TagRuler: Interactive Tool for Span-Level Data Programming by Demonstration

Dongjin Choi, Sara Evensen, Çagatay Demiralp, Estevam HruschkaWWW 2021

Abstract

Despite rapid developments in the field of machine learning research, collecting high-quality labels for supervised learning remains a bottleneck for many applications. This difficulty is exacerbated by the fact that state-of-the-art models for NLP tasks are becoming deeper and more complex, often increasing the amount of training data required even for fine-tuning. Weak supervision methods, including data programming, address this problem and reduce the cost of label collection by using noisy label sources for supervision. However, until recently, data programming was only accessible to users who knew how to program. To bridge this gap, the Data Programming by Demonstration framework was proposed to facilitate the automatic creation of labeling functions based on a few examples labeled by a domain expert. This framework has proven successful for generating high-accuracy labeling models for document classification. In this work, we extend the DPBD framework to span-level annotation tasks, arguably one of the most time-consuming NLP labeling tasks. We built a novel tool, TagRuler, that makes it easy for annotators to build span-level labeling functions without programming and encourages them to explore trade-offs between different labeling models and active learning strategies. We empirically demonstrated that an annotator could achieve a higher F1 score using the proposed tool compared to manual labeling for different span-level annotation tasks.

Introduction

Modern NLP models require massive amounts of labeled training data, which is expensive and time-consuming to create. Weak supervision frameworks like Snorkel address this by using "Data Programming"—allowing users to write noisy, heuristic labeling functions (LFs) in code to automatically label large unlabeled datasets. However, a major bottleneck remains: domain experts (e.g., doctors or lawyers) who understand the data often lack programming skills. TagRuler addresses this for span-level annotation (tagging specific words or phrases), providing a no-code interface to generate complex, token-level labeling functions.

System Architecture and Methods

TagRuler translates user highlights into code through several key components, facilitating an iterative loop between the human annotator and the machine learning model.

The TagRuler system architecture illustrates the flow from user input to model generation and active sampling.
  • The Synthesizer: Converts user highlights into candidate LFs using semantic rules (BERT and ELMo embeddings) and syntactic rules (POS tags, dependency parsing).
  • The Modeler: Aggregates noisy LFs into probabilistic training labels using state-of-the-art sequential models like HMM and FlyingSquid.
  • False-Positive Active Sampler: A novel component that prioritizes showing the user unlabeled text that the current model is likely to misclassify, helping to refine the model's blind spots.

Interactive User Interface

The tool's UI is designed to support a rapid "demonstration-to-rule" workflow, allowing users to see the immediate impact of their annotations on model performance.

The TagRuler UI components: (A) Span Annotation, (B) Labeling Function Generation, (C) Selected Labeling Functions, and (D) Updated Accuracy.

Users interact with four main panels:

  1. Span Annotation (A): Users highlight text and assign labels.
  2. Labeling Function Generation (B): The system suggests rules based on the highlights.
  3. Selected Labeling Functions (C): Users manage and inspect the performance of their chosen rules.
  4. Labeling Statistics (D): Real-time metrics (F1-score, Coverage, Precision, Recall) provide immediate feedback on the model's quality.

Results and Key Insights

TagRuler was evaluated on the BC5CDR medical dataset and Yelp restaurant reviews. In both cases, it significantly outperformed manual labeling within a 30-minute time constraint.

  • Medical Domain: TagRuler achieved a micro F1 of 0.516, compared to 0.363 for manual labeling.
  • Review Domain: TagRuler reached an F1 of 0.564, vs. 0.433 for the baseline.

Key insights include the effectiveness of ensembling BERT with ELMo for domain-specific jargon and the power of surfacing false positives to correct both the model and inconsistencies in the ground truth data.

Conclusion

TagRuler successfully extends Data Programming by Demonstration to span-level tasks, making advanced NLP labeling accessible to non-programmers. By spending time on rules that generalize rather than individual examples, experts can train high-accuracy models much faster than traditional methods.

Summary updated

BibTeX
@inproceedings{choi2021tagruler,
  author = {Dongjin Choi and Sara Evensen and Çagatay Demiralp and Estevam Hruschka},
  title = {{TagRuler: Interactive Tool for Span-Level Data Programming by Demonstration}},
  booktitle = {The Web Conference},
  year = {2021},
  url = {https://openreview.net/forum?id=gzogkOSPO-},
}
Figure