Git Product home page Git Product logo

Comments (3)

danpovey avatar danpovey commented on June 20, 2024

from icefall.

csukuangfj avatar csukuangfj commented on June 20, 2024

I notice that the function "intersect" of class "Nbest" calls k2.shortest_path which return the best path of the lattice.

icefall/icefall/decode.py

Lines 765 to 767 in 6e43905

def rescore_with_attention_decoder(
lattice: k2.Fsa,
num_paths: int,

The lattice in this function is a FsaVec, which contains as many FSAs as the number of utterances. Note that each FSA in lattice is NOT linear. Its scores consists of acoustic scores (from the neural network) and LM scores (from the n-gram LM).

nbest = nbest.intersect(lattice)

nbest here conains an FsaVec. Each FSA in it is linear. Each utterance can have at most num_paths linear FSAs.
Note that at this point, the scores of each FSA is 0. When a linear FSA is intersected with another non-linear FSA, i.e., a lattice, the resulting FSA is not linear and it contains all possible paths that are equivalent to the linear FSA. We use the shortest path to assign scores to the original linear FSA (Remember that its initial scores is 0). The sole purpose of k2.shortest_path here is to assign scores to the original FSAs in the nbest.

from icefall.

drawfish avatar drawfish commented on June 20, 2024

Oh, I got it. Thank you so much. @danpovey @csukuangfj

from icefall.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.