美丽心灵公益论坛's Archiver
论坛
›
电脑技术
› Python查找频率高的词
willsonlincake
发表于 2022-5-11 21:27:05
Python查找频率高的词
import nltk
text1 = 'hello he heloo hello hi '
text1 = text1.split(' ')
fdist1 = nltk.FreqDist(text1)
#Get 50 Most Common Words
print (fdist1.most_common(50))
页:
[1]
查看完整版本:
Python查找频率高的词