upload version=1.1.0
Browse files- .gitattributes +1 -0
- dataset_infos.json +1 -0
- dhivehi-corpus.py +55 -0
- train.txt +3 -0
.gitattributes
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
*.bin filter=lfs diff=lfs merge=lfs -text
|
|
|
1 |
+
*.txt filter=lfs diff=lfs merge=lfs -text
|
2 |
*.7z filter=lfs diff=lfs merge=lfs -text
|
3 |
*.arrow filter=lfs diff=lfs merge=lfs -text
|
4 |
*.bin filter=lfs diff=lfs merge=lfs -text
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"default": {"description": "This is a dataset put together to pretrain a language model in Dhivehi, the language of Maldives.\n", "citation": "@InProceedings{huggingface:dataset,\ntitle = {Dhivehi Corpus},\nauthor={Ismail Ashraq\n},\nyear={2021}\n}\n", "homepage": "https://huggingface.co/datasets/ashraq/dhivehi-corpus", "license": "", "features": {"text": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "dhivehi_corpus", "config_name": "default", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 4872983476, "num_examples": 16784472, "dataset_name": "dhivehi_corpus"}}, "download_checksums": {"train.txt": {"num_bytes": 4822623344, "checksum": "9cb7a93cbe4c886a8dcbddee67b8a2dc457d18d15c08dad09f4d9bc7a1534ba8"}}, "download_size": 4822623344, "post_processing_size": null, "dataset_size": 4872983476, "size_in_bytes": 9695606820}}
|
dhivehi-corpus.py
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import datasets
|
2 |
+
|
3 |
+
_CITATION = """\
|
4 |
+
@InProceedings{huggingface:dataset,
|
5 |
+
title = {A great new dataset},
|
6 |
+
author={huggingface, Inc.
|
7 |
+
},
|
8 |
+
year={2021}
|
9 |
+
}
|
10 |
+
"""
|
11 |
+
|
12 |
+
_DESCRIPTION = """\
|
13 |
+
This is a dataset put together to pretrain a language model in Dhivehi, the language of Maldives.
|
14 |
+
"""
|
15 |
+
_HOMEPAGE = "https://huggingface.co/datasets/ashraq/dhivehi-corpus"
|
16 |
+
|
17 |
+
_LICENSE = ""
|
18 |
+
|
19 |
+
TRAIN_URL = "train.txt"
|
20 |
+
|
21 |
+
|
22 |
+
class DhivehiCorpus(datasets.GeneratorBasedBuilder):
|
23 |
+
VERSION = datasets.Version("1.1.0")
|
24 |
+
|
25 |
+
def _info(self):
|
26 |
+
return datasets.DatasetInfo(
|
27 |
+
description=_DESCRIPTION,
|
28 |
+
features=datasets.Features(
|
29 |
+
{
|
30 |
+
"text": datasets.Value("string"),
|
31 |
+
},
|
32 |
+
),
|
33 |
+
supervised_keys=None,
|
34 |
+
homepage=_HOMEPAGE,
|
35 |
+
citation=_CITATION,
|
36 |
+
)
|
37 |
+
|
38 |
+
def _split_generators(self, dl_manager):
|
39 |
+
train_path = dl_manager.download_and_extract(TRAIN_URL)
|
40 |
+
return [
|
41 |
+
datasets.SplitGenerator(
|
42 |
+
name=datasets.Split.TRAIN,
|
43 |
+
gen_kwargs={
|
44 |
+
"filepath": train_path,
|
45 |
+
"split": "train",
|
46 |
+
},
|
47 |
+
),
|
48 |
+
]
|
49 |
+
|
50 |
+
def _generate_examples(self, filepath, split):
|
51 |
+
with open(filepath, encoding="utf8") as f:
|
52 |
+
data = f.readlines()
|
53 |
+
for id_, row in enumerate(data):
|
54 |
+
yield id_, {"text": row.strip()}
|
55 |
+
|
train.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9cb7a93cbe4c886a8dcbddee67b8a2dc457d18d15c08dad09f4d9bc7a1534ba8
|
3 |
+
size 4822623344
|