Coder Social home page Coder Social logo

kenhenry / tensorflow-seq2seq-chatbot Goto Github PK

View Code? Open in Web Editor NEW
53.0 53.0 11.0 10.36 MB

In this demo code, we implement Tensorflows Sequence to Sequence model to train a chatbot on the Cornell Movie Dialogue dataset.The dataset has been in the project. After training for a few hours, the bot is able to hold a fun conversation.

Python 99.84% Shell 0.16%

tensorflow-seq2seq-chatbot's People

Contributors

kenhenry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

tensorflow-seq2seq-chatbot's Issues

doubt in code analyses

what is exactly happening during testing after the user input get tokenized (i.e)what we get at encoder_input,decoder_input) and how the data get fetch based on given input.I am in need so please explain it briefly

longer time to train

During training the seq2seq chatbot ,why it take long time to train even if I give small amount of data .what is the purpose of test.enc and test.dec

When I change the mode to test meet a error message and my tensorflow version is 0.12.0 python version is 3.5.4

Here is the detial error message :
File "execute.py", line 218, in decode
enc_vocab, _ = data_utils.initialize_vocabulary(enc_vocab_path)
File "E:\tensorflow-seq2seq-chatbot-master\tensorflow-seq2seq-chatbot-master\data_utils.py", line 89, in initialize_vocabulary
rev_vocab.extend(f.readlines())
File "C:\Program Files\Python35\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 131, in readlines
s = self.readline()
File "C:\Program Files\Python35\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 124, in readline
return compat.as_str_any(self._read_buf.ReadLineAsString())
File "C:\Program Files\Python35\lib\site-packages\tensorflow\python\util\compat.py", line 106, in as_str_any
return as_str(value)
File "C:\Program Files\Python35\lib\site-packages\tensorflow\python\util\compat.py", line 84, in as_text
return bytes_or_text.decode(encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 in position 1: invalid start byte

Training Errors

Hi guys. I am new to tensorflow and just trying out couples of examples.
I am using Tensorflow 1.0.1 and python 2.7 w anaconda.

I think it's because of the function relocations, there are couples of issue happens, when I am running the train section.
.
.
.

ValueError: Shape must be rank 2 but is rank 1 for 'model_with_buckets/sequence_loss/sequence_loss_by_example/sampled_softmax_loss/LogUniformCandidateSampler' (op: 'LogUniformCandidateSampler') with input shapes: [?].

Not sure the should I change the input or what, anyone have some clues?

Thanks a lot.

===================================================
Update #1
Turn out I have sort this one out , but I encounter another one, seems something wrong with model_with_buckets()
Here I list all the change I made.

  1. In seq2seq2.py
    i) from tensorflow.models.rnn.translate import data_utils change -> import data_utils
    ii) nn.rnn_cell change -> contrib.rnn
    iii) nn.seq2seq change -> contrib.legacy_seq2seq
    iv) fixing ValueError , interchange "label" and "input"

In tf 0.12.0: Definition : tf.nn.sampled_softmax_loss(weights, biases, inputs, labels, num_sampled, num_classes, num_true=1, sampled_values=None, remove_accidental_hits=True, partition_strategy="mod", name="sampled_softmax_loss")

In tf 1.0: tf.nn.sampled_softmax_loss(weights, biases, labels, inputs, num_sampled, num_classes, num_true=1, sampled_values=None, remove_accidental_hits=True, partition_strategy='mod', name='sampled_softmax_loss')

  1. For missing train.enc error, check data/ exists or not

New Error:

File "/Users/ATC/Desktop/TensorFlow/6. Chatbot/seq2seq_model.py", line 149, in init
softmax_loss_function=softmax_loss_function)
TypeError: Input 'y' of 'Mul' Op has type float32 that does not match type int32 of argument 'x'.

is this seq2seq model handling issues like generic responses and inconsistent reply ?

Hi kenhenry,

thanks for sharing code. i have tried with ubuntu chat log. but i'm facing some common issues like generic responses issues and inconsistent reply.

is this model ( code shared by you ) handling some common issues related to seq2seq model on chatbot like replying generic responses (ex: 'Okay','No','Yes'..) and inconsistent replies for paraphrased contexts but with the same sense.
like
Q-where do you live now?
A-I live in Chicago.
Q-In which country do you live now?
A-Iceland, you?
...like this. inconsistent reply.

these are the most common issues in this model. are you handling this ? if not what's your thought how can we handle these issues?

definitely this is not issues related to code. just don't have other option to get answer for above questions from you.

Thanks,
muna

Number of global steps

Firstly thank you for the updated execute.py, I couldn't for the life of me get Suriya's script working but given Im very very new ubuntu, python and TF I though it was my fault, your git worked first time.

having said that this is probably such a stupid question but .... when does this stop (or how do I stop it cleanly)

I thought it might stop

"if counter % 100000 == 0:" but

global step 101000 learning rate 0.4432 step-time 0.63 perplexity 2.78
eval: bucket 0 perplexity 130.77
eval: bucket 1 perplexity 161.28
eval: bucket 2 perplexity 91.37
eval: bucket 3 perplexity 185.74

...... maybe don't worry about the cleanly ... turns out trying to copy from a putty window sends a keyboard interrupt.

:(

Thanks again for your work on this.

J

Training gets stuck

While running execute.py with mode=train, program gets stuck at reading data 18135. Anyone encountered the same issue? I have come across this issue on multiple codes of seq2seq models

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.