본문 바로가기
Computer/NLP

nltk pos tagger

by hexists 2015. 6. 16.

 import nltk


tokenized_sentence = nltk.word_tokenize('I want to something to drink')

tagged_sentence = nltk.pos_tag(tokenized_sentence)


print tagged_sentence


[('I', 'PRP'), ('want', 'VBP'), ('to', 'TO'), ('something', 'NN'), ('to', 'TO'), ('drink', 'VB')]


이렇게 사용하면 간단히 사용 가능~