Using Crowdsourcing to get Representations based on Regular Expressions

Anders Søgaard, Héctor Martínez Alonso, Jakob Elming, Anders JohannsenEMNLP 2013

Abstract: Often the bottleneck in document classification is finding good representations that zoom in on the most important aspects of the documents. Most research uses n-gram representations, but relevant features often occur discontinuously, e.g., not. . . good in sentiment analysis. In this paper we present experiments getting experts to provide regular expressions, as well as crowdsourced annotation tasks from which regular expressions can be derived. Somewhat surprisingly, it turns out that these crowdsourced feature combinations outperform automatic feature combination methods, as well as expert features, by a very large margin and reduce error by 24-41% over n-gram representations.

Introduction

In document classification, the standard approach for decades has been the "bag-of-words" or n-gram model. However, these models struggle with discontinuous features. For example, in sentiment analysis, the phrase "not... good" is highly predictive, but the words might be separated by several other adjectives (e.g., "not very tasty or particularly good").

While regular expressions (regex) are perfect for capturing these patterns, the search space for "good" regex is infinite. This paper investigates whether we can bridge this gap by using human intuition—either from experts or the "crowd"—to identify these complex, non-linear patterns.

Methodology

The authors compared four primary ways of representing text:

  1. BoW (Baseline): Standard unigram bag-of-words.
  2. HI (Semantic Baseline): Augmenting words with semantic categories from the Harvard Inquirer (e.g., labeling "excellent" as a Positive class).
  3. Exp (Expert Regex): Seven researchers spent 20 person-hours writing manual regular expressions using a custom query tool.
  4. AMT (Crowdsourced Regex): Instead of writing code, Amazon Mechanical Turk (AMT) workers highlighted words or phrases they felt were predictive of the document's label.

To turn crowd highlights into features, the authors used a sliding window to extract trigrams from the highlighted words. These were converted into "skip-trigrams" by inserting Kleene stars (.*) between the words, effectively creating regular expressions that allow for gaps. These were further generalized using semantic HI classes.

Experimental Setup

The study evaluated these methods across three distinct classification tasks:

  • STACKOVERFLOW: Predicting answer quality in technical pairs (~97k pairs).
  • TASTE: Sentiment analysis of beer reviews regarding flavor (~152k samples).
  • APPEARANCE: Sentiment analysis of beer reviews regarding visual presentation (~152k samples).

Key Results and Insights

The Crowd vs. Experts

Surprisingly, features derived from the crowd significantly outperformed those written by machine learning experts. While experts tend to focus on a narrow set of "clever" rules, the crowd provides broader coverage of linguistic variety. The AMT task also proved more efficient; by asking humans to identify patterns and leaving formalization to an algorithm, high-quality features were unlocked at a low cost ($292.50 total).

Figure 2: Accuracy comparison across datasets showing that crowdsourced features (AMT) consistently outperform expert-written regex (Exp) and semantic baselines (HI).

Comparison with Automated Baselines

The authors also compared the crowd-regex approach against automated feature learning methods, including denoising autoencoders and kernel methods. In these document classification tasks, human-guided features remained superior, suggesting that human-priors are more efficient than unsupervised feature learning for "messy" text problems.

Figure 6: Accuracy comparison against automated baselines (kernel methods and denoising autoencoders), demonstrating the superior performance of human-in-the-loop feature extraction.

Across all three datasets, the AMT-based model achieved remarkable error reduction: 24.3% on StackOverflow, 34.2% on Taste, and 41.0% on Appearance. On the Appearance dataset, accuracy jumped from 0.758 (BoW) to 0.859 (AMT).

Limitations and Conclusion

While highly effective, the method relies partly on the Harvard Inquirer for generalization, which may limit performance in specialized domains (e.g., medical or legal) lacking such lexicons. Additionally, the AMT method generates a massive number of features (over 172k for StackOverflow), requiring $L_1$-regularized logistic regression for management.

In conclusion, this research demonstrates that "humans in the loop" still possess a massive edge in feature representation. By simplifying the human task from coding to highlighting, researchers can harvest robust, high-performing representations that outperform both domain experts and state-of-the-art automated baselines.

Summary updated

BibTeX
@inproceedings{sgaard2013using,
  author = {Anders Søgaard and Héctor Martínez Alonso and Jakob Elming and Anders Johannsen},
  title = {{Using Crowdsourcing to get Representations based on Regular Expressions}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2013},
  url = {https://openreview.net/forum?id=SJZO_GGu-S},
}
Figure