Datasets:
Commit
·
922a4e5
1
Parent(s):
4579cd3
Add ThaiCulturaX_loading_script.py
Browse files
ThaiCulturaX_loading_script.py
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
-
"""
|
2 |
-
import gzip
|
3 |
import json
|
4 |
import datasets
|
5 |
|
@@ -73,7 +72,7 @@ class ThaiCulturaX(datasets.GeneratorBasedBuilder):
|
|
73 |
id_ = 0
|
74 |
for filepath in filepaths:
|
75 |
logger.info("generating examples from = %s", filepath)
|
76 |
-
with
|
77 |
for line in f:
|
78 |
if line:
|
79 |
example = json.loads(line)
|
|
|
1 |
+
"""Thai CulturaX clean dataset."""
|
|
|
2 |
import json
|
3 |
import datasets
|
4 |
|
|
|
72 |
id_ = 0
|
73 |
for filepath in filepaths:
|
74 |
logger.info("generating examples from = %s", filepath)
|
75 |
+
with open(open(filepath, "r",encoding="utf-8-sig") as f:
|
76 |
for line in f:
|
77 |
if line:
|
78 |
example = json.loads(line)
|