Created
June 29, 2018 19:02
-
-
Save himlohiya/7babed0c3a662f180818fbd5b6a0b073 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
| pos_tagging_spacy(sentence) { | |
| sentence_nlp = nlp(sentence) | |
| # POS tagging with Spacy | |
| spacy_pos_tagged = [(word, word.tag_, word.pos_) for word in sentence_nlp] | |
| pd.DataFrame(spacy_pos_tagged, columns=['Word', 'POS tag', 'Tag type']) | |
| } | |
| pos_tagging_nltk(sentence) { | |
| # POS tagging with nltk | |
| nltk_pos_tagged = nltk.pos_tag(sentence.split()) | |
| pd.DataFrame(nltk_pos_tagged, columns=['Word', 'POS tag']) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment