oswaldoludwig / Seq2seq-Chatbot-for-Keras

This repository contains a new generative model of chatbot based on seq2seq modeling.
Apache License 2.0
331 stars 98 forks source link

Getting AttributeError:int cannot find replace. #19

Closed Anoopparjanya closed 6 years ago

Anoopparjanya commented 6 years ago

@oswaldoludwig , split_qa I'm trying to execute split_qa.py.When i run the file,it is throwing me the above error. I'm not knowing where this raw_word is converting into int.Tried many combinations,but its not working. Could you please help me out in this scenario?

Please find the attached.

oswaldoludwig commented 6 years ago

You introduced an error when you modified the script in this line: with open(r'C:\Users\...

Anoopparjanya commented 6 years ago

How to load my data? When i give the file name in open('data','r'),it is throwing directory is not found error. When i give the file path(open('file path'),it is throwing syntax error? I'm in learning stage,do help me @oswaldoludwig.

oswaldoludwig commented 6 years ago

Just use text = open('C:\Users\...\data.txt', 'r').

Anoopparjanya commented 6 years ago

@oswaldoludwig issue When i use above line of code,it throwing me the below error. How to solve this?

Anoopparjanya commented 6 years ago

Thanks @oswaldoludwig It worked now!! But now im facing a new problem.

Using Theano backend. WARNING (theano.configdefaults): install mkl with conda install mkl-service: No module named 'mkl' WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions. Found 400000 word vectors.

Warning (from warnings module): File "C:\Users\Anoop\Documents\Seq2seq-Chatbot-for-Keras-master\train_bot.py", line 101 LSTM_encoder = LSTM(sentence_embedding_size, init= 'lecun_uniform') UserWarning: Update your LSTM call to the Keras 2 API: LSTM(300, kernel_initializer="lecun_uniform")

Warning (from warnings module): File "C:\Users\Anoop\Documents\Seq2seq-Chatbot-for-Keras-master\train_bot.py", line 102 LSTM_decoder = LSTM(sentence_embedding_size, init= 'lecun_uniform') UserWarning: Update your LSTM call to the Keras 2 API: LSTM(300, kernel_initializer="lecun_uniform") Traceback (most recent call last): File "C:\Users\Anoop\Documents\Seq2seq-Chatbot-for-Keras-master\train_bot.py", line 113, in merge_layer = merge([context_embedding, answer_embedding], mode='concat', concat_axis=1) TypeError: 'module' object is not callable

How to solve this? Why this is happening?

Thanks in Advance!!