Created
October 24, 2012 11:19
-
-
Save language-engineering/3945534 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| from sussex_nltk import lemmatize_tagged, untag_sequence | |
| #Given your review object, you can get tagged words from it | |
| tagged_words = amazon_review.tagged_words() | |
| #Lemmatise the words (required tagged words) | |
| lemma_words = [lemmatize_tagged(tagged_word) for tagged_word in tagged_words] | |
| #Remove the PoS tags in order to use the lemmas as features | |
| features = untag_sequence(lemma_words) | |
| print features |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment