ML.NET显示哪个分数与哪个标签相关 [英] ML.NET Show which score relates to which label

查看:86
本文介绍了ML.NET显示哪个分数与哪个标签相关的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用ML.Net,我正在使用分类器进行文本解释.预测的得分列为float []和预测的标签.这是因为最高分数与预测标签有关,但其他分数只是浮点数,没有特定的顺序.我如何知道哪个分数与哪个标签相关?如何查看加权第二高的标签?

With ML.Net I am using a classifier for text interpretation. The prediction has a score column as float[] and a predicted label. This works in that the highest score relates to the predicted label, but the other scores are just floats in no particular order. How do I know which score relates to which label? How can I see what the second highest weighted label?

例如,我得到以下信息:0.000050090.008930760.12747630.62097870.2425644

For example, I get this back: 0.00005009 0.00893076 0.1274763 0.6209787 0.2425644

0.6是我预测的标签,但我还需要查看0.24是哪个标签,以便了解为什么它会混淆.

The 0.6 is my predicted label, but I also need to see which label the 0.24 is so I can see why it is confused.

标签是诸如"Greeting"或"Joke"之类的文本字符串,它们在管道中被字典化,所以也许这就是为什么它们的顺序不正确?

Labels are text strings such as "Greeting" or "Joke" which were Dictionarized in the pipeline, so maybe that is why they aren't in the correct order?

ML.Net中是否可以将两者链接在一起?要显示哪个分数与哪个标签相关?

Is there any way in ML.Net to link the two together? To show which score relates to which label?

推荐答案

您可以使用以下代码获取与分数相对应的标签:

You can get the labels corresponding to the scores using the following code:

string[] scoreLabels;
model.TryGetScoreLabelNames(out scoreLabels);

可以在此处请注意,这可能会随着即将发布的ML.NET 0.6 API改变.这些API将直接公开 Schema 并允​​许获取此信息(以及其他有用的信息).这可能类似于 <代码> TryGetScoreLabelNames 可以立即使用.

Note that this may change with the upcoming ML.NET 0.6 APIs. These APIs will expose the Schema directly and enable getting this information (along with other useful information). This might be similar to how TryGetScoreLabelNames works today.

这篇关于ML.NET显示哪个分数与哪个标签相关的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