Datasets:
Tasks:
Token Classification
Sub-tasks:
named-entity-recognition
Languages:
German
Size:
1M<n<10M
ArXiv:
DOI:
License:
elenanereiss
commited on
Commit
•
25ee654
1
Parent(s):
4dfbe0d
Update german-ler.py
Browse files- german-ler.py +9 -8
german-ler.py
CHANGED
@@ -174,16 +174,17 @@ class German_LER(datasets.GeneratorBasedBuilder):
|
|
174 |
current_labels.append(label)
|
175 |
|
176 |
# generate coarse-grained tags
|
177 |
-
|
|
|
178 |
else:
|
179 |
bio, fine_tag = label.split("-")
|
180 |
-
if fine_tag in ['PER', 'RR', 'AN']:
|
181 |
-
elif fine_tag in ['LD', 'ST', 'STR', 'LDS']:
|
182 |
-
elif fine_tag in ['ORG', 'UN', 'INN', 'GRT', 'MRK']:
|
183 |
-
elif fine_tag in ['GS', 'VO', 'EUN']:
|
184 |
-
elif fine_tag in ['VS', 'VT']:
|
185 |
-
else:
|
186 |
-
current_coarse_labels.append(
|
187 |
|
188 |
else:
|
189 |
if not current_words:
|
|
|
174 |
current_labels.append(label)
|
175 |
|
176 |
# generate coarse-grained tags
|
177 |
+
new_label = ""
|
178 |
+
if label == 'O': new_label = label
|
179 |
else:
|
180 |
bio, fine_tag = label.split("-")
|
181 |
+
if fine_tag in ['PER', 'RR', 'AN']: new_label = bio + '-PER'
|
182 |
+
elif fine_tag in ['LD', 'ST', 'STR', 'LDS']: new_label = bio + '-LOC'
|
183 |
+
elif fine_tag in ['ORG', 'UN', 'INN', 'GRT', 'MRK']: new_label = bio + '-ORG'
|
184 |
+
elif fine_tag in ['GS', 'VO', 'EUN']: new_label = bio + '-NRM'
|
185 |
+
elif fine_tag in ['VS', 'VT']: new_label = bio + '-REG'
|
186 |
+
else: new_label = label
|
187 |
+
current_coarse_labels.append(new_label)
|
188 |
|
189 |
else:
|
190 |
if not current_words:
|