类 Embedding
java.lang.Object
dev.langchain4j.data.embedding.Embedding
Represents a dense vector embedding of a text.
This class encapsulates a float array that captures the "meaning" or semantic information of the text.
Texts with similar meanings will have their vectors located close to each other in the embedding space.
The embeddings are typically created by embedding models.
- 另请参阅:
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明intReturns the dimension of the vector.booleanstatic Embeddingfrom(float[] vector) Creates a new Embedding from the given vector.static EmbeddingCreates a new Embedding from the given vector.inthashCode()voidNormalize vectortoString()float[]vector()Returns the vector.Returns a copy of the vector as a list.
-
构造器详细资料
-
Embedding
public Embedding(float[] vector) Creates a new Embedding.- 参数:
vector- the vector, takes ownership of the array.
-
-
方法详细资料
-
vector
public float[] vector()Returns the vector.- 返回:
- the vector.
-
vectorAsList
Returns a copy of the vector as a list.- 返回:
- the vector as a list.
-
normalize
public void normalize()Normalize vector -
dimension
public int dimension()Returns the dimension of the vector.- 返回:
- the dimension of the vector.
-
equals
-
hashCode
public int hashCode() -
toString
-
from
Creates a new Embedding from the given vector.- 参数:
vector- the vector, takes ownership of the array.- 返回:
- the new Embedding.
-
from
Creates a new Embedding from the given vector.- 参数:
vector- the vector.- 返回:
- the new Embedding.
-