Method for aligning text with audio signals

Abstract: In a computerized method, text segments of a text file are aligned with audio segments of an audio file. The text file includes written words, and the audio file includes spoken words. A vocabulary and language model are generated from the text segment. A word list is recognized from the audio segment using the vocabulary and language model. The word list is aligned with the text segment, and corresponding anchors are chosen in the word list and text segment. Using the anchors, the text segment and the audio segment are partitioned into unaligned and aligned segments according to the anchors. These steps are repeated for any unaligned segments until a termination condition is reached.

Description: FIELD OF THE INVENTION This invention relates generally to the processing of speech signals, and more particularly to aligning digitized text to analog spoken words. BACKGROUND OF THE INVENTION In a computerized information retrieval application, a user may desire to locate portions of an audio file, e.g., a taped radio program, that have specific content. If the retrieval application has an aligned text transcript of the audio file, then the text file can be searched using conventual text query techniques to locate the corresponding portion in the audio file. In effect, the alignment enables direct access into the audio file by words. Audio-to-text alignment can also be used to search a video file (video) when the video includes an audio stream aligned with a text transcript, e.g., the video signal is close captioned. Most known alignment methods are extensions of conventional computerized speech recognizers that operate in a very restricted mode to force recognition of the target text. Typically, the alignment is done in a left-to-right manner by moving a recognition window forward in time over the audio signals. The width of the window, measured in time, can be large enough to allow the recognizer to recover from local errors. This type of alignment is probably better characterized as "forced recognition". The problem of forced alignment is different from the problem of recognition. In the case of recognition, the words said are unknown and the task is to recognize the spoken words. With alignment, the text is known but the time alignment of the text with the spoken words of the audio stream is unknown. Therefore, methods based on forced recognition have quite a few drawbacks and limitations. For example, those methods perform poorly with noisy or other difficult audio streams, as in the case where non-speech audio signals are overlaid with the spoken words. In addition, when the audio stream is long, e.g., an hour or more, there is a very high probability of a gross error in the alignment. Because these methods are based on a single left-to-right pass over the audio stream, a single error early in the pass can cause the remaining stream to be misaligned. Furthermore, such methods might not work at all if the text does not represent the entire duration of the audio stream, but only part of it. SUMMARY OF THE INVENTION A computerized method is provided for aligning a text file with an audio file. The text file includes written words and the audio file includes spoken words. There is a one-to-one correspondence between some, but not necessarily all of the words of the text and audio files. The invention, in its broad form, resides in a computerized method and apparatus for aligning text segments of a text file with audio segments of an audio file, as recited in claims 1 and 15 respectively. As described hereinafter, a vocabulary and language model is generated from the text segment. The language model can be in the form of trigrams that indicate the relative probabilities of one, two, and three word sequences in the text segment. A word list annotated with timing information is generated by recognizing spoken words from the audio segment using the vocabulary and language model. The speech recognizer can be any standard speech recognizer that uses acoustic-phonetic models. The word list is aligned with the text segment, noting that there may be several possible alignments. Dynamic programming techniques are used to determine a best possible alignment. Anchors corresponding to best alignments of the written and spoken words are chosen, and the anchors are used to partition the text segment and the audio segment into unaligned and aligned segments. These steps are repeated on the unaligned segments until a termination condition is reached. The termination condition can be recognized as a fully aligned text and audio segments, or when a particular unaligned segment has a duration less than a predetermined threshold. In one embodiment of the invention, the vocabulary and language model is rebuilt from the unaligned segments during the next iterations. BRIEF DESCRIPTION OF THE DRAWINGS A more detailed understanding of the invention can be had from the following description of a preferred embodiment, given by way of example, and to be understood in conjunction with the accompanying drawings, wherein: Figure 1 is a block diagram of portions of text and audio files to be aligned according to a preferred embodiment of the invention; Figure 2 is a block diagram of a top-down partitioning of the text and audio file of Figure 1 into segments; Figure 3 is a flow diagram of a process to perform the alignment of the segments according to a preferred embodiment of the invention; Figure 4 is a block diagram of two possible alignments; Figure 5 is a block diagram of anchors and unaligned and aligned portions of the segments; Figure 6 is a flow diagram of adjusting the processing of the segments during successive iterations; and Figure 7 is block diagram of a speaker dependent alignment process. DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS Figure 1 shows portions of an audio file 110, and a corresponding text file 120 that are to be aligned according to the invention. The text file 120 is a full or partial transcription of the spoken words of the audio file. In practice, the content of the audio file 110 is temporally related. That is, the analog audio signals continuously move forward at a steady rate over, perhaps, several hours. Some words (long 111) may be stretched out in time to give emphasis, other words (112) may be short in duration, depending on the diction of the speaker. Words 113 may blend into each other when the speech is slurred. This makes it difficult to distinguish the end of one word and the start of another. The file 110 may also include silence and other audio signals, for example, extraneous words, music, and background noise, for which there is no corresponding text. The audio signals may also be corrupted by other channel conditions such as distortion and compression induced aberrations. In the text file 120, the characters that form the words of the text are spatially related, that is, there is no sense of time. Each character is typically stored as a fixed length digital string (a byte 121), and spatial separation between words, sentences, and maybe even paragraphs are usually clearly delineated using punctuation marks 122, e.g., the space character or period characters. The problem is to align the temporally ordered audio signals with the spatially ordered text signals as shown by arrows 130. As shown in Figure 2, in contrast with the prior art where the alignment is usually done in a serial manner, the present arrangement uses an iterative top-down "divide and conquer" technique. In the iterative process, the audio and text files 110 and 120 are each partitioned into smaller segments 201, 202, 203, 204, ...., 299, at "anchors" 200 during successive stages of the iterations. The lines of separation between segments are termed as "anchors" for purposes of this invention. The process completes, for example, when the two files are fully aligned, or when no additional anchors can be detected. Because of the inherent uncertainties of speech recognition, there may be several possible alignments for any one segment. Therefore, the possible alignments are scored, and best alignments are selected as the anchors where the files can correctly be partitioned into aligned and unaligned segments. Because the alignment is performed in a top-down manner, there is a smaller likelihood that there will be any gross misalignments. As shown in Figure 3, the preferred method 300 begins in an analyzing step 301 by processing a current text segment 310 of the text file 120 to produce a vocabulary and language model (V-LM) 320 for the text segment 310. Initially, the current segment 310 can be the entire text file 110. The V-LM 320 can be generated using standard language analyzing tools, such the one provided with the Sphinx II speech recognizer developed at the Carnegie-Mellon University. There, the language model is in the form of trigrams 321 where the relative probabilities of all one, two, three word sequences are determined taking into consideration how often these sequences occur in the text segment 310. In step 302, the corresponding segment of the audio file 330 is processed by the speech recognizer using the V-LM 320 and acoustic-phonetic models 325 to generate a word list 331 annotated with timing information 332, and possible confidence scores 333. The speech recognizer can be any standard speech recognizer. For example, the Sphinx II recognizer 203 uses Hidden Markov Modeling (HHM), however, Statistical Trajectory Modeling (STM) can also be used. The acoustic-phonetic models 325 statistically characterize acoustic-phonetic units. The acoustic-models 325 are usually trained from a training corpus. The acoustic-phonetic models 325 can, initially, be speaker independent. The word list 331 sequentially stores only the words that were actually recognized in the audio segment 330. Note in contrast with the prior art, this step 302 is performed without considering what the words might be as indicated in the text segment 310. The timing information 332 indicates, for each recognized word, the starting time and the duration of each recognized word. The confidence scores 333 indicate the degree of certainty that the word is correctly recognized. The word list 331 and the timing information 332 are not necessarily absolutely correct, that is, the recognized spoken words of the list 331 are only a "best guess" at the spoken words of the audio segment 330, as indicated by the confidence scores 333. Some words may be missed, and other words may be misinterpreted, e.g., "way" may be recognized as "weight." In step 303, the recognized word list 331 is aligned with the text segment 310. Dynamic programming, or similar techniques can be used to align the word list 331 and the text segment 310. Dynamic programming techniques that determine a best one-to-one correspondence between two lists of "tokens" are well known. Here, the tokens are spoken words and text words. As shown in Figure 4 for particular word list 401 and corresponding text segment 402, there may be several possible alignments. The dashed lines 403 indicate a one-to-one correspondence where the largest number of words are aligned. The alignment indicated by the solid lines 404 is based on preferentially aligning longer words. It is desired to chose the "best" alignments. For example, each possible alignment can be scored. The scoring of a particular alignment can increase whenever identical words are aligned, and decrease when different words are aligned. The score can be weighted to increase the score by a greater amount for "long" words, since long words probably occur at a lesser frequency. Also, long sequences of correctly aligned words can increase the score. For example, if the sequence of spoken words "there's a long way to go" in the audio segment 330 exactly match up with the corresponding portion of the text segment 310, then it is very likely that is what was actually said, and that the alignment is correct. If at another point in the alignment only the word "a" is matched up, then the correctness of the alignment is less certain. As shown in Figure 5, in step 304, alignments that are most likely to be correct are chosen as "anchors" 200 in the audio segment 330 and the text segment 310. An anchor 200 is defined a place where the spoken words of the audio segment are aligned with the written words of the text segment with a reasonable degree of confidence. In a preferred embodiment, any sequence of four words is assumed to be correct. If no such sequences exist, then the threshold can be reduced to three words, and then two. Other choices are possible, such as choosing only the longest correct sequence as an anchor, or considering total word lengths in determining the length of a correct sequence. At the same time, the anchors 200 in the text segment 310 can be annotated with the corresponding timing information derived from the audio segment 330. In step 305, the anchors 200 are used to partition the text segment 310 and the audio segment 330 into corresponding aligned segments (cross-hatched) 501 and unaligned segments 502. The starting times and durations of the segments 501 and 502 are known from the timing information used to annotate the segments. The unaligned text and audio segments 502 are reprocessed by steps 301-305 until a desired termination conditions is reached, e.g., the text and audio files are fully aligned, or no more anchors can be detected. As an option, some of the words of an anchor 200 can begin and/or terminate each unaligned segment 502 after partitioning to increase the chance that there are some words in the unaligned segment that will be correctly recognized on the next pass. Note, in each iteration, the vocabulary and language model 320 is rebuilt only from the words of that text segment, and only that particular V-LM 320 is used to recognize words in the current audio segment 330. The iterations can terminate for several reasons. One is when there are no more words to align, and hence no more sub-segments. The other is when the last iteration did not find enough aligned words, so there is nothing to be gained by a further iteration. The iterations can be stopped sooner, depending on the precision desired. For example if the alignment is needed for indexing purposes the iterations could be stopped when the duration of a segment is short enough (for example, a few seconds). Because the present method iterates over smaller and smaller unaligned segments with a more constrained vocabulary and language model, the present method is better able to overcome noise and other difficulties in the audio stream, for example, audio streams where speech and music are overlaid. In addition, the method is less likely to misalign long audio streams because a top-down approach is used, a misalignment in one segment will not influence alignment in another segment. Furthermore, the method also works when the text file does not represent the whole duration of the audio file, but only part of it. Large segments in the audio file for which there are no corresponding text segments are easily handled. Figure 6 shows the alignment and partitioning of segments over several iterations. In block 601, the words of an entire segment are unaligned. In block 602 after processing 650, the hashed portions 501 have been aligned. The unaligned portions 502 (blocks 603) are reprocessed 660 to locate further aligned portions (in blocks 604), and so forth (process 680). Block 605 shows that there are no more segments to align. As shown in Figure 6, the processing steps 301-305 can dynamically be adjusted in a number of ways during the iterations. For example, in step 610, the results of aligned portions are used to adjust the acoustic-phonetic models 325 of the recognizer 302. In effect, the recognizer 302 learns to better recognize the spoken words of a specific audio file. In other words, the aligned portions of the last pass become speech training data for the recognizer 302 so that the next pass over unaligned portions can be more robust. For example, the recognizer 302 can initially be configured to work with speaker independent models. However, as the recognizer "learns" the speech of the speaker of the words of the audio file, the speech recognition acoustic-phonetic models become more speaker dependent, i.e., "better tuned." Also, for audio files of a relatively long duration, the models can be adjusted to take into consideration channel parameters such as noise, distortion, and compression techniques used on the speech, i.e., the present method deals better with difficult audio files. As the recognizer is adjusted to improve performance, the aligner and/or anchor choser can also be adjusted in step 630 to be more or less aggressive. For example, the variables and criteria used by the dynamic programming technique of the aligner 302 can be relaxed as the recognizer improves. This means that larger sequences of aligned words will sooner be detected in subsequent iterations. Similarly, if no anchors are identified during a single pass, the unaligned portions can be reprocessed with different scoring techniques, and so forth. With the present scheme, the precision of the alignment can be dynamically adjusted to give reasonable results for a given application. As shown in Figure 7, the present technique can also be used to perform speaker identification. For example, an audio file 710 contains portions 701 spoken by a first speaker (Bob), and portions 702 spoken by a second speaker (Alice). A corresponding text file 720 is fully or partially annotated with speaker identification information, e.g., each portion of transcribed text is preceded with corresponding speaker identifications 721 and 722. Now, the recognizer 302 can develop separate acoustic-phonetic models 731 and 732 for the multiple speakers. After the models are "trained, speaker recognition can automatically be performed. This technique can also be used to perform "automatic" closed captioning. For example, a first tape of a news program is fully or partially transcribed with the "newscaster" identification as described above. After, the recognizer 302 has been trained for a particular "set" of "newscasters," subsequent video (or audio) tapes can be transcribed to generate text files without explicit identification of the speakers. The models 325 can be adjusted as the "cast" of the news program changes. In summary, the present method is a top-down iterative alignment process, and not a sequential left-to-right alignment. During each iteration on a segment, the recognizer operates on time varying signal to recognize tokens, and aligns the tokens with digital versions of the tokens. Unaligned tokens are reprocessed. This technique can also be used to align other types of signals in, for example, automatic handwriting and lip reading systems. It is understood that the above-described embodiments are simply illustrative of the principles of the invention. Various other modifications and changes may be made by those skilled in the art which will fall within the scope of the invention.

