tessl install tessl/pypi-python-levenshtein@0.27.0Python compatibility wrapper for computing string edit distances and similarities using fast Levenshtein algorithms.
Agent Success
Agent success rate when using this tile
88%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.38x
Baseline
Agent success rate without this tile
64%
Build a tool that analyzes the similarity between different versions of document drafts by comparing them as sequences of words. The tool should preserve the order of words when computing similarity, making it suitable for tracking how much documents have changed across revisions.
@generates
def compute_similarity(doc1: list[str], doc2: list[str]) -> float:
"""
Computes similarity between two documents represented as word sequences.
Args:
doc1: First document as a list of words
doc2: Second document as a list of words
Returns:
float: Similarity score between 0.0 (completely different) and 1.0 (identical)
"""
pass
def find_most_similar(target: list[str], candidates: list[list[str]]) -> int:
"""
Finds the index of the most similar document from a list of candidates.
Args:
target: Target document as a list of words
candidates: List of candidate documents, each as a list of words
Returns:
int: Index of the most similar candidate document
"""
passProvides string similarity algorithms including sequence comparison.