Entropy-guided text prediction using combined word and character n-gram language models

Systems and processes are disclosed for predicting words in a text entry environment. Candidate words and probabilities associated therewith can be determined by combining a word n-gram language model and a character m-gram language model. Based on entered text, candidate word probabilities from the word n-gram language model can be integrated with the corresponding candidate character probabilities from the character m-gram language model. A reduction in entropy can be determined from integrated candidate word probabilities before entry of the most recent character to integrated candidate word probabilities after entry of the most recent character. If the reduction in entropy exceeds a predetermined threshold, candidate words with high integrated probabilities can be displayed or otherwise made available to the user for selection. Otherwise, displaying candidate words can be deferred (e.g., pending receipt of an additional character from the user leading to reduced entropy in the candidate set).

FIELD

This relates generally to text prediction and, more specifically, to predicting words by combining word and character n-gram language models and displaying results according to entropy reduction.

BACKGROUND

Electronic devices and the ways in which users interact with them are evolving rapidly. Changes in size, shape, input mechanisms, feedback mechanisms, functionality, and the like have introduced new challenges and opportunities relating to how a user enters information, such as text. Statistical language modeling can play a central role in many text prediction and recognition problems, such as speech or handwriting recognition and keyboard input prediction. An effective language model can be critical to constrain the underlying pattern analysis, guide the search through various (partial) text hypotheses, and/or contribute to the determination of the final outcome. In some examples, statistical language modeling has been used to convey the probability of occurrence in the language of all possible strings of n words.

Given a vocabulary of interest for the expected domain of use, determining the probability of occurrence of all possible strings of n words has been done using a word n-gram model, which can be trained to provide the probability of the current word given the n−1 previous words. Training has typically involved large machine-readable text databases, comprising representative documents in the expected domain. Even so, due to the finite size of such databases, many occurrences of n-word strings can be seen infrequently, yielding unreliable parameter values for all but the smallest values of n. Compounding the problem, in some applications it can be cumbersome or impractical to gather a large enough amount of training data. In other applications, the size of the resulting model may exceed what can reasonably be deployed. In some instances, training data sets and n-gram models can be pruned to an acceptable size, which can negatively impact the predictive power of the resulting pruned models.

In such situations, it has often been expedient to rely on a character m-gram model. Just as a word n-gram can be based on strings of n words, a character m-gram can be based on strings of m characters, where typically m>n. Thus a character m-gram can be trained to provide the probability of the current character given the m−1 previous characters encountered. Because the number of characters in the alphabet is typically much smaller than the number of words in the vocabulary, a character m-gram can be much more compact than a word n-gram for usual values of m and n. Thus, a proper estimation can be performed with a lot less data, which makes such models particularly popular for embedded applications.

While character m-grams are typically more compact and easier to estimate than word n-grams, they can also be less predictive due to the much coarser granularity involved. On the other hand, character m-grams tend to be more robust, in the sense that they generalize better to out-of-vocabulary words. In text prediction applications in particular, a character model can be coupled with a large domain-appropriate lexicon to provide whole word completions and predictions, rather than semantically meaningless partial fragments. This combination, however, can still suffer from an inherent lack of predictive power due to the character restriction of character m-grams.

Accordingly, using either a word n-gram model or a character m-gram model for particular applications can limit overall prediction accuracy, either due to an inherent lack of predictive power due to the character restriction in the case of character m-gram models, or due to a de facto lack of predictive power from excessive pruning in the case of word n-gram models.

SUMMARY

Systems and processes are disclosed for predicting and displaying words by combining a word n-gram language model and a character m-gram language model and displaying results according to entropy reduction. In one example, typed input can be received from a user. Using a word n-gram model, a probability of a predicted word can be determined based on a previously entered word in the typed input. Using a character m-gram model, a probability of a predicted character can be determined based on a previously entered character in the typed input. An integrated probability of the predicted word can be determined based on the probability of the predicted word and the probability of the predicted character. The predicted word can then be displayed based on the integrated probability.

In some examples, first probabilities of a first set of possible word completions can be determined based on a first typed character in the typed input. The first set of possible word completions can include the predicted word, and the first probabilities can include the integrated probability of the predicted word. Second probabilities of a second set of possible word completions can be determined based on the first typed character and a second typed character in the typed input. The second set of possible word completions can include the predicted word. A reduction in entropy can be determined from the first probabilities of the first set to the second probabilities of the second set. In response to the reduction in entropy exceeding a threshold, the predicted word can be displayed.

In another example, a first typed character can be received from a user. A first entropy of a first set of possible word completions can be determined based on first probabilities of the first set of possible word completions, wherein the first probabilities are based on the first typed character. A second typed character can be received from the user. A second entropy of a second set of possible word completions can be determined based on second probabilities of the second set of possible word completions, wherein the second probabilities are based on the first typed character and the second typed character. A reduction in entropy from the first entropy to the second entropy can be determined. In response to the reduction in entropy exceeding a threshold, a candidate word can be displayed from the second set of possible word completions.

In another example, a first typed character can be received from a user. First probabilities of a first set of possible word completions can be determined based on the first typed character. A second typed character can be received from the user. Second probabilities of a second set of possible word completions can be determined based on the first typed character and the second typed character. A reduction in entropy can be determined from the first probabilities of the first set to the second probabilities of the second set. In response to the reduction in entropy exceeding a threshold, a candidate word can be displayed from the second set of possible word completions.

DETAILED DESCRIPTION

In the following description of examples, reference is made to the accompanying drawings in which it is shown by way of illustration specific examples that can be practiced. It is to be understood that other examples can be used and structural changes can be made without departing from the scope of the various examples.

This relates to systems and processes for predicting words in a text entry environment. In one example, candidate words and probabilities associated therewith can be determined by combining a word n-gram language model and a character m-gram language model. Using the word n-gram language model, based on previously entered words, candidate words can be identified and a probability can be calculated for each candidate word. Such a probability can signify a likelihood that a candidate word corresponds to a word a user will enter. Using the character m-gram language model, based on previously entered characters, candidate characters can be identified and a probability can be calculated for each candidate character. Such a probability can signify a likelihood that a candidate character corresponds to a character a user will enter. The candidate word probabilities can be integrated with the corresponding candidate character probabilities. A reduction in entropy can be determined from integrated candidate word probabilities before entry of the most recent character to integrated candidate word probabilities after entry of the most recent character. If the reduction in entropy exceeds a predetermined threshold, candidate words with high integrated probabilities can be displayed or otherwise made available to the user for selection. Otherwise, displaying candidate words can be deferred (e.g., pending receipt of an additional character from the user leading to reduced entropy in the candidate set).

By integrating word and character language models, the strengths of each approach can be leveraged at the same time. This can aid in providing accurate and meaningful candidate word suggestions to a user entering text. With meaningful candidate word suggestions, a user can enter text quickly and efficiently by selecting suggested candidates instead of entering all characters individually for all words. In addition, by employing an entropy reduction threshold to determine when candidate suggestions should be provided to a user, the user experience can be optimized. For example, in some text entry environments, screen real estate can be at a premium (e.g., handheld mobile devices). It can, therefore, be preferable to deliver only those candidate words that provide the highest level of value for users, and an entropy reduction threshold can be employed in this manner to limit candidate word intrusion and optimize the user experience. It should be understood, however, that still many other advantages can be achieved according to the various examples discussed herein.

FIG. 1illustrates exemplary system100for predicting words. In one example, system100can include user device102(or multiple user devices102) that can provide a text entry interface or environment. User device102can include any of a variety of devices, such as a cellular telephone (e.g., smartphone), tablet computer, laptop computer, desktop computer, portable media player, wearable digital device (e.g., digital glasses, wristband, wristwatch, brooch, armbands, etc.), television, set top box (e.g., cable box, video player, video streaming device, etc.), gaming system, or the like. In some examples, user device102can include display114. Display114can include any of a variety of displays, and can also include a touchscreen, buttons, or other interactive elements. In one example, display114can be incorporated within user device102(e.g., as in a touchscreen, integrated display, etc.). In other examples, display114can be external to—but communicatively coupled to—user device102(e.g., as in a television, external monitor, projector, etc.).

