Convert Text String to Embedding Within Oracle AI Database
Perform a text-to-embedding transformation by accessing a vector embedding model stored in the database.
You can download an embedding machine learning model, convert it into ONNX format (if not already in ONNX format), and load the model into Oracle AI Database. You can then access that model to vectorize your data that is used to populate a vector index. Note that you must use the same embedding model on both the data to be indexed and the user's input query. In this example, you can see how to vectorize a user's input query on the fly.
Here, you can call either the VECTOR_EMBEDDING SQL function or the UTL_TO_EMBEDDING PL/SQL function (note the singular "embedding"). Both VECTOR_EMBEDDING and UTL_TO_EMBEDDING directly return a VECTOR type (not an array).
To convert a user's input text string "hello" to a vector embedding, using an embedding model in ONNX format:
Related Topics
Parent topic: Generate Embeddings