Convert dataset to Parquet

#5
by lhoestq HF Staff - opened
README.md CHANGED
@@ -19,20 +19,8 @@ task_ids:
19
  - named-entity-recognition
20
  paperswithcode_id: conll
21
  pretty_name: CoNLL++
22
- train-eval-index:
23
- - config: conllpp
24
- task: token-classification
25
- task_id: entity_extraction
26
- splits:
27
- train_split: train
28
- eval_split: test
29
- col_mapping:
30
- tokens: tokens
31
- ner_tags: tags
32
- metrics:
33
- - type: seqeval
34
- name: seqeval
35
  dataset_info:
 
36
  features:
37
  - name: id
38
  dtype: string
@@ -42,106 +30,128 @@ dataset_info:
42
  sequence:
43
  class_label:
44
  names:
45
- 0: '"'
46
- 1: ''''''
47
- 2: '#'
48
- 3: $
49
- 4: (
50
- 5: )
51
- 6: ','
52
- 7: .
53
- 8: ':'
54
- 9: '``'
55
- 10: CC
56
- 11: CD
57
- 12: DT
58
- 13: EX
59
- 14: FW
60
- 15: IN
61
- 16: JJ
62
- 17: JJR
63
- 18: JJS
64
- 19: LS
65
- 20: MD
66
- 21: NN
67
- 22: NNP
68
- 23: NNPS
69
- 24: NNS
70
- 25: NN|SYM
71
- 26: PDT
72
- 27: POS
73
- 28: PRP
74
- 29: PRP$
75
- 30: RB
76
- 31: RBR
77
- 32: RBS
78
- 33: RP
79
- 34: SYM
80
- 35: TO
81
- 36: UH
82
- 37: VB
83
- 38: VBD
84
- 39: VBG
85
- 40: VBN
86
- 41: VBP
87
- 42: VBZ
88
- 43: WDT
89
- 44: WP
90
- 45: WP$
91
- 46: WRB
92
  - name: chunk_tags
93
  sequence:
94
  class_label:
95
  names:
96
- 0: O
97
- 1: B-ADJP
98
- 2: I-ADJP
99
- 3: B-ADVP
100
- 4: I-ADVP
101
- 5: B-CONJP
102
- 6: I-CONJP
103
- 7: B-INTJ
104
- 8: I-INTJ
105
- 9: B-LST
106
- 10: I-LST
107
- 11: B-NP
108
- 12: I-NP
109
- 13: B-PP
110
- 14: I-PP
111
- 15: B-PRT
112
- 16: I-PRT
113
- 17: B-SBAR
114
- 18: I-SBAR
115
- 19: B-UCP
116
- 20: I-UCP
117
- 21: B-VP
118
- 22: I-VP
119
  - name: ner_tags
120
  sequence:
121
  class_label:
122
  names:
123
- 0: O
124
- 1: B-PER
125
- 2: I-PER
126
- 3: B-ORG
127
- 4: I-ORG
128
- 5: B-LOC
129
- 6: I-LOC
130
- 7: B-MISC
131
- 8: I-MISC
132
- config_name: conllpp
133
  splits:
134
  - name: train
135
- num_bytes: 6931393
136
  num_examples: 14041
137
  - name: validation
138
- num_bytes: 1739247
139
  num_examples: 3250
140
  - name: test
141
- num_bytes: 1582078
142
  num_examples: 3453
143
- download_size: 4859600
144
- dataset_size: 10252718
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
145
  ---
146
 
147
  # Dataset Card for "conllpp"
 
19
  - named-entity-recognition
20
  paperswithcode_id: conll
21
  pretty_name: CoNLL++
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  dataset_info:
23
+ config_name: conllpp
24
  features:
25
  - name: id
26
  dtype: string
 
30
  sequence:
31
  class_label:
32
  names:
33
+ '0': '"'
34
+ '1': ''''''
35
+ '2': '#'
36
+ '3': $
37
+ '4': (
38
+ '5': )
39
+ '6': ','
40
+ '7': .
41
+ '8': ':'
42
+ '9': '``'
43
+ '10': CC
44
+ '11': CD
45
+ '12': DT
46
+ '13': EX
47
+ '14': FW
48
+ '15': IN
49
+ '16': JJ
50
+ '17': JJR
51
+ '18': JJS
52
+ '19': LS
53
+ '20': MD
54
+ '21': NN
55
+ '22': NNP
56
+ '23': NNPS
57
+ '24': NNS
58
+ '25': NN|SYM
59
+ '26': PDT
60
+ '27': POS
61
+ '28': PRP
62
+ '29': PRP$
63
+ '30': RB
64
+ '31': RBR
65
+ '32': RBS
66
+ '33': RP
67
+ '34': SYM
68
+ '35': TO
69
+ '36': UH
70
+ '37': VB
71
+ '38': VBD
72
+ '39': VBG
73
+ '40': VBN
74
+ '41': VBP
75
+ '42': VBZ
76
+ '43': WDT
77
+ '44': WP
78
+ '45': WP$
79
+ '46': WRB
80
  - name: chunk_tags
