Embedding Models
Embedding models transform text into vector representations, enabling semantic search capabilities in OneNode. These vectors capture the meaning and context of text, allowing you to find documents based on semantic similarity rather than exact keyword matches.
When working with Text in OneNode, you can specify which embedding model to use via the emb_model
parameter.
Supported Embedding Models
Model | Provider | Dimensions | Description |
---|---|---|---|
text-embedding-3-small | OpenAI | 1536 | Smaller, faster model with excellent performance-to-cost ratio |
text-embedding-3-large | OpenAI | 3072 | Highest quality model for the most demanding use cases |
text-embedding-ada-002 | OpenAI | 1536 | Legacy model with good performance for general use cases |
Using Embedding Models in OneNode
To specify an embedding model when working with Text
, use the emb_model
parameter:
from onenode import Text, Models
{
"description": Text("This is a sample text that will be embedded.").enable_index(
emb_model=Models.TextToEmbedding.OpenAI.TEXT_EMBEDDING_3_LARGE
)
}
In the example above, we're using the TEXT_EMBEDDING_3_LARGE
model from OpenAI to embed the text.
Best Practices
- Use
text-embedding-3-small
for most general-purpose applications where cost-efficiency is important. - Choose
text-embedding-3-large
for applications requiring the highest quality embeddings, such as complex semantic retrieval tasks. - Consider using the same embedding model throughout your application for consistent results.
- For text fields that don't require semantic search, you can omit the embedding model to save on processing costs.
How can we improve this documentation?
Share Your Thoughts
Your feedback helps us improve our documentation. Let us know what you think!