|
Java example source code file (ModelUtils.java)
The ModelUtils.java Java example source codepackage org.deeplearning4j.models.embeddings.reader; import org.deeplearning4j.models.embeddings.WeightLookupTable; import org.deeplearning4j.models.sequencevectors.sequence.SequenceElement; import org.deeplearning4j.models.word2vec.wordstore.VocabCache; import org.nd4j.linalg.api.ndarray.INDArray; import java.util.Collection; import java.util.List; import java.util.Map; /** * Instances implementing this interface should be responsible for utility access to SequenceVectors model * * @author raver119@gmail.com */ public interface ModelUtils<T extends SequenceElement> { /** * This method implementations should accept given lookup table, and use them in further calls to interface methods * * @param lookupTable */ void init(WeightLookupTable<T> lookupTable); /** * This method implementations should return distance between two given elements * * @param label1 * @param label2 * @return */ double similarity(String label1, String label2); /** * 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 * @param questions the questions to ask * @return the accuracy based on these questions */ Map<String,Double> accuracy(List Other Java examples (source code examples)Here is a short list of links related to this Java ModelUtils.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.