Skip to main content

Toxic Spans Prediction

Project description

License PyPI version Downloads

MUDES - {Mu}ltilingual {De}tection of Offensive {S}pans

We provide state-of-the-art models to detect toxic spans in text. We have evaluated our models on Toxic Spans task 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 MUDES from pip.

From pip

pip install mudes

Pretrained MUDES Models

We will be keep releasing new models. Please keep in touch. We have evaluated the models on the trial set released for Toxic Spanstask at SemEval 2021.

Models Average F1
en-base 0.6734
en-large 0.6886
multilingual-base 0.5953
multilingual-large 0.6013

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 mudes.app.mudes_app import MUDESApp

app = MUDESApp("en-large", use_cuda=False)
print(app.predict_toxic_spans("You motherfucking cunt", spans=True))

System Demonstration

An experimental demonstration interface called MUDES-UI has been released on GitHub and can be checked out in here.

Citing & Authors

If you are using this repo, please consider citing these papers.

@inproceedings{ranasinghemudes,
 title={{MUDES: Multilingual Detection of Offensive Spans}}, 
 author={Tharindu Ranasinghe and Marcos Zampieri},  
 booktitle={Proceedings of NAACL},
 year={2021}
}
@inproceedings{ranasinghe2021semeval,
  title={{WLV-RIT at SemEval-2021 Task 5: A Neural Transformer Framework for Detecting Toxic Spans}},
  author = "Ranasinghe, Tharindu  and Sarkar, Diptanu and Zampieri, Marcos and Ororbia, Alex",
  booktitle={Proceedings of SemEval},
  year={2021}
}

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

mudes-0.4.0.tar.gz (43.1 kB view details)

Uploaded Source

Built Distribution

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

mudes-0.4.0-py3-none-any.whl (49.8 kB view details)

Uploaded Python 3

File details

Details for the file mudes-0.4.0.tar.gz.

File metadata

  • Download URL: mudes-0.4.0.tar.gz
  • Upload date:
  • Size: 43.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for mudes-0.4.0.tar.gz
Algorithm Hash digest
SHA256 6ec3dab5cead782aad64df888d1d84fb662e67d903ddebd69403f262d525ff84
MD5 9e97fe86637e98c173335cf63c989f6b
BLAKE2b-256 f5c2a446da587631e6170aafd1d8f01d5601daafc569e5a7f7c6355252879f23

See more details on using hashes here.

File details

Details for the file mudes-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: mudes-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 49.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for mudes-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dc031435cf9ec4aa1a5385bc9858cde83fda87ed1b72fd5317a045ce036e511b
MD5 c63d3dc8a4236d0e8bebe69a7a126c24
BLAKE2b-256 59444f269b4e3a7536dc335eb3721f7ffb1d7b2293fa23f0d238f3dda22e4265

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