You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`
import paddle
import jieba
import jieba.posseg as pseg
words = pseg.cut("我爱北京天安门") #jieba默认模式
paddle.enable_static()
jieba.enable_paddle() #启动paddle模式。 0.40版之后开始支持,早期版本不支持
words = pseg.cut("我爱北京天安门",use_paddle=True) #paddle模式
for word, flag in words:
print('%s %s' % (word, flag))
#import nltk
#nltk.download()
quit()
`
The text was updated successfully, but these errors were encountered:
jieba分词使用paddletiny,只支持Python3.7,python3.8直接安装paddlepaddle
在官方代码的基础上加上下面两行
import paddle
paddle.enable_static()
`
import paddle
import jieba
import jieba.posseg as pseg
words = pseg.cut("我爱北京天安门") #jieba默认模式
paddle.enable_static()
jieba.enable_paddle() #启动paddle模式。 0.40版之后开始支持,早期版本不支持
words = pseg.cut("我爱北京天安门",use_paddle=True) #paddle模式
for word, flag in words:
print('%s %s' % (word, flag))
#import nltk
#nltk.download()
quit()
`
The text was updated successfully, but these errors were encountered: