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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# KAi Toxicity Filter
|
| 2 |
+
|
| 3 |
+
日本語の有害表現検出に特化したモデル
|
| 4 |
+
Japanese toxicity detection model specialized for Japanese language
|
| 5 |
+
|
| 6 |
+
---
|
| 7 |
+
|
| 8 |
+
## 日本語版
|
| 9 |
+
|
| 10 |
+
### モデル概要
|
| 11 |
+
|
| 12 |
+
日本語テキストを有害/非有害に分類するモデルです。日本語特有の表現やニュアンスに最適化されています。
|
| 13 |
+
|
| 14 |
+
### 学習データ
|
| 15 |
+
|
| 16 |
+
以下のデータで学習されています:
|
| 17 |
+
|
| 18 |
+
- **inspection-ai/japanese-toxic-dataset** (Apache 2.0)
|
| 19 |
+
- 出典: https://github.com/inspection-ai/japanese-toxic-dataset
|
| 20 |
+
- **KAi専用カスタムデータセット**
|
| 21 |
+
- **自動生成されたハードネガティブサンプル**
|
| 22 |
+
- **自動生成された有害表現バリエーション**(バランス調整用)
|
| 23 |
+
|
| 24 |
+
### モデル詳細
|
| 25 |
+
|
| 26 |
+
- **ベースモデル**: `cl-tohoku/bert-base-japanese-v3`
|
| 27 |
+
- **タスク**: 二値分類(有害/非有害)
|
| 28 |
+
- **学習手法**: 連続値ラベル学習(0.0〜1.0)+ BCEWithLogitsLoss
|
| 29 |
+
- **特徴**: 改善された学習手法による日本語表現の最適化
|
| 30 |
+
|
| 31 |
+
### 使用例
|
| 32 |
+
|
| 33 |
+
```python
|
| 34 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
| 35 |
+
import torch
|
| 36 |
+
|
| 37 |
+
model_name = "b4c0n/KAi-toxicity-filter"
|
| 38 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 39 |
+
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
| 40 |
+
|
| 41 |
+
text = "死ね"
|
| 42 |
+
inputs = tokenizer(text, return_tensors="pt")
|
| 43 |
+
outputs = model(**inputs)
|
| 44 |
+
|
| 45 |
+
toxic_logit = outputs.logits[0][1].item()
|
| 46 |
+
toxic_prob = torch.sigmoid(torch.tensor(toxic_logit)).item()
|
| 47 |
+
|
| 48 |
+
print(f"有害確率: {toxic_prob:.2%}")
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
### 使用目的
|
| 52 |
+
|
| 53 |
+
KAi サービスにおける日本語テキストの有害コンテンツ検出・フィルタリングのために開発されました。
|
| 54 |
+
|
| 55 |
+
**主な用途:**
|
| 56 |
+
- ユーザー生成コンテンツのモデレーション
|
| 57 |
+
- 対話型AIの安全性フィルタリング
|
| 58 |
+
- 日本語ソーシャルメディアコンテンツの有害性検出
|
| 59 |
+
|
| 60 |
+
### 制限事項
|
| 61 |
+
|
| 62 |
+
- 単文レベルの分類(文脈考慮なし)
|
| 63 |
+
- 誤検出(偽陽性/偽陰性)の可能性
|
| 64 |
+
- 文化的・地域的文脈により判定が変わる可能性
|
| 65 |
+
- 人間のレビューなしの自動検閲には適していません
|
| 66 |
+
|
| 67 |
+
### 倫理的配慮
|
| 68 |
+
|
| 69 |
+
⚠️ このモデルは有害コンテンツデータで学習されています。責任を持って使用してください。
|
| 70 |
+
|
| 71 |
+
- 正当な表現を誤検出する可能性があります
|
| 72 |
+
- コンテンツ削除の唯一の判断基準として使用すべきではありません
|
| 73 |
+
- 定期的な人間によるレビューを推奨します
|
| 74 |
+
- 自動フィルタリング実装時は表現の自由を考慮してください
|
| 75 |
+
|
| 76 |
+
### パフォーマンス
|
| 77 |
+
|
| 78 |
+
日本語の有害表現検出タスクにおいて高いパフォーマンスを発揮します。
|
| 79 |
+
|
| 80 |
+
### ライセンス
|
| 81 |
+
|
| 82 |
+
Apache 2.0
|
| 83 |
+
|
| 84 |
+
### 謝辞
|
| 85 |
+
|
| 86 |
+
このモデルは [inspection-ai/japanese-toxic-dataset](https://github.com/inspection-ai/japanese-toxic-dataset) (Apache 2.0 License) のデータを使用しています。
|
| 87 |
+
|
| 88 |
+
---
|
| 89 |
+
|
| 90 |
+
## English
|
| 91 |
+
|
| 92 |
+
### Model Description
|
| 93 |
+
|
| 94 |
+
This model classifies Japanese text as toxic or non-toxic, specifically optimized for Japanese language nuances and expressions.
|
| 95 |
+
|
| 96 |
+
### Training Data
|
| 97 |
+
|
| 98 |
+
This model was trained on:
|
| 99 |
+
|
| 100 |
+
- **inspection-ai/japanese-toxic-dataset** (Apache 2.0)
|
| 101 |
+
- Source: https://github.com/inspection-ai/japanese-toxic-dataset
|
| 102 |
+
- **Custom dataset** created specifically for KAi
|
| 103 |
+
- **Automatically generated hard negative samples**
|
| 104 |
+
- **Automatically generated toxic variations** for balance
|
| 105 |
+
|
| 106 |
+
### Model Details
|
| 107 |
+
|
| 108 |
+
- **Base Model**: `cl-tohoku/bert-base-japanese-v3`
|
| 109 |
+
- **Task**: Binary Text Classification (toxic/not-toxic)
|
| 110 |
+
- **Training**: Continuous label learning (0.0-1.0) with BCEWithLogitsLoss
|
| 111 |
+
- **Special Feature**: Optimized for Japanese language with improved training techniques
|
| 112 |
+
|
| 113 |
+
### Usage
|
| 114 |
+
|
| 115 |
+
```python
|
| 116 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
| 117 |
+
import torch
|
| 118 |
+
|
| 119 |
+
model_name = "your-username/KAi-toxicity-filter"
|
| 120 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 121 |
+
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
| 122 |
+
|
| 123 |
+
text = "死ね"
|
| 124 |
+
inputs = tokenizer(text, return_tensors="pt")
|
| 125 |
+
outputs = model(**inputs)
|
| 126 |
+
|
| 127 |
+
toxic_logit = outputs.logits[0][1].item()
|
| 128 |
+
toxic_prob = torch.sigmoid(torch.tensor(toxic_logit)).item()
|
| 129 |
+
|
| 130 |
+
print(f"Toxic probability: {toxic_prob:.2%}")
|
| 131 |
+
```
|
| 132 |
+
|
| 133 |
+
### Intended Use
|
| 134 |
+
|
| 135 |
+
This model was developed for the KAi service to detect and filter harmful content in Japanese text.
|
| 136 |
+
|
| 137 |
+
**Primary Use Cases:**
|
| 138 |
+
- Content moderation for user-generated text
|
| 139 |
+
- Safety filtering in conversational AI
|
| 140 |
+
- Toxicity detection in Japanese social media content
|
| 141 |
+
|
| 142 |
+
### Limitations
|
| 143 |
+
|
| 144 |
+
- Single sentence classification (no context consideration)
|
| 145 |
+
- May have false positives/negatives
|
| 146 |
+
- Cultural and regional context may affect predictions
|
| 147 |
+
- Not designed for automatic censorship without human review
|
| 148 |
+
|
| 149 |
+
### Ethical Considerations
|
| 150 |
+
|
| 151 |
+
⚠️ This model was trained on toxic content data. Please use responsibly.
|
| 152 |
+
|
| 153 |
+
- The model may produce false positives affecting legitimate speech
|
| 154 |
+
- Should not be used as the sole decision-maker for content removal
|
| 155 |
+
- Regular human review is recommended
|
| 156 |
+
- Consider freedom of expression when implementing automated filtering
|
| 157 |
+
|
| 158 |
+
### Performance
|
| 159 |
+
|
| 160 |
+
The model shows strong performance on Japanese toxicity detection tasks.
|
| 161 |
+
|
| 162 |
+
### License
|
| 163 |
+
|
| 164 |
+
Apache 2.0
|
| 165 |
+
|
| 166 |
+
### Citation
|
| 167 |
+
|
| 168 |
+
```bibtex
|
| 169 |
+
@misc{kai-toxicity-filter,
|
| 170 |
+
author = {Your Name},
|
| 171 |
+
title = {KAi Toxicity Filter: Japanese Toxicity Detection Model},
|
| 172 |
+
year = {2025},
|
| 173 |
+
publisher = {HuggingFace},
|
| 174 |
+
howpublished = {\url{https://huggingface.co/your-username/KAi-toxicity-filter}}
|
| 175 |
+
}
|
| 176 |
+
```
|
| 177 |
+
|
| 178 |
+
### Acknowledgments
|
| 179 |
+
|
| 180 |
+
This model uses data from [inspection-ai/japanese-toxic-dataset](https://github.com/inspection-ai/japanese-toxic-dataset) (Apache 2.0 License).
|