Generating string predictions using contexts

In a mobile device, a context is determined for the mobile device. The context is determined based on a variety of characteristics of the mobile device environment including, for example, the current application being used, any contacts that a user of the mobile device is interacting with or having a conversation with, the current date and/or time, a current topic of the conversation, a current style of the conversation, etc. Based on a set of strings associated with the determined context and user generated text, one or more string predictions are generated for the user generated text. The string predictions may be presented to the user as suggested completions of the user generated text.

BACKGROUND

Typing is part of many scenarios on a mobile device, including writing a text message, writing an email, searching for a contact, and typing a URL (uniform resource locator), for example. Typing on a mobile device can be slow and frustrating. This can be especially true when using an on-screen software keyboard.

One solution to this problem is known as a soft input panel. In a soft input panel, a region of the screen may display suggested word predictions based on the characters that a user has entered so far into a text input field. The suggested words change as the user continues to enter characters into the field. When the user sees a word prediction that matches the word that the user is entering, the user may select the word prediction and the selected word is placed in the text input field as a replacement for the characters entered by the user.

Typically, the word predictions shown to the user are generated by matching the entered characters against words in a dictionary, and then presenting a ranked subset of the matching words based on a likelihood that each word is the word that the user intends to enter. The likelihood may be based on the overall probability of usage of each matching word by the general population.

One drawback to such a method for providing word predictions is that it fails to take into account a context associated with the characters being entered. The context may include the application that the user is using (i.e., short message service (SMS) or email application), and the parties that the user is communicating with, a location of the user, the date or time of day, who the user communicated with earlier, or even a mood associated with the user. Typically, a user uses a set of vocabulary that may vary depending on the context of the conversation. For example, a user may use a different set of phrases when in conversations with business contacts than in conversations with friends, or may use a different set of phrases when using an SMS application than when using a word processing application. By not considering the context when generating predictions, the user may receive word predictions that are too broad, or that are inappropriate for the particular context.

SUMMARY

In a mobile device, a context is determined for the mobile device. The context is determined based on characteristics of the mobile device environment and may include, for example, the current application being used, any contacts that a user of the mobile device is interacting with or having a conversation with, the current date and/or time, a current topic of the conversation, a current style of the conversation, etc. Based on a set of strings associated with the determined context and user generated text, one or more string predictions are generated for the user generated text. The string predictions may be presented to the user as suggested completions of the user generated text. Alternatively or additionally, voice notes or emoticons may be generated based on the determined context.

In an implementation, a string is received by a computing device. The received string is associated with an application. A context for the received string is determined by the computing device. String predictions are generated based on the received string and the determined context. Each string prediction comprises a string. One or more of the strings of the string predictions are provided by the computing device. An indication of selection of one of the provided strings is received by the computing device. In response to the indication of selection, the selected string is provided to the application by the computing device.

In an implementation, a context for a received string is determined. It is determined whether a criterion is met by the received string. If the criterion is met by the received string, the received string is added to a plurality of strings associated with the context.

DETAILED DESCRIPTION

FIG. 1is an illustration of an example environment100for the selection and presentation of string predictions based on contexts. The environment100may include a plurality of computing devices115(e.g., computing devices115a-n). The computing devices115may be a variety of computing devices including mobile devices such as cell phones, smart phones, portable media players, game consoles, and the like. The computing devices115may communicate with one another through a network180. The network180may be a variety of network types including the public switched telephone network (PSTN), a cellular telephone network, and a packet switched network (e.g., the Internet). Examples of suitable computing devices115include the computing system500described with respect toFIG. 5.

Each of the computing devices115may include an operating system125and a user interface120. The operating system125may include a variety of well known operating systems. A user of the computing device115may use the user interface120to input one or more characters to the operating system125. The user interface120may include a variety of interfaces including a software keyboard or a hardware keyboard, for example.

Each of the computing devices115may further execute one or more applications135(e.g., applications135a-n). The applications135may be executed in an application layer130. The applications135may include email applications, short message service (SMS) or text applications, chat applications, social networking applications, and word processing applications, for example. The computing devices115may exchange text-based messages using the applications135. For example, each computing device may execute an SMS application and may send and receive SMS messages through the application. A sequence of related text-based messages is referred to herein as a conversation.

Each use of a computing device may interact with the applications135through the user interface120and the operating system125. In an implementation, a user may enter characters through a soft input panel of the user interface120. The entered characters may be received by the operating system125, and may be provided to one or more of the applications135.

