This repository contains the code for the paper "Bridging Laughter Across Languages: Generation of Hindi-English Code-mixed Puns" accepted at the 1st Workshop on Computational Humor (CHum 2025) at COLING 2025. The paper can be found here.
- Python 3.11
- PyTorch 2.2.1
- Transformers 4.45.1
- NLTK 3.8.1
- Pandas 2.0.3
- Numpy 1.25.2
- Scikit-learn 1.4.1
- Huggingface Datasets 2.14.3
The dataset used in the paper can be found in folder classification/Data/labels.json
. The dataset is in the format of a json file with the following columns:
id
: Unique identifier for each data pointtext
: Code-mixed textlabel
: 1 if the text is a pun, 0 otherwise
The code for the four methods for generating puns proposed in the paper can be found in the following folders:
baseline
: Contains the code for the baseline pun generation modelcontextually_aligned
: Contains the code for the contextually aligned pun generation modelquestion_answer
: Contains the code for the question-answer based pun generation modelsubject_masked
: Contains the code for the subject masked pun generation model
The code for the automated pipeline for generating puns can be found in the folder automated_pipeline
. The pipeline generates word pairs and then creates puns using the three methods proposed in the paper on these word pairs. It then evaluates the generated puns using the classification model.
If you use this code for your research, please cite the paper as follows:
@inproceedings{asapu2025generatingpuns,
title={Generating Code-Mixed Puns},
author={Likhith Asapu, Prashant Kodali, Ashna Dua, Kapil Rajesh Kavitha and Manish Shrivastava},
booktitle={Proceedings of the 1st Workshop on Computational Humor (CHum 2025) at COLING 2025},
year={2025}
}