Commit
·
dc52725
1
Parent(s):
481b3b8
fix bigbio imports
Browse files
chia.py
CHANGED
@@ -26,6 +26,8 @@ import datasets
|
|
26 |
from .bigbiohub import kb_features
|
27 |
from .bigbiohub import BigBioConfig
|
28 |
from .bigbiohub import Tasks
|
|
|
|
|
29 |
|
30 |
_LANGUAGES = ['English']
|
31 |
_PUBMED = False
|
@@ -549,7 +551,7 @@ def parse_brat_file(txt_file: Path, annotation_file_suffixes: List[str] = None)
|
|
549 |
ann["text"] = [fields[2]]
|
550 |
ann["type"] = fields[1].split()[0]
|
551 |
ann["offsets"] = []
|
552 |
-
span_str =
|
553 |
for span in span_str.split(";"):
|
554 |
start, end = span.split()
|
555 |
ann["offsets"].append([int(start), int(end)])
|
|
|
26 |
from .bigbiohub import kb_features
|
27 |
from .bigbiohub import BigBioConfig
|
28 |
from .bigbiohub import Tasks
|
29 |
+
from .bigbiohub import remove_prefix
|
30 |
+
|
31 |
|
32 |
_LANGUAGES = ['English']
|
33 |
_PUBMED = False
|
|
|
551 |
ann["text"] = [fields[2]]
|
552 |
ann["type"] = fields[1].split()[0]
|
553 |
ann["offsets"] = []
|
554 |
+
span_str = remove_prefix(fields[1], (ann["type"] + " "))
|
555 |
for span in span_str.split(";"):
|
556 |
start, end = span.split()
|
557 |
ann["offsets"].append([int(start), int(end)])
|