edu.cmu.sphinx.util
Class GapInsertionDetector

java.lang.Object
  extended byedu.cmu.sphinx.util.GapInsertionDetector

public class GapInsertionDetector
extends java.lang.Object

A program that takes in a reference transcript and a hypothesis transcript and figures out how many gap insertion errors are there. The hypothesis transcript file should contain timestamps for when each word was entered and exited.

The gap insertion detection algorithm works as follows. It takes each hypothesized word individually and see whether it falls into a non-speech region in the reference transcript. If it does, that hypothesized word is counted as a gap insertion.


Constructor Summary
GapInsertionDetector(java.lang.String referenceFile, java.lang.String hypothesisFile, boolean showGapInsertions)
          Create a gap insertion detector to detect gap insertions using the given reference file and hypothesis file.
 
Method Summary
 int detect()
          Detect the gap insertion errors.
static void main(java.lang.String[] argv)
          A command line program for detecting gap insertion errors.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GapInsertionDetector

public GapInsertionDetector(java.lang.String referenceFile,
                            java.lang.String hypothesisFile,
                            boolean showGapInsertions)
                     throws java.io.IOException
Create a gap insertion detector to detect gap insertions using the given reference file and hypothesis file.

Parameters:
referenceFile - the file of references
hypothesisFile - the file of hypotheses
showGapInsertions - if true show gap insertions.
Method Detail

detect

public int detect()
           throws java.io.IOException
Detect the gap insertion errors.

Returns:
the total number of gap insertion errors
Throws:
java.io.IOException

main

public static void main(java.lang.String[] argv)
A command line program for detecting gap insertion errors. To run this program, type: java GapInsertionDetector {propsFile} {referenceFile} {hypothesisFile} The propsFile need to have only one property: edu.cmu.sphinx.util.GapInsertionDetector.showGapInsertions=true/false