In some examples, user device102can include or be communicatively coupled to keyboard116, which can capture user-entered text (e.g., characters, words, symbols, etc.). Keyboard116can include any of a variety of text entry mechanisms and devices, such as a stand-alone external keyboard, a virtual keyboard, a remote control keyboard, a handwriting recognition system, or the like. In one example, for instance, keyboard116can include a virtual keyboard on a touchscreen capable of receiving text entry from a user (e.g., detecting character selections from touch). In another example, keyboard116can include a virtual keyboard shown on a display (e.g., display114), and a pointer or other indicator can be used to indicate character selection (e.g., indicating character selection using a mouse, remote control, pointer, button, gesture, eye tracker, etc.). In yet another example, keyboard116can include a touch sensitive device capable of recognizing handwritten characters. In still other examples, keyboard116can include other mechanisms and devices capable of receiving text entry from a user.

User device102can also include processor104, which can receive text entry from a user (e.g., from keyboard116) and interact with other elements of user device102as shown. In one example, processor104can be configured to perform any of the methods discussed herein, such as predicting words and causing them to be displayed by combining a word n-gram language model and a character m-gram language model and displaying results according to entropy reduction. In other examples, processor104can cause data (e.g., entered text, user data, etc.) to be transmitted to server system120through network118. Network118can include any of a variety of networks, such as a cellular telephone network, WiFi network, wide area network, local area network, the Internet, or the like. Server system120can include a server, storage devices, databases, and the like and can be used in conjunction with processor104to perform any of the methods discussed herein. For example, processor104can cause an interface to be provided to a user for text entry, can receive entered text, can transmit some or all of the entered text to server system120, and can cause predicted words to be displayed on display114.

In some examples, user device102can include storage device106, memory108, word n-gram language model110, and character m-gram language model112. In some examples, word n-gram language model110and character m-gram language model112can be stored on storage device106, and can be used to predict words and determine probabilities according to the methods discussed herein. Language models110and112can be trained on any of a variety of text data, and can include domain-specific models for use in particular applications, as will be appreciated by one of ordinary skill in the art.

Thus, any of the functions or methods discussed herein can be performed by a system similar or identical to system100. It should be appreciated that system100can include instructions stored in a non-transitory computer readable storage medium, such as memory108or storage device106, and executed by processor104. The instructions can also be stored and/or transported within any non-transitory computer readable storage medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. In the context of this document, a “non-transitory computer readable storage medium” can be any medium that can contain or store the program for use by or in connection with the instruction execution system, apparatus, or device. The non-transitory computer readable storage medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, a portable computer diskette (magnetic), a random access memory (RAM) (magnetic), a read-only memory (ROM) (magnetic), an erasable programmable read-only memory (EPROM) (magnetic), a portable optical disc such as CD, CD-R, CD-RW, DVD, DVD-R, or DVD-RW, or flash memory such as compact flash cards, secured digital cards, USB memory devices, memory sticks, and the like.

It should be understood that the system is not limited to the components and configuration ofFIG. 1, but can include other or additional components in multiple configurations according to various examples. For example, user device102can include a variety of other mechanisms for receiving input from a user, such as a microphone, optical sensor, camera, gesture recognition sensor, proximity sensor, ambient light sensor, or the like. Additionally, the components of system100can be included within a single device, or can be distributed among multiple devices. For example, althoughFIG. 1illustrates word n-gram language model110and character m-gram language model112as part of user device102, it should be appreciated that, in other examples, the functions of processor104can be performed by server system120, and/or word n-gram language model110and character m-gram language model112can be stored remotely as part of server system120(e.g., in a remote storage device). In still other examples, language models and other data can be distributed across multiple storage devices, and many other variations of system100are also possible.

FIG. 2illustrates exemplary process200for predicting words using a word n-gram model and a character m-gram model. Process200can, for example, be executed on processor104of system100utilizing word n-gram language model110and character m-gram language model112discussed above with reference toFIG. 1. At block202, typed input can be received from a user. Typed input can be received in any of a variety of ways, such as from keyboard116in system100discussed above. The typed input can include a single typed character, such as a letter or symbol. The typed input can also include a string of characters, a word, multiple words, multiple sentences, or the like. User-entered input received at block202can be directed to any type of text entry interface or environment on a user device. For example, such an interface could be configured for typing text messages, emails, web addresses, documents, presentations, search queries, media selections, commands, form data, calendar entries, notes, or the like.

The typed input received at block202can be used to predict a word. For example, the typed input can be used to predict the likely completion of a partially-entered word, a subsequent word likely to be entered following previously-entered words, a phrase or a group of words likely to be entered following previously-entered words, or the like. Previously-entered characters or words can be considered observed context that can be used to make predictions.FIG. 3illustrates exemplary observed context330and prediction332. In one example, observed context330can include observed words338, some or all of which can correspond to the typed input received from a user at block202of process200. Observed context330can also include observed characters340, some or all of which can correspond to observed words338and the typed input received from a user at block202. For example, observed characters340can include some or all of the individual characters that make up observed words338as well as any spaces between the words.

For reference, and as noted inFIG. 3, let:
Wq−n+1q=wq−n+1wq−n+2. . . wq−1wq
denote the string of n words relevant to the prediction of the current word wq(noted as predicted word342), and let:
Cp−m+1p=cp−m+1cp−m+2. . . cp−1cp
denote the string of m characters relevant to the prediction of the current character cp(noted as predicted character346), where cpcan (arbitrarily) be assumed to be the first character making up wq. Also, for further reference, predicted word342can include characters344, in that wqcan be formed out of a string of characters x1. . . xk. . . xK, where K can be the total number of characters in wq. For purposes of explanation, it can be assumed that cp=x1. As will be discussed in further detail below, observed words338can be used in word language model334to determine predicted word342. Similarly, observed characters340can be used in character language model336to determine predicted character346. The upper portion ofFIG. 3illustrates observed context330at a time350, while the lower portion ofFIG. 3illustrates observed context330at a later time352after addition characters have been observed (e.g., after additional characters have been received from the user). As illustrated, there can be a word boundary at time350with no partial character expansion of the predicted word (e.g., k=1).

Referring again to process200ofFIG. 2, at block204, a probability of a predicted word can be determined based on a previously entered word using a word n-gram model (e.g., word n-gram language model110ofFIG. 1, and as illustrated by word language model334ofFIG. 3). As understood by one of ordinary skill in the art, a word n-gram model can compute the probability of a current word wqgiven the available word history, as in the following:
Pr(wq|Wq−n+1q−1),   (1)
where Wq−n+1q−1provides the relevant string of n−1 words. This probability can signify a likelihood that a candidate word (e.g., predicted word342ofFIG. 3) corresponds to a word a user will enter (or a word a user will complete in the instance where one or more characters has already been entered). One of ordinary skill in the art will understand that the value of n can be varied as desired, and a word n-gram model can compute a probability of a predicted word given any amount of available word history (e.g., zero words, one word, two words, etc.).

Referring again to process200ofFIG. 2, at block206, a probability of a predicted character can be determined based on a previously entered character using a character m-gram model (e.g., character m-gram language model112ofFIG. 1, and as illustrated by character language model336ofFIG. 3). As understood by one of ordinary skill in the art, a character m-gram model can compute the probability of a current character cpgiven the available character history, as in the following:
Pr(cp|Cp−m+1p−1),   (2)
where Cp−m+1p−1provides the relevant string of m−1 characters. This probability can signify a likelihood that a candidate character (e.g., predicted character346ofFIG. 3) corresponds to a character a user will enter. One of ordinary skill in the art will understand that the value of m can be varied as desired, and a character m-gram model can compute a probability of a predicted character given any amount of available character history (e.g., zero characters, one character, two characters, etc.).

Referring again to process200ofFIG. 2, at block208, an integrated probability of the predicted word from block204can be determined based on the probability of the corresponding predicted character from block206. As mentioned above, this approach can combine the benefits of both a word n-gram model and a character m-gram model to obtain accurate word predictions. As discussed in further detail below, however, the approach discussed herein can provide an integrated language model outside of restricted solutions involving, for example, an arbitrarily interpolated probability.

