Using the Embedding Model

 Important



Pre-General Availability: 2023-09-18

The following legal notice applies to Oracle pre-GA (Beta) releases. For copyright and other applicable notices, see Oracle Legal Notices.

Pre-General Availability Draft Documentation Notice

This documentation is in pre-General Availability status and is intended for demonstration and preliminary use only. It may not be specific to the hardware on which you are using the software. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to this documentation and will not be responsible for any loss, costs, or damages incurred due to the use of this documentation.

This documentation is not a commitment by Oracle to deliver any material, code, functionality or services. This documentation, and Oracle Pre-GA programs and services are subject to change at any time without notice and, accordingly, should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality for Oracle’s Pre-GA programs and services remains at the sole discretion of Oracle. All release dates or other predictions of future events are subject to change. The future availability of any future Oracle program or service should not be relied on in entering into any license or service agreement with Oracle.

In the navigation bar of the Console, choose a region that hosts Generative AI, for example, US Midwest (Chicago). If you don't know which region to choose, see Regions with Generative AI.
Open the navigation menu and click Analytics & AI. Under AI Services, click Generative AI.
In the left navigation, choose a compartment that you have permission to work in. If you don't see the playground, ask an administrator to give you access to Generative AI resources and then return to the following steps.
Click Playground.
Choose a model for generating text embeddings by performing one of the following actions:
In the Model drop-down list, under Embedding, choose the cohere.embbed-english-light.v2.0 model.
Click View model details, choose a model with Text embeddings capability, and then click Choose model.
(Optional) Click an example from the Example list to either use as a base model or to learn from. Click Run to generate embeddings for the example.
(Optional) Click Clear to remove all the sentences and start generating embeddings for new sentences.
Either start typing a sentence and click Add sentence to add more sentences or click Upload file to add a file to the Sentence input area.
 Note

Only files with a .txt extension are allowed. Each input sentence, phrase, or paragraph must be separated with a newline character. Maximum 96 inputs are allowed for each run and each input must be less than 512 tokens.
(Optional) Add more sentences manually or through uploading new files until you reach the maximum limit of 96 sentences.
For the Truncate parameter, choose whether to truncate the start or end tokens when the tokens exceed the maximum number of allowed tokens which is 512.
 Tip

If the Truncate parameter defaults to None and if an input exceeds 512 tokens, you get an error message. Before you run the embedding model, choose Start or End to for the truncate parameter.
Click Run.
Review a two-dimensional version of the output in the Output vector projection section.
To visualize the outputs with embeddings, output vectors are projected into two dimensions and plotted as points. Points that are close together correspond to phrases that the model considers similar.
When you're happy with the result, click Export output to get a json file that contains a 1024-dmensional vector for each input.
(Optional) Click View code, select a programming Language, click Copy code, and paste the code into a file and save the code. Ensure that your file maintains the format of the pasted code.
 Tip

If you're using the code in your applications, ensure that you authenticate your code.
(Optional) Click Clear to remove all the sentences and start generating embeddings for new sentences.
 Note

When you click Clear the model parameter, Truncate resets its default value of None.