rerank

Function

Performs weighted scoring to the hybrid retrieval results, sorts the results, and returns the top k results.

Prototype

def rerank(query, texts, batch_size)

Parameters

Parameter

Data Type

Required/Optional

Description

query

String

Required

Question, which participates in the relevance score calculation with all texts. The value is a string within the length range of [1, 1024 × 1024].

texts

list[Document]

Required

Text list. The list length range is (0, 1000 × 1000], and the string length range is [1, 1024 × 1024].

batch_size

Integer

Optional

(Not used) Batch size. The default value is 32.

Return Value

Data Type

Description

list[Document]

Top k results with the highest scores.