许可证: cc-by-4.0
数据集:
- wikiann
语言:
- pl
管道标签: token-classification
小部件:
- 文本: "我叫Grzegorz Brzęszczyszczykiewicz,来自Chrząszczyżewoszczyc,在Łękołodzki县办公室工作"
- 文本: "我是Krzysiek,在体育部工作"
- 文本: "她叫Wiktoria,在克拉科夫AGH工作"
模型索引:
- 名称: herbert-base-ner
结果:
- 任务:
名称: 标记分类
类型: token-classification
数据集:
名称: wikiann
类型: wikiann
配置: pl
分割: test
参数: pl
指标:
- 名称: 精确度
类型: precision
值: 0.8857142857142857
- 名称: 召回率
类型: recall
值: 0.9070532179048386
- 名称: F1分数
类型: f1
值: 0.896256755412619
- 名称: 准确率
类型: accuracy
值: 0.9581463871961428
herbert-base-ner
模型描述
herbert-base-ner 是一个经过微调的HerBERT模型,可用于命名实体识别。
它经过训练可以识别三种类型的实体:人物(PER)、地点(LOC)和组织(ORG)。
具体来说,该模型是基于allegro/herbert-base-cased模型,并在wikiann数据集的波兰语子集上进行了微调。
使用方法
您可以使用Transformers的pipeline进行NER任务。
from transformers import AutoTokenizer, AutoModelForTokenClassification
from transformers import pipeline
model_checkpoint = "pczarnik/herbert-base-ner"
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
model = AutoModelForTokenClassification.from_pretrained(model_checkpoint)
nlp = pipeline("ner", model=model, tokenizer=tokenizer)
example = "我叫Grzegorz Brzęszczyszczykiewicz,来自"\
"Chrząszczyżewoszczyc,在Łękołodzki县办公室工作"
ner_results = nlp(example)
print(ner_results)
[{'entity': 'B-PER', 'score': 0.99451494, 'index': 4, 'word': 'Grzegorz</w>', 'start': 12, 'end': 20},
{'entity': 'I-PER', 'score': 0.99758506, 'index': 5, 'word': 'B', 'start': 21, 'end': 22},
{'entity': 'I-PER', 'score': 0.99749386, 'index': 6, 'word': 'rzę', 'start': 22, 'end': 25},
{'entity': 'I-PER', 'score': 0.9973041, 'index': 7, 'word': 'szczy', 'start': 25, 'end': 30},
{'entity': 'I-PER', 'score': 0.99682057, 'index': 8, 'word': 'szczy', 'start': 30, 'end': 35},
{'entity': 'I-PER', 'score': 0.9964832, 'index': 9, 'word': 'kiewicz</w>', 'start': 35, 'end': 42},
{'entity': 'B-LOC', 'score': 0.99427444, 'index': 14, 'word': 'Chrzą', 'start': 55, 'end': 60},
{'entity': 'I-LOC', 'score': 0.99143463, 'index': 15, 'word': 'szczy', 'start': 60, 'end': 65},
{'entity': 'I-LOC', 'score': 0.9922201, 'index': 16, 'word': 'że', 'start': 65, 'end': 67},
{'entity': 'I-LOC', 'score': 0.9918464, 'index': 17, 'word': 'wo', 'start': 67, 'end': 69},
{'entity': 'I-LOC', 'score': 0.9900766, 'index': 18, 'word': 'szczy', 'start': 69, 'end': 74},
{'entity': 'I-LOC', 'score': 0.98823845, 'index': 19, 'word': 'c</w>', 'start': 74, 'end': 75},
{'entity': 'B-ORG', 'score': 0.6808262, 'index': 23, 'word': 'Łę', 'start': 87, 'end': 89},
{'entity': 'I-ORG', 'score': 0.7763973, 'index': 24, 'word': 'ko', 'start': 89, 'end': 91},
{'entity': 'I-ORG', 'score': 0.77731717, 'index': 25, 'word': 'ło', 'start': 91, 'end': 93},
{'entity': 'I-ORG', 'score': 0.9108255, 'index': 26, 'word': 'dzkim</w>', 'start': 93, 'end': 98},
{'entity': 'I-ORG', 'score': 0.98050755, 'index': 27, 'word': 'Urzędzie</w>', 'start': 99, 'end': 107},
{'entity': 'I-ORG', 'score': 0.9789752, 'index': 28, 'word': 'Powiatowym</w>', 'start': 108, 'end': 118}]