Parlai: Grounding knowledge conversation with blender model

Created on 15 Dec 2020  路  7Comments  路  Source: facebookresearch/ParlAI

Hi,

I would like to use the blender model for knowledge-grounded conversation.

The dataset I use has grounding knowledge facts for each dataset entry. So I created the task following the tutorial and added facts as a bot persona in the InteractiveWorld class.

When I run interactive.py script and ask a question related to the current context it seems like the model does not use context information to generate the answer (see the example below).

[context]: tim duncan timothy theodore duncan Enter Your Message: do you love basketball ?
[TransformerGenerator]: i do , i love watching it . it ' s one of my favorite sports . what about you ?
Enter Your Message: me too
[TransformerGenerator]: what ' s your favorite team ? i ' m a big fan of the lakers . they ' re my favorite team .
Enter Your Message: do you know tim duncan ?
[TransformerGenerator]: no , i don ' t know much about him . are you a fan of any other players ?
Enter Your Message: no, i would like to know about tim duncan
[TransformerGenerator]: he ' s a great player . he was one of the best centers in the history of basketball .
Enter Your Message: is he nba champion?
[TransformerGenerator]: no , he is not . he is considered to be the greatest center of all time , though .

Could you please help me what script to change to incorporate grounding knowledge correctly?

Thanks in advance

All 7 comments

BlenderBot isn't trained to incorporate knowledge in context. It was just fine tuned on a dataset that has a lot of factoids, which brings out some knowledge behavior.

If you want to add this, you'll need to do some fine tuning.

Thank you @stephenroller for the quick reply.
Could you recommend the best way to add knowledge to the data for fine tuning BlenderBot?

Now my task dictionary looks like this

{"text": 'i like apples', "knowledge": 'an apple is an edible fruit produced by an apple tree',"labels": 'me too'}

Should I concatenate "knowledge" and "text"?

Yes, concat is the easiest way.

You can look at our wizard of Wikipedia models too, but it gets hairy fast.

@stephenroller Thanks for your answer. I have a question about interactive chat with fine-tuned model: how can I pass the episode grounding knowledge into the the model in interactive mode?

I tried adding facts as the context of conversation using InteractiveWorld in the task. But as far as I have seen during test dialogues information from context is not used in model answers.
Could you please explain how the context is used to generate BlenderBot responses?

Easy hack is just to type it into the input with "n", which gets string replaced to a newline.

Look for get_contexts in the interactive worlds for hints on doing it more programmatically

Ok, one quick question: am I correct that the first element of get_contexts output goes to the human_agent which just prints it, and the second element is fed to the BlenderBot generator model?

Yes, I believe that's correct.

Was this page helpful?
0 / 5 - 0 ratings