November 2019
Intermediate to advanced
304 pages
8h 40m
English
In step 1, we used loadStaticModel() to load the model from the given path; however, you can also use readWord2VecModel(). Unlike readWord2VecModel(), loadStaticModel() utilizes host memory.
In step 2, FileLabeledSentenceProvider is used as a data source to load the sentences/documents from the files. We created CnnSentenceDataSetIterator using the same. CnnSentenceDataSetIterator handles the conversion of sentences to training data for CNNs, where each word is encoded using the word vector from the specified word vector model. Sentences and labels are provided by a LabeledSentenceProvider interface. Different implementations of LabeledSentenceProvider provide different ways of loading the sentence/documents with labels.