加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Python > 正文

python – 了解Spacy的Scorer输出

发布时间:2020-12-20 11:05:11 所属栏目:Python 来源:网络整理
导读:我正在评估我使用Spacy构建的自定义NER模型.我正在使用Spacy的Scorer课程评估训练集. def Eval(examples): # test the saved model print("Loading from",'./model6/') ner_model = spacy.load('./model6/') scorer = Scorer() try: for input_,annot in exa
我正在评估我使用Spacy构建的自定义NER模型.我正在使用Spacy的Scorer课程评估训练集.

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,'ents_p': 91.12227805695142,'ents_r': 93.47079037800687,'ents_f': 92.28159457167091,'ents_p': 92.45614035087719,'ents_r': 92.9453262786596,'ents_f': 92.70008795074759,'ents_p': 94.5993031358885,'ents_r': 94.93006993006993,'ents_f': 94.76439790575917,'ents_p': 92.07920792079209,'ents_r': 93.15525876460768,'ents_f': 92.61410788381743,'token_acc': 100.0}

有谁知道钥匙是什么?我查看了Spacy的文档,找不到任何内容.

谢谢!

解决方法

> UAS(未标记的附件分数)和LAS(标记的附件分数)是评估依赖性分析的标准度量. UAS是头部已正确分配的令牌的比例,LAS是头部已正确分配正确依赖标签(主题,对象等)的令牌的比例.
> ents_p,ents_r,ents_f是NER任务的精度,召回和 fscore. > tags_acc是POS标记的准确性. > token_acc似乎是令牌分割的精确度.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读