Skip to main content

Hate Speech Detection Library for Python

Project description

HateSonar: Hate Speech Detection

HateSonar is the hate speech detection library for Python.

Behold, the power of HateSonar:

>>> from hatesonar import Sonar
>>> sonar = Sonar()
>>> sonar.ping(text="At least I'm not a nigger")
{
  "text" : "At least I'm not a nigger",
  "top_class" : "hate_speech",
  "classes" : [ {
    "class_name" : "hate_speech",
    "confidence" : 0.6001793646345871
  }, {
    "class_name" : "offensive_language",
    "confidence" : 0.399548534507691
  }, {
    "class_name": "neither",
    "confidence": 0.0002721008577219325
  } ]
}

HateSonar allows you to detect hate speech and offensive language in text, without the need for training. There's no need to train the model. You have only to fed text into HateSonar. It detects hate speech with the confidence score.

BERT based model

Feature Support

  • Hate speech and offensive language detection

HateSonar officially supports Python 3.10+

Installation

To install HateSonar, simply use pip:

pip install hatesonar

Reference

Thomas Davidson, Dana Warmsley, Michael Macy, and Ingmar Weber. 2017. "Automated Hate Speech Detection and the Problem of Offensive Language." ICWSM.

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

hatesonar-0.1.0.tar.gz (273.9 kB view details)

Uploaded Source

Built Distribution

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

hatesonar-0.1.0-py3-none-any.whl (222.6 kB view details)

Uploaded Python 3

File details

Details for the file hatesonar-0.1.0.tar.gz.

File metadata

  • Download URL: hatesonar-0.1.0.tar.gz
  • Upload date:
  • Size: 273.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.16

File hashes

Hashes for hatesonar-0.1.0.tar.gz
Algorithm Hash digest
SHA256 17f6bb7472c292c7afed59eceb05470749a5a5e71f4e06a3c2a004d3a48f29f8
MD5 7f335e494ace67c2deae53ff3c5b0f58
BLAKE2b-256 ca8f25542cc1c1310b76cff782e1695e4c4e5377452b487f13e62f6e8a029335

See more details on using hashes here.

File details

Details for the file hatesonar-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: hatesonar-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 222.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.16

File hashes

Hashes for hatesonar-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 969c56618bd628b3cb9b69d4e5170b461c8270737d2b0eb37ba0d55e207e9f37
MD5 4edcd508fb187dc1e1e648130ca960f7
BLAKE2b-256 3e80208eb973d1fd0ce9613d95d150579780708a5defd74fd065baafa1ab401c

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