Package edu.cmu.sphinx.result

Examples of edu.cmu.sphinx.result.Lattice


    */
    @Override
    public void newResult(Result result) {
        String ref = result.getReferenceText();
        if (result.isFinal() && ref != null) {
            Lattice lattice = new Lattice(result);
            LatticeOptimizer optimizer = new LatticeOptimizer(lattice);
            optimizer.optimize();          
            lattice.computeNodePosteriors(languageModelWeight);
            SausageMaker sausageMaker = new SausageMaker(lattice);
            Sausage sausage = sausageMaker.makeSausage();
            sausage.removeFillers();
               
            getAligner().alignSausage(ref, sausage);
View Full Code Here


  @Test
  public void testPosterior() {

      LogMath logMath = LogMath.getLogMath();
     
    Lattice lattice = new Lattice();

    Node a = lattice.addNode("A", "A", 0, 0);
    Node b = lattice.addNode("B", "B", 0, 0);
    Node c = lattice.addNode("C", "C", 0, 0);
    Node d = lattice.addNode("D", "D", 0, 0);

    double acousticAB = 4;
    double acousticAC = 6;
    double acousticCB = 1;
    double acousticBD = 5;
    double acousticCD = 2;

    lattice.setInitialNode(a);
    lattice.setTerminalNode(d);

    lattice.addEdge(a, b, logMath.linearToLog(acousticAB), 0);
    lattice.addEdge(a, c, logMath.linearToLog(acousticAC), 0);
    lattice.addEdge(c, b, logMath.linearToLog(acousticCB), 0);
    lattice.addEdge(b, d, logMath.linearToLog(acousticBD), 0);
    lattice.addEdge(c, d, logMath.linearToLog(acousticCD), 0);

    lattice.computeNodePosteriors(1.0f);
    double pathABD = acousticAB * acousticBD;
    double pathACBD = acousticAC * acousticCB * acousticBD;
    double pathACD = acousticAC * acousticCD;
    double allPaths = pathABD + pathACBD + pathACD;

View Full Code Here

TOP

Related Classes of edu.cmu.sphinx.result.Lattice

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.