The present invention is related to the field of pattern analysis, and more particularly, to pattern analysis involving the conversion text data to synthetic speech.
Numerous advances, both with respect to hardware and software, have been made in recent years relating to computer-based speech recognition and to the conversion of text into electronically generated synthetic speech. Thus, there now exist computer-based systems in which data that is to be synthesized is stored as text in a binary format so that as needed the text can be electronically converted into speech in accordance with a text-to-speech conversion protocol. One advantage of this is that it reduces the memory overhead that would otherwise be needed to store “digitized” speech.
Notwithstanding these advances, however, one problem persists in transforming textual input into intelligible human speech, namely, the handling of homographs that are sometimes encountered in any textual input. A homograph comprises one or more words that have identical spellings but different meanings and different pronunciations. For example, the word BASS has two different meanings—one pertaining to a type of fish and the other to a type of musical instrument. The word also has two distinct pronunciations. Such a word obviously presents a problem for any text-to-speech engine that must predict the phonemes that correspond to the character string B-A-S-S.
In some instances, the meaning and pronunciation may be dictated by the function that the homograph performs; that is, the part of speech to which the word corresponds. For example, the homograph CONTRACT, when it functions as a verb has one meaning—and, accordingly, one pronunciation—and another meaning and corresponding pronunciation when it functions as a noun. Therefore, since nouns frequently precede predicates, knowing the order of appearance of the homograph in a word string may give a clue as to its appropriate pronunciation. In other instances, however, homographs function as the same parts of speech, and accordingly, word order may not be helpful in determining a correct pronunciation. The word BASS is one such homograph: whether as a fish or a musical instrument, it functions as a noun.
In contexts other than word recognition, one method of pattern classification that has been successfully utilized is recursive partitioning. Recursive partitioning is a method that, using a plurality of training samples, tests parameter values to determine a parameter and value that best separate data into categories. The testing uses an objective function to measure a degree of separation effected by partitioning the training sample into different categories. Once an initial partitioning test has been found, the algorithm is recursively applied on each of the two subsets generated by the partitioning. The partitioning continues until either a subset comprising one unadulterated, or pure, category is obtained or a stopping criterion is satisfied. On the basis of this recursive partitioning and iterative testing, a decision tree results which specifies tests and sub-tests that can jointly categorize different data elements.
Although recursive partitioning has been widely applied in other contexts, the technique is not immediately applicable to the disambiguation of homographs owing to the large amounts of missing data that typically occur. Thus, there remains in the art a need for an effective and efficient technique for implementing a recursive partitioning in the context of disambiguating homographs during a text-to-speech conversion. Specifically, there is a need for a technique to recursively partition a training set to construct a statistical test, in the form of a decision tree, that can determine with a satisfactory level of accuracy the pronunciations of homographs that may occur during a text-to-speech event.
The invention, according to one embodiment, provides a device that can be used with a computer-based system capable of converting text data to synthesized speech. The device can include an identification module for identifying a homograph contained in the text data. The device also can include an assignment module for assigning a pronunciation to the homograph using a statistical test constructed from a recursive partitioning of a plurality of training samples.
Each training sample can comprise a word string that contains the homograph. The recursive partitioning can be based on determining for each of a plurality of word indicators an order and a distance of each word indicator relative to the homograph in each training sample. Moreover, an absence of one of the plurality of word indicators in a training sample can be treated as equivalent to the absent word indicator being more than a predefined distance from the homograph.
Another embodiment of the invention is a method of electronically disambiguating homographs during a computer-based text-to-speech event. The method can include identifying a homograph contained in a text, and determining a pronunciation for the homograph using a statistical test constructed from a recursive partitioning of a plurality of training samples. Each training sample, again, can comprise a word string containing the homograph. Likewise, the recursive partitioning can be based on determining for each of a plurality of word indicators an order and a distance of each word indicator relative to the homograph in each training sample, with an absence of one of the plurality of word indicators in a particular training sample being treated as equivalent to the absent word indicator being more than a predefined distance from the homograph.
Still another embodiment of the invention is a computer-implemented method of constructing a statistical test for determining a pronunciation of a homograph encountered during an electronic text-to-speech conversion event. The method can include selecting a set of training samples, each training sample comprising a word string containing the homograph. The method further can include recursively partitioning the set of training samples, the recursive partitioning producing a decision tree for determining the pronunciation and being based on determining for each of a plurality of word indicators an order and a distance of each word indicator relative to the homograph in each training sample. The absence of one of the plurality of word indicators in a training sample can be treated as equivalent to the absent word indicator being more than a predefined distance from the homograph
There are shown in the drawings, embodiments which are presently preferred, it being understood, however, that the invention is not limited to the precise arrangements and instrumentalities shown.
One or both of the identification module 102 and assignment module 104 can be implemented in one or more dedicated, hardwired circuits. Alternatively, one or both of the modules can be implemented in machine-readable code configured to run on a general-purpose or application-specific computing device. According to still another embodiment, one or both of the modules can be implemented in a combination of hardwired circuitry and machine-readable code. The functions of each module are described herein.
Illustratively, the system 100 also includes an input device 108 for receiving text data and a text-to-speech engine 110 for converting the text data into speech-generating data. The device 102 for handling homographs is illustratively interposed between the input device 108 and the text-to-speech engine 110. The system 100 also illustratively includes a speech synthesizer 112 and a speaker 114 for generating an audible rendering based on the output of the text-to-speech engine 110.
The computer-based system 100 can comprise other components (not shown) common to a general-purpose or application-specific computing device. The additional components can include one or more processors, a memory, and a bus, the bus connecting the one or more processors with the memory. The computer-based system 100, alternatively, can include various data communications network components that include a text-to-speech conversion capability.
Operatively the device 102 determines a pronunciation for each homograph encountered in text data that is supplied to the computer-based system 100 and that is to undergo a conversion to synthetic speech. When text data is received at the input device 108, the text data is initially conveyed to the identification module 104 of the device 102. The identification module 104 determines whether the text data conveyed from the input device 108 contains a homograph, and if so, identifies the particular homograph. The identification module 104, accordingly, can include a set that is formatted, for example, as a list of predetermined homographs. The set of homographs contained in the identification module need not be inordinately large: the English language, for example, contains approximately 500 homographs. The text data can be examined by the identification module 104 to determine a match between any word in the text and one of the members of the stored set of homographs.
Once identified by the identification module 104, the homograph (or, more particularly, a representation in the form of machine-readable code) is conveyed from the identification module to the assignment module 106, which, according to the operations described herein, assigns a pronunciation to the homograph. The pronunciation that is assigned to, or otherwise associated with, the homograph by the assignment module 106 is illustratively conveyed from the assignment module to the text-to-speech engine 110. The pronunciation so determined allows the text-to-speech engine 110 to direct the synthesizer 112 to render the homograph according to the pronunciation determined by the device 102.
The assignment module 106 assigns a pronunciation to the homograph using a statistical test, in the form of a decision tree. The decision tree determines which among a set of alternative pronunciations is most likely the correct pronunciation of a homograph. As explained herein, the statistical test that is employed by the assignment module 106 is constructed through a recursive partitioning of a plurality of training samples, each training sample comprising a word string containing a particular homograph. A word string can be, for example, a sentence demarcated by standard punctuation symbols such as a period or semi-colon. Alternatively, the word string can comprise a predetermined number of words appearing in a discrete portion of text, the homograph appearing in one word position within the word string.
The recursive partitioning of the plurality of training samples is based on word indicators associated with each homograph. A word indicator, as defined herein, is a word that can be expected to occur with some degree of regularity in word strings containing a particular homograph. For example, word indicators associated with the word BASS can include WIDE-MOUTH, DRUM, and ANGLER. As with most homographs, there likely are a number of other word indicators that are associated with the word BASS. Without loss of generality, though, the construction of the statistical test can be adequately described using only these three exemplary word indicators.
The recursive partitioning, as the phrase suggests, successively splits a set of training samples into ever smaller, or more refined, subsets.
According to one embodiment, the set of training samples is culled from a large corpus of text that has been searched for sentences that contain a particular homograph. Each selected sentence is a word string that serves as a training sample. Each such sentence is labeled so as to indicate the correct pronunciation for the homograph contained in that sentence. The selected sentences are processed into a matrix form as illustrated by Table 1:
The first column is a label that identifies the homograph's pronunciation: FISH if the homograph is to be pronounced as B-A-S-S, and MUSIC if the homograph is to be pronounced as B-A-S-E. Each subsequent column corresponds to a particular word indicator. Each row comprises a training sample, and each column comprises a feature of a training sample. Thus, each element of the matrix is the value of the feature, xi, i=1, 2, 3, xiεN, for a particular training sample. Each feature corresponds to a particular word indicator. The integer value of each feature indicates the order and word position of the particular indicator word relative to the homograph. A negative integer indicates that the word indicator occurs to the left of the homograph, and a positive integer indicates that the word indicator occurs to the right. The absolute value of the integer indicates the word position of the indicator word relative to the homograph.
For example, the first training sample corresponds to the first row of the matrix. The correct pronunciation of the homograph is B-A-S-S (i.e., the training sample is labeled FISH). Neither of the word indicators DRUM or ANGLER occur in the first training sample, but the indicator word WIDE-MOUTH is one word to the left of the homograph as indicated by the negative integer, −1, at the intersection of the first row and second column of the exemplary matrix.
When a particular indicator word associated with the homograph is absent from the word string comprising a training sample, the absence of the indicator word is indicated by NA in the corresponding cell of the matrix. The specific manner in which absent indicator words are treated is described below.
Each splitting of a set or subset of the training samples corresponds to a node of the decision tree that is constructed through recursive partitioning. Splitting results in a refinement of one set (if the node is the first node) or one subset into a smaller or refined pair of subsets as illustrated in
In formalizing this notion, it is generally more convenient to define the impurity of a node rather than its purity. The criteria for an adequate definition is that the impurity of node n, denoted here as i(n), is zero if all the data samples that fall within a subset following a split at the n-th node bear the same label (e.g., either FISH or MUSIC). Conversely, i(n) is maximum if the different labels are exactly equally represented by the data samples within the subset (i.e., the number labeled FISH equals the number labeled MUSIC). If one label predominates, then the value of i(n) is between zero and its maximum.
One measure of impurity that satisfies the stated criteria is entropy impurity, sometimes referred to as Shannon's impurity or information impurity. The measure is defined by the following summation equation:
where P(ωj) is the fraction of data samples at node n that are in category ωj. As readily understood by one of ordinary skill in the art, the established properties of entropy ensure that if all the data samples have the same label, or equivalently, fall within the same category (e.g., FISH or MUSIC), then the impurity entropy is zero; otherwise it is positive, with the greatest value occurring when any two data samples having a different labels are equally likely.
Another measure of impurity is the Gini impurity, defined by the following alternate summation equation:
The Gini impurity can be interpreted as a variance impurity since under certain relatively benign assumptions, it is related to the variance of a probability distribution associated with the two categories, i and j. The Gini impurity is simply the expected error rate at the n-th node if the label is selected randomly from the class distribution at node n.
Still another measure is the misclassification impurity, which is defined as follows:
The misclassification impurity measures the minimum probability that a training sample would be misclassified at the n-th node.
The decision rule applied at each node in constructing the decision tree implemented by the assignment module 106 can be selected according to any of these measures of impurity. As will be readily understood by one of ordinary skill, other measures of impurity that satisfy the stated criteria can alternatively be used.
According to one embodiment, the decision tree implement by the assignment module 106 effects a partitioning at a succession of nodes according to the following algorithm:
In the algorithm, the text_value is a positive or negative integer depending, respectively, on whether the word position of the particular word indicator is to the right or to the left of the homograph for which the decision tree is being constructed. The datum can be the value of a cell at the intersection of a row and a column of a matrix, when, as described above, each of the training samples is formatted as a row vector and each column of the matrix corresponds to a predetermined indicator word associated for the particular homograph.
Different partitions and, accordingly, different decision trees are constructed by choosing different decision functions or rules. The decision functions or rules are evaluated at each node on the basis of the entropy impurity or Gini impurity, described above, or a similar entropy measurement. On this basis, each of the various ways of splitting a given node is considered, consideration being given to each node individually. The particular split selected for a given node is the one that yields the “best score” in terms of the specific entropy measurement used. The intent is to select at each node the decision rule that is most the effective with respect to minimizing the measured entropy associated with the split at each node. The selection of the various splits or partitions results in the decision tree that is implemented by the assignment module 106.
A key aspect of the invention in constructing the decision tree is the manner in which missing values in a word string are treated. A missing value is the absence of a particular indicator word associated with the homograph that is contained in the word string. When an indicator word is absent from a word string comprising a training sample, the absent indicator word is categorized as a failure to satisfy the decision function or rule. For example, according to the above-delineated algorithm, an absent word indicator is treated as a word indicator whose order and word position fails to satisfy the decision rules implemented by the nested if-else statements.
The operative effect of treating missing values in the same manner as xi values that fail to satisfy a decision rule is to retain all of the labels of the missing values for evaluation by the entropy measure rather than simply discarding them. Accordingly, this technique rewards the proximity of an indicator word relative to the corresponding homograph. Indicator words absent from a word string comprising a training sample are treated as being at a large distance from the homograph. The invention thus avoids sacrificing the numerical benefits of having a large data set, as will be readily recognized by one of ordinary skill in the art.
Note that were missing data discarded, the entropy measure would be based on a small set of training samples (i.e., only those for which the particular word string contained the indicator word). Worse, the small set of training samples would change from one indicator word to another.
Another advantage of the invention pertains to testing separately for values less than zero and greater than zero. The effect of this treatment is to treat indicator words that appear in a word string to the left of a homograph independently of indicator words that appear to the right. In a conventional recursive partitioning algorithm, the typical decision rule is a simple inequality such as xi≦xiS, which in the context of the example above corresponds to testing whether the datum is greater than or less than the test_value; no account of order is taken as with the invention.
The effect of such failure to take account of word order is to put words that are one place to the left of a homograph in the same partition as words that are any distance to the right. Word order is important, however, since they are often dictated by rules of grammar—adjectives are to the left of the nouns they modify, for example—which determine what part of speech a word is. The parts of speech dictate how a word is used, and knowing how a word is used can provide critical information for determining what the word is.
The recursive partitioning through which the statistical test used in step 306 of the method 300 is constructed comprises determining for each of a plurality of word indicators an order and a distance of each word indicator relative to the homograph in each training sample. In constructing the statistical test, moreover, an absence of one of the plurality of word indicators in a training sample is treated as an equivalent to the absent word indicator being more than a predefined distance from the homograph. The method 300 concludes at step 308.
The method 400 further includes recursively partitioning the set of training samples at step 406, the recursive partitioning producing a decision tree for determining the pronunciation. The recursive partitioning, more particularly can be based on determining for each of a plurality of word indicators an order and a distance of each word indicator relative to the homograph in each training sample. Moreover, an absence of one of the plurality of word indicators in a training sample is treated as an equivalent to the absent word indicator being more than a predefined distance from the homograph. The method 400 illustratively concludes at step 408.
The present invention can be realized in hardware, software, or a combination of hardware and software. The present invention can be realized in a centralized fashion in one computer system, or in a distributed fashion where different elements are spread across several interconnected computer systems. Any kind of computer system or other apparatus adapted for carrying out the methods described herein is suited. A typical combination of hardware and software can be a general purpose computer system with a computer program that, when being loaded and executed, controls the computer system such that it carries out the methods described herein.
The present invention also can be embedded in a computer program product, which comprises all the features enabling the implementation of the methods described herein, and which when loaded in a computer system is able to carry out these methods. Computer program in the present context means any expression, in any language, code or notation, of a set of instructions intended to cause a system having an information processing capability to perform a particular function either directly or after either or both of the following: a) conversion to another language, code or notation; b) reproduction in a different material form.
This invention can be embodied in other forms without departing from the spirit or essential attributes thereof. Accordingly, reference should be made to the following claims, rather than to the foregoing specification, as indicating the scope of the invention.