Datasets:
Tasks:
Token Classification
Sub-tasks:
parsing
add encoding='utf-8'
Browse files
brat.py
CHANGED
@@ -235,7 +235,7 @@ class Brat(datasets.GeneratorBasedBuilder):
|
|
235 |
"notes": [],
|
236 |
}
|
237 |
|
238 |
-
with open(filename) as file:
|
239 |
for i, line in enumerate(file):
|
240 |
if len(line.strip()) == 0:
|
241 |
continue
|
@@ -299,7 +299,7 @@ class Brat(datasets.GeneratorBasedBuilder):
|
|
299 |
brat_annotations = Brat._read_annotation_file(ann_fn)
|
300 |
|
301 |
txt_fn = f"{filename}.{self.config.txt_file_extension}"
|
302 |
-
txt_content = open(txt_fn).read()
|
303 |
brat_annotations["context"] = txt_content
|
304 |
brat_annotations["file_name"] = basename
|
305 |
|
|
|
235 |
"notes": [],
|
236 |
}
|
237 |
|
238 |
+
with open(filename, encoding="utf-8") as file:
|
239 |
for i, line in enumerate(file):
|
240 |
if len(line.strip()) == 0:
|
241 |
continue
|
|
|
299 |
brat_annotations = Brat._read_annotation_file(ann_fn)
|
300 |
|
301 |
txt_fn = f"{filename}.{self.config.txt_file_extension}"
|
302 |
+
txt_content = open(txt_fn, encoding="utf-8").read()
|
303 |
brat_annotations["context"] = txt_content
|
304 |
brat_annotations["file_name"] = basename
|
305 |
|