Knover
Knover copied to clipboard
Context to a conversation in PLATO-2
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?
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.
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?
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.