From 89f2b872661951e053594607dd3b7d1b57d1d402 Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Sun, 18 Aug 2019 13:55:34 +0200 Subject: [PATCH] Open file as utf-8 (closes #4138) --- spacy/cli/evaluate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacy/cli/evaluate.py b/spacy/cli/evaluate.py index 2c24d8a26..0a57ef2da 100644 --- a/spacy/cli/evaluate.py +++ b/spacy/cli/evaluate.py @@ -85,11 +85,11 @@ def render_parses(docs, output_path, model_name="", limit=250, deps=True, ents=T docs[0].user_data["title"] = model_name if ents: html = displacy.render(docs[:limit], style="ent", page=True) - with (output_path / "entities.html").open("w") as file_: + with (output_path / "entities.html").open("w", encoding="utf8") as file_: file_.write(html) if deps: html = displacy.render( docs[:limit], style="dep", page=True, options={"compact": True} ) - with (output_path / "parses.html").open("w") as file_: + with (output_path / "parses.html").open("w", encoding="utf8") as file_: file_.write(html)