Skip to content
Snippets Groups Projects
Commit 16465269 authored by Mateusz Klimaszewski's avatar Mateusz Klimaszewski
Browse files

Fix dataset reader.

parent 7e552166
Branches
Tags
2 merge requests!24Release 1.0.0b4.,!23Release 1.0.0b4.
...@@ -82,8 +82,8 @@ class UniversalDependenciesDatasetReader(allen_data.DatasetReader): ...@@ -82,8 +82,8 @@ class UniversalDependenciesDatasetReader(allen_data.DatasetReader):
for conllu_file in file_path: for conllu_file in file_path:
file = pathlib.Path(conllu_file) file = pathlib.Path(conllu_file)
assert conllu_file and file.exists(), f"File with path '{conllu_file}' does not exists!" assert conllu_file and file.exists(), f"File with path '{conllu_file}' does not exists!"
with file.open("r"): with file.open("r") as f:
for annotation in conllu.parse_incr(file, fields=self.fields, field_parsers=self.field_parsers): for annotation in conllu.parse_incr(f, fields=self.fields, field_parsers=self.field_parsers):
yield self.text_to_instance(annotation) yield self.text_to_instance(annotation)
@overrides @overrides
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment