gabrielaltay
commited on
Commit
•
0c99155
1
Parent(s):
9c8b546
fix parsing imports
Browse files- bionlp_st_2011_rel.py +6 -3
bionlp_st_2011_rel.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_2011_rel"
|
26 |
_DISPLAYNAME = "BioNLP 2011 REL"
|
@@ -235,14 +238,14 @@ class bionlp_st_2011_rel(datasets.GeneratorBasedBuilder):
|
|
235 |
if self.config.schema == "source":
|
236 |
txt_files = list(data_files.glob("*txt"))
|
237 |
for guid, txt_file in enumerate(txt_files):
|
238 |
-
example =
|
239 |
example["id"] = str(guid)
|
240 |
yield guid, example
|
241 |
elif self.config.schema == "bigbio_kb":
|
242 |
txt_files = list(data_files.glob("*txt"))
|
243 |
for guid, txt_file in enumerate(txt_files):
|
244 |
-
example =
|
245 |
-
|
246 |
)
|
247 |
example["id"] = str(guid)
|
248 |
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_2011_rel"
|
29 |
_DISPLAYNAME = "BioNLP 2011 REL"
|
|
|
238 |
if self.config.schema == "source":
|
239 |
txt_files = list(data_files.glob("*txt"))
|
240 |
for guid, txt_file in enumerate(txt_files):
|
241 |
+
example = parse_brat_file(txt_file, self._FILE_SUFFIX)
|
242 |
example["id"] = str(guid)
|
243 |
yield guid, example
|
244 |
elif self.config.schema == "bigbio_kb":
|
245 |
txt_files = list(data_files.glob("*txt"))
|
246 |
for guid, txt_file in enumerate(txt_files):
|
247 |
+
example = brat_parse_to_bigbio_kb(
|
248 |
+
parse_brat_file(txt_file, self._FILE_SUFFIX)
|
249 |
)
|
250 |
example["id"] = str(guid)
|
251 |
yield guid, example
|