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

相关推荐
夜阳朔1 分钟前
Conda环境激活失效问题
人工智能·后端·python
m0_7231402324 分钟前
Python训练营-Day49
开发语言·python
北风toto1 小时前
python学习DataFrame数据结构
数据结构·python·学习
亿牛云爬虫专家1 小时前
微服务化采集平台:可扩展性与容错机制
python·微服务·架构·爬虫代理·扩展性·新浪财经·财经新闻
傻啦嘿哟1 小时前
Python爬虫动态IP代理报错全解析:从问题定位到实战优化
爬虫·python·tcp/ip
mit6.8241 小时前
[Meetily后端框架] Whisper转录服务器 | 后端服务管理脚本
c++·人工智能·后端·python
zhangfeng11331 小时前
python 数据分析 单细胞测序数据分析 相关的图表,常见于肿瘤免疫微环境、细胞亚群功能研究 ,各图表类型及逻辑关系如下
开发语言·python·数据分析·医学
柠檬豆腐脑2 小时前
Trae-Agent 内置工具深度解析
python·llm·agent
ydl11282 小时前
机器学习基础知识【 激活函数、损失函数、优化器、 正则化、调度器、指标函数】
python·机器学习
chao_7893 小时前
CSS表达式——下篇【selenium】
css·python·selenium·算法