Views
No views yet
1from transformers import pipeline
2classifier = pipeline("text-classification",model='Xuhui/ToxDect-roberta-large', return_all_scores=True)
3prediction = classifier("You are f**king stupid!", )
4print(prediction)
5
6"""
7Output:
8[[{'label': 'LABEL_0', 'score': 0.002632011892274022}, {'label': 'LABEL_1', 'score': 0.9973680377006531}]]
9"""1@inproceedings{zhou-etal-2020-debiasing,
2 title = {Challenges in Automated Debiasing for Toxic Language Detection},
3 author = {Zhou, Xuhui and Sap, Maarten and Swayamdipta, Swabha and Choi, Yejin and Smith, Noah A.},
4 booktitle = {EACL},
5 abbr = {EACL},
6 html = {https://www.aclweb.org/anthology/2021.eacl-main.274.pdf},
7 code = {https://github.com/XuhuiZhou/Toxic_Debias},
8 year = {2021},
9 bibtex_show = {true},
10 selected = {true}
11}