Datasets:
Tasks:
Token Classification
Sub-tasks:
named-entity-recognition
Languages:
English
Size:
10K<n<100K
License:
Convert dataset to Parquet
#1
by
albertvillanova
HF staff
- opened
- README.md +220 -186
- fabner.py +0 -230
- fabner/test-00000-of-00001.parquet +3 -0
- fabner/train-00000-of-00001.parquet +3 -0
- fabner/validation-00000-of-00001.parquet +3 -0
- fabner_bio/test-00000-of-00001.parquet +3 -0
- fabner_bio/train-00000-of-00001.parquet +3 -0
- fabner_bio/validation-00000-of-00001.parquet +3 -0
- fabner_simple/test-00000-of-00001.parquet +3 -0
- fabner_simple/train-00000-of-00001.parquet +3 -0
- fabner_simple/validation-00000-of-00001.parquet +3 -0
- text2tech/test-00000-of-00001.parquet +3 -0
- text2tech/train-00000-of-00001.parquet +3 -0
- text2tech/validation-00000-of-00001.parquet +3 -0
README.md
CHANGED
@@ -1,206 +1,240 @@
|
|
1 |
---
|
2 |
annotations_creators:
|
3 |
- expert-generated
|
4 |
-
language:
|
5 |
-
- en
|
6 |
language_creators:
|
7 |
- found
|
|
|
|
|
8 |
license:
|
9 |
- other
|
10 |
multilinguality:
|
11 |
- monolingual
|
12 |
-
pretty_name: FabNER is a manufacturing text dataset for Named Entity Recognition.
|
13 |
size_categories:
|
14 |
- 10K<n<100K
|
15 |
source_datasets: []
|
16 |
-
tags:
|
17 |
-
- manufacturing
|
18 |
-
- 2000-2020
|
19 |
task_categories:
|
20 |
- token-classification
|
21 |
task_ids:
|
22 |
- named-entity-recognition
|
|
|
|
|
|
|
|
|
23 |
dataset_info:
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
204 |
---
|
205 |
|
206 |
# Dataset Card for FabNER
|
|
|
1 |
---
|
2 |
annotations_creators:
|
3 |
- expert-generated
|
|
|
|
|
4 |
language_creators:
|
5 |
- found
|
6 |
+
language:
|
7 |
+
- en
|
8 |
license:
|
9 |
- other
|
10 |
multilinguality:
|
11 |
- monolingual
|
|
|
12 |
size_categories:
|
13 |
- 10K<n<100K
|
14 |
source_datasets: []
|
|
|
|
|
|
|
15 |
task_categories:
|
16 |
- token-classification
|
17 |
task_ids:
|
18 |
- named-entity-recognition
|
19 |
+
pretty_name: FabNER is a manufacturing text dataset for Named Entity Recognition.
|
20 |
+
tags:
|
21 |
+
- manufacturing
|
22 |
+
- 2000-2020
|
23 |
dataset_info:
|
24 |
+
- config_name: fabner
|
25 |
+
features:
|
26 |
+
- name: id
|
27 |
+
dtype: string
|
28 |
+
- name: tokens
|
29 |
+
sequence: string
|
30 |
+
- name: ner_tags
|
31 |
+
sequence:
|
32 |
+
class_label:
|
33 |
+
names:
|
34 |
+
'0': O
|
35 |
+
'1': B-MATE
|
36 |
+
'2': I-MATE
|
37 |
+
'3': E-MATE
|
38 |
+
'4': S-MATE
|
39 |
+
'5': B-MANP
|
40 |
+
'6': I-MANP
|
41 |
+
'7': E-MANP
|
42 |
+
'8': S-MANP
|
43 |
+
'9': B-MACEQ
|
44 |
+
'10': I-MACEQ
|
45 |
+
'11': E-MACEQ
|
46 |
+
'12': S-MACEQ
|
47 |
+
'13': B-APPL
|
48 |
+
'14': I-APPL
|
49 |
+
'15': E-APPL
|
50 |
+
'16': S-APPL
|
51 |
+
'17': B-FEAT
|
52 |
+
'18': I-FEAT
|
53 |
+
'19': E-FEAT
|
54 |
+
'20': S-FEAT
|
55 |
+
'21': B-PRO
|
56 |
+
'22': I-PRO
|
57 |
+
'23': E-PRO
|
58 |
+
'24': S-PRO
|
59 |
+
'25': B-CHAR
|
60 |
+
'26': I-CHAR
|
61 |
+
'27': E-CHAR
|
62 |
+
'28': S-CHAR
|
63 |
+
'29': B-PARA
|
64 |
+
'30': I-PARA
|
65 |
+
'31': E-PARA
|
66 |
+
'32': S-PARA
|
67 |
+
'33': B-ENAT
|
68 |
+
'34': I-ENAT
|
69 |
+
'35': E-ENAT
|
70 |
+
'36': S-ENAT
|
71 |
+
'37': B-CONPRI
|
72 |
+
'38': I-CONPRI
|
73 |
+
'39': E-CONPRI
|
74 |
+
'40': S-CONPRI
|
75 |
+
'41': B-MANS
|
76 |
+
'42': I-MANS
|
77 |
+
'43': E-MANS
|
78 |
+
'44': S-MANS
|
79 |
+
'45': B-BIOP
|
80 |
+
'46': I-BIOP
|
81 |
+
'47': E-BIOP
|
82 |
+
'48': S-BIOP
|
83 |
+
splits:
|
84 |
+
- name: train
|
85 |
+
num_bytes: 4394010
|
86 |
+
num_examples: 9435
|
87 |
+
- name: validation
|
88 |
+
num_bytes: 934347
|
89 |
+
num_examples: 2183
|
90 |
+
- name: test
|
91 |
+
num_bytes: 940136
|
92 |
+
num_examples: 2064
|
93 |
+
download_size: 1265830
|
94 |
+
dataset_size: 6268493
|
95 |
+
- config_name: fabner_bio
|
96 |
+
features:
|
97 |
+
- name: id
|
98 |
+
dtype: string
|
99 |
+
- name: tokens
|
100 |
+
sequence: string
|
101 |
+
- name: ner_tags
|
102 |
+
sequence:
|
103 |
+
class_label:
|
104 |
+
names:
|
105 |
+
'0': O
|
106 |
+
'1': B-MATE
|
107 |
+
'2': I-MATE
|
108 |
+
'3': B-MANP
|
109 |
+
'4': I-MANP
|
110 |
+
'5': B-MACEQ
|
111 |
+
'6': I-MACEQ
|
112 |
+
'7': B-APPL
|
113 |
+
'8': I-APPL
|
114 |
+
'9': B-FEAT
|
115 |
+
'10': I-FEAT
|
116 |
+
'11': B-PRO
|
117 |
+
'12': I-PRO
|
118 |
+
'13': B-CHAR
|
119 |
+
'14': I-CHAR
|
120 |
+
'15': B-PARA
|
121 |
+
'16': I-PARA
|
122 |
+
'17': B-ENAT
|
123 |
+
'18': I-ENAT
|
124 |
+
'19': B-CONPRI
|
125 |
+
'20': I-CONPRI
|
126 |
+
'21': B-MANS
|
127 |
+
'22': I-MANS
|
128 |
+
'23': B-BIOP
|
129 |
+
'24': I-BIOP
|
130 |
+
splits:
|
131 |
+
- name: train
|
132 |
+
num_bytes: 4394010
|
133 |
+
num_examples: 9435
|
134 |
+
- name: validation
|
135 |
+
num_bytes: 934347
|
136 |
+
num_examples: 2183
|
137 |
+
- name: test
|
138 |
+
num_bytes: 940136
|
139 |
+
num_examples: 2064
|
140 |
+
download_size: 1258672
|
141 |
+
dataset_size: 6268493
|
142 |
+
- config_name: fabner_simple
|
143 |
+
features:
|
144 |
+
- name: id
|
145 |
+
dtype: string
|
146 |
+
- name: tokens
|
147 |
+
sequence: string
|
148 |
+
- name: ner_tags
|
149 |
+
sequence:
|
150 |
+
class_label:
|
151 |
+
names:
|
152 |
+
'0': O
|
153 |
+
'1': MATE
|
154 |
+
'2': MANP
|
155 |
+
'3': MACEQ
|
156 |
+
'4': APPL
|
157 |
+
'5': FEAT
|
158 |
+
'6': PRO
|
159 |
+
'7': CHAR
|
160 |
+
'8': PARA
|
161 |
+
'9': ENAT
|
162 |
+
'10': CONPRI
|
163 |
+
'11': MANS
|
164 |
+
'12': BIOP
|
165 |
+
splits:
|
166 |
+
- name: train
|
167 |
+
num_bytes: 4394010
|
168 |
+
num_examples: 9435
|
169 |
+
- name: validation
|
170 |
+
num_bytes: 934347
|
171 |
+
num_examples: 2183
|
172 |
+
- name: test
|
173 |
+
num_bytes: 940136
|
174 |
+
num_examples: 2064
|
175 |
+
download_size: 1233960
|
176 |
+
dataset_size: 6268493
|
177 |
+
- config_name: text2tech
|
178 |
+
features:
|
179 |
+
- name: id
|
180 |
+
dtype: string
|
181 |
+
- name: tokens
|
182 |
+
sequence: string
|
183 |
+
- name: ner_tags
|
184 |
+
sequence:
|
185 |
+
class_label:
|
186 |
+
names:
|
187 |
+
'0': O
|
188 |
+
'1': Technological System
|
189 |
+
'2': Method
|
190 |
+
'3': Material
|
191 |
+
'4': Technical Field
|
192 |
+
splits:
|
193 |
+
- name: train
|
194 |
+
num_bytes: 4394010
|
195 |
+
num_examples: 9435
|
196 |
+
- name: validation
|
197 |
+
num_bytes: 934347
|
198 |
+
num_examples: 2183
|
199 |
+
- name: test
|
200 |
+
num_bytes: 940136
|
201 |
+
num_examples: 2064
|
202 |
+
download_size: 1192966
|
203 |
+
dataset_size: 6268493
|
204 |
+
configs:
|
205 |
+
- config_name: fabner
|
206 |
+
data_files:
|
207 |
+
- split: train
|
208 |
+
path: fabner/train-*
|
209 |
+
- split: validation
|
210 |
+
path: fabner/validation-*
|
211 |
+
- split: test
|
212 |
+
path: fabner/test-*
|
213 |
+
default: true
|
214 |
+
- config_name: fabner_bio
|
215 |
+
data_files:
|
216 |
+
- split: train
|
217 |
+
path: fabner_bio/train-*
|
218 |
+
- split: validation
|
219 |
+
path: fabner_bio/validation-*
|
220 |
+
- split: test
|
221 |
+
path: fabner_bio/test-*
|
222 |
+
- config_name: fabner_simple
|
223 |
+
data_files:
|
224 |
+
- split: train
|
225 |
+
path: fabner_simple/train-*
|
226 |
+
- split: validation
|
227 |
+
path: fabner_simple/validation-*
|
228 |
+
- split: test
|
229 |
+
path: fabner_simple/test-*
|
230 |
+
- config_name: text2tech
|
231 |
+
data_files:
|
232 |
+
- split: train
|
233 |
+
path: text2tech/train-*
|
234 |
+
- split: validation
|
235 |
+
path: text2tech/validation-*
|
236 |
+
- split: test
|
237 |
+
path: text2tech/test-*
|
238 |
---
|
239 |
|
240 |
# Dataset Card for FabNER
|
fabner.py
DELETED
@@ -1,230 +0,0 @@
|
|
1 |
-
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
|
2 |
-
#
|
3 |
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
4 |
-
# you may not use this file except in compliance with the License.
|
5 |
-
# You may obtain a copy of the License at
|
6 |
-
#
|
7 |
-
# http://www.apache.org/licenses/LICENSE-2.0
|
8 |
-
#
|
9 |
-
# Unless required by applicable law or agreed to in writing, software
|
10 |
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11 |
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12 |
-
# See the License for the specific language governing permissions and
|
13 |
-
# limitations under the License.
|
14 |
-
"""FabNER is a manufacturing text corpus of 350,000+ words for Named Entity Recognition."""
|
15 |
-
|
16 |
-
import datasets
|
17 |
-
|
18 |
-
|
19 |
-
# Find for instance the citation on arxiv or on the dataset repo/website
|
20 |
-
_CITATION = """\
|
21 |
-
@article{DBLP:journals/jim/KumarS22,
|
22 |
-
author = {Aman Kumar and
|
23 |
-
Binil Starly},
|
24 |
-
title = {"FabNER": information extraction from manufacturing process science
|
25 |
-
domain literature using named entity recognition},
|
26 |
-
journal = {J. Intell. Manuf.},
|
27 |
-
volume = {33},
|
28 |
-
number = {8},
|
29 |
-
pages = {2393--2407},
|
30 |
-
year = {2022},
|
31 |
-
url = {https://doi.org/10.1007/s10845-021-01807-x},
|
32 |
-
doi = {10.1007/s10845-021-01807-x},
|
33 |
-
timestamp = {Sun, 13 Nov 2022 17:52:57 +0100},
|
34 |
-
biburl = {https://dblp.org/rec/journals/jim/KumarS22.bib},
|
35 |
-
bibsource = {dblp computer science bibliography, https://dblp.org}
|
36 |
-
}
|
37 |
-
"""
|
38 |
-
|
39 |
-
# You can copy an official description
|
40 |
-
_DESCRIPTION = """\
|
41 |
-
FabNER is a manufacturing text corpus of 350,000+ words for Named Entity Recognition.
|
42 |
-
It is a collection of abstracts obtained from Web of Science through known journals available in manufacturing process
|
43 |
-
science research.
|
44 |
-
For every word, there were categories/entity labels defined namely Material (MATE), Manufacturing Process (MANP),
|
45 |
-
Machine/Equipment (MACEQ), Application (APPL), Features (FEAT), Mechanical Properties (PRO), Characterization (CHAR),
|
46 |
-
Parameters (PARA), Enabling Technology (ENAT), Concept/Principles (CONPRI), Manufacturing Standards (MANS) and
|
47 |
-
BioMedical (BIOP). Annotation was performed in all categories along with the output tag in 'BIOES' format:
|
48 |
-
B=Beginning, I-Intermediate, O=Outside, E=End, S=Single.
|
49 |
-
"""
|
50 |
-
|
51 |
-
_HOMEPAGE = "https://figshare.com/articles/dataset/Dataset_NER_Manufacturing_-_FabNER_Information_Extraction_from_Manufacturing_Process_Science_Domain_Literature_Using_Named_Entity_Recognition/14782407"
|
52 |
-
|
53 |
-
# TODO: Add the licence for the dataset here if you can find it
|
54 |
-
_LICENSE = ""
|
55 |
-
|
56 |
-
# The HuggingFace Datasets library doesn't host the datasets but only points to the original files.
|
57 |
-
# This can be an arbitrary nested dict/list of URLs (see below in `_split_generators` method)
|
58 |
-
_URLS = {
|
59 |
-
"train": "https://figshare.com/ndownloader/files/28405854/S2-train.txt",
|
60 |
-
"validation": "https://figshare.com/ndownloader/files/28405857/S3-val.txt",
|
61 |
-
"test": "https://figshare.com/ndownloader/files/28405851/S1-test.txt",
|
62 |
-
}
|
63 |
-
|
64 |
-
|
65 |
-
def map_fabner_labels(string_tag):
|
66 |
-
tag = string_tag[2:]
|
67 |
-
# MATERIAL (FABNER)
|
68 |
-
if tag == "MATE":
|
69 |
-
return "Material"
|
70 |
-
# MANUFACTURING PROCESS (FABNER)
|
71 |
-
elif tag == "MANP":
|
72 |
-
return "Method"
|
73 |
-
# MACHINE/EQUIPMENT, MECHANICAL PROPERTIES, CHARACTERIZATION, ENABLING TECHNOLOGY (FABNER)
|
74 |
-
elif tag in ["MACEQ", "PRO", "CHAR", "ENAT"]:
|
75 |
-
return "Technological System"
|
76 |
-
# APPLICATION (FABNER)
|
77 |
-
elif tag == "APPL":
|
78 |
-
return "Technical Field"
|
79 |
-
# FEATURES, PARAMETERS, CONCEPT/PRINCIPLES, MANUFACTURING STANDARDS, BIOMEDICAL, O (FABNER)
|
80 |
-
else:
|
81 |
-
return "O"
|
82 |
-
|
83 |
-
|
84 |
-
class FabNER(datasets.GeneratorBasedBuilder):
|
85 |
-
"""FabNER is a manufacturing text corpus of 350,000+ words for Named Entity Recognition."""
|
86 |
-
|
87 |
-
VERSION = datasets.Version("1.2.0")
|
88 |
-
|
89 |
-
# This is an example of a dataset with multiple configurations.
|
90 |
-
# If you don't want/need to define several sub-sets in your dataset,
|
91 |
-
# just remove the BUILDER_CONFIG_CLASS and the BUILDER_CONFIGS attributes.
|
92 |
-
|
93 |
-
# If you need to make complex sub-parts in the datasets with configurable options
|
94 |
-
# You can create your own builder configuration class to store attribute, inheriting from datasets.BuilderConfig
|
95 |
-
# BUILDER_CONFIG_CLASS = MyBuilderConfig
|
96 |
-
|
97 |
-
# You will be able to load one or the other configurations in the following list with
|
98 |
-
# data = datasets.load_dataset('my_dataset', 'first_domain')
|
99 |
-
# data = datasets.load_dataset('my_dataset', 'second_domain')
|
100 |
-
BUILDER_CONFIGS = [
|
101 |
-
datasets.BuilderConfig(name="fabner", version=VERSION,
|
102 |
-
description="The FabNER dataset with the original BIOES tagging format"),
|
103 |
-
datasets.BuilderConfig(name="fabner_bio", version=VERSION,
|
104 |
-
description="The FabNER dataset with BIO tagging format"),
|
105 |
-
datasets.BuilderConfig(name="fabner_simple", version=VERSION,
|
106 |
-
description="The FabNER dataset with no tagging format"),
|
107 |
-
datasets.BuilderConfig(name="text2tech", version=VERSION,
|
108 |
-
description="The FabNER dataset mapped to the Text2Tech tag set"),
|
109 |
-
]
|
110 |
-
DEFAULT_CONFIG_NAME = "fabner"
|
111 |
-
|
112 |
-
def _info(self):
|
113 |
-
entity_types = [
|
114 |
-
"MATE", # Material
|
115 |
-
"MANP", # Manufacturing Process
|
116 |
-
"MACEQ", # Machine/Equipment
|
117 |
-
"APPL", # Application
|
118 |
-
"FEAT", # Engineering Features
|
119 |
-
"PRO", # Mechanical Properties
|
120 |
-
"CHAR", # Process Characterization
|
121 |
-
"PARA", # Process Parameters
|
122 |
-
"ENAT", # Enabling Technology
|
123 |
-
"CONPRI", # Concept/Principles
|
124 |
-
"MANS", # Manufacturing Standards
|
125 |
-
"BIOP", # BioMedical
|
126 |
-
]
|
127 |
-
if self.config.name == "text2tech":
|
128 |
-
class_labels = ["O", "Technological System", "Method", "Material", "Technical Field"]
|
129 |
-
elif self.config.name == "fabner":
|
130 |
-
class_labels = ["O"]
|
131 |
-
for entity_type in entity_types:
|
132 |
-
class_labels.extend(
|
133 |
-
[
|
134 |
-
"B-" + entity_type,
|
135 |
-
"I-" + entity_type,
|
136 |
-
"E-" + entity_type,
|
137 |
-
"S-" + entity_type,
|
138 |
-
]
|
139 |
-
)
|
140 |
-
elif self.config.name == "fabner_bio":
|
141 |
-
class_labels = ["O"]
|
142 |
-
for entity_type in entity_types:
|
143 |
-
class_labels.extend(
|
144 |
-
[
|
145 |
-
"B-" + entity_type,
|
146 |
-
"I-" + entity_type,
|
147 |
-
]
|
148 |
-
)
|
149 |
-
else:
|
150 |
-
class_labels = ["O"] + entity_types
|
151 |
-
features = datasets.Features(
|
152 |
-
{
|
153 |
-
"id": datasets.Value("string"),
|
154 |
-
"tokens": datasets.Sequence(datasets.Value("string")),
|
155 |
-
"ner_tags": datasets.Sequence(
|
156 |
-
datasets.features.ClassLabel(
|
157 |
-
names=class_labels
|
158 |
-
)
|
159 |
-
),
|
160 |
-
}
|
161 |
-
)
|
162 |
-
return datasets.DatasetInfo(
|
163 |
-
# This is the description that will appear on the datasets page.
|
164 |
-
description=_DESCRIPTION,
|
165 |
-
# This defines the different columns of the dataset and their types
|
166 |
-
features=features, # Here we define them above because they are different between the two configurations
|
167 |
-
# If there's a common (input, target) tuple from the features, uncomment supervised_keys line below and
|
168 |
-
# specify them. They'll be used if as_supervised=True in builder.as_dataset.
|
169 |
-
# supervised_keys=("sentence", "label"),
|
170 |
-
# Homepage of the dataset for documentation
|
171 |
-
homepage=_HOMEPAGE,
|
172 |
-
# License for the dataset if available
|
173 |
-
license=_LICENSE,
|
174 |
-
# Citation for the dataset
|
175 |
-
citation=_CITATION,
|
176 |
-
)
|
177 |
-
|
178 |
-
def _split_generators(self, dl_manager):
|
179 |
-
# If several configurations are possible (listed in BUILDER_CONFIGS), the configuration selected by the user is in self.config.name
|
180 |
-
|
181 |
-
# dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLS
|
182 |
-
# It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files.
|
183 |
-
# By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
|
184 |
-
downloaded_files = dl_manager.download_and_extract(_URLS)
|
185 |
-
|
186 |
-
return [datasets.SplitGenerator(name=i, gen_kwargs={"filepath": downloaded_files[str(i)]})
|
187 |
-
for i in [datasets.Split.TRAIN, datasets.Split.VALIDATION, datasets.Split.TEST]]
|
188 |
-
|
189 |
-
# method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
|
190 |
-
def _generate_examples(self, filepath):
|
191 |
-
# The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
|
192 |
-
with open(filepath, encoding="utf-8") as f:
|
193 |
-
guid = 0
|
194 |
-
tokens = []
|
195 |
-
ner_tags = []
|
196 |
-
for line in f:
|
197 |
-
if line == "" or line == "\n":
|
198 |
-
if tokens:
|
199 |
-
yield guid, {
|
200 |
-
"id": str(guid),
|
201 |
-
"tokens": tokens,
|
202 |
-
"ner_tags": ner_tags,
|
203 |
-
}
|
204 |
-
guid += 1
|
205 |
-
tokens = []
|
206 |
-
ner_tags = []
|
207 |
-
else:
|
208 |
-
splits = line.split(" ")
|
209 |
-
tokens.append(splits[0])
|
210 |
-
ner_tag = splits[1].rstrip()
|
211 |
-
if self.config.name == "fabner_simple":
|
212 |
-
if ner_tag == "O":
|
213 |
-
ner_tag = "O"
|
214 |
-
else:
|
215 |
-
ner_tag = ner_tag.split("-")[1]
|
216 |
-
elif self.config.name == "fabner_bio":
|
217 |
-
if ner_tag == "O":
|
218 |
-
ner_tag = "O"
|
219 |
-
else:
|
220 |
-
ner_tag = ner_tag.replace("S-", "B-").replace("E-", "I-")
|
221 |
-
elif self.config.name == "text2tech":
|
222 |
-
ner_tag = map_fabner_labels(ner_tag)
|
223 |
-
ner_tags.append(ner_tag)
|
224 |
-
# last example
|
225 |
-
if tokens:
|
226 |
-
yield guid, {
|
227 |
-
"id": str(guid),
|
228 |
-
"tokens": tokens,
|
229 |
-
"ner_tags": ner_tags,
|
230 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fabner/test-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:abea0b7f2f710c38230dce5e78e4a353ee6fce0ce763c5023218bc51da248e02
|
3 |
+
size 187818
|
fabner/train-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:27ac50dca8f97f7a53f955c5643b3abf5303ec9ce470b213e091681080eeb2d5
|
3 |
+
size 886876
|
fabner/validation-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f90eede3c304fe37f546a0bf815483fbd762f884e9c1e6518613a3312b0b1220
|
3 |
+
size 191136
|
fabner_bio/test-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c0a19df6e0c230c42c20685db9499fbabe86988cab976797d1b3269c2f86b75c
|
3 |
+
size 186509
|
fabner_bio/train-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:dd645b0ef6c0351f34bd998fcbba60f61661af9e5913a0551abf505b6944ba1d
|
3 |
+
size 882323
|
fabner_bio/validation-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9e1be33b1f7e8d387542923eca2ed37dbddf052859cf0c76e565bade47ddc2b6
|
3 |
+
size 189840
|
fabner_simple/test-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b9cc8e9937fa2195061f32cb8847278c3f36bf057d38bb1955c8626952423669
|
3 |
+
size 182510
|
fabner_simple/train-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f32748bd2b2d330696daccef3405e2880a1fe15266cba37d4c362e036a830b6d
|
3 |
+
size 865900
|
fabner_simple/validation-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2d56f5a2a41890e2f261baee09a4e5765a952ea65b67103dc84d565affd6b5ce
|
3 |
+
size 185550
|
text2tech/test-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9812b6d20f0e352feade83911c703e7f6d74a90bbcf972b4f4ec25bda2c01c4c
|
3 |
+
size 176191
|
text2tech/train-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d3a9dfcfecb0aeb61fc5e43307963a9c1215897b21e8d03c7fd739796a5414ed
|
3 |
+
size 837437
|
text2tech/validation-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2ef0e216890a1b9876c7ba7763e05347d5bbd97680382c706cecae25376310de
|
3 |
+
size 179338
|