anz2 commited on
Commit
d051333
·
1 Parent(s): f431e8a

add helper module template for testing purposes.

Browse files
Files changed (2) hide show
  1. cer.py +2 -0
  2. iliauniiccocrevaluation.py +5 -2
cer.py ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ def calculate_cer(*args):
2
+ return -1
iliauniiccocrevaluation.py CHANGED
@@ -18,6 +18,8 @@ import datasets
18
 
19
 
20
  # TODO: Add BibTeX citation
 
 
21
  _CITATION = """\
22
  @InProceedings{huggingface:module,
23
  title = {A great new module},
@@ -89,7 +91,8 @@ class IliauniIccOCREvaluation(evaluate.Metric):
89
  def _compute(self, predictions, references):
90
  """Returns the scores"""
91
  # TODO: Compute the different scores of the module
92
- accuracy = sum(i == j for i, j in zip(predictions, references)) / len(predictions)
 
93
  return {
94
- "accuracy": accuracy,
95
  }
 
18
 
19
 
20
  # TODO: Add BibTeX citation
21
+ from cer import calculate_cer
22
+
23
  _CITATION = """\
24
  @InProceedings{huggingface:module,
25
  title = {A great new module},
 
91
  def _compute(self, predictions, references):
92
  """Returns the scores"""
93
  # TODO: Compute the different scores of the module
94
+ cer = calculate_cer(predictions, references)
95
+
96
  return {
97
+ "CER": cer,
98
  }