Module semirings

Source
Expand description

Provides a trait that shall be implemented for all weights stored inside a wFST.

Structs§

BooleanWeight
Boolean semiring: (&, |, false, true).
GallicWeight
UnionWeight of GallicWeightRestrict.
GallicWeightLeft
Product of StringWeightLeft and an arbitrary weight.
GallicWeightMin
Product of StringWeightRestrict and an arbitrary weight.
GallicWeightRestrict
Product of StringWeighRestrict and an arbitrary weight.
GallicWeightRight
Product of StringWeightRight and an arbitrary weight.
IntegerWeight
Probability semiring: (x, +, 0.0, 1.0).
LogWeight
Log semiring: (log(e^-x + e^-y), +, inf, 0).
ProbabilityWeight
Probability semiring: (x, +, 0.0, 1.0).
ProductWeight
Product semiring: W1 * W2.
SemiringProperties
Properties verified by the Semiring.
StringWeightLeft
String semiring: (longest_common_prefix, ., Infinity, Epsilon)
StringWeightRestrict
String semiring: (identity, ., Infinity, Epsilon)
StringWeightRight
String semiring: (longest_common_suffix, ., Infinity, Epsilon)
TrivialWeight
Trivial semiring: (…, …, (), ()).
TropicalWeight
Tropical semiring: (min, +, inf, 0).
UnionWeight
Semiring that uses Times() and One() from W and union and the empty set for Plus() and Zero(), respectively. Template argument O specifies the union weight options as above.

Enums§

DivideType
Determines direction of division.
StringType
Determines whether to use left or right string semiring. Includes a ‘restricted’ version that signals an error if proper prefixes/suffixes would otherwise be returned by Plus, useful with various algorithms that require functional transducer input with the string semirings.

Traits§

CompleteSemiring
A semiring (S, ⊕, ⊗, 0, 1) is said to be complete if for any index set I and any family (ai)i ∈ I of elements of S, ⊕(ai)i∈I is an element of S whose definition does not depend on the order of the terms in the ⊕-sum. Note that in a complete semiring all weighted transducers are regulated since all infinite sums are elements of S. For more information : https://cs.nyu.edu/~mohri/pub/hwa.pdf
ReverseBack
Semiring
The weight on an Fst must implement the Semiring trait. Indeed, the weight set associated to a Fst must have the structure of a semiring. (S, +, *, 0, 1) is a semiring if (S, +, 0) is a commutative monoid with identity element 0, (S, *, 1) is a monoid with identity element 1, * distributes over +, 0 is an annihilator for *. Thus, a semiring is a ring that may lack negation. For more information : https://cs.nyu.edu/~mohri/pub/hwa.pdf
SerializableSemiring
StarSemiring
A complete semiring S is a starsemiring that is a semiring that can be augmented with an internal unary closure operation ∗ defined by a∗=⊕an (infinite sum) for any a ∈ S. Furthermore, associativity, commutativity, and distributivity apply to these infinite sums. For more information : https://cs.nyu.edu/~mohri/pub/hwa.pdf
UnionWeightOption
WeaklyDivisibleSemiring
A semiring is said to be divisible if all non-0 elements admit an inverse, that is if S-{0} is a group. (S, +, *, 0, 1) is said to be weakly divisible if for any x and y in S such that x + y != 0, there exists at least one z such that x = (x+y)*z. For more information : https://cs.nyu.edu/~mohri/pub/hwa.pdf
WeightQuantize