Commit ·
229c69b
1
Parent(s): e6785a1
fix bigbio imports
Browse files
mlee.py
CHANGED
|
@@ -26,6 +26,8 @@ import datasets
|
|
| 26 |
from .bigbiohub import kb_features
|
| 27 |
from .bigbiohub import BigBioConfig
|
| 28 |
from .bigbiohub import Tasks
|
|
|
|
|
|
|
| 29 |
|
| 30 |
_SOURCE_VIEW_NAME = "source"
|
| 31 |
_UNIFIED_VIEW_NAME = "bigbio"
|
|
@@ -263,14 +265,14 @@ class MLEE(datasets.GeneratorBasedBuilder):
|
|
| 263 |
if self.config.schema == "source":
|
| 264 |
txt_files = list(data_files.glob("*txt"))
|
| 265 |
for guid, txt_file in enumerate(txt_files):
|
| 266 |
-
example =
|
| 267 |
example["id"] = str(guid)
|
| 268 |
yield guid, example
|
| 269 |
elif self.config.schema == "bigbio_kb":
|
| 270 |
txt_files = list(data_files.glob("*txt"))
|
| 271 |
for guid, txt_file in enumerate(txt_files):
|
| 272 |
-
example =
|
| 273 |
-
|
| 274 |
)
|
| 275 |
example = self._standardize_arguments_roles(example)
|
| 276 |
example["id"] = str(guid)
|
|
|
|
| 26 |
from .bigbiohub import kb_features
|
| 27 |
from .bigbiohub import BigBioConfig
|
| 28 |
from .bigbiohub import Tasks
|
| 29 |
+
from .bigbiohub import parse_brat_file
|
| 30 |
+
from .bigbiohub import brat_parse_to_bigbio_kb
|
| 31 |
|
| 32 |
_SOURCE_VIEW_NAME = "source"
|
| 33 |
_UNIFIED_VIEW_NAME = "bigbio"
|
|
|
|
| 265 |
if self.config.schema == "source":
|
| 266 |
txt_files = list(data_files.glob("*txt"))
|
| 267 |
for guid, txt_file in enumerate(txt_files):
|
| 268 |
+
example = parse_brat_file(txt_file)
|
| 269 |
example["id"] = str(guid)
|
| 270 |
yield guid, example
|
| 271 |
elif self.config.schema == "bigbio_kb":
|
| 272 |
txt_files = list(data_files.glob("*txt"))
|
| 273 |
for guid, txt_file in enumerate(txt_files):
|
| 274 |
+
example = brat_parse_to_bigbio_kb(
|
| 275 |
+
parse_brat_file(txt_file)
|
| 276 |
)
|
| 277 |
example = self._standardize_arguments_roles(example)
|
| 278 |
example["id"] = str(guid)
|