Story Ending Generation with Incremental Encoding and Commonsense Knowledge
Introduction
Generating a reasonable ending for a given story context, i.e., story ending generation, is a strong indication of story comprehension. This task requires not only to understand the context clues which play an important role in planning the plot, but also to handle implicit knowledge to make a reasonable, coherent story. In this paper, we devise a novel model for story ending generation. The model adopts an incremental encoding scheme to represent context clues which are spanning in the story context. In addition, commonsense knowledge is applied through multi-source attention to facilitate story comprehension, and thus to help generate coherent and reasonable endings. Through building context clues and using implicit knowledge, the model is able to produce reasonable story endings.
This project is a tensorflow implementation of our work.
Dependencies
Python 2.7
Numpy 1.14.5
Tensorflow 1.0.1
Pattern 2.6
Quick Start
Dataset
Our dataset contains five-sentence stories from ROCStories corpus (Note that we just split the training data of the original corpus into the new training and testing set) and corresponding commonsense knowledge graphs retrieved from ConceptNet. And only those relations occurring in the dataset is retained.
Please download the pre-trained word vectors Glove to data directory. And in our experiments glove.6B.200d.txt (dimension of word embedding is 200) is adopted.
Train
Test
You can test the model using this command. You may set the directory of test set with inference_path and the checkpoint to be used with inference_version. The generation result will be output to the 'xxx/output_yyy.txt' file.
Details
Training
You can change the model parameters using:
Paper
Jian Guan*, Yansen Wang*, Minlie Huang. Story Ending Generation with Incremental Encoding and Commonsense Knowledge. In AAAI, Honolulu, USA Preprint paper
Concat info : [email protected]
Main Results
Note that there is something wrong with bleu-2 in the result reported in the paper. 