81
  sequence:
82
  class_label:
83
  names:
84
+ '0': O
85
+ '1': B-ADJP
86
+ '2': I-ADJP
87
+ '3': B-ADVP
88
+ '4': I-ADVP
89
+ '5': B-CONJP
90
+ '6': I-CONJP
91
+ '7': B-INTJ
92
+ '8': I-INTJ
93
+ '9': B-LST
94
+ '10': I-LST
95
+ '11': B-NP
96
+ '12': I-NP
97
+ '13': B-PP
98
+ '14': I-PP
99
+ '15': B-PRT
100
+ '16': I-PRT
101
+ '17': B-SBAR
102
+ '18': I-SBAR
103
+ '19': B-UCP
104
+ '20': I-UCP
105
+ '21': B-VP
106
+ '22': I-VP
107
  - name: ner_tags
108
  sequence:
109
  class_label:
110
  names:
111
+ '0': O
112
+ '1': B-PER
113
+ '2': I-PER
114
+ '3': B-ORG
115
+ '4': I-ORG
116
+ '5': B-LOC
117
+ '6': I-LOC
118
+ '7': B-MISC
119
+ '8': I-MISC
 
120
  splits:
121
  - name: train
122
+ num_bytes: 6931345
123
  num_examples: 14041
124
  - name: validation
125
+ num_bytes: 1739223
126
  num_examples: 3250
127
  - name: test
128
+ num_bytes: 1582054
129
  num_examples: 3453
130
+ download_size: 1807915
131
+ dataset_size: 10252622
132
+ configs:
133
+ - config_name: conllpp
134
+ data_files:
135
+ - split: train
136
+ path: conllpp/train-*
137
+ - split: validation
138
+ path: conllpp/validation-*
139
+ - split: test
140
+ path: conllpp/test-*
141
+ default: true
142
+ train-eval-index:
143
+ - config: conllpp
144
+ task: token-classification
145
+ task_id: entity_extraction
146
+ splits:
147
+ train_split: train
148
+ eval_split: test
149
+ col_mapping:
150
+ tokens: tokens
151
+ ner_tags: tags
152
+ metrics:
153
+ - type: seqeval
154
+ name: seqeval
155
  ---
156
 
157
  # Dataset Card for "conllpp"
conllpp.py DELETED
@@ -1,228 +0,0 @@
1
- # coding=utf-8
2
- # Copyright 2020 HuggingFace Datasets Authors.
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
- # Lint as: python3
17
- """CrossWeigh: Training Named Entity Tagger from Imperfect Annotations"""
18
-
19
- import logging
20
-
21
- import datasets
22
-
23
-
24
- _CITATION = """\
25
- @inproceedings{wang2019crossweigh,
26
- title={CrossWeigh: Training Named Entity Tagger from Imperfect Annotations},
27
- author={Wang, Zihan and Shang, Jingbo and Liu, Liyuan and Lu, Lihao and Liu, Jiacheng and Han, Jiawei},
28
- booktitle={Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP)},
29
- pages={5157--5166},
30
- year={2019}
31
- }
32
- """
33
-
34
- _DESCRIPTION = """\
35
- CoNLLpp is a corrected version of the CoNLL2003 NER dataset where labels of 5.38% of the sentences in the test set
36
- have been manually corrected. The training set and development set are included for completeness.
37
- For more details see https://www.aclweb.org/anthology/D19-1519/ and https://github.com/ZihanWangKi/CrossWeigh
38
- """
39
-
40
- _URL = "https://github.com/ZihanWangKi/CrossWeigh/raw/master/data/"
41
- _TRAINING_FILE = "conllpp_train.txt"
42
- _DEV_FILE = "conllpp_dev.txt"
43
- _TEST_FILE = "conllpp_test.txt"
44
-
45
-
46
- class ConllppConfig(datasets.BuilderConfig):
47
- """BuilderConfig for Conll2003"""
48
-
49
- def __init__(self, **kwargs):
50
- """BuilderConfig forConll2003.
51
- Args:
52
- **kwargs: keyword arguments forwarded to super.
53
- """
54
- super(ConllppConfig, self).__init__(**kwargs)
55
-
56
-
57
- class Conllpp(datasets.GeneratorBasedBuilder):
58
- """Conllpp dataset."""
59
-
60
- BUILDER_CONFIGS = [
61
- ConllppConfig(name="conllpp", version=datasets.Version("1.0.0"), description="Conllpp dataset"),
62
- ]
63
-
64
- def _info(self):
65
- return datasets.DatasetInfo(
66
- description=_DESCRIPTION,
67
- features=datasets.Features(
68
- {
69
- "id": datasets.Value("string"),
70
- "tokens": datasets.Sequence(datasets.Value("string")),
71
- "pos_tags": datasets.Sequence(
72
- datasets.features.ClassLabel(
73
- names=[
74
- '"',
75
- "''",
76
- "#",
77
- "$",
78
- "(",
79
- ")",
80
- ",",
81
- ".",
82
- ":",
83
- "``",
84
- "CC",
85
- "CD",
86
- "DT",
87
- "EX",
88
- "FW",
89
- "IN",
90
- "JJ",
91
- "JJR",
92
- "JJS",
93
- "LS",
94
- "MD",
95
- "NN",
96
- "NNP",
97
- "NNPS",
98
- "NNS",
99
- "NN|SYM",
100
- "PDT",
101
- "POS",
102
- "PRP",
103
- "PRP$",
104
- "RB",
105
- "RBR",
106
- "RBS",
107
- "RP",
108
- "SYM",
109
- "TO",
110
- "UH",
111
- "VB",
112
- "VBD",
113
- "VBG",
114
- "VBN",
115
- "VBP",
116
- "VBZ",
117
- "WDT",
118
- "WP",
119
- "WP$",
120
- "WRB",
121
- ]
122
- )
123
- ),
124
- "chunk_tags": datasets.Sequence(
125
- datasets.features.ClassLabel(
126
- names=[
127
- "O",
128
- "B-ADJP",
129
- "I-ADJP",
130
- "B-ADVP",
131
- "I-ADVP",
132
- "B-CONJP",
133
- "I-CONJP",
134
- "B-INTJ",
135
- "I-INTJ",
136
- "B-LST",
137
- "I-LST",
138
- "B-NP",
139
- "I-NP",
140
- "B-PP",
141
- "I-PP",
142
- "B-PRT",
143
- "I-PRT",
144
- "B-SBAR",
145
- "I-SBAR",
146
- "B-UCP",
147
- "I-UCP",
148
- "B-VP",
149
- "I-VP",
150
- ]
151
- )
152
- ),
153
- "ner_tags": datasets.Sequence(
154
- datasets.features.ClassLabel(
155
- names=[
156
- "O",
157
- "B-PER",
158
- "I-PER",
159
- "B-ORG",
160
- "I-ORG",
161
- "B-LOC",
162
- "I-LOC",
163
- "B-MISC",
164
- "I-MISC",
165
- ]
166
- )
167
- ),
168
- }
169
- ),
170
- supervised_keys=None,
171
- homepage="https://github.com/ZihanWangKi/CrossWeigh",
172
- citation=_CITATION,
173
- )
174
-
175
- def _split_generators(self, dl_manager):
176
- """Returns SplitGenerators."""
177
- urls_to_download = {
178
- "train": f"{_URL}{_TRAINING_FILE}",
179
- "dev": f"{_URL}{_DEV_FILE}",
180
- "test": f"{_URL}{_TEST_FILE}",
181
- }
182
- downloaded_files = dl_manager.download_and_extract(urls_to_download)
183
-
184
- return [
185
- datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),
186
- datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": downloaded_files["dev"]}),
187
- datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": downloaded_files["test"]}),
188
- ]
189
-
190
- def _generate_examples(self, filepath):
191
- logging.info("⏳ Generating examples from = %s", filepath)
192
- with open(filepath, encoding="utf-8") as f:
193
- guid = 0
194
- tokens = []
195
- pos_tags = []
196
- chunk_tags = []
197
- ner_tags = []
198
- for line in f:
199
- if line.startswith("-DOCSTART-") or line == "" or line == "\n":
200
- if tokens:
201
- yield guid, {
202
- "id": str(guid),
203
- "tokens": tokens,
204
- "pos_tags": pos_tags,
205
- "chunk_tags": chunk_tags,
206
- "ner_tags": ner_tags,
207
- }
208
- guid += 1
209
- tokens = []
210
- pos_tags = []
211
- chunk_tags = []
212
- ner_tags = []
213
- else:
214
- # conll2003 tokens are space separated
215
- splits = line.split(" ")
216
- tokens.append(splits[0])
217
- pos_tags.append(splits[1])
218
- chunk_tags.append(splits[2])
219
- ner_tags.append(splits[3].rstrip())
220
- # last example
221
- if tokens:
222
- yield guid, {
223
- "id": str(guid),
224
- "tokens": tokens,
225
- "pos_tags": pos_tags,
226
- "chunk_tags": chunk_tags,
227
- "ner_tags": ner_tags,
228
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
conllpp/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6a46d70c2e7056caa761057feb9ba80dc26db2bf1a9a09adb13beb513acb1b5a
3
+ size 276767
conllpp/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d4264892ad73c70e95f85b55754158a4b4269fed152121a31447a973597ceb19
3
+ size 1221036
conllpp/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:656885266739f8ab503bd89da609b53409a00541aa89603c81804762cafa9803
3
+ size 310112