Class EmbeddingOutput

java.lang.Object
ai.djl.modality.nlp.EmbeddingOutput

public class EmbeddingOutput extends Object
A class represents text embedding output.
  • 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

      public Map<String,Float> getLexicalWeights()
      Returns the token weights map.
      Returns:
      the token weights map
    • addTokenWeights

      public void addTokenWeights(String tokenId, float weights)
      Adds the token weights to the output.
      Parameters:
      tokenId - the token id
      weights - the token weights