Created
June 1, 2017 22:37
-
-
Save brun0xff/26aee324c8f140b526145b6b0aef711a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
from nltk.tag import StanfordPOSTagger | |
from nltk.tokenize import word_tokenize | |
model = '/<PATH>/stanford-postagger-full-2016-10-31/models/english-bidirectional-distsim.tagger' | |
jar = '/<PATH>/stanford-postagger-full-2016-10-31/stanford-postagger.jar' | |
st = StanfordPOSTagger(model, jar) | |
postag = st.tag(word_tokenize('What is the airspeed of an unladen swallow ?')) | |
print postag |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nltk 3.2.4, postagger 2016-10-31