我是靠谱客的博主 平常咖啡,这篇文章主要介绍jieba库的安装,现在分享给大家,希望可以做个参考。

1.利用国内镜像网站下载:
首先打开cmd窗口输入如下命令:

pip install jieba -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

2.测试使用

import jieba
>>> jieba.lcut("中国是个伟大的国家")
Building prefix dict from the default dictionary ...
Dumping model to file cache C:Users17185AppDataLocalTempjieba.cache
Loading model cost 0.920 seconds.
Prefix dict has been built successfully.
['中国', '是', '个', '伟大', '的', '国家']

3.jieba.add-word(“蟒蛇语言”),向词库中添加新词

最后

以上就是平常咖啡最近收集整理的关于jieba库的安装的全部内容,更多相关jieba库内容请搜索靠谱客的其他文章。

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

评论列表共有 0 条评论

立即
投稿
返回
顶部