Entering text, character by character, into the user interface120may be frustrating for users of the computing devices115. Accordingly, the computing device115may further include a candidate prediction generator140. The candidate prediction generator140may generate one or more string predictions. A string prediction may include a string that the candidate prediction generator140predicts that a user intends to enter into the user interface120. The string prediction may include a confidence value for the string. Alternatively or additionally, the candidate prediction generator140may generate voice notes, emoticons, or other communication or message types. The predicted string may include any sequence of one or more characters including, but not limited to, words, phrases, sentences, emoticons, punctuation marks or other symbols, or combinations thereof.

As described further with respect toFIG. 2, the string predictions may be based in part on one or more contexts associated with the entered character or string. A context as used herein may include one or more characteristics, features, or properties of the conversation or environment that is associated with the entered character or string. The characteristics or features of a context may include the particular application that the received text is for, the parties, contacts, or other users that are participating in the conversation, the current date and/or time, a tone of the conversation (i.e., sad or happy), a topic of the conversation, and a style of the conversation (i.e., formal or informal), a location of the user, users that the user communicated with earlier, and a mood of the user, for example.

Each context may be associated with a set of strings. The set of strings associated with a context may comprise strings that were used or provided during the context by a user, or that are otherwise known to be associated with the context. For example, a context associated with an SMS application may be associated with strings that are frequently used for text messages such as “LOL”. A context associated with a date such as January 1, may include strings that are associated with the New Year holiday such as “Happy New Year”. A context associated with a particular contact of the user may include one or more strings that the user has entered when interacting with the contact. The strings of the set of strings associated with a context may be associated with a probability. The probability of a string may be based on the number of times that the string was provided by the user, or other users, for the context.

In some implementations, when the user enters one or more characters of a string, the candidate prediction generator140may determine the context of the entered string, and may generate a set of string predictions based on the entered string and the determined context. In some implementations, the string predictions may include one or more strings from the set of strings associated with the context that has the entered string as a prefix, or that are otherwise similar to the entered string. Additionally, the string predictions may also include string predictions that were generated based on one or more models such as dictionaries, for example.

By generating string predictions based on a context, rather than solely based on a dictionary or a model, the generated string predictions are not limited to the words and phrases used in the dictionary or the model. Moreover, because the string predictions based on the context may be more narrowly tailored than string predictions based on the dictionary or the model, the strings may more accurately represent the string that the user intends to enter than the strings of the string predictions based on the dictionary or the model.

FIG. 2is an illustration of an example candidate prediction generator140. As shown, the candidate prediction generator140may include several components, including but not limited to, a context engine240and a prediction model205. Some or all of the components of the candidate prediction generator140may be implemented by a computing system, such as the computing system500illustrated inFIG. 5.

The candidate prediction generator140may receive entered text230from the operating system125. The entered text230may include a string or a character and may be text that was provided to an application135by a user of a computing device115. The entered text230may be related to, or may be a portion of, a string that the user intends, or intended to, provide to the application135. For example, the entered text230may be the first character of the string that the user intends to enter, or the entered text230may be a misspelling of the string that the user intended to enter. Thus, as may be appreciated, the candidate prediction generator140may be used to provide both phrase predictions and spelling suggestions to one or more applications135.

The context engine240may determine one or more contexts210for the entered text230, and may retrieve the determined one or more contexts210from a context storage260. In some implementations, each context210may include or may be associated with a plurality of strings. The plurality of strings associated with the context210may comprise strings that were entered by the user of the computing device115, or other users of other computing devices115, for the context210. For example, for a context210associated with a word processing application, the plurality of strings may include one or more strings frequently entered by the user into the word processing application. For a context associated with a conversation style that is formal, the plurality of strings may include one or more strings typically used during formal conversations by the user or other users. In some implementations, the strings of the plurality of strings associated with a context210may be based on the strings used by one or more other users of computing devices and may be collected and provided to the context engine240by an external administrator. Alternatively or additionally, as described further below, the strings associated with a context210may be determined by the context engine240.

As described above, a context may include one or more characteristics, features, or properties of a conversation220or environment that the user is providing the entered text230through. In some implementations, the context engine240may determine one or more contexts210for the entered text230by determining the characteristics associated with the entered text230, and determining one or more contexts210of the context storage260that match the determined characteristics.

The characteristics of a context210may include the type of application135that is associated with the entered text230. The application135that is associated with the entered text230may be the application135that the user is providing the entered text230to. The types of applications135may include SMS applications, word processing applications, email applications, and social networking applications, for example. Other types of applications may be supported. The context engine240may determine the type of the application135from the operating system120, for example.

