HuggingFaceEmbedding
Defined in: .build/typescript/packages/providers/huggingface/src/embedding.ts:37
Uses feature extraction from ‘@xenova/transformers’ to generate embeddings. Per default the model XENOVA_ALL_MINILM_L6_V2 is used.
Can be changed by setting the modelType
parameter in the constructor, e.g.:
new HuggingFaceEmbedding(\{ modelType: HuggingFaceEmbeddingModelType.XENOVA_ALL_MPNET_BASE_V2,\});
Extends
Section titled “Extends”BaseEmbedding
HuggingFaceEmbedding<
Options
>(nodes
,options?
):Promise
Defined in: .build/typescript/packages/providers/huggingface/src/embedding.ts:37
Uses feature extraction from ‘@xenova/transformers’ to generate embeddings. Per default the model XENOVA_ALL_MINILM_L6_V2 is used.
Can be changed by setting the modelType
parameter in the constructor, e.g.:
new HuggingFaceEmbedding(\{ modelType: HuggingFaceEmbeddingModelType.XENOVA_ALL_MPNET_BASE_V2,\});
Type Parameters
Section titled “Type Parameters”Options
Section titled “Options”Options
extends Record
<string
, unknown
>
Parameters
Section titled “Parameters”BaseNode
<Metadata
>[]
options?
Section titled “options?”Options
Returns
Section titled “Returns”Promise
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new HuggingFaceEmbedding(
params
):HuggingFaceEmbedding
Defined in: .build/typescript/packages/providers/huggingface/src/embedding.ts:43
Parameters
Section titled “Parameters”params
Section titled “params”HuggingFaceEmbeddingParams
= {}
Returns
Section titled “Returns”HuggingFaceEmbedding
Overrides
Section titled “Overrides”BaseEmbedding.constructor
Properties
Section titled “Properties”modelType
Section titled “modelType”modelType:
string
=HuggingFaceEmbeddingModelType.XENOVA_ALL_MINILM_L6_V2
Defined in: .build/typescript/packages/providers/huggingface/src/embedding.ts:38
modelOptions
Section titled “modelOptions”modelOptions:
undefined
|PretrainedModelOptions
={}
Defined in: .build/typescript/packages/providers/huggingface/src/embedding.ts:39
Methods
Section titled “Methods”getExtractor()
Section titled “getExtractor()”getExtractor():
Promise
<FeatureExtractionPipeline
>
Defined in: .build/typescript/packages/providers/huggingface/src/embedding.ts:53
Returns
Section titled “Returns”Promise
<FeatureExtractionPipeline
>
getTextEmbedding()
Section titled “getTextEmbedding()”getTextEmbedding(
text
):Promise
<number
[]>
Defined in: .build/typescript/packages/providers/huggingface/src/embedding.ts:73
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise
<number
[]>
Overrides
Section titled “Overrides”BaseEmbedding.getTextEmbedding