Datasets:
Commit
•
ee70ec1
1
Parent(s):
889ed53
Fix id field to avoid duplicate keys error (#8)
Browse files- Fix id field to avoid duplicate keys error (9b29e75deeed046e5fcb5967ed43e7b39f99eb48)
um005.py
CHANGED
@@ -138,12 +138,8 @@ class UM005(datasets.GeneratorBasedBuilder):
|
|
138 |
for sentence_counter, (x, y) in enumerate(zip(u, e)):
|
139 |
x = x.strip()
|
140 |
y = y.strip()
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
},
|
147 |
-
)
|
148 |
-
sentence_counter += 1
|
149 |
-
yield result
|
|
|
138 |
for sentence_counter, (x, y) in enumerate(zip(u, e)):
|
139 |
x = x.strip()
|
140 |
y = y.strip()
|
141 |
+
id_ = f"{source}-{sentence_counter}"
|
142 |
+
yield id_, {
|
143 |
+
"id": id_,
|
144 |
+
"translation": {"ur": x, "en": y},
|
145 |
+
}
|
|
|
|
|
|
|
|