Downloads · 30 days
40
26% of all-time downloads
TomokiFujihara/luke-japanese-large-lite-offensiveness-estimation
luke-japanese-large-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.
このモデルは、 studio-ousia/luke-japanese-large-lite をSNS上のコメントに人手で攻撃性評価を行ったデータセットでFine-tuningすることで作成しました。
Downloads · 30 days
40
26% of all-time downloads
All-time downloads
153
Public
Repo size
1.7 GB
Likes
0
Public
Click a slice to open those files.
.bin1.7 GB · 100%
From the Hugging Face model README
このモデルは、 studio-ousia/luke-japanese-large-lite をSNS上のコメントに人手で攻撃性評価を行ったデータセットでFine-tuningすることで作成しました。
Summary
| 評価指標 | スコア |
|---|---|
| F値_NOT | 73.9 % |
| F値_GRY | 55.4 % |
| F値_OFF | 62.6 % |
| マクロ平均F値 | 64.0 % |
| 正解率 | 65.0 % |
Confusion matrix
| 正解ラベル \ 予測結果 | Not Offensive | Gray-area | Offensive |
|---|---|---|---|
| Not Offensive | 269 | 73 | 2 |
| Gray-area | 109 | 169 | 42 |
| Offensive | 6 | 48 | 82 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import numpy as np
tokenizer = AutoTokenizer.from_pretrained("studio-ousia/luke-japanese-large-lite")
model = AutoModelForSequenceClassification.from_pretrained("TomokiFujihara/luke-japanese-large-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]