Lattice Functions

41 views
Skip to first unread message

Rafael Setyan

unread,
Jul 12, 2022, 1:31:21 PM7/12/22
to kaldi-help
Hi there,
Currently I am investigating exctracting additional info from Lattices/CompactLattices, I have successfully used about all scripts located in latbin, then I found some function in https://github.com/kaldi-asr/kaldi/blob/master/src/lat/lattice-functions.h#L58 which is GetPerFrameAcousticCosts(). But when calling this function I get assertion error

ASSERTION_FAILED ([5.5.1000~1-df1e9]:GetPerFrameAcousticCosts():lattice-functions.cc:53) Assertion failed: (nbest.NumArcs(cur_state) == 1)


The input Lattice I get from CompaceLattice which I get from decoder.GetLattice(true, clat).

Then I'am using this methods to get nbest (in my case n=1) Lattice

std::vector<kaldi::Lattice> nbestLats;

    {  

        kaldi::Lattice nbest_lat;

        fst::ShortestPath(lat, &nbest_lat, numBest);

        fst::ConvertNbestToVector(nbest_lat, &nbestLats);

    }


After that calling GetPerFrameAcousticCosts I get an error. What I am doing wrong, maybe I have to call other functions on Lattice before calling this function?


Thanks in advance,

Rafayel

Jan Yenda Trmal

unread,
Jul 12, 2022, 1:37:37 PM7/12/22
to kaldi-help
I think the error says that in some specific state there is more than one outgoing arc, which is in contrast what the doc says is precondition.
You don't show the code that includes calling GetPerFrameAcousticCosts() so hard to guess
y.

--
Go to http://kaldi-asr.org/forums.html to find out how to join the kaldi-help group
---
You received this message because you are subscribed to the Google Groups "kaldi-help" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kaldi-help+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kaldi-help/f9777d0a-874f-445f-bcfd-b562ce1109f9n%40googlegroups.com.

Jan Yenda Trmal

unread,
Jul 12, 2022, 1:38:25 PM7/12/22
to kaldi-help
Maybe grep for the calls of the function, so that you see how it is used in the codes?
y.

Rafael Setyan

unread,
Jul 12, 2022, 1:50:53 PM7/12/22
to kaldi-help
I grep it but did not find any example. But never mind I found issue, I was just passing the wrong Lattice, now it works fine.
Also is there any paper/tutorials/blog posts about Lattices that you recommend.
Regards

Jan Yenda Trmal

unread,
Jul 12, 2022, 2:14:06 PM7/12/22
to kaldi-help
Not sure about tutorial per se. Tutorial on FST might be also useful.
y.

Reply all
Reply to author
Forward
0 new messages