---
title: "Code-Switching Patterns Can Be an Effective — Bansal 2020"
description: "Hindi-English code-mixed tweets are common on social media."
authors: ["Srijan Bansal", "Vishal Garimella", "Ayush Suhane", "Jasabanta Patro", "Animesh Mukherjee"]
year: 2020
venue: "Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics"
source: "https://aclanthology.org/2020.acl-main.96/"
doi: "10.18653/v1/2020.acl-main.96"
arxiv: "2005.02295"
licence: "CC BY 4.0 (ACL Anthology)"
licence_url: "https://creativecommons.org/licenses/by/4.0/"
summary_licence: "Elamur Cosmic License"
canonical: "https://research.elamur.ai/free/papers/bansal-2020-code-switching-patterns-can-be/"
---
[Elamur Research](https://md.research.elamur.ai/) · [this page in HTML](https://research.elamur.ai/free/papers/bansal-2020-code-switching-patterns-can-be/)

[home](https://md.research.elamur.ai/) / [papers](https://md.research.elamur.ai/free/papers/) / [2020](https://md.research.elamur.ai/free/papers/2020/) / 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

# 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

**Authors:** [Srijan Bansal](https://md.research.elamur.ai/free/authors/srijan-bansal/), Vishal Garimella, Ayush Suhane, [Jasabanta Patro](https://md.research.elamur.ai/free/authors/jasabanta-patro/), [Animesh Mukherjee](https://md.research.elamur.ai/free/authors/animesh-mukherjee/) · **Year:** 2020 · **Venue:** Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics · **Licence:** [CC BY 4.0 (ACL Anthology)](https://creativecommons.org/licenses/by/4.0/)

**Links:** [Publisher's page](https://aclanthology.org/2020.acl-main.96/) · [PDF](https://aclanthology.org/2020.acl-main.96.pdf) · [DOI 10.18653/v1/2020.acl-main.96](https://doi.org/10.18653/v1/2020.acl-main.96) · [arXiv 2005.02295](https://arxiv.org/abs/2005.02295) · [OpenAlex](https://openalex.org/W3022021376)

**Citations:** 18 citations (openalex-snapshot · 2026-10-14) · [9](#cited-by) in our library, of the 140673 papers whose bibliographies we read

## Summary
Hindi-English code-mixed tweets are common on social media. Linguists have suggested that the act of switching languages can itself carry meaning, for example as a vehicle for jokes. Bansal et al. test whether switching patterns help classifiers detect humour, sarcasm and hate speech in such tweets. They use three existing Twitter corpora: Humour (Khandelwal et al., 2018), Sarcasm (Swami et al., 2018) and Hate (Bohra et al., 2018). The authors language-tagged the Hate corpus themselves. Statistical analysis shows that switching is associated positively with humour but negatively with sarcasm and hate. The authors encode this signal as nine simple features, such as switch counts, language fractions and run-length statistics. They add these features first to the original machine-learning baselines and then to a Hierarchical Attention Network (HAN), where the features join the final fully connected layer. Switching features improved macro-F1 for every model on all three tasks. The best variant, HAN plus features, reached relative gains of up to 17.7% over the baselines. The study suggests that cheap, linguistically motivated cues can strengthen classifiers for mixed-language text.

## Key points
- **Data:** All three datasets are Hindi-English code-mixed tweets:
  - Humour: 3,453 tweets, 1,755 positive.
  - Sarcasm: 5,250 tweets, only 504 positive.
  - Hate: 4,575 tweets, 1,661 positive.
- **Hate corpus tagging:** Two authors added word-level language tags independently and agreed on 98.1% of tokens.
- **Correlation with switching:** The Pearson correlation between a label and the presence of an English word in Hindi context was +0.04 for humour, −0.17 for sarcasm and −0.04 for hate.
- **Macro-F1 results (baseline → HAN + features):**
  - Humour: 69.34 → 72.71.
  - Sarcasm: 78.4 → 82.07.
  - Hate: 33.60 → 39.54.
  
  These correspond to relative gains of 4.9%, 4.7% and 17.7%. Adding the features to the baselines alone gave relative gains of 2.62%, 1.85% and 3.36%.
- **Setup:**
  - The HAN uses a GRU implementation.
  - GloVe embeddings were trained on 725,173 code-mixed tweets from Patro et al. (2017) plus 13,278 tweets from the three datasets.
  - The sarcasm data was rebalanced by removing easy negative samples, those with very low predicted probability of being sarcastic.

*Our summary of the paper, in our own words — not its text. The work belongs to its authors; read it at the links above.*

Fields: [Linguistics & languages](https://md.research.elamur.ai/free/shelves/linguistics/)

## Cited by

Cited by

9 papers of our library cite it (of the 140673 whose bibliographies we read); 1 of them have a page here, 8 not yet.

- [A Survey in Automatic Irony Processing: Linguistic, Cognitive, and Multi-X Perspectives](https://md.research.elamur.ai/free/papers/zeng-2022-survey-automatic-irony-processing-linguistic/)

## Cite

The paper itself, not this page. BibTeX from the library's record of the work.

```bibtex
@inproceedings{bansal2020code,
  title = {{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}},
  author = {Bansal, Srijan and Garimella, Vishal and Suhane, Ayush and Patro, Jasabanta and Mukherjee, Animesh},
  booktitle = {Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics},
  year = {2020},
  doi = {10.18653/v1/2020.acl-main.96},
  eprint = {2005.02295},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.18653/v1/2020.acl-main.96}
}
```

- [← previous Clustering Biblical Texts Using Recurrent Neural Networks](https://md.research.elamur.ai/free/papers/hbo-2020-schans-clustering-biblical-texts-using-recurrent/)
- [next → CodeBERT: A Pre-Trained Model for Programming and Natural Languages](https://md.research.elamur.ai/free/papers/feng-2020-codebert-pre-trained-model-programming/)
- [↑ back to papers of 2020](https://md.research.elamur.ai/free/papers/2020/)

## References

1 references, 0 of them with a card of ours. ↗ leads to the work, «find» searches for one we have no id for yet.

1. P. Agarwal, A. Sharma, J. Grover, M. Sikka, K. Rudra, and M. Choudhury. 2017. I may talk in english but gaali toh hindi mein hi denge : A study of english-hindi code-switching and swearing pattern on social networks. In 2017 9th International Conference on Communication Systems and Networks (COM-SNE… [find](https://scholar.google.com/scholar?q=P%2E+Agarwal%2C+A%2E+Sharma%2C+J%2E+Grover%2C+M%2E+Sikka%2C+K%2E+Rudra%2C+and+M%2E+Choudhury%2E+2017%2E+I+may+talk+in+english+but+gaali+toh+hindi+mein+hi+denge+%3A+A+study+of+english%2Dhindi+code%2Dswitching+and+swearing+pattern+on+)
