A Comparative Study of Monolingual and Multilingual Transfer Learning Strategies with Code-Mixing Analysis
# Group 60 — Sentiment Analysis in African Languages
## COS760 2025 | AfriSenti NLP Project
**Members:**
- Praises Obi (u26819661)
- Bob Dlamini (u21739120)
- Ishe Allen Chihobo (u22592238)
---
## Overview
This project performs multilingual sentiment analysis across five African languages — **Hausa, Yoruba, Igbo, Nigerian Pidgin, and Swahili** — using the AfriSenti-SemEval 2023 dataset. We implement and compare four model architectures:
| Model | Description |
|---|---|
| **TF-IDF + Logistic Regression** | Baseline model using n-gram features |
| **LAFT** | Language-Adaptive Fine-Tuning of AfroXLMR (monolingual, per language) |
| **mBERT** | Multilingual BERT fine-tuned per language |
| **MAFT** | Multilingual Adaptive Fine-Tuning of AfroXLMR (joint training across all 5 languages) |
Phase 4 extends the analysis with LIME interpretability, code-mixing diagnostics, and an error taxonomy based on Muhammad et al. (2023).
---
## Contents of the Zip File
```
Group60/
├── README.md ← This file
├── group60-notebook.ipynb ← Main project notebook (all 4 phases)
├── download_data.py ← Standalone script to download the AfriSenti dataset
└── requirements.txt ← Python library dependencies
```
---
## Setup Instructions
### Requirements
- Python 3.10+
- CUDA-compatible GPU strongly recommended (notebook was developed on Kaggle with a T4 GPU)
- Install dependencies:
```bash
pip install -r requirements.txt
```
> **Note:** The notebook also includes `!pip install` cells at the top of each phase that handle installation automatically when run in Kaggle.
---
## Running the Code
This project is designed to run as a **Kaggle notebook**. Follow these steps:
### Step 1 — Upload the notebook to Kaggle
1. Go to kaggle.com and sign in
2. Click **Code → New Notebook**
3. Go to **File → Import Notebook** and upload `group60-notebook.ipynb`
### Step 2 — Attach the pre-computed assets dataset
The model checkpoints, cached results …