Datasets:
Commit
·
5fc62ee
0
Parent(s):
Update files from the datasets library (from 1.2.0)
Browse filesRelease notes: https://github.com/huggingface/datasets/releases/tag/1.2.0
- .gitattributes +27 -0
- README.md +150 -0
- dataset_infos.json +1 -0
- dummy/swahili/1.0.0/dummy_data.zip +3 -0
- swahili.py +106 -0
.gitattributes
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
4 |
+
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
20 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
+
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,150 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
annotations_creators:
|
3 |
+
- no-annotation
|
4 |
+
language_creators:
|
5 |
+
- expert-generated
|
6 |
+
languages:
|
7 |
+
- sw
|
8 |
+
licenses:
|
9 |
+
- cc-by-4-0
|
10 |
+
multilinguality:
|
11 |
+
- monolingual
|
12 |
+
size_categories:
|
13 |
+
- 10K<n<100K
|
14 |
+
source_datasets:
|
15 |
+
- original
|
16 |
+
task_categories:
|
17 |
+
- sequence-modeling
|
18 |
+
task_ids:
|
19 |
+
- language-modeling
|
20 |
+
---
|
21 |
+
|
22 |
+
# Dataset Card for [Dataset Name]
|
23 |
+
|
24 |
+
## Table of Contents
|
25 |
+
- [Dataset Description](#dataset-description)
|
26 |
+
- [Dataset Summary](#dataset-summary)
|
27 |
+
- [Supported Tasks](#supported-tasks-and-leaderboards)
|
28 |
+
- [Languages](#languages)
|
29 |
+
- [Dataset Structure](#dataset-structure)
|
30 |
+
- [Data Instances](#data-instances)
|
31 |
+
- [Data Fields](#data-fields)
|
32 |
+
- [Data Splits](#data-splits)
|
33 |
+
- [Dataset Creation](#dataset-creation)
|
34 |
+
- [Curation Rationale](#curation-rationale)
|
35 |
+
- [Source Data](#source-data)
|
36 |
+
- [Annotations](#annotations)
|
37 |
+
- [Personal and Sensitive Information](#personal-and-sensitive-information)
|
38 |
+
- [Considerations for Using the Data](#considerations-for-using-the-data)
|
39 |
+
- [Social Impact of Dataset](#social-impact-of-dataset)
|
40 |
+
- [Discussion of Biases](#discussion-of-biases)
|
41 |
+
- [Other Known Limitations](#other-known-limitations)
|
42 |
+
- [Additional Information](#additional-information)
|
43 |
+
- [Dataset Curators](#dataset-curators)
|
44 |
+
- [Licensing Information](#licensing-information)
|
45 |
+
- [Citation Information](#citation-information)
|
46 |
+
|
47 |
+
## Dataset Description
|
48 |
+
|
49 |
+
- **Homepage: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7339006/**
|
50 |
+
- **Repository: NA**
|
51 |
+
- **Paper: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7339006/**
|
52 |
+
- **Leaderboard: [More Information Needed]**
|
53 |
+
- **Point of Contact: [More Information Needed]**
|
54 |
+
|
55 |
+
### Dataset Summary
|
56 |
+
|
57 |
+
The Swahili dataset developed specifically for language modeling task.
|
58 |
+
The dataset contains 28,000 unique words with 6.84M, 970k, and 2M words for the train,
|
59 |
+
valid and test partitions respectively which represent the ratio 80:10:10.
|
60 |
+
The entire dataset is lowercased, has no punctuation marks and,
|
61 |
+
the start and end of sentence markers have been incorporated to facilitate easy tokenization during language modeling.
|
62 |
+
|
63 |
+
### Supported Tasks and Leaderboards
|
64 |
+
|
65 |
+
Language Modeling
|
66 |
+
|
67 |
+
### Languages
|
68 |
+
|
69 |
+
Swahili (sw)
|
70 |
+
|
71 |
+
## Dataset Structure
|
72 |
+
|
73 |
+
### Data Instances
|
74 |
+
|
75 |
+
[More Information Needed]
|
76 |
+
|
77 |
+
### Data Fields
|
78 |
+
|
79 |
+
- text : A line of text in Swahili
|
80 |
+
|
81 |
+
### Data Splits
|
82 |
+
|
83 |
+
train = 80%, valid = 10%, test = 10%
|
84 |
+
|
85 |
+
## Dataset Creation
|
86 |
+
|
87 |
+
### Curation Rationale
|
88 |
+
|
89 |
+
Enhancing African low-resource languages
|
90 |
+
|
91 |
+
### Source Data
|
92 |
+
|
93 |
+
#### Initial Data Collection and Normalization
|
94 |
+
|
95 |
+
The dataset contains 28,000 unique words with 6.84 M, 970k, and 2 M words for the train, valid and test partitions respectively which represent the ratio 80:10:10.
|
96 |
+
The entire dataset is lowercased, has no punctuation marks and, the start and end of sentence markers have been incorporated to facilitate easy tokenization during language modelling.
|
97 |
+
|
98 |
+
#### Who are the source language producers?
|
99 |
+
|
100 |
+
[More Information Needed]
|
101 |
+
|
102 |
+
### Annotations
|
103 |
+
|
104 |
+
#### Annotation process
|
105 |
+
|
106 |
+
Unannotated data
|
107 |
+
|
108 |
+
#### Who are the annotators?
|
109 |
+
|
110 |
+
NA
|
111 |
+
|
112 |
+
### Personal and Sensitive Information
|
113 |
+
|
114 |
+
[More Information Needed]
|
115 |
+
|
116 |
+
## Considerations for Using the Data
|
117 |
+
|
118 |
+
### Social Impact of Dataset
|
119 |
+
|
120 |
+
Enhancing African low-resource languages
|
121 |
+
|
122 |
+
### Discussion of Biases
|
123 |
+
|
124 |
+
[More Information Needed]
|
125 |
+
|
126 |
+
### Other Known Limitations
|
127 |
+
|
128 |
+
[More Information Needed]
|
129 |
+
|
130 |
+
## Additional Information
|
131 |
+
|
132 |
+
### Dataset Curators
|
133 |
+
|
134 |
+
[More Information Needed]
|
135 |
+
|
136 |
+
### Licensing Information
|
137 |
+
|
138 |
+
Creative Commons Attribution 4.0 International
|
139 |
+
|
140 |
+
### Citation Information
|
141 |
+
|
142 |
+
"""\
|
143 |
+
@InProceedings{huggingface:dataset,
|
144 |
+
title = Language modeling data for Swahili (Version 1),
|
145 |
+
authors={Shivachi Casper Shikali, & Mokhosi Refuoe.
|
146 |
+
},
|
147 |
+
year={2019},
|
148 |
+
link = http://doi.org/10.5281/zenodo.3553423
|
149 |
+
}
|
150 |
+
"""
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"swahili": {"description": "The Swahili dataset developed specifically for language modeling task.\nThe dataset contains 28,000 unique words with 6.84M, 970k, and 2M words for the train,\nvalid and test partitions respectively which represent the ratio 80:10:10.\nThe entire dataset is lowercased, has no punctuation marks and,\nthe start and end of sentence markers have been incorporated to facilitate easy tokenization during language modeling.\n", "citation": "@InProceedings{huggingface:dataset,\ntitle = Language modeling data for Swahili (Version 1),\nauthors={Shivachi Casper Shikali, & Mokhosi Refuoe.\n},\nyear={2019},\nlink = http://doi.org/10.5281/zenodo.3553423\n}\n", "homepage": "https://zenodo.org/record/3553423", "license": "Attribution 4.0 International", "features": {"text": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "swahili", "config_name": "swahili", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 7700136, "num_examples": 42069, "dataset_name": "swahili"}, "test": {"name": "test", "num_bytes": 695092, "num_examples": 3371, "dataset_name": "swahili"}, "validation": {"name": "validation", "num_bytes": 663520, "num_examples": 3372, "dataset_name": "swahili"}}, "download_checksums": {"https://zenodo.org/record/3553423/files/Swahili%20data.zip?download=1": {"num_bytes": 2783330, "checksum": "fca1a30f471e08fb0a1b310004d7b49e0992b76997cadd0e8d6ecca035a00078"}}, "download_size": 2783330, "post_processing_size": null, "dataset_size": 9058748, "size_in_bytes": 11842078}}
|
dummy/swahili/1.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9f0a1bd3f8420bc012d47fe59467c4dd54ee8938d247f1016f6a19d36e495495
|
3 |
+
size 2337
|
swahili.py
ADDED
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# coding=utf-8
|
2 |
+
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
|
3 |
+
#
|
4 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
+
# you may not use this file except in compliance with the License.
|
6 |
+
# You may obtain a copy of the License at
|
7 |
+
#
|
8 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9 |
+
#
|
10 |
+
# Unless required by applicable law or agreed to in writing, software
|
11 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
+
# See the License for the specific language governing permissions and
|
14 |
+
# limitations under the License.
|
15 |
+
"""A Swahili dataset developed specifically for language modelling task.
|
16 |
+
|
17 |
+
The dataset contains 28,000 unique words with 6.84 M, 970k, and 2 M words for the train, valid and
|
18 |
+
test partitions respectively which represent the ratio 80:10:10.
|
19 |
+
The entire dataset is lowercased, has no punctuation marks and,
|
20 |
+
the start and end of sentence markers have been incorporated to facilitate easy tokenization during language modelling."""
|
21 |
+
|
22 |
+
from __future__ import absolute_import, division, print_function
|
23 |
+
|
24 |
+
import os
|
25 |
+
|
26 |
+
import datasets
|
27 |
+
|
28 |
+
|
29 |
+
_CITATION = """\
|
30 |
+
@InProceedings{huggingface:dataset,
|
31 |
+
title = Language modeling data for Swahili (Version 1),
|
32 |
+
authors={Shivachi Casper Shikali, & Mokhosi Refuoe.
|
33 |
+
},
|
34 |
+
year={2019},
|
35 |
+
link = http://doi.org/10.5281/zenodo.3553423
|
36 |
+
}
|
37 |
+
"""
|
38 |
+
|
39 |
+
_DESCRIPTION = """\
|
40 |
+
The Swahili dataset developed specifically for language modeling task.
|
41 |
+
The dataset contains 28,000 unique words with 6.84M, 970k, and 2M words for the train,
|
42 |
+
valid and test partitions respectively which represent the ratio 80:10:10.
|
43 |
+
The entire dataset is lowercased, has no punctuation marks and,
|
44 |
+
the start and end of sentence markers have been incorporated to facilitate easy tokenization during language modeling.
|
45 |
+
"""
|
46 |
+
|
47 |
+
_HOMEPAGE = "https://zenodo.org/record/3553423"
|
48 |
+
|
49 |
+
_LICENSE = "Attribution 4.0 International"
|
50 |
+
|
51 |
+
_URLs = "https://zenodo.org/record/3553423/files/Swahili%20data.zip?download=1"
|
52 |
+
|
53 |
+
|
54 |
+
class Swahili(datasets.GeneratorBasedBuilder):
|
55 |
+
"""The Swahili dataset developed specifically for language modeling task."""
|
56 |
+
|
57 |
+
VERSION = datasets.Version("1.0.0")
|
58 |
+
BUILDER_CONFIGS = [
|
59 |
+
datasets.BuilderConfig(name="swahili", version=VERSION, description="Swahili data for language modeling"),
|
60 |
+
]
|
61 |
+
|
62 |
+
def _info(self):
|
63 |
+
return datasets.DatasetInfo(
|
64 |
+
description=_DESCRIPTION,
|
65 |
+
features=datasets.Features(
|
66 |
+
{
|
67 |
+
"text": datasets.Value("string"),
|
68 |
+
}
|
69 |
+
),
|
70 |
+
supervised_keys=None,
|
71 |
+
homepage=_HOMEPAGE,
|
72 |
+
license=_LICENSE,
|
73 |
+
citation=_CITATION,
|
74 |
+
)
|
75 |
+
|
76 |
+
def _split_generators(self, dl_manager):
|
77 |
+
"""Returns SplitGenerators."""
|
78 |
+
data_dir = dl_manager.download_and_extract(_URLs)
|
79 |
+
return [
|
80 |
+
datasets.SplitGenerator(
|
81 |
+
name=datasets.Split.TRAIN,
|
82 |
+
gen_kwargs={
|
83 |
+
"filepath": os.path.join(data_dir, "Swahili data/train.txt"),
|
84 |
+
"split": "train",
|
85 |
+
},
|
86 |
+
),
|
87 |
+
datasets.SplitGenerator(
|
88 |
+
name=datasets.Split.TEST,
|
89 |
+
gen_kwargs={"filepath": os.path.join(data_dir, "Swahili data/test.txt"), "split": "test"},
|
90 |
+
),
|
91 |
+
datasets.SplitGenerator(
|
92 |
+
name=datasets.Split.VALIDATION,
|
93 |
+
gen_kwargs={
|
94 |
+
"filepath": os.path.join(data_dir, "Swahili data/valid.txt"),
|
95 |
+
"split": "valid",
|
96 |
+
},
|
97 |
+
),
|
98 |
+
]
|
99 |
+
|
100 |
+
def _generate_examples(self, filepath, split):
|
101 |
+
""" Yields examples. """
|
102 |
+
_id = 0
|
103 |
+
with open(filepath, mode="r", encoding="utf-8") as f:
|
104 |
+
for line in f:
|
105 |
+
yield _id, {"text": line.strip()},
|
106 |
+
_id += 1
|