Class BgeSmallEnV15QuantizedEmbeddingModel
java.lang.Object
dev.langchain4j.model.embedding.DimensionAwareEmbeddingModel
dev.langchain4j.model.embedding.onnx.AbstractInProcessEmbeddingModel
dev.langchain4j.model.embedding.onnx.bgesmallenv15q.BgeSmallEnV15QuantizedEmbeddingModel
- All Implemented Interfaces:
EmbeddingModel
Quantized BAAI bge-small-en-v1.5 embedding model that runs within your Java application's process.
Maximum length of text (in tokens) that can be embedded at once: unlimited. However, while you can embed very long texts, the quality of the embedding degrades as the text lengthens. It is recommended to embed segments of no more than 512 tokens long.
Embedding dimensions: 384
It is recommended to add "Represent this sentence for searching relevant passages:" prefix to a query.
Uses an Executor to parallelize the embedding process.
By default, uses a cached thread pool with the number of threads equal to the number of available processors.
Threads are cached for 1 second.
More details here
-
Field Summary
Fields inherited from class DimensionAwareEmbeddingModel
dimension -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of anBgeSmallEnV15QuantizedEmbeddingModel.BgeSmallEnV15QuantizedEmbeddingModel(Executor executor) Creates an instance of anBgeSmallEnV15QuantizedEmbeddingModel. -
Method Summary
Modifier and TypeMethodDescriptionprotected IntegerWhen known (e.g., can be derived from the model name), returns the dimension of theEmbeddingproduced by this embedding model.protected OnnxBertBiEncodermodel()Methods inherited from class AbstractInProcessEmbeddingModel
embedAll, loadFromJarMethods inherited from class DimensionAwareEmbeddingModel
dimensionMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface EmbeddingModel
embed, embed, modelName
-
Constructor Details
-
BgeSmallEnV15QuantizedEmbeddingModel
public BgeSmallEnV15QuantizedEmbeddingModel()Creates an instance of anBgeSmallEnV15QuantizedEmbeddingModel. Uses a cached thread pool with the number of threads equal to the number of available processors. Threads are cached for 1 second. -
BgeSmallEnV15QuantizedEmbeddingModel
Creates an instance of anBgeSmallEnV15QuantizedEmbeddingModel.- Parameters:
executor- The executor to use to parallelize the embedding process.
-
-
Method Details
-
model
- Specified by:
modelin classAbstractInProcessEmbeddingModel
-
knownDimension
Description copied from class:DimensionAwareEmbeddingModelWhen known (e.g., can be derived from the model name), returns the dimension of theEmbeddingproduced by this embedding model. Otherwise, it returnsnull.- Overrides:
knownDimensionin classDimensionAwareEmbeddingModel- Returns:
- the known dimension of the
Embedding, ornullif unknown.
-