* Fix language.py for change in StringStore load API

This commit is contained in:
Matthew Honnibal 2015-10-23 03:48:12 +11:00
parent 23855db3ca
commit f18fd8c659

View File

@ -1,5 +1,6 @@
from os import path
from warnings import warn
import io
try:
import ujson as json
@ -248,8 +249,8 @@ class Language(object):
self.entity.model.end_training(path.join(data_dir, 'ner', 'model'))
self.tagger.model.end_training(path.join(data_dir, 'pos', 'model'))
strings_loc = path.join(data_dir, 'vocab', 'strings.txt')
with io.open(strings_loc, 'w', encoding='utf8'):
strings_loc = path.join(data_dir, 'vocab', 'strings.json')
with io.open(strings_loc, 'w', encoding='utf8') as file_:
self.vocab.strings.dump(file_)
with open(path.join(data_dir, 'vocab', 'serializer.json'), 'w') as file_: