Package edu.cmu.sphinx.linguist.acoustic

Examples of edu.cmu.sphinx.linguist.acoustic.HMM


            //        + " size " + endNodeMap.size());
            Map<HMM, HMMNode> resultMap = new HashMap<HMM, HMMNode>();
            Unit baseUnit = endNode.getBaseUnit();
            Unit lc = endNode.getLeftContext();
            for (Unit rc : entryPoints) {
                HMM hmm = hmmPool.getHMM(baseUnit, lc, rc, HMMPosition.END);
                HMMNode hmmNode = resultMap.get(hmm);
                if (hmmNode == null) {
                    hmmNode = new HMMNode(hmm, LogMath.LOG_ONE);
                    resultMap.put(hmm, hmmNode);
                }
View Full Code Here


            curNode = ep.getNode();
            lc = baseUnit;
            for (int i = 1; i < units.length - 1; i++) {
                baseUnit = units[i];
                rc = units[i + 1];
                HMM hmm = hmmPool.getHMM(baseUnit, lc, rc, HMMPosition.INTERNAL);
                if (hmm == null) {
                    logger.severe("Missing HMM for unit " + baseUnit.getName() + " with lc=" + lc.getName() + " rc=" + rc.getName());
                } else {
                    curNode = curNode.addSuccessor(hmm, probability);
                }
View Full Code Here

            HashMap<HMM, HMMNode> singleUnitMap = new HashMap<HMM, HMMNode>();

            for (Unit lc : exitPoints) {
                Node epNode = new Node(LogMath.LOG_ZERO);
                for (Unit rc : getEntryPointRC()) {
                    HMM hmm = hmmPool.getHMM(baseUnit, lc, rc, HMMPosition.BEGIN);
                    Node addedNode;

                    if ((addedNode = map.get(hmm)) == null) {
                        addedNode = epNode.addSuccessor(hmm, getProbability());
                        map.put(hmm, addedNode);
View Full Code Here

         */
        private void connectSingleUnitWords(Unit lc, Node epNode, HashMap<HMM, HMMNode> map) {
            if (!singleUnitWords.isEmpty()) {
               
                for (Unit rc : entryPoints) {
                    HMM hmm = hmmPool.getHMM(baseUnit, lc, rc, HMMPosition.SINGLE);
                   
                    HMMNode tailNode;
                    if (( tailNode = map.get(hmm)) == null) {
                        tailNode = (HMMNode)
                                epNode.addSuccessor(hmm, getProbability());
View Full Code Here

            if (generateUnitStates) {
                arc = new LexTreeUnitState(hmmNode, getWordHistory(), previous
                        .getSmearTerm(), smearProbability, languageProbability,
                        insertionProbability, collapsed);
            } else {
                HMM hmm = hmmNode.getHMM();
                arc = new LexTreeHMMState(hmmNode, getWordHistory(), previous
                        .getSmearTerm(), smearProbability, hmm.getInitialState(),
                        languageProbability, insertionProbability, null, collapsed);
            }
            return arc;
        }
View Full Code Here

                                getSmearProb(), logOne, logOne,
                                this.getNode(), collapsed);
                    }
                } else {
                    for (int i = 0; i < nodes.length; i++) {
                        HMM hmm = nodes[i].getHMM();
                        arcs[i] = new LexTreeHMMState(nodes[i],
                                getWordHistory(), getSmearTerm(),
                                getSmearProb(), hmm.getInitialState(),
                                logOne, logOne, this.getNode(), collapsed);
                    }
                }
                putCachedArcs(arcs);
            }
View Full Code Here

         * @return a list of SearchState objects
         */
        @Override
        public SearchStateArc[] getSuccessors() {
            SearchStateArc[] arcs = new SearchStateArc[1];
            HMM hmm = getHMMNode().getHMM();
            arcs[0] = new LexTreeHMMState(getHMMNode(), getWordHistory(),
                    getSmearTerm(), getSmearProb(), hmm.getInitialState(),
                    logOne, logOne, parentNode, collapsed);
            return arcs;
        }
View Full Code Here

        return new TableEventMap(key, table);
    }

    @Override
    public HMM get(HMMPosition position, Unit unit) {
        HMM hmm = super.get(position, unit);
        if (null != hmm) return hmm;

        int[] ids = new int[3];
        ids[1] = symbolTable.get(unit.getName());
View Full Code Here

            // Create tmat
            float[][] transitionMatrix = matrixPool.get(unitCount);
            SenoneSequence ss = getSenoneSequence(stid);

            HMM hmm = new SenoneHMM(unit, ss, transitionMatrix, HMMPosition.lookup(position));
            hmmManager.put(hmm);
            unitCount++;
        }

        // If we want to use this code to load sizes/create models for
View Full Code Here

        if (s instanceof WordSearchState) {
            numWords++;
        } else if (s instanceof UnitSearchState) {
            numUnits++;
        } else if (s instanceof HMMSearchState) {
            HMM hmm = ((HMMSearchState) s).getHMMState().getHMM();
            switch (hmm.getPosition()) {
                case BEGIN: numHMMBegin++; break;
                case END: numHMMEnd++; break;
                case SINGLE: numHMMSingle++; break;
                case INTERNAL: numHMMInternal++; break;
                default: break;
View Full Code Here

TOP

Related Classes of edu.cmu.sphinx.linguist.acoustic.HMM

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.