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

相关推荐
Pandaconda1 分钟前
【Golang 面试题】每日 3 题(六十五)
开发语言·经验分享·笔记·后端·面试·golang·go
不太会写21 分钟前
基于Python+django+mysql旅游数据爬虫采集可视化分析推荐系统
python·推荐算法
呱牛do it35 分钟前
Python Matplotlib图形美化指南
开发语言·python·matplotlib
pianmian138 分钟前
python制图之小提琴图
开发语言·python·信息可视化
橙子小哥的代码世界40 分钟前
【机器学习】【KMeans聚类分析实战】用户分群聚类详解——SSE、CH 指数、SC全解析,实战电信客户分群案例
人工智能·python·机器学习·kmeans·数据科学·聚类算法·肘部法
计算机徐师兄41 分钟前
Python基于Flask的豆瓣Top250电影数据可视化分析与评分预测系统(附源码,技术说明)
python·flask·豆瓣top250电影数据可视化·豆瓣top250电影评分预测·豆瓣电影数据可视化分析系统·豆瓣电影评分预测系统·豆瓣电影数据
k layc1 小时前
【论文解读】《Training Large Language Models to Reason in a Continuous Latent Space》
人工智能·python·机器学习·语言模型·自然语言处理·大模型推理
阿正的梦工坊1 小时前
Sliding Window Attention(滑动窗口注意力)解析: Pytorch实现并结合全局注意力(Global Attention )
人工智能·pytorch·python
喜-喜1 小时前
Python pip 缓存清理:全面方法与操作指南
python·缓存·pip
rgb2gray1 小时前
GeoHD - 一种用于智慧城市热点探测的Python工具箱
人工智能·python·智慧城市