Home / Function/ evaluate_string_pairs() — langchain Function Reference

evaluate_string_pairs() — langchain Function Reference

Architecture documentation for the evaluate_string_pairs() function in schema.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  3ea3b093_5648_88aa_046a_77ffd66a2814["evaluate_string_pairs()"]
  910b9203_afa5_b8ca_1a1e_3933f70c340f["PairwiseStringEvaluator"]
  3ea3b093_5648_88aa_046a_77ffd66a2814 -->|defined in| 910b9203_afa5_b8ca_1a1e_3933f70c340f
  7026853a_ec84_d1d0_4656_2bb45a043e17["_check_evaluation_args()"]
  3ea3b093_5648_88aa_046a_77ffd66a2814 -->|calls| 7026853a_ec84_d1d0_4656_2bb45a043e17
  6695fe03_0fd9_7552_8ebc_8e87d5983012["_evaluate_string_pairs()"]
  3ea3b093_5648_88aa_046a_77ffd66a2814 -->|calls| 6695fe03_0fd9_7552_8ebc_8e87d5983012
  style 3ea3b093_5648_88aa_046a_77ffd66a2814 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/evaluation/schema.py lines 322–350

    def evaluate_string_pairs(
        self,
        *,
        prediction: str,
        prediction_b: str,
        reference: str | None = None,
        input: str | None = None,  # noqa: A002
        **kwargs: Any,
    ) -> dict:
        """Evaluate the output string pairs.

        Args:
            prediction: The output string from the first model.
            prediction_b: The output string from the second model.
            reference: The expected output / reference string.
            input: The input string.
            **kwargs: Additional keyword arguments, such as callbacks and optional reference strings.

        Returns:
            `dict` containing the preference, scores, and/or other information.
        """  # noqa: E501
        self._check_evaluation_args(reference=reference, input_=input)
        return self._evaluate_string_pairs(
            prediction=prediction,
            prediction_b=prediction_b,
            reference=reference,
            input=input,
            **kwargs,
        )

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/schema.py.
Where is evaluate_string_pairs() defined?
evaluate_string_pairs() is defined in libs/langchain/langchain_classic/evaluation/schema.py at line 322.
What does evaluate_string_pairs() call?
evaluate_string_pairs() calls 2 function(s): _check_evaluation_args, _evaluate_string_pairs.

Analyze Your Own Codebase

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

Try Supermodel Free