@@ -16,8 +16,8 @@ The LLM is expected to return a JSON object containing ranked document indices.
1616are kept, so the output can contain fewer than ` top_k ` documents, or none if the LLM considers none relevant.
1717
1818If the query is empty, or if generation or parsing fails and ` raise_on_failure ` is ` False ` , the ranker falls back
19- to the deduplicated input documents in their original order. ` top_k ` is not applied to these fallback documents:
20- the input documents aren't necessarily sorted by relevance, so cutting them off could drop relevant ones.
19+ to the deduplicated input documents, unranked and in their original order. ` top_k ` is not applied to them, since
20+ cutting off unranked documents could drop relevant ones.
2121
2222Usage example:
2323
@@ -89,7 +89,7 @@ Initialize the LLMRanker component.
8989- ** top_k** (<code >int</code >) – The maximum number of ranked documents to return. Not applied when the ranker falls back to the input
9090 documents.
9191- ** raise_on_failure** (<code >bool</code >) – If ` True ` , raise when generation or response parsing fails. If ` False ` , log the failure and return all
92- deduplicated input documents in their original order, without applying ` top_k ` .
92+ deduplicated input documents unranked, in their original order, without applying ` top_k ` .
9393
9494** Raises:**
9595
@@ -180,7 +180,7 @@ Before ranking, duplicate documents are removed.
180180- <code >dict\[ str, list\[ Document\]\] </code > – A dictionary with the following key:
181181- ` documents ` : Up to ` top_k ` documents the LLM considers relevant, from most to least relevant. If
182182 ` query ` is empty, or if generation or parsing fails and ` raise_on_failure ` is ` False ` , all deduplicated
183- input documents in their original order.
183+ input documents unranked, in their original order.
184184
185185** Raises:**
186186
@@ -214,7 +214,7 @@ but can be used with `await` in an async code. If the chat generator only implem
214214- <code >dict\[ str, list\[ Document\]\] </code > – A dictionary with the following key:
215215- ` documents ` : Up to ` top_k ` documents the LLM considers relevant, from most to least relevant. If
216216 ` query ` is empty, or if generation or parsing fails and ` raise_on_failure ` is ` False ` , all deduplicated
217- input documents in their original order.
217+ input documents unranked, in their original order.
218218
219219** Raises:**
220220
0 commit comments