Gaëtan Caillaut commited on
Commit ·
59ab6e1
1
Parent(s): 647e1af
hacky fix to ignore one huge sentence
Browse files- frwiki_el.py +6 -2
frwiki_el.py
CHANGED
|
@@ -45,7 +45,7 @@ class FrwikiElDataset(datasets.GeneratorBasedBuilder):
|
|
| 45 |
"""
|
| 46 |
"""
|
| 47 |
|
| 48 |
-
VERSION = datasets.Version("0.2.
|
| 49 |
|
| 50 |
# This is an example of a dataset with multiple configurations.
|
| 51 |
# If you don't want/need to define several sub-sets in your dataset,
|
|
@@ -144,4 +144,8 @@ class FrwikiElDataset(datasets.GeneratorBasedBuilder):
|
|
| 144 |
with gzip.open(open(path, 'rb'), "rt", encoding="UTF-8") as datafile:
|
| 145 |
for id, line in enumerate(datafile):
|
| 146 |
item = json.loads(line)
|
| 147 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
"""
|
| 46 |
"""
|
| 47 |
|
| 48 |
+
VERSION = datasets.Version("0.2.2")
|
| 49 |
|
| 50 |
# This is an example of a dataset with multiple configurations.
|
| 51 |
# If you don't want/need to define several sub-sets in your dataset,
|
|
|
|
| 144 |
with gzip.open(open(path, 'rb'), "rt", encoding="UTF-8") as datafile:
|
| 145 |
for id, line in enumerate(datafile):
|
| 146 |
item = json.loads(line)
|
| 147 |
+
# quick fix to prevent huge sentences
|
| 148 |
+
if item['wikipedia_id'] == 4883187:
|
| 149 |
+
continue
|
| 150 |
+
else:
|
| 151 |
+
yield id, item
|