Tutorial
Installation
Not needed if you have followed the setup instructions for our ASR Labs
To use openfst-python, we can simply install it with pip:
$ pip install openfst-python
Lab-specific documentation: an overview
Lab 1: Building HMMs with OpenFst
See the full documentation at Lab 1: Basic FST Manipulation.
Note
Please go to the github repo to view the jupyter notebook file for this lab.
There are three classes used in Lab 1: _MutableFst, the main class for a “mutable” FST (ie. one that can be dynamically modified in the code); Arc, which is the arc object used to connect states in an FST; and SymbolTable, which maps input or output strings to the integer IDs used as arc labels by OpenFst.
Mutable SymbolTable class. |
|
(No constructor.) |
|
|
This class represents an arc while remaining agnostic about the underlying arc type. |
Lab 2: FST with Weights
See the full documentation at Lab 2: Computing HMM probabilities with FST weights.
Note
Please go to the github repo to view the jupyter notebook file for this lab.
The essential class for this lab is Weight, and all weights are instances of this class.
|
FST weight class. |
Labs 3 and 4: Viterbi decoding
There is no additional documentation specific to either of these labs.
Labs 5: WFST operations
See the full documentation at Labs 5: WFST operations.
Note
Please go to the github repo to view the jupyter notebook file for this lab.
This lab introduces several WFST operations. You’ll see how these can be used to implement solutions to the problem of matching phoneme sequences to entries in a lexicon, and also incorporating a grammar. We use the following operations:
determinize(ifst, delta=1e-6, det_type="functional", |
|
|
Constructively composes two FSTs. |
shortestpath(ifst, delta=1e-6, nshortest=1, nstate=NO_STATE_ID, |
|
Minimizes the FST. |
|
Converts the FST to an acceptor using input or output labels. |
|
rmepsilon(self, queue_type="auto", connect=True, weight=None, |
|
Sorts arcs leaving each state of the FST. |