_load_map_rerank_chain() — langchain Function Reference
Architecture documentation for the _load_map_rerank_chain() function in loading.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD b697154b_40c5_e27f_d5cc_7b5d3379e066["_load_map_rerank_chain()"] bca47bc4_997d_4fc4_b050_2e6593c54792["loading.py"] b697154b_40c5_e27f_d5cc_7b5d3379e066 -->|defined in| bca47bc4_997d_4fc4_b050_2e6593c54792 style b697154b_40c5_e27f_d5cc_7b5d3379e066 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain/langchain_classic/chains/qa_with_sources/loading.py lines 44–61
def _load_map_rerank_chain(
llm: BaseLanguageModel,
*,
prompt: BasePromptTemplate = MAP_RERANK_PROMPT,
verbose: bool = False,
document_variable_name: str = "context",
rank_key: str = "score",
answer_key: str = "answer",
**kwargs: Any,
) -> MapRerankDocumentsChain:
llm_chain = LLMChain(llm=llm, prompt=prompt, verbose=verbose)
return MapRerankDocumentsChain(
llm_chain=llm_chain,
rank_key=rank_key,
answer_key=answer_key,
document_variable_name=document_variable_name,
**kwargs,
)
Domain
Subdomains
Source
Frequently Asked Questions
What does _load_map_rerank_chain() do?
_load_map_rerank_chain() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/chains/qa_with_sources/loading.py.
Where is _load_map_rerank_chain() defined?
_load_map_rerank_chain() is defined in libs/langchain/langchain_classic/chains/qa_with_sources/loading.py at line 44.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free