The task here is to given a knowledge base of the WikiMovie we create a KnowledgeGraph. The KnowledgeGraph is used to do QA.
The KnowledgeBase sample stored in 'wiki_entities_kb.txt' are as follows:
Kismet directed_by William Dieterle
Kismet written_by Edward Knoblock
Kismet starred_actors Marlene Dietrich, Edward Arnold, Ronald Colman, James Craig
Kismet release_year 1944
Kismet in_language English
Kismet has_tags bd-r
Kismet has_plot Hafiz, a rascally beggar on the periphery of the court of Baghdad, schemes to marry his daughter to royalty and to win the heart of the queen of the castle himself.
KnowledgeGraph is created using 'networkx'. Networkx provide a good visualisation of the KnowledgeGraph. DirectedGraph is used to preserve capture the proper relation. Information is stored in triplet form (subject, relation, object)
Case 1 :
< question_word > < attribute > < Name >
Example: who directed the movie Kismet ?
Case 2 :
< question_word > < Name > < attribute >
Example: when was Kismet released?
Case3 :
< Name > < attribute > < question_word >
Example: Kismet directed by whom?
Question: what movies did Temuera Morrison act in ?
Answer:
Tracker
Once Were Warriors
River Queen
Python version: 3 and above
Install the following Python Libraries:
- Networkx :
pip install networkx
- nltk:
pip install nltk
- sklearn:
pip install sklearn
KnowledgeBase is taken from WikiMovies
WikiMovies : https://arxiv.org/abs/1611.09823
For more information feel free to contact :
Rohit Mishra: rohitpro129@gmail.com , phc2014002@iiita.ac.in
Soham Dwivedi: sohamdwivedi2012@gmail.com