PyTorch-IE: Fast and Reproducible Prototyping for Information Extraction
Arne Binder, Leonhard Hennig, Christoph Alt
TL;DR
Information Extraction requires integrating multiple subtasks and translating between complex data schemas and model inputs. PyTorch-IE provides a modular framework with a typed document model and task modules to decouple data representation from model encoding, while leveraging PyTorch-Lightning, HuggingFace Datasets, and Hydra to enable fast, reproducible prototyping. The framework includes a reusable ecosystem of ready-made models, datasets, metrics, templates, and a GitHub-based workflow for easy project bootstrapping and sharing via the HuggingFace Hub. By formalizing a document-centric data schema and encoding/decoding abstractions, PyTorch-IE bridges complex IE data with powerful language models, promoting reuse, extensibility, and collaborative development across IE tasks.
Abstract
The objective of Information Extraction (IE) is to derive structured representations from unstructured or semi-structured documents. However, developing IE models is complex due to the need of integrating several subtasks. Additionally, representation of data among varied tasks and transforming datasets into task-specific model inputs presents further challenges. To streamline this undertaking for researchers, we introduce PyTorch-IE, a deep-learning-based framework uniquely designed to enable swift, reproducible, and reusable implementations of IE models. PyTorch-IE offers a flexible data model capable of creating complex data structures by integrating interdependent layers of annotations derived from various data types, like plain text or semi-structured text, and even images. We propose task modules to decouple the concerns of data representation and model-specific representations, thereby fostering greater flexibility and reusability of code. PyTorch-IE also extends support for widely used libraries such as PyTorch-Lightning for training, HuggingFace datasets for dataset reading, and Hydra for experiment configuration. Supplementary libraries and GitHub templates for the easy setup of new projects are also provided. By ensuring functionality and versatility, PyTorch-IE provides vital support to the research community engaged in Information Extraction.