Referring again toFIG. 3, at a given time350, there can be an observed word history Wq−n+1q−1including observed words338. The observed word history can include recently entered words. For example, recently entered words can include words entered in a current input session (e.g., in a current text message, a current email, a current document, etc.). For predicting words, the recently entered words can include the last n words entered (e.g., the last three words, the last four words, the last five words, or any other number of words). There can also be an observed character history Cp−m+1p−1including observed characters340. As mentioned above, observed character340can include the individual characters of observed words338. The observed character history can thus include recently entered characters in a current input session, including the last m characters entered (e.g., the last three characters, the last four characters, the last five characters, or any other number of characters). No assumption needs to be made on the comparative length of the observed word string and observed character string. The desired prediction can involve both the current predicted word wqand a partial character expansion of wqas x1x2. . . xkwith 1≤k≤K. The case k=K can be omitted, as the character expansion would otherwise be identical to the word wqand would thus offer only a redundant prediction.

With this setup, a joint probability of the current word wqand the partial character expansion x1x2. . . xkcan be computed given all relevant history, as in the following:
Pr(wqx1. . . xk|Wq−n+1q−1Cp−m+1p−1).   (3)
This joint probability can be simplified while making few assumptions on the structure of the word and class history.

Using the definition of a conditional probability, expression (3) can be manipulated as follows to achieve the following outcome expression (4):

Pr⁡(wq⁢x1⁢⁢…⁢⁢xk|Wq-n+1q-1⁢Cp-m+1p-1)=Pr⁡(wq⁢x1⁢⁢…⁢⁢xk⁢Wq-n+1q-1⁢Cp-m+1p-1)Pr⁡(Wq-n+1q-1⁢Cp-m+1p-1)=Pr⁢(x1⁢⁢…⁢⁢xk⁢Cp-m+1p-1|wq⁢Wq-n+1q-1)·Pr⁡(wq|Wq-n+1q-1)·Pr⁡(Wq-n+1q-1)Pr⁡(Cp-m+1p-1|Wq-n+1q-1)·Pr⁡(Wq-n+1q-1)=[Pr⁡(x1⁢⁢…⁢⁢xk⁢Cp-m+1p-1|wq⁢Wq-n+1q-1)Pr⁡(Cp-m+1p-1|Wq-n+1q-1)]·Pr⁡(wq|Wq-n+1q-1)=[Pr⁡(x1⁢⁢…⁢⁢xk⁢Cp-m+1p-1|wq⁢Wq-n+1q-1)Pr⁡(Cp-m+1p-1|Wq-n+1q-1)]·Pr⁡(wq|Wq-n+1q-1)=[Pr⁡(x1⁢⁢…⁢⁢xk|Cp-m+1p-1⁢wq⁢Wq-n+1q-1)·Pr⁡(Cp-m+1p-1|wq⁢Wq-n+1q-1)Pr⁡(Cm+1p-1|Wq-n+1q-1)]·Pr⁡(wq|Wq-n+1q-1).(4)
The resulting expression (4) can thus include the standard n-gram probability Pr(wq|Wq−n+1q−1) of expression (1), multiplied by the expression in square brackets, which can act as a weight on this n-gram probability. It should be appreciated that the above derivation can be achieved without approximation.

Notably, in expression (4), the term Pr(Cp−m+1p−1|wqWq−n+1q−1) involves the character history conditioned on both the word history and the current word, which introduces a non-causal dependence on future events. Dropping this non-causal dependence can be a very mild assumption and modification. As a result, this term can be simplified to Pr(Cp−m+1p−1|Wq−n+1q−1), which can then cancel with the denominator to yield the following:
Pr(wqx1. . . xk|Wq−n+1q−1Cp−m+1p−1)≈Pr(x1. . . xk|Cp−m+1p−1wqWq−n+1q−1)·Pr(wq|Wq=n+1q−1)   (5)
The weight on the standard n-gram probability thus reduces to Pr(x1. . . xk|Cp−m+1p−1wqWq−n+1q−1), which represents the probability of the partial character expansion of the current word conditioned on the current word itself, as well as both the character history and the word history.

It should be appreciated that there can be redundancy in this conditioning, as character history and word history can overlap significantly. Whether character history or word history provides more information can depend on the respective values of m and n. In one example, it can be assumed that m can be large enough relative to n to provide a meaningful representation of the relevant history. In such an example, knowledge of the character history can be sufficient, and the precise identity of the words may not be necessary. This can provide a simplification of the weighting element to Pr(x1. . . xk|Cp−m+1p−1wq), which, using Bayes' rule, can in turn be written as follows:

Pr⁡(x1⁢…⁢⁢xk|Cp-m+1p-1⁢wq)=Pr⁡(wq|x1⁢⁢…⁢⁢xk⁢Cp-m+1p-1)·Pr⁡(x1⁢⁢…⁢⁢xk|Cp-m+1p-1)Pr⁡(wq).(6)
Expression (6) exposes the probability Pr(x1. . . xk|Cp−m+1p−1), which can be computed with the standard character m-gram. For example, the standard character m-gram can be computed according to the following:
Pr(x1. . . xk|Cp−m+1p−1)=Pr(xk|x1. . . xk−1Cp−m+1p−1) . . .Pr(x2|x1Cp−m+1p−1)·Pr(x1|Cp−,+1p−1)≈Pr(xk|x1. . . xk−1Cp−m+kp−1) . . .Pr(x2|x1Cp−m+2p−1)·Pr(x1|Cp−m+1p−1),   (7)
where the approximation on the second line in expression (7) properly takes into account the fixed value of the character span m.

In one example, a further approximation can be employed for the probability Pr(wq|x1. . . xkCp−m+1p−1), which predicts the current word based on the partial character expansion and the character history. Given that the character history can already be used to predict the partial expansion in expression (7), it can be a relatively mild modification to focus on the dependence of the current word on the partial character expansion. With such an approximation, this probability can be reduced as follows:
Pr(wq|x1. . . xkCp−m+1p−1)≈Pr(wq|x1. . . xk).   (8)
In essence, this approximation policy can be consistent with the typical assumption made in class m-grams, which decouples word assignment from class m-gram calculations. Similarly here, the relationship between word and partial character expansion (“word assignment”) can be decoupled from the character m-gram calculations.

With this decoupling analogy, the probability Pr(wq|x1. . . xk) can be computed by leveraging the words in the vocabulary whose first k characters are x1. . . xk. For reference, the set of words in the vocabulary whose first k characters are x1. . . xkcan be denoted by Vx1. . . xk. With this notation and simplification, this probability can be determined according to

Pr⁡(wq|x1⁢…⁢⁢xk)=1Vx1⁢…⁢⁢xk⁢∑w∈Vx1⁢…⁢⁢xk⁢⁢Pr⁡(w),
e.g., the prediction for the current word can be determined as the average unigram probability computed over the set of words in the vocabulary whose first k characters are x1. . . xk.

The previous derivations and approximations can further be combined to modify expression (5) to arrive at the following:

Pr⁡(wq⁢x1⁢⁢…⁢⁢xk|Wq-n+1q-1⁢Cp-m+1p-1)≈[Pr⁡(wq|x1⁢⁢…⁢⁢xk)·Pr⁡(x1⁢…⁢⁢xk|Cp-m+1p-1)Pr⁡(wq)]·Pr⁡(wq|Wq-n+1q-1)≈[(1Vx1⁢…⁢⁢xk⁢∑w∈Vx1⁢…⁢⁢xk⁢⁢Pr⁡(w))·∏i=1k⁢⁢Pr⁡(xi|x1⁢⁢…⁢⁢xi-1⁢Cp-m+ip-1)Pr⁡(wq)]·Pr⁡(wq|Wq-n+1q-1),(9)
with the convention that x0can be the empty string.

Expression (9) can be interpreted as an enhanced word n-gram incorporating intelligence from a character m-gram relative to a baseline word unigram containing no character information. The standard word n-gram probability can be weighted using character information. For example, if the character m-gram model predicts the current word with a higher probability than would have been predicted using only (word) unigram information, the standard word n-gram probability can be boosted accordingly. If, on the other hand, the word unigram model predicts the current word with a higher probability than the character m-gram model, the word n-gram probability can be reduced accordingly.

