Commit
·
2e28435
1
Parent(s):
531566b
fix bigbio imports
Browse files- meddocan.py +5 -3
meddocan.py
CHANGED
|
@@ -30,6 +30,8 @@ import datasets
|
|
| 30 |
from .bigbiohub import kb_features
|
| 31 |
from .bigbiohub import BigBioConfig
|
| 32 |
from .bigbiohub import Tasks
|
|
|
|
|
|
|
| 33 |
|
| 34 |
_LANGUAGES = ['Spanish']
|
| 35 |
_PUBMED = False
|
|
@@ -232,15 +234,15 @@ class MeddocanDataset(datasets.GeneratorBasedBuilder):
|
|
| 232 |
|
| 233 |
if self.config.schema == "source":
|
| 234 |
for guid, txt_file in enumerate(txt_files):
|
| 235 |
-
example =
|
| 236 |
|
| 237 |
example["id"] = str(guid)
|
| 238 |
yield guid, example
|
| 239 |
|
| 240 |
elif self.config.schema == "bigbio_kb":
|
| 241 |
for guid, txt_file in enumerate(txt_files):
|
| 242 |
-
example =
|
| 243 |
-
|
| 244 |
)
|
| 245 |
example["id"] = str(guid)
|
| 246 |
yield guid, example
|
|
|
|
| 30 |
from .bigbiohub import kb_features
|
| 31 |
from .bigbiohub import BigBioConfig
|
| 32 |
from .bigbiohub import Tasks
|
| 33 |
+
from .bigbiohub import parse_brat_file
|
| 34 |
+
from .bigbiohub import brat_parse_to_bigbio_kb
|
| 35 |
|
| 36 |
_LANGUAGES = ['Spanish']
|
| 37 |
_PUBMED = False
|
|
|
|
| 234 |
|
| 235 |
if self.config.schema == "source":
|
| 236 |
for guid, txt_file in enumerate(txt_files):
|
| 237 |
+
example = parse_brat_file(txt_file)
|
| 238 |
|
| 239 |
example["id"] = str(guid)
|
| 240 |
yield guid, example
|
| 241 |
|
| 242 |
elif self.config.schema == "bigbio_kb":
|
| 243 |
for guid, txt_file in enumerate(txt_files):
|
| 244 |
+
example = brat_parse_to_bigbio_kb(
|
| 245 |
+
parse_brat_file(txt_file)
|
| 246 |
)
|
| 247 |
example["id"] = str(guid)
|
| 248 |
yield guid, example
|