Package ai.djl.modality.nlp
Class EmbeddingOutput
java.lang.Object
ai.djl.modality.nlp.EmbeddingOutput
A class represents text embedding output.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTokenWeights(String tokenId, float weights) Adds the token weights to the output.float[]Returns the dense embedding.Returns the token weights map.voidsetDenseEmbedding(float[] denseEmbedding) Sets the dense embedding.
-
Constructor Details
-
EmbeddingOutput
public EmbeddingOutput()
-
-
Method Details
-
getDenseEmbedding
public float[] getDenseEmbedding()Returns the dense embedding.- Returns:
- the dense embedding
-
setDenseEmbedding
public void setDenseEmbedding(float[] denseEmbedding) Sets the dense embedding.- Parameters:
denseEmbedding- the dense embedding
-
getLexicalWeights
Returns the token weights map.- Returns:
- the token weights map
-
addTokenWeights
Adds the token weights to the output.- Parameters:
tokenId- the token idweights- the token weights
-