Hybrid TF–IDF Logistic Regression and MLP Neural Baseline for Indonesian Three-Class Sentiment Analysis on Social Media Text

Allya Nurul Islami Pasha, Eka Fidiya Putri, Luluk Muthoharoh, Ardika Satria, Martin C.T. Manullang · 2026

Read Hybrid TF–IDF Logistic Regression and MLP Neural Baseline for Indonesian Three-Class Sentiment Analysis on Social Media Text by Allya Nurul Islami Pasha, Eka Fidiya Putri, Luluk Muthoharoh, Ardika Satria, Martin C.T. Manullang (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2605-07793.txt.

Introduction

Allya Nurul Islami Pasha and four co-authors present a compact sentiment analysis study for Indonesian social media text, classifying posts as positive, negative, or neutral. Their practical baseline pairs TF-IDF text features with three lightweight numeric metadata features and a balanced multinomial logistic regression classifier. A two-layer neural network over the same features serves as the comparison.

After cleaning, the dataset held just over seven hundred samples with a strong positive skew, drawn from a much finer-grained emotion dataset. Logistic regression reached about eighty percent accuracy and the better weighted F1 score, while project notes report a higher-accuracy neural model that was not production-ready. The lesson: careful preprocessing and class balancing keep simple models competitive on small datasets.

Catalog record

CREATORAllya Nurul Islami Pasha, Eka Fidiya Putri, Luluk Muthoharoh, Ardika Satria, Martin C.T. Manullang
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE21 KB
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2605.07793

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Hybrid TF–IDF Logistic Regression and MLP Neural Baseline for Indonesian Three-Class Sentiment Analysis on Social Media Text Allya Nurul Islami Pasha, Eka Fidiya Putri, Luluk Muthoharoh, Ardika Satria, Martin C.T. Manullang Abstract This paper presents a compact three-class sentiment analysis study for Indonesian social media text. The task is formulated with positive , negative , and neutral outputs derived from a fine-grained emotion dataset. The proposed practical baseline combines TF–IDF text features, three lightweight numeric metadata features, and a balanced multinomial Logistic Regression classifier. For comparison, the study also includes a neural baseline using a two-layer multilayer perceptron (MLP) over the same hybrid feature representation. The dataset originally contains 732 rows and 191 fine-grained emotion labels; after cleaning, deduplication, and label remapping, 707 samples remain with an imbalanced distribution of 459 positive, 188 negative, and 60 neutral instances. Experimental results show that the Logistic Regression deployment model reaches 0.8028 accuracy, 0.8003 weighted F1, and 0.7276 macro F1, while project documentation reports a higher-accuracy but non-production MLP baseline. These findings indicate that careful preprocessing, interpretable feature engineering, and class balancing remain competitive for small Indonesian sentiment datasets, whereas the neural baseline is better treated as a comparative experiment than as the default deployment model. Keywords Indonesian NLP \cdot Sentiment Analysis \cdot Logistic Regression \cdot MLPClassifier \cdot TF–IDF \cdot Social Media Text 1 Introduction Sentiment analysis is one of the most established text classification tasks in natural language processing because it converts user opinions into structured signals for monitoring public response, customer satisfaction, and social trends ( 12 ; 9 ) . In practice, Indonesian sentiment analysis remains challenging because user-generated text is noisy, code-mixed, abbreviated, and often semantically ambiguous. These characteristics are particularly visible in social media data, where informal spelling, slang, emotive words, hashtags, mentions, and short context windows make polarity detection harder than in clean benchmark corpora. Many recent sentiment-analysis papers emphasize large neural or transformer models, but small and noisy datasets do not always benefit equally from that additional modeling complexity. In low-resource settings, the more immediate challenge is often to design a reproducible pipeline that handles label ambiguity, class imbalance, and deployment constraints without sacrificing interpretability. The specific contribution of this study is therefore not a new model architecture, but a carefully documented comparison between deployable classical and lightweight neural baselines under the same hybrid feature space for Indonesian social media sentiment classification. The system studied in this work adopts a production-first perspective. Instead of directly optimizing for the most complex architecture, it prioritizes reproducible preprocessing, stable deployment, and interpretable hybrid features. The production model combines TF–IDF unigram–bigram features with three numeric features derived from the cleaned text and metadata: text length in words, total engagement, and hashtag count. The deep learning branch is preserved as a separate experimental baseline implemented with an MLP over the same feature space. A second challenge addressed by the repository is label granularity. The original dataset contains many emotion labels such as joy , nostalgia , grief , surprise , and curiosity . The pipeline remaps these fine-grained labels into the operational labels positive , negative , and neutral . This remapping is necessary for deployment, but it also introduces semantic compression and ambiguity, especially for mixed labels such as bittersweet , sympathy , and surprise . Because of this issue, weighted F1 alone is not sufficient; macro F1 and class-level discussion are also needed. Based on the available implementation artifacts and model reports, this paper makes three contributions. First, it formalizes a reproducible end-to-end workflow for Indonesian three-class sentiment analysis, from cleaning and label remapping to deployment-ready inference. Second, it evaluates a hybrid classical baseline and a shallow neural baseline under the same input representation, enabling a more controlled comparison of classifier families. Third, it highlights the methodological implications of label compression, data imbalance, and incomplete benchmark preservation for small-scale sentiment-analysis studies. 2 Related Work Classical sentiment analysis has long relied on lexical features, bag-of-words statistics, and linear classifiers because they provide strong baselines and interpretable decision boundaries ( 11 ; 5 ) . TF–IDF combined with Logistic Regression remains competitive for low-resource or medium-sized text classification tasks, especially when the dataset is not large enough to justify heavy neural models ( 5 ; 14 ) . Recent Indonesian sentiment analysis studies have explored both conventional machine learning and deep learning strategies, especially for noisy user-generated text. Across this literature, preprocessing choices, feature representation, and class balance strongly influence final performance ( 9 ; 1 ) . For Indonesian and multilingual social media text, normalization of slang, non-standard spelling, and noisy punctuation is particularly important because informal writing patterns can dominate token statistics. This study positions itself in that line of work by emphasizing reproducibility and deployment-oriented comparison rather than only raw predictive performance. Distributed representations and deep neural networks improve text classification by learning dense feature interactions beyond sparse lexical counts ( 10 ; 6 ) . Recurrent models such as LSTM can capture longer contextual dependencies ( 4 ) , while attention-based transformers such as BERT provide contextualized embeddings that are now dominant across many NLP tasks ( 2 ) . Indonesian-specific pretrained models such as IndoBERT further improve local-language performance by adapting transformer pretraining to Indonesian corpora ( 7 ) . However, strong deep models usually require larger training corpora, more compute, and more complex deployment pipelines. For compact educational or production-ready systems, lightweight neural baselines such as multilayer perceptrons still provide a useful midpoint between classical sparse models and full transformer stacks ( 3 ) . This repository adopts that pragmatic view: Logistic Regression is maintained as the production model, while an MLP baseline is retained for comparative experimentation. The design aligns with the broader literature showing that simpler models can remain attractive under limited-data, limited-resource, and maintainability constraints ( 13 ; 8 ) . 3 Dataset and Preprocessing 3.1 Dataset Characteristics The study uses a social-media sentiment dataset stored in project-ml/data/raw/sentimentdataset.csv . The raw file contains 732 rows and 191 unique fine-grained sentiment labels. After cleaning, removing empty text, and dropping duplicates, the effective dataset contains 707 samples. The final class distribution is 459 positive, 188 negative, and 60 neutral samples, indicating a strong imbalance toward positive sentiment. Table 1 summarizes the dataset characteristics most relevant to the experimental design. The strong skew in the class distribution is one of the main reasons for reporting macro F1 in addition to accuracy and weighted F1. Figure 1 visualizes this imbalance directly. The positive class is several times larger than the neutral class, which helps explain why weighted metrics remain relatively high even when minority-class predictions are less stable. Table 1: Dataset summary after preprocessing. Attribute Value Raw samples 732 Samples after cleaning and deduplication 707 Original label space 191 fine-grained emotion labels Operational label space 3 classes: positive, negative, neutral Class distribution 459 positive, 188 negative, 60 neutral Main data challenge Severe class imbalance and semantically ambiguous label remapping Figure 1: Class distribution after preprocessing. The positive class dominates the dataset, while the neutral class remains the smallest category, which helps explain the gap between weighted and macro-level performance. 3.2 Preprocessing Pipeline The preprocessing pipeline is directly reflected in the implementation. Text is lowercased, URLs and

Read the complete text