Semantic Encoder (SE) content requirements and best practices
Semantic Encoder (SE) content requirements and best practices
|
|
|
A Semantic Encoder (SE) model creates embeddings for your indexed item content. The embeddings are then used by the SE model to retrieve items for a given query based on semantic similarity (see What does an SE model do?).
In the context of generating answers using Relevance Generative Answering (RGA) or retrieving passages using Passage Retrieval (CPR), a list of the most relevant content is sent to the RGA or CPR model for answer generation or passage retrieval (see RGA overview or CPR overview). The quality of that content has a direct impact on the quality of the embeddings, the relevance of the retrieved items, and the quality of the answers generated by RGA or the passages retrieved by CPR.
When creating an SE model, you must specify the indexed content that the model will use. This article describes the requirements and best practices with regards to the content that you choose.
How SE uses your content
Before deciding on the content to use, it’s important to understand how the SE model uses your content.
When an item is indexed, its content is mapped to the title and body fields in the Coveo index.
The SE model uses a pre-trained sentence transformer language model to convert your indexed content’s title and body text into mathematical representations (vectors) in a process called embedding.
When a user enters a query, the model uses the vector space to retrieve the most relevant content.
This retrieval is based on semantic similarity using embeddings, which are created using the text in your content’s title and body text.
In summary, the SE model parses only your content’s title and body text when creating the embeddings. Therefore, an item’s title and body data should be as clean, focused, and relevant as possible. The better the data, the better the embeddings, and the better the content retrieval. For more information, see What does an SE model do?
Requirements
-
The content you want to use must be indexed in your Coveo organization before creating the model.
You don’t have to use all the content in your index. In fact, best practices dictate that you should choose a reasonably sized dataset to keep the content focused and relevant. When creating the model, you can choose to use a subset of your indexed content by selecting the sources that contain the items, and then further filtering the source dataset. For more information, see Choose your content.
NoteIf the indexed items you want to use aren’t optimized for use with the model, re-index the items with the proper configuration.
-
An indexed item must contain a unique value in the
permanentidfield in order for the item’s content to be embedded and used by the model.NoteBy default, an item indexed using a standard Coveo source automatically contains a value in its
permanentidfield that Coveo uses as the item’s unique identifier. However, if you’re using a custom source, such as Push API, you must make sure that the items that you want to use contain a unique value in thepermanentidfield. If not, you must map unique metadata to the item’spermanentidfield.To verify if an item contains a unique value in the
permanentidfield, you can use the Content Browser (platform-ca | platform-eu | platform-au) page of the Coveo Administration Console to check the item’s properties. -
The indexed item’s
languagefield is English.By default, only English content is supported. However, Coveo offers beta support for languages other than English. Learn more about multilingual content retrieval and answer generation.
NoteTo verify an item’s
languagefield, you can use the Content Browser (platform-ca | platform-eu | platform-au) page of the Coveo Administration Console to check the item’s properties.
Supported file types
Coveo has tested and supports the following file types for use with the model:
-
HTML
-
PDF
|
|
Notes
|
Best practices
This section describes best practices when it comes to choosing the content to use for the model and how to optimize the content for best results.
Choose your content
When deciding on the content to use, consider the following:
-
Prioritize content that’s designed to answer questions such as knowledge base articles, support documents, FAQs, community answers, and product documentation.
-
Prioritize content that’s written in a conversational tone.
-
Prioritize shorter documents that are focused on a single topic.
NoteAvoid using very long documents that cover multiple topics. This may result in text being embedded as semantically similar, even though the context or topic is different.
-
Content should be written using a single language.
By default, only English content is supported. However, Coveo offers beta support for languages other than English. Learn more about multilingual content retrieval and answer generation.
NoteOther languages are supported as a beta. For a list of beta-supported languages, see Supported languages for machine learning models.
-
Avoid multiple documents with similar content.
-
Choose a reasonably sized dataset to keep the content focused and current.
|
|
Keep the model embedding limits in mind when choosing the content for your model. |
Optimize your content
To optimize your content for the model, follow these best practices:
|
|
Notes
|
Model embedding limits
The SE model converts your content’s title and body text into numerical representations (vectors) in a process called embedding. It does this by breaking the text up into smaller segments called chunks, and each chunk is mapped as a distinct vector. For more information, see Embeddings.
The model is subject to the following embedding limits based on the selected chunking strategy:
|
|
Note
For a given model, the same chunking strategy is used for all sources and item types. |
-
Up to 15 million items or 50 million chunks
NoteThe maximum number of items depends on the item allocation of your product plan.
-
11 chunks per item
This limit is sufficient for the SE model to capture an item’s main concepts. If an item is long with a lot of text, however, such as more than 4000 words or 5 pages, the model will embed the item’s text until the 11-chunk limit is reached. The remaining text won’t be embedded and therefore won’t be used by the model.
To make sure that each item’s text is fully embedded, follow best practices by keeping items concise and focused.
-
500 words per chunk
NoteThere can be an overlap of up to 20% between chunks. In other words, the last 20% of the previous chunk can be the first 20% of the next chunk.