ai4privacy-ja — 日本語PII検出NERモデル
日本語テキスト中の個人情報(PII)を検出するためのトークン分類モデルです。 cl-tohoku/bert-base-japanese-v3 をベースに、合成データでfine-tuningしています。
検出対象(9種)
| Entity | 説明 | 例 |
|---|---|---|
| PERSON_NAME | 氏名 | 田中太郎、鈴木 |
| メールアドレス | tanaka@example.com | |
| PHONE | 電話番号 | 090-1234-5678 |
| ADDRESS | 住所 | 東京都渋谷区神宮前1-2-3 |
| DATE | 日付 | 1990年4月1日 |
| ORGANIZATION | 組織名 | 株式会社テスト |
| BANK_ACCOUNT | 銀行口座番号 | 1234567 |
| USER_ID | ユーザーID | user-1234 |
| PASSWORD | パスワード | Pass@123 |
ベンチマーク結果
テストデータ(400件)での評価結果:
| Entity | Precision | Recall | F1 |
|---|---|---|---|
| ADDRESS | 0.99 | 1.00 | 1.00 |
| PHONE | 0.97 | 1.00 | 0.99 |
| BANK_ACCOUNT | 0.97 | 0.98 | 0.98 |
| USER_ID | 0.97 | 0.98 | 0.98 |
| PERSON_NAME | 0.96 | 0.98 | 0.97 |
| ORGANIZATION | 0.95 | 0.96 | 0.96 |
| DATE | 0.95 | 0.97 | 0.96 |
| 0.96 | 0.96 | 0.96 | |
| PASSWORD | 0.95 | 0.95 | 0.95 |
| micro avg | 0.96 | 0.98 | 0.97 |
文単位正答率: 94.2%(377/400)
使い方
from transformers import pipeline
ner = pipeline(
"token-classification",
model="athena-tech/ai4privacy-ja",
aggregation_strategy="simple",
)
text = "田中太郎様の電話番号は090-1234-5678です。"
results = ner(text)
for entity in results:
print(f"{entity['word']} -> {entity['entity_group']} ({entity['score']:.3f})")
必要なライブラリ
pip install transformers fugashi unidic-lite
学習データ
- データセット: athena-tech/atf-masking-ja (revision: v2.1-gpt4.1-2000)
- 学習データ: 1,400件 / 検証: 200件 / テスト: 400件
- テキスト生成: OpenAI GPT-4.1(67場面 x 26意図、文体バリエーション付き)
- PII値: CRMデータ(80%)+ Faker ja_JP(20%)
学習設定
| パラメータ | 値 |
|---|---|
| ベースモデル | cl-tohoku/bert-base-japanese-v3 |
| max_length | 512 |
| epochs | 10 (early stopping) |
| batch_size | 16 |
| learning_rate | 3e-5 (linear warmup 10%) |
| optimizer | AdamW |
| ラベル体系 | BIO (IOB2)、19ラベル |
ライセンス
Apache License 2.0
- Downloads last month
- 207
Model tree for athena-tech/ai4privacy-ja
Base model
tohoku-nlp/bert-base-japanese-v3