system HF staff commited on
Commit
c7064eb
0 Parent(s):

Update files from the datasets library (from 1.5.0)

Browse files

Release notes: https://github.com/huggingface/datasets/releases/tag/1.5.0

Files changed (5) hide show
  1. .gitattributes +27 -0
  2. README.md +148 -0
  3. dataset_infos.json +1 -0
  4. dummy/ro_sts/1.0.0/dummy_data.zip +3 -0
  5. ro_sts.py +122 -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,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators: []
3
+ language_creators:
4
+ - crowdsourced
5
+ languages:
6
+ - ro
7
+ licenses:
8
+ - cc-by-4-0
9
+ multilinguality:
10
+ - monolingual
11
+ size_categories:
12
+ - 1K<n<10K
13
+ source_datasets:
14
+ - extended|other-sts-b
15
+ task_categories:
16
+ - text-scoring
17
+ task_ids:
18
+ - semantic-similarity-scoring
19
+ ---
20
+
21
+ # Dataset Card for RO-STS
22
+
23
+ ## Table of Contents
24
+ - [Dataset Description](#dataset-description)
25
+ - [Dataset Summary](#dataset-summary)
26
+ - [Supported Tasks](#supported-tasks-and-leaderboards)
27
+ - [Languages](#languages)
28
+ - [Dataset Structure](#dataset-structure)
29
+ - [Data Instances](#data-instances)
30
+ - [Data Fields](#data-instances)
31
+ - [Data Splits](#data-instances)
32
+ - [Dataset Creation](#dataset-creation)
33
+ - [Curation Rationale](#curation-rationale)
34
+ - [Source Data](#source-data)
35
+ - [Annotations](#annotations)
36
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
37
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
38
+ - [Social Impact of Dataset](#social-impact-of-dataset)
39
+ - [Discussion of Biases](#discussion-of-biases)
40
+ - [Other Known Limitations](#other-known-limitations)
41
+ - [Additional Information](#additional-information)
42
+ - [Dataset Curators](#dataset-curators)
43
+ - [Licensing Information](#licensing-information)
44
+ - [Citation Information](#citation-information)
45
+ - [Contributions](#contributions)
46
+
47
+ ## Dataset Description
48
+
49
+ - **Homepage:** [GitHub](https://github.com/dumitrescustefan/RO-STS)
50
+ - **Repository:** [GitHub](https://github.com/dumitrescustefan/RO-STS)
51
+ - **Paper:** [Needs More Information]
52
+ - **Leaderboard:** [Needs More Information]
53
+ - **Point of Contact:** dumitrescu.stefan@gmail.com
54
+
55
+ ### Dataset Summary
56
+
57
+ We present RO-STS - the Semantic Textual Similarity dataset for the Romanian language. It is a high-quality translation of the [STS English dataset](https://ixa2.si.ehu.eus/stswiki/index.php/STSbenchmark). RO-STS contains 8,628 sentence pairs with their similarity scores. The original English sentences were collected from news headlines, captions of images and user forums, and are categorized accordingly. The Romanian release follows this categorization and provides the same train/validation/test split with 5,749/1,500/1,379 sentence pairs in each subset.
58
+
59
+ ### Supported Tasks and Leaderboards
60
+
61
+ [Needs More Information]
62
+
63
+ ### Languages
64
+
65
+ The text dataset is in Romanian (`ro`)
66
+
67
+ ## Dataset Structure
68
+
69
+ ### Data Instances
70
+
71
+ An example looks like this:
72
+
73
+ ```
74
+ {'score': 1.5,
75
+ 'sentence1': 'Un bărbat cântă la harpă.',
76
+ 'sentence2': 'Un bărbat cântă la claviatură.',
77
+ }
78
+ ```
79
+
80
+ ### Data Fields
81
+
82
+ - `score`: a float representing the semantic similarity score where 0.0 is the lowest score and 5.0 is the highest
83
+ - `sentence1`: a string representing a text
84
+ - `sentence2`: another string to compare the previous text with
85
+
86
+ ### Data Splits
87
+
88
+ The train/validation/test split contain 5,749/1,500/1,379 sentence pairs.
89
+
90
+ ## Dataset Creation
91
+
92
+ ### Curation Rationale
93
+
94
+ [Needs More Information]
95
+
96
+ ### Source Data
97
+
98
+ [Needs More Information]
99
+
100
+ #### Initial Data Collection and Normalization
101
+
102
+ *To construct the dataset, we first obtained automatic translations using Google's translation engine. These were then manually checked, corrected, and cross-validated by human volunteers. *
103
+
104
+ #### Who are the source language producers?
105
+
106
+ [Needs More Information]
107
+
108
+ ### Annotations
109
+
110
+ #### Annotation process
111
+
112
+ #### Who are the annotators?
113
+
114
+ ### Personal and Sensitive Information
115
+
116
+ [Needs More Information]
117
+
118
+ ## Considerations for Using the Data
119
+
120
+ ### Social Impact of Dataset
121
+
122
+ [Needs More Information]
123
+
124
+ ### Discussion of Biases
125
+
126
+ [Needs More Information]
127
+
128
+ ### Other Known Limitations
129
+
130
+ [Needs More Information]
131
+
132
+ ## Additional Information
133
+
134
+ ### Dataset Curators
135
+
136
+ [Needs More Information]
137
+
138
+ ### Licensing Information
139
+
140
+ CC BY-SA 4.0 License
141
+
142
+ ### Citation Information
143
+
144
+ [Needs More Information]
145
+
146
+ ### Contributions
147
+
148
+ Thanks to [@lorinczb](https://github.com/lorinczb) for adding this dataset.
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
1
+ {"ro_sts": {"description": "The RO-STS (Romanian Semantic Textual Similarity) dataset contains 8628 pairs of sentences with their similarity score. It is a high-quality translation of the STS benchmark dataset.\n", "citation": "Article under review\n", "homepage": "https://github.com/dumitrescustefan/RO-STS/", "license": "CC BY-SA 4.0 License", "features": {"score": {"dtype": "float32", "id": null, "_type": "Value"}, "sentence1": {"dtype": "string", "id": null, "_type": "Value"}, "sentence2": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "ro_sts", "config_name": "ro_sts", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 878354, "num_examples": 5749, "dataset_name": "ro_sts"}, "test": {"name": "test", "num_bytes": 194157, "num_examples": 1379, "dataset_name": "ro_sts"}, "validation": {"name": "validation", "num_bytes": 245738, "num_examples": 1500, "dataset_name": "ro_sts"}}, "download_checksums": {"https://raw.githubusercontent.com/dumitrescustefan/RO-STS/master/dataset/text-similarity/RO-STS.train.tsv": {"num_bytes": 844672, "checksum": "5e2f24ad5443ed1199a0079dd0b5de9f1fec8a2bb3b0a70f6e3616c32d6d282f"}, "https://raw.githubusercontent.com/dumitrescustefan/RO-STS/master/dataset/text-similarity/RO-STS.dev.tsv": {"num_bytes": 236912, "checksum": "914f0ca935c71b317179bab9e052867aeaad84cc143b011d5919a00d444553ef"}, "https://raw.githubusercontent.com/dumitrescustefan/RO-STS/master/dataset/text-similarity/RO-STS.test.tsv": {"num_bytes": 186023, "checksum": "fd84bc1f9581e6352f0c797cb46fdf08a39f7b908a6ff1cfe21deb62f8c78e0c"}}, "download_size": 1267607, "post_processing_size": null, "dataset_size": 1318249, "size_in_bytes": 2585856}}
dummy/ro_sts/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:598ad7f5333340c1756a0791a15ba63498a0da197a6be25885768c16c0074de3
3
+ size 1274
ro_sts.py ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2021 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
+ """RO-STS: The Romanian Semantic Textual Similarity Dataset"""
16
+
17
+ from __future__ import absolute_import, division, print_function
18
+
19
+ import datasets
20
+
21
+
22
+ # Find for instance the citation on arxiv or on the dataset repo/website
23
+ _CITATION = """\
24
+ Article under review
25
+ """
26
+
27
+ # You can copy an official description
28
+ _DESCRIPTION = """\
29
+ The RO-STS (Romanian Semantic Textual Similarity) dataset contains 8628 pairs of sentences with their similarity score. It is a high-quality translation of the STS benchmark dataset.
30
+ """
31
+
32
+ _HOMEPAGE = "https://github.com/dumitrescustefan/RO-STS/"
33
+
34
+ _LICENSE = "CC BY-SA 4.0 License"
35
+
36
+ # The HuggingFace dataset library don't host the datasets but only point to the original files
37
+ # This can be an arbitrary nested dict/list of URLs (see below in `_split_generators` method)
38
+ _URL = "https://raw.githubusercontent.com/dumitrescustefan/RO-STS/master/dataset/text-similarity/"
39
+ _TRAINING_FILE = "RO-STS.train.tsv"
40
+ _TEST_FILE = "RO-STS.test.tsv"
41
+ _DEV_FILE = "RO-STS.dev.tsv"
42
+
43
+
44
+ class ROSTSConfig(datasets.BuilderConfig):
45
+ """BuilderConfig for RO-STS dataset"""
46
+
47
+ def __init__(self, **kwargs):
48
+ super(ROSTSConfig, self).__init__(**kwargs)
49
+
50
+
51
+ class RoSts(datasets.GeneratorBasedBuilder):
52
+ """RO-STS dataset"""
53
+
54
+ VERSION = datasets.Version("1.0.0")
55
+ BUILDER_CONFIGS = [
56
+ ROSTSConfig(name="ro_sts", version=VERSION, description="RO-STS dataset"),
57
+ ]
58
+
59
+ def _info(self):
60
+
61
+ features = datasets.Features(
62
+ {
63
+ "score": datasets.Value("float"),
64
+ "sentence1": datasets.Value("string"),
65
+ "sentence2": datasets.Value("string"),
66
+ }
67
+ )
68
+
69
+ return datasets.DatasetInfo(
70
+ # This is the description that will appear on the datasets page.
71
+ description=_DESCRIPTION,
72
+ # This defines the different columns of the dataset and their types
73
+ features=features, # Here we define them above because they are different between the two configurations
74
+ # If there's a common (input, target) tuple from the features,
75
+ # specify them here. They'll be used if as_supervised=True in
76
+ # builder.as_dataset.
77
+ supervised_keys=None,
78
+ # Homepage of the dataset for documentation
79
+ homepage=_HOMEPAGE,
80
+ # License for the dataset if available
81
+ license=_LICENSE,
82
+ # Citation for the dataset
83
+ citation=_CITATION,
84
+ )
85
+
86
+ def _split_generators(self, dl_manager):
87
+ """Returns SplitGenerators."""
88
+
89
+ urls_to_download = {"train": _URL + _TRAINING_FILE, "dev": _URL + _DEV_FILE, "test": _URL + _TEST_FILE}
90
+
91
+ downloaded_files = dl_manager.download(urls_to_download)
92
+
93
+ return [
94
+ datasets.SplitGenerator(
95
+ name=datasets.Split.TRAIN,
96
+ # These kwargs will be passed to _generate_examples
97
+ gen_kwargs={"filepath": downloaded_files["train"]},
98
+ ),
99
+ datasets.SplitGenerator(
100
+ name=datasets.Split.TEST,
101
+ # These kwargs will be passed to _generate_examples
102
+ gen_kwargs={"filepath": downloaded_files["test"]},
103
+ ),
104
+ datasets.SplitGenerator(
105
+ name=datasets.Split.VALIDATION,
106
+ # These kwargs will be passed to _generate_examples
107
+ gen_kwargs={"filepath": downloaded_files["dev"]},
108
+ ),
109
+ ]
110
+
111
+ def _generate_examples(self, filepath):
112
+ """This function returns the examples in the raw (text) form."""
113
+ with open(filepath, encoding="utf-8") as f:
114
+
115
+ reader = f.readlines()
116
+ for idx, row in enumerate(reader):
117
+ splits = row.strip().split("\t")
118
+ yield idx, {
119
+ "score": splits[0], # row["score"],
120
+ "sentence1": splits[1], # row["sentence1"],
121
+ "sentence2": splits[2], # row["sentence2"],
122
+ }