Closed npuichigo closed 3 years ago
@yzhang123 could u help to take a look?
there is a way, this is mainly by using the same code as cardinal wfst from inverse text normalization but inverting the graph at the end and fixing some format issues. But that code is very slow. So we did optimization and directly load the far. If you like the previous inline code version take a look at this PR.
Thanks for reply. You said there’s some optimization in the far for direct loading. Could you also provide some details about that?
you can for example the graph.optimize() in far file and load it, so you don't have to build it all the time. We have a cache function currently too, so when you specify --cache_dir
it will save the generated .far file and load that next time. that is much faster.
Is there anyway in to create the fst for cardinal number name using pynini like other cases? Or can anyone provide a way to create that, since I would like to do some locale expansion.