# Swahili News Classification Challenge
This repository contains data and modeling assets for classifying Swahili news articles into five categories: `kitaifa`, `kimataifa`, `biashara`, `michezo`, and `burudani`.
## Dataset
- Training data: 5,151 labeled news articles in `Train.csv`
- Test data: 1,030 unlabeled news articles in `Test.csv`
- Data dictionary: `VariableDefinitions.csv`
## Project Structure
```text
|- group_14_EDA_week_7.ipynb
|- requirements.txt
|- Train.csv
|- Test.csv
|- SampleSubmission.csv
`- results/
```
## Recommended Run Path
The notebook is now the main reproducible workflow.
It:
- validates the input files
- normalizes label casing to lowercase
- trains a TF-IDF + balanced Logistic Regression baseline
- evaluates on a stratified validation split
- writes output files to `results/`
- includes improved prompt-engineering utilities for optional LLM-assisted review
Generated files:
- `results/baseline_metrics_from_notebook.json`
- `results/baseline_submission_from_notebook.csv`
## Installation
```bash
pip install -r requirements.txt
```
This installs the notebook dependencies for:
- baseline modeling
- visualizations
- optional OpenAI API usage for prompt-engineering experiments
- XGBoost and multilingual BERT sections
If you only want the lightest baseline environment, the minimum practical packages are `pandas`, `numpy`, and `scikit-learn`.
## Notes
- The raw labels in `Train.csv` are inconsistently cased, so normalization is required for stable training and submission output.
- `results/checkpoint-*` directories come from earlier notebook training runs and are not required for the notebook baseline.
## License
This repository is for a challenge project and does not include a formal license file.