terrierteam / ir_measures

provides a common interface to many IR measure tools
https://ir-measur.es/
Apache License 2.0
76 stars 8 forks source link

missing pytrec_eval measures #1

Open cmacdonald opened 3 years ago

cmacdonald commented 3 years ago

This list is not exhaustive, but just the other measures more likely to be used.

cmacdonald commented 3 years ago

The following nicknames might be handy:

seanmacavaney commented 3 years ago

For a pytrec_eval (nick)name -> irm mapping function, would something like this meet your needs?

ir_measures.convert_trec_name(name: str) -> List[BaseMeasure]

# Examples
ir_measures.convert_trec_name('map') -> [AP]
ir_measures.convert_trec_name('P_5') -> [P@5]
ir_measures.convert_trec_name('P_5,10') -> [P@5, P@10]
ir_measures.convert_trec_name('P.5') -> [P@5]
ir_measures.convert_trec_name('P.5,10') -> [P@5, P@10]
ir_measures.convert_trec_name('P') -> [P@5, P@10, P@15, P@20, P@30, P@100, P@200, P@500, P@1000] # expando
ir_measures.convert_trec_name('ndcg') -> [nDCG]
ir_measures.convert_trec_name('ndcg_cut') -> [nDCG@5, nDCG@10, ...] # expando
ir_measures.convert_trec_name('official') -> [NumRet, ...] # all those from the family
cmacdonald commented 3 years ago

Also:

ir_measures.convert_trec_name('ndcg_cut_5') -> [nDCG@5]

Your implementation might come from: https://github.com/terrier-org/pyterrier/blob/ir_measures/pyterrier/pipelines.py#L64

seanmacavaney commented 3 years ago

Remaining measures (identified via supported_measures in pytrec_eval):