Logo Lanfrica
  • Home
  • Atlas
  • Insights
  • Docs
  • Sign in

© 2026 Lanfrica. All rights reserved. All copyrights of the resources shown on the Lanfrica website belong to the original copyright holders, unless explicitly stated otherwise.

linsey254/ML-model-for-Kiswahili-Hate-Speech

Domain:

natural language processing

Record type:

model
Creator:
lin
Host:
Kiswahili Hate Speech Detection: This repository contains a machine learning model that detects hate speech in Kiswahili text. The goal of this project is to build a robust classifier that can help identify harmful and offensive language in social media, news articles, and other text sources in Kiswahili. Table of Contents: i)Introduction ii)Dataset iii)Model iv)Installation v)Usage vi)Evaluation i)Introduction: ~ Hate speech is a growing problem in online platforms, especially in local languages like Kiswahili. This project aims to detect Kiswahili hate speech using machine learning techniques. By leveraging natural language processing (NLP), this classifier can identify whether a given text is classified as hate speech or non-hate speech. The model is trained on a manually labeled dataset containing examples of both hate speech and non-hate speech in Kiswahili. ii)Dataset: ~ The dataset used for training and testing the model contains Kiswahili text samples labeled as either: a) 1- for Hate Speech b) 0- for Non-Hate Speech ~ You can add your own dataset or use the dataset provided in this repository for testing and improving the model. Example format: a) "Mtu huyu ni mjinga kabisa" - 1 b) "Ninafurahia sana maisha yangu" - 0 Data Prepocesing; ~ The dataset undergoes preprocessing steps such as: a) Lowercasing text b) Removing punctuation c) Removing numbers d) Tokenization iii)Model: ~ The classifier is built using the following machine learning techniques: a) Text Vectorization: TF-IDF (Term Frequency-Inverse Document Frequency) is used to convert textual data into numerical features. b) Classifier: A Logistic Regression model is used to classify the text into hate speech or non-hate speech. ~ The model achieves a decent accuracy on a test set and can be further fine-tuned with larger datasets or advanced deep learning techniques like LSTM or BERT. iv) Installation: Follow these steps to set up the project: a) Clone the repository: ie. git clone http …

Visit

github.com

Tasks

hate speech detectiontext classification

Languages

SwahiliSwahili, CoastalSwahili, Congo