🚀 camembert-ner: NERタスク用にcamemBERTをファインチューニングしたモデル
このcamembert-nerは、固有表現認識(NER)タスク用にcamemBERTをファインチューニングしたモデルです。wikiner-frデータセットを使用して訓練され、電子メールやチャットデータで他のモデルを上回る性能を発揮します。
🚀 クイックスタート
概要
[camembert-ner]は、wikiner-frデータセット上でcamemBERTをファインチューニングしたNERモデルです。このモデルはwikiner-frデータセット(約170,634文)で訓練され、電子メールやチャットデータで検証されました。特に、大文字で始まらない固有表現に対して良好な性能を示します。
訓練データ
訓練データは以下のように分類されています。
属性 |
詳情 |
モデルタイプ |
NERモデル |
訓練データ |
wikiner-frデータセット(約170,634文) |
略称 |
説明 |
O |
固有表現外 |
MISC |
その他の固有表現 |
PER |
人名 |
ORG |
組織名 |
LOC |
地名 |
HuggingFaceでのcamembert-nerの使用方法
camembert-nerとサブワードトークナイザーの読み込み
from transformers import AutoTokenizer, AutoModelForTokenClassification
tokenizer = AutoTokenizer.from_pretrained("Jean-Baptiste/camembert-ner")
model = AutoModelForTokenClassification.from_pretrained("Jean-Baptiste/camembert-ner")
テキストサンプル(ウィキペディアから)の処理
from transformers import pipeline
nlp = pipeline('ner', model=model, tokenizer=tokenizer, aggregation_strategy="simple")
nlp("Apple est créée le 1er avril 1976 dans le garage de la maison d'enfance de Steve Jobs à Los Altos en Californie par Steve Jobs, Steve Wozniak et Ronald Wayne14, puis constituée sous forme de société le 3 janvier 1977 à l'origine sous le nom d'Apple Computer, mais pour ses 30 ans et pour refléter la diversification de ses produits, le mot « computer » est retiré le 9 janvier 2015.")
[{'entity_group': 'ORG',
'score': 0.9472818374633789,
'word': 'Apple',
'start': 0,
'end': 5},
{'entity_group': 'PER',
'score': 0.9838564991950989,
'word': 'Steve Jobs',
'start': 74,
'end': 85},
{'entity_group': 'LOC',
'score': 0.9831605950991312,
'word': 'Los Altos',
'start': 87,
'end': 97},
{'entity_group': 'LOC',
'score': 0.9834540486335754,
'word': 'Californie',
'start': 100,
'end': 111},
{'entity_group': 'PER',
'score': 0.9841555754343668,
'word': 'Steve Jobs',
'start': 115,
'end': 126},
{'entity_group': 'PER',
'score': 0.9843501806259155,
'word': 'Steve Wozniak',
'start': 127,
'end': 141},
{'entity_group': 'PER',
'score': 0.9841533899307251,
'word': 'Ronald Wayne',
'start': 144,
'end': 157},
{'entity_group': 'ORG',
'score': 0.9468960364659628,
'word': 'Apple Computer',
'start': 243,
'end': 257}]
モデルの性能(評価指標: seqeval)
全体の性能
指標 |
値 |
適合率 |
0.8859 |
再現率 |
0.8971 |
F1値 |
0.8914 |
固有表現ごとの性能
固有表現の種類 |
適合率 |
再現率 |
F1値 |
PER |
0.9372 |
0.9598 |
0.9483 |
ORG |
0.8099 |
0.8265 |
0.8181 |
LOC |
0.8905 |
0.9005 |
0.8955 |
MISC |
0.8175 |
0.8117 |
0.8146 |
関連記事
興味がある方へ。このモデルの結果を使用して、電子メールの署名検出用のLSTMモデルを訓練する方法についての短い記事があります。
https://medium.com/@jean-baptiste.polle/lstm-model-for-email-signature-detection-8e990384fefa
📄 ライセンス
このモデルはMITライセンスの下で提供されています。