Datasets:

License:
system HF staff commited on
Commit
5a677a7
0 Parent(s):

Update files from the datasets library (from 1.2.0)

Browse files

Release notes: https://github.com/huggingface/datasets/releases/tag/1.2.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,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - found
4
+ language_creators:
5
+ - found
6
+ languages:
7
+ - en
8
+ - fr
9
+ licenses:
10
+ - unknown
11
+ multilinguality:
12
+ - multilingual
13
+ size_categories:
14
+ - n>1M
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:** http://opus.nlpl.eu/giga-fren.php
51
+ - **Repository:** None
52
+ - **Paper:** http://www.lrec-conf.org/proceedings/lrec2012/pdf/463_Paper.pdf
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
+ Here are some examples of questions and facts:
73
+
74
+
75
+ ### Data Fields
76
+
77
+ [More Information Needed]
78
+
79
+ ### Data Splits
80
+
81
+ [More Information Needed]
82
+
83
+ ## Dataset Creation
84
+
85
+ ### Curation Rationale
86
+
87
+ [More Information Needed]
88
+
89
+ ### Source Data
90
+
91
+ [More Information Needed]
92
+
93
+ #### Initial Data Collection and Normalization
94
+
95
+ [More Information Needed]
96
+
97
+ #### Who are the source language producers?
98
+
99
+ [More Information Needed]
100
+
101
+ ### Annotations
102
+
103
+ [More Information Needed]
104
+
105
+ #### Annotation process
106
+
107
+ [More Information Needed]
108
+
109
+ #### Who are the annotators?
110
+
111
+ [More Information Needed]
112
+
113
+ ### Personal and Sensitive Information
114
+
115
+ [More Information Needed]
116
+
117
+ ## Considerations for Using the Data
118
+
119
+ ### Social Impact of Dataset
120
+
121
+ [More Information Needed]
122
+
123
+ ### Discussion of Biases
124
+
125
+ [More Information Needed]
126
+
127
+ ### Other Known Limitations
128
+
129
+ [More Information Needed]
130
+
131
+ ## Additional Information
132
+
133
+ ### Dataset Curators
134
+
135
+ [More Information Needed]
136
+
137
+ ### Licensing Information
138
+
139
+ [More Information Needed]
140
+
141
+ ### Citation Information
142
+
143
+ [More Information Needed]
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"en-fr": {"description": "Giga-word corpus for French-English from WMT2010 collected by Chris Callison-Burch\n2 languages, total number of files: 452\ntotal number of tokens: 1.43G\ntotal number of sentence fragments: 47.55M\n", "citation": "J. Tiedemann, 2012, Parallel Data, Tools and Interfaces in OPUS. In Proceedings of the 8th International Conference on Language Resources and Evaluation (LREC 2012)\n", "homepage": "http://opus.nlpl.eu/giga-fren.php", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "translation": {"languages": ["en", "fr"], "id": null, "_type": "Translation"}}, "post_processed": null, "supervised_keys": null, "builder_name": "giga_fren", "config_name": "en-fr", "version": {"version_str": "2.0.0", "description": "", "major": 2, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 8690296821, "num_examples": 22519904, "dataset_name": "giga_fren"}}, "download_checksums": {"https://object.pouta.csc.fi/OPUS-giga-fren/v2/moses/en-fr.txt.zip": {"num_bytes": 2701536198, "checksum": "26b03b0b944829cc125c37542a50a62a47fcf77ca1ebab0c41eb1f84f8a4e6d1"}}, "download_size": 2701536198, "post_processing_size": null, "dataset_size": 8690296821, "size_in_bytes": 11391833019}}
dummy/en-fr/2.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8aa142c6b41dfb79e62cfa89b881df7746efe94370084d9bdc9266e6559c74f7
3
+ size 1189
giga_fren.py ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 os
18
+
19
+ import datasets
20
+
21
+
22
+ _DESCRIPTION = """\
23
+ Giga-word corpus for French-English from WMT2010 collected by Chris Callison-Burch
24
+ 2 languages, total number of files: 452
25
+ total number of tokens: 1.43G
26
+ total number of sentence fragments: 47.55M
27
+ """
28
+ _HOMEPAGE_URL = "http://opus.nlpl.eu/giga-fren.php"
29
+ _CITATION = """\
30
+ @InProceedings{TIEDEMANN12.463,
31
+ author = {J{\"o}rg Tiedemann},
32
+ title = {Parallel Data, Tools and Interfaces in OPUS},
33
+ booktitle = {Proceedings of the Eight International Conference on Language Resources and Evaluation (LREC'12)},
34
+ year = {2012},
35
+ month = {may},
36
+ date = {23-25},
37
+ address = {Istanbul, Turkey},
38
+ editor = {Nicoletta Calzolari (Conference Chair) and Khalid Choukri and Thierry Declerck and Mehmet Ugur Dogan and Bente Maegaard and Joseph Mariani and Jan Odijk and Stelios Piperidis},
39
+ publisher = {European Language Resources Association (ELRA)},
40
+ isbn = {978-2-9517408-7-7},
41
+ language = {english}
42
+ }
43
+ """
44
+
45
+ _VERSION = "2.0.0"
46
+ _BASE_NAME = "giga-fren.{}.{}"
47
+ _URL = "https://object.pouta.csc.fi/OPUS-giga-fren/v2/moses/en-fr.txt.zip"
48
+
49
+
50
+ class GigaFrenConfig(datasets.BuilderConfig):
51
+ def __init__(self, *args, **kwargs):
52
+ super().__init__(
53
+ *args,
54
+ name="en-fr",
55
+ **kwargs,
56
+ )
57
+
58
+ @property
59
+ def lang1(self):
60
+ return "en"
61
+
62
+ @property
63
+ def lang2(self):
64
+ return "fr"
65
+
66
+
67
+ class GigaFren(datasets.GeneratorBasedBuilder):
68
+ BUILDER_CONFIGS = [GigaFrenConfig(description=f"Translating en to fr ", version=datasets.Version(_VERSION))]
69
+ BUILDER_CONFIG_CLASS = GigaFrenConfig
70
+
71
+ def _info(self):
72
+ return datasets.DatasetInfo(
73
+ description=_DESCRIPTION,
74
+ features=datasets.Features(
75
+ {
76
+ "id": datasets.Value("string"),
77
+ "translation": datasets.Translation(languages=(self.config.lang1, self.config.lang2)),
78
+ },
79
+ ),
80
+ supervised_keys=None,
81
+ homepage=_HOMEPAGE_URL,
82
+ citation=_CITATION,
83
+ )
84
+
85
+ def _split_generators(self, dl_manager):
86
+ path = dl_manager.download_and_extract(_URL)
87
+ return [
88
+ datasets.SplitGenerator(
89
+ name=datasets.Split.TRAIN,
90
+ gen_kwargs={"datapath": path},
91
+ )
92
+ ]
93
+
94
+ def _generate_examples(self, datapath):
95
+ l1, l2 = self.config.lang1, self.config.lang2
96
+ folder = l1 + "-" + l2
97
+ l1_file = _BASE_NAME.format(folder, l1)
98
+ l2_file = _BASE_NAME.format(folder, l2)
99
+ l1_path = os.path.join(datapath, l1_file)
100
+ l2_path = os.path.join(datapath, l2_file)
101
+ with open(l1_path, encoding="utf-8") as f1, open(l2_path, encoding="utf-8") as f2:
102
+ for sentence_counter, (x, y) in enumerate(zip(f1, f2)):
103
+ x = x.strip()
104
+ y = y.strip()
105
+ result = (
106
+ sentence_counter,
107
+ {
108
+ "id": str(sentence_counter),
109
+ "translation": {l1: x, l2: y},
110
+ },
111
+ )
112
+ yield result