Python 理解Spacy和x27;s记分器输出

Python 理解Spacy和x27;s记分器输出,python,spacy,ner,Python,Spacy,Ner,我正在评估使用Spacy构建的自定义NER模型。我正在使用斯帕西的记分员课程评估训练集 def Eval(examples): # test the saved model print("Loading from", './model6/') ner_model = spacy.load('./model6/') scorer = Scorer() try: for input_, annot in examples:

我正在评估使用Spacy构建的自定义NER模型。我正在使用斯帕西的记分员课程评估训练集

    def Eval(examples):
    # test the saved model
    print("Loading from", './model6/')
    ner_model = spacy.load('./model6/')

    scorer = Scorer()
    try:
        for input_, annot in examples:
            doc_gold_text = ner_model.make_doc(input_)
            gold = GoldParse(doc_gold_text, entities=annot['entities'])
            pred_value = ner_model(input_)
            scorer.score(pred_value, gold)
    except Exception as e: print(e)

    print(scorer.scores)
它工作正常,但我不理解输出。以下是我从每一套训练中得到的信息

{'uas': 0.0, 'las': 0.0, 'ents_p': 90.14084507042254, 'ents_r': 92.7536231884058, 'ents_f': 91.42857142857143, 'tags_acc': 0.0, 'token_acc': 100.0}

{'uas': 0.0, 'las': 0.0, 'ents_p': 91.12227805695142, 'ents_r': 93.47079037800687, 'ents_f': 92.28159457167091, 'tags_acc': 0.0, 'token_acc': 100.0}

{'uas': 0.0, 'las': 0.0, 'ents_p': 92.45614035087719, 'ents_r': 92.9453262786596, 'ents_f': 92.70008795074759, 'tags_acc': 0.0, 'token_acc': 100.0}

{'uas': 0.0, 'las': 0.0, 'ents_p': 94.5993031358885, 'ents_r': 94.93006993006993, 'ents_f': 94.76439790575917, 'tags_acc': 0.0, 'token_acc': 100.0}

{'uas': 0.0, 'las': 0.0, 'ents_p': 92.07920792079209, 'ents_r': 93.15525876460768, 'ents_f': 92.61410788381743, 'tags_acc': 0.0, 'token_acc': 100.0}
有人知道钥匙是什么吗?我查阅了斯帕西的文件,什么也没找到

谢谢

  • UAS(未标记的附件分数)和LAS(标记的附件分数)是评估依赖项解析的标准度量。UAS是头部已正确分配的令牌的比例,LAS是头部已正确分配有正确依赖标签(主题、对象等)的令牌的比例
  • ents\u p
    ents\u r
    ents\u f
    是NER任务的精确度、召回率和可执行性
  • tags\u acc
    是词性标注的准确性
  • token\u acc
    似乎是令牌分段的精度

此外,
ents\u p
ents\u r
ents\u f
是基于每个实体计算的。也就是说,spaCy考虑文档中的所有实体,以查找真阳性、假阳性和假阴性。我有一个令人印象深刻的开始,只要一个句子中的预测实体与黄金集匹配,它就会+1到真正的正计数,但我错了。对于那些有兴趣深入研究的人,一定要查看
language.py
scorer.py
evaluate.py
来完成计算。