Torch-Struct: Deep Structured Prediction Library

Alexander Rush


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. 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.
Anthology ID:
2020.acl-demos.38
Volume:
Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics: System Demonstrations
Month:
July
Year:
2020
Address:
Online
Editors:
Asli Celikyilmaz, Tsung-Hsien Wen
Venue:
ACL
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
335–342
Language:
URL:
https://aclanthology.org/2020.acl-demos.38
DOI:
10.18653/v1/2020.acl-demos.38
Award:
 Honorable Mention for Best Demonstration Paper
Bibkey:
Cite (ACL):
Alexander Rush. 2020. Torch-Struct: Deep Structured Prediction Library. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics: System Demonstrations, pages 335–342, Online. Association for Computational Linguistics.
Cite (Informal):
Torch-Struct: Deep Structured Prediction Library (Rush, ACL 2020)
Copy Citation:
PDF:
https://aclanthology.org/2020.acl-demos.38.pdf
Software:
 2020.acl-demos.38.Software.tgz
Video:
 http://slideslive.com/38928616
Code
 harvardnlp/pytorch-struct