Downloads · 30 days
47
5% of all-time downloads
TomokiFujihara/luke-japanese-base-lite-offensiveness-estimation
luke-japanese-base-lite-offensiveness-estimation is a text classification model from TomokiFujihara. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
このモデルは、 sonoisa/sentence-luke-japanese-base-lite をSNS上のコメントに人手で攻撃性評価を行ったデータセットでFine-tuningすることで作成しました。 学習に使用したデータセットを参照したい方は、記載の連絡先へ別途ご連絡ください。
Downloads · 30 days
47
5% of all-time downloads
All-time downloads
999
Public
Parameters
133M
532 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors532 MB · 100%
From the Hugging Face model README
このモデルは、 sonoisa/sentence-luke-japanese-base-lite をSNS上のコメントに人手で攻撃性評価を行ったデータセットでFine-tuningすることで作成しました。 学習に使用したデータセットを参照したい方は、記載の連絡先へ別途ご連絡ください。
本モデルは、NLP2024にて下記の発表で公開します。
Summary
| 評価指標 | スコア |
|---|---|
| F値_NOT | 71.3 % |
| F値_GRY | 55.5 % |
| F値_OFF | 61.8 % |
| マクロ平均F値 | 62.9 % |
| 正解率 | 63.8 % |
Confusion matrix
| 正解ラベル \ 予測結果 | Not Offensive | Gray-area | Offensive |
|---|---|---|---|
| Not Offensive | 260 | 80 | 4 |
| Gray-area | 110 | 169 | 41 |
| Offensive | 15 | 40 | 81 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import numpy as np
tokenizer = AutoTokenizer.from_pretrained("studio-ousia/luke-japanese-base-lite")
model = AutoModelForSequenceClassification.from_pretrained("TomokiFujihara/luke-japanese-base-lite-offensiveness-estimation", trust_remote_code=True)
inputs = tokenizer.encode_plus(text, return_tensors='pt')
outputs = model(inputs['input_ids'], inputs['attention_mask']).detach().numpy()[0][:3]
minimum = np.min(outputs)
if minimum < 0:
outputs = outputs - minimum
score = outputs / np.sum(outputs)
print(f'攻撃的でない発言: {score[0]:.1%},\nグレーゾーンの発言: {score[1]:.1%},\n攻撃的な発言: {score[2]:.1%}')
E-mail: [email protected]
@inproceedings{fujihara2024offensiveness,
title={ソーシャルメディア上の発話の攻撃性推定と会話補助},
author={藤原 知樹 and 伊藤 彰則 and 能勢隆},
booktitle={言語処理学会第30回年次大会発表論文集},
year={2024}
}