Code-Switching Patterns Can Be an Effective Route to Improve Performance of Downstream NLP Applications: A Case Study of Humour, Sarcasm and Hate Speech Detection (2020)

Abstract: In this paper, we demonstrate how code-switching patterns can be utilised to improve various downstream NLP applications. In particular, we encode various switching features to improve humour, sarcasm and hate speech detection tasks. We believe that this simple linguistic observation can also be potentially helpful in improving other similar NLP applications.

## introduction code-mixing/switching in social media has become commonplace. over the past few years, the nlp research community has in fact started to vigorously investigate various properties of such codeswitched posts to build downstream applications. the author in @xcite demonstrated that inter-sentential switching is preferred more than intra-sentential switching by facebook users. further while 45% of the switching was done for real lexical needs, 40% was for discussing a particular topic and 5% for content classification. in another study @xcite interviewed hindi-english bilingual students and reported that 67% of the words were in hindi and 33% in english. recently, many down stream applications have been designed for code-mixed text. @xcite attempted to construct a normalisation dictionary offline using the distributional similarity of tokens plus their string edit distance. @xcite developed a pos tagging framework for hindi-english data. more nuanced applications like humour detection @xcite , sarcasm detection @xcite and hate speech detection @xcite have been targeted for code-switched data in the last two to three years. ## dataset we consider three datasets consisting of hindi (hi) -english (en) code-mixed tweets scraped from twitter for our experiments -humour, sarcasm and hate. we discuss the details of each of these datasets below. humour: humour dataset was released by @xcite and has hindi-english codemixed tweets from domains like 'sports', 'politics', 'entertainment' etc. the dataset has uniform distribution of tweets in each category to yield better supervised classification results (see sarcasm: sarcasm dataset released by @xcite ) contains tweets that have hashtags #sarcasm and #irony. authors used other keywords such as 'bollywood', 'cricket' and 'politics' to collect sarcastic tweets from these domains. in this case, the dataset is heavily unbalanced (see hate speech: @xcite created the corpus using the tweets posted online in the last five years which have a good propensity to contain hate speech (see ## switching features in this section, we outline the key contribution of this work. in particular, we identify how patterns of switching correlate with the tweet text being humorous, sarcastic or hateful. we outline a synopsis of our investigation below. ## results we compare the baseline models along with (i) the baseline + switching feature-based models and (ii) the han models. we use macro-f1 score for comparison all through. the main results are summarized in similarly, hate being negatively correlated with switching, a tweet with no switching -shilpa hi ji hi aap hi ravidubey hi jaise hi tuchho hi ko hi jawab hi mat hi dijiye hi ye hi log hi aap hi ke hi sath hi kabhi hi nahi hi was labeled as non-hateful by the baseline, was detected as hateful by our methods (bf and hf). ## conclusion in this paper, we identified how switching patterns can be effective in improving three different nlp applications. we present a set of nine features that improve upon the state-of-the-art baselines. in addition, we exploit the modern deep learning machinery to improve the performance further. finally, this model can be improved further by pumping the switching features in the final layer of the deep network. in future, we would like to extend this work for other language pairs. for instance, we have seen examples of such switching in english-spanish 10 and english-telugu 11 pairs also. further we plan to investigate other nlp applications that can benefit from the simple linguistic features introduced here. 10 don't forget humourstart la toalla cuando go to le playa humour end ; gloss: don't forget the towel when you go to the beach. 11 votes kosam quality leni liquor bottles supply chesina politicians sarcasmstart ee roju quality gurinchi matladuthunnaru sarcasm end ; gloss:politicians who supplied low quality liquor bottles for votes are talking about quality today.