Humor Generation and Detection in Code-Mixed H indi- E nglish (2021)

Abstract: Computational humor generation is one of the hardest tasks in natural language generation, especially in code-mixed languages. Existing research has shown that humor generation in English is a promising avenue. However, studies have shown that bilingual speakers often appreciate humor more in code-mixed languages with unexpected transitions and clever word play. In this study, we propose several methods for generating and detecting humor in code-mixed Hindi-English. Of the experimented approaches, an Attention Based Bi-Directional LSTM with converting parts of text on a word2vec embedding gives the best results by generating 74.8% good jokes and IndicBERT used for detecting humor in code-mixed Hindi-English outperforms other humor detection methods with an accuracy of 96.98%.

## introduction humor is one of the most powerful tools of communication capable of transforming negative sentiments and emotions to positive ones @xcite . from the early 1990's, computer science researchers and linguistic scholars have attempted to generate humor using computers giving rise to the field of computational humor generation. however, the task of humor generation has proven to be one of the most difficult tasks in natural language generation due to the lack of fundamental knowledge of how brains perceive and generate humor and its intimate link with the inner workings of the brain @xcite . while the field of computational humor generation is nowhere near saturation, deep learning techniques have shown promising results @xcite . meanwhile, studies have shown that appreciating humor in jokes involves resolution and incongruity-detection, both of which require a strong command over the medium of communication of the joke (ayc ¸ic @xcite . the added element of surprise and clever wordplay by rhyming a logically apt word from another language in a joke adds to its humor @xcite . these studies and observations show that code-mixed joke generation can prove effective in creating humor. code-mixing refers to the insertion of words, phrases, and morphemes of one language into a statement or an expression of another language @xcite . india has around 350 million people that speak code-mixed hindi-english (popularly known as hinglish) (gts, 2019), and according to david crystal, a british linguist at the university of wales, the world's hinglish speakers may soon outnumber native english speakers. this makes hinglish one of the most widely spoken code-mixed languages worldwide. in this paper, we aim to generate and detect humor in code-mixed hindi-english. although a lot of work has been carried out on humor generation and detection in english @xcite @xcite @xcite , and humor detection in code-mixed hindi-english @xcite , humor generation in codemixed languages is relatively unexplored. to the best of our knowledge, we are the first to attempt humor generation in code-mixed languages. the contributions of our work include program called jape (joke analysis and production engine) which was used to generate questionanswer type of puns. it was in 2005 when graeme ritchie introduced various pun generation mechanisms. they divided puns into two major categories of self-contained puns which are portions of text that can be used as humorous objects in a wide variety of situations. their best preconditions to be used are preferred know-how (of the surrounding lifestyle, and so on) and contextually integrated puns which are used with a broader discourse and some more text @xcite . past endeavors using template-based approaches depend on formats and several constraints which intensely compel the quality and variety of generated sentences. most past research is focused towards using layouts which are helpful for generating template based jokes, but they are often rigid. none of the frameworks intended to be innovative as the skeletons of the sentences are fixed. owing to this, over time the quest of joke generation has shifted from template-based approaches to neural networks. various work has been done for pun generation using the lstm approach. the initial model was proposed by @xcite 's current affair jokes generator which was trained on a joke corpus along with news data for current affairs using lstm rnn as architecture and glove as vector representation for training data @xcite . the results however, were not satisfactory. another such attempt was made by using a conditioned neural language model that was trained using general text corpus which was then passed through a decoding algorithm @xcite . though these neural network techniques gave creative outputs, they lacked humor in comparison to template-based approaches which showed fairly good humor despite lacking creativity. in this paper we take a deeper dive into humor generation using neural networks and attempt to generate humor using deep learning models in code-mixed hindi-english. ## proposed methodology the proposed methodology consists of two sections, each covering a major contribution of this paper.