aboutsummaryrefslogtreecommitdiff
path: root/check.py
diff options
context:
space:
mode:
Diffstat (limited to 'check.py')
-rwxr-xr-xcheck.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/check.py b/check.py
index 69c247c..44a7f70 100755
--- a/check.py
+++ b/check.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python3
import fileinput
+from math import log
if __name__ == '__main__':
scores = dict()
@@ -8,7 +9,7 @@ if __name__ == '__main__':
query, dbpediaid, relevance, field, nvalues, nmatches = line.split('\t')
if field not in scores:
scores[field] = 0
- scores[field] += float(relevance) * int(nmatches) / int(nvalues)
+ scores[field] += float(relevance) * log(1 + int(nmatches)/int(nvalues))
for field, score in scores.items():
print('{}\t{}'.format(field, score))