Bridging Laughter Across Languages: Generation of Hindi-English Code-mixed Puns
Summary
The authors are the first to tackle the automatic generation of puns in code-mixed Hindi-English speech. The joke in such a pun rests on a word in one language sounding almost like a word in the other. First, the researchers collected 500 "Hindi word — English word" pairs that sound similar but differ in meaning. To do this, words from the Leipzig news corpora were converted to IPA using epitran, and the English transcription was adapted to Indian pronunciation. Pairs were compared with a modified Levenshtein distance, and cognates were filtered out manually. Next, GPT-4o in a few-shot setting generates sentences using three schemes: with a context word, in a question-answer format, and with subject masking. After generation, the English word is replaced with its Hindi counterpart. All three schemes clearly outperform direct prompting. On this basis, the authors compiled the HECoP dataset with human ratings and used it to evaluate the XLM-R and mBERT classifiers. The authors also built a pipeline that creates a pun from a single input word. The work shows how phonetic matching can be combined with LLMs to generate humor for low-resource code-mixed language pairs.
Key points
- If GPT-4o is simply asked to compose a pun, only 19.8% of the outputs are successful. The proposed schemes reach 38.8%, 62.6% and 43%.
- Word pairs were selected on the condition that the distance between their IPA forms is at most 1. Insertions and deletions have infinite cost, so only words with the same number of phonemes are compared. Substitutions of allophones, of long and short vowel pairs, and of voiced and voiceless consonant pairs cost 0.
- HECoP contains 2000 model-generated sentences. For each one, annotators determined whether it is a pun and rated how funny and how natural it is. Several multilingual pun detection models, including XLM-R and mBERT, were compared on the dataset.
- The "single-word" pipeline works in three steps: phonetic search for a pair, scoring of pair compatibility with a regression network (hidden layers of 512 and 256, with POS among the features), and selection of the best sentence by XLM-R confidence. In a human comparison on 50 examples, it beat the baseline model in 67.65% of cases. The mean funniness score was 1.79 versus 0.91 on a scale of up to 5.
- The code and data are available on GitHub: Likhith-Asapu/Codemix-Pun-Generation.
Cite
@inproceedings{asapu2025bridging,
title = {{Bridging Laughter Across Languages: Generation of Hindi-English Code-mixed Puns}},
author = {Asapu, Likhith and Kodali, Prashant and Dua, Ashna and Kavitha, Kapil Rajesh and Shrivastava, Manish},
booktitle = {Proceedings of the 1st Workshop on Computational Humor (CHum)},
year = {2025},
url = {https://aclanthology.org/2025.chum-1.5/}
}References
- Try Agustini and Ruli Manurung. 2012. Automatic evaluation of punning riddle template extraction. In (LREC’12), pages 759–765, Istanbul, Turkey. European Language Resources Association (ELRA). find
- Simran Khanuja, Sandipan Dandapat, Anirudh Srinivasan, Sunayana Sitaram, and Monojit Choudhury. 2020. GLUECoS: An evaluation benchmark for code-switched NLP. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 3575–3585, Online. Association for Computati… find
- Marina Borisovna Grolman, Zubayda Albertovna, Bik-tagirova, Olimjon Habibovich, and Kasimov. 2021. Phonetic peculiarities of the english language in india. find
- Prashant Kodali, Anmol Goel, Likhith Asapu, Vamshi Krishna Bonagiri, Anirudh Govil, Monojit Choudhury, Manish Shrivastava, and Ponnurangam Kumaraguru. 2024. From human judgements to predictive models: Unravelling acceptability in code-mixed sentences. Preprint, arXiv:2405.05572. find
- Deepak Gupta, Asif Ekbal, and Pushpak Bhattacharyya. 2020. A semi-supervised approach to generate the code-mixed text using pre-trained encoder and transfer learning. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 2267–2280, Online. Association for Computational Ling… find
- Jan Korák. 2011. Word play in advertising: A linguistic analysis. find
- Deepak Gupta, Pabitra Lenka, Asif Ekbal, and Pushpak Bhattacharyya. 2018. Uncovering code-mixed challenges: A framework for linguistically driven question generation and neural based question answering. In Proceedings of the 22nd Conference on Computational Natural Language Learning, pages 119–130,… find
- Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. 2020. BART: Denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension. In Proceedings of the 58th Annual Meeting of the… find our card
- He He, Nanyun Peng, and Percy Liang. 2019a. Pun generation with surprise. In North American Chapter of the Association for Computational Linguistics. find
- Yinhan Liu, Jiatao Gu, Naman Goyal, Xian Li, Sergey Edunov, Marjan Ghazvininejad, Mike Lewis, and Luke Zettlemoyer. 2020. Multilingual denoising pre-training for neural machine translation. Transactions of the Association for Computational Linguistics, 8:726–742. find
- He He, Nanyun Peng, and Percy Liang. 2019b. Pun generation with surprise. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 1734–1744, Minneapolis, Minnesota. Asso… find
- Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. 2019. Roberta: A robustly optimized bert pretraining approach. Preprint, arXiv:1907.11692. find
- Bryan Anthony Hong and Ethel Ong. 2008. Generating punning riddles from examples. 2008 Second International Symposium on Universal Communication, pages 347–352. find
- Fuli Luo, Shunyao Li, Pengcheng Yang, Lei Li, Baobao Chang, Zhifang Sui, and Xu Sun. 2019. Pun-gan: Generative adversarial network for pun generation. In Conference on Empirical Methods in Natural Language Processing. find
- Aaron Jaech, Rik Koncel-Kedziorski, and Mari Ostendorf. 2016. Phonological pun-derstanding. pages 654–663. find
- Tristan Miller, Christian Hempelmann, and Iryna Gurevych. 2017. SemEval-2017 task 7: Detection and interpretation of English puns. In Proceedings of the 11th International Workshop on Semantic Evaluation (SemEval-2017), pages 58–68, Vancouver, Canada. Association for Computational Linguistics. find
- Shelly Jain, Aditya Yadavalli, Ganesh Mirishkar, Chi-ranjeevi Yarra, and Anil Kumar Vuppala. 2021. IE-CPS lexicon: An automatic speech recognition oriented Indian-English pronunciation dictionary. In Proceedings of the 18th International Conference on Natural Language Processing (ICON), pages 195–20… find
- Anirudh Mittal, Yufei Tian, and Nanyun Peng. 2022. AmbiPun: Generating humorous puns with ambiguous context. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 1053–1062, Seattle, United States. Ass… find
- Divyanshu Kakwani, Anoop Kunchukuttan, Satish Golla, Gokul N.C., Avik Bhattacharyya, Mitesh M. Khapra, and Pratyush Kumar. 2020. IndicNLP-Suite: Monolingual corpora, evaluation benchmarks and pre-trained multilingual language models for Indian languages. In Findings of the Association for Computatio… find
- David R. Mortensen, Siddharth Dalmia, and Patrick Littell. 2018. Epitran: Precision G2P for many languages. In Proceedings of the Eleventh International Conference on Language Resources and Evaluation (LREC 2018), Miyazaki, Japan. European Language Resources Association (ELRA). find our card
- Zhiwei Yu, Jiwei Tan, and Xiaojun Wan. 2018. A neural approach to pun generation. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1650–1660, Melbourne, Australia. Association for Computational Linguistics. find
- Ravindra Nayak and Raviraj Joshi. 2022a. L3cube-hingcorpus and hingbert: A code mixed hindi-english dataset and bert language models. Preprint, arXiv:2204.08398. find
- Jingjie Zeng, Liang Yang, Jiahao Kang, Yufeng Diao, Zhihao Yang, and Hongfei Lin. 2024. barking up the right tree, a gan-based pun generation model through semantic pruning. In International Conference on Language Resources and Evaluation. find
- Ravindra Nayak and Raviraj Joshi. 2022b. L3cube-hingcorpus and hingbert: A code mixed hindi-english dataset and bert language models. ArXiv, abs/2204.08398. find
- Yichao Zhou, Jyun-Yu Jiang, Jieyu Zhao, Kai-Wei Chang, and Wei Wang. 2020. “the boating store had its best sail ever”: Pronunciation-attentive contextualized pun recognition. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 813–822, Online. Associatio… find
- Slav Petrov, Dipanjan Das, and Ryan T. McDonald. 2011. A universal part-of-speech tagset. ArXiv, abs/1104.2086. find
- Dafna Shahaf, Eric Horvitz, and Robert Mankoff. 2015. Inside jokes: Identifying humorous cartoon captions. Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining. find
- L. Shanaieva-Tsymbal. 2021. A persuasive force of puns in british advertising. Mìnarodnij fìlologìnij asopis. find
- Jiao Sun, Anjali Narayan-Chen, Shereen Oraby, Shuyang Gao, Tagyoung Chung, Jing huan Huang, Yang Liu, and Nanyun Peng. 2022. Context-situated pun generation. ArXiv, abs/2210.13522. find
- Yufei Tian, Divyanshu Sheth, and Nanyun Peng. 2022. A unified framework for pun generation with humor principles. In Findings of the Association for Computational Linguistics: EMNLP 2022, pages 3253–3261, Abu Dhabi, United Arab Emirates. Association for Computational Linguistics. find
- Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro, Faisal Azhar, Aurelien Rodriguez, Armand Joulin, Edouard Grave, and Guillaume Lample. 2023. Llama: Open and efficient foundation language models. Preprint… find
- María José García Viscaíno. 2011. Humor in code-mixed airline advertising. Pragmatics, 21:145–170. find
- Aya Williams, Mahesh Srinivasan, Chang Liu, Pearl Lee, and Qing Zhou. 2019. Why do bilinguals code-switch when emotional? insights from immigrant parent-child interactions. Emotion, 20(5):830–841. find
- Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pier-ric Cistac, Tim Rault, Rémi Louf, Morgan Funtow-icz, Joe Davison, Sam Shleifer, Patrick von Platen, Clara Ma, Yacine Jernite, Julien Plu, Canwen Xu, Teven Le Scao, Sylvain Gugger, Mariama Drame, Quentin Lh… find our card
This page in Markdown → https://md.research.elamur.ai/free/papers/asapu-2025-bridging-laughter-across-languages-generation/