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}
}