My undergraduate thesis: comparing CNN, LSTM, BiLSTM, and a hybrid CNN+BiLSTM-Attention model to classify Indonesian sentiment toward electric vehicles from Platform X, deployed as a live Streamlit demo.

Timeline: September – December 2025
This is my undergraduate thesis (Tugas Akhir) at Universitas 17 Agustus 1945 Surabaya, the capstone project required to graduate with a Sarjana Komputer degree in Informatics. It compares four deep learning architectures for classifying Indonesian-language sentiment toward electric vehicles, using real public discussion scraped from Platform X (formerly Twitter).
Title: Analisis Sentimen Terhadap Ulasan Online untuk Kendaraan Listrik Menggunakan Deep Learning di Platform X ("Sentiment Analysis on Online Reviews of Electric Vehicles Using Deep Learning on Platform X").
Why this topic: public attention toward EVs in Indonesia has grown enough to generate constant, messy, opinionated discussion on social media. That's exactly the kind of unstructured, subjective data sentiment analysis exists for, and a systematic model comparison on it is useful to three different audiences: researchers extending sentiment analysis / NLP work, the automotive industry looking for a read on what people actually think of their vehicles, and prospective buyers trying to gauge public opinion before purchasing.
Four architectures were trained and compared head-to-head on the same data and the same task: classifying tweets as Positive, Negative, or Neutral.
The dataset is Indonesian-language tweets about electric vehicles, collected January 1, 2023 – August 30, 2025 via a custom crawler, with 26,852 samples remaining after preprocessing.
Labeling didn't use a fixed lexicon threshold, which is the default, simpler approach. Instead, every tweet gets a lexicon-based sentiment score (InSet plus a supplementary lexicon), and the label boundaries are set dynamically per-dataset using quantiles: below Q1 is Negative, above Q3 is Positive, and the middle band is Neutral. The point is a threshold that adapts to how this specific dataset's scores are actually distributed, rather than a fixed cutoff that assumes a distribution shape it might not have.
Preprocessing: cleaning (URLs, mentions, hashtags, emoji, non-alphanumeric characters), slang normalization against a custom slang dictionary, case folding, and stemming via Sastrawi. Text is converted to fixed-length sequences (128 tokens, padded) through a trainable Keras embedding layer, with no pretrained word vectors.
Each of the four architectures was trained at three epoch budgets (50, 100, 150) with the Adam optimizer, categorical cross-entropy loss, class weights to counter label imbalance, and EarlyStopping + model checkpointing to avoid overfitting and keep the best-performing weights.
| Model | Accuracy | Macro F1 | Weighted ROC-AUC |
|---|---|---|---|
| CNN + BiLSTM (hybrid) | 75% | 0.76 | ~0.90 |
| BiLSTM | 73% | 0.73 | ~0.88 |
| CNN | 72% | 0.72 | ~0.88 |
| LSTM | 43% | 0.20 | 0.50 |
The hybrid model won on every metric. Single-direction LSTM effectively failed: it collapsed into predicting the majority class and never recovered, performing no better than a coin flip (AUC 0.50), regardless of how long it trained.
What the epoch sweep revealed (Table 4.6) was more interesting than the headline numbers. CNN's F1 score actually fell as training went from 50 → 150 epochs (0.744 → 0.721), a textbook overfitting curve. BiLSTM stayed flat across all three (a stable plateau). The hybrid model was the only one that kept improving with more training (0.751 → 0.760), meaning it had learning capacity the other architectures didn't, and it was chosen at 150 epochs for deployment.
Where it still struggles: even the winning hybrid model's biggest source of error is confusing Positive with Neutral. Its recall on the Positive class alone is just 0.63. Distinguishing mild positivity from neutral commentary turned out to be the hard part of this task, not separating clearly positive from clearly negative sentiment.

The best-performing model, tokenizer, and label encoder were exported and wired into a Streamlit web app. Type in a review, hit analyze, and the app runs the same preprocessing pipeline used in training before returning a prediction with a confidence score.


Worth being precise about: the research and evaluation, meaning every number above, comes from the custom-trained TensorFlow/Keras CNN+BiLSTM-Attention model described in the thesis. The public demo app, for practical deployment reasons, calls a pretrained HuggingFace sentiment model (PyTorch) instead of loading the custom Keras model directly. The UI and pipeline shown are the same ones built for the thesis; the inference backend behind the public link is a lighter swap to keep a free-tier deployment fast and reliable.
| Layer | Choice |
|---|---|
| Language | Python |
| Deep learning | TensorFlow / Keras (research & training) |
| Deployment inference | PyTorch, HuggingFace Transformers |
| Data & metrics | pandas, NumPy, scikit-learn |
| Indonesian NLP | Sastrawi (stemming), InSet lexicon |
| Notebooks | Jupyter |
| Web app | Streamlit |