This release is a pre-release and may not be stable for production use.
HateSpans
We provide state-of-the-art models to detect toxic spans in text. We have evaluated our models on Toxic Spanstask at SemEval 2021 (Task 5).
Installation
You first need to install PyTorch. The recommended PyTorch version is 1.6. Please refer to PyTorch installation page regarding the specific install command for your platform.
When PyTorch has been installed, you can install HateSpans from pip.
From pip
pip install hatespans
Pretrained HateSpans Models
We will be keep releasing new models. Please keep in touch.
| Models | Average F1 |
|---|---|
| small | 0.6652 |
Prediction
Following code can be used to predict toxic spans in text. Upon executing, it will download the relevant model and return the toxic spans.
from hatespans.app.hate_spans_app import HateSpansApp
app = HateSpansApp("small", use_cuda=False)
print(app.predict_hate_spans("You motherfucking cunt", spans=True))
Metadata
Release files for hate-spans 0.1.0b0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hate_spans-0.1.0b0.tar.gz | 39.4 kB | Without provenance | Details for hate_spans-0.1.0b0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hate_spans-0.1.0b0-py3-none-any.whl | Python 3 | none | any | Details for hate_spans-0.1.0b0-py3-none-any.whl |
Total release size: 84.3 kB
Release files / hate_spans-0.1.0b0.tar.gz
| Download URL | hate_spans-0.1.0b0.tar.gz |
|---|---|
| Size | 39.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
de6624eb9bef3ea0d63ec64c1c96c6c9a55f96eaa6f016e9436b131ddd0abcc3
|
|
BLAKE2b-256 checksum How to use checksums |
051b11c8109a04a330c1aeb6b8e10871613131266ceadb8a60b5096e4ec582d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.9.0
|
Release files / hate_spans-0.1.0b0-py3-none-any.whl
| Download URL | hate_spans-0.1.0b0-py3-none-any.whl |
|---|---|
| Size | 44.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5872ca84c7ed2607c827327adc9dbc871084583f5898c207bc298d86ef22f3a5
|
|
BLAKE2b-256 checksum How to use checksums |
a7fc108b2fb999de672d07a4fbfd812f183e5651bc86c10975d277ba00a0e7d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.9.0
|
Security for hate-spans 0.1.0b0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.