Spaces:
Runtime error
Runtime error
File size: 535 Bytes
8d7d29c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
import evaluate as ev
from nDCG import nDCG
metric = nDCG(cache_dir="cache")
a = [1,2,3,4,5]
b = [1,2,3,4,5]
c = [1,2,3,4,0]
#metric.add(prediction=a, reference=b)
metric.add(prediction=c, reference=b)
metric.add(prediction=c, reference=b)
metric.add(prediction=c, reference=b)
print(metric.compute(predictions=[a], references=[b]))
print(metric.compute(predictions=[a], references=[c]))
print(metric.compute(predictions=[a], references=[c]))
print(metric.compute(predictions=[a,a], references=[c,a]))
print(metric.cache_file_name)
|