Knover icon indicating copy to clipboard operation
Knover copied to clipboard

Context to a conversation in PLATO-2

Open bakszero opened this issue 4 years ago • 3 comments

Is it possible to give a context to the conversation, so that the setting description/persona can be given to the pretrained models beforehand?

If not, is there a possibility of incorporating something like this with the pretrained models?

bakszero avatar Aug 12 '20 14:08 bakszero

This is a good question. Currently, our pre-trained PLATO-2 model is fine-tuned on Knowledge Grounded Dialogues. It is OK to put some persona and other knowledge backgrounds in the context during the inference process to make the model respond according to a certain persona/knowledge ground.

WorldEditors avatar Aug 13 '20 07:08 WorldEditors

Great, thanks for your response!

Could you please let me know where should I make the changes in the scripts/code to enable some persona and knowledge backgrounds during inference?

bakszero avatar Aug 13 '20 08:08 bakszero

You can change the data format in interaction.py: https://github.com/PaddlePaddle/Knover/blob/15d5279a4370b225b0c388a129b774c9469fcde4/interaction.py#L69 For example:

personas = ["your persona: i have three cats."] 
example = Example(src=" [SEP] ".join(personas + context), data_id=0)

You can specify the personas as you need.

sserdoubleh avatar Aug 13 '20 08:08 sserdoubleh