我怎么知道LibShortText预测输出文件中每个分数对应于哪个班级?

时间:2018-09-07 07:09:50

标签: python nlp text-classification libshorttext

我使用LibShortText进行短文本分类。

我训练了一个模型,并通过运行以下模型来对测试集进行班级预测:

python text-train.py -L 0 -f ./demo/train_file
python text-predict.py ./demo/train_file train_file.model output

output文件包含每个测试样本的每个类别的分数。她是output文件的开头:

version: 1
analyzable: 1
text-src: ./demo/train_file
extra-files:    
model-id: 22d9e6defd38ed92e45662d576262915d10c3374

Tickets Tickets 1.045974012515694   -0.1533289000025808 -0.142460215262256  -0.1530588765291932 -0.1249182478102407 -0.1190708362082807 -0.06841237067728836    0.04587568197139553 -0.2283616562229066 -0.102238591774343
Stamps  Stamps  -0.1187719176481736 1.118188003417143   -0.08034439513604429    -0.1973997029054026 -0.06355109135595602    -0.1786639939826796 -0.1169254102259164 -0.01967861752032143    -0.06964465109882922    -0.2732082235438185
Music   Music   -0.1315596826953709 -0.2641082947449856 1.008713836384851   -0.04068831625284784    -0.1545790157496564 -0.1010212095804389 -0.02069378431571431    -0.02404317930606417    0.008960552873498827    -0.2809809066132714
Jewelry & Watches   Jewelry & Watches   -0.0749032450936907 -0.1369122108940684 -0.2159355702219642 0.9582440549577076  -0.141187218792264  -0.1290355317490395 -0.04287756450848382    -0.0919782002284954 -0.04312539181047169    -0.0822891216592294
Tickets Tickets 0.9291396425612148  -0.1597595507175184 -0.07086077554348413    -0.07087036006347401    -0.1111802245732816 -0.2329161314957608 -0.07080154336497513    -0.07093153970747144    -0.07096098431125453    -0.07085853278399512
Books   Books   -0.03482279197164031    -0.02622229736755784    -0.08576360644172253    -0.1209545478269265 0.9735039690597804  -0.02640896142537765    -0.1511226188239169 -0.1785299152500055 -0.1569282110333412 -0.1927510189192921
Tickets Tickets 1.165624491239117   -0.1643444003616841 -0.279795018266336  -0.05911033737681937    -0.1496733471948844 -0.1774767469424229 -0.1806900189575362 -0.05711408596057094    0.06427848575613292 -0.1616990219349959
Art Art -0.07563152438778584    -0.1926345255861422 -0.1379519287608234 -0.1728869014895525 -0.2081235484009353 0.9764371359082827  -0.06097998223834129    -0.06082239643658216    -0.0434090642865785 -0.0239972643215402
Art Art -0.21374038053991   0.0146962630542977  -0.02279914632208601    -0.001108284295731699   -0.2621058759589903 1.016592310148241   0.01436347343617804 -0.04476369315079338    -0.1246095742882179 -0.3765250920829869
Books   Books   -0.08063364674726788    -0.08053738921453879    -0.08032365427931695    -0.1496633152184083 0.9195583554164264  -0.08011940998873018    -0.08053175336913043    -0.16302082274963   -0.1105339242133948 -0.09419443963601073

我怎么知道每个分数对应于哪个班级?

我知道我可以通过查看几个测试样本的预测类别和最高分数来推断出来,但是我希望可以找到一些更直接的方法。

0 个答案:

没有答案