gabrielaltay
commited on
Commit
·
1065790
1
Parent(s):
eb27b07
fix parsing import
Browse files- bionlp_st_2013_cg.py +6 -3
bionlp_st_2013_cg.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_cg"
|
26 |
_DISPLAYNAME = "BioNLP 2013 CG"
|
@@ -252,14 +255,14 @@ class bionlp_st_2013_cg(datasets.GeneratorBasedBuilder):
|
|
252 |
if self.config.schema == "source":
|
253 |
txt_files = list(data_files.glob("*txt"))
|
254 |
for guid, txt_file in enumerate(txt_files):
|
255 |
-
example =
|
256 |
example["id"] = str(guid)
|
257 |
yield guid, example
|
258 |
elif self.config.schema == "bigbio_kb":
|
259 |
txt_files = list(data_files.glob("*txt"))
|
260 |
for guid, txt_file in enumerate(txt_files):
|
261 |
-
example =
|
262 |
-
|
263 |
)
|
264 |
example = self._standardize_arguments_roles(example)
|
265 |
example["id"] = str(guid)
|
|
|
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_cg"
|
29 |
_DISPLAYNAME = "BioNLP 2013 CG"
|
|
|
255 |
if self.config.schema == "source":
|
256 |
txt_files = list(data_files.glob("*txt"))
|
257 |
for guid, txt_file in enumerate(txt_files):
|
258 |
+
example = parse_brat_file(txt_file)
|
259 |
example["id"] = str(guid)
|
260 |
yield guid, example
|
261 |
elif self.config.schema == "bigbio_kb":
|
262 |
txt_files = list(data_files.glob("*txt"))
|
263 |
for guid, txt_file in enumerate(txt_files):
|
264 |
+
example = brat_parse_to_bigbio_kb(
|
265 |
+
parse_brat_file(txt_file)
|
266 |
)
|
267 |
example = self._standardize_arguments_roles(example)
|
268 |
example["id"] = str(guid)
|