public interface ModelUtils<T extends SequenceElement>
| Modifier and Type | Method and Description |
|---|---|
Map<String,Double> |
accuracy(List<String> questions)
Accuracy based on questions which are a space separated list of strings
where the first word is the query word, the next 2 words are negative,
and the last word is the predicted word to be nearest
|
void |
init(WeightLookupTable<T> lookupTable)
This method implementations should accept given lookup table, and use them in further calls to interface methods
|
double |
similarity(String label1,
String label2)
This method implementations should return distance between two given elements
|
List<String> |
similarWordsInVocabTo(String word,
double accuracy)
Find all words with a similar characters
in the vocab
|
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 implementations should return N nearest elements labels to given element's label
|
Collection<String> |
wordsNearestSum(Collection<String> positive,
Collection<String> negative,
int top) |
Collection<String> |
wordsNearestSum(org.nd4j.linalg.api.ndarray.INDArray words,
int top) |
Collection<String> |
wordsNearestSum(String word,
int n) |
void init(WeightLookupTable<T> lookupTable)
lookupTable - double similarity(String label1, String label2)
label1 - label2 - Map<String,Double> accuracy(List<String> questions)
questions - the questions to askList<String> similarWordsInVocabTo(String word, double accuracy)
word - the word to compareaccuracy - the accuracy: 0 to 1Collection<String> wordsNearest(String label, int n)
label - label to return nearest elements forn - number of nearest words to returnCollection<String> wordsNearest(Collection<String> positive, Collection<String> negative, int top)
positive - the positive wordsnegative - the negative wordstop - the top n wordsCollection<String> wordsNearest(org.nd4j.linalg.api.ndarray.INDArray words, int top)
Collection<String> wordsNearestSum(String word, int n)
Collection<String> wordsNearestSum(org.nd4j.linalg.api.ndarray.INDArray words, int top)
Collection<String> wordsNearestSum(Collection<String> positive, Collection<String> negative, int top)
Copyright © 2022. All rights reserved.