gabrielaltay
commited on
Commit
•
ba68baa
1
Parent(s):
c9227e4
fix bigbio imports
Browse files- verspoor_2013.py +5 -3
verspoor_2013.py
CHANGED
@@ -35,6 +35,8 @@ import datasets
|
|
35 |
from .bigbiohub import kb_features
|
36 |
from .bigbiohub import BigBioConfig
|
37 |
from .bigbiohub import Tasks
|
|
|
|
|
38 |
|
39 |
_LANGUAGES = ['English']
|
40 |
_PUBMED = True
|
@@ -250,15 +252,15 @@ class Verspoor2013Dataset(datasets.GeneratorBasedBuilder):
|
|
250 |
if self.config.schema == "source":
|
251 |
txt_files = data_files["text_files"]
|
252 |
for guid, txt_file in enumerate(txt_files):
|
253 |
-
example =
|
254 |
example["id"] = str(guid)
|
255 |
yield guid, example
|
256 |
|
257 |
elif self.config.schema == "bigbio_kb":
|
258 |
txt_files = data_files["text_files"]
|
259 |
for guid, txt_file in enumerate(txt_files):
|
260 |
-
example =
|
261 |
-
|
262 |
)
|
263 |
example["id"] = str(guid)
|
264 |
yield guid, example
|
|
|
35 |
from .bigbiohub import kb_features
|
36 |
from .bigbiohub import BigBioConfig
|
37 |
from .bigbiohub import Tasks
|
38 |
+
from .bigbiohub import parse_brat_file
|
39 |
+
from .bigbiohub import brat_parse_to_bigbio_kb
|
40 |
|
41 |
_LANGUAGES = ['English']
|
42 |
_PUBMED = True
|
|
|
252 |
if self.config.schema == "source":
|
253 |
txt_files = data_files["text_files"]
|
254 |
for guid, txt_file in enumerate(txt_files):
|
255 |
+
example = parse_brat_file(txt_file)
|
256 |
example["id"] = str(guid)
|
257 |
yield guid, example
|
258 |
|
259 |
elif self.config.schema == "bigbio_kb":
|
260 |
txt_files = data_files["text_files"]
|
261 |
for guid, txt_file in enumerate(txt_files):
|
262 |
+
example = brat_parse_to_bigbio_kb(
|
263 |
+
parse_brat_file(txt_file)
|
264 |
)
|
265 |
example["id"] = str(guid)
|
266 |
yield guid, example
|