Attention: This MediaPipe Solutions Preview is an early release. Learn more.

TextEmbedder.TextEmbedderOptions.Builder

Stay organized with collections Save and categorize content based on your preferences.
public static abstract class TextEmbedder.TextEmbedderOptions.Builder

Public Constructors

Public Methods

abstract TextEmbedder.TextEmbedderOptions
build()
abstract TextEmbedder.TextEmbedderOptions.Builder
setBaseOptions(BaseOptions value)
Sets the base options for the text embedder task.
abstract TextEmbedder.TextEmbedderOptions.Builder
setL2Normalize(boolean l2Normalize)
Sets whether L2 normalization should be performed on the returned embeddings.
abstract TextEmbedder.TextEmbedderOptions.Builder
setQuantize(boolean quantize)
Sets whether the returned embedding should be quantized to bytes via scalar quantization.

Inherited Methods

Public Constructors

public Builder ()

Public Methods

public abstract TextEmbedder.TextEmbedderOptions build ()

public abstract TextEmbedder.TextEmbedderOptions.Builder setBaseOptions (BaseOptions value)

Sets the base options for the text embedder task.

Parameters
value

public abstract TextEmbedder.TextEmbedderOptions.Builder setL2Normalize (boolean l2Normalize)

Sets whether L2 normalization should be performed on the returned embeddings. Use this option only if the model does not already contain a native L2_NORMALIZATION TF Lite Op. In most cases, this is already the case and L2 norm is thus achieved through TF Lite inference.

False by default.

Parameters
l2Normalize

public abstract TextEmbedder.TextEmbedderOptions.Builder setQuantize (boolean quantize)

Sets whether the returned embedding should be quantized to bytes via scalar quantization. Embeddings are implicitly assumed to be unit-norm and therefore any dimensions is guaranteed to have value in [-1.0, 1.0]. Use setL2Normalize(boolean) if this is not the case.

False by default.

Parameters
quantize