Create the environment with conda and pip.
conda env create -f environment.yml
conda activate season
pip install -r requirements.txt
Install nltk "punkt" package.
python -c "import nltk; nltk.download('punkt');"
We've tested this environment with python 3.8 and cuda 10.2. (For other CUDA version, please install the corresponding packages)
Run the following commands to download the CNN/DM dataset, preprocess it, and save it locally.
mkdir data
- For ELIFE dataset
python preprocess.py --dataset elife
- For PLOS dataset
python preprocess.py --dataset elife
Please run the scripts below:
bash run_train.sh
The trained model parameters and training logs are saved in outputs/train
folder.
You can use our trained model weights to generate summaries for your data.
mkdir checkpoints
cd checkpoints
Step 2. Generate summaries for CNN/DM Test set.
bash run_inference.sh
After running the script, you will get the results in outputs/inference
folder including the predicted summaries in generated_predictions.txt
and the ROUGE results in predict_results.json
.
- We thank the authors of Season their open-source codes.