system HF staff commited on
Commit
4b57a33
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,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - found
4
+ language_creators:
5
+ - found
6
+ languages:
7
+ - en
8
+ licenses:
9
+ - cc-by-sa-4-0
10
+ multilinguality:
11
+ - monolingual
12
+ size_categories:
13
+ - n<1K
14
+ source_datasets:
15
+ - original
16
+ task_categories:
17
+ - conditional-text-generation
18
+ - text-classification
19
+ task_ids:
20
+ - multi-class-classification
21
+ - text-simplification
22
+ ---
23
+
24
+ # Dataset Card for OneStopEnglish corpus
25
+
26
+ ## Table of Contents
27
+ - [Dataset Description](#dataset-description)
28
+ - [Dataset Summary](#dataset-summary)
29
+ - [Supported Tasks](#supported-tasks-and-leaderboards)
30
+ - [Languages](#languages)
31
+ - [Dataset Structure](#dataset-structure)
32
+ - [Data Instances](#data-instances)
33
+ - [Data Fields](#data-instances)
34
+ - [Data Splits](#data-instances)
35
+ - [Dataset Creation](#dataset-creation)
36
+ - [Curation Rationale](#curation-rationale)
37
+ - [Source Data](#source-data)
38
+ - [Annotations](#annotations)
39
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
40
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
41
+ - [Social Impact of Dataset](#social-impact-of-dataset)
42
+ - [Discussion of Biases](#discussion-of-biases)
43
+ - [Other Known Limitations](#other-known-limitations)
44
+ - [Additional Information](#additional-information)
45
+ - [Dataset Curators](#dataset-curators)
46
+ - [Licensing Information](#licensing-information)
47
+ - [Citation Information](#citation-information)
48
+
49
+ ## Dataset Description
50
+
51
+ - **Homepage:** https://github.com/nishkalavallabhi/OneStopEnglishCorpus
52
+ - **Repository:** https://github.com/purvimisal/OneStopCorpus-Compiled/raw/main/Texts-SeparatedByReadingLevel.zip
53
+ - **Paper:** https://www.aclweb.org/anthology/W18-0535.pdf
54
+ - **Leaderboard:**
55
+ - **Point of Contact:**
56
+
57
+ ### Dataset Summary
58
+ OneStopEnglish is a corpus of texts written at three reading levels, and demonstrates its usefulness for through two applications - automatic readability assessment and automatic text simplification.
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
+ - text: document text
77
+ - label: reading level of the document- ele/int/adv (Elementary/Intermediate/Advance)
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
+ #### Initial Data Collection and Normalization
92
+
93
+ [More Information Needed]
94
+
95
+ #### Who are the source language producers?
96
+
97
+ [More Information Needed]
98
+
99
+ ### Annotations
100
+
101
+ #### Annotation process
102
+
103
+ [More Information Needed]
104
+
105
+ #### Who are the annotators?
106
+
107
+ [More Information Needed]
108
+
109
+ ### Personal and Sensitive Information
110
+
111
+ [More Information Needed]
112
+
113
+ ## Considerations for Using the Data
114
+
115
+ ### Social Impact of Dataset
116
+
117
+ [More Information Needed]
118
+
119
+ ### Discussion of Biases
120
+
121
+ [More Information Needed]
122
+
123
+ ### Other Known Limitations
124
+
125
+ [More Information Needed]
126
+
127
+ ## Additional Information
128
+
129
+ ### Dataset Curators
130
+
131
+ [More Information Needed]
132
+
133
+ ### Licensing Information
134
+
135
+ Creative Commons Attribution-ShareAlike 4.0 International License
136
+
137
+ ### Citation Information
138
+
139
+ [More Information Needed]
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"default": {"description": "This dataset is a compilation of the OneStopEnglish corpus of texts written at three reading levels into one file.\nText documents are classified into three reading levels - ele, int, adv (Elementary, Intermediate and Advance).\nThis dataset demonstrates its usefulness for through two applica-tions - automatic readability assessment and automatic text simplification.\nThe corpus consists of 189 texts, each in three versions/reading levels (567 in total).\n", "citation": "@inproceedings{vajjala-lucic-2018-onestopenglish,\n title = {OneStopEnglish corpus: A new corpus for automatic readability assessment and text simplification},\n author = {Sowmya Vajjala and Ivana Lu\u010di\u0107},\n booktitle = {Proceedings of the Thirteenth Workshop on Innovative Use of NLP for Building Educational Applications},\n year = {2018}\n}\n", "homepage": "https://github.com/nishkalavallabhi/OneStopEnglishCorpus", "license": "Creative Commons Attribution-ShareAlike 4.0 International License", "features": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 3, "names": ["ele", "int", "adv"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": {"input": "", "output": ""}, "builder_name": "onestop_english", "config_name": "default", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 2278043, "num_examples": 567, "dataset_name": "onestop_english"}}, "download_checksums": {"https://github.com/purvimisal/OneStopCorpus-Compiled/raw/main/Texts-SeparatedByReadingLevel.zip": {"num_bytes": 1228804, "checksum": "05a99e6647eea8111f98a4df491e81e4863ed2004353091959198966bc41d3d8"}}, "download_size": 1228804, "post_processing_size": null, "dataset_size": 2278043, "size_in_bytes": 3506847}}
dummy/1.1.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cb140c93f2a1fd03d22c711603cbd07999b1bfc1cace152baf474498c680ab82
3
+ size 622918
onestop_english.py ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ """OneStopEnglish Corpus: Dataset of texts classified into reading levels/text complexities."""
16
+
17
+ from __future__ import absolute_import, division, print_function
18
+
19
+ import logging
20
+ import os
21
+
22
+ import datasets
23
+
24
+
25
+ _CITATION = """\
26
+ @inproceedings{vajjala-lucic-2018-onestopenglish,
27
+ title = {OneStopEnglish corpus: A new corpus for automatic readability assessment and text simplification},
28
+ author = {Sowmya Vajjala and Ivana Lučić},
29
+ booktitle = {Proceedings of the Thirteenth Workshop on Innovative Use of NLP for Building Educational Applications},
30
+ year = {2018}
31
+ }
32
+ """
33
+
34
+ _DESCRIPTION = """\
35
+ This dataset is a compilation of the OneStopEnglish corpus of texts written at three reading levels into one file.
36
+ Text documents are classified into three reading levels - ele, int, adv (Elementary, Intermediate and Advance).
37
+ This dataset demonstrates its usefulness for through two applica-tions - automatic readability assessment and automatic text simplification.
38
+ The corpus consists of 189 texts, each in three versions/reading levels (567 in total).
39
+ """
40
+
41
+ _HOMEPAGE = "https://github.com/nishkalavallabhi/OneStopEnglishCorpus"
42
+
43
+ _LICENSE = "Creative Commons Attribution-ShareAlike 4.0 International License"
44
+
45
+ _URL = "https://github.com/purvimisal/OneStopCorpus-Compiled/raw/main/Texts-SeparatedByReadingLevel.zip"
46
+
47
+
48
+ # TODO: Name of the dataset usually match the script name with CamelCase instead of snake_case
49
+ class OnestopEnglish(datasets.GeneratorBasedBuilder):
50
+ """OneStopEnglish Corpus: Dataset of texts classified into reading levels"""
51
+
52
+ VERSION = datasets.Version("1.1.0")
53
+
54
+ def _info(self):
55
+ # TODO: This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
56
+ return datasets.DatasetInfo(
57
+ description=_DESCRIPTION,
58
+ features=datasets.Features(
59
+ {"text": datasets.Value("string"), "label": datasets.features.ClassLabel(names=["ele", "int", "adv"])}
60
+ ),
61
+ supervised_keys=[""],
62
+ homepage=_HOMEPAGE,
63
+ license=_LICENSE,
64
+ citation=_CITATION,
65
+ )
66
+
67
+ def _vocab_text_gen(self, train_file):
68
+ for _, ex in self._generate_examples(train_file):
69
+ yield ex["text"]
70
+
71
+ def _split_generators(self, dl_manager):
72
+ """Downloads OneStopEnglish corpus"""
73
+ extracted_folder_path = dl_manager.download_and_extract(_URL)
74
+ return [
75
+ datasets.SplitGenerator(
76
+ name=datasets.Split.TRAIN,
77
+ gen_kwargs={"split_key": "train", "data_dir": extracted_folder_path},
78
+ )
79
+ ]
80
+
81
+ def _get_examples_from_split(self, split_key, data_dir):
82
+ """Reads the downloaded and extracted files and combines the individual text files to one dataset."""
83
+
84
+ data_dir = os.path.join(data_dir, "Texts-SeparatedByReadingLevel")
85
+
86
+ ele_samples = []
87
+ dir_path = os.path.join(data_dir, "Ele-Txt")
88
+ files = os.listdir(dir_path)
89
+ for f in sorted(files):
90
+ try:
91
+ with open(os.path.join(dir_path, f), encoding="utf-8-sig") as myfile:
92
+ text = myfile.read().strip()
93
+ ele_samples.append(text)
94
+ except Exception as e:
95
+ logging.info("Error with:", os.path.join(dir_path, f), e)
96
+
97
+ int_samples = []
98
+ dir_path = os.path.join(data_dir, "Int-Txt")
99
+ files = os.listdir(dir_path)
100
+ for f in sorted(files):
101
+ try:
102
+ with open(os.path.join(dir_path, f), encoding="utf-8-sig") as myfile:
103
+ text = myfile.read().strip()
104
+ int_samples.append(text)
105
+ except Exception as e:
106
+ logging.info("Error with:", os.path.join(dir_path, f), e)
107
+
108
+ adv_samples = []
109
+ dir_path = os.path.join(data_dir, "Adv-Txt")
110
+ files = os.listdir(dir_path)
111
+ for f in sorted(files):
112
+ try:
113
+ with open(os.path.join(dir_path, f), encoding="utf-8-sig") as myfile:
114
+ text = myfile.read().strip()
115
+ adv_samples.append(text)
116
+ except Exception as e:
117
+ logging.info("Error with:", os.path.join(dir_path, f), e)
118
+
119
+ train_samples = ele_samples + int_samples + adv_samples
120
+ train_labels = (["ele"] * len(ele_samples)) + (["int"] * len(int_samples)) + (["adv"] * len(adv_samples))
121
+
122
+ if split_key == "train":
123
+ return (train_samples, train_labels)
124
+ else:
125
+ raise ValueError(f"Invalid split key {split_key}")
126
+
127
+ def _generate_examples(self, split_key, data_dir):
128
+ """Yields examples for a given split of dataset."""
129
+ split_text, split_labels = self._get_examples_from_split(split_key, data_dir)
130
+ for text, label in zip(split_text, split_labels):
131
+ data_key = split_key + "_" + text
132
+ feature_dict = {"text": text, "label": label}
133
+ yield data_key, feature_dict