INFODENS: An Open-source Framework for Learning Text Representations

Ahmad Taie, Raphael Rubino, Josef van GenabitharXiv 2018

Abstract

The advent of representation learning methods enabled large performance gains on various language tasks, alleviating the need for manual feature engineering. While engineered representations are usually based on some linguistic understanding and are therefore more interpretable, learned representations are harder to interpret. Empirically studying the complementarity of both approaches can provide more linguistic insights that would help reach a better compromise between interpretability and performance. We present INFODENS, a framework for studying learned and engineered representations of text in the context of text classification tasks. It is designed to simplify the tasks of feature engineering as well as provide the groundwork for extracting learned features and combining both approaches. INFODENS is flexible, extensible, with a short learning curve, and is easy to integrate with many of the available and widely used natural language processing tools.

Introduction

In the current era of Natural Language Processing (NLP), "representation learning" (deep learning) has largely replaced manual feature engineering. While deep learning models offer impressive performance gains, they often operate as "black boxes," making it difficult to extract linguistic insights. Conversely, hand-crafted features (like part-of-speech ratios or n-grams) are highly interpretable but are often dismissed as outdated.

The authors argue that these two approaches are not mutually exclusive. However, there has been a lack of a unified, modular framework that allows researchers to systematically study how these different representations complement each other. INFODENS addresses this by providing a "developer-friendly" environment to experiment with both "engineered" and "learned" features without requiring extensive boilerplate code.

Methodology

INFODENS is built on a modular architecture categorized into Frozen spots (core logic that remains unchanged) and Hot spots (pluggable modules for customization).

The modular architecture of the INFODENS framework showing the interaction between the Controller and various service modules.
  • The Controller: The centerpiece that handles communication between all modules.
  • Feature Extractors: A plug-and-play system where researchers can add new feature types (e.g., a simple script for sentence length) by simply dropping a file into a directory.
  • Hybrid Pipelines: The framework can extract traditional features (n-grams, lexical ratios) and learned features (fastText, sentence embeddings) simultaneously.
  • Classifiers: It integrates with scikit-learn for linear models (like SVMs) and Keras/TensorFlow for non-linear models (Multi-Layer Perceptrons), allowing users to feed concatenated feature sets into a neural network.
  • Configuration-Driven: Experiments are defined via simple .ini files, making the research process reproducible and accessible to those with limited programming experience.

Evaluation and Results

The authors validated the framework using seven well-known benchmarks across topic classification (AG’s news, DBpedia, Yahoo! Answers) and sentiment analysis (Yelp Review Polarity/Full, Amazon Review Polarity/Full). These datasets range from 120k to 3.6M training samples.

Performance comparison of various text representations across seven benchmark datasets.

The quantitative results demonstrate that the hybrid approach is highly effective:

  • Competitive Baselines: On the DBpedia dataset, INFODENS' hand-crafted features achieved 98.5% accuracy, nearly identical to state-of-the-art deep learning models.
  • Hybrid Gains: For the Yelp Full sentiment task, combining all features in a Multi-Layer Perceptron (MLP) yielded 59.7%, outperforming several standalone neural architectures.
  • Efficiency: While deep learning models often require significant GPU time, many of the hand-crafted feature sets could be evaluated in a fraction of the time while maintaining high accuracy.

Discussion and Key Insights

  • N-grams are still heavy hitters: Simple n-gram features, when tuned with proper frequency cut-offs, can still match or even outperform complex neural models like fastText or VDCNN on several datasets.
  • The Power of Combination: In many cases, the best performance was achieved by combining hand-crafted features with learned representations, suggesting that deep learning models don't always capture the same linguistic nuances that manual engineering does.
  • Dataset Sensitivity: There is no "silver bullet" representation. Different datasets benefit from different feature combinations, emphasizing the need for a framework like INFODENS to perform rapid, iterative experimentation.
  • Interpretability vs. Performance: By allowing users to extract and test specific linguistic features, the framework helps researchers move away from black-box models toward a more "glass-box" understanding of what information actually drives a classification decision.

Conclusion and Future Work

While INFODENS is a powerful tool for experimentation, future versions aim to allow features to be fed into more complex structures, such as convolutional layers, and develop a visualization module to improve interpretability. Currently, the framework provides a robust foundation for bridging the gap between traditional and modern NLP techniques.

Summary updated

BibTeX
@misc{taie2018infodens,
  author = {Ahmad Taie and Raphael Rubino and Josef van Genabith},
  title = {{INFODENS: An Open-source Framework for Learning Text Representations}},
  year = {2018},
  eprint = {1810.07091},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1810.07091},
}
Figure