Downloads · 30 days
124
6% of all-time downloads
Mizuiro-sakura/bert-large-japanese-v2-finetuned-ner
bert-large-japanese-v2-finetuned-ner is a token classification model from Mizuiro-sakura. Use it when you need labels on individual words, such as names. It is set up for transformers. The card lists the license as mit.
このモデルはcl-tohoku/bert-large-japanese-v2を Wikipediaを用いた日本語の固有表現抽出データセット(ストックマーク社、https://github.com/stockmarkteam/ner-wikipedia-dataset )を用いてファインチューニングしたものです。
Downloads · 30 days
124
6% of all-time downloads
All-time downloads
2K
Public
Parameters
336M
2.7 GB on disk
Likes
4
Public
Click a slice to open those files.
.bin1.3 GB · 50%
How the weights are stored.
F32336M · 100%
From the Hugging Face model README
このモデルはcl-tohoku/bert-large-japanese-v2を Wikipediaを用いた日本語の固有表現抽出データセット(ストックマーク社、https://github.com/stockmarkteam/ner-wikipedia-dataset )を用いてファインチューニングしたものです。
固有表現抽出(NER)タスクに用いることができます。
This model is fine-tuned by using Wikipedia dataset.
You could use this model for NER tasks.
全体:0.8620626488367833
| precision | recall | f1-score | support | |
|---|---|---|---|---|
| その他の組織名 | 0.80 | 0.78 | 0.79 | 238 |
| イベント名 | 0.82 | 0.88 | 0.85 | 215 |
| 人名 | 0.92 | 0.95 | 0.93 | 549 |
| 地名 | 0.90 | 0.89 | 0.89 | 446 |
| 政治的組織名 | 0.86 | 0.91 | 0.89 | 263 |
| 施設名 | 0.86 | 0.91 | 0.88 | 241 |
| 法人名 | 0.88 | 0.89 | 0.88 | 487 |
| 製品名 | 0.62 | 0.68 | 0.65 | 252 |
| micro avg | 0.85 | 0.87 | 0.86 | 2691 |
| macro avg | 0.83 | 0.86 | 0.85 | 2691 |
| weighted avg | 0.85 | 0.87 | 0.86 | 2691 |
fugashiとtransformers,unidic_liteをインストールして (pip install fugashi, pip install unidic_lite, pip install transformers) 以下のコードを実行することで、NERタスクを解かせることができます。 please execute this code.
from transformers import AutoTokenizer,pipeline, AutoModelForTokenClassification
tokenizer = AutoTokenizer.from_pretrained('Mizuiro-sakura/bert-large-japanese-v2-finetuned-ner')
model=AutoModelForTokenClassification.from_pretrained('Mizuiro-sakura/bert-large-japanese-v2-finetuned-ner') # 学習済みモデルの読み込み
text=('昨日は東京で買い物をした')
ner=pipeline('ner', model=model, tokenizer=tokenizer)
result=ner(text)
print(result)