Sunday, February 10, 2019

Working of Seq2Seq model

First of all one thing I want to tell that this post is not about explaining code. If you want code implementation of chatbot using Seq2Seq Go Here.
So, seq2seq model basically introduced for machine translation. Before seq2seq word by word conversion to target language irrespective of checking grammar.
Seq2seq consider whole sentence as an input vector and convert it to target language which changes whole situation of language translation. It gives a very good BLEU score in translating English to French . Consider reading This Paper for more info about language translation using seq2seq

Working of Seq2seq :-

Working of seq2seq model is based on two LSTM based Rnn
Source@google.github.io/seq2seq/
On LSTM is used as encoder and  another LSTM is used as decoder .
Encoder LSTM is present at input side it accepts input sentence and convert it into a hidden vectors using Deep Neural Networks . Every vector represent
every word as well as context of that word with respect to sentence .

Decoder accept these hidden vectors as inputs and converts them to next hidden vectors and finally the target language

Mechanism used for conversion of language:-
Generally two types of mechanism is used in seq2seq model
1) Attention Based Mechanism:-
 In this type of mechanism only one input vector is provided to Decoder  LSTM.
This vector has store all the information about the context. So this mechanism fails in the case of long sequences
2 ) Beam Search:-
In this method the word which have the highest probability will be given as output. Generally this method does not provide most optimum solution .

Nowadays seq2seq model is used in various ways for eg:- chatbots, image captioning , text summarization

Working of Seq2Seq model

First of all one thing I want to tell that this post is not about explaining code. If you want code implementation of chatbot using Seq2Seq...