Adaptive Rule Discovery for Labeling Text Data

Sainyam Galhotra, Behzad Golshan, Wang-Chiew Tan

TL;DR

Darwin is an interactive system that solves the "cold start" problem in data labeling by automatically discovering high-quality heuristic rules for text classification. By starting with just a single seed rule or a few examples, Darwin navigates a massive space of potential rules and asks an annotator for simple Yes/No feedback, achieving 80% coverage of positive instances with roughly 100 queries—outperforming existing automated methods that require thousands of pre-labeled examples.

What Problem Does This Paper Address?

In the era of deep learning, the biggest bottleneck isn't the model architecture; it’s the labeled data. While "weak supervision" frameworks like Snorkel allow users to write heuristic rules (e.g., "if the sentence contains 'shuttle', label it as 'transportation'") to label data at scale, they suffer from two major issues:

  1. The Expert Burden: Manually writing diverse, high-quality rules is tedious and requires deep domain expertise.
  2. The Cold Start Problem: Automated rule-mining systems (like Snuba) usually require a pre-labeled "gold" subset of data to start. In imbalanced datasets (where the "positive" class is rare), finding enough examples to even start mining is nearly impossible through random sampling.

Darwin addresses this by turning rule discovery into an interactive, adaptive search process that minimizes human effort while maximizing the discovery of rare positive instances.

Methods

Darwin’s architecture is built on three main pillars:

  • Efficient Indexing (Derivation Sketches): To handle millions of sentences, Darwin pre-computes an index based on a Context-Free Grammar (CFG). It represents every possible rule that could match a sentence in a trie-like structure. This allows the system to instantly calculate the "coverage" (how many sentences a rule would label) of any candidate rule.
  • Heuristic Hierarchy: Darwin organizes candidate rules into a hierarchy from generic to specific. For example, a generic rule like [word] to [location] sits at the top, while a specific descendant like shuttle to SFO sits below it. This structure allows the system to intelligently generalize or specialize based on feedback.
  • HybridSearch Traversal: This is the "brain" of the system. Darwin uses a classifier (trained on-the-fly) to estimate the "benefit" of querying a rule. It employs a HybridSearch strategy:
  • LocalSearch: Explores the neighborhood of known good rules to find similar patterns.
  • UniversalSearch: Looks globally across the entire hierarchy to find semantically different but useful rules.
  • The system adaptively switches between these to avoid getting stuck in "local optima" while ensuring it doesn't ignore promising new areas of the dataset.

Datasets

The authors evaluated Darwin on five diverse real-world datasets:

  • cause-effect: Identifying relationship extraction between entities (10.7K sentences).
  • musicians: Entity extraction from Wikipedia (15.8K sentences).
  • directions: A real-world concierge dataset for intent classification (15.3K sentences).
  • profession: A massive collection from ClueWeb used to test scalability (1 Million sentences).
  • tweets: Benchmark for classifying tweet intents (2.1K sentences).

Key Insights and Ideas

  • Feedback is Better than Writing: It is much easier for a human to say "Yes, this rule looks accurate" than to brainstorm a complex regex from scratch. Darwin shifts the human role from author to editor.
  • The Power of the Hierarchy: The hierarchical arrangement is a clever pruning tool. If a rule is confirmed as precise, its descendants (stricter versions) are likely redundant. If a rule is noisy, its descendants might be the "cleaned up" versions the system needs.
  • Semantic Generalization: By using word embeddings in its internal classifier, Darwin can bridge the gap between keywords. If it finds that "bus" is a good keyword, the classifier helps it "leap" to "public transport" in the rule hierarchy, even if they aren't structurally related.
  • Scalability: Because of the indexing strategy, Darwin can process a corpus of 1 million sentences in under 3 hours, making it viable for industrial-scale NLP tasks.

Key Results

  • Superior Coverage: Darwin(HS) identified 40% more positive instances than Snuba, even when Snuba was given 1,000 labeled instances to start with.
  • Efficiency: In most datasets, Darwin achieved a 0.80 F1-score and 80% coverage with fewer than 120 queries to the annotator.
  • Cost-Effectiveness: Using standard crowdsourcing rates, the authors estimated that Darwin could generate 80% of the positive labels for a dataset for about $7.20.
  • Robustness: The system performed consistently well regardless of whether the "seed" was a broad keyword or a specific long sentence.

Limitations and Future Work

  • Oracle Reliability: The system assumes the "Oracle" (the human annotator) is perfect. While the authors tested this with crowd workers and found it robust to some noise, a consistently "lazy" or incorrect annotator would degrade the rule quality.
  • Rule Complexity: While Darwin supports any CFG-based rule, the search space grows exponentially with rule complexity. The current implementation limits the "depth" of rules to keep the interactive loop fast.
  • Future Directions: The authors suggest exploring parallel discovery (multiple annotators working on different branches of the hierarchy) and further integrating more complex NLP features like coreference resolution into the rule grammar.

Summary updated

BibTeX
@inproceedings{galhotra2021adaptive,
  author = {Sainyam Galhotra and Behzad Golshan and Wang-Chiew Tan},
  title = {{Adaptive Rule Discovery for Labeling Text Data}},
  booktitle = {SIGMOD},
  year = {2021},
  doi = {10.1145/3448016.3457334},
}
Figure