Logo Lanfrica

KwameCode27/Hausa_Sentiment-_Analysis_Project

Domaine:

natural language processing

Type de record:

project
Créateur:
Kwa
HĂŽte:
# Hausa Sentiment Analysis for Ghana 🇬🇭 > **Machine Learning-Based Sentiment Analysis for Hausa Social Media Content in Ghana** > Department of Computer Science · Research Project · 2026 --- ## Overview This project builds a supervised machine learning pipeline that classifies Hausa-language text from social media and news sources into three sentiment classes: **positive**, **negative**, and **neutral**. The pipeline is designed around two complementary goals: 1. **Academic benchmarking** – train and evaluate on the AfriSenti Hausa dataset so results can be compared against published state-of-the-art systems. 2. **Applied inference** – run the trained model on unlabelled Ghana-focused Hausa news articles (scraped from BBC Hausa, VOA Hausa, and DW Hausa) to analyse real-world sentiment trends relevant to Ghanaian communities. --- ## Architecture ``` Raw Text (TSV / CSV) │ â–Œ ┌─────────────────────────────────────────┐ │ HausaTextPreprocessor (src/utils.py) │ │ ‱ Lowercase & strip noise │ │ ‱ Remove URLs / mentions / hashtags │ │ ‱ Normalise repeated characters │ │ ‱ Tokenise & remove stopwords │ └──────────────────┬──────────────────────┘ │ ┌──────────▌──────────┐ │ FeatureUnion │ │ ┌───────────────┐ │ │ │ Char TF-IDF │ │ 3–5-grams │ │ Word TF-IDF │ │ unigrams + bigrams │ │ Length feat. │ │ scaled │ │ Lexicon feat. │ │ 11 numeric features, scaled │ └───────────────┘ │ └──────────┬──────────┘ │ ┌──────────▌──────────┐ │ Classifier │ │ MultinomialNB OR │ │ LogisticRegression │ └──────────┬──────────┘ │ ┌──────────▌──────────┐ │ Predicted Label │ │ positive / neutral │ │ / negative │ └─────────────────────┘ ``` --- ## Results All results below are from the **held-out AfriSenti Hausa test set** (5,303 samples). | Model | Vectoriser | Accuracy | Macro-F1 | Macro-P | Macro-R | |---|---|---|---|---|---| | Multinomial NaĂŻve Bayes | TF-IDF | 74.7% | 0.748 | 0.750 | 0.747