Evaluate search engine with trec-eval

How to install

  1. Download from official site
  2. Extract
  3. run make

Usage

$ ./trec_eval [-q] [-m measure] qrel.txt results.txt

where:

  1. qrel.txt contains the correct answers
  2. results.txt are the results of your search engine

Your program should construct results.txt

qrel.txt:

query-id 0 document-id relevance

 

  • query-id: is the query id
  • 0: is reserved and is not used
  • document-id: is the document id
  • relevance: should be 1 for relevant documents and 0 for non relevant documents

results.txt:

query-id Q0 document-id rank score STANDARD
  • query-id: is the query id
  • Q0: is the run id (unique for the document)
  • document-id: is the document id of a relevant document
  • rank: is the rank of the id (unique, ascending)
  • score: is the similarity score (descending)
  • STANDARD: is a custom tag (ignored)

Evaluation measures:

runidName of the run (is the name given on the last field of the results file)
num_qTotal number of evaluated queries
num_retTotal number of retrieved documents
num_relTotal number of relevant documents (according to the qrels file)
num_rel_retTotal number of relevant documents retrieved (in the results file)
mapMean average precision (map)
gm_mapAverage precision. Geometric mean
RprecPrecision of the first R documents, where R are the number os relevants
bprefBinary preference
recip_rankReciprical Rank
iprec_at_recall_0.00Interpolated Recall – Precision Averages at 0.00 recall
iprec_at_recall_0.10Interpolated Recall – Precision Averages at 0.10 recall
iprec_at_recall_0.20Interpolated Recall – Precision Averages at 0.20 recall
iprec_at_recall_0.30Interpolated Recall – Precision Averages at 0.30 recall
iprec_at_recall_0.40Interpolated Recall – Precision Averages at 0.40 recall
iprec_at_recall_0.50Interpolated Recall – Precision Averages at 0.50 recall
iprec_at_recall_0.60Interpolated Recall – Precision Averages at 0.60 recall
iprec_at_recall_0.70Interpolated Recall – Precision Averages at 0.70 recall
iprec_at_recall_0.80Interpolated Recall – Precision Averages at 0.80 recall
iprec_at_recall_0.90Interpolated Recall – Precision Averages at 0.90 recall
iprec_at_recall_1.00Interpolated Recall – Precision Averages at 1.00 recall
P_5Precision of the 5 first documents
P_10Precision of the 10 first documents
P_15Precision of the 15 first documents
P_20Precision of the 20 first documents
P_30Precision of the 30 first documents
P_100Precision of the 100 first documents
P_200Precision of the 200 first documents
P_500Precision of the 500 first documents
P_1000Precision of the 1000 first documents

Leave a comment