Fix DuplicatedKeysError

#2
by albertvillanova HF staff - opened
Files changed (1) hide show
  1. ESCI-product-dataset.py +3 -1
ESCI-product-dataset.py CHANGED
@@ -71,8 +71,10 @@ class ESCIproduct(datasets.GeneratorBasedBuilder):
71
 
72
  def _generate_examples(self, files):
73
  """Yields examples."""
 
74
  for filepath in files:
75
  with open(filepath, encoding="utf-8") as f:
76
  for line in f:
77
  data = json.loads(line)
78
- yield data['query_id'], data
 
 
71
 
72
  def _generate_examples(self, files):
73
  """Yields examples."""
74
+ key = 0
75
  for filepath in files:
76
  with open(filepath, encoding="utf-8") as f:
77
  for line in f:
78
  data = json.loads(line)
79
+ yield key, data
80
+ key += 1