Skip to main content

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.

Metadata

Release files for hatesonar 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hatesonar 0.1.0
File Size Uploaded
hatesonar-0.1.0.tar.gz 273.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hatesonar 0.1.0
File Interpreter ABI Platform
hatesonar-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 496.5 kB

Release files / hatesonar-0.1.0.tar.gz

Download URL hatesonar-0.1.0.tar.gz
Size 273.9 kB
Tags Source
SHA-256 checksum
How to use checksums
17f6bb7472c292c7afed59eceb05470749a5a5e71f4e06a3c2a004d3a48f29f8
BLAKE2b-256 checksum
How to use checksums
ca8f25542cc1c1310b76cff782e1695e4c4e5377452b487f13e62f6e8a029335
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.16

Release files / hatesonar-0.1.0-py3-none-any.whl

Download URL hatesonar-0.1.0-py3-none-any.whl
Size 222.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
969c56618bd628b3cb9b69d4e5170b461c8270737d2b0eb37ba0d55e207e9f37
BLAKE2b-256 checksum
How to use checksums
3e80208eb973d1fd0ce9613d95d150579780708a5defd74fd065baafa1ab401c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.16

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

3 release files

0.0.2

1 release file

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page