2
3

More than 5 years have passed since last update.

ボッチだからPCと喋ってあそぶ。 ParlAI Light。

Last updated at Posted at 2019-06-30

雑談できるチャットボットを調べていたら ParlAI Light なるものを見つけた。

Learning in Interactive Games with Humans and Text

とあるように、テキストゲームするらしい。テキストゲームなんてやったことないけど楽しそう。

上手くいった会話がこんな感じ。

Enter Your Message: Excuse me?
[BiEncoderRanker]: You don't address your cardinal that way
Enter Your Message: What is the cardinal?
[BiEncoderRanker]: The prince of the kingdom
Enter Your Message: I go to the cardinal.
[BiEncoderRanker]: You don't address your cardinal that way
Enter Your Message: Who are you>
[BiEncoderRanker]: I am the spokesperson of God and my commands are his will
Enter Your Message: Tell me What do I?
[BiEncoderRanker]: The Lord is our Holy Saviour and He is the one who created Life on this Planet
Enter Your Message: Planet?
[BiEncoderRanker]: Why he is the almighty creator. He gave you that very ability.
Enter Your Message: exit from here
[BiEncoderRanker]: I will watch over you, as I do the entire kingdom, as you move the rocks to enter the Temple.

環境

  • Corabolatory
  • 時間
    • 1時間は待つ余裕がほしい

コード

%pip install pytorch-pretrained-bert
!git clone https://github.com/facebookresearch/ParlAI.git
%cd ParlAI/
%run setup.py develop
%run ./examples/interactive.py -t light_dialog -mf models:light/biranker_dialogue/model

DLに時間がかかりますが、実行に成功するとユーザー入力を受け付けてくれます。
上手くいかないときは、個別に実行してみてください。

感想とか

上手くいかないと3回くらいで会話が進まなくなります。上記の例みたいに上手くいってると、ゲームしてる感じ出ます。(うまく会話できないのは、ゲーム下手なだけかもしれません。。。)
相手の会話内容について触れるようにするとそこそこに会話できます。逆に、それ以外は上手く会話できませんでした。なんかコマンドがあって、それに沿って行動するとか、お決まりがあるのかも。
相手の会話が変だったり理解できなかったりする。世界観を自前で想像しろってことかもしれない。

これを使ってゲームしようとか考えるならば、エンディングはどうするとか、会話相手は誰とか、ルールとかが必要そう。そういったものが学習できるのか?

公式のexampleは学習のみなので注意。ParlAIに関する日本語資料が少ない。公式のドキュメントも難解に感じる。

詳しい内容は (ParlAI Light](https://parl.ai/projects/light/) にある論文 Urbanek et al., 2019.を参照か?。少しずつ理解できればいいな。

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3