Skip to content
Code for "A Skeleton-Based Model for Promoting Coherence Among Sentences in Narrative Story Generation" (EMNLP 2018)
Branch: master
Clone or download
Latest commit fdfb00a Aug 21, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
data upload codes Aug 18, 2018
README.md upload codes Aug 18, 2018
__init__.py upload code Aug 16, 2018
batcher.py
calculate_relevance_BLEU.py upload code Aug 16, 2018
data.py upload code Aug 16, 2018
decode.py
generate_sc_sample.py
generated_sample.py
generated_srl_sample.py
generator_whole.py
inspect_checkpoint.py
model.py
result_evaluate.py
run_summarization.py
run_test.sh upload codes Aug 18, 2018
run_train.sh upload codes Aug 18, 2018
sc_batch.py
sc_model.py upload code Aug 16, 2018
srl_seq_batch.py
srl_seq_model.py
util.py

README.md

Skeleton-Based-Generation-Model

The Code for "A Skeleton-Based Model for Promoting Coherence Among Sentences in Narrative Story Generation"

Requirements

  • ubuntu 16.04
  • python 3.5
  • tensorflow 1.4.1
  • nltk 3.2.5

Data Source

The Processed Data

  • Compression dataset: Since the original dataset is too large, we only use a subset of this dataset. The processed data can be found at data/trainfeature02.json, data/testfeature02.json, data/validfeature02.json.

  • Storytelling dataset: The dataset is listed at data/story/train_process.txt, data/story/valid_process.txt, data/story/test_process.txt.

Method Details

  1. First, we pre-train a sentence compression module.
  2. Second, we use the pre-trained compression module to extract skeletons for storytelling dataset. The feature files for extracting skeleton are listed at data/story/train_sc.txt, data/story/valid_sc.txt, data/story/test_sc.txt. The extracted skeleton files are listed at data/0/train_skeleton.txt, data/0/valid_skeleton.txt, data/0/test_skeleton.txt.
  3. Third, we use the extracted skeletons to train the input-to-skeleton module and the skeleton-to-sentence module.
  4. Finally, we connect all modules by reinforcement learning.

Run

CUDA_VISIBLE_DEVICES=2 nohup bash run_train.sh > log_train.txt &
CUDA_VISIBLE_DEVICES=2 nohup bash run_test.sh > log_test.txt &

Cite

To use this code, please cite the following paper:

Jingjing Xu, Yi Zhang, Qi Zeng, Xuancheng Ren, Xiaoyan Cai, Xu Sun. A Skeleton-Based Model for Promoting Coherence Among Sentences in Narrative Story Generation. EMNLP 2018.

bibtext:

@inproceedings{Skeleton-Based-Generation-Model,
  author    = {Jingjing Xu and Yi Zhang and Qi Zeng and Xuancheng Ren and Xiaoyan Cai and Xu Sun},
  title     = {A Skeleton-Based Model for Promoting Coherence Among Sentences in Narrative Story Generation},
  booktitle = {EMNLP},
  year      = {2018}
}
You can’t perform that action at this time.