fix parse_brat_file import
#2
by
gabrielaltay
- opened
an_em.py
CHANGED
|
@@ -29,6 +29,8 @@ import datasets
|
|
| 29 |
from .bigbiohub import kb_features
|
| 30 |
from .bigbiohub import BigBioConfig
|
| 31 |
from .bigbiohub import Tasks
|
|
|
|
|
|
|
| 32 |
|
| 33 |
_LANGUAGES = ['English']
|
| 34 |
_PUBMED = True
|
|
@@ -205,7 +207,7 @@ class AnEMDataset(datasets.GeneratorBasedBuilder):
|
|
| 205 |
# Use brat text files and consider files in the provided split list
|
| 206 |
if (file.suffix != ".txt") or (file.stem not in split_list):
|
| 207 |
continue
|
| 208 |
-
brat_parsed =
|
| 209 |
source_example = self._brat_to_source(file, brat_parsed)
|
| 210 |
|
| 211 |
yield source_example["document_id"], source_example
|
|
@@ -216,7 +218,7 @@ class AnEMDataset(datasets.GeneratorBasedBuilder):
|
|
| 216 |
# Use brat text files and consider files in the provided split list
|
| 217 |
if (file.suffix != ".txt") or (file.stem not in split_list):
|
| 218 |
continue
|
| 219 |
-
brat_parsed =
|
| 220 |
bigbio_kb_example = parse.brat_parse_to_bigbio_kb(brat_parsed)
|
| 221 |
|
| 222 |
bigbio_kb_example["id"] = bigbio_kb_example["document_id"]
|
|
|
|
| 29 |
from .bigbiohub import kb_features
|
| 30 |
from .bigbiohub import BigBioConfig
|
| 31 |
from .bigbiohub import Tasks
|
| 32 |
+
from .bigbiohub import parse_brat_file
|
| 33 |
+
|
| 34 |
|
| 35 |
_LANGUAGES = ['English']
|
| 36 |
_PUBMED = True
|
|
|
|
| 207 |
# Use brat text files and consider files in the provided split list
|
| 208 |
if (file.suffix != ".txt") or (file.stem not in split_list):
|
| 209 |
continue
|
| 210 |
+
brat_parsed = parse_brat_file(file)
|
| 211 |
source_example = self._brat_to_source(file, brat_parsed)
|
| 212 |
|
| 213 |
yield source_example["document_id"], source_example
|
|
|
|
| 218 |
# Use brat text files and consider files in the provided split list
|
| 219 |
if (file.suffix != ".txt") or (file.stem not in split_list):
|
| 220 |
continue
|
| 221 |
+
brat_parsed = parse_brat_file(file)
|
| 222 |
bigbio_kb_example = parse.brat_parse_to_bigbio_kb(brat_parsed)
|
| 223 |
|
| 224 |
bigbio_kb_example["id"] = bigbio_kb_example["document_id"]
|