Datasets:
Commit
·
c11f695
1
Parent(s):
4a6e973
Tracking and adding LFS artifacts
Browse files- .gitattributes +7 -0
- Thai_loading_script.py +80 -0
- data/data.00.json +3 -0
- data/data.01.json +3 -0
- data/data.02.json +3 -0
- data/data.03.json +3 -0
- data/data.04.json +3 -0
- data/data.05.json +3 -0
- data/data.06.json +3 -0
.gitattributes
CHANGED
|
@@ -53,3 +53,10 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 53 |
*.jpg filter=lfs diff=lfs merge=lfs -text
|
| 54 |
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 55 |
*.webp filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
*.jpg filter=lfs diff=lfs merge=lfs -text
|
| 54 |
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 55 |
*.webp filter=lfs diff=lfs merge=lfs -text
|
| 56 |
+
data/data.01.json filter=lfs diff=lfs merge=lfs -text
|
| 57 |
+
data/data.02.json filter=lfs diff=lfs merge=lfs -text
|
| 58 |
+
data/data.03.json filter=lfs diff=lfs merge=lfs -text
|
| 59 |
+
data/data.04.json filter=lfs diff=lfs merge=lfs -text
|
| 60 |
+
data/data.05.json filter=lfs diff=lfs merge=lfs -text
|
| 61 |
+
data/data.06.json filter=lfs diff=lfs merge=lfs -text
|
| 62 |
+
data/data.00.json filter=lfs diff=lfs merge=lfs -text
|
Thai_loading_script.py
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Thai CulturaX clean dataset."""
|
| 2 |
+
import json
|
| 3 |
+
import datasets
|
| 4 |
+
|
| 5 |
+
logger = datasets.logging.get_logger(__name__)
|
| 6 |
+
_DESCRIPTION = """
|
| 7 |
+
Mark12 dataset."""
|
| 8 |
+
_CITATION = """EMPTY"""
|
| 9 |
+
_URL = "EMPTY"
|
| 10 |
+
_DATA_URL = "data/data.{index:02d}.json"
|
| 11 |
+
_LICENSE="odc-by"
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
class ThaiDatasetConfig(datasets.BuilderConfig):
|
| 15 |
+
"""BuilderConfig for Dataset."""
|
| 16 |
+
|
| 17 |
+
def __init__(self, *args, languages="Thai", **kwargs):
|
| 18 |
+
"""BuilderConfig for Dataset.
|
| 19 |
+
Args:
|
| 20 |
+
languages (:obj:`List[str]`): list of languages to load
|
| 21 |
+
**kwargs: keyword arguments forwarded to super.
|
| 22 |
+
"""
|
| 23 |
+
super().__init__(
|
| 24 |
+
*args,
|
| 25 |
+
**kwargs,
|
| 26 |
+
)
|
| 27 |
+
self.languages = languages
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
class ThaiDataset(datasets.GeneratorBasedBuilder):
|
| 31 |
+
"""ThaiDataset clean dataset."""
|
| 32 |
+
|
| 33 |
+
BUILDER_CONFIGS = [
|
| 34 |
+
ThaiDatasetConfig(languages="Thai", version=datasets.Version("1.0.0"))
|
| 35 |
+
]
|
| 36 |
+
BUILDER_CONFIG_CLASS = ThaiDatasetConfig
|
| 37 |
+
|
| 38 |
+
def _info(self):
|
| 39 |
+
return datasets.DatasetInfo(
|
| 40 |
+
description=_DESCRIPTION,
|
| 41 |
+
features=datasets.Features(
|
| 42 |
+
{
|
| 43 |
+
"text": datasets.Value("string"),
|
| 44 |
+
"meta": datasets.Value("string"),
|
| 45 |
+
}
|
| 46 |
+
),
|
| 47 |
+
supervised_keys=None,
|
| 48 |
+
homepage=_URL,
|
| 49 |
+
citation=_CITATION,
|
| 50 |
+
license=_LICENSE,
|
| 51 |
+
)
|
| 52 |
+
|
| 53 |
+
def _split_generators(self, dl_manager):
|
| 54 |
+
data_urls = {}
|
| 55 |
+
for split in ["train"]:
|
| 56 |
+
data_urls[split] = [
|
| 57 |
+
_DATA_URL.format(
|
| 58 |
+
index=index,
|
| 59 |
+
)
|
| 60 |
+
for index in range(0, 7)
|
| 61 |
+
]
|
| 62 |
+
train_downloaded_files = dl_manager.download(data_urls["train"])
|
| 63 |
+
|
| 64 |
+
return [
|
| 65 |
+
datasets.SplitGenerator(
|
| 66 |
+
name=datasets.Split.TRAIN,
|
| 67 |
+
gen_kwargs={"filepaths": train_downloaded_files},
|
| 68 |
+
),
|
| 69 |
+
]
|
| 70 |
+
|
| 71 |
+
def _generate_examples(self, filepaths):
|
| 72 |
+
id_ = 0
|
| 73 |
+
for filepath in filepaths:
|
| 74 |
+
logger.info("generating examples from = %s", filepath)
|
| 75 |
+
with open(filepath, "r",encoding="utf-8-sig") as f:
|
| 76 |
+
for line in f:
|
| 77 |
+
if line:
|
| 78 |
+
example = json.loads(line)
|
| 79 |
+
yield id_, example
|
| 80 |
+
id_ += 1
|
data/data.00.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:eddaae06e6730bcc402cfa8f93a2aa5742d010fa1a373022e024323a4d64061a
|
| 3 |
+
size 36724716595
|
data/data.01.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f2a0e68fc47f2ce355521432d9dccc7888d154dd3f0eaecd3d365bfd0675f859
|
| 3 |
+
size 32829126516
|
data/data.02.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:014e9a572a80c22c6528e806acf0e11379b05621681a460e1e2bb0b9591c6fae
|
| 3 |
+
size 30825834316
|
data/data.03.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a4cf4f422bb7879aa2e766dd8c8654815d8aa95751418ad1abc5353f069c8501
|
| 3 |
+
size 32503770468
|
data/data.04.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0d102406bc2e7eb5703a5ee5ab3a0f63b1d476ae408452dd6ac8dfd607c8c674
|
| 3 |
+
size 24736907677
|
data/data.05.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:14c85b162d35e12d93721aa6acd3893d54de034f6b8715b9a8866d3b9e2ca825
|
| 3 |
+
size 24711757627
|
data/data.06.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1585bab922217418dcb703e16611a331db07c2ec708c5a02226faa903c173490
|
| 3 |
+
size 4801859609
|