当我的测试文件包含135时,为什么模型的FastText测试仅返回1个例子

问题描述 投票:0回答:1

我正在尝试测试我在测试文件(test.txt)上使用fastText制作的模型(model.bin)。在这个测试文件中,我有135个标签化数据。我希望fastText能够在这个例子中测试我的模型,相反,它只测试了1个例子。这个问题来自哪里?

我已经尝试用另一个模型和另一个测试文件来做这样的事情,并且都很好用。

这是我测试我的模型的方式。 model_baby.bin是模型,test.data.txt是我的测试文件。

./fasttext test model_baby.bin test.data.txt 

N       1

P@1     1

R@1     0.0164

Number of examples: 1

这是我的测试文件的摘录

__label__4.0我喜欢你可以隐藏你的东西的事实。只有在中间和底部保持它的带子可以更好地为您的汽车设计。这里有足够的空间。 __label__5.0这非常隐藏我们的ipad。特别是那些我们都跳出来并使用洗手间的快速停留。它拉链,折叠并且为后座的孩子们保留了所有东西。 __label__3.0

由于我的测试文件中有超过1个标记示例,我希望输出“示例数:”至少大于1,但实际值为“1”

fasttext
1个回答
0
投票

从官方文档(https://fasttext.cc/docs/en/supervised-tutorial.html):文本文件的每一行都包含一个标签列表,后面是相应的文档。所有标签都以__label__前缀开头,这就是fastText识别什么是标签或什么是单词的方式。

我不太了解你的摘录。我想它应该是这样的:

__label__4.0 I love the fact you can hide your stuff. Only down is that the straps to hold it at midpoint and bottom could be better designed for your car. It's got plenty of room which is great. 
__label__5.0 This hid our ipad wonderfully. Especially for those quick stops where we all had jump out and use the restroom. It zipped, folded and held all our stuff for the kids in the back seat. 
__label__3.0 ...
© www.soinside.com 2019 - 2024. All rights reserved.