-
Notifications
You must be signed in to change notification settings - Fork 234
Why lattice.shortest path slower than lattice.get_tot_scores ? #1348
Description
Hi,
I am currently working on a project that uses WFST.
At some point, this involves computing a score corresponding to the probability of the shortest path in a lattice. This lattice can be constructed from either one word or several words.
When there is one word, I know that the shortest path will correspond to that particular word, so I just need the score, and hence call lattice.get_tot_scores . However, when several words are involved, my idea was that I can merge some computations when the words have a common prefixes by deriving the lattice from the union of the FSA of each word, instead of constructing one separate lattice per word. But in this case, I need to know what word correspond to the shortest_path that gives the best score.
The issue is that from my experiments, calling lattice.shortest_path (to get score+labels corresponding to the word) takes more time that calling lattice.get_tot_scores. I'd naively though that getting the best score would require to know the best path too, so the times should be similar.