system HF staff commited on
Commit
f5b5e09
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
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
1
+ {"default": {"description": "The SemEval-2010 Task 8 focuses on Multi-way classification of semantic relations between pairs of nominals.\nThe task was designed to compare different approaches to semantic relation classification\nand to provide a standard testbed for future research.\n", "citation": "@inproceedings{hendrickx-etal-2010-semeval,\n title = \"{S}em{E}val-2010 Task 8: Multi-Way Classification of Semantic Relations between Pairs of Nominals\",\n author = \"Hendrickx, Iris and\n Kim, Su Nam and\n Kozareva, Zornitsa and\n Nakov, Preslav and\n {'O} S{'e}aghdha, Diarmuid and\n Pad{'o}, Sebastian and\n Pennacchiotti, Marco and\n Romano, Lorenza and\n Szpakowicz, Stan\",\n booktitle = \"Proceedings of the 5th International Workshop on Semantic Evaluation\",\n month = jul,\n year = \"2010\",\n address = \"Uppsala, Sweden\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://www.aclweb.org/anthology/S10-1006\",\n pages = \"33--38\",\n}\n", "homepage": "https://semeval2.fbk.eu/semeval2.php?location=tasks&taskid=11", "license": "", "features": {"sentence": {"dtype": "string", "id": null, "_type": "Value"}, "relation": {"num_classes": 19, "names": ["Cause-Effect(e1,e2)", "Cause-Effect(e2,e1)", "Component-Whole(e1,e2)", "Component-Whole(e2,e1)", "Content-Container(e1,e2)", "Content-Container(e2,e1)", "Entity-Destination(e1,e2)", "Entity-Destination(e2,e1)", "Entity-Origin(e1,e2)", "Entity-Origin(e2,e1)", "Instrument-Agency(e1,e2)", "Instrument-Agency(e2,e1)", "Member-Collection(e1,e2)", "Member-Collection(e2,e1)", "Message-Topic(e1,e2)", "Message-Topic(e2,e1)", "Product-Producer(e1,e2)", "Product-Producer(e2,e1)", "Other"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": {"input": "sentence", "output": "relation"}, "builder_name": "sem_eval2010_task8", "config_name": "default", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 1054352, "num_examples": 8000, "dataset_name": "sem_eval2010_task8"}, "test": {"name": "test", "num_bytes": 357075, "num_examples": 2717, "dataset_name": "sem_eval2010_task8"}}, "download_checksums": {"https://github.com/JoelNiklaus/SemEval2010Task8/raw/main/SemEval2010_task8_all_data.zip": {"num_bytes": 1964087, "checksum": "3bfd3ed634d844c9f95d1e4a1bb042b1c6d498ed7b4182dcadecde9bb95a8e71"}}, "download_size": 1964087, "post_processing_size": null, "dataset_size": 1411427, "size_in_bytes": 3375514}}
dummy/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4e36df6d6755d75719e43cf45c92b933c597bb836aade27d60c5ed4e45998db0
3
+ size 1778
sem_eval_2010_task_8.py ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ """The SemEval-2010 Task 8 on Multi-way classification of semantic relations between pairs of nominals"""
16
+
17
+ from __future__ import absolute_import, division, print_function
18
+
19
+ import os
20
+
21
+ import datasets
22
+
23
+
24
+ _CITATION = """\
25
+ @inproceedings{hendrickx-etal-2010-semeval,
26
+ title = "{S}em{E}val-2010 Task 8: Multi-Way Classification of Semantic Relations between Pairs of Nominals",
27
+ author = "Hendrickx, Iris and
28
+ Kim, Su Nam and
29
+ Kozareva, Zornitsa and
30
+ Nakov, Preslav and
31
+ {\'O} S{\'e}aghdha, Diarmuid and
32
+ Pad{\'o}, Sebastian and
33
+ Pennacchiotti, Marco and
34
+ Romano, Lorenza and
35
+ Szpakowicz, Stan",
36
+ booktitle = "Proceedings of the 5th International Workshop on Semantic Evaluation",
37
+ month = jul,
38
+ year = "2010",
39
+ address = "Uppsala, Sweden",
40
+ publisher = "Association for Computational Linguistics",
41
+ url = "https://www.aclweb.org/anthology/S10-1006",
42
+ pages = "33--38",
43
+ }
44
+ """
45
+
46
+ _DESCRIPTION = """\
47
+ The SemEval-2010 Task 8 focuses on Multi-way classification of semantic relations between pairs of nominals.
48
+ The task was designed to compare different approaches to semantic relation classification
49
+ and to provide a standard testbed for future research.
50
+ """
51
+
52
+ _URL = "https://github.com/JoelNiklaus/SemEval2010Task8/raw/main/SemEval2010_task8_all_data.zip"
53
+
54
+
55
+ class SemEval2010Task8(datasets.GeneratorBasedBuilder):
56
+ """The SemEval-2010 Task 8 focuses on Multi-way classification of semantic relations between pairs of nominals.
57
+ The task was designed to compare different approaches to semantic relation classification
58
+ and to provide a standard testbed for future research."""
59
+
60
+ VERSION = datasets.Version("1.0.0")
61
+
62
+ def _info(self):
63
+ return datasets.DatasetInfo(
64
+ # This is the description that will appear on the datasets page.
65
+ description=_DESCRIPTION,
66
+ # This defines the different columns of the dataset and their types
67
+ features=datasets.Features(
68
+ {
69
+ "sentence": datasets.Value("string"),
70
+ "relation": datasets.ClassLabel(
71
+ names=[
72
+ "Cause-Effect(e1,e2)",
73
+ "Cause-Effect(e2,e1)",
74
+ "Component-Whole(e1,e2)",
75
+ "Component-Whole(e2,e1)",
76
+ "Content-Container(e1,e2)",
77
+ "Content-Container(e2,e1)",
78
+ "Entity-Destination(e1,e2)",
79
+ "Entity-Destination(e2,e1)",
80
+ "Entity-Origin(e1,e2)",
81
+ "Entity-Origin(e2,e1)",
82
+ "Instrument-Agency(e1,e2)",
83
+ "Instrument-Agency(e2,e1)",
84
+ "Member-Collection(e1,e2)",
85
+ "Member-Collection(e2,e1)",
86
+ "Message-Topic(e1,e2)",
87
+ "Message-Topic(e2,e1)",
88
+ "Product-Producer(e1,e2)",
89
+ "Product-Producer(e2,e1)",
90
+ "Other",
91
+ ]
92
+ ),
93
+ }
94
+ ),
95
+ # If there's a common (input, target) tuple from the features,
96
+ # specify them here. They'll be used if as_supervised=True in
97
+ # builder.as_dataset.
98
+ supervised_keys=datasets.info.SupervisedKeysData(input="sentence", output="relation"),
99
+ # Homepage of the dataset for documentation
100
+ homepage="https://semeval2.fbk.eu/semeval2.php?location=tasks&taskid=11",
101
+ citation=_CITATION,
102
+ )
103
+
104
+ def _split_generators(self, dl_manager):
105
+ """Returns SplitGenerators."""
106
+ # dl_manager is a datasets.download.DownloadManager that can be used to
107
+ # download and extract URLs
108
+ dl_dir = dl_manager.download_and_extract(_URL)
109
+ data_dir = os.path.join(dl_dir, "SemEval2010_task8_all_data")
110
+ return [
111
+ datasets.SplitGenerator(
112
+ name=datasets.Split.TRAIN,
113
+ # These kwargs will be passed to _generate_examples
114
+ gen_kwargs={
115
+ "filepath": os.path.join(data_dir, "SemEval2010_task8_training/TRAIN_FILE.TXT"),
116
+ },
117
+ ),
118
+ datasets.SplitGenerator(
119
+ name=datasets.Split.TEST,
120
+ gen_kwargs={
121
+ "filepath": os.path.join(data_dir, "SemEval2010_task8_testing_keys/TEST_FILE_FULL.TXT"),
122
+ },
123
+ ),
124
+ ]
125
+
126
+ def _generate_examples(self, filepath):
127
+ """ Yields examples. """
128
+ with open(filepath, "r", encoding="us-ascii") as file:
129
+ lines = file.readlines()
130
+ num_lines_per_sample = 4
131
+
132
+ for i in range(0, len(lines), num_lines_per_sample):
133
+ idx = int(lines[i].split("\t")[0])
134
+ sentence = lines[i].split("\t")[1][1:-2] # remove " at the start and "\n at the end
135
+ relation = lines[i + 1][:-1] # remove \n at the end
136
+ yield idx, {
137
+ "sentence": sentence,
138
+ "relation": relation,
139
+ }