public class TreeModelUtils<T extends SequenceElement> extends BasicModelUtils<T>
BasicModelUtils.ArrayComparator, BasicModelUtils.SimilarityComparator, BasicModelUtils.WordSimilarity| Modifier and Type | Field and Description |
|---|---|
protected org.deeplearning4j.clustering.vptree.VPTree |
vpTree |
CORRECT, EXISTS, lookupTable, normalized, vocabCache, WRONG| Constructor and Description |
|---|
TreeModelUtils() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkTree() |
void |
init(WeightLookupTable<T> lookupTable)
This method implementations should accept given lookup table, and use them in further calls to interface methods
|
Collection<String> |
wordsNearest(Collection<String> positive,
Collection<String> negative,
int top)
Words nearest based on positive and negative words
|
Collection<String> |
wordsNearest(org.nd4j.linalg.api.ndarray.INDArray words,
int top)
Words nearest based on positive and negative words
* @param top the top n words
|
Collection<String> |
wordsNearest(String label,
int n)
This method returns nearest words for target word, based on tree structure.
|
accuracy, getLabels, similarity, similarWordsInVocabTo, wordsNearestSum, wordsNearestSum, wordsNearestSumpublic void init(@NonNull
WeightLookupTable<T> lookupTable)
ModelUtilsinit in interface ModelUtils<T extends SequenceElement>init in class BasicModelUtils<T extends SequenceElement>protected void checkTree()
public Collection<String> wordsNearest(String label, int n)
wordsNearest in interface ModelUtils<T extends SequenceElement>wordsNearest in class BasicModelUtils<T extends SequenceElement>label - label of element we're looking nearest words ton - number of nearest elements to returnpublic Collection<String> wordsNearest(Collection<String> positive, Collection<String> negative, int top)
ModelUtilswordsNearest in interface ModelUtils<T extends SequenceElement>wordsNearest in class BasicModelUtils<T extends SequenceElement>positive - the positive wordsnegative - the negative wordstop - the top n wordspublic Collection<String> wordsNearest(org.nd4j.linalg.api.ndarray.INDArray words, int top)
BasicModelUtilswordsNearest in interface ModelUtils<T extends SequenceElement>wordsNearest in class BasicModelUtils<T extends SequenceElement>Copyright © 2018. All rights reserved.