4 Topics

Member Avatar for
Member Avatar for Remy the cook

I have been trying to find the frequency distribution of nouns in a given sentence. If I do this: text = "This ball is blue, small and extraordinary. Like no other ball." token_text= nltk.word_tokenize(text) tagged_sent = nltk.pos_tag(token_text) nouns= [] for word,pos in tagged_sent: if pos in ['NN',"NNP"]: nouns.append(word) freq_nouns=nltk.FreqDist(nouns) print …

Member Avatar for Remy the cook
0
1K
Member Avatar for Remy the cook

I have to append first 3 sentences of this sample text to a file(data.txt). So far I've done this: import nltk text="""First patented in 1876 by Alexander Graham Bell and further developed by many others, the telephone was the first device in history that enabled people to talk directly with …

Member Avatar for vegaseat
0
267
Member Avatar for amartin903

I've built a classifier after following an online tutorial. I take a bunch of tweets, use a HTML parser to get rid of unescaped syntax, remove everything shorter than 3 words and make a dictionary out of them. I then work out the frequency distribution of the words and so …

0
59
Member Avatar for rmbrown09

Hello, I am trying to generate word frequencies using ngrams. I have taken the brown corpus from nltk and changed it for use with ngram calculations by adding <s> and </s> at the beginning and end (in place of period.) I need to try and calculate the frequencies from this …

Member Avatar for rmbrown09
0
155

The End.