Datasets:

Modalities:
Text
Languages:
English
Libraries:
Datasets
License:
albertvillanova HF Staff commited on
Commit
2ee733d
·
verified ·
1 Parent(s): e0421fe

Support streaming in parse_brat_file

Browse files
Files changed (1) hide show
  1. bionlp_st_2019_bb.py +3 -1
bionlp_st_2019_bb.py CHANGED
@@ -414,9 +414,11 @@ class bionlp_st_2019_bb(datasets.GeneratorBasedBuilder):
414
  ann_lines = []
415
  for suffix in annotation_file_suffixes:
416
  annotation_file = txt_file.with_suffix(suffix)
417
- if annotation_file.exists():
418
  with annotation_file.open(encoding="utf8") as f:
419
  ann_lines.extend(f.readlines())
 
 
420
 
421
  example["text_bound_annotations"] = []
422
  example["events"] = []
 
414
  ann_lines = []
415
  for suffix in annotation_file_suffixes:
416
  annotation_file = txt_file.with_suffix(suffix)
417
+ try:
418
  with annotation_file.open(encoding="utf8") as f:
419
  ann_lines.extend(f.readlines())
420
+ except Exception:
421
+ continue
422
 
423
  example["text_bound_annotations"] = []
424
  example["events"] = []