sclite(1)

NAME sclite - score speech recognition system output

NOTE: This manual page was created automatically from HTMl pages in the sclite/doc directory. This manual page does not include output file examples. The author suggests using a HTML browser for reading the sclite documentation.

SYNOPSIS sclite -r reffile [ fmt ] -h hypfile [ fmt [ title ] ] OPTIONS

DESCRIPTION

The program sclite is a tool for scoring and evaluating the output of speech recognition systems. Sclite is part of the NIST SCTK Scoring Tookit. The program compares the hypothesized text (HYP) output by the speech recognizer to the correct, or reference (REF) text. After comparing REF to HYP, (a process called alignment), statistics are gathered during the scoring process and a variety of reports can be produced to summarize the performance of the recognition system. THE ALIGNMENT PROCESS

The Alignment process consists of two steps: 1) selecting matching REF and HYP texts, and 2) performing an alignment of the reference and hypothesis texts.

Step 1: Selection of matching REF and HYP texts
    Sclite accepts as input a wide variety of file formats. The type of input formats define the algorithm for selecting matching REF and HYP texts. Currently sclite uses four algorithms:

        Utterance ID Matching:
            Input reference and hypothesis files in "trn" transcript format can be aligned by either dynamic programming (DP) or GNU's "diff".

            When alignments are performed via DP, corresponding REF and HYP records with the same utterance id's are located in the REF and HYP files. DP Alignment and scoring are then performed on each pair of records. Only the utterance ID's present in the HYP file are aligned and scored. This means the REF file may contain more utterance records than the HYP.

            When "diff" is used for alignment, corresponding REF and HYP records with the same utterance id's are located in the REF and HYP files. Rather than execute "diff" for each pair of records, all matching REF and HYP pairs are re-formatted to be newline separated words and written to a temporary files. Using the two temporary files, "diff" is then called to perform a global alignment. The output of "diff" is re-chunking into REF/HYP records by applying the rule: include all words in the output stream up to and including the last word in the reference record.

            The reference file can contain extra transcripts, only needed transcripts are loaded.

        Word Time Mark Matching:
            When both the REF and HYP files are in the "ctm" format, The first step in the alignment process is to segment both the reference and hypothesis word lists by locating common areas of silence, (i.e. the absence of a word time mark). Once completed, the resulting "segments" are aligned via dynamic programming and scored as usual.

            By default, the DP alignment is performed using word-to-word distances measures of: 0, 3, 3, 4 for correct, insertions, deletions and substitutions respectively.

            Optionally, the command line flag performed using time-mediated alignments.

        Reference Segment Time Mark to Hypothesis Word Time Mark
            When the reference file format is "stm" and the hypothesis file format is "ctm", sclite chops up the hypothesis file into regions matching the reference segments. Currently, there a two methods of chopping the hypothesis file. The method is dependent on the text alignment algorithm.

            When DP alignments are performed, the hypothesis file is segmented to match the reference segments by selecting the string of hypothesized words whose times occur before the end of each reference segment. The midpoint time of a word is used to determine if the word falls within a segment. DP alignments are then performed on the selected hypothesis words and the reference segment.

            If the alignments are performed via "diff", pre-process the input reference and hypothesis texts, creating temporary reference and hypothesis files with one word per line. Then use GNU's "diff" program to perform a global alignment on the word lists. The output of "diff" is re-chunked into segments for scoring. Alternate reference transcripts can not be used with "diff" alignments.

        Reference Segment Time Mark to Hypothesis Text file
            When the reference file format "stm" and the hypothesis file format "txt" are used as inputs, the same alignment and scoring algorithm is used as describe above under the label "Reference Segment Time Mark to Hypothesis Word Time Mark" by GNU diff alignments.

