Welcome to the Amharic News Classification using AfriBERTa project repository!
This project focuses on building an intelligent Natural Language Processing (NLP) system capable of automatically classifying Amharic news articles using the powerful AfriBERTa transformer model.
The repository contains datasets, preprocessing scripts, model training pipelines, evaluation results, and research implementations developed collaboratively by our project team members.
| Group Member | Student UGR ID |
|---|---|
| Shalom Mesfin | UGR/25453/14 |
| Benjamin Endale | UGR/25484/14 |
| Salem Mesfin | UGR/25407/14 |
| Yaikob Wasihun | UGR/25556/14 |
| Bereket Daniel | UGR/25430/14 |
This project applies Deep Learning and Transformer-based NLP techniques to classify Amharic news articles into 6 different categories automatically:
Using AfriBERTa, a multilingual transformer language model pre-trained specifically on 11 African languages (including Amharic), the system achieves state-of-the-art accuracy for sequence classification tasks on low-resource Amharic text.
/home/yaikob-wasihun/Desktop/NLP/
├── Amharic_News_Dataset.csv # Dataset file containing 51,483 news articles
├── requirements.txt # Package dependencies
├── main.py # Main pipeline executor (training + evaluation + sample prediction)
├── predict.py # CLI inference utility for predictions on new Amharic texts
└── src/
├── __init__.py # Module entrypoint exposing modules
├── data_loader.py # CSV loader with inspection functions
├── preprocessing.py # Cleaning text, encoding labels, and PyTorch dataset wrappers
├── trainer.py # Model fine-tuning workflow using Hugging Face Trainer
└── visualization.py # Matplotlib category distribution plots
Training large language models (LLMs) like AfriBERTa is highly resource-intensive. The training pipeline in main.py is engineered to detect your system resources dynamically:
castorini/afriberta_base (or castorini/afriberta_large), employing larger batches and full GPU acceleration.castorini/afriberta_small model. This enables the training pipeline to run successfully on any computer in just a few minutes for validation and testing purposes without hanging or running out of memory.Make sure all dependencies are installed:
pip install -r requirements.txt
Run the main pipeline which loads data, performs cleaning/preprocessing, splits data into Train/Val/Test subsets, fine-tunes the AfriBERTa sequence classifier, evaluates on the test set, saves checkpoints, and runs a quick prediction test:
python3 main.py
Once the model is trained and saved under results/best_model, you can easily classify any new Amharic headlines or articles using the CLI tool:
python3 predict.py "የአፍሪካ ዋንጫ ማጣሪያ ውድድር በቅርቡ እንደሚጀመር የኢትዮጵያ እግር ኳስ ፌዴሬሽን አስታውቋል።"
5 commits
Python
100.0%
Welcome to the Amharic News Classification using AfriBERTa project repository!
This project focuses on building an intelligent Natural Language Processing (NLP) system capable of automatically classifying Amharic news articles using the powerful AfriBERTa transformer model.
The repository contains datasets, preprocessing scripts, model training pipelines, evaluation results, and research implementations developed collaboratively by our project team members.
| Group Member | Student UGR ID |
|---|---|
| Shalom Mesfin | UGR/25453/14 |
| Benjamin Endale | UGR/25484/14 |
| Salem Mesfin | UGR/25407/14 |
| Yaikob Wasihun | UGR/25556/14 |
| Bereket Daniel | UGR/25430/14 |
This project applies Deep Learning and Transformer-based NLP techniques to classify Amharic news articles into 6 different categories automatically:
Using AfriBERTa, a multilingual transformer language model pre-trained specifically on 11 African languages (including Amharic), the system achieves state-of-the-art accuracy for sequence classification tasks on low-resource Amharic text.
/home/yaikob-wasihun/Desktop/NLP/
├── Amharic_News_Dataset.csv # Dataset file containing 51,483 news articles
├── requirements.txt # Package dependencies
├── main.py # Main pipeline executor (training + evaluation + sample prediction)
├── predict.py # CLI inference utility for predictions on new Amharic texts
└── src/
├── __init__.py # Module entrypoint exposing modules
├── data_loader.py # CSV loader with inspection functions
├── preprocessing.py # Cleaning text, encoding labels, and PyTorch dataset wrappers
├── trainer.py # Model fine-tuning workflow using Hugging Face Trainer
└── visualization.py # Matplotlib category distribution plots
Training large language models (LLMs) like AfriBERTa is highly resource-intensive. The training pipeline in main.py is engineered to detect your system resources dynamically:
castorini/afriberta_base (or castorini/afriberta_large), employing larger batches and full GPU acceleration.castorini/afriberta_small model. This enables the training pipeline to run successfully on any computer in just a few minutes for validation and testing purposes without hanging or running out of memory.Make sure all dependencies are installed:
pip install -r requirements.txt
Run the main pipeline which loads data, performs cleaning/preprocessing, splits data into Train/Val/Test subsets, fine-tunes the AfriBERTa sequence classifier, evaluates on the test set, saves checkpoints, and runs a quick prediction test:
python3 main.py
Once the model is trained and saved under results/best_model, you can easily classify any new Amharic headlines or articles using the CLI tool:
python3 predict.py "የአፍሪካ ዋንጫ ማጣሪያ ውድድር በቅርቡ እንደሚጀመር የኢትዮጵያ እግር ኳስ ፌዴሬሽን አስታውቋል።"
5 commits
Python
100.0%