Model description
This model is a fine-tuned version of the DistilBERT model to classify toxic comments.
How to use
You can use the model with the following code.
from transformers import AutoModelForSequenceClassification, AutoTokenizer, TextClassificationPipeline
model_path = "martin-ha/toxic-comment-model"
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForSequenceClassification.from_pretrained(model_path)
pipeline = TextClassificationPipeline(model=model, tokenizer=tokenizer)
print(pipeline('This is a test text.'))
Limitations and Bias
This model is intended to use for classify toxic online classifications. However, one limitation of the model is that it performs poorly for some comments that mention a specific identity subgroup, like Muslim. The following table shows a evaluation score for different identity group. You can learn the specific meaning of this metrics here. But basically, those metrics shows how well a model performs for a specific group. The larger the number, the better.
subgroup | subgroup_size | subgroup_auc | bpsn_auc | bnsp_auc |
---|---|---|---|---|
muslim | 108 | 0.689 | 0.811 | 0.88 |
jewish | 40 | 0.749 | 0.86 | 0.825 |
homosexual_gay_or_lesbian | 56 | 0.795 | 0.706 | 0.972 |
black | 84 | 0.866 | 0.758 | 0.975 |
white | 112 | 0.876 | 0.784 | 0.97 |
female | 306 | 0.898 | 0.887 | 0.948 |
christian | 231 | 0.904 | 0.917 | 0.93 |
male | 225 | 0.922 | 0.862 | 0.967 |
psychiatric_or_mental_illness | 26 | 0.924 | 0.907 | 0.95 |
數(shù)據(jù)評(píng)估
本站OpenI提供的martin-ha/toxic-comment-model都來源于網(wǎng)絡(luò),不保證外部鏈接的準(zhǔn)確性和完整性,同時(shí),對(duì)于該外部鏈接的指向,不由OpenI實(shí)際控制,在2023年 5月 26日 下午6:06收錄時(shí),該網(wǎng)頁上的內(nèi)容,都屬于合規(guī)合法,后期網(wǎng)頁的內(nèi)容如出現(xiàn)違規(guī),可以直接聯(lián)系網(wǎng)站管理員進(jìn)行刪除,OpenI不承擔(dān)任何責(zé)任。