Step 2: Text Alignments
    Sclite can use either of two algorithms for finding alignments between reference and hypothesis word strings. The first, and most widely accepted, uses dynamic programming (DP) and the second uses GNU's "diff", a FSF (Free Software Foundation) program for comparing text files.

    Dynamic Programming string alignment:

        The DP string alignment algorithm performs a global minimization of a Levenshtein distance function which weights the cost of correct words, insertions, deletions and substitutions as 0, 3, 3 and 4 respectively. The computational complexity of DP is 0(NN).

        When evaluating the output of speech recognition systems, the precision of generated statistics is directly correlated to the reference text accuracy. But uttered words can be coarticulated or mumbled to where they have ambiguous transcriptions, (e.i., "what are" or "what're"). In order to more accurately represent ambiguous transcriptions, and not penalize recognition systems, the ARPA community agreed upon a format for specifying alternative reference transcriptions. The convention, when used on the case above, allows the recognition system to output either transcripts, "what are" or "what're", and still be correct.

        The case above handles ambiguously spoken words which are loud enough for the transcriber to think something should be recognized. For mumbled or quietly spoken words, the ARPA community agreed to neither penalize systems which correctly recognized the word, nor penalize systems which did not. To accommodate this, a NULL word, "@", can be added to an alternative reference transcript. For example, "the" is often spoken quickly with little acoustic evidence. If "the" and "@" are alternates, the recognition system will be given credit for outputting "the" but not penalized if it does not.

        The presence of alternate transcriptions represents added computational complexity to the DP algorithm. Rather than align all alternate reference texts to the hypothesis text, then choose the lowest error rate alignment, this implementation of DP aligns two word networks, thus reducing the computational complexity from 2^(ref_alts + hyp_alts) * O(N_ref * N_hyp) to O((N_ref+ref_alts) * (N_hyp+hyp_alts)).

            For a detailed explanation of DP alignment, see TIME WARPS, STRING EDITS, AND MACROMOLECULES: THE THEORY AND PRACTICE OF SEQUENCE COMPARISON, by Sankoff and Kruskal, ISBN 0-201-07809-0.

        As noted above, DP alignment minimizes a distance function that is applied to word pairs. In addition to the "word" alignments which uses a distance function defined by static weights, the sclite DP alignment module can use two other distance functions. The first, called Time-Mediated alignment and the second called Word-Weight-Mediated alignment.

        Time-Mediated Alignment
            Time-Mediated alignment is a variation of DP alignment where word-to-word distances are based on the time of occurence for individual words. Time-mediated alignments are performed when the '<A href="options.htm#option_T_name_0">-T' option is exercised and the input formats for both the reference and hypothesis files are in "<A href="infmts.htm#ctm_fmt_name_0">ctm" format.

            Time-mediated alignments are computed by replacing the standard word-to-word distance weights of 0, 3, 3, and 4 with measures based on beginning and ending word times. The formulas for time-mediated word-to-word distances are:

                D(correct) = | T1(ref) - T1(hyp) | + | T2(ref) - T2(hyp) |
                D(insertion) = T2(hyp) - T1(hyp)
                D(deletion) = T2(ref) - T1(ref)
                D(substitution) = | T1(ref) - T1(hyp) | + | T2(ref) - T2(hyp) | + 0.001
                Distance for an Insertion or Deletion of the NULL Token '@' = 0.001

                Where,
                    T1(x) is the beginning time mark of word x
                    T2(x) is the ending time mark of word x

        Word-Weight-Mediated Alignment
            Word-weight-mediated alignment is a variation of DP alignments where word-to-word distances are based on pre-defined word-weights. Each word has a unique weight assigned to it, via either a word-weight-list file, using the <A href="options.htm#option_w_name_0">-w option, or through a language model file, using the -L option. The formulas for word-weight-mediated word-to-word distances are:

                D(correct) = 0.0
                D(insertion) = W(hyp)
                D(deletion) = W(ref)
                D(substitution) = W(hyp) + W(ref)
                Distance for and Insertion or Deletion of the NULL Token '@' = 0.001

                    Where W(x) is the weight assigned to word 'x'.

    String alignments via GNU's "diff":

        While the DP algorithm has the advantage of flexibility, it is slow for aligning large chunks of text. To address the speed concerns, an alternative string alignment module, which utilizes GNU's "diff", has been added to sclite. The sclite program pre-processes the input reference and hypothesis texts, creating temporary reference and hypothesis files with one word per line. Then GNU's "diff" program is used to perform a global alignment on the word lists and the output is re-chunked into utterances or text segments for scoring.

        Alignments can be performed with "diff" in about half the time taken for DP alignments on the standard 300 Utterance ARPA CSRNAB test set. However, in the opinion of the author, "diff" has the following bad effects:

            1. it can not accommodate transcription alternations,

            2. "diff" does not produce the same alignments as the DP alignments,

            3. there is an increase measured error rates.
