public class SectorEncoder extends Encoder
| Modifier and Type | Field and Description |
|---|---|
protected SectorTagger |
tagger |
id, log, model, modelAvailable, name, timer| Constructor and Description |
|---|
SectorEncoder() |
SectorEncoder(String id) |
SectorEncoder(String id,
SectorTagger sector) |
| 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(Collection<Document> docs,
Class<? extends Span> elementClass) |
void |
encodeEach(Document d,
Class<? extends Span> elementClass) |
void |
encodeEach(Sentence input,
Class<? extends Span> elementClass) |
org.nd4j.linalg.api.ndarray.INDArray |
encodeMatrix(List<Document> input,
int maxTimeSteps,
Class<? extends Span> timeStepClass)
Encodes each element in the input and attaches the vectors to the element.
|
int |
getBatchSize() |
int |
getEmbeddingLayerSize() |
long |
getEmbeddingVectorSize() |
String |
getName() |
int |
getNumEpochs() |
SectorTagger |
getTagger() |
boolean |
isMultiClass() |
boolean |
isRandomize() |
void |
loadModel(Resource file)
overrides and re-implementations for export of nested tagger to XML/JSON
|
void |
saveModel(Resource dir,
String name) |
void |
setBatchSize(int size) |
void |
setEmbeddingLayerSize(int size) |
void |
setMultiClass(boolean isMultiClass) |
void |
setName(String name) |
void |
setNumEpochs(int numEpochs) |
void |
setRandomize(boolean rand) |
void |
setTagger(SectorTagger tagger) |
void |
trainModel(Collection<Document> documents) |
encode, trainModelappendTestLog, appendTestLog, appendTrainLog, appendTrainLog, clearTestLog, clearTrainLog, getConf, getId, getModel, getTestLog, getTrainLog, isModelAvailable, isModelAvailableInChildren, setConf, setId, setModel, setModelAvailable, setModelFilenameclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetEncoders, getId, isModelAvailable, setEncodersprotected SectorTagger tagger
public SectorEncoder()
public SectorEncoder(String id)
public SectorEncoder(String id, SectorTagger sector)
public SectorTagger getTagger()
public void setTagger(SectorTagger tagger)
public long getEmbeddingVectorSize()
public org.nd4j.linalg.api.ndarray.INDArray encode(Span span)
public org.nd4j.linalg.api.ndarray.INDArray encode(String word)
public void encodeEach(Document d, Class<? extends Span> elementClass)
encodeEach in class Encoderpublic void encodeEach(Collection<Document> docs, Class<? extends Span> elementClass)
encodeEach in class Encoderpublic org.nd4j.linalg.api.ndarray.INDArray encodeMatrix(List<Document> input, int maxTimeSteps, Class<? extends Span> timeStepClass)
encodeMatrix in class Encoderinput - - the Document that should be encodedtimeStepClass - - the class of sub elements in the Document, e.g. Sentence.classpublic void encodeEach(Sentence input, Class<? extends Span> elementClass)
encodeEach in class Encoderpublic void trainModel(Collection<Document> documents)
trainModel in class Encoderpublic void loadModel(Resource file)
public String getName()
getName in interface IComponentgetName in class AnnotatorComponentpublic void setName(String name)
setName in class AnnotatorComponentpublic int getBatchSize()
public void setBatchSize(int size)
public int getEmbeddingLayerSize()
public void setEmbeddingLayerSize(int size)
public void setMultiClass(boolean isMultiClass)
public boolean isMultiClass()
public void setNumEpochs(int numEpochs)
public int getNumEpochs()
public void setRandomize(boolean rand)
public boolean isRandomize()
Copyright © 2019. All rights reserved.