facebookresearch / ParlAI

A framework for training and evaluating AI models on a variety of openly available dialogue datasets.
https://parl.ai
MIT License
10.49k stars 2.1k forks source link

Integrating SearchServer, Persona to blended_skill_talk #4939

Closed benihime91 closed 1 year ago

benihime91 commented 1 year ago

Hi, I want to create a open-domain chatbot something similar to blended_skill_talk task. I want to have the following features -

  1. Ability for the model to access internet to query and fetch latest information on questions like (Who is president of India?)

    image

    So for these kinds of questions the model should query the internet and fetch the answer.

  2. Ability to add custom persona to the model so that I can controal to a degree how the models responds. (For example I want my chatbot to always respond in a positive manner & it should always initiate conversation)

  3. I want the chatbot to recall information that I tell it. For now the model cannot recall (screenshot attached)

    image

    to reproduce -

$python parlai/scripts/safe_interactive.py -t blended_skill_talk -mf zoo:blender/blender_90M/model --include-initial-utterances True --include-personas True

Could point me towards how I could go about tacklinng these issues ? Thanks.

mojtaba-komeili commented 1 year ago

You are using BlenderBot 1 here, which doesn't have all those things that you asked for. Try BlenderBot 2, or 3. They match what you need better.

klshuster commented 1 year ago

Indeed, both blenderbot 2 and blenderbot 3 handle what you've described

benihime91 commented 1 year ago

I went through the bb2 and bb3. I have seen that internet search and memory recall can be integrated in bb3 via https://github.com/facebookresearch/ParlAI/tree/main/projects/bb3/agents . But I could not find the appropriate documentation for the same features for bb2 and bb1.

So, am i right to assume that :

If no can you please point me to the appropriate documentation

benihime91 commented 1 year ago

Hi I tried using bb2, but still facing the same problem of the model not being able to recall information (screenshot attached below). Instead it's giving erratic answers 😄

To reproduce

$ python -m parlai.scripts.safe_interactive --task convai2 -mf zoo:blenderbot2/blenderbot2_400M/model --search-server None --knowledge-access-method memory_only --inference topk --beam-min-length 15 --beam-length-penalty 1.2 --loglevel debug
image

another example -

$ python -m parlai.scripts.safe_interactive -mf zoo:blenderbot2/blenderbot2_400M/model -t blended_skill_talk --loglevel debug --search-server never
image
mojtaba-komeili commented 1 year ago

To answer your old question, that you figured out at this point, BB2 has long term memory and uses external (eg internet) search. But BB1 does not. And about your last question, having the capability of memory access and internet search does not guarantee that these models utilize them efficiently. This is in fact an existing challenge for the chatbots.

benihime91 commented 1 year ago

Thanks for the clarification.