Cross-Domain Sentiment Analysis for Indonesian

2026 · Undergraduate thesis

The problem

Sentiment models trained on one kind of Indonesian text say, news do noticeably worse on another, like social media, mostly because the vocabulary and the way words get split don’t carry over. A common fix is “vocabulary extension”: teaching the model the target domain’s words. I wanted to test whether that actually helps.

What I built

  • A 7,265-comment Indonesian corpus from YouTube news comments (CNN Indonesia and KOMPASTV), each labelled by three native speakers with majority vote, tested against the IndoNLU SmSA benchmark. On top of it I compared five ways of representing the text TF-IDF, fastText, IndoBERT, and two vocabulary-extension variants in both transfer directions, with three classifiers and SMOTEENN for class imbalance.

The stack

  • fastText

The result

  • Vocabulary extension turned out to be double-edged: it helped slightly in one direction but hurt by 16.1 points in the other. A controlled frozen-body ablation showed the culprit wasn’t the added words it was drift in the transformer’s body from the domain-adaptive pre-training, which pulled the decision boundary toward the negative class. Freezing the body cut the penalty from 16.1 to 1.1 points, confirming it. The best setup reached 0.804 F1-macro with IndoBERT features, well above the 0.37–0.43 the classical TF-IDF approach (used by earlier Indonesian work) managed. The takeaway: use vocabulary extension selectively — only when the target domain breaks into unknown tokens far more than the model’s original training did.
First page of the paper Feature Extraction Analysis for Indonesian Cross-Domain Sentiment Analysis, showing the title, the three authors, the abstract and the start of the introduction

data/ml · research