Torch-Struct: Deep Structured Prediction Library

Alexander M. Rush
2/3/2020
cs.CLcs.NEstat.ML

Official code: harvardnlp/pytorch-struct (1,134 stars, Jupyter Notebook, MIT, last commit 2022-04-20).

Abstract

The literature on structured prediction for NLP describes a rich collection of distributions and algorithms over sequences, segmentations, alignments, and trees; however, these algorithms are difficult to utilize in deep learning frameworks. We introduce Torch-Struct, a library for structured prediction designed to take advantage of and integrate with vectorized, auto-differentiation based frameworks.

Show full abstract

Torch-Struct includes a broad collection of probabilistic structures accessed through a simple and flexible distribution-based API that connects to any deep learning model. The library utilizes batched, vectorized operations and exploits auto-differentiation to produce readable, fast, and testable code. Internally, we also include a number of general-purpose optimizations to provide cross-algorithm efficiency. Experiments show significant performance gains over fast baselines and case-studies demonstrate the benefits of the library. Torch-Struct is available at https://github.com/harvardnlp/pytorch-struct.

View on arXivView PDF

Code Implementations(1)

MIT

Fast, general, and tested differentiable structured prediction in PyTorch

1,13492Jupyter Notebook, PythonAug 26, 20194 years agoMIT

Similar Papers

Cite this paper

@article{rush2020torchstruct,
  title  = {Torch-Struct: Deep Structured Prediction Library},
  author = {Alexander M. Rush},
  year   = {2020},
  eprint = {2002.00876},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2002.00876}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2002.00876.svg)](https://codeofpaper.com/paper/2002.00876)

Discussion