mirror of https://github.com/explosion/spaCy.git
* Update train_pos_tagger example
This commit is contained in:
parent
a676d66807
commit
bf5a7cc598
|
@ -62,8 +62,10 @@ def main(output_dir):
|
||||||
tokens = tokenizer.tokens_from_list(words)
|
tokens = tokenizer.tokens_from_list(words)
|
||||||
tagger.train(tokens, tags)
|
tagger.train(tokens, tags)
|
||||||
random.shuffle(DATA)
|
random.shuffle(DATA)
|
||||||
tagger.model.end_training(path.join(output_dir, 'pos', 'model'))
|
tagger.model.end_training()
|
||||||
vocab.strings.dump(path.join(output_dir, 'vocab', 'strings.txt'))
|
tagger.model.dump(path.join(output_dir, 'pos', 'model'))
|
||||||
|
with io.open(output_dir, 'vocab', 'strings.json') as file_:
|
||||||
|
tagger.vocab.strings.dump(file_)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Reference in New Issue