Sentiment Analysis in Dravidian Code-Mixed YouTube Comments and Posts

Sanjeepan Sivapiran, Charangan Vasantharajan, Uthayasanker ThayasivamFire (working Notes) 2021

Abstract

This paper addresses the complexities of sentiment analysis in "code-mixed" social media environments, specifically focusing on Tamil-English YouTube comments. By integrating a custom translation and transliteration pipeline with the Universal Language Model Fine-tuning (ULMFiT) architecture, the authors achieved a weighted F1 score of 0.61. This performance demonstrates that specialized transfer learning can outperform massive transformer models like BERT in low-resource, multi-script contexts.

Introduction

Most Natural Language Processing (NLP) models are optimized for "clean" monolingual datasets. However, social media users in multilingual regions like South India frequently employ code-mixing—the practice of switching between languages (e.g., Tamil and English) and scripts (e.g., using Latin characters for Tamil words) within a single sentence. Standard models often fail to recognize "Tamil-in-Latin-script" as semantically equivalent to "Tamil-in-native-script." This study aims to bridge this gap for Dravidian languages by classifying YouTube comments into five categories: Positive, Negative, Mixed Feelings, Unknown, and Not in Tamil.

Methodology

The researchers implemented a two-pronged strategy involving aggressive preprocessing and domain-specific transfer learning.

The Normalization Pipeline

To handle script-mixing, a preprocessing routine was developed to convert inputs into a uniform native Tamil script:

  • Translation: English words were identified via NLTK and converted to native Tamil script using the Google Translate API.
  • Transliteration: Tamil words written in the Latin alphabet were converted to native Tamil script using the AI4Bharat Transliteration tool. This normalization effectively transforms a code-mixed corpus into a "monolingual" Tamil dataset, facilitating better pattern recognition by the models.

Model Selection

The study compared three distinct architectures: Multilingual BERT (mBERT), DistilBERT, and ULMFiT. ULMFiT (Universal Language Model Fine-tuning) was the primary focus, utilizing a three-stage transfer learning process to adapt to the specific linguistic nuances of the dataset.

The three-stage ULMFiT architecture: LM pretraining, LM fine-tuning, and Classifier fine-tuning.

Dataset Analysis

The study utilized the Dravidian-CodeMix-FIRE 2021 dataset, consisting of 35,656 training, 3,962 validation, and 4,392 test comments. The dataset is notably imbalanced; for instance, the "Positive" class contains over 20,000 training samples, while the "Not-Tamil" class has fewer than 1,700. The data includes inter-sentential, intra-sentential, and tag switching, reflecting the authentic linguistic complexity of YouTube user interactions.

Results and Discussion

The models were evaluated using the weighted average F1 score. ULMFiT emerged as the most effective model, outperforming both transformer variants.

Comparison of Precision, Recall, and F1-Score across ULMFiT, DistilBERT, and mBERT models.

The success of ULMFiT (F1: 0.6101) over mBERT (F1: 0.5963) suggests that current multilingual transformer models may not be sufficiently pre-trained on low-resource languages like Tamil. ULMFiT’s specific approach—fine-tuning the language model on the target domain before classification—proved more robust for this specialized task. Furthermore, the results highlight that script normalization is critical; by transliterating everything into a single native script, the model can recognize that the same word in different alphabets carries identical sentiment.

Conclusion and Future Work

While the proposed pipeline achieved significant improvements, challenges remain. The extreme class imbalance in the training set likely hampers overall performance. Additionally, the reliance on external APIs for translation presents potential scaling bottlenecks. Future research should explore testing this pipeline on other low-resource Dravidian languages, such as Malayalam and Kannada, and developing transformer models specifically pre-trained on larger corpora of native and code-mixed Dravidian text.

Summary updated

BibTeX
@inproceedings{sivapiran2021sentiment,
  author = {Sanjeepan Sivapiran and Charangan Vasantharajan and Uthayasanker Thayasivam},
  title = {{Sentiment Analysis in Dravidian Code-Mixed YouTube Comments and Posts}},
  booktitle = {Fire (working Notes)},
  year = {2021},
}
Figure