Skip to content

Conversation

DonalEvans
Copy link
Contributor

The name "text embedding" is used in many places where dense vector embeddings are handled, despite the type of the embedding vector not being exclusive to text embeddings. For example, image or multimodal embeddings may also produce a dense vector. To allow future reuse of classes related to dense vectors with multimodal embeddings, the naming is being changed to the more general "dense embedding". Classes which explicitly relate to text embeddings are not being renamed.

This rename is internal to the code only and does not change the name of any JSON objects which currently use "text_embedding", as doing so would be a breaking change.

  • For everything not exclusively related to text embedding, rename classes, methods and variables to use "dense embedding" instead of "text embedding"
  • Use correct class name in ElasticTextEmbeddingPayload.TextEmbeddingFloat.PARSER
  • Correct the javadoc in DenseEmbeddingBitResults

The name "text embedding" is used in many places where dense vector
embeddings are handled, despite the type of the embedding vector not
being exclusive to text embeddings. For example, image or multimodal
embeddings may also produce a dense vector. To allow future reuse of
classes related to dense vectors with multimodal embeddings, the naming
is being changed to the more general "dense embedding". Classes which
explicitly relate to text embeddings are not being renamed.

This rename is internal to the code only and does not change the name of
any JSON objects which currently use "text_embedding", as doing so would
be a breaking change.

- For everything not exclusively related to text embedding, rename
  classes, methods and variables to use "dense embedding" instead of
"text embedding"
- Use correct class name in
  ElasticTextEmbeddingPayload.TextEmbeddingFloat.PARSER
- Correct the javadoc in DenseEmbeddingBitResults
@DonalEvans DonalEvans added >refactoring :ml Machine learning Team:ML Meta label for the ML team v9.3.0 labels Oct 9, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/ml-core (Team:ML)

Comment on lines -202 to +203
private static final ConstructingObjectParser<TextEmbeddingFloatResults, Void> PARSER = new ConstructingObjectParser<>(
TextEmbeddingByteResults.class.getSimpleName(),
private static final ConstructingObjectParser<DenseEmbeddingFloatResults, Void> PARSER = new ConstructingObjectParser<>(
DenseEmbeddingFloatResults.class.getSimpleName(),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This parser was previously using the incorrect class name, which would have led to any errors encountered when parsing to report the wrong class.

@DonalEvans DonalEvans requested a review from davidkyle October 9, 2025 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:ml Machine learning >refactoring Team:ML Meta label for the ML team v9.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants