Home / Function/ _parse_ranking() — langchain Function Reference

_parse_ranking() — langchain Function Reference

Architecture documentation for the _parse_ranking() function in listwise_rerank.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  bd5a4899_8f63_080c_c78f_50628a384e31["_parse_ranking()"]
  4e632d3e_51a3_ce8f_2735_e8ab3d863e6b["listwise_rerank.py"]
  bd5a4899_8f63_080c_c78f_50628a384e31 -->|defined in| 4e632d3e_51a3_ce8f_2735_e8ab3d863e6b
  style bd5a4899_8f63_080c_c78f_50628a384e31 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/retrievers/document_compressors/listwise_rerank.py lines 34–37

def _parse_ranking(results: dict) -> list[Document]:
    ranking = results["ranking"]
    docs = results["documents"]
    return [docs[i] for i in ranking.ranked_document_ids]

Domain

Subdomains

Frequently Asked Questions

What does _parse_ranking() do?
_parse_ranking() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/retrievers/document_compressors/listwise_rerank.py.
Where is _parse_ranking() defined?
_parse_ranking() is defined in libs/langchain/langchain_classic/retrievers/document_compressors/listwise_rerank.py at line 34.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free