Package com.gengoai.hermes.ml
Class UniversalSentenceEncoder
- java.lang.Object
-
- com.gengoai.apollo.ml.model.TensorFlowModel
-
- com.gengoai.hermes.ml.UniversalSentenceEncoder
-
- All Implemented Interfaces:
Model
,Transform
,Copyable<Transform>
,SerializableFunction<HString,HString>
,ContextualizedEmbedding
,HStringMLModel
,Serializable
,Function<HString,HString>
public class UniversalSentenceEncoder extends TensorFlowModel implements HStringMLModel, ContextualizedEmbedding
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
DIMENSION
-
Fields inherited from class com.gengoai.apollo.ml.model.TensorFlowModel
inputs, modelFile, outputs, transformer
-
-
Constructor Summary
Constructors Constructor Description UniversalSentenceEncoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HString
apply(@NonNull HString hString)
protected Map<String,org.tensorflow.Tensor<?>>
createTensors(DataSet batch)
protected Observation
decodeNDArray(String name, NDArray ndArray)
Model
delegate()
Delegate model.HStringDataSetGenerator
getDataGenerator()
Gets data generator.LabelType
getLabelType(@NonNull String name)
String
getVersion()
Gets version.void
setVersion(String version)
Sets version.-
Methods inherited from class com.gengoai.apollo.ml.model.TensorFlowModel
calculate_max_sequence_length, createTransformer, estimate, getFitParameters, getInputs, getOutputs, load, processBatch, save, setEncoder, transform, transform
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.gengoai.hermes.ml.ContextualizedEmbedding
transform
-
Methods inherited from interface com.gengoai.hermes.ml.HStringMLModel
estimate, estimate, getEvaluator, getFitParameters, getInputs, getOutput, getOutputs, transform, transform, transform, transform
-
Methods inherited from interface com.gengoai.apollo.ml.model.Model
copy, fitAndTransform, getLabelType, save
-
Methods inherited from interface com.gengoai.function.SerializableFunction
andThen, asConsumer, compose
-
-
-
-
Field Detail
-
DIMENSION
public static final int DIMENSION
- See Also:
- Constant Field Values
-
-
Method Detail
-
createTensors
protected Map<String,org.tensorflow.Tensor<?>> createTensors(DataSet batch)
- Overrides:
createTensors
in classTensorFlowModel
-
decodeNDArray
protected Observation decodeNDArray(String name, NDArray ndArray)
- Specified by:
decodeNDArray
in classTensorFlowModel
-
delegate
public Model delegate()
Description copied from interface:HStringMLModel
Delegate model.- Specified by:
delegate
in interfaceHStringMLModel
- Returns:
- the model
-
getDataGenerator
public HStringDataSetGenerator getDataGenerator()
Description copied from interface:HStringMLModel
Gets data generator.- Specified by:
getDataGenerator
in interfaceHStringMLModel
- Returns:
- the data generator
-
getLabelType
public LabelType getLabelType(@NonNull @NonNull String name)
- Specified by:
getLabelType
in interfaceHStringMLModel
- Specified by:
getLabelType
in interfaceModel
-
getVersion
public String getVersion()
Description copied from interface:HStringMLModel
Gets version.- Specified by:
getVersion
in interfaceHStringMLModel
- Returns:
- the version
-
setVersion
public void setVersion(String version)
Description copied from interface:HStringMLModel
Sets version.- Specified by:
setVersion
in interfaceHStringMLModel
- Parameters:
version
- the version
-
-