system HF staff commited on
Commit
9c896da
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

Files changed (5) hide show
  1. .gitattributes +27 -0
  2. README.md +139 -0
  3. dataset_infos.json +1 -0
  4. dummy/1.1.1/dummy_data.zip +3 -0
  5. muchocine.py +107 -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
+ - no-annotation
4
+ language_creators:
5
+ - found
6
+ languages:
7
+ - es
8
+ licenses:
9
+ - cc-by-2-1
10
+ multilinguality:
11
+ - monolingual
12
+ size_categories:
13
+ - 1K<n<10K
14
+ source_datasets:
15
+ - original
16
+ task_categories:
17
+ - text-classification
18
+ task_ids:
19
+ - sentiment-classification
20
+ ---
21
+
22
+ # Dataset Card for Muchocine
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:** http://www.lsi.us.es/~fermin/index.php/Datasets
50
+
51
+ ### Dataset Summary
52
+
53
+ The Muchocine reviews dataset contains 3,872 longform movie reviews in Spanish language,
54
+ each with a shorter summary review, and a rating on a 1-5 scale.
55
+
56
+ ### Supported Tasks and Leaderboards
57
+
58
+ [More Information Needed]
59
+
60
+ ### Languages
61
+
62
+ Spanish
63
+
64
+ ## Dataset Structure
65
+
66
+ ### Data Instances
67
+
68
+ [More Information Needed]
69
+
70
+ ### Data Fields
71
+
72
+ - review_body - longform review
73
+ - review_summary - shorter-form review
74
+ - star_rating - an integer star rating (1-5)
75
+
76
+ The original source also includes part-of-speech tagging for body and summary fields.
77
+
78
+ ### Data Splits
79
+
80
+ One split (train) with 3,872 reviews
81
+
82
+ ## Dataset Creation
83
+
84
+ ### Curation Rationale
85
+
86
+ [More Information Needed]
87
+
88
+ ### Source Data
89
+
90
+ #### Initial Data Collection and Normalization
91
+
92
+ Data was collected from www.muchocine.net and uploaded by Dr. Fermín L. Cruz Mata
93
+ of La Universidad de Sevilla
94
+
95
+ #### Who are the source language producers?
96
+
97
+ [More Information Needed]
98
+
99
+ ### Annotations
100
+
101
+ #### Annotation process
102
+
103
+ The text reviews and star ratings came directly from users, so no additional annotation was 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
+ - Dr. Fermín L. Cruz Mata
132
+
133
+ ### Licensing Information
134
+
135
+ CC-BY-2.1
136
+
137
+ ### Citation Information
138
+
139
+ See http://www.lsi.us.es/~fermin/index.php/Datasets
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
1
+ {"default": {"description": "The Muchocine reviews dataset contains 3,872 longform movie reviews in Spanish language,\neach with a shorter summary review, and a rating on a 1-5 scale.\n", "citation": "", "homepage": "http://www.lsi.us.es/~fermin/index.php/Datasets", "license": "CC-BY-2.1", "features": {"review_body": {"dtype": "string", "id": null, "_type": "Value"}, "review_summary": {"dtype": "string", "id": null, "_type": "Value"}, "star_rating": {"dtype": "int32", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "muchocine", "config_name": "default", "version": {"version_str": "1.1.1", "description": null, "major": 1, "minor": 1, "patch": 1}, "splits": {"train": {"name": "train", "num_bytes": 11855607, "num_examples": 3872, "dataset_name": "muchocine"}}, "download_checksums": {"http://www.lsi.us.es/~fermin/corpusCine.zip": {"num_bytes": 55556703, "checksum": "2be1333c903613402effa85ca629a66541093702c92e079c438b6eb5d84260a5"}}, "download_size": 55556703, "post_processing_size": null, "dataset_size": 11855607, "size_in_bytes": 67412310}}
dummy/1.1.1/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4d9fbeb5fb323644cc34ff45fee54dbcb109efcd51617bea0c931789215adb7e
3
+ size 4703
muchocine.py ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
16
+ from __future__ import absolute_import, division, print_function
17
+
18
+ import glob
19
+ import os
20
+ import re
21
+ from xml.dom.minidom import parseString
22
+
23
+ import datasets
24
+
25
+
26
+ # no BibTeX citation
27
+ _CITATION = ""
28
+
29
+ _DESCRIPTION = """\
30
+ The Muchocine reviews dataset contains 3,872 longform movie reviews in Spanish language,
31
+ each with a shorter summary review, and a rating on a 1-5 scale.
32
+ """
33
+
34
+ _LICENSE = "CC-BY-2.1"
35
+
36
+ _URLs = {"default": "http://www.lsi.us.es/~fermin/corpusCine.zip"}
37
+
38
+
39
+ class Muchocine(datasets.GeneratorBasedBuilder):
40
+ VERSION = datasets.Version("1.1.1")
41
+
42
+ def _info(self):
43
+ features = datasets.Features(
44
+ {
45
+ "review_body": datasets.Value("string"),
46
+ "review_summary": datasets.Value("string"),
47
+ "star_rating": datasets.Value("int32"),
48
+ }
49
+ )
50
+ return datasets.DatasetInfo(
51
+ description=_DESCRIPTION,
52
+ features=features,
53
+ supervised_keys=None,
54
+ homepage="http://www.lsi.us.es/~fermin/index.php/Datasets",
55
+ license=_LICENSE,
56
+ citation=_CITATION,
57
+ )
58
+
59
+ def _split_generators(self, dl_manager):
60
+ my_urls = _URLs[self.config.name]
61
+ data_dir = dl_manager.download_and_extract(my_urls)
62
+ return [
63
+ datasets.SplitGenerator(
64
+ name=datasets.Split.TRAIN,
65
+ gen_kwargs={
66
+ "filepaths": sorted(glob.glob(os.path.join(data_dir, "corpusCriticasCine", "*.xml"))),
67
+ "split": "train",
68
+ },
69
+ ),
70
+ ]
71
+
72
+ def _generate_examples(self, filepaths, split):
73
+ for filepath in filepaths:
74
+ with open(filepath, encoding="latin-1") as f:
75
+ id = re.search(r"\d+\.xml", filepath)[0][:-4]
76
+
77
+ txt = f.read()
78
+ txt = txt.replace("&ldquo;", '"').replace("&rdquo;", '"').replace("&hellip;", "")
79
+ txt = txt.replace("&lsquo;", '"').replace("&rsquo;", '"').replace("&prime;", "")
80
+ txt = txt.replace("&agrave;", "à").replace("&ndash;", "-").replace("&egrave;", "è")
81
+ txt = txt.replace("&ouml;", "ö").replace("&ccedil;", "ç").replace("&", "and")
82
+ try:
83
+ doc = parseString(txt)
84
+ except Exception as e:
85
+ # skip 6 malformed xml files, for example unescaped < and >
86
+ _ = e
87
+ continue
88
+
89
+ btxt = ""
90
+ review_bod = doc.getElementsByTagName("body")
91
+ if len(review_bod) > 0:
92
+ for node in review_bod[0].childNodes:
93
+ if node.nodeType == node.TEXT_NODE:
94
+ btxt += node.data + " "
95
+
96
+ rtxt = ""
97
+ review_summ = doc.getElementsByTagName("summary")
98
+ if len(review_summ) > 0:
99
+ for node in review_summ[0].childNodes:
100
+ if node.nodeType == node.TEXT_NODE:
101
+ rtxt += node.data + " "
102
+
103
+ yield id, {
104
+ "review_body": btxt,
105
+ "review_summary": rtxt,
106
+ "star_rating": int(doc.documentElement.attributes["rank"].value),
107
+ }