Home / Function/ _evaluate_string_pairs() — langchain Function Reference

_evaluate_string_pairs() — langchain Function Reference

Architecture documentation for the _evaluate_string_pairs() function in base.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  1fe1bfd8_c0e2_e992_88ac_e0bbb569d592["_evaluate_string_pairs()"]
  673d639d_36b0_87dd_ead9_5b65d00daaca["PairwiseStringDistanceEvalChain"]
  1fe1bfd8_c0e2_e992_88ac_e0bbb569d592 -->|defined in| 673d639d_36b0_87dd_ead9_5b65d00daaca
  b169d8ca_baf2_528c_d013_53f7c6ab28a6["_prepare_output()"]
  1fe1bfd8_c0e2_e992_88ac_e0bbb569d592 -->|calls| b169d8ca_baf2_528c_d013_53f7c6ab28a6
  style 1fe1bfd8_c0e2_e992_88ac_e0bbb569d592 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/evaluation/string_distance/base.py lines 385–417

    def _evaluate_string_pairs(
        self,
        *,
        prediction: str,
        prediction_b: str,
        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 two predictions.

        Args:
            prediction: The first prediction string.
            prediction_b: The second prediction 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, "prediction_b": prediction_b},
            callbacks=callbacks,
            tags=tags,
            metadata=metadata,
            include_run_info=include_run_info,
        )
        return self._prepare_output(result)

Domain

Subdomains

Frequently Asked Questions

What does _evaluate_string_pairs() do?
_evaluate_string_pairs() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/evaluation/string_distance/base.py.
Where is _evaluate_string_pairs() defined?
_evaluate_string_pairs() is defined in libs/langchain/langchain_classic/evaluation/string_distance/base.py at line 385.
What does _evaluate_string_pairs() call?
_evaluate_string_pairs() 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