mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
add utf8 encoding for opening file
This commit is contained in:
parent
040c7c0541
commit
e972ecba72
|
@ -253,7 +253,7 @@ def _get_converter(msg, converter, input_path):
|
||||||
if converter == "auto":
|
if converter == "auto":
|
||||||
converter = input_path.suffix[1:]
|
converter = input_path.suffix[1:]
|
||||||
if converter == "ner" or converter == "iob":
|
if converter == "ner" or converter == "iob":
|
||||||
with input_path.open() as file_:
|
with input_path.open(encoding="utf8") as file_:
|
||||||
input_data = file_.read()
|
input_data = file_.read()
|
||||||
converter_autodetect = autodetect_ner_format(input_data)
|
converter_autodetect = autodetect_ner_format(input_data)
|
||||||
if converter_autodetect == "ner":
|
if converter_autodetect == "ner":
|
||||||
|
|
Loading…
Reference in New Issue
Block a user