Skip to content

Instantly share code, notes, and snippets.

@mickeypash
Created July 26, 2015 22:24
Show Gist options
  • Save mickeypash/e18e178da80ed2db6d6e to your computer and use it in GitHub Desktop.
Save mickeypash/e18e178da80ed2db6d6e to your computer and use it in GitHub Desktop.
My solution is in the comments
def getQueryResultPerformance(results, topic_num):
i = 0
rels_found = 0
for r in results:
i += 1
if qrels.get_value(topic_num, r.docid) > 0:
rels_found += 1
# rels_found = sum(qrels.get_value(topic_num, r.docid) > 0 for r in results)
# return [rels_found, len(results)]
return [rels_found, i]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment