Skip to content

Instantly share code, notes, and snippets.

@brun0xff
Created June 1, 2017 22:37
Show Gist options
  • Save brun0xff/26aee324c8f140b526145b6b0aef711a to your computer and use it in GitHub Desktop.
Save brun0xff/26aee324c8f140b526145b6b0aef711a to your computer and use it in GitHub Desktop.
#!/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
@brun0xff
Copy link
Author

brun0xff commented Jun 1, 2017

nltk 3.2.4, postagger 2016-10-31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment