xinference.client.restful.restful_client.RESTfulRerankModelHandle.rerank#

RESTfulRerankModelHandle.rerank(documents: List[str], query: str, top_n: int | None = None, max_chunks_per_doc: int | None = None, return_documents: bool | None = None, return_len: bool | None = None, **kwargs)[源代码]#

Returns an ordered list of documents ordered by their relevance to the provided query.

参数:
  • query (str) -- The search query

  • documents (List[str]) -- The documents to rerank

  • top_n (int) -- The number of results to return, defaults to returning all results

  • max_chunks_per_doc (int) -- The maximum number of chunks derived from a document

  • return_documents (bool) -- if return documents

  • return_len (bool) -- if return tokens len

返回:

The scores of documents ordered by their relevance to the provided query

返回类型:

Scores

抛出:

RuntimeError -- Report the failure of rerank and provide the error message.