Referring back to process200ofFIG. 2, in one example, expression (9) can be used at block208to determine an integrated probability of the predicted word based on the probability of the predicted character. In particular, expression (9) can utilize the probability of predicted words from a word n-gram model based on previously entered words, as at block204of process200. In addition, expression (9) can utilize the probability of predicted characters from a character m-gram model based on previously entered characters, as at block206of process200. At block208, these probabilities can be combined as in expression (9) to produce an integrated probability of predicted words based on probabilities of predicted characters. It should be appreciated that other weighting effects are possible that combine the word n-gram model and character m-gram model in a similar fashion.

It should be appreciated that this weighting operation can be done specifically based on the local context observed (as opposed to a global weighting as in, for example, linear interpolation). In particular, in the case of a frequently observed word, the unigram probability can tend to be large, thus limiting the influence of the character m-gram model in favor of the word n-gram model. On the other hand, in the case of an unseen or rarely observed word, the unigram probability can tend to be small, and the character m-gram model can thus be given comparatively more importance.

Referring again to process200ofFIG. 2, at block210, the predicted word can be displayed based on the integrated probability determined at block208(e.g., based on integrated probabilities produced from expression (9) or a similar weighting function). In one example, integrated probabilities for a set of candidate words can be determined as at blocks204,206, and208. In response to one or more of those integrated probabilities exceeding a threshold, the corresponding candidate words can be displayed for a user as predicted words. In some examples, such a threshold can be determined empirically. A user can select a displayed predicted word or phrase, and the selected word or phrase can be entered as text input in its entirety without the user having to manually enter each of the characters making up the word or phrase.

If it is determined that a predicted word should not yet be displayed at block210(e.g., if no integrated probability exceeds a predetermined threshold and/or a reduction in entropy fails to exceed a predetermined threshold as discussed in further detail below), process200can continue at block202awaiting further input from a user. For example, blocks202,204,206, and208can be repeated with the addition of each new character entered by a user, and a determination can be made for each new character whether a predicted word should be displayed based on newly determined integrated probabilities of candidate words.

FIG. 3illustrates such recalculation at time352after two-character partial expansion of the current word (e.g., k=3). As shown, by time352, two additional characters x1and x2have been revealed since time350(e.g., these characters were entered by the user since time350). In one example, the inputs to character language model336can be updated as shown to include the newly added characters x1and x2and likewise to exclude characters cp−m+1and cp−m+2as these characters may have fallen outside the relevant character history length m. The current character of interest then becomes x3. In one example, the set of candidate words for predicted word342can be constrained to only those words beginning with x1x2. The analysis in process200can be updated given the newly revealed characters and word constraints, yielding updated integrated probabilities of candidate words. In response to those updated integrated probabilities exceeding a threshold (and/or in response to a significant reduction in entropy as discussed below), a predicted word can be displayed at block210of process200(or previously displayed word predictions can be updated based on the updated integrated probabilities).

It should be appreciated that process200ofFIG. 2and the observed context and prediction ofFIG. 3are illustrative examples, and various modifications will be apparent to those of ordinary skill in the art. For example, it should be understood that, although separated out into three different blocks inFIG. 2, blocks204,206, and208can be combined into a single function (e.g., as in expression (9)). Various other modifications are also possible.

FIG. 4illustrates exemplary process400for determining word prediction candidates to be displayed based on prediction set entropies. For example, process400can be used in conjunction with process200ofFIG. 2to determine whether candidate words should be displayed to a user (e.g., to determine whether candidate words have sufficient predictive value that they should be surfaced to a user and occupy screen real estate). Process400can also be used in conjunction with other word prediction approaches to determine whether word prediction candidates should be displayed. In one example, process400can be executed on processor104of system100discussed above with reference toFIG. 1.

At block402, a first typed character can be received from a user. The character can be received in any of a variety of ways, such as from keyboard116in system100discussed above. The user-entered character received at block402can be directed to any type of text entry interface or environment on a user device. For example, such an interface could be configured for typing text messages, emails, web addresses, documents, presentations, search queries, media selections, commands, form data, calendar entries, notes, or the like. The character received at block402can be used to predict a word. For example, the received character can be used in process200discussed above or in any other word prediction process.

At block404, a first entropy of a first set of possible word completions can be determined. In a typical word prediction process (such as process200discussed above), the number of possible word completions or prediction candidates at any given point can be limited by the number of words in the vocabulary that satisfy the current constraints imposed by already-entered text (e.g., constraining the set of possible word completions to words with a given prefix of k characters). For example, at block404, the first set of possible word completions can uniformly include the first typed character from block402as part of a prefix, as all other candidates failing to satisfy this condition could have been removed as candidates. In some instances, the constrained set can still tend to be too large to provide a significant level of confidence for surfacing prediction results to the user (e.g., displaying results). As discussed in further detail below, a measure of entropy of the possible completions can be used to decide when to present word predictions to the user. A variety of different entropy calculations can be used. In one example, an entropy calculation as in expression (10) below can be used.

At block406, a second typed character can be received from the user. At block408, a second entropy of a second set of possible word completions can be determined. As at block404, the entropy can be determined in any of a variety of ways, including according to expression (10) discussed below. In one example, the second set of possible word completions can uniformly include both the first typed character from block402and the second typed character from block406in succession as part of a prefix. The second set of possible word completions can thus be a subset of the first set of possible word completions (e.g., candidate words having a prefix of the first and second typed characters can likely be a subset of candidate words having a prefix of the first typed character). The addition of the second typed character can thus limit the set of predicted word candidates, as only a subset of previously predicted candidates is likely to include the second typed character.

At block410, a reduction in entropy can be determined from the first entropy at block404to the second entropy at block408. In other words, using entropy as a measurement, the relative change in the prediction set due to the addition of the second character at block406can be determined. This can signify the amount of information that was revealed by the addition of the second character. For example, in some instances, the addition of a character may not reveal much information and may not significantly limit the set of possible word completions. In other instances, however, the addition of a character may significantly reduce the set of possible word completions, meaning the additional character provided significant predictive value. The reduction in entropy value at block410can thus represent the comparative strength of the current word prediction set.

At block412, a determination can be made as to whether the entropy reduction determined at block410exceeds a threshold. In some examples, such a threshold can be tuned empirically for particular applications. In addition, in some examples, the threshold can change depending on the length of the existing known prefix (e.g., a first threshold when no characters are known, a second threshold when one character is known, a third threshold when two characters are known, etc.).

If the entropy reduction exceeds the relevant threshold (the “yes” branch), at block416, a candidate word can be caused to be displayed from the second set of possible word completions. In some examples, multiple candidate words from the second set can be displayed according to their probability. For example, the top three candidates having the highest probability can be displayed. In other examples, a word probability threshold can be applied, and only the top candidates having a probability above the word probability threshold can be displayed (or a subset given space constraints, maximum word prediction constraints, user preference, or the like). It should be appreciated that the displayed candidates can have significant predictive value for the user given that the entropy reduction threshold can limit word prediction intrusion until the set of possible word completions is deemed to have been sufficiently limited. This entropy-derived limitation can thus provide a desirable user experience where intrusion into frequently-limited screen real estate can be reserved for candidates with high predictive value.

If, however, the entropy reduction does not exceed the relevant threshold (the “no” branch), at block414, an entropy reduction determination can be repeated for each new character that is revealed until the threshold is met, at which point a candidate word or words can be displayed as in block416. In this manner, the entropy reduction determination can be successively applied as new characters are revealed to strategically determine at which point word prediction candidates should be surfaced and displayed to a user from the set of possible word completions.

In some examples, process400can be modified or employed differently depending on where the current character of interest is positioned compared to a word boundary. For example, at a word boundary (e.g., after a space), prediction candidates can be displayed without regard to entropy calculations. After a character is revealed, entropy reduction can be determined compared to the candidate set at the word boundary, and the determination at block412can proceed as discussed above. In this example, the space between words can be considered the first typed character at block402, and the revealed character of the word can be considered the second typed character at block406.

It should be understood that, in some examples, the explicit entropy calculations described with reference to blocks404and408can be excluded, and an entropy reduction can be determined at block410in other ways. For example, as described below with reference to expression (17), entropy reduction can be determined based on the possible word completions that are eliminated upon the addition of a character.

For explanation purposes, the following expressions reference the variables and expressions discussed above for process200. Like variables and expressions can be assumed to be the same. It should be appreciated, however, that the concepts of entropy reduction calculations discussed herein need not be restricted to the word prediction discussed with regard to process200above, and one of ordinary skill in the art will be able to apply these concepts to other word prediction mechanisms.

