calculate all the metrics of a custom Named Entity recognition (NER)Model using Spacy and ner.manual

北城以北 提交于 2019-12-24 07:39:01

问题


i have made a spacy (2.1.8) model which works on some labels like data, time, coordinate,stars...

now I want to see all the metrics related to each entity using spacy. something like this


           precision    recall  f1-score   support

  B-LOC      0.810     0.784     0.797      1084
  I-LOC      0.690     0.637     0.662       325
 B-MISC      0.731     0.569     0.640       339
 I-MISC      0.699     0.589     0.639       557
  B-ORG      0.807     0.832     0.820      1400
  I-ORG      0.852     0.786     0.818      1104
  B-PER      0.850     0.884     0.867       735
  I-PER      0.893     0.943     0.917       634

I have noticed that I can use Scorer for that:

https://spacy.io/api/scorer

I write something like this

scorer = nlp.evaluate(docs_golds, verbose=True)
print(scorer.scores)

but I do not know how to make a "docs-golds" form my text? I have data in JsonL format and also read the data as text in my notebook and then used my model for NER like this

doc=nlp(str1)

do you have any idea how can I solve this and generally what do you recommend to show the performance of my model I have accuracy but of course accuracy is not enough for ner task?

I have read this

is there a way with spaCy's NER to calculate metrics per entity type?

but I want to do it by spacy. It seems it is possible in spacy 2

来源:https://stackoverflow.com/questions/58376213/calculate-all-the-metrics-of-a-custom-named-entity-recognition-nermodel-using

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!