public class ClassEncoder extends LookupCacheEncoder
| Modifier and Type | Field and Description |
|---|---|
static String |
ID |
totalWords, vocabid, log, model, modelAvailable, name, timer| Constructor and Description |
|---|
ClassEncoder() |
ClassEncoder(String id) |
| Modifier and Type | Method and Description |
|---|---|
org.nd4j.linalg.api.ndarray.INDArray |
encode(Span classLabel) |
org.nd4j.linalg.api.ndarray.INDArray |
encode(String classLabel) |
long |
getEmbeddingVectorSize() |
int |
getIndex(String word) |
String |
getName() |
String |
getNearestNeighbour(org.nd4j.linalg.api.ndarray.INDArray v) |
Collection<Map.Entry<String,Double>> |
getNearestNeighbourEntries(org.nd4j.linalg.api.ndarray.INDArray v,
int k) |
Collection<String> |
getNearestNeighbours(org.nd4j.linalg.api.ndarray.INDArray v,
int k) |
boolean |
isUnknown(String classLabel) |
org.nd4j.linalg.api.ndarray.INDArray |
oneHot(String word) |
void |
trainModel(Collection<Document> documents) |
void |
trainModel(Iterable<String> classes,
int minClassFrequency) |
void |
trainModelUsingHead(Iterable<String> classes) |
getConfidence, getFrequency, getMaxConfidence, getNearestNeighbours, getProbability, getTotalWords, getWord, getWords, loadModel, saveModel, setTotalWordsencode, encodeEach, encodeEach, encodeEach, encodeMatrix, trainModelappendTestLog, appendTestLog, appendTrainLog, appendTrainLog, clearTestLog, clearTrainLog, getConf, getId, getModel, getTestLog, getTrainLog, isModelAvailable, isModelAvailableInChildren, setConf, setId, setModel, setModelAvailable, setModelFilename, setNameclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetEncoders, getId, isModelAvailable, setEncoderspublic static final String ID
public ClassEncoder()
public ClassEncoder(String id)
public String getName()
getName in interface IComponentgetName in class AnnotatorComponentpublic org.nd4j.linalg.api.ndarray.INDArray encode(Span classLabel)
public long getEmbeddingVectorSize()
getEmbeddingVectorSize in interface IEncodergetEmbeddingVectorSize in class LookupCacheEncoderpublic org.nd4j.linalg.api.ndarray.INDArray encode(String classLabel)
public int getIndex(String word)
getIndex in class LookupCacheEncoderpublic org.nd4j.linalg.api.ndarray.INDArray oneHot(String word)
oneHot in class LookupCacheEncoderpublic boolean isUnknown(String classLabel)
isUnknown in class LookupCacheEncoderpublic void trainModel(Collection<Document> documents)
trainModel in class Encoderpublic String getNearestNeighbour(org.nd4j.linalg.api.ndarray.INDArray v)
getNearestNeighbour in class LookupCacheEncoderpublic Collection<String> getNearestNeighbours(org.nd4j.linalg.api.ndarray.INDArray v, int k)
getNearestNeighbours in class LookupCacheEncoderpublic Collection<Map.Entry<String,Double>> getNearestNeighbourEntries(org.nd4j.linalg.api.ndarray.INDArray v, int k)
Copyright © 2019. All rights reserved.