Datasets:
Fix subtask_c config science_ie.py
Browse files- science_ie.py +2 -4
science_ie.py
CHANGED
@@ -328,9 +328,7 @@ class ScienceIE(datasets.GeneratorBasedBuilder):
|
|
328 |
for relation in relations:
|
329 |
tag = relation["relation"][0]
|
330 |
if tag != "O":
|
331 |
-
|
332 |
-
for j in range(relation["arg2_start"], relation["arg2_end"]):
|
333 |
-
tag_vectors[i][j] = tag
|
334 |
# Yields examples as (key, example) tuples
|
335 |
yield key, {
|
336 |
"id": key,
|
@@ -348,7 +346,7 @@ class ScienceIE(datasets.GeneratorBasedBuilder):
|
|
348 |
}
|
349 |
for k, v in relation.items():
|
350 |
example[k] = v
|
351 |
-
yield
|
352 |
else: # NER config
|
353 |
doc_example_idx += 1
|
354 |
key = f"{doc_id}_{doc_example_idx}"
|
|
|
328 |
for relation in relations:
|
329 |
tag = relation["relation"][0]
|
330 |
if tag != "O":
|
331 |
+
tag_vectors[relation["arg1_start"]][relation["arg2_start"]] = tag
|
|
|
|
|
332 |
# Yields examples as (key, example) tuples
|
333 |
yield key, {
|
334 |
"id": key,
|
|
|
346 |
}
|
347 |
for k, v in relation.items():
|
348 |
example[k] = v
|
349 |
+
yield key, example
|
350 |
else: # NER config
|
351 |
doc_example_idx += 1
|
352 |
key = f"{doc_id}_{doc_example_idx}"
|