Home / Class/ StringDistance Class — langchain Architecture

StringDistance Class — langchain Architecture

Architecture documentation for the StringDistance class in config.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  f5c007bc_d3e2_b80c_e287_0ffa65b4b40d["StringDistance"]
  5528a09f_3682_a8b0_958b_cd9a898b6e3c["SingleKeyEvalConfig"]
  f5c007bc_d3e2_b80c_e287_0ffa65b4b40d -->|extends| 5528a09f_3682_a8b0_958b_cd9a898b6e3c
  ba7f9415_541a_d99f_0400_a688a10212b0["config.py"]
  f5c007bc_d3e2_b80c_e287_0ffa65b4b40d -->|defined in| ba7f9415_541a_d99f_0400_a688a10212b0

Relationship Graph

Source Code

libs/langchain/langchain_classic/smith/evaluation/config.py lines 163–175

    class StringDistance(SingleKeyEvalConfig):
        """Configuration for a string distance evaluator.

        Attributes:
            distance: The string distance metric to use (`damerau_levenshtein`,
                `levenshtein`, `jaro`, or `jaro_winkler`).
            normalize_score: Whether to normalize the distance to between 0 and 1.
                Applies only to the Levenshtein and Damerau-Levenshtein distances.
        """

        evaluator_type: EvaluatorType = EvaluatorType.STRING_DISTANCE
        distance: StringDistanceEnum | None = None
        normalize_score: bool = True

Frequently Asked Questions

What is the StringDistance class?
StringDistance is a class in the langchain codebase, defined in libs/langchain/langchain_classic/smith/evaluation/config.py.
Where is StringDistance defined?
StringDistance is defined in libs/langchain/langchain_classic/smith/evaluation/config.py at line 163.
What does StringDistance extend?
StringDistance extends SingleKeyEvalConfig.

Analyze Your Own Codebase

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

Try Supermodel Free