Multilingual Sentiment Analysis

Sentiment and aspect classification on Yassir app reviews — French, English, and Algerian Arabic (darija)

Interactive dashboard

Open dashboard in full screen

Project information

Classifying reviews in three languages at once

Yassir app reviews come in French, English, and Algerian Arabic, often mixed within the same dataset. Five models were compared for sentiment classification, including DziriBERT — a transformer pretrained specifically on Algerian dialect — for the Arabic-script subset. The deployed pipeline routes each review to the right model automatically and also flags which aspect it concerns: delivery, food, service, quality, app, or pricing.

Project deep dive

Problem statement

Classify Yassir app customer feedback into sentiment categories while identifying the underlying topic of complaint or praise — using text written in French, English, and Algerian Arabic (darija), often mixed within the same dataset, without a translation step. The deployed solution also had to fit free-tier hosting memory limits while keeping the best accuracy available for each language.

Dataset

  • data_reviews.csv — 723 positive / 413 negative labeled reviews (Sentiment, Rating, Language, Aspect_Focus)
  • restaurant_reviews_v2.csv — unlabeled reviews tied to anonymized restaurant IDs, used for the leaderboard
  • Language split: 34.5% French, 33.2% English, 32.3% Arabic

Methodology

  1. Data pipeline — cleaning, language detection, duplicate/consistency checks, feature engineering (review length, punctuation counts, token length vs. model max-length), and bilingual/RTL-aware word clouds.
  2. Model comparison — five approaches trained and evaluated on the labeled set: TF-IDF + Logistic Regression and two multilingual transformers (mBERT, XLM-RoBERTa) on the full dataset, plus two Arabic-specialized transformers (DziriBERT, MARBERT) on the Arabic-script subset.
  3. Aspect detection — keyword-based, with dictionaries in French, English, and Arabic (including Algerian dialect terms) mapping to six categories: delivery, food, service, quality, app, pricing.
  4. Deployed architecture — French/English reviews are routed to TF-IDF + Logistic Regression (best score, ships in the repo, loads instantly); Arabic-script/darija reviews are routed to DziriBERT, hosted on Hugging Face Hub and loaded at runtime.

Key findings

ModelScopeF1 (macro)
TF-IDF + LogRegFull dataset0.981
mBERTFull dataset0.971
XLM-RoBERTaFull dataset0.962
DziriBERTArabic subset1.000*
MARBERTArabic subset1.000*

*Arabic-subset validation split is small (~74 rows), so these scores are less statistically robust than the full-dataset results.

The classical TF-IDF + Logistic Regression baseline beat every transformer on French/English text — while being far smaller and faster to load, which directly shaped the deployment architecture above.

Tech stack

Python Transformers mBERT DziriBERT XLM-RoBERTa MARBERT scikit-learn Streamlit Hugging Face Hub

Limitations worth flagging: aspect detection is keyword-based rather than learned, and there's no "neutral" class in the labeled data despite an early project brief mentioning three sentiment categories. Details in the GitHub repo →