For reference, Pk(wq) can denote the joint probability Pr(wqx1. . . xk|Wq−n+1q−1Cp−m+1p−1), with a k-character partial expansion (e.g., k characters have been revealed so far for the current word of interest). The entropy H of the set of possible completions given a k-character partial expansion can be described as follows:

Hk=-∑wq∈Vx1⁢…⁢⁢xk⁢⁢Pk⁡(wq)⁢log⁢⁢Pk⁡(wq).(10)
As noted above, the expression Vx1. . . xkcan represent the set of words in the vocabulary whose first k characters are x1. . . xk. The entropy summation can thus include all candidate words wqin the vocabulary whose first k characters are x1. . . xk. Now Pk+1(wq) can denote the same joint probability when another character has been observed (e.g., a new character beyond k). In particular, with the newly-observed character xk+1, the joint probability can be expressed as Pr(wqx1. . . xkxk+1|Wq−n+1q−1Cp−m+1p−1). The entropy of the set of possible completions given the additional character xk+1can become:

Hk+1=-∑wq∈Vx1⁢…⁢⁢xk⁢xk+1⁢⁢Pk+1⁡(wq)⁢log⁢⁢Pk+1⁡(wq),(11)
where normally |Vx1. . . xkxk+1|«|Vx1. . . xk| (e.g., the set of words in the vocabulary whose first k characters are x1. . . xkxk+1can typically be much smaller than the set of words in the vocabulary whose first k characters are x1. . . xk).

Referring back to expression (9) for an enhanced word n-gram incorporating intelligence from a character m-gram relative to a baseline word unigram containing no character information, and because all other terms cancel out, the following ratio can be derived:

Pk+1⁡(wq)Pk⁡(wq)=(1Vx1⁢…⁢⁢xk⁢xk+1⁢∑w∈Vx1⁢…⁢⁢xk⁢xk+1⁢⁢Pr⁡(w))·∏i=1k+1⁢⁢Pr⁡(xi|x1⁢…⁢⁢xi-1⁢Cp-m+ip-1)(1Vx1⁢…⁢⁢xk⁢∑w∈Vx1⁢…⁢⁢xk⁢⁢Pr⁡(w))·∏i=1k⁢⁢Pr⁡(xi|x1⁢⁢…⁢⁢xi-1⁢Cp-m+ip-1).(12)
In some examples, the average unigram probability may not vary significantly with the addition of one more character in most instances. In addition, the order of the character m-gram model can be assumed to be large enough that conditioning on one extra character may not lead to appreciably different results. With these observations, in some examples, expression (12) can be simplified to the following:

Pk+1⁡(wq)Pk⁡(wq)≈Pr⁡(xk+1|x1⁢⁢…⁢⁢xk⁢Cp-m+k+1p-1)Pr⁡(cp-m+k),(13)
where cp−m+kcan refer to the least recent character in the m-character span ending at index k. Notably, the right-hand side of expression (13) can depend on the character language model only, and not on the word language model. Furthermore, while this ratio can vary with individual values of the characters involved, on the average it can tend to be bounded around unity as denoted by the following:

Pr⁡(xk+1|x1⁢⁢…⁢⁢xk⁢Cp-m+k+1p-1)Pr⁡(cp-m+k)-1≤ɛ,(14)
where ε can be suitably “small” (e.g., zero or practically zero). From this, a reasonable first-order approximation can be that Pk+1(wq)≈Pk(wq), which can therefore mean that expression (11) can also be expressed as follows:

In some examples, for further manipulation, expression (10) can be rewritten as follows:

Hk=-∑wq∈Vx1⁢…⁢⁢xk⁢xk+1⁢⁢Pk⁡(wq)⁢log⁢⁢Pk⁡(wq)-∑wq∈Vx1⁢…⁢⁢xk⁢xk+1_⁢⁢Pk⁡(wq)⁢log⁢⁢Pk⁡(wq),(16)
where Vx1. . . xkxk+1can refer to the set of all words from the vocabulary whose first k characters are x1. . . xk, but whose next character is not xk+1(as expressed by the bar notation ofxk+1). This can lead to a difference in entropy that can be expressed as follows:

Hk+1-Hk≈∑wq∈Vx1⁢…⁢⁢xk⁢xk+1_⁢⁢Pk⁡(wq)⁢log⁢⁢Pk⁡(wq)≤0.(17)
In other words, expression (17) can represent the reduction in entropy that ensues when xk+1is revealed. This reduction in entropy can thus be conveyed directly in terms of all possible completions that are eliminated upon the addition of one extra character at index (k+1). In other words, in some examples, the reduction in entropy from the addition of a character can be computed based on the word candidates that become disqualified by the revelation of the new character. In other examples, entropy can be computed at each character addition, cached for future reference, and used to calculate reduction in entropy after a new character is added. It should be appreciated that many other methods for determining a reduction in entropy can be used in any of the processes discussed herein.

FIG. 5illustrates exemplary process500for determining word prediction candidates to be displayed based on entropy reduction. Similar to process400discussed above, process500demonstrates another example of employing entropy calculations to determine whether candidate words should be displayed to a user. In one example, process500can be used in conjunction with a word prediction algorithm, such as process200ofFIG. 2. Process500can be executed on processor104of system100discussed above with reference toFIG. 1.

At block502, a first typed character can be received from a user. The character can be received in any of a variety of ways, such as from keyboard116in system100discussed above. The user-entered character received at block502can be directed to any type of text entry interface or environment on a user device. For example, such an interface could be configured for typing text messages, emails, web addresses, documents, presentations, search queries, media selections, commands, form data, calendar entries, notes, or the like. The character received at block502can be used to predict a word. For example, the received character can be used in process200discussed above or in any other word prediction process.

At block504, first probabilities of a first set of possible word completions can be determined based on the first typed character received at block502. For example, a word prediction process, such as process200discussed above, can be employed to determine the probability that candidate words complete the user's desired text entry (e.g., correspond to the user's eventual desired word). In one example, expression (9) discussed above can be used to determine these probabilities given the available word and character history (including the first typed character from block502). In particular, a standard word n-gram probability can be integrated with observed character information to arrive at the first probabilities of the first set of possible word completions. It should be appreciated that the first set of possible word completions can be limited to words in the vocabulary having a prefix that includes the first typed character from block502.

At block506, a second typed character can be received from the user. At block508, second probabilities of a second set of possible word completions can be determined based on both the first typed character from block502and the second typed character from block506. As at block504, a word prediction process, such as process200discussed above, can be employed to determine the second probabilities of the second set of possible word completions. In some examples, the word prediction process can be employed to narrow the first set of possible word completions based on the second typed character to arrive at the second set of possible word completions. For example, the first character from block502and the second character from block506can define at least a part of a prefix of a user's desired word. The second set of possible word completions can thus be a subset of the first set of possible word completions at block504given the revelation of the second typed character limiting candidate words to those having prefixes including both the first and second typed characters. The addition of the second typed character can thus limit the set of predicted word candidates, as only a subset of previously predicted candidates is likely to include the second typed character in addition to the first.

At block510, a reduction in entropy from the first probabilities of the first set to the second probabilities of the second set can be determined. For example, a reduction in entropy can be determined as described above with reference to expression (17) based on the possible word completions that are eliminated upon the addition of a character. In particular, reduction in entropy can be determined based on the probabilities that are disqualified from the first set of block504in arriving at the second set of block508based on the revelation of the second typed character at block506. In another example, entropy reduction can be determined by calculating the entropy (e.g., according to expression (10) discussed above) of the first probabilities of the first set from block504, calculating the entropy of the second probabilities of the second set from block508, and determining the reduction in entropy from the first to the second by taking the difference. In still other examples, entropy reduction can be determined in any of a variety of other ways.

Notably, according to the examples discussed herein, entropy can be used as a measurement of the relative change in the prediction set due to the addition of the second character at block506. This can signify the amount of information that was revealed by the addition of the second character. For example, in some instances, the addition of a character may not reveal much information and may not significantly limit the entropy of the first probabilities of the first set of possible word completions. In other instances, however, the addition of a character may significantly reduce the entropy of the first probabilities of the first set of possible word completions, meaning the additional character provided significant predictive value. The reduction in entropy value at block510can thus represent the comparative strength of the current word prediction set.

