Training ParlAI dialog model on KG dataset.
Hello,
How can we train the model for reasoning over KG (entity <- relationship -> entity) dataset and generate bot responses (dialogs).
Any suggestions or guidance would be highly appreciated.
Thanks!
you can try just training a vanilla dialogue model, assuming there exists a KG dialogue dataset in ParlAI. If there doesn't, first step is to add one!
Thanks for your response.
Can you please provide a sample structure to creating KG dialogue dataset?
Currently, I have KG dataset in the format entity -> RELATION -> entity.
Thanks!
You can take a look at how the Wizard of Wikipedia dataset provides grounded dialogue examples:
parlai dd -t wizard_of_wikipedia:Generator --prepend-gold-knowledge True
.
.
.
- - - NEW EPISODE: WizTeacher - - -
__knowledge__ Science fiction (often shortened to SF or sci-fi) is a genre of speculative fiction, typically dealing with imaginative concepts such as futuristic science and technology, space travel, time travel, faster than light travel, parallel universes, and extraterrestrial life. __endknowledge__
Science fiction
I think science fiction is an amazing genre for anything. Future science, technology, time travel, FTL travel, they're all such interesting concepts.
__knowledge__ Science fiction films have often been used to focus on political or social issues, and to explore philosophical issues like the human condition. __endknowledge__
I'm a huge fan of science fiction myself!
Awesome! I really love how sci-fi storytellers focus on political/social/philosophical issues that would still be around even in the future. Makes them relatable.
__knowledge__ The central premise for these stories oftentimes involves changing history, either intentionally or by accident, and the ways by which altering the past changes the future and creates an altered present or future for the time traveler when they return home. __endknowledge__
I agree. One of my favorite forms of science fiction is anything related to time travel! I find it fascinating.
It's not quite sci-fi, but my favorite version of time travel is in Harry Potter and the Prisoner of Azkaban. Breaks zero logical rules.
__knowledge__ Science fiction often explores the potential consequences of scientific and other innovations, and has been called a "literature of ideas". __endknowledge__
And that's difficult to do when dealing with time travel. I actually haven't seen the latest Harry Potter movies. Guess it's time to check them out!
If you really want a look at the potential negative consequences of scientific innovation, what you should check out is the TV show Fringe. Incredibly well written.
In the above example the dataset shows the grounded knowledge under __knowledge <TEXT> __endknowledge__ tag.
How about incorporation knowledge graph triplets <entity, relation, entity> to generate the response text?
For example:
From the triple facts in the KG,
Adam -> work -> New York
The model should response the input query based on the KG fact,
Input: Where does Adam works?
Output: Adam works in New York.
Is there any model under ParlAI framework that support this kind of functionality..?
Thanks!
With regards to the data format: that's a design decision for you to make
Any generation model within ParlAI can ground on a knowledge sentence. The SeeKeR model, for instance, uses a sequential generation process that ultimately conditions on a knowledge sentence within the context. Perhaps look into that.