jieba 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.
1条答案
按热度按时间btxsgosb1#
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()