I'm trying to get the full tag from nltk pos_tag, but I can't find a simple way to do it using nltk. For example, using tagsets='universal'
.
from nltk.tokenize import word_tokenize
def nltk_pos(text):
token = word_tokenize(text)
return (nltk.pos_tag(token)[0])[1]
nltk_pos('home')
output: 'NN'
expected output: 'NOUN'
I had the same problem when doing NLP analysis for a paper I wrote. I had to use a mapping function like this: