From e44bbb53616e07ffcf855e7dea7bee9e3011d9da Mon Sep 17 00:00:00 2001 From: ines Date: Thu, 26 Oct 2017 16:12:41 +0200 Subject: [PATCH] Remove old example --- examples/training/load_ner.py | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 examples/training/load_ner.py diff --git a/examples/training/load_ner.py b/examples/training/load_ner.py deleted file mode 100644 index bf81cee50..000000000 --- a/examples/training/load_ner.py +++ /dev/null @@ -1,22 +0,0 @@ -# Load NER -from __future__ import unicode_literals -import spacy -import pathlib -from spacy.pipeline import EntityRecognizer -from spacy.vocab import Vocab - -def load_model(model_dir): - model_dir = pathlib.Path(model_dir) - nlp = spacy.load('en', parser=False, entity=False, add_vectors=False) - with (model_dir / 'vocab' / 'strings.json').open('r', encoding='utf8') as file_: - nlp.vocab.strings.load(file_) - nlp.vocab.load_lexemes(model_dir / 'vocab' / 'lexemes.bin') - ner = EntityRecognizer.load(model_dir, nlp.vocab, require=True) - return (nlp, ner) - -(nlp, ner) = load_model('ner') -doc = nlp.make_doc('Who is Shaka Khan?') -nlp.tagger(doc) -ner(doc) -for word in doc: - print(word.text, word.orth, word.lower, word.tag_, word.ent_type_, word.ent_iob)