At block512, a determination can be made as to whether the entropy reduction determined at block510exceeds a threshold. In some examples, such a threshold can be tuned empirically for particular applications. In addition, in some examples, the threshold can change depending on the length of the existing known prefix (e.g., a first threshold when no characters are known, a second threshold when one character is known, a third threshold when two characters are known, etc.).

If the entropy reduction exceeds the relevant threshold (the “yes” branch), at block516, a candidate word can be caused to be displayed from the second set of possible word completions. In some examples, multiple candidate words from the second set can be displayed according to their probability. For example, the top three candidates having the highest probability can be displayed. In other examples, a word probability threshold can be applied, and only the top candidates having a probability above the word probability threshold can be displayed (or a subset given space constraints, maximum word prediction constraints, user preference, or the like). It should be appreciated that the displayed candidates can have significant predictive value for the user given that the entropy reduction threshold can limit word prediction intrusion until the set of possible word completions is deemed to have been sufficiently limited. This entropy-derived limitation can thus provide a desirable user experience where intrusion into frequently-limited screen real estate can be reserved for candidates with high predictive value.

If, however, the entropy reduction does not exceed the relevant threshold (the “no” branch), at block514, an entropy reduction determination can be repeated for each new character that is revealed until the threshold is met, at which point a candidate word or words can be displayed as in block516. In this manner, the entropy reduction determination can be successively applied as new characters are revealed to strategically determine at which point word prediction candidates should be surfaced and displayed to a user from the set of possible word completions.

In some examples, process500can be modified or employed differently depending on where the current character of interest is positioned compared to a word boundary. For example, at a word boundary (e.g., after a space), prediction candidates can be displayed without regard to entropy calculations. After a character is revealed, entropy reduction can be determined compared to the candidate set at the word boundary, and the determination at block512can proceed as discussed above. In this example, the space between words can be considered the first typed character at block502, and the revealed character of the word can be considered the second typed character at block506.

FIG. 6illustrates exemplary process600for predicting words and displaying them according to entropy reduction. For reference, variables and expressions are used that are similar to those discussed above, and the concepts discussed above can be applied similarly in this example. Likewise, the concepts and particular examples described for process600can be applied to any of the processes discussed herein. For purposes of process600, however, as compared to expression (17) derived above, let k correspond to the current character, and k−1 correspond to the previous character, such that the relevant entropy reduction equation can be rewritten as Hk−Hk−1. One of ordinary skill in the art will understand that the calculations can be equivalent, and the notations can simply be changed for referential simplicity (e.g., referring to the current and previous characters as opposed to the current and next characters).

At block602, at a word boundary (e.g., as at time350inFIG. 3, after receiving a space character, or the like), a list of most likely next words can be displayed based on a word n-gram model. For example, the most likely next words can be determined according to the integrated model discussed above with reference to process200. At the word boundary, in this example, k=0. Referring to expression (3) above, given k=0 (e.g., there is no partial character expansion yet observed), the joint probability of the current word wqand the null partial character expansion can simplify to the following:
Pr(Wq|Wq−n+1q−1Cp−m+1p−1)≈Pr(wq|Wq−n+1q−1),   (18)
which in practice can reduce to the word n-gram noted at block602inFIG. 6. A word n-gram model can thus provide an initial set of word predictions at the word boundary. In one example, a predetermined number of words having the highest likelihoods can be displayed. In another example, a subset of candidate words having likelihoods above a predetermined threshold can be displayed.

At block604, the variable k can be given an initial value of 1 as a first character x1of the next word is received from a user. At block606, sets Vx1. . . xkand Vx1. . .xkcan be determined. In particular, the set of words in the vocabulary beginning with revealed characters x1. . . xkcan be determined, and the set of words in the vocabulary that have been disqualified for failing to begin with revealed characters x1. . . xkcan be determined. At this point in this example, given the first character x1, these sets can include Vx1, in which all words begin with x1, and set Vx1, in which all words do not begin with x1.

At block608, the integrated probability Pkcan be computed along with the entropy reduction Hk−Hk−1. For example, given the revealed characters, the integrated probability Pkcan be computed according to expression (9) discussed above. In particular, the integrated probability can include an enhanced word n-gram incorporating intelligence from a character m-gram relative to a baseline word unigram containing no character information. At this point in this example, given the first character x1, the integrated probability can be computed as follows:

P1⁡(wq)=[(1Vx1⁢∑w∈Vx1⁢⁢Pr⁡(w))·Pr⁡(x1|Cp-m+1p-1)Pr⁡(wq)]·Pr⁡(wq|Wq-n+1q-1),(19)
where Vx1can be the set of words in the vocabulary that start with x1.

At this point in this example, the entropy reduction Hk−Hk−1can be computed using the value obtained from expression (19) as follows:

H1-H0=∑wq∈Vx1_⁢⁢P1⁡(wq)⁢log⁢⁢P1⁡(wq),(20)
where Vx1can be the set of words in the vocabulary that do not start with x1.

At block610, it can be determined whether Hk−Hk−1is greater than a threshold. For example, the result from block608can be compared to an empirically tuned threshold θ1. If the entropy reduction is high enough (H1−H0>θ1, the “yes” branch), the top candidates starting with x1can be displayed at block612based on the substantial reduction in entropy. Otherwise, in some examples, no candidates can be displayed based on the theory that character x1may not have offered enough information to present meaningful completions to the user. At the “no” branch, the index k can be incremented at block616, and the process can continue at block606as shown.

Assuming in this example that k was incremented at block616, a second character x2can be received from the user. Returning to block606, given the received characters x1x2, set Vx1x2can be determined, in which all words begin with x1x2, and set Vx1x2can be determined, in which all words do not begin with x1x2. At block608, the integrated probability Pkcan be computed along with the entropy reduction Hk−Hk−1. In particular, given the characters x1x2, the integrated probability can be computed as follows:

P2⁡(wq)=[(1Vx1⁢x2⁢∑w∈Vx1⁢x2⁢⁢Pr⁡(w))·Pr⁡(x2|x1⁢Cp-m+2p-1)·Pr⁡(x1|Cp-m+1p-1)Pr⁡(wq)]·Pr⁡(wq|Wq-n+1q-1),(21)
where Vx1x2can be the set of words in the vocabulary that start with x1x2.

At this point in this example, the entropy reduction Hk−Hk−1can be computed using the value obtained from expression (21) as follows:

H2-H1=∑wq∈Vx1⁢x2_⁢⁢P2⁡(wq)⁢log⁢⁢P2⁡(wq),(22)
where Vx1x2can be the set of words in the vocabulary that start with x1but do not contain x2as the second character following x1.

At block610, it can be determined whether H2−H1is greater than another empirically tuned threshold θ2. If the entropy reduction is high enough (H2−H1>θ2, the “yes” branch), the top candidates starting with x1x2can be displayed at block612based on the substantial reduction in entropy. Otherwise, in some examples, no candidates can be displayed based on the theory that characters x1x2still may not have offered enough information to present meaningful completions to the user. At the “no” branch, the index k can be incremented again at block616, and the process can continue again at block606awaiting receipt of the third character from the user, and so on.

Returning to the situations in which top candidates are displayed at block612, at block614, a determination can be made as to whether a suggestion has been accepted. In other words, it can be determined whether a user accepts and selects one of the top candidates displayed at block612. If no suggestion is accepted (the “no” branch), the process can continue by anticipating a new character will be entered: the index k can be incremented at block616and the process can return to block606upon receipt of the next character.

If a suggestion is accepted (the “yes” branch), the selected word can be entered into the typing interface and the process can continue with the next word: the process can return to block602and display a list of most likely next words based on a word n-gram model, taking into account the suggestion just accepted at block614. In other examples, receipt of a space character can similarly restart the process at block602, taking into account the word entered prior to the space character. Likewise, receipt of other symbols and characters signifying the completion of a word can restart the process at block602(e.g., periods, commas, semi-colons, colons, question marks, exclamation points, or the like).

By employing an entropy reduction threshold as with process600and other processes discussed herein, the user experience can be improved as, in some examples, only high-value suggestions can be presented to the user. This can also include the attendant benefit that the user need not monitor tentative predictions after each character, but only when it is deemed to be truly worth it. This in turn can enhance both text input speed and user experience.

