US20100211378A1 - Modular approach to building large language models - Google Patents

Modular approach to building large language models Download PDF

Info

Publication number
US20100211378A1
US20100211378A1 US11/529,663 US52966306A US2010211378A1 US 20100211378 A1 US20100211378 A1 US 20100211378A1 US 52966306 A US52966306 A US 52966306A US 2010211378 A1 US2010211378 A1 US 2010211378A1
Authority
US
United States
Prior art keywords
data files
data
files
grams
text
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
US11/529,663
Other versions
US7774197B1 (en
Inventor
Ivan Ivanovich Bulyko
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Raytheon BBN Technologies Corp
Original Assignee
BBN Technologies Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by BBN Technologies Corp filed Critical BBN Technologies Corp
Priority to US11/529,663 priority Critical patent/US7774197B1/en
Assigned to BANK OF AMERICA, N.A. (SUCCESSOR BY MERGER TO FLEET NATIONAL BANK), AS AGENT reassignment BANK OF AMERICA, N.A. (SUCCESSOR BY MERGER TO FLEET NATIONAL BANK), AS AGENT PATENT AND TRADEMARK SECURITY AGREEMENT Assignors: BBN TECHNOLOGIES CORP.
Assigned to BBN TECHNOLOGIES CORP. reassignment BBN TECHNOLOGIES CORP. ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: BULYKO, IVAN
Assigned to RAYTHEON BBN TECHNOLOGIES CORP. reassignment RAYTHEON BBN TECHNOLOGIES CORP. CHANGE OF NAME (SEE DOCUMENT FOR DETAILS). Assignors: BBN TECHNOLOGIES CORP.
Application granted granted Critical
Publication of US7774197B1 publication Critical patent/US7774197B1/en
Publication of US20100211378A1 publication Critical patent/US20100211378A1/en
Active legal-status Critical Current
Adjusted expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/216Parsing using statistical methods

Definitions

  • Language models provide probabilities for sequences of words and are a primary component in most modern speech and language applications. These models are generated from a set of training data by counting the frequency of occurrence of sequences of n words in the training data (where n is an integer). Sequences of n words are referred to as n-grams. N-grams are classified based on the number of words included in the n-gram. For example, a unigram is a single word, a bigram is an ordered sequence of two words, a trigram includes three words, and a 5-gram includes five words. Because not all possible sequences of words will appear in the training data, back-off modeling techniques have been developed to assign estimated frequencies to non-appearing sequences.
  • the invention addresses the computational challenge of estimating a language model using a large data set. More particularly, according to one aspect, the invention provides a scalable solution by breaking the language model estimation process into sub-processes and parallelizing computation of various portions of the process.
  • the invention provides a method of building a language model which begins with providing a text and a first set of count files. Respective count files are associated with one or more corresponding text elements. A series of consecutive text elements is selected from the text to form an n-gram. The n-gram is assigned to one or more count files of the first set of count files based on the presence of a selected text element in the n-gram.
  • the process of assigning the n-gram to a count file includes, for example, increasing a count corresponding to the n-gram.
  • the method may further include computing probability estimates for the n-grams assigned to the count files.
  • the series of consecutive text elements used to form the n-gram includes a current text element and a history of text elements.
  • the selected text element i.e. the text element used to assign the n-gram to a count file, is the most recent text element in the history, where the history includes the text elements which occurred prior to the current text element.
  • a predetermined number of the history text elements are included. For example, trigrams from the phrase “see Spot run to Jane” include “see Spot run”, “Spot run to”, and “run to Jane”. The last element of each trigram is the current text element (i.e.
  • a text element may be a word, a comma, a period, a beginning-of-sentence marker, an end-of-sentence marker, or any other grammatical or formatting element.
  • the n-grams are derived from text elements in the text.
  • the series of text elements may comprise a single text element, and thus the n-gram is a unigram.
  • unigrams are assigned to more than one count file of a set of count files.
  • unigrams are assigned to each of the count files.
  • the n-gram may be a bigram, a trigram, a four-gram, a five-gram, a six-gram, a seven-gram, and eight-gram, or longer than an eight-gram.
  • the method includes merging the first set of count files to a single count file.
  • the method may also include a second set of count files, and each count file of the second set of count files may correspond to a respective count file of the first set of count files.
  • the method includes merging, in parallel, each count file of the first set of count files with each of the respective count files of the second set of count files.
  • the second set of count files in one embodiment, are populated with n-grams derived from a second text.
  • the method includes generating a language model from the first set of count files.
  • the invention provides a method of building a language model.
  • the method includes providing a first language model comprising a first set of data files and a second language model comprising a second set of data files.
  • the language models are then merged in parallel.
  • providing language model includes calculating a plurality of probabilities related to the likelihood of selected n-grams and storing the plurality of probabilities in data files corresponding to the language model.
  • the data files are language model subsets.
  • the method includes generating a combined language model.
  • the combined language model is generated by merging respective data files of the first language model with corresponding data files of the second language model.
  • the corresponding data files are merged in parallel.
  • merging respective ones of the first set of data files with corresponding ones of the second set of data files includes interpolating corresponding probability measurements.
  • each of the first set of data files is associated with a set of text elements
  • each of the corresponding second set of data files is associated with the same set of text elements.
  • the set of text elements may include words, commas, periods, beginning-of-sentence markers, end-of-sentence markers, and other grammatical and formatting elements.
  • the data files of the first set of data files and the data files of the second set of data files store probability measurements.
  • the probability measurements indicate the probability of occurrence of various selected n-grams.
  • a smoothing algorithm is used to assign probability estimates to additional n-grams that are not present in the data files.
  • back-off weights are calculated to assign probability estimates to a second set of n-grams that are not present in the data files.
  • merging respective data files of the first set of data files with corresponding data files of the second set of data files results in a set of merged data files.
  • Respective data files of the set of merged data files may then be pruned.
  • the respective data files may be pruned in parallel.
  • FIG. 1 is a block diagram of a prior art method of generating counts used in language models.
  • FIG. 2 is a block diagram of a method of generating counts according to an illustrative embodiment the invention.
  • FIG. 3 is a block diagram of a method of generating count files.
  • FIG. 4 is a block diagram of an exemplary count file.
  • FIG. 5 is a block diagram of two exemplary count files being combined into a merged count file.
  • FIG. 6 is a block diagram of a prior art method of generating a language model.
  • FIG. 7 is a block diagram of a method of generating a language model according to an illustrative embodiment of the invention.
  • Each corpus usually includes text data of a particular origin. For example, one corpus may include text taken from several years of Wall Street Journal newspapers. Another corpus may be transcribed speech from recorded telephone conversations. Each corpus may be used to build an independent language model, and these language models may be combined to form a larger, more accurate, language model.
  • n-gram counts are collected.
  • An n-gram is a particular series of n text elements.
  • An n-gram count is the number of occurrences of that n-gram observed in a corpus of text.
  • n-gram probabilities are estimated from the n-gram counts. N-gram probabilities are typically noted in the form p(w c
  • FIG. 1 is a block diagram of a prior art method 100 of generating n-gram counts.
  • the method 100 begins with a plurality of text files 102 a - 102 m.
  • the n-grams (usually unigram, bigrams, and/or trigrams) occurring in the text files 102 a - 102 m are counted (step 104 a - 104 m ), resulting in n-gram counts 106 a - 106 m.
  • the n-gram counts 106 a - 106 m are merged (step 110 ), resulting in a merged n-gram count 112 .
  • Merged n-gram count 112 includes the total number of occurrences of the n-grams observed in the combined set of text files 102 a - 102 m. According to this method, the individual n-gram counts 106 a - 106 m are serially merged to the merged n-gram count 112 .
  • FIG. 2 is a block diagram of a method 200 of generating counts according to an illustrative embodiment of the invention.
  • the method 200 begins with the provision of a plurality of text files 202 a - 202 m.
  • Each text file 202 a may be an independent training corpus, or it may be a portion of a larger training corpus, which has been split into m files.
  • the text files 202 a - 202 m are used to generate a set of k skeleton count files 204 a - 204 k, as explained in greater detail with respect to FIG. 3 .
  • Each skeleton count file 204 a - 204 k is associated with one or more text elements from the text files 202 a - 202 m.
  • a text element associated with a particular skeleton count file is referred to herein as an “assigned element.”
  • n-gram counts 210 a - 210 m For each text file 202 a - 202 m, occurrences of n-grams in the text files 202 a - 202 m are counted ( 208 a - 208 m ) resulting in n-gram counts 210 a - 210 m.
  • Each n-gram count 210 a - 210 m includes k count files, such as count files 212 a - 212 k, generated from text file 202 a, and 214 a - 214 k, generated from text file 202 m.
  • the count files 212 a - 212 k and 214 a - 214 k correspond to the previously generated skeleton count files 204 a - 204 k.
  • Each count file 212 a - 212 k and 214 a - 214 k includes a subset of the n-gram counts 210 a - 210 m.
  • the subset of a particular count file 212 a - 212 k and 214 a - 214 k is based on the assigned elements of a corresponding skeleton count file 204 a - 204 k.
  • a count file includes the counts of all n-grams in which the most recent element in the history of an n-gram is one of the count file's assigned elements. For example, n-grams (*
  • Respective count files 212 a - 212 k and 214 a - 214 k of the n-gram counts 210 a - 210 m, generated from the various text files 202 a - 202 m, include counts of corresponding n-grams.
  • the n-gram counts included in count file 212 a correspond to the n-gram counts of count file 214 a, since both count files 212 a and 214 a have the same set of assigned elements, and all n-grams from the respective text files 202 a and 202 m having one of the assigned elements as the most recent history element are included in the respective count file 212 a and 214 a.
  • the n-gram counts included in count file 212 b correspond to the n-gram counts of count file 214 b.
  • the n-gram counts included in count file 212 k correspond to the n-gram counts of count file 214 k.
  • the count files may include a count of all unigrams in the corresponding text file.
  • the n-gram counts 210 a - 210 m from the text files 202 a - 202 m are merged in parallel at 218 a - 218 k by merging each count file 212 a - 214 k with the respective corresponding count files 212 a - 214 k of the n-gram counts 210 a - 210 m.
  • count file 212 a is merged with 214 a at 218 a, in parallel with the merger of count file 212 b with 214 b at 218 b, and count file 212 k with 214 k at 218 k. This process results in the merged count 220 , having merged count files 222 a - 222 k.
  • the method 200 is performed on a conventional computer system having a processor, non-volatile storage (e.g. a hard drive or optical drive), and random access memory (RAM).
  • the method 200 is performed on a personal computer with an Intel Pentium 4 (3 GHz) processor, 1 GB of RAM and a 200 GB hard drive.
  • the skeleton count files 204 a - 204 k are generated such that the count files 212 a - 214 k are small enough such that the computer system can perform the merging in steps 218 a - 218 k without accessing the non-volatile storage of the computer system. Since corresponding count files (e.g.
  • 212 a and 214 a are merged independent of other count files ( 212 b - 212 k and 214 b - 214 k ), during merging, only one set of corresponding count files (e.g. 212 a through 214 a ) needs to be uploaded to RAM at a time, while the other count files (e.g. 212 b - 212 k through 214 b - 214 k ) may be stored in non-volatile storage. Performing the merging step 218 in RAM increases efficiency and requires far less RAM than merging all n-gram counts at the same time.
  • Previous n-gram counting methods stored counts for all n-grams in a single data file. As this file can grow in size rapidly, such methods have often required pruning the count files (discarding the least-frequent n-grams) prior to estimating a language model to decrease count file size to fit into system RAM. By enabling the merging in steps 218 a - 218 k to occur without pruning, the method 200 prevents the decrease in accuracy inherent in prior language model creation methods.
  • FIG. 3 is a block diagram of a method 300 of generating k skeleton count files 310 a - 310 k from m text files 302 a - 302 m.
  • Text elements 304 a - 304 x are assigned to the skeleton count files 310 a - 310 k as described in relation to FIG. 2 , resulting in lists of assigned elements.
  • the number k of skeleton count files 310 a - 310 k may be determined based on the amount of RAM available in the computer system. In various embodiments, about 10, about 25, about 50, about 75, about 100, about 150, about 200, about 250, or about 300 count files are used.
  • the total number of occurrences of each text element 304 a - 304 x in the text files 302 a - 302 m is counted yielding counts 306 a - 306 x.
  • the counts 306 a - 306 x are stored in memory with the corresponding text elements 304 a - 304 x.
  • counts 306 a - 306 x are generated from a representative sample of text from one or more of the text files. For example, w 1 may occur 3 times, w 2 may occur 96 times, w 3 may occur 32 times, and w x may occur 58 times.
  • the text elements 304 a - 304 x are divided among the plurality of skeleton count files 310 a - 310 k.
  • text element 304 a may be assigned to skeleton count file 310 c and text element 304 c may be assigned to skeleton count file 310 a, etc.
  • the text elements 304 a - 304 x associated with each skeleton count file 310 a - 310 k preferably are assigned such that the count files that are derived from the skeleton count files 310 a - 310 k (e.g. the count files 212 a - 214 k of FIG.
  • the count data into count files of approximately equal size allows an even distribution of computational load among the merging processes 218 .
  • the approximate distribution is achieved by round-robin assignment of text elements. For example, the text element with the highest count is assigned to the first count file 310 a, the text element with the second highest count is assigned to the second count file 310 b, and so forth, with text element k+1 assigned back to the first count file 310 a.
  • Factors other than the number of times a text element occurs may contribute to the assignment of a text element to a skeleton count file.
  • the number of different text elements that may precede a selected text element may contribute to the assignment of the selected text element to a skeleton count file, with text elements that may be preceded by a large number of different text elements spread evenly among the skeleton count files 310 a - 310 k.
  • any text element that does not have an explicit assignment is automatically mapped to a special “catch-all” skeleton file. Even though the number of such text elements can be large (i.e. all text elements that did not occur in the text files 302 a - 302 m that were used for extracting the assigned elements), these elements are likely to be infrequent and, hence, will not be a big factor in memory usage.
  • FIG. 4 is a block diagram of an exemplary count file 400 generated, for example, from text file 202 a.
  • the exemplary count file 400 includes the counts 410 a - 410 c, 414 a - 414 c and 418 a - 418 c.
  • Counts 410 a - 410 c, etc. correspond to n-grams 408 a - 408 c (bigrams), 412 a - 412 c (trigrams) and 416 a - 416 c (trigrams).
  • the count file 400 also includes combined counts 404 a - 404 c of all unigrams 402 a - 402 c from a text file (e.g. text file 202 a of FIG. 2 ).
  • One of the text elements assigned to count file 400 is the word “Spot.”
  • the bigrams 408 a - 408 c have “Spot” as the most recent text element in their history.
  • Each bigram 408 a - 408 c includes a current element which occurred after the word “Spot,” such as run ( 408 a ), jump ( 408 b ), and beg ( 408 c ).
  • Spot) was incremented by one.
  • the text file from which the count file 400 was populated included the word “Spot” followed by the word “run” 25 times ( 410 a ). “Spot” was followed by the word “jump” 20 times ( 410 b ), and was followed by the word “beg” 5 times ( 410 c ).
  • the count file 400 also includes trigrams 412 a - 412 c and 416 a - 416 c. These trigrams 412 a - 412 c and 416 a - 416 c also have “Spot” as the most recent history element. They further include the element which occurred before “Spot” in the text file. For example, in the trigrams 412 a - 412 c, “Spot” is preceded by “see.” Again, various words may occur after “Spot,” including for example “run” ( 412 a ), “jump” ( 412 b ), and “beg” ( 412 c ).
  • these trigrams represent the phrases “see Spot run,” which occurs 8 times ( 414 a ) in the input text file, “see Spot jump,” which occurs 10 times ( 414 b ) in the input text file, and “see Spot beg,” which occurs twice ( 414 c ) in the input text file.
  • “Spot” is preceded by the word “watch.”
  • These trigrams represent the phrases “watch Spot run,” which occurs 6 times ( 418 a ) in the input text file, “watch Spot jump,” which occurs 4 times ( 418 b ) in the input text file, and “watch Spot beg,” which occurs once ( 418 c ) in the input text file.
  • FIG. 5 is a functional block diagram of a method of merging two exemplary count files 502 and 504 .
  • the count files 502 and 504 are derived from two different text files, but were populated using the same list of assigned elements. Identical n-grams from the count files 502 and 504 are combined by adding their respective counts.
  • Spot) of the count file 502 is identical to the bigram 518 a (run
  • the counts 514 b and 520 b of the bigrams 512 b and 518 b are added to result in the combined count 524 b for the bigram 522 b
  • the counts 514 c and 520 c of the bigram 512 c and 518 c are added to result in the combined count 524 c for the bigram 522 c.
  • N-grams unique to each text file are added to the merged count file 506 .
  • the corresponding count files of all the text files of a corpus are preferably merged in parallel.
  • occurrence probability estimates are calculated for each n-gram to generate a language model.
  • a language model includes a set of probabilities that a particular n-gram will occur in a previously unanalyzed input file (an occurrence probability).
  • Smoothing and/or back-off algorithms are used to assign probabilities to n-grams that either were not observed in the training data or were discarded due to model size constraints, and to adjust the occurrence probabilities of the observed and saved n-grams accordingly. Smoothing provides a “smooth” (or “discounted”) probability estimate to the observed n-grams.
  • the back-off algorithm is used to compute probabilities of unseen n-grams.
  • w i ⁇ 1 , . . . , w i ⁇ n+1 ) p ′( w i
  • Equation 1 Computing n-gram probabilities by interpolating with lower order estimates.
  • Knesser-Ney smoothing algorithm One example smoothing algorithm suitable for this calculation is the Knesser-Ney smoothing algorithm.
  • Another example of a popular smoothing algorithm is the Witten-Bell smoothing algorithm.
  • a back-off algorithm which can be combined with smoothing, allows lower order estimates p(w i
  • the lower order estimates are scaled with the corresponding back-off weight bow(w i ⁇ 1 , . . . , w i ⁇ n+1 ).
  • the back-off weights are chosen such that the overall model is normalized, i.e. occurrence probabilities for every n-gram context sum to 1. This can be achieved by using equation 2:
  • Estimation ⁇ ⁇ of ⁇ ⁇ a ⁇ ⁇ back ⁇ - ⁇ off ⁇ ⁇ weight ⁇ ⁇ for ⁇ ⁇ a ⁇ ⁇ given ⁇ ⁇ ⁇ context ⁇ ⁇ involves ⁇ ⁇ summing ⁇ ⁇ over ⁇ ⁇ all ⁇ ⁇ ⁇ probabilities ⁇ ⁇ found ⁇ ⁇ in ⁇ ⁇ that ⁇ ⁇ context ⁇ ⁇ as ⁇ ⁇ well ⁇ ⁇ ⁇ as ⁇ ⁇ ⁇ he ⁇ ⁇ corresponding ⁇ ⁇ lower ⁇ - ⁇ order ⁇ ⁇ estimates .
  • the language model described herein includes the probability estimates derived directly from the counts and also those derived from the smoothing and back-off algorithms described above.
  • FIG. 6 is a functional block diagram of a prior art method 600 of generating a language model 620 from multiple training corpora.
  • Prior art language models have been trained using more than one input text corpus.
  • the method generates a set of pruned merged counts 602 a - 602 n for each input text corpus, as described in FIG. 1 .
  • the pruned merged counts 602 a - 602 n are used to estimate language models (steps 604 a - 604 n ).
  • the language models 602 a - 602 n are estimated using n-gram probability estimates derived directly from the merged counts 602 a - 602 n, as well as those derived using smoothing and back-off algorithms to assign probabilities to unobserved or pruned n-grams.
  • a common strategy is to build separate language models 606 a - 606 n from each corpus and then combine these models via linear interpolation (step 610 ). To perform interpolation, the probability of a word w i given context h is computed as a linear combination of the corresponding n-gram probabilities from the corpus language models 606 a - 606 n :
  • p ⁇ ( w i ⁇ h ) ⁇ s ⁇ ⁇ 606 ⁇ a , ... ⁇ , 606 ⁇ n ⁇ ⁇ ⁇ s ⁇ p s ⁇ ( w i ⁇ h )
  • the resulting interpolated language model 612 may then be pruned (step 618 ), e.g. using the entropy criterion (S. Chen and J. Goodman, “An empirical study of smoothing techniques for language modeling”, Center for Research in Computing Technologies, Harvard University, 1998), to meet specific model size requirements. This results in the final pruned language model 620 .
  • interpolation of several models 606 a - 606 n may exceed the computer's physical memory, and thus each model 606 a - 606 n is pruned prior to interpolation.
  • FIG. 7 is a functional block diagram of a method 700 of generating a language model according to an illustrative embodiment of the present invention.
  • the method 700 provides a means for creating large interpolated language models without requiring pruning prior to interpolation.
  • the method 700 begins with the provision or generation of merged counts 702 a - 702 n.
  • Each merged count includes k merged count files 704 a - 704 k and 706 a - 706 k, which are substantially the same as the merged count files 222 a - 222 k of FIG. 2 .
  • Corpus language models 712 a - 712 n are generated in parallel at step 708 for each of the merged counts 702 a - 706 k.
  • Each corpus language model 712 a - 712 n includes k corpus language model subsets.
  • Each corpus language model subset 714 a - 716 k corresponds to a merged count file 704 a - 706 k.
  • the corpus language model 712 a includes the corpus language model subsets 714 a - 714 k
  • the corpus language model 712 n includes the corpus language model subsets 716 a - 716 k.
  • the language model subsets 714 a - 716 k are generated for each merged count using the methodology described above, treating each merged count file 704 a - 706 k as an individual merged count.
  • the next step in the method 700 is interpolation of the corpus language models 712 a - 712 n (step 718 ).
  • Each of the corresponding corpus language model subsets 714 a - 716 a, 714 b - 716 b, and 714 k - 716 k are interpolated in k parallel interpolation processes 720 a - 720 k.
  • the interpolation results in an interpolated language model 722 comprising k interpolated language model subsets 724 a - 724 k.
  • the interpolated language model 722 is pruned (step 728 ) by pruning each of the interpolated language model subsets 724 a - 724 k.
  • the resulting language model for example the interpolated language model 722 or the pruned language model 732 , may be stored either as k individual language model subset files, or combined into a single file.

Abstract

Methods for building arbitrarily large language models are presented herein. The methods provide a scalable solution to estimating a language model using a large data set by breaking the language model estimation process into sub-processes and parallelizing computation of various portions of the process.

Description

    GOVERNMENT CONTRACT
  • The U.S. Government has a paid-up license in this invention and the right in limited circumstances to require the patent owner to license others on reasonable terms as provided for by the terms of Contract No. NBCHC030014 awarded by DARPA IAO.
  • BACKGROUND
  • Language models provide probabilities for sequences of words and are a primary component in most modern speech and language applications. These models are generated from a set of training data by counting the frequency of occurrence of sequences of n words in the training data (where n is an integer). Sequences of n words are referred to as n-grams. N-grams are classified based on the number of words included in the n-gram. For example, a unigram is a single word, a bigram is an ordered sequence of two words, a trigram includes three words, and a 5-gram includes five words. Because not all possible sequences of words will appear in the training data, back-off modeling techniques have been developed to assign estimated frequencies to non-appearing sequences.
  • Many such applications, in particular, automatic speech recognition (ASR) and machine translation (MT), have evolved over the past decade, offering high performance and usability. Today, despite extensive research on novel approaches, the standard back-off n-gram language model remains the model of choice in most applications due to its efficiency and reliability. Significant gains in performance are achieved by utilizing larger amounts of training data available for language modeling. However, very large data sets (e.g. data sets including billions of words) pose a computational challenge where one must be able to estimate billions of parameters. Systems and methods are needed for reducing the memory requirements of language models without reducing model accuracy.
  • SUMMARY
  • The invention, in various embodiments, addresses the computational challenge of estimating a language model using a large data set. More particularly, according to one aspect, the invention provides a scalable solution by breaking the language model estimation process into sub-processes and parallelizing computation of various portions of the process.
  • According to one aspect, the invention provides a method of building a language model which begins with providing a text and a first set of count files. Respective count files are associated with one or more corresponding text elements. A series of consecutive text elements is selected from the text to form an n-gram. The n-gram is assigned to one or more count files of the first set of count files based on the presence of a selected text element in the n-gram.
  • The process of assigning the n-gram to a count file includes, for example, increasing a count corresponding to the n-gram. The method may further include computing probability estimates for the n-grams assigned to the count files.
  • In one embodiment, the series of consecutive text elements used to form the n-gram includes a current text element and a history of text elements. The selected text element, i.e. the text element used to assign the n-gram to a count file, is the most recent text element in the history, where the history includes the text elements which occurred prior to the current text element. In constructing an n-gram, a predetermined number of the history text elements are included. For example, trigrams from the phrase “see Spot run to Jane” include “see Spot run”, “Spot run to”, and “run to Jane”. The last element of each trigram is the current text element (i.e. “run”, “to”, and “Jane”, respectively), and the second-to-last element being the most recent history element (i.e. “Spot”, “run”, and “to”, respectively). The trigrams may be denoted as (run|Spot, see), (to|run, Spot), and (Jane|to, run), respectively. Note that a text element may be a word, a comma, a period, a beginning-of-sentence marker, an end-of-sentence marker, or any other grammatical or formatting element. The n-grams are derived from text elements in the text.
  • In one embodiment, the series of text elements may comprise a single text element, and thus the n-gram is a unigram. In some implementations, unigrams are assigned to more than one count file of a set of count files. In one example, unigrams are assigned to each of the count files. In other embodiments, the n-gram may be a bigram, a trigram, a four-gram, a five-gram, a six-gram, a seven-gram, and eight-gram, or longer than an eight-gram.
  • According to one implementation, the method includes merging the first set of count files to a single count file. The method may also include a second set of count files, and each count file of the second set of count files may correspond to a respective count file of the first set of count files. In one embodiment, the method includes merging, in parallel, each count file of the first set of count files with each of the respective count files of the second set of count files. The second set of count files, in one embodiment, are populated with n-grams derived from a second text. According to various implementations, the method includes generating a language model from the first set of count files.
  • According to another aspect, the invention provides a method of building a language model. The method includes providing a first language model comprising a first set of data files and a second language model comprising a second set of data files. The language models are then merged in parallel.
  • In one embodiment, providing language model includes calculating a plurality of probabilities related to the likelihood of selected n-grams and storing the plurality of probabilities in data files corresponding to the language model. According to one embodiment, the data files are language model subsets.
  • According to one feature, the method includes generating a combined language model. The combined language model is generated by merging respective data files of the first language model with corresponding data files of the second language model. The corresponding data files are merged in parallel. In one embodiment, merging respective ones of the first set of data files with corresponding ones of the second set of data files includes interpolating corresponding probability measurements.
  • In one implementation, each of the first set of data files is associated with a set of text elements, and each of the corresponding second set of data files is associated with the same set of text elements. According to one embodiment, the set of text elements may include words, commas, periods, beginning-of-sentence markers, end-of-sentence markers, and other grammatical and formatting elements.
  • In one implementation, the data files of the first set of data files and the data files of the second set of data files store probability measurements. The probability measurements indicate the probability of occurrence of various selected n-grams. In one implementation, a smoothing algorithm is used to assign probability estimates to additional n-grams that are not present in the data files. In some implementations, either instead of or in addition to a smoothing algorithm, back-off weights are calculated to assign probability estimates to a second set of n-grams that are not present in the data files.
  • According to one implementation, merging respective data files of the first set of data files with corresponding data files of the second set of data files results in a set of merged data files. Respective data files of the set of merged data files may then be pruned. According to one feature, the respective data files may be pruned in parallel.
  • BRIEF DESCRIPTION OF THE DRAWINGS
  • The foregoing and other objects and advantages of the invention will be appreciated more fully from the following further description thereof, with reference to the accompanying drawings. These depicted embodiments are to be understood as illustrative of the invention and not as limiting in any way.
  • FIG. 1 is a block diagram of a prior art method of generating counts used in language models.
  • FIG. 2 is a block diagram of a method of generating counts according to an illustrative embodiment the invention.
  • FIG. 3 is a block diagram of a method of generating count files.
  • FIG. 4 is a block diagram of an exemplary count file.
  • FIG. 5 is a block diagram of two exemplary count files being combined into a merged count file.
  • FIG. 6 is a block diagram of a prior art method of generating a language model.
  • FIG. 7 is a block diagram of a method of generating a language model according to an illustrative embodiment of the invention.
  • Throughout the figures, the characters c, k, n, m and x are used in the reference numbers. These characters may represent any selected integer, with the same character representing the same selected integer throughout the figures.
  • DETAILED DESCRIPTION OF THE DRAWINGS
  • To provide an overall understanding of the invention, certain illustrative embodiments will now be described, including systems, methods and devices for building arbitrarily large language models. However, it will be understood by one of ordinary skill in the art that the systems and methods described herein can be adapted and modified for other suitable applications and that such other additions and modifications will not depart from the scope hereof.
  • Large language models are generally built using several corpora of data. Each corpus usually includes text data of a particular origin. For example, one corpus may include text taken from several years of Wall Street Journal newspapers. Another corpus may be transcribed speech from recorded telephone conversations. Each corpus may be used to build an independent language model, and these language models may be combined to form a larger, more accurate, language model.
  • Building large language models from text data typically involves two steps. First, n-gram counts are collected. An n-gram is a particular series of n text elements. An n-gram count is the number of occurrences of that n-gram observed in a corpus of text. Next, n-gram probabilities are estimated from the n-gram counts. N-gram probabilities are typically noted in the form p(wc|wh) and denote the probability of a current word wc appearing next given a history of previous words wh.
  • FIG. 1 is a block diagram of a prior art method 100 of generating n-gram counts. The method 100 begins with a plurality of text files 102 a-102 m. For each text file 102 a-102 m, the n-grams (usually unigram, bigrams, and/or trigrams) occurring in the text files 102 a-102 m are counted (step 104 a-104 m), resulting in n-gram counts 106 a-106 m. Next, the n-gram counts 106 a-106 m are merged (step 110), resulting in a merged n-gram count 112. Merged n-gram count 112 includes the total number of occurrences of the n-grams observed in the combined set of text files 102 a-102 m. According to this method, the individual n-gram counts 106 a-106 m are serially merged to the merged n-gram count 112.
  • FIG. 2 is a block diagram of a method 200 of generating counts according to an illustrative embodiment of the invention. The method 200 begins with the provision of a plurality of text files 202 a-202 m. Each text file 202 a may be an independent training corpus, or it may be a portion of a larger training corpus, which has been split into m files. The text files 202 a-202 m are used to generate a set of k skeleton count files 204 a-204 k, as explained in greater detail with respect to FIG. 3. Each skeleton count file 204 a-204 k is associated with one or more text elements from the text files 202 a-202 m. A text element associated with a particular skeleton count file is referred to herein as an “assigned element.”
  • For each text file 202 a-202 m, occurrences of n-grams in the text files 202 a-202 m are counted (208 a-208 m) resulting in n-gram counts 210 a-210 m. Each n-gram count 210 a-210 m includes k count files, such as count files 212 a-212 k, generated from text file 202 a, and 214 a-214 k, generated from text file 202 m. The count files 212 a-212 k and 214 a-214 k correspond to the previously generated skeleton count files 204 a-204 k. Each count file 212 a-212 k and 214 a-214 k includes a subset of the n-gram counts 210 a-210 m. The subset of a particular count file 212 a-212 k and 214 a-214 k is based on the assigned elements of a corresponding skeleton count file 204 a-204 k. A count file includes the counts of all n-grams in which the most recent element in the history of an n-gram is one of the count file's assigned elements. For example, n-grams (*|wi−1), (*|wi−1, wi−2), . . . , (*|wi−1, . . . , wi−n+2), where * denotes a current word, wi−1 denotes the immediately preceding word, wi−2 denotes the word preceding word wi−1, etc., are added to the same count file, since they share the most recent history element wi−1. If an n-gram is not currently present in a count file, the n-gram is added to the file and given a count of one, while if the n-gram is already present in the count file, the count is increased by one. Respective count files 212 a-212 k and 214 a-214 k of the n-gram counts 210 a-210 m, generated from the various text files 202 a-202 m, include counts of corresponding n-grams. For example, the n-gram counts included in count file 212 a correspond to the n-gram counts of count file 214 a, since both count files 212 a and 214 a have the same set of assigned elements, and all n-grams from the respective text files 202 a and 202 m having one of the assigned elements as the most recent history element are included in the respective count file 212 a and 214 a. Similarly, the n-gram counts included in count file 212 b correspond to the n-gram counts of count file 214 b. And, the n-gram counts included in count file 212 k correspond to the n-gram counts of count file 214 k. Additionally, the count files may include a count of all unigrams in the corresponding text file.
  • The n-gram counts 210 a-210 m from the text files 202 a-202 m are merged in parallel at 218 a-218 k by merging each count file 212 a-214 k with the respective corresponding count files 212 a-214 k of the n-gram counts 210 a-210 m. For example, count file 212 a is merged with 214 a at 218 a, in parallel with the merger of count file 212 b with 214 b at 218 b, and count file 212 k with 214 k at 218 k. This process results in the merged count 220, having merged count files 222 a-222 k.
  • According to various embodiments, the method 200 is performed on a conventional computer system having a processor, non-volatile storage (e.g. a hard drive or optical drive), and random access memory (RAM). In one example, the method 200 is performed on a personal computer with an Intel Pentium 4 (3 GHz) processor, 1 GB of RAM and a 200 GB hard drive. As described further in reference to FIG. 3, the skeleton count files 204 a-204 k are generated such that the count files 212 a-214 k are small enough such that the computer system can perform the merging in steps 218 a-218 k without accessing the non-volatile storage of the computer system. Since corresponding count files (e.g. 212 a and 214 a) are merged independent of other count files (212 b-212 k and 214 b-214 k), during merging, only one set of corresponding count files (e.g. 212 a through 214 a) needs to be uploaded to RAM at a time, while the other count files (e.g. 212 b-212 k through 214 b-214 k) may be stored in non-volatile storage. Performing the merging step 218 in RAM increases efficiency and requires far less RAM than merging all n-gram counts at the same time.
  • Previous n-gram counting methods stored counts for all n-grams in a single data file. As this file can grow in size rapidly, such methods have often required pruning the count files (discarding the least-frequent n-grams) prior to estimating a language model to decrease count file size to fit into system RAM. By enabling the merging in steps 218 a-218 k to occur without pruning, the method 200 prevents the decrease in accuracy inherent in prior language model creation methods.
  • FIG. 3 is a block diagram of a method 300 of generating k skeleton count files 310 a-310 k from m text files 302 a-302 m. Text elements 304 a-304 x are assigned to the skeleton count files 310 a-310 k as described in relation to FIG. 2, resulting in lists of assigned elements. The number k of skeleton count files 310 a-310 k may be determined based on the amount of RAM available in the computer system. In various embodiments, about 10, about 25, about 50, about 75, about 100, about 150, about 200, about 250, or about 300 count files are used. To assign the text elements 304 a-304 x, in one illustrative embodiment, the total number of occurrences of each text element 304 a-304 x in the text files 302 a-302 m is counted yielding counts 306 a-306 x. The counts 306 a-306 x are stored in memory with the corresponding text elements 304 a-304 x. Alternatively, counts 306 a-306 x are generated from a representative sample of text from one or more of the text files. For example, w1 may occur 3 times, w2 may occur 96 times, w3 may occur 32 times, and wx may occur 58 times. Depending in part upon the text element counts 306 a-306 x, the text elements 304 a-304 x are divided among the plurality of skeleton count files 310 a-310 k. For example, text element 304 a may be assigned to skeleton count file 310 c and text element 304 c may be assigned to skeleton count file 310 a, etc. The text elements 304 a-304 x associated with each skeleton count file 310 a-310 k preferably are assigned such that the count files that are derived from the skeleton count files 310 a-310 k (e.g. the count files 212 a-214 k of FIG. 2), will be of similar sizes after the assignment of all associated n-grams to the count files. Splitting the count data into count files of approximately equal size allows an even distribution of computational load among the merging processes 218. In one embodiment, the approximate distribution is achieved by round-robin assignment of text elements. For example, the text element with the highest count is assigned to the first count file 310 a, the text element with the second highest count is assigned to the second count file 310 b, and so forth, with text element k+1 assigned back to the first count file 310 a.
  • Factors other than the number of times a text element occurs may contribute to the assignment of a text element to a skeleton count file. For example, the number of different text elements that may precede a selected text element may contribute to the assignment of the selected text element to a skeleton count file, with text elements that may be preceded by a large number of different text elements spread evenly among the skeleton count files 310 a-310 k.
  • Referring back to FIG. 2, when assigning counts to count files 212 a-212 k and 214 a-214 k, it is not necessary for all text elements to have an explicit assignment to a skeleton count file 204 a-204 k. In one implementation, any text element that does not have an explicit assignment is automatically mapped to a special “catch-all” skeleton file. Even though the number of such text elements can be large (i.e. all text elements that did not occur in the text files 302 a-302 m that were used for extracting the assigned elements), these elements are likely to be infrequent and, hence, will not be a big factor in memory usage.
  • FIG. 4 is a block diagram of an exemplary count file 400 generated, for example, from text file 202 a. The exemplary count file 400 includes the counts 410 a-410 c, 414 a-414 c and 418 a-418 c. Counts 410 a-410 c, etc., correspond to n-grams 408 a-408 c (bigrams), 412 a-412 c (trigrams) and 416 a-416 c (trigrams). The count file 400 also includes combined counts 404 a-404 c of all unigrams 402 a-402 c from a text file (e.g. text file 202 a of FIG. 2).
  • One of the text elements assigned to count file 400 is the word “Spot.” As shown in the figure, the bigrams 408 a-408 c have “Spot” as the most recent text element in their history. Each bigram 408 a-408 c includes a current element which occurred after the word “Spot,” such as run (408 a), jump (408 b), and beg (408 c). In generating the count file 400, each time the word “Spot” was detected in the text file followed by the word “run”, the count 410 a of bigram (run|Spot) was incremented by one. According to the count file 400, the text file from which the count file 400 was populated included the word “Spot” followed by the word “run” 25 times (410 a). “Spot” was followed by the word “jump” 20 times (410 b), and was followed by the word “beg” 5 times (410 c).
  • The count file 400 also includes trigrams 412 a-412 c and 416 a-416 c. These trigrams 412 a-412 c and 416 a-416 c also have “Spot” as the most recent history element. They further include the element which occurred before “Spot” in the text file. For example, in the trigrams 412 a-412 c, “Spot” is preceded by “see.” Again, various words may occur after “Spot,” including for example “run” (412 a), “jump” (412 b), and “beg” (412 c). Thus, these trigrams represent the phrases “see Spot run,” which occurs 8 times (414 a) in the input text file, “see Spot jump,” which occurs 10 times (414 b) in the input text file, and “see Spot beg,” which occurs twice (414 c) in the input text file. In another example, as shown in the trigrams 416 a-416 c of FIG. 4, “Spot” is preceded by the word “watch.” These trigrams represent the phrases “watch Spot run,” which occurs 6 times (418 a) in the input text file, “watch Spot jump,” which occurs 4 times (418 b) in the input text file, and “watch Spot beg,” which occurs once (418 c) in the input text file.
  • FIG. 5 is a functional block diagram of a method of merging two exemplary count files 502 and 504. The count files 502 and 504 are derived from two different text files, but were populated using the same list of assigned elements. Identical n-grams from the count files 502 and 504 are combined by adding their respective counts. For example, the bigram 512 a (run|Spot) of the count file 502 is identical to the bigram 518 a (run|Spot) of the count file 504, and thus their respective counts 514 a (25) and 520 a (7) are added to result in the combined count 524 a (32) for the bigram 522 a (run|Spot) of the merged count file 506. Similarly, the counts 514 b and 520 b of the bigrams 512 b and 518 b (jump|Spot) are added to result in the combined count 524 b for the bigram 522 b, and the counts 514 c and 520 c of the bigram 512 c and 518 c (beg|Spot) are added to result in the combined count 524 c for the bigram 522 c. N-grams unique to each text file are added to the merged count file 506. As mentioned above, the corresponding count files of all the text files of a corpus are preferably merged in parallel.
  • According to one embodiment, after the n-gram count files have been merged, occurrence probability estimates are calculated for each n-gram to generate a language model. A language model includes a set of probabilities that a particular n-gram will occur in a previously unanalyzed input file (an occurrence probability). Smoothing and/or back-off algorithms are used to assign probabilities to n-grams that either were not observed in the training data or were discarded due to model size constraints, and to adjust the occurrence probabilities of the observed and saved n-grams accordingly. Smoothing provides a “smooth” (or “discounted”) probability estimate to the observed n-grams. The back-off algorithm is used to compute probabilities of unseen n-grams.
  • Most existing smoothing algorithms for estimation of n-gram language model probabilities can be expressed recursively as a linear interpolation of higher and lower order n-gram models (as further described in S. Chen and J. Goodman, “An empirical study of smoothing techniques for language modeling”, Center for Research in Computing Technologies, Harvard University, 1998), such as in equation 1, with a uniform 0th order distribution:

  • p(w i |w i−1 , . . . , w i−n+1)=p′(w i |w i−1 , . . . , w i−n+1)+γ(w i−1 , . . . , w i−n+1)p(w i |w i−1 , . . . , w i−n+2)

  • Equation 1. Computing n-gram probabilities by interpolating with lower order estimates.
  • One example smoothing algorithm suitable for this calculation is the Knesser-Ney smoothing algorithm. Another example of a popular smoothing algorithm is the Witten-Bell smoothing algorithm.
  • A back-off algorithm, which can be combined with smoothing, allows lower order estimates p(wi|wi−1, . . . , wi−n+2) to be used when the explicit probability p(wi|wi−1, . . . , wi−n+1) is not present. The lower order estimates are scaled with the corresponding back-off weight bow(wi−1, . . . , wi−n+1). The back-off weights are chosen such that the overall model is normalized, i.e. occurrence probabilities for every n-gram context sum to 1. This can be achieved by using equation 2:
  • Estimation of a back - off weight for a given context involves summing over all probabilities found in that context as well as he corresponding lower - order estimates . bow ( w i - 1 , , w i - n + 1 ) = 1 - w p ( w w i - 1 , , w i - n + 1 ) 1 - w p ( w w i - 1 , , w i - n + 2 ) . Equation 2
  • According to one feature, the language model described herein includes the probability estimates derived directly from the counts and also those derived from the smoothing and back-off algorithms described above.
  • FIG. 6 is a functional block diagram of a prior art method 600 of generating a language model 620 from multiple training corpora. Prior art language models have been trained using more than one input text corpus. The method generates a set of pruned merged counts 602 a-602 n for each input text corpus, as described in FIG. 1. The pruned merged counts 602 a-602 n are used to estimate language models (steps 604 a-604 n). The language models 602 a-602 n are estimated using n-gram probability estimates derived directly from the merged counts 602 a-602 n, as well as those derived using smoothing and back-off algorithms to assign probabilities to unobserved or pruned n-grams. A common strategy is to build separate language models 606 a-606 n from each corpus and then combine these models via linear interpolation (step 610). To perform interpolation, the probability of a word wi given context h is computed as a linear combination of the corresponding n-gram probabilities from the corpus language models 606 a-606 n:
  • p ( w i h ) = s { 606 a , , 606 n } λ s p s ( w i h )
  • for all n-grams that are present in any of the language models 606 a-606 n (i.e. the union of all n-grams). The resulting interpolated language model 612 may then be pruned (step 618), e.g. using the entropy criterion (S. Chen and J. Goodman, “An empirical study of smoothing techniques for language modeling”, Center for Research in Computing Technologies, Harvard University, 1998), to meet specific model size requirements. This results in the final pruned language model 620. In some embodiments, especially if the language models 606 a-606 n are large, interpolation of several models 606 a-606 n may exceed the computer's physical memory, and thus each model 606 a-606 n is pruned prior to interpolation.
  • FIG. 7 is a functional block diagram of a method 700 of generating a language model according to an illustrative embodiment of the present invention. The method 700 provides a means for creating large interpolated language models without requiring pruning prior to interpolation. The method 700 begins with the provision or generation of merged counts 702 a-702 n. Each merged count includes k merged count files 704 a-704 k and 706 a-706 k, which are substantially the same as the merged count files 222 a-222 k of FIG. 2. Corpus language models 712 a-712 n are generated in parallel at step 708 for each of the merged counts 702 a-706 k. Each corpus language model 712 a-712 n includes k corpus language model subsets. Each corpus language model subset 714 a-716 k corresponds to a merged count file 704 a-706 k. For example, the corpus language model 712 a includes the corpus language model subsets 714 a-714 k, and the corpus language model 712 n includes the corpus language model subsets 716 a-716 k. The language model subsets 714 a-716 k are generated for each merged count using the methodology described above, treating each merged count file 704 a-706 k as an individual merged count.
  • The next step in the method 700 is interpolation of the corpus language models 712 a-712 n (step 718). Each of the corresponding corpus language model subsets 714 a-716 a, 714 b-716 b, and 714 k-716 k are interpolated in k parallel interpolation processes 720 a-720 k. The interpolation results in an interpolated language model 722 comprising k interpolated language model subsets 724 a-724 k. Optionally, the interpolated language model 722 is pruned (step 728) by pruning each of the interpolated language model subsets 724 a-724 k. Pruning results in a pruned language model 732 including k pruned language model subsets 734 a-734 k. The resulting language model, for example the interpolated language model 722 or the pruned language model 732, may be stored either as k individual language model subset files, or combined into a single file.
  • Those skilled in the art will know or be able to ascertain using no more than routine experimentation, many equivalents to the embodiments and practices described herein. Accordingly, it will be understood that the invention is not to be limited to the embodiments disclosed herein, but is to be understood from the following claims, which are to be interpreted as broadly as allowed under the law.

Claims (28)

1-15. (canceled)
16. A method of building a language model comprising:
providing a first language model derived from a first corpus comprising a first set of data files, wherein each of the data files in the first set of data files is associated with a different set of text elements;
providing a second language model derived from a second corpus different from the first corpus comprising a second set of data files, wherein i) each of the data files in the second set of data files is associated with a different set of text elements, ii) each of the data files in the first set of data files corresponds to a respective data file in the second set of data files, and iii) a data file in the first set of data files corresponds to a data file in the second set of data files if the data file in the first set of data files is associated with a similar set of text elements as is associated with the data file in the second set of data files; and
merging, in parallel using a computer processor, respective data files in the first set of data files with corresponding data files in the second set of data files, thereby generating a combined language model by merging the first language model with the second language model.
17. The method of claim 16, wherein each of the first set of data files is associated with a set of text elements, and each of the corresponding second set of data files is associated with the same set of text elements.
18. The method of claim 17, wherein a text element is one of a word, a comma, a period, a beginning-of-sentence marker, and an end-of-sentence marker.
19. The method of claim 16, wherein the data files of the first set of data files and the data files of the second set of data files store probability measurements.
20. The method of claim 19, wherein the respective probability measurements indicate the probability of occurrence of respective selected n-grams.
21. The method of claim 20, further comprising using a smoothing algorithm to assign probability estimates to a second set of n-grams that are not present in the first or second sets of data files.
22. The method of claim 20, further comprising calculating back-off weights to assign probability estimates to a second set of n-grams that are not present in the first or second sets of data files.
23. The method of claim 19, wherein merging respective ones of the first set of data files with corresponding ones of the second set of data files comprises interpolating corresponding probability measurements.
24. The method of claim 16, wherein providing a first language model comprises calculating a plurality of probabilities related to the likelihood of selected n-grams and storing the plurality of probabilities in the data files of the first set of data files.
25. The method of claim 16, wherein merging respective data files of the first set of data files with corresponding data files of the second set of data files results in a set of merged data files.
26. The method of claim 25, further comprising pruning, in parallel, respective data files of the set of merged data files.
27-41. (canceled)
42. A computer-readable storage containing instructions for causing a computing device to carry out a method of building a language model, comprising:
providing a first language model derived from a first corpus comprising a first set of data files, wherein each of the first set of data files is associated with a different set of text elements;
providing a second language model derived from a second corpus different from the first corpus comprising a second set of data files, wherein i) each of the second set of data files is associated with a different set of text elements, ii) each of the data files in the first set of data files corresponds to a respective data file in the second set of data files, and iii) a data file in the first set of data files corresponds to a data file in the second set of data files if the data file in the first set of data files is associated with a similar set of text elements as is associated with the data file in the second set of data files; and
merging, in parallel, respective data files in the first set of data files with corresponding data files in the second set of data files, thereby generating a combined language model by merging the first language model with the second language model.
43. The computer-readable storage of claim 42, wherein each of the first set of data files is associated with a set of text elements, and each of the corresponding second set of data files is associated with the same set of text elements.
44. The computer-readable storage of claim 43, wherein a text element is one of a word, a comma, a period, a beginning-of-sentence marker, and an end-of-sentence marker.
45. The computer-readable storage of claim 42, wherein the data files of the first set of data files and the data files of the second set of data files store probability measurements.
46. The computer-readable storage of claim 45, wherein the respective probability measurements indicate the probability of occurrence of respective selected n-grams.
47. The computer-readable storage of claim 46, comprising instructions for causing the computing device to use a smoothing algorithm to assign probability estimates to a second set of n-grams that are not present in the first or second sets of data files.
48. The computer-readable storage of claim 46, comprising instructions for causing the computing device to calculate back-off weights to assign probability estimates to a second set of n-grams that are not present in the first or second sets of data files.
49. The computer-readable storage of claim 45, wherein merging respective ones of the first set of data files with corresponding ones of the second set of data files comprises interpolating corresponding probability measurements.
50. The computer-readable storage of claim 42, wherein providing a first language model includes calculating a plurality of probabilities related to the likelihood of selected n-grams and storing the plurality of probabilities in the data files of the first set of data files.
51. The computer-readable storage of claim 42, wherein merging respective data files of the first set of data files with corresponding data files of the second set of data files results in a set of merged data files.
52. The computer-readable storage of claim 51, comprising instructions for causing the computing device to prune, in parallel, respective data files of the set of merged data files.
53. The method of claim 16, wherein:
each data file comprises data about a plurality of n-grams;
each n-gram comprises a current text element and a text element history, the text element history comprising text elements preceding the current text element of the n-gram; and
the n-grams about which data is included in a given data file include those n-grams found in the corpus from which the given data file was derived that have one of the text elements associated with the given data file as a most recent text element in the histories of the respective n-grams.
54. The method of claim 53, wherein a data file in the first set of data files is considered associated with a similar set of text elements as is associated with the data file in the second set of data files if the data files share a similar set of text elements as the most-recent text elements in the histories of the n-grams about which data is stored in the data files.
55. The computer-readable storage of claim 42, wherein:
each data file comprises data about a plurality of n-grams;
each n-gram comprises a current text element and a text element history, the text element history comprising text elements preceding the current text element of the n-gram; and
the n-grams about which data is included in a given data file include those n-grams found in the corpus from which the given data file was derived that have one of the text elements associated with the given data file as a most recent text element in the histories of the respective n-grams.
56. The computer-readable storage of claim 55, wherein a data file in the first set of data files is considered associated with a similar set of text elements as is associated with the data file in the second set of data files if the data files share a similar set of text elements as the most-recent text elements in the histories of the n-grams about which data is stored in the data files.
US11/529,663 2006-09-27 2006-09-27 Modular approach to building large language models Active 2029-05-09 US7774197B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US11/529,663 US7774197B1 (en) 2006-09-27 2006-09-27 Modular approach to building large language models

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
US11/529,663 US7774197B1 (en) 2006-09-27 2006-09-27 Modular approach to building large language models

