He-Xingwei commited on
Commit
a9e82d2
1 Parent(s): 4d86c21

Add my new, shiny module.

Browse files
Files changed (1) hide show
  1. sari_metric.py +3 -3
sari_metric.py CHANGED
@@ -78,7 +78,7 @@ Examples:
78
  >>> sari = evaluate.load("sari")
79
  >>> results = sari.compute(sources=sources, predictions=predictions, references=references)
80
  >>> print(results)
81
- {'sari': 26.953601953601954, 'keep': 0.22527472527472525, 'del': 0.5, 'add': 0.08333333333333333}
82
  """
83
 
84
 
@@ -300,6 +300,6 @@ class Sari(evaluate.Metric):
300
  avgkeepscore = avgkeepscore / len(predictions)
301
  avgdelscore = avgdelscore / len(predictions)
302
  avgaddscore = avgaddscore / len(predictions)
303
- return {"sari": 100 * sari_score, "keep": avgkeepscore,
304
- "del": avgdelscore, "add": avgaddscore}
305
 
 
78
  >>> sari = evaluate.load("sari")
79
  >>> results = sari.compute(sources=sources, predictions=predictions, references=references)
80
  >>> print(results)
81
+ {'sari': 26.953601953601954, 'keep': 22.527472527472525, 'del': 50, 'add': 8.333333333333333}
82
  """
83
 
84
 
 
300
  avgkeepscore = avgkeepscore / len(predictions)
301
  avgdelscore = avgdelscore / len(predictions)
302
  avgaddscore = avgaddscore / len(predictions)
303
+ return {"sari": 100 * sari_score, "keep": 100 * avgkeepscore,
304
+ "del": 100 * avgdelscore, "add": 100 * avgaddscore}
305