|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinpro.incremental.deltifier.ASRWordDeltifier
public class ASRWordDeltifier
an ASRWordDeltifier (and descendants) can be used to store the ASR's (or one of the ASR's) current hypothesis you would usually call deltify() (either on the result or a specific token from the n-best-list) and afterwards retrieve the WordIUs and edits since the previous call via getIUs() and getEdits() Descendents of this class implement methods described in NAACL-HLT 2009
Field Summary | |
---|---|
(package private) int |
currentFrame
the number of the frame to which recognition has proceeded, restarts from zero with every recognition restart |
(package private) int |
currentOffset
offset to account for token numbers restarting from zero on recognition restarts (we want IU times to increase between recognitions, not restart from zero) |
private static org.apache.log4j.Logger |
logger
|
protected boolean |
recoFinal
flag to avoid smoothing or fixed lags on final result |
(package private) long |
startTime
|
protected java.util.List<EditMessage<WordIU>> |
wordEdits
|
protected IUList<WordIU> |
wordIUs
|
Constructor Summary | |
---|---|
ASRWordDeltifier()
|
Method Summary | |
---|---|
void |
deltify(edu.cmu.sphinx.result.Result result)
update the stored ASR-representation with the new Result from ASR the current representation can afterwards be queried through getWordIUs() the difference from the previous state can be queried through getWordEdits() the actual deltification algorithm is described in deltify(Token) |
protected void |
deltify(edu.cmu.sphinx.decoder.search.Token token)
update the stored ASR-representation with information from the ASR result's given Token the actual deltification algorithm works as follows: we first extract all the word- and phoneme tokens from the token sequence, each word-token is followed by the corresponding phoneme tokens let's assert that every word-token is followed by the corresponding phoneme tokens and that every SIL phoneme is preceded by a silence-word token we then compare the previous and the current hypothesis: the beginning of the previous and this word hypothesis should be equal, we only need to update phoneme timings eventually, the two hypotheses will differ: we construct remove-edits for the remaining old words we then construct the new words and add edits for them |
int |
getCurrentFrame()
the frame count in the IU world; no restarts between recognitions and including non-VAD-times |
double |
getCurrentTime()
the time that has passed in the IU world; no restarts between recognitions |
private double |
getTimeFromNewIt(java.util.ListIterator<edu.cmu.sphinx.decoder.search.Token> newIt)
tries to get segmentEndTime from a list iterator; the iterator will be at the same position afterwards as it was before |
protected java.util.List<edu.cmu.sphinx.decoder.search.Token> |
getTokens(edu.cmu.sphinx.decoder.search.Token finalToken)
adds a bunch of assertions to the output of ResultUtil.getTokenList(Token,boolean,boolean) |
java.util.List<EditMessage<WordIU>> |
getWordEdits()
return the change of the hypothesis as a list of edits (on the word level) since the last call |
java.util.List<WordIU> |
getWordIUs()
return the current hypothesis as a list of IUs (on the word level) |
private static boolean |
isSilenceSegment(edu.cmu.sphinx.decoder.search.Token t)
|
private static boolean |
isSilenceWord(edu.cmu.sphinx.decoder.search.Token t)
|
void |
newProperties(edu.cmu.sphinx.util.props.PropertySheet ps)
this base implementation does not accept any parameters |
void |
reset()
|
void |
setCollectTime(long collectTime)
|
void |
setOffset(int currentOffset)
there are two alternatives to set the offset: - put an OffsetAdapter into the FrontEnd (after VAD) - use signalOccurred() below; for this you have to call FrontEnd.addSignalListener(deltifier) somewhere (CurrentHypothesis-setup) here, the offset is given in centiseconds (frames) |
void |
signalOccurred(edu.cmu.sphinx.frontend.Signal signal)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final IUList<WordIU> wordIUs
protected final java.util.List<EditMessage<WordIU>> wordEdits
private static final org.apache.log4j.Logger logger
int currentFrame
int currentOffset
long startTime
protected boolean recoFinal
Constructor Detail |
---|
public ASRWordDeltifier()
Method Detail |
---|
public void newProperties(edu.cmu.sphinx.util.props.PropertySheet ps) throws edu.cmu.sphinx.util.props.PropertyException
newProperties
in interface edu.cmu.sphinx.util.props.Configurable
edu.cmu.sphinx.util.props.PropertyException
protected java.util.List<edu.cmu.sphinx.decoder.search.Token> getTokens(edu.cmu.sphinx.decoder.search.Token finalToken)
ResultUtil.getTokenList(Token,boolean,boolean)
finalToken
- the token to start the backwards trace from
private static boolean isSilenceWord(edu.cmu.sphinx.decoder.search.Token t)
private static boolean isSilenceSegment(edu.cmu.sphinx.decoder.search.Token t)
protected void deltify(edu.cmu.sphinx.decoder.search.Token token)
the actual deltification algorithm works as follows:
token
- the token from which the deltification startsprivate double getTimeFromNewIt(java.util.ListIterator<edu.cmu.sphinx.decoder.search.Token> newIt)
public void deltify(edu.cmu.sphinx.result.Result result)
deltify(Token)
result
- current ASR hypothesisdeltify(Token)
public java.util.List<EditMessage<WordIU>> getWordEdits()
getWordEdits
in interface ASRResultKeeper
public java.util.List<WordIU> getWordIUs()
getWordIUs
in interface ASRResultKeeper
public int getCurrentFrame()
getCurrentFrame
in interface ASRResultKeeper
public double getCurrentTime()
getCurrentTime
in interface ASRResultKeeper
public void reset()
reset
in interface edu.cmu.sphinx.instrumentation.Resetable
public void setOffset(int currentOffset)
public void signalOccurred(edu.cmu.sphinx.frontend.Signal signal)
signalOccurred
in interface edu.cmu.sphinx.frontend.SignalListener
public void setCollectTime(long collectTime)
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |