Home › Glossary › Evaluation › Edit distance

Intermediate · Evaluation

Edit distance

Visual diagram · (in preparation) · Math · (in preparation) · Worked example · 3 difficulty levels.

TL;DR. A metric that calculates the minimum number of single-character edits required to change one string into another.

Technical Definition

A metric that calculates the minimum number of single-character edits required to change one string into another.

How it works

Edit distance, such as Levenshtein distance, measures the similarity between two strings by counting the minimum number of insertions, deletions, or substitutions needed to transform one into the other. It's useful in natural language processing tasks like spell checking, DNA sequencing, and comparing text documents.

Further Reading

  • Google ML Glossary