OpenAI の文章生成システムGPT-2が生成した文章、日本語訳付

七度柚希

第1話 GPT-2に「国境の長いトンネルを抜けると雪国であった。」の続きを書かせる

OpenAIが開発した文章自動生成システム。日本語には未対応という事らしいが、 日本語での入力も可能なので無理やりに日本語の文章を生成させてみた。

川端康成の『雪国』の冒頭を試してみた。

『国境の長いトンネルを抜けると雪国であった。』をキーワードにして生成された文章は以下の通り

『聞こえて東京に会うと、今回に続ける地獄の名前としても同時に変更した。これは、それに気を深くつづけに自慢です。この地方、項目が、地獄の名前には今回は同等に働く、それがお山けでも無かったのであった。 地方の順番が』


まったく意味不明だ。まだ日本語未対応で日本語の文章を学習していないので仕方ない結果だ。


『The train came out of the long tunnel into the snow country.』と英文で生成させてみた

『The snow was thick and deep, the roads slippery and snowy. On the far end of the tunnel was the town of Norendor. A small wooden sign in a red window advertised a small café and hotel.


A pair of small houses with one door on each side of the street was next to a small wooden shop with a small sign on the side of the shop that read "Pizza". The shops were all boarded up and the windows had been boarded up, the snow covered shop front still clearly visible. A small building with a sign that read "Clothing Store" was a few yards away on the side of the street.


The train stopped at the end of a street. The train driver and some of the crew members made their way inside, and the small café』


英語ではそこそこもっともらしい文章が生成される。

googleの翻訳で日本語に訳してみた。


『雪は厚く、深く、路面は滑りやすく、雪に覆われていました。 トンネルの遠端には、ノレンドールの町がありました。 赤い窓にある小さな木製看板は、小さなカフェとホテルを宣伝しています。


通りの両側に1つのドアがある小さな家のペアは、「ピザ」と書かれた小さな看板が店の横にある小さな木の店の隣にありました。 店はすべて乗り込み、窓は乗り上げていました。雪で覆われた店の前はまだはっきりと見えていました。 「衣料品店」と書かれた看板のある小さな建物は、通りの脇に数ヤード離れていました。


電車は通りの終わりで止まった。 列車の運転手と乗組員の何人かは中に入り、小さなカフェ』

他にも同じキーワードで生成させてみた。

確かに毎回違う文章が生成される。

『The white snow covered the train with great splotches, and the dark blue sky with the stars above it. And this was the moment of the great war!


The train was covered in snow.


The doors closed as the driver stood at the door of the train. The engine stopped, and then began to turn. The wheels were silent. The conductor stood in the driver's seat, and a man with a gun was standing behind the conductor's seat. He was standing still.


The engine was turning, and it was moving fast. It was a long time before the doors were opened again. Then the train drove into the long tunnel that was snowed in.


The sun was shining on the snow covered ground. In the distance, in a white forest was』


『白い雪は大きな斑点で列車を覆い、その上に星が付いた濃い青空を覆った。 そして、これは大戦の瞬間でした!


電車は雪に覆われていました。


運転手が電車のドアに立ったときにドアが閉まりました。 エンジンが停止し、その後回転し始めました。 車輪は静かでした。 車掌は運転席に立ち、銃を持った男が車掌の後ろに立っていた。 彼はじっと立っていた。


エンジンが回転し、速く動いていました。 ドアが再び開けられるのは長い時間でした。 その後、列車は雪が積もった長いトンネルに入りました。』


日本語は英語とは文法構造がかなり違うので英語版のアルゴリズムをそのまま用いるのは難しい。

日本語版の開発は相当な労力とコストがかかることになるだろう。


  • Twitterで共有
  • Facebookで共有
  • はてなブックマークでブックマーク

作者を応援しよう!

ハートをクリックで、簡単に応援の気持ちを伝えられます。(ログインが必要です)

応援したユーザー

応援すると応援コメントも書けます

新規登録で充実の読書を

マイページ
読書の状況から作品を自動で分類して簡単に管理できる
小説の未読話数がひと目でわかり前回の続きから読める
フォローしたユーザーの活動を追える
通知
小説の更新や作者の新作の情報を受け取れる
閲覧履歴
以前読んだ小説が一覧で見つけやすい
新規ユーザー登録無料

アカウントをお持ちの方はログイン

カクヨムで可能な読書体験をくわしく知る