<aside> ℹ️ 기초 정보
</aside>
논문
데이터셋
https://github.com/smilegate-ai/korean_unsmile_dataset
https://github.com/sgunderscore/hatescore-korean-hate-speech
소개 영상 (Korean Unsmile Dataset)
데모 API (Huggingface)
sgunderscore/hatescore-korean-hate-speech · Hugging Face
from transformers import TextClassificationPipeline, BertForSequenceClassification, AutoTokenizer
model_name = 'sgunderscore/hatescore-korean-hate-speech'
model = BertForSequenceClassification.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name)
pipe = TextClassificationPipeline(
model = model,
tokenizer = tokenizer,
device = -1, # gpu: 0
return_all_scores = True,
function_to_apply = 'sigmoid')
for result in pipe("착한 중국인은 죽은 중국인이다")[0]:
print(result)
#{'label': 'None', 'score': 0.07771512866020203}
#{'label': '기타 혐오', 'score': 0.02803093008697033}
#{'label': '남성', 'score': 0.013538877479732037}
#{'label': '단순 악플', 'score': 0.01559345331043005}
#{'label': '성소수자', 'score': 0.014305355027318}
#{'label': '여성/가족', 'score': 0.014650419354438782}
#{'label': '연령', 'score': 0.014001855626702309}
#{'label': '인종/국적', 'score': 0.9227811098098755}
#{'label': '종교', 'score': 0.035127196460962296}
#{'label': '지역', 'score': 0.02069076895713806}
<aside> 📌 요약
</aside>
<aside> 📖 연구의 배경
</aside>