A simple hate speech detection model using machine learning.
Project description
Hate Speech Detector
A lightweight Python package to detect hate speech in text using a machine learning model.
This project was developed by [Jahfar Muhammed]as part of my major project in college to explore ethical AI applications and contribute to safer digital communication. It uses traditional NLP preprocessing and a trained machine learning model to classify whether input text contains hate speech.
Features
- Simple API with a single function call
- Returns human-readable and structured results
- Trained on real-world datasets
- Easily integrable with chat apps, moderation systems, and content filters
Installation
You can install this package using pip:
pip install hate_speech_detector
Usage
Here's how you can use the package in your code:
from hate_speech_detector import isHate
result = isHate("I hate you!")
print(result)
# Output: {'message': 'Hate Speech', 'isHate': True}
result = isHate("Have a nice day!")
print(result)
# Output: {'message': 'Not Hate Speech', 'isHate': False}
Function Description
isHate(text: str) -> dict- Input: A string of text
- Output: A dictionary with:
message: "Hate Speech" or "Not Hate Speech"isHate: True if hate speech, else False
Project Information
This package was developed as a college major project with the goal of creating a practical ethical and easy-to-use tool for identifying hate speech in textual content. It combines text preprocessing machine learning, and Python packaging into a useful open-source solution.
Author
- Name: Jahfar Muhammed
- GitHub: https://github.com/jah-117
- Email: jahfarbinmuhammed117@gmail.com
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hate_speech_detector-0.2.1.tar.gz.
File metadata
- Download URL: hate_speech_detector-0.2.1.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c959145fb7b192246e6a71c64910dd8e809c9190ab6f98f658ff7bdbeddf437b
|
|
| MD5 |
3eba1d5c932e6e9056c7cd8a070b8e98
|
|
| BLAKE2b-256 |
e38f720f348cbbc05b673aad2880594ac55199105e9eb20a9a8831588d868cfb
|
File details
Details for the file hate_speech_detector-0.2.1-py3-none-any.whl.
File metadata
- Download URL: hate_speech_detector-0.2.1-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2aa0e0225ffaf5fdda37ccae161bedd7a0f6b0e18703bd9319e85af53d13ae85
|
|
| MD5 |
e9638fd9adea979a18397436b461e44c
|
|
| BLAKE2b-256 |
91ee89dd43a0b2ca011b4df86035a263f995ccbe419ab9fe91cb95d022c9d7d9
|