This is one of the common type of Question Answering problem over Natural Language. A previously known Movie Summaries is taken as the knowledge base to answer the queries pertaining to the same.
For Ex: Given the summary of Batman Movie, queries could be:
"Hero in the movie is afraid of bats and through intense training from Ras Al Gul, he conquers his fear and evolves as a super hero."
The approach to this problem is to treat it as text classification while retaining the semantic features from the summaries and queries. A combination of Neural Networks is used to acheive the same:
- A Convolution Neural Network on sentences of the Summaries to obtain the features with their spatial significance.
- A Fully connected NN to obtain the features of "Actions" in the query.
- A Fully connected NN to obtain the featueres of "NERs" in the query.
- A Fully connected NN to obtain the featueres of sentence embedding.
The features obtained are concatenated and passed through another CNN and finally to output layer, which predicts the probability of each movie that a query might belong to.
To successuflly run the project, the following deps are requried:
- Keras
- Numpy
- pickle
- Sent2Vec
- sent2vec_wiki_bigrams
- NLTK
- neuralcoref
- Pandas
- pyjnius
- k-parser
- The jars (Event Extractor, NER Extractor) provided with the project
All the above libraries are required to proceed to launch the project. Once everything is installed, follow:
This is required for the 2, 3 Neural Networks from the "Approach". The jar files provided extract the events and ners for a given sentence.
- Setup k-parser as per its documentation.
- Place the provided jars in a directory.
- Open the config.py and change the respective paths (use full path).
Note: Events and NERs for the summaries have been generated already and they are used for training. If required to generate events/ners for new data, please be noted that it make take several minutes.
Once the sent2vec is installed, you are required to download the 16gb wiki_bigrams file and place it in the project root folder.
- Run sentiment_cnn.py to train the above discussed network. This would generate model and its params.
- Run predict.py to predict on the queries in the ./data/test.txt file.