Swahili News Classification
# NLP_PROJECT
---
# Swahili News Classification using AfriBERTA
This repository contains a Python script for classifying Swahili news articles into predefined categories using the AfriBERTa model. The project leverages the Hugging Face Transformers library and is designed to run on the Kaggle platform.
## Table of Contents
- Project Overview
- Dataset
- Dependencies
- Setup
- Usage
- Results
- Contributing
- License
## Project Overview
The goal of this project is to classify Swahili news articles into five categories: Biashara, Burudani, Kimataifa, Kitaifa, and Michezo. The project uses the AfriBERTa model, a pre-trained language model fine-tuned for sequence classification tasks. The dataset consists of news articles with labeled categories, and the model is trained to predict these categories based on the article content.
## Dataset
The dataset used in this project is available in the `/kaggle/input/swaillidataset/` directory and includes the following files:
- `Train.csv`: Training data with labeled news articles.
- `Test.csv`: Test data without labels.
- `SampleSubmission.csv`: Sample submission file for Kaggle competition.
- `VariableDefinitions.csv`: Definitions of variables used in the dataset.
## Dependencies
To run this project, The following dependencies are required
- Python 3.x
- Pandas
- NumPy
- Scikit-learn
- Transformers (Hugging Face)
- Datasets (Hugging Face)
- PyTorch
- NLTK
- Matplotlib
- Seaborn
- WordCloud
Installation of these dependencies using pip:
```bash
pip install pandas numpy scikit-learn transformers datasets torch nltk matplotlib seaborn wordcloud
```
## Setup
1. **Clone the Repository:**
```bash
git clone
github.com
cd NLP_PROJECT
```
2. **Install Dependencies:**
```bash
pip install -r requirements.txt
```
3. **Download the Dataset:**
- Download the dataset from the Kaggle Swahili Dataset and place it in the `input` directory.
4. **Set Up Kaggle Environment:**
- If you are running this on Ka …