模型:
cardiffnlp/twitter-roberta-base-hate-multiclass-latest
此模型是 cardiffnlp/twitter-roberta-base-2022-154m 的一个经过微调的版本,用于多类仇恨言论分类。使用了13个不同的英文仇恨言论数据集来进行微调。
{ "sexism": 0, "racism": 1, "disability": 2, "sexual_orientation": 3, "religion": 4, "other": 5, "not_hate":6 }
通过pip安装tweetnlp。
pip install tweetnlp
在Python中加载模型。
import tweetnlp model = tweetnlp.Classifier("cardiffnlp/twitter-roberta-base-hate-latest") model.predict('Women are trash 2.') >> {'label': 'sexism'} model.predict('@user dear mongoloid respect sentiments & belief refrain totalitarianism. @user') >> {'label': 'disability'}
@misc{antypas2023robust, title={Robust Hate Speech Detection in Social Media: A Cross-Dataset Empirical Evaluation}, author={Dimosthenis Antypas and Jose Camacho-Collados}, year={2023}, eprint={2307.01680}, archivePrefix={arXiv}, primaryClass={cs.CL} }