DKPro Similarity: An Open Source Framework for Text Similarity

Daniel Bär, Torsten Zesch, Iryna GurevychACL 2013

Abstract

We present DKPro Similarity, an open source framework for text similarity. Our goal is to provide a comprehensive repository of text similarity measures which are implemented using standardized interfaces. DKPro Similarity comprises a wide variety of measures ranging from ones based on simple n-grams and common subsequences to high-dimensional vector comparisons and structural, stylistic, and phonetic measures. In order to promote the reproducibility of experimental results and to provide reliable, permanent experimental conditions for future studies, DKPro Similarity additionally comes with a set of full-featured experimental setups which can be run out-of-the-box and be used for future systems to built upon.

Introduction

Text similarity—the task of determining how "close" two pieces of text are—is foundational to NLP applications like plagiarism detection, automatic essay grading, and paraphrase recognition. However, before the development of DKPro Similarity, the field faced a significant engineering hurdle: fragmentation. Most similarity measures were either not publicly available or scattered across disparate, incompatible libraries. There was no common interface to compare a simple n-gram overlap with a complex high-dimensional vector space model. This lack of standardization made it incredibly difficult for researchers to reproduce results or build "hybrid" systems that combine multiple types of similarity signals.

Architecture and Implementation

The authors developed a modular architecture that operates in two distinct modes to bridge the gap between simple standalone scripts and complex NLP pipelines.

  1. Stand-alone Mode: A lightweight API where users can pass raw strings or lists of tokens to a measure and get a similarity score. This is ideal for quick experiments or integration into non-UIMA projects.
  2. UIMA-coupled Mode: This mode integrates directly into the Apache UIMA (Unstructured Information Management Architecture) framework. It allows similarity computation to happen at the end of a sophisticated pipeline that might include lemmatization, part-of-speech tagging, or named-entity resolution.
Figure 1: Architecture of the UIMA-based pipeline integrating various text similarity measures via a Similarity Scorer component.

As illustrated in Figure 1, the architecture allows similarity measures to be plugged into a UIMA pipeline via a dedicated Similarity Scorer component. This modularity ensures that the preprocessing steps are decoupled from the similarity computation itself, allowing for flexible experimentation.

Comprehensive Measure Repository

The framework categorizes its vast library of measures into several key domains:

  • String-based: Longest common subsequences, Greedy String Tiling, and classic distances like Levenshtein and Jaro-Winkler.
  • Semantic: Pairwise word similarity using resources like WordNet and Wiktionary, as well as Vector Space Models like Latent Semantic Analysis (LSA) and Explicit Semantic Analysis (ESA).
  • Structural & Stylistic: Measures that look at stopword n-grams, function word frequencies, and type-token ratios to capture the "feel" or structure of a text rather than just its content.
  • Phonetic: Algorithms like Soundex and Double Metaphone to compare how words sound.

Reproducibility and Hybridization

Standardization is the antidote to "code rot." By defining common Java interfaces (TextSimilarityMeasure), the authors made it trivial to swap one algorithm for another. This encourages the community to contribute new measures that are immediately compatible with existing pipelines.

Furthermore, DKPro Similarity includes adapters for the Weka machine learning framework, allowing users to treat individual similarity scores as features for a classifier. This enables the creation of hybrid systems that capture different "dimensions" of similarity. To promote reproducibility, the framework provides "full-featured experimental setups." Instead of just providing the code for an algorithm, they provide the entire configuration used in their own published studies, allowing others to run the exact same experiment with a single command.

Key Results and Impact

  • State-of-the-Art Performance: In the task of detecting text reuse, a setup using DKPro Similarity (combining string-based and semantic measures) consistently outperformed all previous work across three standard datasets, including the METER corpus and various RTE challenges.
  • Community Validation: The framework was used in the pilot Semantic Textual Similarity (STS) task at SemEval-2012, where it became one of the recommended baseline systems for subsequent years.

Conclusion

DKPro Similarity provides a robust, extensible platform that addresses the fragmentation of text similarity research. While some advanced measures still rely on external specialized libraries, the framework's modular design and focus on reproducibility make it a vital resource for the NLP community. Future work focuses on expanding the library of pre-configured experimental setups and encouraging more "extrinsic" evaluation setups—testing how similarity measures perform as components within larger, real-world applications.

Summary updated

BibTeX
@inproceedings{bar2013dkpro,
  author = {Daniel Bär and Torsten Zesch and Iryna Gurevych},
  title = {{DKPro Similarity: An Open Source Framework for Text Similarity}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2013},
  url = {https://openreview.net/forum?id=S1WGghgubr},
}
Figure