Ondřej Plátek Blog
PhD candidate@UFAL, Prague. LLM & TTS evaluation. Engineer. Researcher. Speaker. Father.

Test copy paste ipython notebook for debugging

[]
In [1]:
import fst
v, n = fst.read_std('test_lat2nbest.fst'), 10
from pykaldi.utils import lattice_to_nbest, fst_shortest_path_to_lists

shortest = v.shortest_path(n)
print v[0].final
nbest = fst_shortest_path_to_lists(shortest)
from IPython.display import display, SVG
print nbest
display(shortest)
display(v)

TropicalWeight(inf)
[(110.40000001341105, [1, 3, 4]), (110.6000000089407, [2, 3, 4]), (1000.2000000029802, [2])]

FST00990->90:011110->110:013130->130:0889->80:0101011->100:0121213->120:011222->10:0333->20:0/1000444->20:0/100555->43:4/10666->51:3/0.3777->52:3/0.48->60:1/0.110->70:2/0.212->30:2/0.2
FST00110->10:1/0.1220->20:2/0.2331->31:3/0.32->32:3/0.4552->50:0/1000443->43:4/104->50:0/100
In []: