Practical overview
When it fits
Use HateSonar when a Python application needs a documented three-class text classification result and confidence scores as one input to moderation or analysis.
Who it is for
- Python developers building text moderation or analysis workflows.
- Teams that want to flag potentially hateful or offensive user-generated text for human review.
- Developers creating interfaces that display text-classification labels and confidence scores.
Documented uses
- Classify a text string into hate speech, offensive language or neither.
- Retrieve confidence scores alongside the predicted class.
- Add a text-screening step to a moderation pipeline without training a model.
Requirements & limits
The public repository specifies an MIT license. The README lists Python 3.10 or later and installation with pip.
- The documented output distinguishes hate speech, offensive language and neither, with a confidence value for each class.
- The README says model training is not required for use.
- Python 3.10 or later is the stated supported version.
- The repository specifies the MIT license.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Classify a text string in Python
Pass text to HateSonar and read its predicted class labels and confidence scores.
Before you start
- HateSonar installed in a Python 3.10-or-later environment
Steps
Import
Sonarfromhatesonar.Create a
Sonarinstance.Call
pingwith a text string.Read
top_classand theclassesentries, including their confidence values.
Expected outcome
The documented example returns a top class and confidence scores for hate speech, offensive language and neither.
Guide limitations
- The README provides an example but does not document thresholds for decisions or a human-review policy.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 14 October 2026
- Original website title
- Hironsan/HateSonar · Official homepage title · retained in its source language

