Portability | portable |
---|---|
Stability | experimental |
Maintainer | www.ailab.tj.chiba-u.jp/~shinot |
DcdComps
Description
This module contains definitions of pipeline components for speech decoding. This is the mainbody of the husky decoder.
- data DcdConfig
- readConfig :: String -> IO DcdConfig
- configPsr :: DcdConfig -> String -> DcdConfig
- decodeForward :: DcdConfig -> WFST -> Vector GMixture -> [FeaVector] -> [PathList]
- progressiveBacktrack :: Int -> Int -> [PathList] -> [Arc]
- wfstExpandFrame :: WFST -> Vector GMixture -> [FeaVector] -> [StateScores] -> [PathList]
- wfstExpandEps :: WFST -> [PathList] -> [(PathList, StateScores)]
- pruneHypotheses :: DcdConfig -> [StateScores] -> [StateScores]
- candidateStates :: DcdConfig -> WFST -> [StateScores] -> [StateScores]
- connectedHyps :: [PathList] -> [PathList]
- chunkLattice :: Int -> [PathList] -> [[PathList]]
- latConnectionFilter :: [[PathList]] -> [[PathList]]
- pileUpHyps :: Int -> [[PathList]] -> [[PathList]] -> [[PathList]]
- harvestHyp :: [[PathList]] -> [([PathList], [PathList])]
Decoding configuration
Arguments
:: String | A name of configuration file |
-> IO DcdConfig | configuration |
Takes a file name of a configuration file for decoding and reads it. Each line of the file specifies a name-value pair: name=val. The parameters include insPenalty, lmWeight, band, and beam.
Parse a string describing parameters. Returns a DcdConfig where one of the data fields is updated following the specification in the string.
Main decoding functions
Arguments
:: DcdConfig | Decoding configuration. |
-> WFST | WFST definitions. |
-> Vector GMixture | A set of Gaussian mixture definitions of HMM states. |
-> [FeaVector] | A time series of a feature vector. |
-> [PathList] | A time series of a set of frame hypotheses. |
Performs Viterbi forward pass for speech decoding.
Arguments
:: Int | Interval to perform partial backtracking. Specified in frames. |
-> Int | State ID of the final WFST state. |
-> [PathList] | A time series of a set of frame hypotheses. |
-> [Arc] | A time series of an arc that has been determined. i.e. recognition results. |
Performs progressive backtracking for every specified interval frames. Determined arcs are output progressively without waiting for the end of the input. Large interval results in coarse output timing and small one results in large computational overhed for frequent partial backtracking.
Sub functions
Arguments
:: WFST | WFST definitions |
-> Vector GMixture | A set of Gaussian mixture definitions of HMM states. |
-> [FeaVector] | A time series of a feature vector. |
-> [StateScores] | A time series of a set of candidate states with their accumulated scores. |
-> [PathList] | A time series of a set of frame hypotheses obtained by expanding the candidate states. |
Expands candidate states at each time frame. Epsilon transitions are not expanded.
Arguments
:: WFST | WFST definitions |
-> [PathList] | A time series of a set of frame hypotheses. |
-> [(PathList, StateScores)] | A time series of a pair of a set of frame hypotheses and a set of candidate states with accumulated scores. The states are end nodes of the frame hypotheses. |
Expands a set of frame hypotheses by epsilon transitions.
Arguments
:: DcdConfig | Decoding configuration. |
-> [StateScores] | A time series of a set of candidate states. |
-> [StateScores] | Pruned results. |
Prune hypotheses
Arguments
:: DcdConfig | Decoding configuration. |
-> WFST | WFST definitions |
-> [StateScores] | A time series of a set of candidate states. |
-> [StateScores] | A shifted time series of a set of candidate states. |
Delays (shifts) a time series of a set of candidate states by one frame. The first element is a set of candidate states obtained by expanding the initial WFST state by epsilon transitions.
Arguments
:: [PathList] | A time series of a set of frame hypotheses. |
-> [PathList] | A squeezed time series of a set of frame hypotheses. |
Discards non-connected paths. The input time series is supposed to represent a partial lattice in reversed time order where the first element is the newest. The frame hypotheses that do not have a path to one of the first frame hypotheses (i.e. dead hypotheses) are removed.
chunkLattice :: Int -> [PathList] -> [[PathList]]
Chunks a time series of a set of frame hypotheses. A time series of a chunked time series of a set of frame hypotheses is returned. Ex. [1 2 3 4 5 6 7 8] -> [[1 2 3] [4 5 6] [7 8 9]].
Arguments
:: [[PathList]] | A time series of a chunked time series of a set of frame hypotheses. |
-> [[PathList]] | A squeezed time series of a chunked time series of a set of frame hypotheses. |
Connection filtering. Applies connectedHyps at each element.
Arguments
:: Int | The WFST final state |
-> [[PathList]] | A time series of a new chunked time series of a set of frame hypotheses. |
-> [[PathList]] | A time series of a remaining chunked time series of a set of frame hypotheses. |
-> [[PathList]] | A time series of a concatenated chunked time series of a set of frame hypotheses. |
Piles up non-determined hypotheses. Takes two time serieses of a chunked time series of a set of frame hypotheses, and connects them at each element. If the first time series is empty, then a dummy final-to-final arc is attached.
Arguments
:: [[PathList]] | A time series of a chunked time series of a set of frame hypotheses. |
-> [([PathList], [PathList])] | A time series of a pair of two chunked time serieses of a set of frame hypotheses. |
Harvests determined hypothesis. The output is a time series of a pair of two chunked time serieses of a set of frame hypotheses, where the first element is the determined arc sequence and the second element is the remains.