0

Hi I am trying to build a text summarizer, using sequence 2 sequence model in tensorflow.js.

My dataSet(example) :

{
Text: i want to return this product because it was broken when i received it.
Expected Output: broken Product.
}

I can convert text to word vectors using a pre-trained word2vec model. I am using these word embeddings for an LSTM network to get a sentiment value.

I could get some sense of sequence 2 sequence model theoretically, but i could not wrap my head around this idea interms of coding, how an encoder/decoder network looks like as a real code.

Can any please post a straight and a simple example of encoder and decoder network in tensorflow.js.

Or if there are any examples already posted some where that you know can you share them please.

Manoj
  • 983
  • 12
  • 23
  • The problem with encoder/decoder networks in tfjs is, that it's not that simple to get output of a layer which is inside the network. The only way I can think of is to get all the weights of the layers before and build a new model out of it. – Sebastian Speitel Oct 14 '18 at 08:48
  • I didn't get you can you explain a little bit more ? Thank you. – Manoj Oct 14 '18 at 12:45
  • Each tf.sequential in tfjs only has one output layer, so if you train your network on en-/decoding, the same network can't just encode, because the inner layer outputs aren't valid outputs. But maybe you can use the more flexible tf.model to create a network that has multiple outputs. – Sebastian Speitel Oct 14 '18 at 15:34
  • 1
    can you share a code example or some resource that i can look at please. – Manoj Oct 14 '18 at 19:50

0 Answers0