Logo Lanfrica

musombaangel/swahili_text_classification

Domaine:

natural language processing

Type de record:

project
Créateur:
mus
Hôte:
This is a project that classifies swahili texts as scam or trustworthy. # Swahili Scam Text Classification Classification of Swahili messages as scam or trustworthy. Two models were used in this project: 1. A baseline logistic regression model 2. A transformer model (XML-R) ## File structure |-- data/ | |-- bongo_scam.csv | |-- bongo_scam_cleaned.csv | |-- extra_report/ | |-- extra_report.py | |-- predictions.csv | |-- notebooks/ | |-- baseline_model.py | |-- preprocessing.py | |-- transformer_model.py | |-- reports/ | |-- findings.md | |-- visualizations.ipynb | |-- images/ | |-- wordcloud.png |-- requirements.txt ## Dependencies The model dependencies are listed under the requirements.txt file. All of them can be installed using pip: pip install -r requirements.txt # About the data The data (bongoscam.csv in the data folder) is a dataset with two columns: - Sms: A column with swahili texts. - Category: A column with binary values `scam`(scam messages) and `trust` (not spam). ## License citation The dataset used in this project is sourced from Kaggle: [Swahili SMS Detection Dataset]-[Author name: Henry Dioniz] The dataset can be found here: Swahili SMS Detection Datas… # Methodology ## Preprocessing The preprocessing.py file handles all the data processing that is necessary. These steps include: - Removal of capital letters, numbers and special characters: Capital letters and special characters may interfere with how words are vectorized. Numbers were removed because they are not useful in determining context given that a lot of messages included them, which could mislead the model. - Removal of stop words: These are words that appear commonly and may not be as useful in determining context Below is the list of stop words used: `["akasema","hii","alikuwa","alisema","baada","basi","bila","cha","chini","hadi","hapo","hata","hivyo","hiyo","huku","huo","ili","ilikuwa","juu","kama","karibu","katika","kila","kima","kisha","kubwa","kutoka","kuwa","kwa","kwamba","kwenda" …