THE SCORING PROCESS
    After reference and hypothesis texts have been aligned, scores are tallied for each speaker and each ref/hyp pair. After the tallies are made, a variety if output reports are generated by using the Here is a set of examples.

    The categories tallied are: Percent of correct words = # Correct words * 100 Percent of substituted words = # Substituted words * 100 Percent of inserted words = # Inserted words * 100 Percent of deleted words = # Deleted words * 100 Percent of sentence errors = # incorrect ref and hyp pairs * 100

     A variation in scoring called Weighted-Word Scoring can also be implemented by sclite. After Word-Weight-Mediated Alignment, the word weights can be tallied to produce weighted-word scores. The formulas for weighted-word scoring are very simliar to word scoring described above. The difference is rather than assume each word has the same weight, 1 in the case of word scoring, each individual word has a different weight. The word scoring formulas become: Weighted Percent of correct words = Sum of W(hyp) if correct * 100 Weighted Percent of substituted words = Sum of W(hyp) + W(ref) if substituted * 100 Weighted Percent of inserted words = Sum of W(hyp) if inserted * 100 Weighted Percent of deleted words = Sum of W(ref) if deleted * 100
        W(hyp) is the weight assigned to a hypothesis word, and W(ref) is the weight assigned to a reference word. Optionally deletable words have the default weight of 0.0.
WORD CONFIDENCE MEASURE EVALUATION
    Confidence scores for each hypothesized word were requested of the LVCSR (Large Vocabulary Speech Recognition) participants beginning with the April 1996 evaluation. Each site was asked to do its analysis of these scores which were not processed by NIST. A review meeting was held at NIST in August 1996 which resulted in a decision to apply an agreed upon standard metric.

    Confidence scores as they have been implemented are associated with each hypothesized word. (The issue has been raised whether for languages such as Mandarin, where character error rate is considered the primary measure of performance, the confidence ought to be associated with characters.) The confidence score pc, associated with a word must be in the closed interval [0,1] and presumably, given the entropy related metric defined below, in the open interval (0,1). It should represent the system's best estimate of the a posterior probability that the hypothesized word is correct. (Correct here necessarily is with respect to an alignment procedure of the reference and hypothesis word strings.)

    A single metric to use in the evaluartion of confidence scores was adopted at the August meeting. This is a normalized version of the cross entropy or mutual information. Specifically, the metric is defined as:

    Sclite will automatically detect the presence of confidence measures when reading in a hypothesis "ctm" file. When sclite detects the confidence scores, the report genererated by the options "-o sum" has an additional column containing the Normalized Cross Entropy (NCE).

    Output graphs concerning confidence estimates are generated by using the option. A variety of graphs can be created:
     DET Curve Example
     Binned Histogram Example
     Word Confidence Score Histogram Example
REVISION HISTORY
    See revision.txt in the main directory of the sclite source code directory package.
EXAMPLE USES OF SCLITE
    The sclite scoring utility was written to be used as a standard scoring tool for the ARPA speech recognition benchmark tests. Since evaluation paradigms have changed over the past several years, file formats and scoring proceedures have changed as well. This utility supports the following speech recognition benchmark tests:
        Utterance based evaluations:
            Resource Management
            ATIS (Airline Travel Information Systems):
        Found speech evaluations:
            Hub 4 - Marketplace and Broadcast News
            Hub 5 - LVCSR Switchboard
BUGS/COMMENTS
    Please contact Jon Fiscus at NIST with any bug reports or comments at the email address jonathan.fiscus@nist.gov or by phone, (301)-975-3182. Please include the version number of rover,
Sclite Commandline Options

The commandline options for sclite can be broken into four categories: Input File Options:
    -e, -h, -i, -P, -r, -R
Alignment Options:
    -c, -d, -F, -L -m, -s, -S, -T -w
Output Options:
    -f, -l, -O, -p
Scoring Report Options:
    -C, -n, -o

Input File Options:
    These options control/define the input to sclite. Input can come from either reference and hypothesis files, or piped input from previously aligned REF and HYP files.
    -e gb|euc
        Define the character encoding used for the text portion input ref and hyp files. The flag "gb" stands for GB encoded Chinese and "euc" stands for EUC encoded Japanese. Both encodings are 2-byte per character encodings. The default, is extended ASCII.

    -h hypfile [ trn | txt | ctm ] title
        The '-h' option is a required argument which specifies the input hypothesis file. The optional format field, "[ trn | txt | ctm] " specifies the input file format from the set of input formats described above. The default input format is "trn". When reports are generated, the "hypfile" name will be used to identify the origins of the results. If the "title" option is used, that string will be used instead.

         The -h option may be used more than once to align multiple files.

    -i [ wsj | atis | rm | swb | spu_id ]
        The '-i' option defines how to interpret the utterance id's used in the transcription input file format "trn" described above. This argument identifies the corpus of the utterance id:
        for Wall Street Journal and CSRNAB for ATIS3 are synonyms which refer to generic utterance id formats whereby the utterance id is made up of a speaker code, followed by a hyphen or underscore, followed by an utterance number.

        This option is only required for aligning transcript inputs (trn). TBD

    -P
        Alignments are read from 'stdin' as input to sclite. The format of the input must be in the "sgml" output format, created either by '-o sgml' or by piped input from another sclite utility. No re-alignments are performed on the read in alignments, only scoring reports can be generated.

    -r reffile [ trn | stm | ctm ]
        The '-r' option, a required argument, specifies the input reference file which the hypothesis file(s) are compared to. The optional format field "[ trn | stm | ctm ] " field specifies the input file format from the set of input formats described above. The default input format is "trn".

    -R
        Interpret the text symbols as a right-to-left language such as Arabic. The default is to interpret text in a left-to-right fashion as in English.