FIG. 7illustrates exemplary process700for predicting and displaying words by combining a word n-gram language model and a character m-gram language model and displaying results according to entropy reduction. In some examples, process700can be performed in a similar manner as process600described above. Process700can combine word prediction process200described above with any of the entropy reduction thresholds discussed herein.

At block702, typed input can be received from a user. Typed input can be received in any of a variety of ways, such as from keyboard116in system100discussed above. The typed input can be directed to any type of text entry interface, and can include any form of text.

At block704, a word n-gram model can be used to determine probabilities of predicted words based on previously entered words. For example, a word n-gram model as discussed above with reference to expression (1) and word n-gram language model110ofFIG. 1can be used to determine the probability of a candidate word given available word history. This can occur, for example, at a word boundary before any characters are known for a subsequent word (e.g., after a space, period, or other break). In some examples, these probabilities can be used to cause predicted words to be displayed to a user based on the word probabilities (e.g., displaying top candidates).

In other examples where prefix characters for the current word may be known, the word n-gram model can be used in conjunction with a character m-gram model to predict word completions. For example, at block706, a character m-gram model can be used to determine probabilities of predicted characters based on previously entered characters (e.g., based on one or more prefix characters of the pertinent word). A character m-gram model as discussed above with reference to expression (2) and character m-gram language model112ofFIG. 1can be used to determine the probability of a candidate character given available character history (e.g., given one or more prefix characters).

At block708, integrated probabilities of predicted words can be determined based on probabilities of predicted characters. In one example, the probabilities from blocks704and706can be combined: word probabilities from block704can be integrated with corresponding character probabilities from block706(e.g., adding weight to words with prefixes matching likely character predictions, and removing weight from words with prefixes that diverge from likely character predictions). In another example, blocks704,706, and708can be combined in a single function that provides a word n-gram model probability integrated with character information, as from a character m-gram model. For example, expression (9) discussed above can be used to determine integrated probabilities of predicted words based on predicted characters. In particular, expression (9) can be used as an enhanced word n-gram incorporating intelligence from a character m-gram relative to a baseline word unigram containing no character information.

At block710, a reduction in entropy can be determined from previous integrated probabilities to current integrated probabilities. In one example, the entropy of the previous integrated probabilities can be determined using the set of predicted words and their associated integrated probabilities prior to receipt of the most recent character (e.g., prior to the most recent typed input from the user at block702). The entropy of the current integrated probabilities can be determined using the set of predicted words and their associated probabilities after having been updated based on receipt of the most recent character (e.g., after receiving the most recent typed input from the user at block702). Entropies can be calculated, for example, as discussed above with regard to expression (10), or using any other method. The reduction in entropy can then be determined from the difference in these calculations.

In another example, a reduction in entropy from previous integrated probabilities to current integrated probabilities can be determined at block710based on the set of predicted words that became disqualified based on receipt of the most recent character at block702. For example, a reduction in entropy based on receipt of the most recent character can be determined according to expression (17) discussed above.

At block712, a determination can be made as to whether the entropy reduction determined at block710exceeds a threshold. In some examples, such a threshold can be tuned empirically for particular applications. In addition, in some examples, the threshold can change depending on the length of the existing known prefix (e.g., a first threshold when no characters are known, a second threshold when one character is known, a third threshold when two characters are known, etc.).

If the entropy reduction exceeds the relevant threshold (the “yes” branch), at block714, predicted words can be caused to be displayed. In some examples, multiple predicted words can be displayed according to their integrated probabilities. For example, the top three candidates having the highest probabilities can be displayed. In other examples, a word probability threshold can be applied, and only the top candidates having a probability above the word probability threshold can be displayed (or a subset given space constraints, maximum word prediction constraints, user preference, or the like). It should be appreciated that the displayed predicted words can have significant predictive value for the user, given that the entropy reduction threshold can limit word prediction intrusion until the set of predicted words is deemed to have been sufficiently limited. This entropy-derived limitation can thus provide a desirable user experience where intrusion into frequently-limited screen real estate can be reserved for predicted words with high value.

If, however, the entropy reduction does not exceed the relevant threshold at block712(the “no” branch), process700can return to block702to await further input from the user. For example, if entropy of a current prediction set is still too large, displaying predicted words can be delayed until further input is received and more confidence is garnered in a narrower result set. In particular, process700can return to block702to receive another character from the user. The new character can be used to update the probabilities of blocks704,706, and708as discussed above. Given the updated results and likely narrower result set, entropy reduction can again be determined at block710, and a determination at block712can again be made as to whether the entropy reduction satisfies the relevant threshold. In some examples, the relevant entropy reduction threshold on a subsequent pass through process700can be different than in a prior iteration (e.g., differing based on the number of characters that have been revealed for the pertinent word). The process can then be repeated, for example, until the relevant threshold is met, at which point predicted words can be caused to be displayed at block714as discussed above.

In any of the various examples discussed herein, language models can be personalized for a particular user. For example, word n-gram language models and character m-gram language models discussed herein can be trained on user-specific information or modified according to user preferences, contacts, text, usage history, profile data, demographics, or the like. In addition, such models can be updated over time based on user interactions (e.g., frequently entered text or the like). Gathering and use of user data that is available from various sources can be used to improve the delivery to users of invitational content or any other content that may be of interest to them. The present disclosure contemplates that in some instances, this gathered data can include personal information data that uniquely identifies or can be used to contact or locate a specific person. Such personal information data can include demographic data, location-based data, telephone numbers, email addresses, home addresses, or any other identifying information.

The present disclosure recognizes that the use of such personal information data, in the present technology, can be used to the benefit of users. For example, the personal information data can be used to deliver targeted content that is of greater interest to the user. Accordingly, use of such personal information data enables calculated control of the delivered content. Further, other uses for personal information data that benefit the user are also contemplated by the present disclosure.

Despite the foregoing, the present disclosure also contemplates examples in which users selectively block the use of, or access to, personal information data. That is, the present disclosure contemplates that hardware and/or software elements can be provided to prevent or block access to such personal information data. For example, in the case of advertisement delivery services, the present technology can be configured to allow users to select to “opt in” or “opt out” of participation in the collection of personal information data during registration for services. In another example, users can select not to provide location information for targeted content delivery services. In yet another example, users can select to not provide precise location information, but permit the transfer of location zone information.

Therefore, although the present disclosure broadly covers use of personal information data to implement one or more various disclosed examples, the present disclosure also contemplates that the various examples can also be implemented without the need for accessing such personal information data. That is, the various examples of the present technology are not rendered inoperable due to the lack of all or a portion of such personal information data. For example, content can be selected and delivered to users by inferring preferences based on non-personal information data or a bare minimum amount of personal information, such as the content being requested by the device associated with a user, other non-personal information available to the content delivery services, or publicly available information.

In accordance with some examples,FIG. 8shows a functional block diagram of an electronic device800configured in accordance with the principles of the various described examples. The functional blocks of the device can be implemented by hardware, software, or a combination of hardware and software to carry out the principles of the various described examples. It is understood by persons of skill in the art that the functional blocks described inFIG. 8can be combined or separated into sub-blocks to implement the principles of the various described examples. Therefore, the description herein optionally supports any possible combination or separation or further definition of the functional blocks described herein.

As shown inFIG. 8, electronic device800can include a display unit802configured to display a text entry interface, and a typed input receiving unit804configured to receive typed input from a user. In some examples, typed input receiving unit804can be integrated with display unit802(e.g., as in a touchscreen). Electronic device800can further include a processing unit806coupled to display unit802and typed input receiving unit804. In some examples, processing unit806can include a predicted word determining unit808, a predicted character determining unit810, and an integrated probability determining unit812.

Processing unit806can be configured to receive typed input from a user (e.g., from typed input receiving unit804). Processing unit806can be further configured to determine (e.g., using predicted word determining unit808), using a word n-gram model, a probability of a predicted word based on a previously entered word in the typed input. Processing unit806can be further configured to determine (e.g., using predicted character determining unit810), using a character m-gram model, a probability of a predicted character based on a previously entered character in the typed input. Processing unit806can be further configured to determine (e.g., using integrated probability determining unit812) an integrated probability of the predicted word based on the probability of the predicted word and the probability of the predicted character. Processing unit806can be further configured to cause the predicted word to be displayed (e.g., using display unit802) based on the integrated probability.

