gabrielaltay
commited on
Commit
•
492d811
1
Parent(s):
7c011a7
fix parsing import
Browse files- bionlp_st_2013_gro.py +6 -3
bionlp_st_2013_gro.py
CHANGED
@@ -22,6 +22,9 @@ import datasets
|
|
22 |
from .bigbiohub import kb_features
|
23 |
from .bigbiohub import BigBioConfig
|
24 |
from .bigbiohub import Tasks
|
|
|
|
|
|
|
25 |
|
26 |
_DATASETNAME = "bionlp_st_2013_gro"
|
27 |
_DISPLAYNAME = "BioNLP 2013 GRO"
|
@@ -225,14 +228,14 @@ class bionlp_st_2013_gro(datasets.GeneratorBasedBuilder):
|
|
225 |
if self.config.schema == "source":
|
226 |
txt_files = list(data_files.glob("*txt"))
|
227 |
for guid, txt_file in enumerate(txt_files):
|
228 |
-
example =
|
229 |
example["id"] = str(guid)
|
230 |
yield guid, example
|
231 |
elif self.config.schema == "bigbio_kb":
|
232 |
txt_files = list(data_files.glob("*txt"))
|
233 |
for guid, txt_file in enumerate(txt_files):
|
234 |
-
example =
|
235 |
-
|
236 |
)
|
237 |
example["id"] = str(guid)
|
238 |
yield guid, example
|
|
|
22 |
from .bigbiohub import kb_features
|
23 |
from .bigbiohub import BigBioConfig
|
24 |
from .bigbiohub import Tasks
|
25 |
+
from .bigbiohub import parse_brat_file
|
26 |
+
from .bigbiohub import brat_parse_to_bigbio_kb
|
27 |
+
|
28 |
|
29 |
_DATASETNAME = "bionlp_st_2013_gro"
|
30 |
_DISPLAYNAME = "BioNLP 2013 GRO"
|
|
|
228 |
if self.config.schema == "source":
|
229 |
txt_files = list(data_files.glob("*txt"))
|
230 |
for guid, txt_file in enumerate(txt_files):
|
231 |
+
example = parse_brat_file(txt_file)
|
232 |
example["id"] = str(guid)
|
233 |
yield guid, example
|
234 |
elif self.config.schema == "bigbio_kb":
|
235 |
txt_files = list(data_files.glob("*txt"))
|
236 |
for guid, txt_file in enumerate(txt_files):
|
237 |
+
example = brat_parse_to_bigbio_kb(
|
238 |
+
parse_brat_file(txt_file)
|
239 |
)
|
240 |
example["id"] = str(guid)
|
241 |
yield guid, example
|