The characteristics of the context210may include time and/or date related characteristics. As may be appreciated, the types of words or phrases that are provided by a user may vary based on the time of day, day of the week, or month, for example. For example, a user may use the phrase “Good Afternoon” in the afternoon and “Good Morning” in the morning. The words or phrases used by a user may be different during the weekend than during a weekday. Similarly, a user may be more likely to use certain holiday related words and phrases such as “Happy St. Patrick's Day” or “Happy Mother's Day” during a period of time surrounding the respective holidays. The context engine240may determine the time or date related characteristics from the operating system120, for example.

The characteristics of a context210may further be determined from the conversation220associated with the entered text230. In some implementations, a conversation220may include one or more strings from text-based messages generated by the user and one or more other users that are parties to the conversation220. For example, a conversation220may be a series of texts, emails, or social networking messages sent between the user of the computing device115and one or more other users of other computing devices115. In addition, the characteristics of the context may include the entities or parties that are mentioned or brought up during the conversation.

Examples of characteristics of the context210that may be determined by the context engine240from the conversation220associated with the entered text230may include one or more parties associated with the conversation220. For example, a user may be having an email conversation with two friends. The friends may be the parties of the conversation220. Users may use different words or phrases depending on the parties that they are communicating with (e.g., their mother versus a friend). The context engine240may determine the parties to the conversation220from the application135associated with the entered text230.

Further examples of characteristics of the context210that may be determined by the context engine240from the conversation220associated with the entered text230may include a style or tone of the conversation220. Examples of the style of the conversation220may include formal, informal, or business. Examples of the tone may include serious, sad, happy, and excited. Other tones or styles may be supported. Typically, users use a set of words or phrases in a conversation220that match the style or tone of the conversation220.

The context engine240may determine the style or tone of the conversation220based on the words or phrases used in the conversation220. In some implementations, the context engine240may look for words or phrases in the conversation220that are indicative of the style or tone of the conversation and may determine the style or tone of the conversation220based on the determined words. For example, the use of informal words such as “LOL” may indicate that the style of the conversation220is informal, and the use of exclamation marks may indicate that the tone of the conversation is likely happy or excited. In some implementations, the context engine240may continuously monitor the conversation220, and may update or change the style or tone of the conversation220as the conversation220progresses.

Further examples of characteristics of the context210that that may be determined by the context engine240from the conversation220associated with the entered text230may include a topic of the conversation220. Similarly to the style and tone described above, the context engine240may determine the topic of the conversation by looking for particular words or phrases in the conversation220. For example, multiple occurrences of “New York” and “trip” in the conversation220may indicate that the conversation220is about New York or vacations. The context engine240may continuously monitor the conversation220, and may update or change the topic of the conversation220as the conversation220progresses.

In some implementations, the context engine240may retrieve a context210matching each of the determined characteristics from the context storage260. Thus, if the context engine240determines that the context210associated with the entered text230has the characteristics of a formal tone, and the parties to the conversation are the user's parents, then the context engine240may retrieve a context210from the context storage260that has the characteristics of a formal tone, and the parties to the conversation are the user's parents. If no such context210exists in the context storage260, the context engine240may select a context210with characteristics that are the closest or most similar to the determined characteristics. Alternatively or additionally, rather than retrieving a single context210that has all of the determined characteristics from the context storage260, the context engine240may, for each characteristic, retrieve a context210that has the characteristic from the context storage260.

The candidate prediction generator140may generate one or more string predictions215based on the entered text230and the determined one or more contexts210. In some implementations, the string predictions215may be generated by the candidate prediction generator140by determining strings from the plurality of strings associated with each of the one or more contexts210that have the entered text230as a prefix. The confidence values for the determined strings may be determined by the number of the one or more contexts210that include the determined strings and the probabilities associated with each string of the one or more contexts210, for example.

In implementations where the string predictions215are used as spelling suggestions, rather than determining strings from the plurality of strings associated with each of the one or more contexts210that have the entered text230as a prefix, the candidate prediction generator140may determine strings from the plurality of strings that are similar to the entered text230. Any method for determining the similarity of strings may be used. Alternatively, the candidate prediction generator140may determine if the entered text230includes any possible misspellings of the strings from the plurality of strings associated with each of the one or more contexts210, and may generate the string predictions215using the determined strings.

The candidate prediction generator140may provide one or more of the generated string predictions215. Where there are many string predictions215, the candidate prediction generator140may select which string predictions215to provide based the confidence values associated with each string prediction215. The confidence values may be based on the probabilities associated with each of the strings associated with the determined one or more contexts210. For phrase prediction implementations, the strings of the provided string predictions215may be displayed to the user in a soft input panel of the user interface120. If the user selects a displayed string, the string may be provided as an input to the application135.

