Input
output(str): The generated textexpectedOutput(str): The reference text
Output
Result(float): A score between 0 and 1.
Interpretation
- Higher scores (closer to 1): Stronger structural similarity and correct word order
- Lower scores (closer to 0): Weak structural similarity
Formula
Example Calculation
- Reference: βthe cat sat on the matβ (m = 6)
- Candidate: βthe cat lies on the rugβ (n = 6)
- LCS(X,Y) = [the, cat, on, the] β length = 4
This is a Similarity Metric
Use Cases
- Evaluating abstractive summarization
- Assessing machine translation