In some examples, processing unit806can be further configured to determine (e.g., using predicted word determining unit808) the probability of the predicted word based on a plurality of words in the typed input. In some examples, the plurality of words comprises a string of recently entered words. For example, recently entered words can include words entered in a current input session (e.g., in a current text message, a current email, a current document, etc.). For predicting words, the recently entered words can include the last n words entered (e.g., the last three words, the last four words, the last five words, or any other number of words). Processing unit806can be further configured to determine (e.g., using predicted character determining unit810) the probability of the predicted character based on a plurality of characters in the typed input. In some examples, the plurality of characters comprises a string of recently entered characters. For example, recently entered characters can include characters in a current input session, including the last m characters entered (e.g., the last three characters, the last four characters, the last five characters, or any other number of characters). Processing unit806can be further configured to determine (e.g., using integrated probability determining unit812) the integrated probability of the predicted word by determining a joint probability of the predicted word and the predicted character.

In some examples, processing unit806can be further configured to determine first probabilities of a first set of possible word completions based on a first typed character in the typed input (e.g., using predicted word determining unit808), wherein the first set of possible word completions comprises the predicted word, and wherein the first probabilities comprise the integrated probability of the predicted word. Processing unit806can be further configured to determine second probabilities of a second set of possible word completions based on the first typed character and a second typed character in the typed input (e.g., using predicted character determining unit810), wherein the second set of possible word completions comprises the predicted word. Processing unit806can be further configured to determine a reduction in entropy from the first probabilities of the first set to the second probabilities of the second set. Processing unit806can be further configured to cause the predicted word to be displayed (e.g., using display unit802) in response to the reduction in entropy exceeding a threshold. In some examples, processing unit806can be further configured to determine the reduction in entropy based on third probabilities of a third set of possible word completions, the third set of possible word completions comprising words in the first set of possible word completions other than words in the second set of possible word completions.

In accordance with some examples,FIG. 9shows a functional block diagram of an electronic device900configured in accordance with the principles of the various described examples. The functional blocks of the device can be implemented by hardware, software, or a combination of hardware and software to carry out the principles of the various described examples. It is understood by persons of skill in the art that the functional blocks described inFIG. 9can be combined or separated into sub-blocks to implement the principles of the various described examples. Therefore, the description herein optionally supports any possible combination or separation or further definition of the functional blocks described herein.

As shown inFIG. 9, electronic device900can include a display unit902configured to display a text entry interface, a first typed character receiving unit904configured to receive a first typed character from a user, and a second typed character receiving unit906configured to receive a second typed character from a user. In some examples, first and second typed character receiving units904and906can be integrated into a single unit, and/or can be integrated with display unit902(e.g., as in a touchscreen). Electronic device900can further include a processing unit908coupled to display unit902and first and second typed character receiving units904and906. In some examples, processing unit908can include a first entropy determination unit910, a second entropy determination unit912, and an entropy reduction determination unit914.

Processing unit908can be configured to receive a first typed character from a user (e.g., from first typed character receiving unit904). Processing unit908can be further configured to determine (e.g., using first entropy determining unit910) a first entropy of a first set of possible word completions based on first probabilities of the first set of possible word completions, wherein the first probabilities are based on the first typed character. Processing unit908can be further configured to receive a second typed character from a user (e.g., from second typed character receiving unit906). Processing unit908can be further configured to determine (e.g., using second entropy determining unit912) a second entropy of a second set of possible word completions based on second probabilities of the second set of possible word completions, wherein the second probabilities are based on the first typed character and the second typed character. Processing unit908can be further configured to determine (e.g., using entropy reduction determining unit914) a reduction in entropy from the first entropy to the second entropy. Processing unit908can be further configured to—responsive to the reduction in entropy exceeding a threshold—cause a candidate word to be displayed (e.g., using display unit902) from the second set of possible word completions.

In some examples, processing unit908can be further configured to determine the first probabilities of the first set of possible word completions by determining, using a word n-gram model, third probabilities of a plurality of predicted words based on the first typed character; determining, using a character m-gram model, fourth probabilities of a plurality of predicted characters based on the first typed character; and determining the first probabilities of the first set of possible word completions based jointly on the third probabilities and the fourth probabilities. In some examples, processing unit908can be further configured to determine the second probabilities of the second set of possible word completions by determining, using the word n-gram model, fifth probabilities of a plurality of predicted words based on the first typed character and the second typed character; determining, using the character m-gram model, sixth probabilities of a plurality of predicted characters based on the first typed character and the second typed character; and determining the second probabilities of the second set of possible word completions based jointly on the fifth probabilities and the sixth probabilities.

In some examples, processing unit908can be further configured to determine (e.g., using entropy reduction determining unit914) the reduction in entropy based on third probabilities of a third set of possible word completions, the third set of possible word completions comprising words in the first set of possible word completions other than words in the second set of possible word completions.

In accordance with some examples,FIG. 10shows a functional block diagram of an electronic device1000configured in accordance with the principles of the various described examples. The functional blocks of the device can be implemented by hardware, software, or a combination of hardware and software to carry out the principles of the various described examples. It is understood by persons of skill in the art that the functional blocks described inFIG. 10can be combined or separated into sub-blocks to implement the principles of the various described examples. Therefore, the description herein optionally supports any possible combination or separation or further definition of the functional blocks described herein.

As shown inFIG. 10, electronic device1000can include a display unit1002configured to display a text entry interface, a first typed character receiving unit1004configured to receive a first typed character from a user, and a second typed character receiving unit1006configured to receive a second typed character from a user. In some examples, first and second typed character receiving units1004and1006can be integrated into a single unit, and/or can be integrated with display unit1002(e.g., as in a touchscreen). Electronic device1000can further include a processing unit1008coupled to display unit1002and first and second typed character receiving units1004and1006. In some examples, processing unit1008can include a first probabilities determining unit1010, a second probabilities determining unit1012, and an entropy reduction determining unit1014.

Processing unit1008can be configured to receive a first typed character from a user (e.g., from first typed character receiving unit1004). Processing unit1008can be further configured to determine (e.g., using first probabilities determining unit1010) first probabilities of a first set of possible word completions based on the first typed character. Processing unit1008can be further configured to receive a second typed character from a user (e.g., from second typed character receiving unit1006). Processing unit1008can be further configured to determine (e.g., using second probabilities determining unit1012) second probabilities of a second set of possible word completions based on the first typed character and the second typed character. Processing unit1008can be further configured to determine (e.g., using entropy reduction determining unit1014) a reduction in entropy from the first probabilities of the first set to the second probabilities of the second set. Processing unit1008can be further configured to—responsive to the reduction in entropy exceeding a threshold—cause a candidate word to be displayed (e.g., using display unit1002) from the second set of possible word completions.

In some examples, processing unit1008can be further configured to determine (e.g., using first probabilities determining unit1010) the first probabilities by determining, using a word n-gram model, third probabilities of a plurality of predicted words based on the first typed character; determining, using a character m-gram model, fourth probabilities of a plurality of predicted characters based on the first typed character; and determining the first probabilities based jointly on the third probabilities and the fourth probabilities. In some examples, processing unit1008can be further configured to determine (e.g., using second probabilities determining unit1012) the second probabilities by determining, using the word n-gram model, fifth probabilities of a plurality of predicted words based on the first typed character and the second typed character; determining, using the character m-gram model, sixth probabilities of a plurality of predicted characters based on the first typed character and the second typed character; and determining the second probabilities based jointly on the fifth probabilities and the sixth probabilities.

In some examples, processing unit1008can be further configured to determine (e.g., using entropy reduction determining unit1014) the reduction in entropy based on third probabilities of a third set of possible word completions, the third set of possible word completions comprising words in the first set of possible word completions other than words in the second set of possible word completions.

Although examples have been fully described with reference to the accompanying drawings, it is to be noted that various changes and modifications will become apparent to those skilled in the art (e.g., modifying any of the systems or processes discussed herein according to the concepts described in relation to any other system or process discussed herein). Such changes and modifications are to be understood as being included within the scope of the various examples as defined by the appended claims.