Efficient Sentence Retrieval Based on Syntactic Structure

Hiroshi Ichikawa, Keita Hakoda, Taiichi Hashimoto, Takenobu TokunagaACL 2006

Introduction: The Challenge of Syntactic Similarity

Most modern search engines and natural language processing tools prioritize "surface information," such as specific words and their parts of speech. However, surface similarity can be deceptive. Two sentences may share nearly identical word patterns but possess fundamentally different meanings due to their underlying syntactic structure.

Consider the sentences: "He beats a dog with a stick" and "He knows the girl with a ribbon." On the surface, both follow a similar N-V-DET-N-P-DET-N pattern. However, as shown in Figure 1, their syntactic trees reveal a critical difference: the prepositional phrase "with a stick" modifies the verb "beats" (instrumental), whereas "with a ribbon" modifies the noun "girl" (adjectival).

Syntactic trees for sentences with similar surface patterns but different structures.

While "Tree Kernels" (TK) were developed to quantify such structural similarities by counting shared subtrees, they suffer from an exponential indexing bottleneck. A single 22-word sentence can yield over 8 billion subtrees, making real-time retrieval across large corpora computationally unfeasible.

Proposed Methods: TO and SS

To address the scalability issues of Tree Kernels, researchers from the Tokyo Institute of Technology proposed two efficient approximations:

  1. Tree Overlapping (TO): This method focuses on counting overlapping "production rules"—the fundamental building blocks of a grammar tree—rather than every possible subtree. By mapping each production rule to its occurrences in a corpus and employing a specialized indexing function, TO can calculate similarity using a pre-built table. This avoids the need for exhaustive pair-wise tree comparisons. Figure 4 illustrates how the algorithm identifies and counts these overlapping structures.
  2. Subpath Set (SS): An even more streamlined approach, SS treats a syntactic tree as a collection of paths from the root to the leaves. By measuring the overlap of these paths (and their segments) between two sentences, it provides a rapid, albeit coarser, measure of structural similarity.
Illustration of the Tree Overlapping (TO) algorithm's calculation of structural similarity.

Experimental Evaluation and Results

The algorithms were tested on two distinct Japanese language datasets: the Titech Corpus (hand-annotated newspaper sentences) and the Iwanami Dictionary (automatically parsed dictionary glosses). The primary goal was to measure the speedup and retrieval accuracy of TO and SS relative to the "gold standard" Tree Kernel.

The experimental results highlighted a dramatic improvement in efficiency:

  • Speed: Tree Overlapping was approximately 100 times faster than the baseline TK, while Subpath Set achieved a 1,000-fold speedup. For instance, on the dictionary dataset, TK required over an hour for 1,000 queries, whereas SS completed the task in just 5.1 seconds.
  • Retrieval Quality: TO proved to be a robust middle ground. In comparative tests, the top result from TO matched a top-5 result from the gold-standard TK 73% of the time. SS, while faster, was significantly less accurate, matching only 35% of the time.

Discussion and Future Work

While these algorithms represent a major step toward practical structural search, several challenges remain. Syntactic similarity does not always equate to semantic similarity; two sentences might share a structure but discuss unrelated topics. Future research should explore integrating keyword-based content similarity with these structural methods. Additionally, the current models treat all structural differences with equal weight, whereas human intuition often perceives certain grammatical changes as more significant than others. Refining these algorithms to reflect human linguistic perception and implementing them in compiled languages for further speed gains are promising avenues for future development.

Summary updated

BibTeX
@inproceedings{ichikawa2006efficient,
  author = {Hiroshi Ichikawa and Keita Hakoda and Taiichi Hashimoto and Takenobu Tokunaga},
  title = {{Efficient Sentence Retrieval Based on Syntactic Structure}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2006},
}
Figure