Logo Lanfrica

1camelea/jumia-sentiment-analysis

Domain:

natural language processing

Record type:

project
Creator:
1ca
Host:
Sentiment analysis of Jumia Morocco reviews β€” French & Darija NLP # πŸ›’ Jumia Morocco β€” Sentiment Analysis > **NLP project** | TF-IDF + Logistic Regression | French & Darija (Moroccan Arabic) --- ## πŸ“Œ Overview This project builds a **sentiment analysis classifier** for customer reviews scraped from **Jumia Morocco** (jumia.ma) β€” the leading e-commerce platform in Africa. Reviews are written in a realistic mix of **French**, **Darija** (Moroccan Arabic dialect in Latin script), and **Arabizi**, making this a unique and challenging NLP task that reflects real-world Moroccan digital content. **Sentiment labels** are derived automatically from star ratings: | Stars | Label | |-------|----------| | ⭐⭐ | Negative | | ⭐⭐⭐ | Neutral | | ⭐⭐⭐⭐⭐ | Positive | --- ## πŸ—‚οΈ Project Structure ``` jumia-sentiment/ β”œβ”€β”€ data/ β”‚ └── raw_reviews.csv # Scraped / sample reviews β”œβ”€β”€ src/ β”‚ β”œβ”€β”€ scraper.py # Jumia Morocco web scraper β”‚ β”œβ”€β”€ generate_sample_data.py # Generates realistic sample data β”‚ └── train_model.py # Full NLP training pipeline β”œβ”€β”€ outputs/ β”‚ β”œβ”€β”€ sentiment_model.joblib # Saved trained model β”‚ └── figures/ β”‚ β”œβ”€β”€ eda_overview.png β”‚ β”œβ”€β”€ confusion_matrix.png β”‚ └── top_features.png β”œβ”€β”€ requirements.txt └── README.md ``` --- ## βš™οΈ Installation ```bash git clone github.com cd jumia-sentiment-analysis pip install -r requirements.txt ``` --- ## πŸš€ Usage ### Step 1 β€” Get data **Option A: Scrape live data from Jumia Morocco** ```bash python src/scraper.py ``` **Option B: Generate a sample dataset (for testing)** ```bash python src/generate_sample_data.py ``` ### Step 2 β€” Train & evaluate ```bash python src/train_model.py ``` --- ## 🧠 NLP Pipeline ``` Raw Review Text β”‚ β–Ό Preprocessing ───────────── β€’ Lowercase β€’ Remove URLs, punctuation β€’ Remove French + Darija stopwords β€’ Preserve Arabizi digits (3 = ΨΉ, 7 = Ψ­, 9 = Ω‚) β”‚ β–Ό TF-IDF Vectorizer ───────────────── β€’ Unigrams + Bigrams β€’ max_features = 10 000 β€’ sublinear_ …