Class EmbeddingMatch

  • All Implemented Interfaces:

    
    public class EmbeddingMatch<Embedded>
    
                        

    Represents a matched embedding along with its relevance score (derivative of cosine distance), ID, and original embedded content.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      Double score() Returns the relevance score (derivative of cosine distance) of this embedding compared to a reference embedding during a search.
      String embeddingId() The ID of the embedding assigned when adding this embedding to the store.
      Embedding embedding() Returns the embedding that has been matched.
      Embedded embedded() Returns the original content that was embedded.
      boolean equals(Object o)
      int hashCode()
      String toString()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EmbeddingMatch

        EmbeddingMatch(Double score, String embeddingId, Embedding embedding, Embedded embedded)
        Creates a new instance.
        Parameters:
        score - The relevance score (derivative of cosine distance) of this embedding compared to a reference embedding during a search.
        embeddingId - The ID of the embedding assigned when adding this embedding to the store.
        embedding - The embedding that has been matched.
        embedded - The original content that was embedded.
    • Method Detail

      • score

         Double score()

        Returns the relevance score (derivative of cosine distance) of this embedding compared to a reference embedding during a search. The current implementation assumes that the embedding store uses cosine distance when comparing embeddings.

        Returns:

        Relevance score, ranging from 0 (not relevant) to 1 (highly relevant).

      • embeddingId

         String embeddingId()

        The ID of the embedding assigned when adding this embedding to the store.

        Returns:

        The ID of the embedding assigned when adding this embedding to the store.

      • embedding

         Embedding embedding()

        Returns the embedding that has been matched.

        Returns:

        The embedding that has been matched.