Compute the string distance between the prediction and reference.
This logs the string distance (Damerau-Levenshtein) to LangSmith and returns
a _Matcher instance for making assertions on the distance value.
This depends on the rapidfuzz package for string distance computation.
edit_distance(
self,
prediction: str,
reference: str,
*,
config: Optional[EditDistanceConfig] = None
) -> _Matcher| Name | Type | Description |
|---|---|---|
prediction* | str | The predicted string to compare. |
reference* | str | The reference string to compare against. |
config | Optional[EditDistanceConfig] | Default: NoneOptional configuration for the string distance evaluator. Supported options:
|