Publications (2)

Publication Number Publication Date
US7774197B1 US7774197B1 (en) 2010-08-10
US20100211378A1 true US20100211378A1 (en) 2010-08-19

Family

ID=42536622

Family Applications (1)

Application Number Title Priority Date Filing Date
US11/529,663 Active 2029-05-09 US7774197B1 (en) 2006-09-27 2006-09-27 Modular approach to building large language models

Country Status (1)

Country Link
US (1) US7774197B1 (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090265171A1 (en) * 2008-04-16 2009-10-22 Google Inc. Segmenting words using scaled probabilities
US20090326927A1 (en) * 2008-06-27 2009-12-31 Microsoft Corporation Adaptive generation of out-of-dictionary personalized long words
US20140180690A1 (en) * 2012-06-06 2014-06-26 Spansion Llc Hybrid Hashing Scheme for Active HMMS
US9047868B1 (en) * 2012-07-31 2015-06-02 Amazon Technologies, Inc. Language model data collection
US20160283464A1 (en) * 2010-09-29 2016-09-29 Touchtype Ltd. System and method for inputting text into electronic devices
US9484023B2 (en) 2013-02-22 2016-11-01 International Business Machines Corporation Conversion of non-back-off language models for efficient speech decoding
US10613746B2 (en) 2012-01-16 2020-04-07 Touchtype Ltd. System and method for inputting text

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7877258B1 (en) * 2007-03-29 2011-01-25 Google Inc. Representing n-gram language models for compact storage and fast retrieval
US8682668B2 (en) * 2008-05-16 2014-03-25 Nec Corporation Language model score look-ahead value imparting device, language model score look-ahead value imparting method, and program storage medium
US9069755B2 (en) * 2010-03-11 2015-06-30 Microsoft Technology Licensing, Llc N-gram model smoothing with independently controllable parameters
US8532994B2 (en) * 2010-08-27 2013-09-10 Cisco Technology, Inc. Speech recognition using a personal vocabulary and language model
CN103186522B (en) * 2011-12-29 2018-01-26 富泰华工业(深圳)有限公司 Electronic equipment and its natural language analysis method
US9224386B1 (en) 2012-06-22 2015-12-29 Amazon Technologies, Inc. Discriminative language model training using a confusion matrix
US9292487B1 (en) * 2012-08-16 2016-03-22 Amazon Technologies, Inc. Discriminative language model pruning
US9251135B2 (en) * 2013-08-13 2016-02-02 International Business Machines Corporation Correcting N-gram probabilities by page view information
US10311046B2 (en) * 2016-09-12 2019-06-04 Conduent Business Services, Llc System and method for pruning a set of symbol-based sequences by relaxing an independence assumption of the sequences
CN108021712B (en) * 2017-12-28 2021-12-31 中南大学 Method for establishing N-Gram model
US10650812B2 (en) * 2018-08-13 2020-05-12 Bank Of America Corporation Deterministic multi-length sliding window protocol for contiguous string entity
CN117194410A (en) * 2023-07-13 2023-12-08 广州白码科技有限公司 Method and system for generating business report by artificial intelligence language model

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5467425A (en) * 1993-02-26 1995-11-14 International Business Machines Corporation Building scalable N-gram language models using maximum likelihood maximum entropy N-gram models
US5651096A (en) * 1995-03-14 1997-07-22 Apple Computer, Inc. Merging of language models from two or more application programs for a speech recognition system
US20030216919A1 (en) * 2002-05-13 2003-11-20 Roushar Joseph C. Multi-dimensional method and apparatus for automated language interpretation
US20050021322A1 (en) * 2003-06-20 2005-01-27 Microsoft Corporation Adaptive machine translation
US20050055217A1 (en) * 2003-09-09 2005-03-10 Advanced Telecommunications Research Institute International System that translates by improving a plurality of candidate translations and selecting best translation
US20050216265A1 (en) * 2004-03-26 2005-09-29 Microsoft Corporation Representation of a deleted interpolation N-gram language model in ARPA standard format
US20050256715A1 (en) * 2002-10-08 2005-11-17 Yoshiyuki Okimoto Language model generation and accumulation device, speech recognition device, language model creation method, and speech recognition method
US20060009965A1 (en) * 2000-10-13 2006-01-12 Microsoft Corporation Method and apparatus for distribution-based language model adaptation
US20060031061A1 (en) * 2001-01-10 2006-02-09 Microsoft Corporation Performing machine translation using a unified language model and translation model
US20060053015A1 (en) * 2001-04-03 2006-03-09 Chunrong Lai Method, apparatus and system for building a compact language model for large vocabulary continous speech recognition (lvcsr) system
US7016830B2 (en) * 2000-06-01 2006-03-21 Microsoft Corporation Use of a unified language model
US7275029B1 (en) * 1999-11-05 2007-09-25 Microsoft Corporation System and method for joint optimization of language model performance and size

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5467425A (en) * 1993-02-26 1995-11-14 International Business Machines Corporation Building scalable N-gram language models using maximum likelihood maximum entropy N-gram models
US5651096A (en) * 1995-03-14 1997-07-22 Apple Computer, Inc. Merging of language models from two or more application programs for a speech recognition system
US7275029B1 (en) * 1999-11-05 2007-09-25 Microsoft Corporation System and method for joint optimization of language model performance and size
US7016830B2 (en) * 2000-06-01 2006-03-21 Microsoft Corporation Use of a unified language model
US20060009965A1 (en) * 2000-10-13 2006-01-12 Microsoft Corporation Method and apparatus for distribution-based language model adaptation
US20060031061A1 (en) * 2001-01-10 2006-02-09 Microsoft Corporation Performing machine translation using a unified language model and translation model
US20060053015A1 (en) * 2001-04-03 2006-03-09 Chunrong Lai Method, apparatus and system for building a compact language model for large vocabulary continous speech recognition (lvcsr) system
US20030216919A1 (en) * 2002-05-13 2003-11-20 Roushar Joseph C. Multi-dimensional method and apparatus for automated language interpretation
US20050256715A1 (en) * 2002-10-08 2005-11-17 Yoshiyuki Okimoto Language model generation and accumulation device, speech recognition device, language model creation method, and speech recognition method
US20050021322A1 (en) * 2003-06-20 2005-01-27 Microsoft Corporation Adaptive machine translation
US20050055217A1 (en) * 2003-09-09 2005-03-10 Advanced Telecommunications Research Institute International System that translates by improving a plurality of candidate translations and selecting best translation
US20050216265A1 (en) * 2004-03-26 2005-09-29 Microsoft Corporation Representation of a deleted interpolation N-gram language model in ARPA standard format

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8046222B2 (en) * 2008-04-16 2011-10-25 Google Inc. Segmenting words using scaled probabilities
US8566095B2 (en) 2008-04-16 2013-10-22 Google Inc. Segmenting words using scaled probabilities
US20090265171A1 (en) * 2008-04-16 2009-10-22 Google Inc. Segmenting words using scaled probabilities
US20090326927A1 (en) * 2008-06-27 2009-12-31 Microsoft Corporation Adaptive generation of out-of-dictionary personalized long words
US9411800B2 (en) * 2008-06-27 2016-08-09 Microsoft Technology Licensing, Llc Adaptive generation of out-of-dictionary personalized long words
US20160283464A1 (en) * 2010-09-29 2016-09-29 Touchtype Ltd. System and method for inputting text into electronic devices
US10146765B2 (en) * 2010-09-29 2018-12-04 Touchtype Ltd. System and method for inputting text into electronic devices
US10613746B2 (en) 2012-01-16 2020-04-07 Touchtype Ltd. System and method for inputting text
US9230548B2 (en) * 2012-06-06 2016-01-05 Cypress Semiconductor Corporation Hybrid hashing scheme for active HMMS
US20140180690A1 (en) * 2012-06-06 2014-06-26 Spansion Llc Hybrid Hashing Scheme for Active HMMS
US9047868B1 (en) * 2012-07-31 2015-06-02 Amazon Technologies, Inc. Language model data collection
US9484023B2 (en) 2013-02-22 2016-11-01 International Business Machines Corporation Conversion of non-back-off language models for efficient speech decoding
US9514744B2 (en) 2013-02-22 2016-12-06 International Business Machines Corporation Conversion of non-back-off language models for efficient speech decoding
US9934778B2 (en) 2013-02-22 2018-04-03 International Business Machines Corporation Conversion of non-back-off language models for efficient speech decoding

Also Published As

Publication number Publication date
US7774197B1 (en) 2010-08-10

Similar Documents

Publication Publication Date Title
US7774197B1 (en) Modular approach to building large language models
US10146765B2 (en) System and method for inputting text into electronic devices
US7542907B2 (en) Biasing a speech recognizer based on prompt context
US7356468B2 (en) Lexical stress prediction
US9092422B2 (en) Category-sensitive ranking for text
US9786269B2 (en) Language modeling of complete language sequences
EP1580667A2 (en) Representation of a deleted interpolation N-gram language model in ARPA standard format
Wang et al. Dynamic conditional random fields for joint sentence boundary and punctuation prediction
CA2515511A1 (en) System for predicting speech recognition accuracy and development for a dialog system
WO2012165529A1 (en) Language model construction support device, method and program
CN105893351B (en) Audio recognition method and device
US20090164217A1 (en) Multiresolution searching
Nocera et al. Phoneme lattice based A* search algorithm for speech recognition
US20080059149A1 (en) Mapping of semantic tags to phases for grammar generation
Duh et al. Automatic learning of language model structure
JP5466575B2 (en) Important word extraction device, method and program thereof
Kim et al. Review of Korean speech act classification: machine learning methods
JP5766152B2 (en) Language model generation apparatus, method and program
Wessel et al. Robust dialogue-state dependent language modeling using leaving-one-out
Kaufmann et al. Syntactic language modeling with formal grammars
Zhang et al. Partial parse selection for robust deep processing
JP5225219B2 (en) Predicate term structure analysis method, apparatus and program thereof
Blasig Combination of words and word categories in varigram histories
JP5860439B2 (en) Language model creation device and method, program and recording medium
JP2004053745A (en) Method, apparatus, and program for language model generation

Legal Events

Date Code Title Description
AS Assignment

Owner name: BANK OF AMERICA, N.A. (SUCCESSOR BY MERGER TO FLEE

Free format text: PATENT AND TRADEMARK SECURITY AGREEMENT;ASSIGNOR:BBN TECHNOLOGIES CORP.;REEL/FRAME:018359/0196

Effective date: 20040326

AS Assignment

Owner name: BBN TECHNOLOGIES CORP., MASSACHUSETTS

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:BULYKO, IVAN;REEL/FRAME:019700/0182

Effective date: 20070814

AS Assignment

Owner name: RAYTHEON BBN TECHNOLOGIES CORP., MASSACHUSETTS

Free format text: CHANGE OF NAME;ASSIGNOR:BBN TECHNOLOGIES CORP.;REEL/FRAME:024456/0537

Effective date: 20091027

STCF Information on status: patent grant

Free format text: PATENTED CASE

FPAY Fee payment

Year of fee payment: 4

MAFP Maintenance fee payment

Free format text: PAYMENT OF MAINTENANCE FEE, 8TH YEAR, LARGE ENTITY (ORIGINAL EVENT CODE: M1552)

Year of fee payment: 8

MAFP Maintenance fee payment

Free format text: PAYMENT OF MAINTENANCE FEE, 12TH YEAR, LARGE ENTITY (ORIGINAL EVENT CODE: M1553); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY

Year of fee payment: 12