DoctorSlimm commited on
Commit
707c9e4
1 Parent(s): 8b5d1da

add import

Browse files
Files changed (1) hide show
  1. kaushiks_criteria.py +3 -0
kaushiks_criteria.py CHANGED
@@ -150,6 +150,8 @@ class kaushiks_criteria(evaluate.Metric):
150
  :param references:
151
  :return:
152
  """
 
 
153
  pred_ds = Dataset.from_dict({'text': predictions})
154
  refs_ds = Dataset.from_dict({'text': references})
155
  proc_ds = DatasetDict({'predictions': pred_ds, 'references': refs_ds})
@@ -173,6 +175,7 @@ class kaushiks_criteria(evaluate.Metric):
173
  predictions=proc_ds['predictions']['row_counts'],
174
  references=proc_ds['references']['row_counts']
175
  )['exact_match']
 
176
  return {
177
  'exact_match_headers': exact_match_headers,
178
  'exact_match_sep_row': exact_match_sep_row,
 
150
  :param references:
151
  :return:
152
  """
153
+ from datasets import Dataset
154
+
155
  pred_ds = Dataset.from_dict({'text': predictions})
156
  refs_ds = Dataset.from_dict({'text': references})
157
  proc_ds = DatasetDict({'predictions': pred_ds, 'references': refs_ds})
 
175
  predictions=proc_ds['predictions']['row_counts'],
176
  references=proc_ds['references']['row_counts']
177
  )['exact_match']
178
+
179
  return {
180
  'exact_match_headers': exact_match_headers,
181
  'exact_match_sep_row': exact_match_sep_row,