我是靠谱客的博主 动人黄豆,最近开发中收集的这篇文章主要介绍利用python进行词频统计_利用python做词频计算(word-count),觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

主要针对英文文本做出词频计算,因为英文是用空格作为词语分割的。中文需要用到分词的库。

下面就用奥巴马的一片演讲做词频计算

1,分析的文本

speech_etxt = '''

My fellow citizens: I stand here today humbled by the task before us, grateful for the trust you've bestowed, mindful of the sacrifices borne by our ancestors.

I thank President Bush for his service to our nation -- (applause) -- as well as the generosity and cooperation he has shown throughout this transition.

Forty-four Americans have now taken the presidential oath. The words have been spoken during rising tides of prosperity and the still waters of peace. Yet, every so often, the oath is taken amidst gathering clouds and raging storms. At these moments, America has carried on not simply because of the skill or vision of those in high office, but because we, the people, have remained faithful to the ideals of our forebears and true to our founding documents.

So it has

最后

以上就是动人黄豆为你收集整理的利用python进行词频统计_利用python做词频计算(word-count)的全部内容,希望文章能够帮你解决利用python进行词频统计_利用python做词频计算(word-count)所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(59)

评论列表共有 0 条评论

立即
投稿
返回
顶部