davidstap commited on
Commit
e840d90
1 Parent(s): 0b984c2

improved yield

Browse files
Files changed (1) hide show
  1. ted_talks.py +5 -3
ted_talks.py CHANGED
@@ -53,7 +53,10 @@ class TedTalks(datasets.GeneratorBasedBuilder):
53
  return datasets.DatasetInfo(
54
  description=_DESCRIPTION,
55
  features=datasets.Features(
56
- {"translation": datasets.features.Translation(languages=self.config.language_pair)}
 
 
 
57
  ),
58
  homepage="https://github.com/neulab/word-embeddings-for-nmt",
59
  citation=_CITATION,
@@ -147,6 +150,5 @@ class TedTalks(datasets.GeneratorBasedBuilder):
147
 
148
  if len(source_target_pairs) > 0:
149
  source_sentences, target_sentences = zip(*source_target_pairs)
150
-
151
  for idx, (l1, l2) in enumerate(zip(source_sentences, target_sentences)):
152
- yield idx, {"translation": {self.config.source: l1, self.config.target: l2}}
 
53
  return datasets.DatasetInfo(
54
  description=_DESCRIPTION,
55
  features=datasets.Features(
56
+ {
57
+ self.config.source: datasets.features.Value("string"),
58
+ self.config.target: datasets.features.Value("string"),
59
+ }
60
  ),
61
  homepage="https://github.com/neulab/word-embeddings-for-nmt",
62
  citation=_CITATION,
 
150
 
151
  if len(source_target_pairs) > 0:
152
  source_sentences, target_sentences = zip(*source_target_pairs)
 
153
  for idx, (l1, l2) in enumerate(zip(source_sentences, target_sentences)):
154
+ yield idx, {self.config.source: l1, self.config.target: l2}