Views
No views yet
tsmatz/xlm-roberta-ner-japanese をベースにファインチューニングを行い、医療分野での情報抽出や匿名化に役立つよう最適化しています。| ラベル | 説明 |
|---|---|
| PER | 人名 |
| ORG | 組織名 |
| ORG-P | 組織の部門 |
| ORG-O | 組織その他 |
| LOC | 地名 |
| INS | 施設名(病院・学校など) |
| PRD | 製品名 |
| EVT | イベント名 |
| O | その他(非エンティティ) |
1from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline
2
3model = AutoModelForTokenClassification.from_pretrained("Tetsuo3003/ner-medical-japanese")
4tokenizer = AutoTokenizer.from_pretrained("Tetsuo3003/ner-medical-japanese")
5ner_pipeline = pipeline("ner", model=model, tokenizer=tokenizer, aggregation_strategy="simple")
6
7text = "金丸先生が松本市にある石川クリニックに通院しました。"
8results = ner_pipeline(text)
9for entity in results:
10 print(f"{entity['word']} → {entity['entity_group']} (score: {entity['score']:.2f})")