_evaluate_strings() — langchain Function Reference
Architecture documentation for the _evaluate_strings() function in base.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD bc83b440_a302_dbf7_e138_2d0f9fd61418["_evaluate_strings()"] bff7d7ab_1e8c_c321_eeec_49e7e15eca13["StringDistanceEvalChain"] bc83b440_a302_dbf7_e138_2d0f9fd61418 -->|defined in| bff7d7ab_1e8c_c321_eeec_49e7e15eca13 b169d8ca_baf2_528c_d013_53f7c6ab28a6["_prepare_output()"] bc83b440_a302_dbf7_e138_2d0f9fd61418 -->|calls| b169d8ca_baf2_528c_d013_53f7c6ab28a6 style bc83b440_a302_dbf7_e138_2d0f9fd61418 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain/langchain_classic/evaluation/string_distance/base.py lines 250–285
def _evaluate_strings(
self,
*,
prediction: str,
reference: str | None = None,
input: str | None = None,
callbacks: Callbacks = None,
tags: list[str] | None = None,
metadata: dict[str, Any] | None = None,
include_run_info: bool = False,
**kwargs: Any,
) -> dict:
"""Evaluate the string distance between the prediction and the reference.
Args:
prediction: The prediction string.
reference: The reference string.
input: The input string.
callbacks: The callbacks to use.
tags: The tags to apply.
metadata: The metadata to use.
include_run_info: Whether to include run info in the output.
**kwargs: Additional keyword arguments.
Returns:
The evaluation results containing the score.
"""
result = self(
inputs={"prediction": prediction, "reference": reference},
callbacks=callbacks,
tags=tags,
metadata=metadata,
include_run_info=include_run_info,
)
return self._prepare_output(result)
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does _evaluate_strings() do?
_evaluate_strings() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/evaluation/string_distance/base.py.
Where is _evaluate_strings() defined?
_evaluate_strings() is defined in libs/langchain/langchain_classic/evaluation/string_distance/base.py at line 250.
What does _evaluate_strings() call?
_evaluate_strings() calls 1 function(s): _prepare_output.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free