Hi, I have added ner
model to existing model but having some issues. Here is how I added the ner
to existing model.
import spacy
nlp = spacy.load("ur_model")
# nlp.remove_pipe("ner")
print(nlp.pipe_names) # ['tagger', 'parser']
nlp_entity = spacy.load("ur_ner")
# Get the ner pipe from this model and add it to base model
nlp.add_pipe("ner", source=nlp_entity)
print(nlp.pipe_names) # ['tagger', 'parser', 'ner']
nlp.to_disk("./ur_ner")
Now when I use this model tagger and parser are showing empty string instead of tags.
import spacy
nlp = spacy.load("ur_ner")
for token in doc:
print(token.pos_, token.ent_type_, token.dep_)
Other
Other
Other
Location
Other
Other
Other
Other
Other
Other
Other
But my exising model used give tags on both tag_
and deps_
nlp = spacy.load("ur_model")
doc = nlp("پانچواں حصہ تحریک پاکستان کے نامور افراد کے ذکر پر مشتمل")
for token in doc:
print(token.pos_, token.ent_type_, token.dep_)
ADJ amod
NOUN nsubj
PROPN compound
PROPN nmod
ADP case
ADJ amod
NOUN nmod
ADP case
NOUN obl
ADP case
ADJ ROOT