Datasets:
Tasks:
Token Classification
Modalities:
Text
Formats:
json
Sub-tasks:
named-entity-recognition
Size:
10K - 100K
License:
Commit
·
f5277f5
1
Parent(s):
27fcb95
made fine grained labels upper case as well because of problems with seqeval otherwise
Browse files- README.md +45 -45
- convert_to_hf_dataset.py +5 -5
- test.jsonl +1 -1
- train.jsonl +1 -1
- validation.jsonl +1 -1
README.md
CHANGED
|
@@ -158,51 +158,51 @@ The final coarse grained tagset (in IOB notation) is the following:
|
|
| 158 |
The final fine grained tagset (in IOB notation) is the following:
|
| 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 |
]`
|
| 207 |
|
| 208 |
|
|
|
|
| 158 |
The final fine grained tagset (in IOB notation) is the following:
|
| 159 |
|
| 160 |
`[
|
| 161 |
+
'O',
|
| 162 |
+
'B-BUILDING',
|
| 163 |
+
'I-BUILDING',
|
| 164 |
+
'B-CITY',
|
| 165 |
+
'I-CITY',
|
| 166 |
+
'B-COUNTRY',
|
| 167 |
+
'I-COUNTRY',
|
| 168 |
+
'B-PLACE',
|
| 169 |
+
'I-PLACE',
|
| 170 |
+
'B-TERRITORY',
|
| 171 |
+
'I-TERRITORY',
|
| 172 |
+
'I-UNIT',
|
| 173 |
+
'B-UNIT',
|
| 174 |
+
'B-VALUE',
|
| 175 |
+
'I-VALUE',
|
| 176 |
+
'B-YEAR',
|
| 177 |
+
'I-YEAR',
|
| 178 |
+
'B-STANDARD ABBREVIATION',
|
| 179 |
+
'I-STANDARD ABBREVIATION',
|
| 180 |
+
'B-MONTH',
|
| 181 |
+
'I-MONTH',
|
| 182 |
+
'B-DAY',
|
| 183 |
+
'I-DAY',
|
| 184 |
+
'B-AGE',
|
| 185 |
+
'I-AGE',
|
| 186 |
+
'B-ETHNIC CATEGORY',
|
| 187 |
+
'I-ETHNIC CATEGORY',
|
| 188 |
+
'B-FAMILY NAME',
|
| 189 |
+
'I-FAMILY NAME',
|
| 190 |
+
'B-INITIAL NAME',
|
| 191 |
+
'I-INITIAL NAME',
|
| 192 |
+
'B-MARITAL STATUS',
|
| 193 |
+
'I-MARITAL STATUS',
|
| 194 |
+
'B-PROFESSION',
|
| 195 |
+
'I-PROFESSION',
|
| 196 |
+
'B-ROLE',
|
| 197 |
+
'I-ROLE',
|
| 198 |
+
'B-NATIONALITY',
|
| 199 |
+
'I-NATIONALITY',
|
| 200 |
+
'B-TITLE',
|
| 201 |
+
'I-TITLE',
|
| 202 |
+
'B-URL',
|
| 203 |
+
'I-URL',
|
| 204 |
+
'B-TYPE',
|
| 205 |
+
'I-TYPE',
|
| 206 |
]`
|
| 207 |
|
| 208 |
|
convert_to_hf_dataset.py
CHANGED
|
@@ -23,8 +23,8 @@ annotation_labels = {'ADDRESS': ['building', 'city', 'country', 'place', 'postco
|
|
| 23 |
'TIME': [],
|
| 24 |
'VEHICLE': ['build year', 'colour', 'license plate number', 'model', 'type']}
|
| 25 |
|
| 26 |
-
# make all
|
| 27 |
-
annotation_labels = {key.upper(): [label.
|
| 28 |
print(annotation_labels)
|
| 29 |
print("coarse_grained:", list(annotation_labels.keys()))
|
| 30 |
print("fine_grained:",
|
|
@@ -61,7 +61,7 @@ def get_coarse_grained_for_fine_grained(label):
|
|
| 61 |
|
| 62 |
def is_fine_grained(label):
|
| 63 |
for coarse_grained, fine_grained_set in annotation_labels.items():
|
| 64 |
-
if label.
|
| 65 |
return True
|
| 66 |
return False
|
| 67 |
|
|
@@ -101,7 +101,7 @@ def get_token_annotations(token, annotations):
|
|
| 101 |
# some DATE are mislabeled as day but it is hard to correct this. So we ignore it
|
| 102 |
fine_grained = label
|
| 103 |
|
| 104 |
-
return coarse_grained.upper(), fine_grained.
|
| 105 |
|
| 106 |
|
| 107 |
def generate_IOB_labelset(series, casing_function):
|
|
@@ -132,7 +132,7 @@ def get_annotated_sentence(result_sentence, sentence):
|
|
| 132 |
result_sentence["coarse_grained"].append(coarse_grained)
|
| 133 |
result_sentence["fine_grained"].append(fine_grained)
|
| 134 |
result_sentence["coarse_grained"] = generate_IOB_labelset(result_sentence["coarse_grained"], str.upper)
|
| 135 |
-
result_sentence["fine_grained"] = generate_IOB_labelset(result_sentence["fine_grained"], str.
|
| 136 |
return result_sentence
|
| 137 |
|
| 138 |
|
|
|
|
| 23 |
'TIME': [],
|
| 24 |
'VEHICLE': ['build year', 'colour', 'license plate number', 'model', 'type']}
|
| 25 |
|
| 26 |
+
# make all labels upper case
|
| 27 |
+
annotation_labels = {key.upper(): [label.upper() for label in labels] for key, labels in annotation_labels.items()}
|
| 28 |
print(annotation_labels)
|
| 29 |
print("coarse_grained:", list(annotation_labels.keys()))
|
| 30 |
print("fine_grained:",
|
|
|
|
| 61 |
|
| 62 |
def is_fine_grained(label):
|
| 63 |
for coarse_grained, fine_grained_set in annotation_labels.items():
|
| 64 |
+
if label.upper() in fine_grained_set:
|
| 65 |
return True
|
| 66 |
return False
|
| 67 |
|
|
|
|
| 101 |
# some DATE are mislabeled as day but it is hard to correct this. So we ignore it
|
| 102 |
fine_grained = label
|
| 103 |
|
| 104 |
+
return coarse_grained.upper(), fine_grained.upper()
|
| 105 |
|
| 106 |
|
| 107 |
def generate_IOB_labelset(series, casing_function):
|
|
|
|
| 132 |
result_sentence["coarse_grained"].append(coarse_grained)
|
| 133 |
result_sentence["fine_grained"].append(fine_grained)
|
| 134 |
result_sentence["coarse_grained"] = generate_IOB_labelset(result_sentence["coarse_grained"], str.upper)
|
| 135 |
+
result_sentence["fine_grained"] = generate_IOB_labelset(result_sentence["fine_grained"], str.upper)
|
| 136 |
return result_sentence
|
| 137 |
|
| 138 |
|
test.jsonl
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 7717849
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9498f67f080b1745b5b41feb32f66beb30e2bd2ca024306a910a7c59c3134d14
|
| 3 |
size 7717849
|
train.jsonl
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 22116076
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f2e8da9572e8bdfd699c998803d40b9680b8c6b92ea3356e8786d675cc5a19e4
|
| 3 |
size 22116076
|
validation.jsonl
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 2874796
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a9b1a294688da296414c8042d4a18deb7a8f93006085f197074fe9a3a9b65abc
|
| 3 |
size 2874796
|