Commit
·
f40ae4c
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 +142 -0
- dataset_infos.json +1 -0
- dummy/ig-en/1.0.0/dummy_data.zip +3 -0
- igbo_english_machine_translation.py +123 -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,142 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
annotations_creators:
|
3 |
+
- found
|
4 |
+
language_creators:
|
5 |
+
- found
|
6 |
+
languages:
|
7 |
+
- en
|
8 |
+
- ig
|
9 |
+
licenses:
|
10 |
+
- unknown
|
11 |
+
multilinguality:
|
12 |
+
- multilingual
|
13 |
+
size_categories:
|
14 |
+
- 10K<n<100K
|
15 |
+
source_datasets:
|
16 |
+
- original
|
17 |
+
task_categories:
|
18 |
+
- conditional-text-generation
|
19 |
+
task_ids:
|
20 |
+
- machine-translation
|
21 |
+
---
|
22 |
+
|
23 |
+
# Dataset Card Creation Guide
|
24 |
+
|
25 |
+
## Table of Contents
|
26 |
+
- [Dataset Description](#dataset-description)
|
27 |
+
- [Dataset Summary](#dataset-summary)
|
28 |
+
- [Supported Tasks](#supported-tasks-and-leaderboards)
|
29 |
+
- [Languages](#languages)
|
30 |
+
- [Dataset Structure](#dataset-structure)
|
31 |
+
- [Data Instances](#data-instances)
|
32 |
+
- [Data Fields](#data-instances)
|
33 |
+
- [Data Splits](#data-instances)
|
34 |
+
- [Dataset Creation](#dataset-creation)
|
35 |
+
- [Curation Rationale](#curation-rationale)
|
36 |
+
- [Source Data](#source-data)
|
37 |
+
- [Annotations](#annotations)
|
38 |
+
- [Personal and Sensitive Information](#personal-and-sensitive-information)
|
39 |
+
- [Considerations for Using the Data](#considerations-for-using-the-data)
|
40 |
+
- [Social Impact of Dataset](#social-impact-of-dataset)
|
41 |
+
- [Discussion of Biases](#discussion-of-biases)
|
42 |
+
- [Other Known Limitations](#other-known-limitations)
|
43 |
+
- [Additional Information](#additional-information)
|
44 |
+
- [Dataset Curators](#dataset-curators)
|
45 |
+
- [Licensing Information](#licensing-information)
|
46 |
+
- [Citation Information](#citation-information)
|
47 |
+
|
48 |
+
## Dataset Description
|
49 |
+
|
50 |
+
- **Homepage:** None
|
51 |
+
- **Repository:** https://github.com/IgnatiusEzeani/IGBONLP/tree/master/ig_en_mt
|
52 |
+
- **Paper:** https://arxiv.org/abs/2004.00648
|
53 |
+
- **Leaderboard:** [More Information Needed]
|
54 |
+
- **Point of Contact:** [More Information Needed]
|
55 |
+
|
56 |
+
### Dataset Summary
|
57 |
+
|
58 |
+
[More Information Needed]
|
59 |
+
|
60 |
+
### Supported Tasks and Leaderboards
|
61 |
+
|
62 |
+
[More Information Needed]
|
63 |
+
|
64 |
+
### Languages
|
65 |
+
|
66 |
+
[More Information Needed]
|
67 |
+
|
68 |
+
## Dataset Structure
|
69 |
+
|
70 |
+
### Data Instances
|
71 |
+
|
72 |
+
[More Information Needed]
|
73 |
+
|
74 |
+
### Data Fields
|
75 |
+
|
76 |
+
[More Information Needed]
|
77 |
+
|
78 |
+
### Data Splits
|
79 |
+
|
80 |
+
[More Information Needed]
|
81 |
+
|
82 |
+
## Dataset Creation
|
83 |
+
|
84 |
+
### Curation Rationale
|
85 |
+
|
86 |
+
[More Information Needed]
|
87 |
+
|
88 |
+
### Source Data
|
89 |
+
|
90 |
+
[More Information Needed]
|
91 |
+
|
92 |
+
#### Initial Data Collection and Normalization
|
93 |
+
|
94 |
+
[More Information Needed]
|
95 |
+
|
96 |
+
#### Who are the source language producers?
|
97 |
+
|
98 |
+
[More Information Needed]
|
99 |
+
|
100 |
+
### Annotations
|
101 |
+
|
102 |
+
[More Information Needed]
|
103 |
+
|
104 |
+
#### Annotation process
|
105 |
+
|
106 |
+
[More Information Needed]
|
107 |
+
|
108 |
+
#### Who are the annotators?
|
109 |
+
|
110 |
+
[More Information Needed]
|
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 |
+
[More Information Needed]
|
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 |
+
[More Information Needed]
|
139 |
+
|
140 |
+
### Citation Information
|
141 |
+
|
142 |
+
[More Information Needed]
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"ig-en": {"description": "Parallel Igbo-English Dataset\n", "citation": "@misc{ezeani2020igboenglish,\n title={Igbo-English Machine Translation: An Evaluation Benchmark},\n author={Ignatius Ezeani and Paul Rayson and Ikechukwu Onyenwe and Chinedu Uchechukwu and Mark Hepple},\n year={2020},\n eprint={2004.00648},\n archivePrefix={arXiv},\n primaryClass={cs.CL},\n url={https://arxiv.org/abs/2004.00648}\n}\n", "homepage": "https://github.com/IgnatiusEzeani/IGBONLP/tree/master/ig_en_mt", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "translation": {"languages": ["ig", "en"], "id": null, "_type": "Translation"}}, "post_processed": null, "supervised_keys": null, "builder_name": "igbo_english_machine_translation", "config_name": "ig-en", "version": {"version_str": "1.0.0", "description": "", "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 2367989, "num_examples": 10000, "dataset_name": "igbo_english_machine_translation"}, "validation": {"name": "validation", "num_bytes": 60154, "num_examples": 200, "dataset_name": "igbo_english_machine_translation"}, "test": {"name": "test", "num_bytes": 298670, "num_examples": 552, "dataset_name": "igbo_english_machine_translation"}}, "download_checksums": {"https://raw.githubusercontent.com/IgnatiusEzeani/IGBONLP/master/ig_en_mt/benchmark_dataset/train.en": {"num_bytes": 1047590, "checksum": "873cbd3c7d2c73105bc98d57b4ef37e336ffa39abbcb55bddf88368b9e01fea2"}, "https://raw.githubusercontent.com/IgnatiusEzeani/IGBONLP/master/ig_en_mt/benchmark_dataset/train.ig": {"num_bytes": 1183332, "checksum": "fb043c8aa1ef975041a69d621da14cd803da52315023721f3fa120f807409b56"}, "https://raw.githubusercontent.com/IgnatiusEzeani/IGBONLP/master/ig_en_mt/benchmark_dataset/val.en": {"num_bytes": 27102, "checksum": "57ad159ef029de297a15126cd687a53bc056493ab70c7834d5a19dcd728d0530"}, "https://raw.githubusercontent.com/IgnatiusEzeani/IGBONLP/master/ig_en_mt/benchmark_dataset/val.ig": {"num_bytes": 30566, "checksum": "ac49e08729ec4b89d72c1c9467c6cb5e9486056ded1d0fa7e31a7efa44c8c2b9"}, "https://raw.githubusercontent.com/IgnatiusEzeani/IGBONLP/master/ig_en_mt/benchmark_dataset/test.en": {"num_bytes": 155651, "checksum": "571d8b408be81d0b9357032ee5b0f2642e00d2d96733f85e7b67e28b5830fed9"}, "https://raw.githubusercontent.com/IgnatiusEzeani/IGBONLP/master/ig_en_mt/benchmark_dataset/test.ig": {"num_bytes": 136014, "checksum": "ad2ef28dd7c81809b94ac5f7fe3cf2fda1afc688a629d8379e78bb9654221a64"}}, "download_size": 2580255, "post_processing_size": null, "dataset_size": 2726813, "size_in_bytes": 5307068}}
|
dummy/ig-en/1.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0904bcd1d587dfb892de7452c0183b4bd11e7872cceb4e87d393e911812c8c77
|
3 |
+
size 2541
|
igbo_english_machine_translation.py
ADDED
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# coding=utf-8
|
2 |
+
# Copyright 2020 HuggingFace Datasets Authors.
|
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 |
+
|
16 |
+
# Lint as: python3
|
17 |
+
import datasets
|
18 |
+
|
19 |
+
|
20 |
+
_DESCRIPTION = """\
|
21 |
+
Parallel Igbo-English Dataset
|
22 |
+
"""
|
23 |
+
_HOMEPAGE_URL = "https://github.com/IgnatiusEzeani/IGBONLP/tree/master/ig_en_mt"
|
24 |
+
_CITATION = """\
|
25 |
+
@misc{ezeani2020igboenglish,
|
26 |
+
title={Igbo-English Machine Translation: An Evaluation Benchmark},
|
27 |
+
author={Ignatius Ezeani and Paul Rayson and Ikechukwu Onyenwe and Chinedu Uchechukwu and Mark Hepple},
|
28 |
+
year={2020},
|
29 |
+
eprint={2004.00648},
|
30 |
+
archivePrefix={arXiv},
|
31 |
+
primaryClass={cs.CL},
|
32 |
+
url={https://arxiv.org/abs/2004.00648}
|
33 |
+
}
|
34 |
+
"""
|
35 |
+
|
36 |
+
_VERSION = "1.0.0"
|
37 |
+
_TRAIN_EN = "https://raw.githubusercontent.com/IgnatiusEzeani/IGBONLP/master/ig_en_mt/benchmark_dataset/train.en"
|
38 |
+
_VALID_EN = "https://raw.githubusercontent.com/IgnatiusEzeani/IGBONLP/master/ig_en_mt/benchmark_dataset/val.en"
|
39 |
+
_TEST_EN = "https://raw.githubusercontent.com/IgnatiusEzeani/IGBONLP/master/ig_en_mt/benchmark_dataset/test.en"
|
40 |
+
_TRAIN_IG = "https://raw.githubusercontent.com/IgnatiusEzeani/IGBONLP/master/ig_en_mt/benchmark_dataset/train.ig"
|
41 |
+
_VALID_IG = "https://raw.githubusercontent.com/IgnatiusEzeani/IGBONLP/master/ig_en_mt/benchmark_dataset/val.ig"
|
42 |
+
_TEST_IG = "https://raw.githubusercontent.com/IgnatiusEzeani/IGBONLP/master/ig_en_mt/benchmark_dataset/test.ig"
|
43 |
+
|
44 |
+
_LANGUAGE_PAIRS = [
|
45 |
+
("ig", "en"),
|
46 |
+
]
|
47 |
+
|
48 |
+
|
49 |
+
class IgboEnglishMachineTranslationConfig(datasets.BuilderConfig):
|
50 |
+
def __init__(self, *args, lang1=None, lang2=None, **kwargs):
|
51 |
+
super().__init__(
|
52 |
+
*args,
|
53 |
+
name=f"{lang1}-{lang2}",
|
54 |
+
**kwargs,
|
55 |
+
)
|
56 |
+
self.lang1 = lang1
|
57 |
+
self.lang2 = lang2
|
58 |
+
|
59 |
+
|
60 |
+
class IgboEnglishMachineTranslation(datasets.GeneratorBasedBuilder):
|
61 |
+
BUILDER_CONFIGS = [
|
62 |
+
IgboEnglishMachineTranslationConfig(
|
63 |
+
lang1=lang1,
|
64 |
+
lang2=lang2,
|
65 |
+
description=f"Translating {lang1} to {lang2} or vice versa",
|
66 |
+
version=datasets.Version(_VERSION),
|
67 |
+
)
|
68 |
+
for lang1, lang2 in _LANGUAGE_PAIRS
|
69 |
+
]
|
70 |
+
BUILDER_CONFIG_CLASS = IgboEnglishMachineTranslationConfig
|
71 |
+
|
72 |
+
def _info(self):
|
73 |
+
return datasets.DatasetInfo(
|
74 |
+
description=_DESCRIPTION,
|
75 |
+
features=datasets.Features(
|
76 |
+
{
|
77 |
+
"id": datasets.Value("string"),
|
78 |
+
"translation": datasets.Translation(languages=(self.config.lang1, self.config.lang2)),
|
79 |
+
},
|
80 |
+
),
|
81 |
+
supervised_keys=None,
|
82 |
+
homepage=_HOMEPAGE_URL,
|
83 |
+
citation=_CITATION,
|
84 |
+
)
|
85 |
+
|
86 |
+
def _split_generators(self, dl_manager):
|
87 |
+
train_en = dl_manager.download_and_extract(_TRAIN_EN)
|
88 |
+
train_ig = dl_manager.download_and_extract(_TRAIN_IG)
|
89 |
+
|
90 |
+
valid_en = dl_manager.download_and_extract(_VALID_EN)
|
91 |
+
valid_ig = dl_manager.download_and_extract(_VALID_IG)
|
92 |
+
|
93 |
+
test_en = dl_manager.download_and_extract(_TEST_EN)
|
94 |
+
test_ig = dl_manager.download_and_extract(_TEST_IG)
|
95 |
+
|
96 |
+
return [
|
97 |
+
datasets.SplitGenerator(
|
98 |
+
name=datasets.Split.TRAIN,
|
99 |
+
gen_kwargs={"ig_datapath": train_ig, "en_datapath": train_en},
|
100 |
+
),
|
101 |
+
datasets.SplitGenerator(
|
102 |
+
name=datasets.Split.VALIDATION,
|
103 |
+
gen_kwargs={"ig_datapath": valid_ig, "en_datapath": valid_en},
|
104 |
+
),
|
105 |
+
datasets.SplitGenerator(
|
106 |
+
name=datasets.Split.TEST,
|
107 |
+
gen_kwargs={"ig_datapath": test_ig, "en_datapath": test_en},
|
108 |
+
),
|
109 |
+
]
|
110 |
+
|
111 |
+
def _generate_examples(self, ig_datapath, en_datapath):
|
112 |
+
with open(ig_datapath, encoding="utf-8") as f1, open(en_datapath, encoding="utf-8") as f2:
|
113 |
+
for sentence_counter, (x, y) in enumerate(zip(f1, f2)):
|
114 |
+
x = x.strip()
|
115 |
+
y = y.strip()
|
116 |
+
result = (
|
117 |
+
sentence_counter,
|
118 |
+
{
|
119 |
+
"id": str(sentence_counter),
|
120 |
+
"translation": {"ig": x, "en": y},
|
121 |
+
},
|
122 |
+
)
|
123 |
+
yield result
|