Commit ·
c2d7dc4
1
Parent(s): 5c08365
fix parsing imports
Browse files- cellfinder.py +6 -3
cellfinder.py
CHANGED
|
@@ -31,6 +31,9 @@ import datasets
|
|
| 31 |
from .bigbiohub import kb_features
|
| 32 |
from .bigbiohub import BigBioConfig
|
| 33 |
from .bigbiohub import Tasks
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
_LANGUAGES = ['English']
|
| 36 |
_PUBMED = True
|
|
@@ -216,7 +219,7 @@ class CellFinderDataset(datasets.GeneratorBasedBuilder):
|
|
| 216 |
continue
|
| 217 |
|
| 218 |
# Read brat annotations for the given text file and convert example to the source format
|
| 219 |
-
brat_example =
|
| 220 |
source_example = self._to_source_example(file, brat_example)
|
| 221 |
|
| 222 |
yield source_example["document_id"], source_example
|
|
@@ -232,8 +235,8 @@ class CellFinderDataset(datasets.GeneratorBasedBuilder):
|
|
| 232 |
continue
|
| 233 |
|
| 234 |
# Read brat annotations for the given text file and convert example to the BigBio-KB format
|
| 235 |
-
brat_example =
|
| 236 |
-
kb_example =
|
| 237 |
kb_example["id"] = kb_example["document_id"]
|
| 238 |
|
| 239 |
# Fix text type annotation for the converted example
|
|
|
|
| 31 |
from .bigbiohub import kb_features
|
| 32 |
from .bigbiohub import BigBioConfig
|
| 33 |
from .bigbiohub import Tasks
|
| 34 |
+
from .bigbiohub import parse_brat_file
|
| 35 |
+
from .bigbiohub import brat_parse_to_bigbio_kb
|
| 36 |
+
|
| 37 |
|
| 38 |
_LANGUAGES = ['English']
|
| 39 |
_PUBMED = True
|
|
|
|
| 219 |
continue
|
| 220 |
|
| 221 |
# Read brat annotations for the given text file and convert example to the source format
|
| 222 |
+
brat_example = parse_brat_file(file)
|
| 223 |
source_example = self._to_source_example(file, brat_example)
|
| 224 |
|
| 225 |
yield source_example["document_id"], source_example
|
|
|
|
| 235 |
continue
|
| 236 |
|
| 237 |
# Read brat annotations for the given text file and convert example to the BigBio-KB format
|
| 238 |
+
brat_example = parse_brat_file(file)
|
| 239 |
+
kb_example = brat_parse_to_bigbio_kb(brat_example)
|
| 240 |
kb_example["id"] = kb_example["document_id"]
|
| 241 |
|
| 242 |
# Fix text type annotation for the converted example
|