jieba icon indicating copy to clipboard operation
jieba copied to clipboard

AssertionError: In PaddlePaddle 2.x, we turn on dynamic graph mode by default, and 'data()' is only supported in static graph mode. So if you want to use this api, please call 'paddle.enable_static()' before this api to enter static graph mode.

Open DachuanZhao opened this issue 3 years ago • 1 comments

pip install jieba -U
pip install paddlepaddle -U
import jieba
jieba.enable_paddle()

目前jieba和lac不兼容,需要修改。 相关issue : https://github.com/fxsjy/jieba/issues/901

DachuanZhao avatar Apr 22 '21 08:04 DachuanZhao

def paddle(self): paddle.enable_static() jieba.enable_paddle() seg_list = jieba.cut("我来到北京清华大学", cut_all=False) print("Default Mode: " + "/ ".join(seg_list)) # 精确模式

加入:就可以了。 paddle.enable_static()

sinhang avatar Mar 19 '22 07:03 sinhang