模型:
spaCy NER模型用于西班牙语,使用与圣雅各布之路相关的旅游采访进行训练。它识别四种类型的实体: 地点 (LOC), 组织机构 (ORG), 人物 (PER) 和其他 (MISC)。它是使用 PlanTL-GOB-ES/roberta-base-bne 进行微调的。
| Feature | Description |
|---|---|
| Name | es_spacy_ner_cds_trf |
| Version | 0.0.2 |
| spaCy | >=3.5.2,<3.6.0 |
| Default Pipeline | transformer , ner |
| Components | transformer , ner |
| Component | Labels |
|---|---|
| ner | LOC , MISC , ORG , PER |
您可以将此模型与 spaCy 的 NER 管道一起使用。
import spacy
from spacy.pipeline import merge_entities
nlp = spacy.load("es_spacy_ner_cds_trf")
nlp.add_pipe('sentencizer')
example = "Fue antes de llegar a Sigüeiro, en el Camino de Santiago. Si te metes en el Franco desde la Alameda, vas hacia la Catedral. Y allí precisamente es Santiago el patrón del pueblo."
ner_pipe = nlp(example)
print(ner_pipe.ents)
for token in merge_entities(ner_pipe):
print(token.text, token.ent_type_)
待完成
| entity | precision | recall | f1 |
|---|---|---|---|
| LOC | 0.985 | 0.987 | 0.986 |
| MISC | 0.862 | 0.865 | 0.863 |
| ORG | 0.938 | 0.779 | 0.851 |
| PER | 0.921 | 0.941 | 0.931 |
| micro avg | 0.971 | 0.972 | 0.971 |
| macro avg | 0.926 | 0.893 | 0.908 |
| weighted avg | 0.971 | 0.972 | 0.971 |