garvys-org / rustfst

Rust re-implementation of OpenFST - library for constructing, combining, optimizing, and searching weighted finite-state transducers (FSTs). A Python binding is also available.
https://docs.rs/rustfst
Other
144 stars 17 forks source link

Determinization issues: Unequal arguments : non-functional FST #165

Closed dmort27 closed 2 years ago

dmort27 commented 2 years ago

When attempting to call determinize on some wFSTs, I get error messages like the following:

Unequal arguments : non-functional FST ? w1 = StringWeightRestrict { value: Labels([45, 62]) } w2 = StringWeightRestrict { value: Labels([45, 40]) }

As far as I can tell, this not very informative error message goes back to OpenFST, but even there, its meaning seems unclear. What could the problem be?

I haven't been able to reproduce this error with smaller FSTs, but I'll try.

Garvys commented 2 years ago

Hello ! Sorry for the late reply ! This error is raised because you are using a Non-Functional FST meaning giving one input sequence, your FST produces multiple different sequences. To be able to use the determinization with this kind of Fst, you must change the det_type when calling the determinize function and use DeterminizeDisambiguate for instance. Hope this fixes your issue :-)