Code and Datasets from the paper, "Can Humor Prediction Datasets be used for Humor Generation? Humorous Headline Generation via Style Transfer" by Orion Weller, Nancy Fulda, and Kevin Seppi.
For related projects, see our work on Humor Detection (separating the humorous jokes from the non-humorous) or our collection of 500k+ jokes.
** We do not endorse these jokes. Please view at your own risk **
Data files are located in data/*.csv
and are from the HumicroEdit Dataset. The script to reproduce the dataset files is create_sentences.py
. The neural translation model is in transformer.py
while the random model comes from the random_translate.py
file.
- Run
pip3 install -r requirements.txt
andpython -m spacy download en
to install the correct packages
- Run
python3 translate.py
to start producing translations. If you want to enter in your own sentences interactively after each epoch, usepython3 translate.py --interactive
- Run
python3 translate.py -all -e -s
to generate a file with outputs - Run
python3 clean_and_ready_eval.py
to add in the Random model and clean up puncuation, etc.
I've included four pre-trained models at various epochs (30, 60, 90, 120). If you'd like to just play with a model, feel free to use one of them (found in the models/{epoch_num}-{timestamp}-model.pt
).
If you found this repository helpful, please cite the following paper:
@inproceedings{weller2020can,
title={Can Humor Prediction Datasets be used for Humor Generation? Humorous Headline Generation via Style Transfer},
author={Weller, Orion and Fulda, Nancy and Seppi, Kevin},
booktitle={Proceedings of the Second Workshop on Figurative Language Processing},
pages={186--191},
year={2020}
}