本文使用trec_eval。
注意编译生成可执行文件trec_eval才可以!!! linux系统下,进入trec_eval的目录,控制台输入 make即可编译。
命令行格式如下:
$ ./trec_eval -h
trec_eval [-h] [-q] [-m measure[.params] [-c] [-n] [-l <num>]
[-D debug_level] [-N <num>] [-M <num>] [-R rel_format] [-T results_format]
rel_info_file results_file
其中-m 可以有四种选择:
'official': the main measures often used by TREC
'all_trec': all measures calculated with the standard TREC results and rel_info format files.
'set': subset of all_trec that calculates unranked values.
'prefs': Measures not in all_trec that calculate preference measures.
我们选择 all_trec
,它会对计算所有measure,结果如下:
user$ ./trec_eval -m all_trec path-to-qrels/qrels.251-300 path-to-retrieval-result/input.anu5aut1
runid all anu5aut1
num_q all 50
num_ret all 50000
num_rel all 5524
num_rel_ret all 1879
map all 0.1537
gm_map all 0.0237
Rprec all 0.1948
bpref all 0.1691
recip_rank all 0.4216
iprec_at_recall_0.00 all 0.4679
iprec_at_recall_0.10 all 0.2869
iprec_at_recall_0.20 all 0.2399
iprec_at_recall_0.30 all 0.2027
iprec_at_recall_0.40 all 0.1760
iprec_at_recall_0.50 all 0.1557
iprec_at_recall_0.60 all 0.1191
iprec_at_recall_0.70 all 0.0954
iprec_at_recall_0.80 all 0.0703
iprec_at_recall_0.90 all 0.0390
iprec_at_recall_1.00 all 0.0316
P_5 all 0.2520
P_10 all 0.2540
P_15 all 0.2240
P_20 all 0.2160
P_30 all 0.1893
P_100 all 0.1384
P_200 all 0.0929
P_500 all 0.0593
P_1000 all 0.0376
recall_5 all 0.0695
recall_10 all 0.1029
recall_15 all 0.1160
recall_20 all 0.1483
recall_30 all 0.1653
recall_100 all 0.2590
recall_200 all 0.3060
recall_500 all 0.3944
recall_1000 all 0.4560
infAP all 0.1537
gm_bpref all 0.0144
Rprec_mult_0.20 all 0.2690
Rprec_mult_0.40 all 0.2369
Rprec_mult_0.60 all 0.2343
Rprec_mult_0.80 all 0.2154
Rprec_mult_1.00 all 0.1948
Rprec_mult_1.20 all 0.1720
Rprec_mult_1.40 all 0.1537
Rprec_mult_1.60 all 0.1413
Rprec_mult_1.80 all 0.1305
Rprec_mult_2.00 all 0.1239
utility all -924.8400
11pt_avg all 0.1713
binG all 0.1399
G all 0.1399
ndcg all 0.3419
ndcg_rel all 0.3171
Rndcg all 0.2778
ndcg_cut_5 all 0.2783
ndcg_cut_10 all 0.2860
ndcg_cut_15 all 0.2736
ndcg_cut_20 all 0.2763
ndcg_cut_30 all 0.2631
ndcg_cut_100 all 0.2650
ndcg_cut_200 all 0.2730
ndcg_cut_500 all 0.3125
ndcg_cut_1000 all 0.3419
map_cut_5 all 0.0619
map_cut_10 all 0.0793
map_cut_15 all 0.0862
map_cut_20 all 0.0940
map_cut_30 all 0.1005
map_cut_100 all 0.1291
map_cut_200 all 0.1389
map_cut_500 all 0.1494
map_cut_1000 all 0.1537
relative_P_5 all 0.2620
relative_P_10 all 0.2863
relative_P_15 all 0.2705
relative_P_20 all 0.2895
relative_P_30 all 0.2738
relative_P_100 all 0.2961
relative_P_200 all 0.3168
relative_P_500 all 0.3951
relative_P_1000 all 0.4560
success_1 all 0.3200
success_5 all 0.5400
success_10 all 0.6000
set_P all 0.0376
set_relative_P all 0.4560
set_recall all 0.4560
set_map all 0.0199
set_F all 0.0627
num_nonrel_judged_ret all 16729