Class BgeSmallZhV15EmbeddingModel
java.lang.Object
dev.langchain4j.model.embedding.DimensionAwareEmbeddingModel
dev.langchain4j.model.embedding.onnx.AbstractInProcessEmbeddingModel
dev.langchain4j.model.embedding.onnx.bgesmallzhv15.BgeSmallZhV15EmbeddingModel
- All Implemented Interfaces:
dev.langchain4j.model.embedding.EmbeddingModel
public class BgeSmallZhV15EmbeddingModel
extends dev.langchain4j.model.embedding.onnx.AbstractInProcessEmbeddingModel
BAAI bge-small-zh-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: 512
It is recommended to add "为这个句子生成表示以用于检索相关文章:" 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 dev.langchain4j.model.embedding.DimensionAwareEmbeddingModel
dimension -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of anBgeSmallZhV15EmbeddingModel.BgeSmallZhV15EmbeddingModel(Executor executor) Creates an instance of anBgeSmallZhV15EmbeddingModel. -
Method Summary
Methods inherited from class dev.langchain4j.model.embedding.onnx.AbstractInProcessEmbeddingModel
embedAll, loadFromJarMethods inherited from class dev.langchain4j.model.embedding.DimensionAwareEmbeddingModel
dimensionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.langchain4j.model.embedding.EmbeddingModel
embed, embed
-
Constructor Details
-
BgeSmallZhV15EmbeddingModel
public BgeSmallZhV15EmbeddingModel()Creates an instance of anBgeSmallZhV15EmbeddingModel. Uses a cached thread pool with the number of threads equal to the number of available processors. Threads are cached for 1 second. -
BgeSmallZhV15EmbeddingModel
Creates an instance of anBgeSmallZhV15EmbeddingModel.- Parameters:
executor- The executor to use to parallelize the embedding process.
-
-
Method Details
-
model
protected dev.langchain4j.model.embedding.onnx.OnnxBertBiEncoder model()- Specified by:
modelin classdev.langchain4j.model.embedding.onnx.AbstractInProcessEmbeddingModel
-
knownDimension
- Overrides:
knownDimensionin classdev.langchain4j.model.embedding.DimensionAwareEmbeddingModel
-