test_batch_flow()运行出错,具体报错信息如下,求大神指导。

来源:8-13 batch_flow_bucket(5)测试

JessicaEarth

2019-04-15

test_batch_flow()运行出错,具体报错信息如下,求大神指导。

C:\Users\ThinkPad\Anaconda3\envs\nlp\python.exe F:/Learning/MukeChatbot/chatbot/data_utils.py

Traceback (most recent call last):

  File "F:/Learning/MukeChatbot/chatbot/data_utils.py", line 193, in <module>

    test_batch_flow()

  File "F:/Learning/MukeChatbot/chatbot/data_utils.py", line 186, in test_batch_flow

    x,xl,y,yl=next(flow)

  File "F:/Learning/MukeChatbot/chatbot/data_utils.py", line 84, in batch_flow

    x,xl=transform_sentence(line,w,max_lens[j],add_end[j])

  File "F:/Learning/MukeChatbot/chatbot/data_utils.py", line 22, in transform_sentence

    encoded=ws.transform(

AttributeError: 'WordSequence' object has no attribute 'transform'


Process finished with exit code 1



写回答

1回答

Mr_Ricky

2019-04-29

你看下是不是transform这个函数名写错了

0
0

NLP实践TensorFlow打造聊天机器人

解析自然语言处理( NLP )常用技术,从0搭建聊天机器人应用并部署上线,可用于毕设。

673 学习 · 281 问题

查看课程