Claims: A computerized method for aligning text segments (310) of a text file with audio segments (330) of an audio file, comprising the steps of: generating (301) a vocabulary and language model (320) from the text segment (310); recognizing (302) a word list (332) from the audio segment using the vocabulary and language model; aligning (303) the word list (332) with the text segment (310); choosing corresponding "anchors" (304), defined as the lines of separation between segments, in the word list and text segment; partitioning the text segment (305) and the audio segment into unaligned and aligned segments according to the anchors; and repeating the generating, recognizing, aligning, choosing, and partitioning steps with the unaligned segments until a termination condition is reached. The method of claim 1, wherein the text segment corresponds to the entire text file, and the audio segment corresponds to the entire audio file. The method of claim 1, wherein the language model is in the form of trigrams, wherein the trigrams indicate the relative probabilities of one, two, and three word sequences in the text segment. The method of claim 1, wherein the word list includes is a sequential list of recognized spoken words of the audio segment. The method of claim 1 further including the step of annotating the word list with timing information, wherein the timing information includes the starting time and duration of each recognized spoken word. The method of claim 1, wherein the word list is recognized using acoustic-phonetic models of a speech recognizer. The method of claim 1, further including the steps of determining a plurality of possible alignments, scoring each possible alignment, and selecting a best alignment using dynamic programming, further including the step of increasing the score of a particular possible alignment when the particular possible alignment includes a longest sequence of correctly aligned words. The method of claim 5 further including the step of annotating the text segment with the timing information for correctly aligned words of the audio segment. The method of claim 1, wherein the termination condition is a fully aligned text and audio segment. The method of claim 1, wherein the termination condition is a detection of all anchors in the text and audio segments. The method of claim 1, wherein the termination condition is reached for a particular unaligned segment if the particular unaligned segment has a duration less than a predetermined threshold. The method of claim 1, wherein the unaligned segments include portions of adjacent aligned segments to increase the chance that words of the unaligned segment will be correctly recognized. The method of claim 1, wherein the vocabulary and language model is rebuilt from the unaligned segments during the next iterations. The method of claim 1, wherein the text segment corresponds to a portion of the audio segment. An apparatus for aligning text segments (310) of a text file with audio segments (330) of an audio file, comprising: means (301) for analyzing the text segment to generate a vocabulary and language model (320) for the text segment; a speech recognizer (302) for generating a word list (332) from the audio segment using the vocabulary and language model; means (303) for aligning the word list (332) with the text segment (310); means (304) for choosing corresponding anchors, defined as the lines of separation between segments, in the word list and text segment; means for partitioning (305) the text segment and the audio segment into unaligned and aligned segments according to the anchors; and means for repeating the generating, recognizing, aligning, choosing, and partitioning steps with the unaligned segments until a termination condition is reached.

Inventors: GLICKMAN OREN, JOERG CHRISTOPHER FRANK, GLICKMAN, OREN, JOERG, CHRISTOPHER FRANK
Applicants: COMPAQ COMPUTER CORP, COMPAQ COMPUTER CORPORATION
Application year: 1998
Main classification: G10L15
IPC codes: G06F17, G10L15, G06F3