Record Class EmbeddingBenchModel
java.lang.Object
java.lang.Record
com.tnsai.evaluation.rag.embedding.EmbeddingBenchModel
- Record Components:
name- table labelnativeDimensions- native vector length before any truncatereportedDimensions- dimensions actually stored and searchedbytesPerDoc-reportedDimensions * Float.BYTESqueryEmbedder- embeds queriesdocumentEmbedder- embeds passages
public record EmbeddingBenchModel(String name, int nativeDimensions, int reportedDimensions, int bytesPerDoc, com.tnsai.memory.advanced.EmbeddingFunction queryEmbedder, com.tnsai.memory.advanced.EmbeddingFunction documentEmbedder)
extends Record
Named embedder under comparison.
- Since:
- 0.14.0
-
Constructor Summary
ConstructorsConstructorDescriptionEmbeddingBenchModel(String name, int nativeDimensions, int reportedDimensions, int bytesPerDoc, com.tnsai.memory.advanced.EmbeddingFunction queryEmbedder, com.tnsai.memory.advanced.EmbeddingFunction documentEmbedder) Creates an instance of aEmbeddingBenchModelrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thebytesPerDocrecord component.com.tnsai.memory.advanced.EmbeddingFunctionReturns the value of thedocumentEmbedderrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.intReturns the value of thenativeDimensionsrecord component.static EmbeddingBenchModelof(String name, int nativeDimensions, int reportedDimensions, com.tnsai.memory.advanced.EmbeddingFunction queryEmbedder, com.tnsai.memory.advanced.EmbeddingFunction documentEmbedder) static EmbeddingBenchModelstatic EmbeddingBenchModelollama(String name, int nativeDimensions, OllamaEmbeddingFunction client) Wraps an Ollama model so queries use the query prefix and passages use the document prefix.com.tnsai.memory.advanced.EmbeddingFunctionReturns the value of thequeryEmbedderrecord component.intReturns the value of thereportedDimensionsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
EmbeddingBenchModel
public EmbeddingBenchModel(String name, int nativeDimensions, int reportedDimensions, int bytesPerDoc, com.tnsai.memory.advanced.EmbeddingFunction queryEmbedder, com.tnsai.memory.advanced.EmbeddingFunction documentEmbedder) Creates an instance of aEmbeddingBenchModelrecord class.- Parameters:
name- the value for thenamerecord componentnativeDimensions- the value for thenativeDimensionsrecord componentreportedDimensions- the value for thereportedDimensionsrecord componentbytesPerDoc- the value for thebytesPerDocrecord componentqueryEmbedder- the value for thequeryEmbedderrecord componentdocumentEmbedder- the value for thedocumentEmbedderrecord component
-
-
Method Details
-
of
public static EmbeddingBenchModel of(String name, int nativeDimensions, com.tnsai.memory.advanced.EmbeddingFunction embedder) -
of
public static EmbeddingBenchModel of(String name, int nativeDimensions, int reportedDimensions, com.tnsai.memory.advanced.EmbeddingFunction queryEmbedder, com.tnsai.memory.advanced.EmbeddingFunction documentEmbedder) -
ollama
public static EmbeddingBenchModel ollama(String name, int nativeDimensions, OllamaEmbeddingFunction client) Wraps an Ollama model so queries use the query prefix and passages use the document prefix. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
nativeDimensions
public int nativeDimensions()Returns the value of thenativeDimensionsrecord component.- Returns:
- the value of the
nativeDimensionsrecord component
-
reportedDimensions
public int reportedDimensions()Returns the value of thereportedDimensionsrecord component.- Returns:
- the value of the
reportedDimensionsrecord component
-
bytesPerDoc
public int bytesPerDoc()Returns the value of thebytesPerDocrecord component.- Returns:
- the value of the
bytesPerDocrecord component
-
queryEmbedder
public com.tnsai.memory.advanced.EmbeddingFunction queryEmbedder()Returns the value of thequeryEmbedderrecord component.- Returns:
- the value of the
queryEmbedderrecord component
-
documentEmbedder
public com.tnsai.memory.advanced.EmbeddingFunction documentEmbedder()Returns the value of thedocumentEmbedderrecord component.- Returns:
- the value of the
documentEmbedderrecord component
-