Skip to main content

A simple hate speech detection model using machine learning.

Project description

<<<<<<< HEAD

hate_speech_detector

A Python package to detect hate speech in text using a simple ML model.

<<<<<<< HEAD

hate_speech_detector

A Python package to detect hate speech in text using a simple ML model.

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

License

This project is licensed under the MIT License - see the LICENSE file for details.

2fd4587 (Initial commit: Hate speech detector) 5f48726 (Initial commit: Hate speech detector v0.1.1)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hate_speech_detector-0.1.2.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hate_speech_detector-0.1.2-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file hate_speech_detector-0.1.2.tar.gz.

File metadata

  • Download URL: hate_speech_detector-0.1.2.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

Hashes for hate_speech_detector-0.1.2.tar.gz
Algorithm Hash digest
SHA256 2711aa3d4582d4c34d534bf5ea1dd2d4caf32138663130ab44492572b3f251df
MD5 b508e950fdbdf3494a4b8b86d6a36501
BLAKE2b-256 5518daf92520bc3b25b9a9bf97b1180c332909ca6254889cb73e33dc24632bd3

See more details on using hashes here.

File details

Details for the file hate_speech_detector-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for hate_speech_detector-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e83ba7621def93274caa8e94605b7525d3bd2f3009efe58d46b89506cf2dec6b
MD5 f3b0338dcb446af9d186a8dac4ce53c3
BLAKE2b-256 f234bd0e4d26cb8976bce1d0726db2bf97d39e287aca036df8bf36939a1a6299

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page