Datasets:
Commit
•
9b29e75
1
Parent(s):
889ed53
Fix id field to avoid duplicate keys error
Browse filesFix id field to avoid duplicate keys error.
Fix #7.
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 |
+
}
|
|
|
|
|
|
|
|