For spelling suggestion implementations, the strings of the provided string predictions215may be displayed near the entered text230, or as menu selections. If the user selects a displayed string, the selected string may replace the entered text230in the application135.

In addition to the contexts210, the candidate prediction generator140may also generate one or more string predictions215using a prediction model205. In an implementation, the prediction model205may comprise a dictionary, and may include a variety of strings (e.g., words or phrases), along with a probability for each string. The probability of each string may reflect the popularity of each string in general usage, for example. The probabilities may have been determined by collecting and analyzing the strings provided by users over a period time for one or more applications135in one or more conversations220, or may be based on an analysis of strings from newspapers, magazines, or other language sources, for example. Other types of models may be used.

In some implementations, the candidate prediction generator140may combine the string predictions215generated using the one or more contexts210with the string predictions215generated by the prediction model205. For example, the candidate prediction generator140may select the top string predictions (i.e., with the highest confidence values) generated using the one or more contexts210and the top string predictions of the prediction model205, and combine the selected string predictions.

In other implementations, the candidate prediction generator140may generate the one or more string predictions215using the one or more contexts210and the prediction model205. For example, the strings of the plurality of strings associated with the one or more contexts210may be incorporated into the model205, or the probabilities associated with the strings in the model205may be adjusted based on the strings associated with the one or more contexts210. Any changes or adjustments made to the prediction model205by the candidate prediction generator140may be temporary, and may be reversed if the context engine240determines one or more different contexts210.

The context engine240may maintain or update determined contexts210based on the entered text230. The context engine240may receive a string from an application135. The string may be a string that was provided to the application, or that was part of a conversation220associated with the application135. For example, a user of the computing device115may provide the entered text230“May the force be with you” into an SMS application as part of a conversation220with a particular party. The context(s) associated with the entered text230may be determined by the context engine240using the characteristics of the SMS application and the party associated with the conversation220.

The context engine240may determine if a string of the entered text230is already part of the strings associated with the one or more contexts210. Alternatively or additionally, the context engine240may determine if a string that is similar to the string of the entered text230is already part of the strings associated with each of the one or more contexts210. Any method for determining similar strings may be used. If the string of the entered text230(or a similar string) is already part of the strings associated with the one or more contexts210, then the probability of the string (or the similar string) in each of the plurality of strings associated with the one or more contexts210may be increased. The probability may be increased by a fixed amount, for example.

If the string (or a similar string) of the entered text230is not part of the strings associated with the one or more contexts210, then the context engine240may determine whether or not to add the string of the entered text230to the plurality of strings associated with the one or more contexts210. In some implementations, the string of the entered text230may be added to the plurality of strings associated with a context210if it meets a criterion associated with the context210. For example, the criterion may be that the string was part of entered text230more than a threshold number of times, such as three times. Other threshold times or criteria may be used. Each context210may have its own criterion, or the criterion may be the same for each context210in the context storage260. Thus, continuing the example above, the string “May the force be with you” may be added to the context210for the SMS applications and the context210for the party associated with the conversation220if the string “May the force be with you” was received more than three times for each of the contexts210.

FIG. 3is an operational flow of an implementation of a method300for providing string predictions using one or more contexts. The method300may be implemented by a candidate prediction generator140of a computing device115, for example.

A string is received at301. The string may be received by the candidate prediction generator140from a user through the user interface120as the entered text230. For example, the user may have entered one or more characters into a text field using a software keyboard. The received string may be a prefix of the string that the user intends to provide to an application135as part of a conversation220with one or more parties. The application135may be one or more of an SMS application, a social networking application, and an email application, for example.

A context is determined for the string at303. The context210may be determined by the context engine240of the candidate prediction generator140. The context engine240may determine a single context210for the received string, or may determine a plurality of contexts210. The context210may be determined from the contexts210stored in the context storage260. Each context210may be associated with a plurality of strings that are strings that were frequently provided by the user, or other users, during the particular context210. Each string of the plurality of strings may also include a probability that is a measure of how frequently that the string was provided during the context210.

In some implementations, determining the context may include determining the context based on the application135associated with the received string, or the date or time associated with the received string. Alternatively or additionally, for example, the context may be based on the conversation220associated with the received string, and the context may be determined based on the parties to the conversation, the topic of the conversation, or the style of the conversation. The topic or style of the conversation may be determined by the context engine240by looking for strings in the conversation220that are indicative of a particular style or topic.

