Reranks the results of vector retrieval and full-text retrieval to address inaccurate sorting by using semantic understanding to rescore and reorder recalled data, which significantly improves result relevance and accuracy. AnalyticDB for PostgreSQL allows you to invoke rerank models to reorder retrieval results, but does not provide the models.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
gpdb:Rerank |
list |
*DBInstance
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| DBInstanceId |
string |
Yes |
The instance ID. Note
You can call the DescribeDBInstances operation to view the details of all AnalyticDB for PostgreSQL instances in the specified region, including instance IDs. |
gp-xxxxxxxxx |
| RegionId |
string |
Yes |
The region ID of the instance. |
cn-hangzhou |
| Query |
string |
No |
The query statement for reranking. |
What is ADBPG? |
| Documents |
array |
No |
The list of documents to be reranked. |
ADBPG is an Alibaba Cloud OLAP database. |
|
string |
No |
The content of a single document. |
ADBPG is an Alibaba Cloud OLAP database |
|
| Model |
string |
No |
The rerank model. Valid values:
|
bge-reranker-v2-m3 |
| Instruct |
string |
No |
The description of the custom ranking task type. This parameter can be set when RerankModel.Name is qwen3-rerank. It guides the model to use different ranking strategies. |
Given a web search query, retrieve relevant passages that answer the query |
| TopK |
integer |
No |
The number of most relevant documents to return. |
3 |
| ReturnDocuments |
boolean |
No |
Specifies whether to return the document text. If this parameter is set to false, the document text is not returned. Only the indexes and rerank scores of the sorted documents are returned. |
false |
| MaxChunksPerDoc |
integer |
No |
The maximum number of chunks allowed when the text exceeds the model window. Valid values:
Note
Chunking example
|
10 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Message |
string |
The detailed information returned in the response. |
success |
| RequestId |
string |
The request ID. |
ABB39CC3-4488-4857-905D-2E4A051D0521 |
| Results |
object |
||
| Results |
array<object> |
The rerank results. |
|
|
object |
The result details. |
||
| Document |
string |
The reranked document information. |
ADBPG is an Alibaba Cloud OLAP database. |
| Index |
integer |
The index of the document in the Documents request parameter. The index starts from 0. |
1 |
| RelevanceScore |
number |
The rerank similarity score. |
2.31412 |
| Status |
string |
The execution status of the API operation. Valid values:
|
success |
| Tokens |
integer |
The number of tokens consumed. |
100 |
Examples
Success response
JSON format
{
"Message": "success",
"RequestId": "ABB39CC3-4488-4857-905D-2E4A051D0521",
"Results": {
"Results": [
{
"Document": "ADBPG is an Alibaba Cloud OLAP database.",
"Index": 1,
"RelevanceScore": 2.31412
}
]
},
"Status": "success",
"Tokens": 100
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.