Rerank documents¶
Reorder candidate documents by relevance to a query and obtain relevance scores and original document positions.
Prerequisites¶
Prepare a personal access token or service account API Key with Genesis permissions. See Access credentials. Find and select a model for reranking, and prepare a query and a nonempty candidate document list.
Call sequence¶
Preserve the original candidate order and rerank documents using the selected model, query, and candidate list.
Read relevance scores and original document indices, and associate results with the candidate list.
Use the returned ranking in your application. To limit the number of returned results, configure the limit as described on the action page.
API operations¶
Task |
API operation |
When to use it or what to check |
|---|---|---|
Rank candidates by relevance |
Use after preparing a query and candidates to obtain scores and original indices. |
Confirm the result¶
Confirm that each result maps to an original candidate and that the number of returned results matches the request configuration.
Limitations and notes¶
Reranking processes the candidates supplied in the request. Preserve their order before sending the request to avoid associating returned indices with the wrong documents.