word_counter python nltk code example
Example: word_counter python nltk
import nltkwith open ("input.txt", "r") as myfile: data=myfile.read().replace('\n', ' ')data = data.split(' ')fdist1 = nltk.FreqDist(data)print (fdist1.most_common(50))
import nltkwith open ("input.txt", "r") as myfile: data=myfile.read().replace('\n', ' ')data = data.split(' ')fdist1 = nltk.FreqDist(data)print (fdist1.most_common(50))