Alignment Options:
    -c [ NOASCII DH ]
        Chop up the words into separate characters before doing the alignment. It is generally not the practice of the ARPA community to score at the character level. The intent of this option is to be able to score Mandarin Chinese at the character level. The option "NOASCII" does not separate characters if they are ASCII. The option "DH" deletes hyphens from the ref and hyp strings before alignment. This option only works using the DP alignment algorithm. (-c & -d are exclusive)

    -d
        Use GNU diff for alignments rather than the default dynamic programming. (-c & -d are exclusive)

    -F
        Perform the alignment using a cost function which counts fragments, words ending or beginning with a hyphen, as correct if the spelling up to the hyphen matches the spelling of the hypothesized word. Options -F and -d are exclusive.

    -L LM
        Define the CMU-Cambridge Statistical Language Modeling Toolkit v2 language mode file to be 'LM'. The LM file must be created using the idngram2lm program. (See the toolkit documentation details of how to make the language model.) Currently, SCTK supports 1, 2 and 3-grams.

         The language model is used to compute an individual weight for each word in the reference and hypothesis strings. The weight is defined to be Log2(P(word|context)). Each pair of aligned strings is considered to be independent, so therefore, there is no context for initial words in each pair.

        The word-weights are used in two ways, first as a method to define word-to-word distances for word-weight-mediated alignment and second to perform weighted word scoring .

         Out-of-Vocabulary words get the default weight of 20.0, and optionally deletable words get a default weight of 0.0.

    -m [ ref | hyp ]
        When scoring a hypothesis ctm file against a reference stm file, the time spans of the two may not match, (i.e. the start time of the first word/segment may not match or the end time of the last word/segment may not match).

        When this option is used, the alignment phase of scoring ignores any segment or word (depending on the option(s) used) which is not in the time span of the opposite file. The time span of a file is defined to be start time of the first time mark, to the end time of the last time mark.

        The "ref" option reduces the reference segments to those which are within the hypothesis file time span.

        The "hyp" option reduces the hypothesis words to those which are within the reference file tiem span.

        Both "ref" and "hyp" may be used simultaneously.

        The argument -m by itself defaults to '-m ref'. Exclusive with -d.

    -s
        Do Case-sensitive alignments. Otherwise all input is mapped to a single case before scoring. Of course, GB and UEX encode text data is never case-converted.

    -S algo1 lexicon [ ASCIITOO ]
        The '-S' option performs an inferred word segmentation alignment algorithm. This option is intended to be used for the LVCSR evaluation of Mandarin Chinese. A problem with scoring Mandarin at the word level is the lack of clearly defined words in Mandari text. This option implements an algorithm which, given a word segmentation for the reference string and a "lexicon" of legal words, computes a minimal error rate word alignment. The algorithm is as follows:

          Convert the previously word-segmented reference string into a word network.
         Covert the hypothesis text to a string of characters, each character representing a word. The data represented is then convert to a network. ex. * --- A --- * --- T --- * --- 0 --- *
         Consider all possible sequences of letters through the network. If a sequence creates a word which is represented in the lexicon, add an arc to the network representing the word. The maximum characters per word is limited to the maximum word length in the lexicon.
                             ,-------- TO -------.
                            / ex. * --- A --- * --- T --- * --- 0 --- *
                                /
                 `------- AT --------'
         DP Align the reference and hypothesis networks, and extract a minimal cost path.

        The supplied "lexicon" must be a sorted list of word records, each separated by a newline. Only the first column, separated by whitespace, is read in and used for the lexicon. By default, the algorithm only separates hypothesis characters that are GB or EUC encoded. If the option "ASCIITOO" is used, ASCII hypothesis words are also converted to characters in step 2.

        Exclusive with -d.
    -S algo2 lexicon [ ASCIITOO ]
        Perform a similar algorithm as described in '-S alog1' except the roles of the reference and hypothesis transcripts are reversed. In this algorithm, the segmentation of the hypothesis text is held constant, while the reference transcript undergoes the process of of coversion to characters and arcs added to the network for words found in the lexicon. Both "lexicon" and "ASCIITOO" have the same usage as in algo1.

        Exclusive with -d.

    -T
        The '-T' option performs time-mediated string alignments rather than the traditional word alignments. Currently, only alignments involving two "ctm" files can be aligned in this manner. The main SCLITE page describes time-mediated alignments.

        Options -F and -d are exlcusive.

    -w wwl_file
        Define the word-weight list (WWL) file to be 'wwl_file'. The WWL file defines an arbitrary weight for each word in the lexicon. The weights are used in two ways, first as a method to define word-to-word distances for word-weight-mediated alignment and second to perform weighted word scoring .

         If the supplied WWL filename is "unity", then no file of weights is read in. Instead, this is a shorthand notation to use a weight of 1.0 for all words.

         Optionally deletable words get a default weight of 0.0, (even if "unity" is supplied as the WWL filename).

         The format of the WWL file is as follows.
            Comment lines begin with double semi-colons. The are two forms of "special" comment lines. The first defines heading labels each column in the table. The format for this line is:

                 ;; 'Headings' '<COL1>' '<COL2>' '<COL3>' ....

            The label for column 1 should be "Word Spelling" since this column is the word's text. The labels for columns 2 though 10 are defined by the user.

            The second "special" comment line defines the default weight applied to out-of-vocabulary words if any exist. The format for this line is:

                 ;; Default missing weight '<number>'

            The remainder of the file consists of word records, each word record separated by a newline. The format of each record is:

                 <WORD_TEXT> <WEIGHT_1> <WEIGHT_2> . . .

            There should be no whitespace at the beginning if the line, and the word texts can not include whitespace. The remainder of the line are whitespace separated floating point weights, up to a maximum of 10 weights can be assigned per word.

            NOTE: The current version of SCTK only utilizes the first weight.

Output Options:
    -f level
        As a well behaved program, reassure the user that the program is continuing to perform it's task by providing the user with some feedback. The feedback levels, defined by this option are: 0) no feedback, 1) processing feedback (i.e. status of text loading and alignments); 2) processing feedback plus printing out aligned strings. The feedback level defaults to 0 if no output options are specified using the '-o' option, otherwise it defaults to 1.
    -l width
        When printing the text alignments for the output option "pralign" wrap the lines at "width" characters. Default is 1000 characters.
    -O output_dir
        Instead of writing the output files to the directory containing the hyp file, write the files into the directory "output_dir". If the output directory does not exist, all reports will be written to stdout.
    -p
        Write to standard out the resulting alignments so they can be piped to another sclite utility. The format of the output is the same as '-o sgml'. The options sets the feedback level, with '-f' to 0.
Scoring Report Options:
    -C [ det | bhist | hist | none ]
        Defines the output formats for analysis of confidence scores. Currently, the only way to assign confidence estimates to each hyp word is through the ctm hypothesis file. Default: 'none' Examples.
    -n name
        Writes all outputs using 'name' as a root filename instead of is 'name'.'hypfile'
    -o [ sum | rsum | wws | pralign | all | sgml | stdout | lur | snt | spk | dtl | prf | none ]
        Defines the output scoring reports generated by the sclite. The possible reports are:
        Produce a summary of speaker performance in terms of Percents: Correct, Substitutions, Deletions, Insertions, Word Errors and Sentence (or Utterance) errors. System averages and speaker means, medians and standard deviations are computed for each percentage. If the report is not going to stdout, the output is placed in a file called "<hypfile>.sys". The options '-O' and '-n' can change the destination of the output file. Example Produce a summary similar to 'sum' except output word counts instead of percentages. If the report is not going to stdout, the output is placed in a file called .raw. The options '-O' and file. Example Produce a summary similar to 'sum' except output weighted word error instead of word error. If the report is not going to stdout, the output is placed in a file called .wws. The options '-O' and file. Example
        pra - Produce a text copy of all the string alignments. If the report is not going to stdout, the output is placed in a file called .pra. The options '-O' and '-n' can change the destination of the output file. "pralign" and "pra" are synonyms. Example Produce a text copy of all the string alignments similar to that produced by "pralign" except, include all relevant information concerning the alignments. That is, include in the output things like: word beginning and ending times, reference segment beginning and ending times, and hypothesis word confidence scores. Example Produces the three reports: "sum", "rsum", and pralign" Write all selected scoring reports to stdout. If the feedback level is not specified using the '-f' option, the feedback level is set to 0. Produce a dump of the text alignments in an sgml notation. The output consists of tags at the system, speaker, and sentence level. Text information is only present at the sentence level and consists a comma separated list of word alignments. The word alignments can be either of the following: C:"word" or I:"word" or D:"word" or S:"word1","word2" for correct, insertion, deletion and substitution respectively. If the report is not going to stdout, the output is placed in a file called .sgml. The options '-O' and file. Example Produce a Labeled Utterance Report (LUR) based information in the reference STM file. (Note: only reference files in STM format support this option.) The LUR report is a report which tabulates overall error rate statistics and statistics over arbitrary subsets of the reference data, e.g. speaker's sex, audio characteristics. If the report is not going to stdout, the output is placed in a file called .lur. The options '-O' and '-n' can change the destination of the output file. Example Produce a scoring report file for all utterance/segments of a speaker. Within each file, one per speaker, is a by-utterance error analysis which contains: the aligned text, error classification percentages and other statistics. If the report is not going to stdout, the output is placed in a file called output file. Example Produce a scoring report file summarizing the errors made on the speaker's utterances. Within each file, one per speaker id, is a summarization of utterance and word errors along with confusion pair, insertion, deletion, substitution and falsely recognized word lists. If the report is not going to stdout, the output is placed in a file called output file. Example Produce a scoring report in the same format as the "spk" report using statistics gathered over the entire test set. If the report is not going to stdout, the output is placed in a file called change the destination and name of the output file. Example Produce no output reports.

        If this option is not specified, the default options are "sum" and "stdout". If the user wishes to have reports other than "sum" to be written to stdout, then the "stdout" flag must be used in the argument list. Options that are duplicated, have the effect of nullification. So for instance using the options "all pralign" is equivalent to "sum rsum". Defines the output reports. Default: 'sum stdout'
        Sclite Input file formats: trn, txt, stm, ctm The inputs to "sclite" are the reference file and a hypothesis file(s), the text portions of which may be either ASCII characters or GB encoded Chinese characters. There are a number of different input formats permitted: "trn", "txt", "stm", and "ctm". As new scoring paradigms were created for the ARPA tests, accompanying formats were created to support the evaluations.

        trn - Definition of a transcript input file

            The transcript format is a file of word sequence records separated by newlines. Each record contains a word sequence, follow by the an utterance ID enclosed in parenthesis. See the '-i' option for a list of accepted utterance id types.

            example.
                she had your dark suit in greasy wash water all year (cmh_sa01)

            Transcript alternations, described above, can be used in the word sequence by using this BNF format:

                ALTERNATE :== "{" TEXT ALT+ "}"

                ALT :== "/" TEXT
                TEXT :== 1 or more whitespace separated words | "@" | ALTERNATE

            The "@" represents a NULL word in the transcript. For scoring purposes, an error is not counted if the "@" is aligned as an insertion.

            example
                i've { um / uh / @ } as far as i'm concerned

        txt - Definition of a text input file
            This format is simply free-form text with no page, paragraphs, sentence or speaker breaks.
        stm - Definition of segment time mark input file

            This describes the segment time marked files to be used for scoring the output of speech recognizers via the NIST sclite() program. This is a reference file format.

            The segment time mark file consists of a concatenation of text segment records from a waveform file. Each record is separated by a newline and contains: the waveform's filename and channel identifier [A | B], the talkers id, begin and end times (in seconds), optional subset label and the text for the segment. Each record follows this BNF format:

            STM :== <F> <C> <S> <BT> <ET> [ <LABEL> ] transcript . . .
                Where :
                    <F>
                        The waveform filename. NOTE: no pathnames or extensions are expected.
                    <C>
                        The waveform channel. The text of the waveform channel is not restricted by sclite. The text can be any text string without witespace so long as the matching string is found in both the reference and hypothesis input files.
                    <S>
                        The speaker id, no restrictions apply to this name.
                    <BT>
                        The begin time (seconds) of the segment.
                    <ET>
                        The end time (seconds) of the segment.
                    <LABEL>
                        A comma separated list of subset identifiers enclosed in angle brackets. Ex. "<O,F,00>". See "USING STM FORMAT FOR LABELED UTTERANCE REPORTS (LUR)" below.
                    transcript
                        The transcript can take on two forms: 1) a whitespace separated list of words, or 2) the string "IGNORE_TIME_SEGMENT_IN_SCORING".

                        The list of words can contain an transcript alternation using the following BNF format:

                            ALTERNATE :== "{" <text> ALT+ "}"
                            ALT :== "/" <text>
                            TEXT :== 1 thru n words | "@" | ALTERNATE

                        The "@" represents a NULL word in the transcript. For scoring purposes, an error is not counted if the "@" is aligned as an insertion.

                            Example: "i've { um / uh / @ } as far as i'm concerned"

                        When the string "IGNORE_TIME_SEGMENT_IN_SCORING" is used as the transcript, the process which chops the hypothesis file to matching reference segments ignores all hypothesis words whose time-midpoints occur within the reference segments beginning and ending time. The effect is to declare this segments regions as "out-of-bounds" for scoring, thus generation no errors from that time region.

                            NOTE: this only works with DP alignment of a referenc stm file and hypothesis ctm file.

                Example STM file:
                    ;; comment
                    2345 A 2345-a 0.10 2.03 uh huh yes i thought
                    2345 A 2345-b 2.10 3.04 dog walking is a very
                    2345 A 2345-a 3.50 4.59 yes but it's worth it

                The file must be sorted by the first and second columns in ASCII order, and the fourth in numeric order. The UNIX sort command: "sort +0 -1 +1 -2 +3nb -4" will sort the words into appropriate order.

                Lines beginning with ';;' are considered comments and are ignored. Blank lines are also ignored.

            USING STM FORMAT FOR LABELED UTTERANCE REPORTS (LUR):
                Motivation:
                    For the Fall '95 ARPA CSR Evaluation, it was desirable to not only report overall error-rate statistics but also error-rate statistics for arbitrary partitions and/or groups of partitions within the test set. To this end, the STM file format was extended to encode arbitrary subset information for each segment.
                Usage:
                    The subset information is encoded by adding two types of information into the STM file. The first information type, is a special comment line, the subset information line, (SIL). The SIL defines the subset's label id, a short column heading and a description. The special comment line format is:
                        ;; LABEL "<ID>" "<COL_HD>" "<DESC>"
                            where:
                                <ID>
                                    The subset id. Used to label each segment that belongs to the subset. The format is arbitrary, but without spaces.
                                <COL_HD>
                                    Used as column headings in generated reports. Format is arbitrary.
                                <DESC>
                                    Used for subset descriptions in generated reports. May be of arbitrary length and for- mat. Double backslashes '\' add a line feed.
                        The order of the SIL lines in the STM file defines the order of subset presentation the generated reports. The second type of information incorporated into the STM file is an optional sixth field to the text segment record. The field consists of a comma separated list of subset ids enclosed in angle brackets. Each unique id must have a special comment line, specified above, to be properly interpreted. Otherwise the id will be ignored.

                        Each position within the label field, separated by a commas, defines a group of subsets that are presented separately in the generated reports. So for instance, the first group might be all segments, and the second might be either male or female, and the third might be the story. The example below shows an STM file encoded with this information.
                            ;; LABEL "M" "Male" "Male Talkers"
                            ;; LABEL "F" "Female" "Female Talkers"
                            ;; LABEL "01" "Story 1" "Business news"
                            ;; LABEL "00" "Not in Story" "Words or Phrases not contained in a story"
                            940328 1 A 4.00 18.10 <O,F,00> FROM LOS ANGELES
                            940328 1 B 18.10 25.55 <O,M,01> MEXICO IN TURMOIL

        ctm - Definition of time marked conversation scoring input

            This describes the time marked conversation input files to be used for scoring the output of speech recognizers via the NIST sclite() program. Both the reference and hypothesis input files can share this format.

            The ctm file format is a concatenation of time mark records for each word in each channel of a waveform. The records are separated with a newline. Each word token must have a waveform id, channel identifier [A | B], start time, dura- tion, and word text. Optionally a confidence score can be appended for each word. Each record follows this BNF for- mat:

            CTM :== <F> <C> <BT> <DUR> word [ <CONF> ]
                Where :
                    <F> ->
                        The waveform filename. NOTE: no pathnames or extensions are expected.
                    <C> ->
                        The waveform channel. Either "A" or "B". The text of the waveform channel is not restricted by sclite. The text can be any text string without witespace so long as the matching string is found in both the reference and hypothesis input files.
                    <BT> ->
                        The begin time (seconds) of the word, measured from the start time of the file.
                    <DUR> ->
                        The duration (seconds) of the word.
                    <CONF> ->
                        Optional confidence score. It is proposed that this score will be used in the future.

            The file must be sorted by the first three columns: the first and the second in ASCII order, and the third by a numeric order. The UNIX sort command: "sort +0 -1 +1 -2 +2nb -3" will sort the words into appropriate order.

            Lines beginning with ';;' are considered comments and are ignored. Blank lines are also ignored.

            Included below is an example:
                ;;
                ;; Comments follow ';;'
                ;;
                ;; The Blank lines are ignored
                ;;
                7654 A 11.34 0.2 YES -6.763
                7654 A 12.00 0.34 YOU -12.384530
                7654 A 13.30 0.5 CAN 2.806418
                7654 A 17.50 0.2 AS 0.537922
                :
                7654 B 1.34 0.2 I -6.763
                7654 B 2.00 0.34 CAN -12.384530
                7654 B 3.40 0.5 ADD 2.806418
                7654 B 7.00 0.2 AS 0.537922
                :

            For CTM reference files, a format extension exists to permit marking alternate transcripts. The alternation uses the same file format as described above, except three word strings, "<ALT_BEGIN>", "<ALT>" and "<ALT_END>", are used to delimit the alternation. Each tag is treated as a word, with a conversation id, channel and "*"'s for the begin and duration time.

            The alternation is begun using the word "<ALT_BEGIN>", and terminated using the word "<ALT_END>". In between the start and end, are at least 2 alternative time-marked word sequences separated by the word "<ALT>". Each word sequence can contain any number of words. An empty alternative sig- nifies a null word.

            Below is and example alternate reference transcript for the words "uh" and "um".

                ;;
                7654 A * * <ALT_BEGIN>
                7654 A 12.00 0.34 UM
                7654 A * * <ALT>
                7654 A 12.00 0.34 UH
                7654 A * * <ALT_END>