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

相关推荐
未来可期叶2 小时前
如何用Python批量解压ZIP文件?快速解决方案
python
张槊哲2 小时前
ROS2架构介绍
python·架构
风逸hhh3 小时前
python打卡day29@浙大疏锦行
开发语言·前端·python
浩皓素3 小时前
深入理解For循环及相关关键字原理:以Python和C语言为例
c语言·python
英英_3 小时前
详细介绍一下Python连接MySQL数据库的完整步骤
数据库·python·mysql
水花花花花花4 小时前
GloVe 模型讲解与实战
python·深度学习·conda·pip
C_VuI4 小时前
如何安装cuda版本的pytorch
人工智能·pytorch·python
Star abuse4 小时前
机器学习基础课程-6-课程实验
人工智能·python·机器学习
不二一4 小时前
linux c++头文件生成源文件 使用python脚本 配置vim快捷键
linux·c++·python
RongSen334 小时前
Python海龟绘图(Turtle Graphics)核心函数和关键要点
开发语言·python