Commit
·
a698827
1
Parent(s):
c14bb83
fix parsing imports
Browse files- bionlp_st_2013_ge.py +6 -3
bionlp_st_2013_ge.py
CHANGED
|
@@ -21,6 +21,9 @@ import datasets
|
|
| 21 |
from .bigbiohub import kb_features
|
| 22 |
from .bigbiohub import BigBioConfig
|
| 23 |
from .bigbiohub import Tasks
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
_DATASETNAME = "bionlp_st_2013_ge"
|
| 26 |
_DISPLAYNAME = "BioNLP 2013 GE"
|
|
@@ -223,14 +226,14 @@ class bionlp_st_2013_ge(datasets.GeneratorBasedBuilder):
|
|
| 223 |
if self.config.schema == "source":
|
| 224 |
txt_files = list(data_files.glob("*txt"))
|
| 225 |
for guid, txt_file in enumerate(txt_files):
|
| 226 |
-
example =
|
| 227 |
example["id"] = str(guid)
|
| 228 |
yield guid, example
|
| 229 |
elif self.config.schema == "bigbio_kb":
|
| 230 |
txt_files = list(data_files.glob("*txt"))
|
| 231 |
for guid, txt_file in enumerate(txt_files):
|
| 232 |
-
example =
|
| 233 |
-
|
| 234 |
)
|
| 235 |
example["id"] = str(guid)
|
| 236 |
yield guid, example
|
|
|
|
| 21 |
from .bigbiohub import kb_features
|
| 22 |
from .bigbiohub import BigBioConfig
|
| 23 |
from .bigbiohub import Tasks
|
| 24 |
+
from .bigbiohub import parse_brat_file
|
| 25 |
+
from .bigbiohub import brat_parse_to_bigbio_kb
|
| 26 |
+
|
| 27 |
|
| 28 |
_DATASETNAME = "bionlp_st_2013_ge"
|
| 29 |
_DISPLAYNAME = "BioNLP 2013 GE"
|
|
|
|
| 226 |
if self.config.schema == "source":
|
| 227 |
txt_files = list(data_files.glob("*txt"))
|
| 228 |
for guid, txt_file in enumerate(txt_files):
|
| 229 |
+
example = parse_brat_file(txt_file)
|
| 230 |
example["id"] = str(guid)
|
| 231 |
yield guid, example
|
| 232 |
elif self.config.schema == "bigbio_kb":
|
| 233 |
txt_files = list(data_files.glob("*txt"))
|
| 234 |
for guid, txt_file in enumerate(txt_files):
|
| 235 |
+
example = brat_parse_to_bigbio_kb(
|
| 236 |
+
parse_brat_file(txt_file)
|
| 237 |
)
|
| 238 |
example["id"] = str(guid)
|
| 239 |
yield guid, example
|