This is a project aimed at carrying out sentiment analysis of social media posts in kenya regarding topics such as Mpesa fee, kenya elections an etc
# π°πͺ Kenya Social Media Sentiment Analysis
> **Supervised Machine Learning on Kenyan Multilingual Social Media Data**
> Languages supported: English Β· Swahili Β· Sheng (code-switching)
---
## π₯ Group Members
| # | Name | Student ID |
|---|------|------------|
| 1 | Moses Ogenrwot | 673380 |
| 2 | Victor Kipngeno Rotich | 670388 |
---
## π Project Overview
This project builds and evaluates supervised machine learning classifiers to analyse public sentiment expressed on Kenyan social media. Given the multilingual nature of Kenyan online discourse β mixing English, Swahili, and Sheng (urban slang/code-switching) β the project includes a custom multilingual preprocessing pipeline, a labelled dataset of 920 posts, and four trained classification models compared by standard NLP metrics.
### Topics Covered
| Topic | Description |
|-------|-------------|
| **M-Pesa Fees** | Public sentiment on Safaricom mobile money transaction charges |
| **Elections** | Views on Kenya's electoral process, IEBC, and democracy |
| **Fuel Prices** | Reactions to EPRA fuel price reviews and energy costs |
| **Education** | Opinions on CBC curriculum, school fees, and teacher strikes |
| **Cost of Living** | Sentiments on inflation, rent, food prices, and affordability |
### Research Questions Addressed
1. Can standard ML classifiers (Naive Bayes, Logistic Regression) accurately classify sentiment in multilingual Kenyan social media text?
2. How does TF-IDF feature engineering with bigrams compare to Bag-of-Words for this task?
3. What are the dominant public sentiments across different Kenyan social issues?
---
## π Project Structure
```
kenya_sentiment/
β
βββ data/
β βββ kenya_social_media_dataset.csv # 920 labelled social media posts
β βββ generate_dataset.py # Initial seed dataset generator
β βββ build_large_dataset.py # Full 920-row dataset builder
β βββ expand_dataset.py # Dataset augmentation utilities
β βββ final_dataset.py β¦