TL;DR
This paper introduces the Block Suffix Shifting (BSS) algorithm, a novel multi-string pattern matching technique that significantly speeds up the identification of concepts within large text corpora, particularly in the biomedical domain. By exploiting the natural block-and-separator structure of text and implementing intelligent shifting mechanisms, BSS outperforms traditional algorithms like Aho-Corasick, achieving substantial performance gains in real-world applications.
What Problem Does This Paper Address?
The digital age has led to an explosion of text-based data, from news archives to massive electronic medical records (EMRs). Extracting meaningful information from these vast datasets is a significant challenge, primarily due to the computational cost of pattern matching. Traditional algorithms, while effective, often struggle with the sheer volume of data and the inherent structure of natural language. Specifically, in domains like healthcare, manually sifting through EMRs to identify medical concepts for quality reporting is time-consuming and error-prone. Existing rule-based systems face performance bottlenecks when dealing with efficient pattern matching on large corpora. This paper aims to bridge this gap by developing a faster, more scalable algorithm for simultaneous multi-pattern matching.
Methods
The core contribution of this paper is the Block Suffix Shifting (BSS) algorithm. BSS builds upon the well-established Aho-Corasick (AC) algorithm but introduces crucial modifications to leverage the "block/separator" property of text.
Here's a breakdown of the key methodological aspects:
- Block/Separator Property: The authors observe that natural language text can be viewed as a sequence of "blocks" (e.g., words) separated by "separators" (e.g., spaces, punctuation). This property is fundamental to BSS.
- Exploiting Structure: Unlike AC, which treats text as a flat sequence of characters, BSS recognizes that patterns in many applications (like medical concept extraction) often align with these block boundaries. This means a pattern instance is unlikely to start in the middle of a word.
- Intelligent Shifting: The primary innovation is the BSS algorithm's ability to perform significant "shifts" over the text. When a mismatch occurs, instead of just advancing one character (as AC might), BSS can skip entire blocks or suffixes of blocks that are unlikely to contain a match, based on the block/separator structure. This drastically reduces the number of character comparisons.
- Modified State Machine: BSS retains the state machine (automaton) approach of AC but modifies its failure functions. These modifications are designed to:
- Avoid unnecessary backtracking.
- Prevent false positive "substring" matches that don't respect block boundaries.
- Handle character index number (CIN) mismatches more efficiently.
- Eliminate redundant failure functions that lead to wasted computation.
- Goto and Failure Functions: Similar to AC, BSS uses goto functions to transition between states based on input characters and failure functions to handle mismatches. However, BSS redefines and optimizes these functions to enable its shifting capabilities.
Datasets
The paper utilizes several datasets for evaluation:
- Electronic Medical Records (EMR) Data: A large corpus (over 640MB) from the biomedical domain.
- Scientific Chemistry Papers: A corpus of 500MB from the Royal Chemistry Society.
- DNA Data: A dataset of 250MB in geg format, with a small alphabet size (σ=4) and fixed block length.
The patterns used were derived from:
- Unified Medical Language System (UMLS): 71,140 patterns categorized into signs/symptoms, diseases, and clinical drugs.
- Chemistry Domain: 50,000 chemical names.
The paper does not introduce a new benchmark dataset but rather applies its algorithm to existing, large-scale real-world data.
Key Insights and Ideas
- The "Block/Separator" Property is Key: The most significant insight is that natural language text isn't just a stream of characters; its inherent structure of words and punctuation provides a powerful opportunity for optimization.
- Shifting is More Than Just Character Skipping: BSS's shifts are not just about moving forward; they are intelligent skips based on the context of word boundaries, leading to much larger performance gains than simple character-level shifts.
- Medical Concept Extraction is a Prime Use Case: The paper effectively demonstrates BSS's utility in a critical real-world application, highlighting its potential to accelerate research and improve healthcare informatics.
- Failure Function Optimization Matters: The detailed analysis of how BSS modifies failure functions reveals that even subtle changes can have a profound impact on performance by eliminating redundant computations.
- "Substring" False Positives are a Real Problem: The paper addresses and mitigates the issue of algorithms incorrectly identifying patterns that are merely substrings of larger words, which is crucial for accurate concept extraction.
Key Results
The BSS algorithm consistently outperforms the Aho-Corasick (AC) algorithm across various experimental settings:
- Speedup: BSS achieves significant speed improvements. For instance, in the EMR data, improvement rates range from 100% down to 35.1% as the number of patterns increases. In one experiment, BSS scanned text 52.577% faster by skipping over 51% of the text.
- Efficiency with Large Datasets: The performance advantage of BSS over AC remains steady even as the size of the text increases.
- Pattern Length Robustness: BSS shows performance gains across various pattern lengths, including multi-word concepts common in healthcare.
- Block Size Impact: Larger average block sizes lead to greater performance improvements for BSS, as there are more characters to shift.
- Mismatched Location: BSS performs best when mismatches occur early in blocks, allowing for larger shifts.
Limitations and Future Work
- Worst-Case Scenarios: The paper acknowledges that in specific worst-case scenarios (e.g., no mismatches, or mismatches only at the end of blocks), BSS's performance can degrade to that of the AC algorithm. However, these are noted as infrequent in free-text contexts.
- Equal-Length Blocks: While BSS can be optimized for equal-length blocks (as seen in the DNA dataset experiments), its primary strength lies in handling variable block lengths.
- Future Work: The authors suggest further investigation into the impact of various modification steps on performance and exploring the algorithm's applicability to other domains with similar block/separator structures. The paper also implies that further refinement of the failure function logic could yield even greater efficiency.
Summary updated