Search in sources :

Example 1 with WordVectorsImpl

use of org.deeplearning4j.models.embeddings.wordvectors.WordVectorsImpl in project deeplearning4j by deeplearning4j.

the class WordVectorSerializer method fromTableAndVocab.

/**
     * Load word vectors for the given vocab and table
     *
     * @param table
     *            the weights to use
     * @param vocab
     *            the vocab to use
     * @return wordvectors based on the given parameters
     */
public static WordVectors fromTableAndVocab(WeightLookupTable table, VocabCache vocab) {
    WordVectorsImpl vectors = new WordVectorsImpl();
    vectors.setLookupTable(table);
    vectors.setVocab(vocab);
    vectors.setModelUtils(new BasicModelUtils());
    return vectors;
}
Also used : BasicModelUtils(org.deeplearning4j.models.embeddings.reader.impl.BasicModelUtils) WordVectorsImpl(org.deeplearning4j.models.embeddings.wordvectors.WordVectorsImpl)

Aggregations

BasicModelUtils (org.deeplearning4j.models.embeddings.reader.impl.BasicModelUtils)1 WordVectorsImpl (org.deeplearning4j.models.embeddings.wordvectors.WordVectorsImpl)1