English

Efficient Semiring-Weighted Earley Parsing

Computation and Language 2023-07-07 v1 Data Structures and Algorithms Formal Languages and Automata Theory

Abstract

This paper provides a reference description, in the form of a deduction system, of Earley's (1970) context-free parsing algorithm with various speed-ups. Our presentation includes a known worst-case runtime improvement from Earley's O(N3GR)O (N^3|G||R|), which is unworkable for the large grammars that arise in natural language processing, to O(N3G)O (N^3|G|), which matches the runtime of CKY on a binarized version of the grammar GG. Here NN is the length of the sentence, R|R| is the number of productions in GG, and G|G| is the total length of those productions. We also provide a version that achieves runtime of O(N3M)O (N^3|M|) with MG|M| \leq |G| when the grammar is represented compactly as a single finite-state automaton MM (this is partly novel). We carefully treat the generalization to semiring-weighted deduction, preprocessing the grammar like Stolcke (1995) to eliminate deduction cycles, and further generalize Stolcke's method to compute the weights of sentence prefixes. We also provide implementation details for efficient execution, ensuring that on a preprocessed grammar, the semiring-weighted versions of our methods have the same asymptotic runtime and space requirements as the unweighted methods, including sub-cubic runtime on some grammars.

Cite

@article{arxiv.2307.02982,
  title  = {Efficient Semiring-Weighted Earley Parsing},
  author = {Andreas Opedal and Ran Zmigrod and Tim Vieira and Ryan Cotterell and Jason Eisner},
  journal= {arXiv preprint arXiv:2307.02982},
  year   = {2023}
}

Comments

Main conference long paper at ACL 2023

R2 v1 2026-06-28T11:23:39.157Z