A Statistical Model for Flexible String Similarity

Atsuhiro TakasuIJCAI 2003

Abstract

This paper introduces the Dual and Variable Length Hidden Markov Model (DVHMM), a statistical framework designed to learn string similarity directly from data. Unlike traditional edit distance, which relies on manually tuned costs, DVHMM models complex, context-dependent transformations by decomposing strings into variable-length substring pairs. Evaluation on bibliographic matching tasks demonstrates that DVHMM consistently outperforms standard edit distance.

Introduction

Measuring string similarity is a foundational task in computer science, essential for applications ranging from OCR error correction to bibliographic record linkage. Traditionally, researchers have relied on Edit Distance (ED) or Dynamic Programming (DP) matching. However, standard edit distance is often too rigid. While DP matching allows for custom weights, setting these weights manually is a tedious "black art." For instance, in academic citations, a missing character in a journal name might be a common abbreviation (low penalty), whereas a missing digit in a page number is likely a critical error (high penalty). This paper proposes a model that automatically learns these nuances from training examples.

The Dual and Variable Length Hidden Markov Model (DVHMM)

The authors propose the DVHMM, an evolution of the classic Hidden Markov Model. While a standard HMM generates a single sequence of symbols, a DVHMM generates a pair of strings simultaneously.

Variable-Length States

Each state in the model is defined by a pair of lengths $(i, j)$. For instance, a state $(2, 1)$ represents a mapping where two characters in the "base" string correspond to one character in the "compared" string. This allows the model to capture complex many-to-one or one-to-many relationships, such as abbreviations or OCR segmentation errors.

DVHMM state transition diagram showing variable-length mappings.

Hierarchical Structure

To handle structured data like citations, the authors employ a hierarchical "meta-structure." Different components of a string (e.g., Author, Title, Journal) are represented by their own sub-DVHMMs. This allows the model to learn that "similarity" varies across different semantic fields.

Hierarchical structure of component DVHMMs for structured string matching.

Learning and Inference

Model parameters (transition and output probabilities) are estimated using the Expectation-Maximization (EM) algorithm. To determine similarity, the model calculates the joint probability of the string pair, typically by finding the most likely sequence of state transitions via a Viterbi-like approach.

Experimental Evaluation

The model was evaluated on a bibliographic matching task using 1,575 reference strings extracted from Japanese academic articles. The goal was to match these references against a ground-truth bibliographic database.

Results

The DVHMM was compared against standard Edit Distance (ED) using 5-fold cross-validation. The results show that DVHMM consistently provides higher ranking accuracy.

Metric Edit Distance (ED) DVHMM
Rank 1 Accuracy 92.33% 94.57%
Rank 5 Accuracy 94.56% 95.10%
Rank 10 Accuracy 95.23% 95.47%

Discussion and Key Insights

The primary advantage of DVHMM is its ability to move beyond character-level edits. By allowing states to represent variable lengths, it naturally handles abbreviations and common OCR merges/splits. Furthermore, the hierarchical nesting provides context-sensitive similarity; the system learns that a deletion in a "Journal" field is statistically more probable than in a "Volume Number" field. Unlike arbitrary penalty points in traditional methods, DVHMM grounds similarity in joint probability, providing a mathematically rigorous framework.

Limitations and Future Work

While effective, DVHMM introduces higher computational complexity than simple edit distance. Additionally, it requires a labeled training set to learn parameters, unlike "out-of-the-box" methods. Future research could explore scaling the model to larger, more diverse datasets and optimizing the inference algorithms for real-time applications.

Summary updated

BibTeX
@inproceedings{takasu2003statistical,
  author = {Atsuhiro Takasu},
  title = {{A Statistical Model for Flexible String Similarity}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2003},
}
Figure