public class EntityEncoder extends Encoder
| Modifier and Type | Class and Description |
|---|---|
static class |
EntityEncoder.Strategy |
| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
log |
protected org.deeplearning4j.models.paragraphvectors.ParagraphVectors |
parvec |
protected EntityEncoder.Strategy |
strategy |
enableCacheid, model, modelAvailable, name, timer| Constructor and Description |
|---|
EntityEncoder(Resource paragraphVectors,
EntityEncoder.Strategy strategy) |
| Modifier and Type | Method and Description |
|---|---|
org.nd4j.linalg.api.ndarray.INDArray |
encode(Span span) |
org.nd4j.linalg.api.ndarray.INDArray |
encode(String word) |
void |
encodeEach(Document doc,
Annotation.Source source,
Class<? extends Annotation> type)
Encodes each annotation in the document and attaches the vector to it.
|
org.nd4j.linalg.api.ndarray.INDArray |
encodeEntity(ArticleRef ref) |
org.nd4j.linalg.api.ndarray.INDArray |
encodeEntity(WikiDataArticle art) |
org.nd4j.linalg.api.ndarray.INDArray |
encodeID(String id,
String fallback) |
org.nd4j.linalg.api.ndarray.INDArray |
encodeMention(String mention,
String context) |
long |
getEmbeddingVectorSize() |
void |
loadModel(Resource paragraphVectors) |
void |
saveModel(Resource dir,
String name) |
void |
trainModel(Collection<Document> documents) |
encode, encodeEach, encodeEach, encodeEach, encodeMatrix, isCachingEnabled, setCachingEnabled, trainModelappendTestLog, appendTestLog, appendTrainLog, appendTrainLog, clearTestLog, clearTrainLog, getConf, getId, getModel, getName, getTestLog, getTrainLog, isModelAvailable, isModelAvailableInChildren, setConf, setId, setModel, setModelAvailable, setModelFilename, setNameclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetEncoders, getId, getName, isModelAvailable, setEncodersprotected static final org.slf4j.Logger log
protected org.deeplearning4j.models.paragraphvectors.ParagraphVectors parvec
protected EntityEncoder.Strategy strategy
public EntityEncoder(Resource paragraphVectors, EntityEncoder.Strategy strategy) throws IOException
IOExceptionpublic void loadModel(Resource paragraphVectors) throws IOException
IOExceptionpublic long getEmbeddingVectorSize()
public org.nd4j.linalg.api.ndarray.INDArray encodeEntity(WikiDataArticle art)
public org.nd4j.linalg.api.ndarray.INDArray encodeEntity(ArticleRef ref)
public org.nd4j.linalg.api.ndarray.INDArray encodeMention(String mention, String context)
public org.nd4j.linalg.api.ndarray.INDArray encode(Span span)
public org.nd4j.linalg.api.ndarray.INDArray encode(String word)
public void encodeEach(Document doc, Annotation.Source source, Class<? extends Annotation> type)
public void trainModel(Collection<Document> documents)
trainModel in class EncoderCopyright © 2019. All rights reserved.