Class FlatModelUtils<T extends SequenceElement>
- java.lang.Object
-
- org.deeplearning4j.models.embeddings.reader.impl.BasicModelUtils<T>
-
- org.deeplearning4j.models.embeddings.reader.impl.FlatModelUtils<T>
-
- All Implemented Interfaces:
ModelUtils<T>
public class FlatModelUtils<T extends SequenceElement> extends BasicModelUtils<T>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.deeplearning4j.models.embeddings.reader.impl.BasicModelUtils
BasicModelUtils.ArrayComparator, BasicModelUtils.SimilarityComparator, BasicModelUtils.WordSimilarity
-
-
Field Summary
-
Fields inherited from class org.deeplearning4j.models.embeddings.reader.impl.BasicModelUtils
CORRECT, EXISTS, lookupTable, normalized, vocabCache, WRONG
-
-
Constructor Summary
Constructors Constructor Description FlatModelUtils()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<String>
wordsNearest(String label, int n)
This method does full scan against whole vocabulary, building descending list of similar wordsCollection<String>
wordsNearest(org.nd4j.linalg.api.ndarray.INDArray words, int top)
This method does full scan against whole vocabulary, building descending list of similar words-
Methods inherited from class org.deeplearning4j.models.embeddings.reader.impl.BasicModelUtils
accuracy, adjustRank, getLabels, init, similarity, similarWordsInVocabTo, wordsNearest, wordsNearestSum, wordsNearestSum, wordsNearestSum
-
-
-
-
Method Detail
-
wordsNearest
public Collection<String> wordsNearest(String label, int n)
This method does full scan against whole vocabulary, building descending list of similar words- Specified by:
wordsNearest
in interfaceModelUtils<T extends SequenceElement>
- Overrides:
wordsNearest
in classBasicModelUtils<T extends SequenceElement>
- Parameters:
label
-n
-- Returns:
-
wordsNearest
public Collection<String> wordsNearest(org.nd4j.linalg.api.ndarray.INDArray words, int top)
This method does full scan against whole vocabulary, building descending list of similar words- Specified by:
wordsNearest
in interfaceModelUtils<T extends SequenceElement>
- Overrides:
wordsNearest
in classBasicModelUtils<T extends SequenceElement>
- Parameters:
words
-top
-- Returns:
- the words nearest the mean of the words
-
-