We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
终于成功运行起来了,以下是我在 Windows 成功设置的步骤:
Install Python 3.7 and below
https://www.python.org/downloads/release/python-379/
$env:PATH = $env:USERPROFILE + '\AppData\Local\Programs\Python\Python37;' + $env:PATH $env:PATH = $env:USERPROFILE + '\AppData\Local\Programs\Python\Python37\Scripts;' + $env:PATH
Install Jieba and dependent packages
pip install jieba paddlepaddle-tiny protobuf==3.20.0
Run Jieba
jieba-demo.py:
jieba-demo.py
# encoding=utf-8 import jieba jieba.enable_paddle()# 启动paddle模式。 0.40版之后开始支持,早期版本不支持 strs=["我来到北京清华大学","乒乓球拍卖完了","中国科学技术大学"] for str in strs: seg_list = jieba.cut(str,use_paddle=True) # 使用paddle模式 print("Paddle Mode: " + '/'.join(list(seg_list))) seg_list = jieba.cut("我来到北京清华大学", cut_all=True) print("Full Mode: " + "/ ".join(seg_list)) # 全模式 seg_list = jieba.cut("我来到北京清华大学", cut_all=False) print("Default Mode: " + "/ ".join(seg_list)) # 精确模式 seg_list = jieba.cut("他来到了网易杭研大厦") # 默认是精确模式 print(", ".join(seg_list)) seg_list = jieba.cut_for_search("小明硕士毕业于中国科学院计算所,后在日本京都大学深造") # 搜索引擎模式 print(", ".join(seg_list))
python .\jieba-demo.py
The text was updated successfully, but these errors were encountered:
No branches or pull requests
终于成功运行起来了,以下是我在 Windows 成功设置的步骤:
Install Python 3.7 and below
https://www.python.org/downloads/release/python-379/
Install Jieba and dependent packages
Run Jieba
jieba-demo.py
:python .\jieba-demo.py
The text was updated successfully, but these errors were encountered: