AttributeError: module ‘hanlp.utils.rules‘ has no attribute ‘tokenize_english‘

附原文链接:http://t.csdnimg.cn/wVLib

  1. import hanlp

  2. tokenizer = hanlp.utils.rules.tokenize_english

  3. tokenizer('Mr. Hankcs bought hankcs.com for 1.5 thousand dollars.')

  4. 改为:

  5. from hanlp.utils.lang.en.english_tokenizer import tokenize_english

    tokenizer = tokenize_english

    tokenizer('Mr. Hankcs bought hankcs.com for 1.5 thousand dollars.')

Python 版本为 3.8.10

相关推荐
Envyᥫᩣ14 分钟前
Python中的自然语言处理:从基础到高级
python·自然语言处理·easyui
哪 吒15 分钟前
华为OD机试 - 几何平均值最大子数(Python/JS/C/C++ 2024 E卷 200分)
javascript·python·华为od
我是陈泽18 分钟前
一行 Python 代码能实现什么丧心病狂的功能?圣诞树源代码
开发语言·python·程序员·编程·python教程·python学习·python教学
hakesashou18 分钟前
python全栈开发是什么?
python
创作小达人37 分钟前
家政服务|基于springBoot的家政服务平台设计与实现(附项目源码+论文+数据库)
开发语言·python
ZPC82101 小时前
Python使用matplotlib绘制图形大全(曲线图、条形图、饼图等)
开发语言·python·matplotlib
镜花照无眠1 小时前
Python爬虫使用实例-mdrama
开发语言·爬虫·python
aaasssdddd961 小时前
python和c
c语言·开发语言·python
爱写代码的小朋友1 小时前
Python的几个高级特性
python
Eric.Lee20211 小时前
数据集-目标检测系列- 螃蟹 检测数据集 crab >> DataBall
python·深度学习·算法·目标检测·计算机视觉·数据集·螃蟹检测