mirror of
https://github.com/explosion/spaCy.git
synced 2025-02-28 17:40:39 +03:00
caught another codecs.open
This commit is contained in:
parent
8199012d26
commit
764bdc62e7
|
@ -5,7 +5,7 @@ from __future__ import unicode_literals
|
||||||
import os
|
import os
|
||||||
from os import path
|
from os import path
|
||||||
import shutil
|
import shutil
|
||||||
import codecs
|
import io
|
||||||
import random
|
import random
|
||||||
|
|
||||||
import plac
|
import plac
|
||||||
|
@ -169,7 +169,7 @@ def write_parses(Language, dev_loc, model_dir, out_loc):
|
||||||
nlp = Language()
|
nlp = Language()
|
||||||
gold_tuples = read_docparse_file(dev_loc)
|
gold_tuples = read_docparse_file(dev_loc)
|
||||||
scorer = Scorer()
|
scorer = Scorer()
|
||||||
out_file = codecs.open(out_loc, 'w', 'utf8')
|
out_file = io.open(out_loc, 'w', encoding='utf8')
|
||||||
for raw_text, segmented_text, annot_tuples in gold_tuples:
|
for raw_text, segmented_text, annot_tuples in gold_tuples:
|
||||||
tokens = nlp(raw_text)
|
tokens = nlp(raw_text)
|
||||||
for t in tokens:
|
for t in tokens:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user