Sample=cutstring (U) It is learnt that the car is nicknamed the Beast and the Beast is likely to be used in January 2017 when the 45th President of the United States took office. At present, the detailed specifications of the beast are classified information, but spy photos show the Beast adopted the Cadillac's latest grille and headlight design. ") tokenstr=nltk.word_tokenize (sample) FDIST3=NLTK. Freqdist (tokenstr) print "---the number of U.S. occurrences---" Print fdist3[u "us"]print "---sample total---" Print fdist3. N () print "---the largest number of samples---" Print fdist3.max () #频率分布表fdist3. tabulate () #频率分布图fdist3. Plot () #累积频率分布图fdist3. Plot (10, Cumulative=true)
This blog all content is original, if reprint please indicate source http://blog.csdn.net/myhaspl/
The Road to Mathematics (machine Learning Practice Guide)-Text mining with NLP (4)