Loading

Search POS (Part of Speech) using NLTK

% python
>>> import nltk
>>> nltk.pos_tag(["work"])
[('work', 'NN')]
Oh! its say work as NOUN!

Yeah, single verb can be use as noun. we need to pass the the whole sentence to check it

we have english sample like "he works for a company"
>>> nltk.pos_tag("he works for a company".split())
[('he', 'PRP'), ('works', 'VBZ'), ('for', 'IN'), ('a', 'DT'), ('company', 'NN')]

wow :-) its show "works" as VBZ, it is verb, great. huh!

so search, "work" in nltk results again. and can get very accurate POS :-)

work = VBZ for that case :-)

#but unfortunately its take time around 100ms to 1s, its slow for me, but no way. have to use that.

cheers,
soe min

No comments:

က်ေနာ္ဖတ္ေသာ အျခား ဘေလာ့ / ဆိုဒ္မ်ား