-1

I'd like to train a model which maps a sentence to a label (e.g. "Canon EOS 77D DSLR Camera" maps to a label "Digital Camera").

I understand that strings need to be converted to a vector first. I found an example of word2vec which does this.

I then found a separate example on how to build a convolution network.

That said, I don't understand how to put it all together. Given:

  1. A text file containing: sentence,label
  2. A word2vec trained against all sentences, labels

How do I parse the text file into vectors (taken from word2vec) and pass it into a convolution network for training?

Gili
  • 86,244
  • 97
  • 390
  • 689

1 Answers1

0

Answering my own question:

  1. Convert sentences, labels to vectors using Word2Vec: [example]
  2. Use CnnSentenceDataSetIterator to feed training/test data into a convolution network using the aforementioned Word2Vec: [example]

There is also an example using ParagraphVectorsClassifier that does this without a convolution network.

Gili
  • 86,244
  • 97
  • 390
  • 689