Update taiwanese_english_translation.py
Browse files
taiwanese_english_translation.py
CHANGED
@@ -103,7 +103,7 @@ class TaiwaneseEnglishTranslation(datasets.GeneratorBasedBuilder):
|
|
103 |
# TODO: This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
|
104 |
source, target = self.config.language_pair
|
105 |
features = datasets.Features(
|
106 |
-
{"id": datasets.Value("
|
107 |
"translation": datasets.features.Translation(languages=self.config.language_pair)}
|
108 |
)
|
109 |
return datasets.DatasetInfo(
|
@@ -157,7 +157,7 @@ class TaiwaneseEnglishTranslation(datasets.GeneratorBasedBuilder):
|
|
157 |
target_sentences.append(row[1])
|
158 |
source, target = self.config.language_pair
|
159 |
for idx, (l1, l2) in enumerate(zip(source_sentences, target_sentences)):
|
160 |
-
result = {"id":
|
161 |
"translation": {source: l1, target: l2}}
|
162 |
# Make sure that both translations are non-empty.
|
163 |
if all(result.values()):
|
|
|
103 |
# TODO: This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
|
104 |
source, target = self.config.language_pair
|
105 |
features = datasets.Features(
|
106 |
+
{"id": datasets.Value("string"),
|
107 |
"translation": datasets.features.Translation(languages=self.config.language_pair)}
|
108 |
)
|
109 |
return datasets.DatasetInfo(
|
|
|
157 |
target_sentences.append(row[1])
|
158 |
source, target = self.config.language_pair
|
159 |
for idx, (l1, l2) in enumerate(zip(source_sentences, target_sentences)):
|
160 |
+
result = {"id": str(idx),
|
161 |
"translation": {source: l1, target: l2}}
|
162 |
# Make sure that both translations are non-empty.
|
163 |
if all(result.values()):
|