python - 了解 Spacy 的得分手输出
问题描述
我正在评估使用 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, '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}
有谁知道钥匙是什么?我查看了 Spacy 的文档,但找不到任何东西。
谢谢!
解决方案
- UAS(未标记附件分数)和 LAS(标记附件分数)是评估依赖项解析的标准指标。UAS 是其头部被正确分配的令牌的比例,LAS 是其头部被正确分配正确依赖标签(主题、对象等)的令牌的比例。
ents_p
,ents_r
,ents_f
是 NER 任务的准确率、召回率和fscore。tags_acc
是词性标注准确率。token_acc
似乎是令牌分割的精度。
推荐阅读
- react-native - ReactNative ScrollView 在不同平台上无法正常工作
- opengl - 如何制作范围有限的法线贴图着色器?
- pygame - 如何在pygame中设置图像的位置?
- python - Python试图更新二维numpy数组中的值,值不更新
- c# - WinSCP 给出我的主机密钥指纹不正确但随机使用相同指纹的错误
- c++ - 在静态链接的二进制文件中获取进程内回溯
- c# - Xamarin.Forms Android 的自定义渲染器(条目)中的 OnElementChanged 仅被调用一次
- identityserver4 - 快速入门示例代码 - NuGet 依赖项已损坏
- python - 如何从 Mac OS 目录中的所有文件中获取 MAC 时间/文件属性
- python - 无法使用python从网络下载某些图像