- Notifications
You must be signed in to change notification settings - Fork 2.1k
Open
Description
OpenAiEmbeddingModel uses the following code for creating an embedding for a document:
@Override public float[] embed(Document document) { Assert.notNull(document, "Document must not be null"); return this.embed(document.getFormattedContent(this.metadataMode)); }metadataModel controls if all, some or none of the metadata is included in constructing the String that then is used to create an embedding.
The default MetadataMode is EMBED which includes all fields, that aren't explicitly excluded.
OllamaEmbeddingModel on the other hand uses this implementation:
@Override public float[] embed(Document document) { return embed(document.getText()); }This means metadata is not included at all.
I don't see a reason why this behaviour is different for different embedding models. It should be the same for all and only implemented once, possibly in AbstractEmbeddingModel
Metadata
Metadata
Assignees
Labels
No labels