Last active
November 30, 2019 08:28
-
-
Save nikkisharma536/8c675c8e0677854f73ea5c05c3b48820 to your computer and use it in GitHub Desktop.
create or load model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if model is not None: | |
nlp = spacy.load(model) # load existing spaCy model | |
print("Loaded model '%s'" % model) | |
else: | |
nlp = spacy.blank("en") # create blank Language class | |
print("Created blank 'en' model") | |
if 'ner' not in nlp.pipe_names : | |
ner = nlp.create_pipe('ner') | |
nlp.add_pipe(ner, last=True) | |
else : | |
ner = nlp.get_pipe("ner") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment