NLP:结巴分词的使用

python包的安装:

pip3 install jieba

出错:AttributeError: module ‘jieba’ has no attribute ‘cut’

是因为你把你写的python命名为jieba.py了,不可以!!!python代码文件换个名字就可以啦!

代码:(分词的结果类型是generator)

在这里插入图片描述

     a=jieba.cut(b)
      print("Default Mode:", "/ ".join(a))

猜你喜欢

转载自blog.csdn.net/weixin_42721412/article/details/106106304