i'm looking for something specific and didn't really found an answer: I'm looking to rename the pos tags label of spacy. E.g. if i have this code:
def eng(textstr):
nlp = spacy.load("en_core_web_sm")
doc = nlp(textstr)
for token in doc:
print("Word: "+token.text+ " "+"POS: "+token.pos_)
I want token.pos_ to give me NIA instead of NOUN, BO instead of VERB, etc... I don't want to retrain anything if i can. The results given by the pos tagger are accurate enough for me, i just want to rename each label (Noun to NIA, Verb to BO, etcc..). So instead of having a NOUN i want token.pos_ to give me back NIA. First is this possible and if it is, how can i do it? The first thing that came me to mind is to use simply an if statement:
if token.pos_ == "NOUN"
print("Word: "+token.text+ " "+"POS: NIA")
but that cannot be done because than i have to change about 5000 functions, which is impossible. Is there another way? Thank you very much for your help!