Package saui_pr4 :: Module latticeui :: Class LatticeModel
[hide private]
[frames] | no frames]

Class LatticeModel

source code

object --+
         |
        LatticeModel

Model of a word lattice obtained from speech recognition, along with a possibly user-specified correct hypothesis.

It provides alternate words with associated probabilities for visualization, and tracks the user's corrected hypothesis.

Instance Methods [hide private]
 
__init__(self, dag, lm=None, lw=9.5, wip=0.5)
Create a LatticeModel object.
source code
 
set_lm(self, lm=None, lw=9.5, wip=0.5)
Set the language model and update the best hypothesis and posterior probabilities with the new model.
source code
 
set_dag(self, dag, lm=None, lw=9.5, wip=0.5)
Set the DAG and update the best hypothesis from its best path.
source code
list of LatticeWord
get_hyp(self)
Retrieve the best hypothesis from a LatticeModel
source code
 
set_hyp(self, hyp)
Set the best hypothesis
source code
string
get_hyp_text(self)
Retrieve the text of the top hypothesis
source code
LatticeCloud
get_cloud(self, word)
Retrieve a cloud around a hypothesis word.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, dag, lm=None, lw=9.5, wip=0.5)
(Constructor)

source code 
Create a LatticeModel object.
Parameters:
  • dag (sphinx.lattice.Dag) - Word lattice to initialize this object with.
Overrides: object.__init__

set_lm(self, lm=None, lw=9.5, wip=0.5)

source code 
Set the language model and update the best hypothesis and posterior probabilities with the new model.
Parameters:
  • lm (sphinx.arpalm.ArpaLM (or equivalent)) - Language model to use in computation
  • lw (float) - Language model weight
  • wip (float) - Word insertion penalty

set_dag(self, dag, lm=None, lw=9.5, wip=0.5)

source code 
Set the DAG and update the best hypothesis from its best path.
Parameters:
  • dag (sphinx.lattice.Dag (or equivalent)) - DAG to use.
  • lm (sphinx.arpalm.ArpaLM (or equivalent)) - Language model to use in computation of best path
  • lw (float) - Language model weight
  • wip (float) - Word insertion penalty

get_hyp(self)

source code 
Retrieve the best hypothesis from a LatticeModel
Returns: list of LatticeWord
The top hypothesis, annotated with start and end frames and posterior probabilities

set_hyp(self, hyp)

source code 
Set the best hypothesis
Parameters:
  • hyp (list of LatticeWord) - The new top hypothesis

get_hyp_text(self)

source code 
Retrieve the text of the top hypothesis
Returns: string
The top hypothesis text

get_cloud(self, word)

source code 
Retrieve a cloud around a hypothesis word.
Parameters:
  • word (LatticeWord) - Word in a hypothesis
Returns: LatticeCloud
Cloud around this word with beam width 0