Datasets:

Languages:
English
Multilinguality:
monolingual
Size Categories:
1K<n<10K
Language Creators:
crowdsourced
Annotations Creators:
crowdsourced
Source Datasets:
original
ArXiv:
Tags:
License:

Fix DuplicatedKeysError

#2
by albertvillanova HF staff - opened
Files changed (1) hide show
  1. taskmaster2.py +3 -1
taskmaster2.py CHANGED
@@ -115,6 +115,7 @@ class Taskmaster2(datasets.GeneratorBasedBuilder):
115
  ]
116
 
117
  def _generate_examples(self, filepath):
 
118
  with open(filepath, encoding="utf-8") as f:
119
  dialogs = json.load(f)
120
  for dialog in dialogs:
@@ -122,4 +123,5 @@ class Taskmaster2(datasets.GeneratorBasedBuilder):
122
  for utterance in utterances:
123
  if "segments" not in utterance:
124
  utterance["segments"] = []
125
- yield dialog["conversation_id"], dialog
 
115
  ]
116
 
117
  def _generate_examples(self, filepath):
118
+ key = 0
119
  with open(filepath, encoding="utf-8") as f:
120
  dialogs = json.load(f)
121
  for dialog in dialogs:
123
  for utterance in utterances:
124
  if "segments" not in utterance:
125
  utterance["segments"] = []
126
+ yield key, dialog
127
+ key += 1