pos-tagger

How to extract nouns from dataframe

How to extract nouns from dataframe Question: I want to extract nouns from dataframe. Only nouns. I do as below import pandas as pd import nltk from nltk.tag import pos_tag from nltk import word_tokenize df = pd.DataFrame({‘noun’: [‘good day’, ‘good night’]}) I want to get noun 0 day 1 night My code df[‘noun’] = df.apply(lambda …

Total answers: 1

Python NLTK pos_tag not returning the correct part-of-speech tag

Python NLTK pos_tag not returning the correct part-of-speech tag Question: Having this: text = word_tokenize(“The quick brown fox jumps over the lazy dog”) And running: nltk.pos_tag(text) I get: [(‘The’, ‘DT’), (‘quick’, ‘NN’), (‘brown’, ‘NN’), (‘fox’, ‘NN’), (‘jumps’, ‘NNS’), (‘over’, ‘IN’), (‘the’, ‘DT’), (‘lazy’, ‘NN’), (‘dog’, ‘NN’)] This is incorrect. The tags for quick brown lazy …

Total answers: 3

What does NN VBD IN DT NNS RB means in NLTK?

What does NN VBD IN DT NNS RB means in NLTK? Question: when I chunk text, I get lots of codes in the output like NN, VBD, IN, DT, NNS, RB. Is there a list documented somewhere which tells me the meaning of these? I have tried googling nltk chunk code nltk chunk grammar nltk …

Total answers: 4