scratchplot story generation
1.0.0
该存储库包含来自预训练的语言模型的绘图编写代码,这些代码出现在INLG 2022中。本文引入了一种方法,以提示PLM构成内容计划。然后,我们生成故事的身体并以内容计划结束。此外,我们通过使用其他PLM来对生成的(故事,结尾)对进行排名。
此存储库在很大程度上依赖于Dino。由于我们进行了一些较小的更改,因此我们包括完整的代码以易于使用。
包括位置,演员,流派和主题。
sh run_plot_static_gpu.sh
内容计划元素是一次生成并存储的。在生成故事时,系统从离线生成的情节元素中采样。
sh run_plot_dynamic_gpu_single.sh
sh run_plot_dynamic_gpu_batch.sh
--no_cuda
到所有称为dino.py
的命令。需要python3。在Python 3.6和3.8上测试。
pip3 install -r requirements.txt
import nltk
nltk . download ( 'punkt' )
nltk . download ( 'stopwords' )
如果您使用此存储库中的代码,请引用以下论文:
@inproceedings{jin-le-2022-plot,
title = "Plot Writing From Pre-Trained Language Models",
author = "Jin, Yiping and Kadam, Vishakha and Wanvarie, Dittaya",
booktitle = "Proceedings of the 15th International Natural Language Generation conference",
year = "2022",
address = "Maine, USA",
publisher = "Association for Computational Linguistics"
}
如果您将Dino用于其他任务,请引用以下论文:
@article{schick2020generating,
title={Generating Datasets with Pretrained Language Models},
author={Timo Schick and Hinrich Schütze},
journal={Computing Research Repository},
volume={arXiv:2104.07540},
url={https://arxiv.org/abs/2104.07540},
year={2021}
}