arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2301.06862cs.DScs.CL
收藏

带失败弧的无环加权有限状态自动机算法

Algorithms for Acyclic Weighted Finite-State Automata with Failure Arcs

ETH Zürich(苏黎世联邦理工学院);Johns Hopkins University(约翰斯·霍普金斯大学)

Anej Svete, Benjamin Dayan, Tim Vieira, Ryan Cotterell, Jason Eisner

AI总结:

本文针对带失败转移的无环加权有限状态自动机,提出直接处理失败弧的高效后向算法,并给出适用于环加权情形的更低复杂度替代算法。

摘要:

加权有限状态自动机(WSFAs)在自然语言处理(NLP)中被广泛使用。失败转移是一种有用的扩展,用于紧凑地表示 $n$-gram 模型和条件随机场(CRFs)中的回退或插值,而这两者都是 WFSAs 的特殊情形。普通无环 WFSAs 中的路径和可以通过后向算法在 $O(|E|)$ 时间内高效计算,其中 $E$ 是转移集合。然而,该方法不允许失败转移,而预处理 WFSA 以消除失败转移可能会使 $|E|$ 大幅增加。我们将后向算法扩展为直接处理失败转移。当平均每个状态仅对字母表 $Σ$ 的一小部分 $s \ll 1$ 具有出弧时,我们的方法是高效的。我们提出了一种针对一般无环 WFSAs 的算法,其运行时间为 $O{\left(|E| + s |Σ| |Q| T_\text{max} \log{|Σ|}\right)}$,其中 $Q$ 是状态集合,$T_\text{max}$ 是失败转移的最大连通分量的大小。当失败转移拓扑满足以 CRFs 为例的条件时,可以去掉 $T_\text{max}$ 因子;当权重半环是环时,可以去掉 $\log{|Σ|}$ 因子。在后一种情况下(环加权无环 WFSAs),我们还给出了一种替代算法,其复杂度为 $\displaystyle O{\left(|E| + |Σ| |Q| \min(1,sπ_\text{max}) \right)}$,其中 $π_\text{max}$ 是最长失败路径的大小。

英文摘要:

Weighted finite-state automata (WSFAs) are commonly used in NLP. Failure transitions are a useful extension for compactly representing backoffs or interpolation in $n$-gram models and CRFs, which are special cases of WFSAs. The pathsum in ordinary acyclic WFSAs is efficiently computed by the backward algorithm in time $O(|E|)$, where $E$ is the set of transitions. However, this does not allow failure transitions, and preprocessing the WFSA to eliminate failure transitions could greatly increase $|E|$. We extend the backward algorithm to handle failure transitions directly. Our approach is efficient when the average state has outgoing arcs for only a small fraction $s \ll 1$ of the alphabet $Σ$. We propose an algorithm for general acyclic WFSAs which runs in $O{\left(|E| + s |Σ| |Q| T_\text{max} \log{|Σ|}\right)}$, where $Q$ is the set of states and $T_\text{max}$ is the size of the largest connected component of failure transitions. When the failure transition topology satisfies a condition exemplified by CRFs, the $T_\text{max}$ factor can be dropped, and when the weight semiring is a ring, the $\log{|Σ|}$ factor can be dropped. In the latter case (ring-weighted acyclic WFSAs), we also give an alternative algorithm with complexity $\displaystyle O{\left(|E| + |Σ| |Q| \min(1,sπ_\text{max}) \right)}$, where $π_\text{max}$ is the size of the longest failure path.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