LevenshteinDistance: Character-level edit distance approximation

This metric aims to evaluate character-level similarity between a generated label and a gold-standard label using the normalised Levenshtein edit distance. The raw distance counts the minimum number of single-character insertions, deletions, and substitutions needed to transform one string into the other; the score is normalised to [0, 1] as 1 − distance / max(len_a, len_b).

Example:

Generate_Label_1: Wine

Generate_Label_2: Wines

Generate_Label_3: Liquor

Gold_Standard_Label: Wine

Result:

  1. LevenshteinDistance(Generate_Label_1, Gold_Standard_Label) = 1.00
  2. LevenshteinDistance(Generate_Label_2, Gold_Standard_Label) ≈ 0.80
  3. LevenshteinDistance(Generate_Label_3, Gold_Standard_Label) ≈ 0.17

What is being measured?

This metric captures fine-grained character-level proximity between labels. It is well suited to detecting typos, plurals, and small spelling drifts, but is purely lexical and cannot detect semantic equivalence.

Metric information

RDF Resource Description Framework Flyer Icon
Title
Character-level edit distance approximation
Identifier
Keywords
Ontology Concept Matching, Metric, Classes, Properties, Edit Distance
Contact Point
Publisher
Version
0.1.0
License
Category
Ontology Concept Matching
Dimension
Task
Applicable for
Benchmark
CQ2OE Benchmark: Competency Questions for Ontology Engineering. A benchmark for evaluating LLM-assisted ontology generation from competency questions.
Status
Active
Active Proposed Inactive Deprecated
Ontology Engineering Group https://oeg.fi.upm.es