A plurality of sting predictions is generated based on the received string and the determined context at305. The plurality of string predictions may comprise the string predictions215and may be generated by the candidate prediction generator140using the received string and the plurality of strings associated with the determined context210. In some implementations, the string predictions215may each include a string from the plurality of strings associated with the determined context210, and may have been generated by determining strings from the plurality of strings that include the received string as a prefix. Alternatively, the string predictions215may have been generated by determining strings from the plurality of strings that are similar to the received string. The string predictions215may further each include a confidence value that is based on the probability of the string in the plurality of strings.

In some implementations, the plurality of string predictions215may also be generated by the candidate prediction generator140using the prediction model205and the determined context210. The prediction model205may comprise or be based on a dictionary, for example.

One or more strings of the plurality of string predictions are provided at307. The one or more strings may be provided according to the confidence values of the string predictions215by the candidate prediction generator140. In some implementations, the strings of the string predictions215with the highest confidence values may be provided. The strings may be provided by displaying the strings in a soft input panel of the user interface120, for example. Where the strings are provided as spelling suggestions for the received string, the strings may be displayed proximate to the received string by the operating system125.

An indication of selection of one of the provided one or more strings is received at309. The indication of selection may be received by the operating system125from the user interface125and may be provided to the candidate prediction generator140. For example, the user may select or touch one of the strings in the soft input panel of the user interface120.

The selected string is provided as an input to the application at311. The selected string may be provided to the application135as part of the conversation220by the candidate prediction generator140, or as a spelling replacement for the received string.

In some implementations, the selected string may also be used to update the determined context210by the context engine240of the candidate prediction generator140. For example, the probability associated with the selected string in the plurality of strings associated with the determined context210may be increased by the context engine240of the candidate prediction generator140.

FIG. 4is an operational flow of an implementation of a method400for updating a context. The method400may be implemented by the candidate prediction generator140, for example.

A string is received at401. The string may be received by the candidate prediction generator140from the operating system125. The string may have been entered or selected by a user of an application135. The string may include one or more words or phrases.

A context is determined for the received string at403. The context210may be determined by the context engine240of the candidate prediction generator140. The context210may be associated with a plurality of strings that are strings that were frequently provided by the user, or other users, during the particular context210. Each string of the plurality of strings may also include a probability that is a measure of how frequently that the string was provided during the context210.

Whether the plurality of strings that is associated with the determined context includes the received string is determined at405. The determination may be made by the context engine240of the candidate prediction generator140. If the plurality of strings includes the string, the method400may continue at407. Otherwise, the method400may continue at409.

The probability of the string in the plurality of strings is increased at407. The probability may be increased by the context engine240of the candidate prediction generator140. For example, the context engine240may increase the probability by adding a fixed amount to the probability of the received string in the plurality of strings.

Whether a criterion is met by the string is determined at409. The determination may be made by the context engine240of the candidate prediction generator140. In some implementations, the criterion may be that the string was received more than a threshold number of times. For example, a string may be added to the plurality of strings associated with a determined context210after it has been entered or provided by a user to an application135more than three times (or another predetermined number of times, depending on the implementation). Other criteria may be used. If the criterion is met, then the method400may continue at411. Otherwise, the method400may exit at413.

The string is added to the plurality of strings associated with the context at411. The string may be added by the context engine240of the candidate prediction generator140. In some implementations, the probability associated with the added string may be set to a default value for newly added strings, for example.

With reference toFIG. 5, an exemplary system for implementing aspects described herein includes a computing device, such as computing system500. In its most basic configuration, computing system500typically includes at least one processing unit502and memory504. Depending on the exact configuration and type of computing device, memory504may be volatile (such as random access memory (RAM)), non-volatile (such as read-only memory (ROM), flash memory, etc.), or some combination of the two. This most basic configuration is illustrated inFIG. 5by dashed line506.

Computing system500may have additional features/functionality. For example, computing system500may include additional storage (removable and/or non-removable) including, but not limited to, magnetic or optical disks or tape. Such additional storage is illustrated inFIG. 5by removable storage508and non-removable storage510.

Computing system500typically includes a variety of computer readable media. Computer readable media can be any available media that can be accessed by computing system500and includes both volatile and non-volatile media, removable and non-removable media.

Computing system500may contain communication connection(s)512that allow the device to communicate with other devices and/or interfaces. Computing system500may also have input device(s)514such as a keyboard (software or hardware), mouse, pen, voice input interface, touch interface, etc. Output device(s)516such as a display, speakers, printer, etc. may also be included. All these devices are well known in the art and need not be discussed at length here.