dataset: fix span processing
Browse files- germeval2014.py +7 -7
germeval2014.py
CHANGED
@@ -203,16 +203,16 @@ class GermEval2014(datasets.GeneratorBasedBuilder):
|
|
203 |
for span in original_spans:
|
204 |
if token in span:
|
205 |
original_tag = "B-" + span.tag if token == span[0] else "I-" + span.tag
|
206 |
-
|
207 |
-
span_text = " ".join(token.text for token in span.tokens)
|
208 |
-
t5_span = f"{span.tag} : {span_text}"
|
209 |
-
own_span = f"{span.tag} = {span_text}"
|
210 |
-
t5_spans.append(t5_span)
|
211 |
-
own_spans.append(own_span)
|
212 |
-
|
213 |
original_tokens.append(sentence[index].text)
|
214 |
original_tags.append(original_tag)
|
215 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
216 |
ner_t5_output = " || ".join(t5_spans)
|
217 |
ner_own_output = " || ".join(own_spans)
|
218 |
|
|
|
203 |
for span in original_spans:
|
204 |
if token in span:
|
205 |
original_tag = "B-" + span.tag if token == span[0] else "I-" + span.tag
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
206 |
original_tokens.append(sentence[index].text)
|
207 |
original_tags.append(original_tag)
|
208 |
|
209 |
+
for span in original_spans:
|
210 |
+
span_text = " ".join(token.text for token in span.tokens)
|
211 |
+
t5_span = f"{span.tag} : {span_text}"
|
212 |
+
own_span = f"{span.tag} = {span_text}"
|
213 |
+
t5_spans.append(t5_span)
|
214 |
+
own_spans.append(own_span)
|
215 |
+
|
216 |
ner_t5_output = " || ".join(t5_spans)
|
217 |
ner_own_output = " || ".join(own_spans)
|
218 |
|