Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support LogWeight in C and Python #233

Open
dhdaines opened this issue Jan 31, 2023 · 2 comments
Open

Support LogWeight in C and Python #233

dhdaines opened this issue Jan 31, 2023 · 2 comments

Comments

@dhdaines
Copy link
Contributor

Writing code in Rust is fun, but writing it in Python is more fun... but for many use cases (i.e. training or constructing WFSTs for language modeling) we need the log semiring which is only accessible from Rust.

Evidently to support it elsewhere requires it to be added to rustfst-ffi which implies duplicating all the classes and functions everywhere. Since log and tropical semiring are nearly the same thing this seems a bit wasteful to me!

As an aside, I wonder whether the OpenFST approach of templating everything based on the weight type is really a good idea, given that it duplicates all the object code simply to have a different implementation of a handful of simple functions, but this is typical of the C++ mentality underlying OpenFST...

@Garvys
Copy link
Owner

Garvys commented Feb 14, 2023

Hello ! Very nice feature request. It would indeed be very useful to have all semiring available in python and not only the tropical one. Regarding implementation, I will have to dig but it seems that we won't have much choice of creating a type for each in the same spirit as what has been done for ConstFst and VectorFst.

@dhdaines
Copy link
Contributor Author

I may have time to make a PR for this one, it is more immediately useful than FAR support for my purposes (since my collections of FSTs will fit just fine in memory)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants