Grouping similar words in language model

By treating phrases as the same category and modifying the language model, the problem of inefficiency in existing ASR systems when dealing with new n-tuples is solved, achieving more accurate speech transcription and a better user experience.

CN119768862APending Publication Date: 2025-04-04SNAP INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202380061489.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2022-08-22
Filing Date
2023-08-21
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

The existing automatic speech recognition (ASR) system fails to effectively utilize the relationship between n-tuples when processing new n-tuples, resulting in inefficiency and poor recognition.

Method used

Ensure the probability of all group members expected in a specific context by grouping interchangeable phrases and words and modifying the language model (LM) to contain n-tuples of each combination of all group members.

Benefits of technology

Improved the ASR recognition capability of the new n-tuple, improves the accuracy and user experience of speech transcription, while reducing the consumption of computing resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119768862A_ABST
    Figure CN119768862A_ABST
Patent Text Reader

Abstract

Systems and methods for performing automatic speech recognition are provided. The system and method accesses an LM that includes a plurality of n-tuples, each n-tuple of the plurality of n-tuples including a respective sequence of words and a corresponding LM score, and receives a list of words associated with a group classification, each word in the list of words associated with a respective weight. The systems and methods calculate a probability that a given word in a list of words associated with a group classification appears in n-tuples including individual word sequences in an LM based on LM scores of a plurality of n-tuples, and add one or more new n-tuples to the LM, the new n-tuple includes a combination of one or more words in a list of words with a separate sequence of words and is associated with a particular LM score based on the calculated probability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates generally to the technical field of automatic speech recognition (ASR). Background Art

[0002] As the popularity of social networks grows, they continue to expand their capabilities. To improve ease of use, social networks integrate more and more features, allowing users to complete many or even most of their computer-based tasks within the social network itself. Some social networks enable users to control various operations using voice. BRIEF DESCRIPTION OF THE DRAWINGS

[0003] In the accompanying drawings (which are not necessarily drawn to scale), similar reference numerals may describe similar components in different views. To easily identify the discussion of any particular element or action, the most significant digit or digits in the reference numeral refer to the figure number in which the element is first introduced. Some non-limiting examples are shown in the accompanying drawings, in which:

[0004] Figure 1 is a diagrammatic representation of a networking environment in which the present disclosure may be deployed, according to some examples.

[0005] Figure 2 is a diagrammatic representation of a messaging system having both client-side and server-side functionality according to some examples.

[0006] Figure 3 is a diagrammatic representation of data structures as maintained in a database according to some examples.

[0007] Figure 4 is a graphical representation of messages according to some examples.

[0008] Figure 5 A word grouping ASR system according to some examples is shown.

[0009] Figure 6 An example word list according to some examples is shown.

[0010] Figure 7 Example language models according to some examples are shown.

[0011] Figure 8 is a flow diagram illustrating example operation of a word grouping ASR system according to some examples.

[0012] Fig. 9 is a diagrammatic representation of a machine in the form of a computer system according to some examples within which a set of instructions may be executed for causing the machine to perform any one or more of the methodologies discussed herein.

[0013] Fig.10 is a block diagram illustrating a software architecture in which examples may be implemented. DETAILED DESCRIPTION

[0014] The following description includes systems, methods, techniques, instruction sequences and computing machine program products that implement the illustrative examples of the present disclosure. In the following description, for the purpose of illustration, many specific details are set forth to provide an understanding of various examples. However, it will be apparent to those skilled in the art that examples can be practiced without these specific details. Typically, it is not necessary to show in detail known instruction instances, protocols, structures and techniques.

[0015] Automatic speech recognition (ASR) engines typically consist of an acoustic component and a decoder. The acoustic component converts the user's speech into the logit (unnormalized score) of the inferred characters of the phonemes, and the decoder applies beam search and language model (LM) to determine the best combination / alternative of characters / phonemes as the resulting transcription. In this setting, the role of the decoder is to increase the probability of acoustic options based on their likelihood scores in the language model (LM scores). Language models are used to determine the likelihood of word sequences based on their occurrence in a large language corpus. The language model initially examines the corpus, extracts a distribution model from the corpus, and then uses the distribution model at runtime to determine the likelihood of a given word sequence. The likelihood of an n-gram can be referred to as an n-gram score or LM score.

[0016] LMs typically use a list of n-grams (sequences of n words - unigrams, bigrams, 3-grams, etc., typically up to n=6) and their likelihood in the language (as embodied in the training corpus). LMs also implement smoothing, which is a method of determining the likelihood of n-grams not seen in the corpus by looking at the "fallback" probabilities of the n-1 prefixes of the n-1 prefix, and the likelihood of the n-1 suffixes. For example, if the n-gram I_am_here_already is not in the LM, its likelihood would be calculated by probability of am_here_already * (fallback probability of I_am_here). Calculating the likelihood of n-grams not found in the LM in this way can lead to poor ASR recognition and a negative user experience. For example, if an n-gram is assigned an incorrect LM score, the ASR recognition may perform an undesired action or may misunderstand the intent behind the n-gram.

[0017] Some n-grams in an LM may be related to each other by subject matter because they are related to common groups such as cities, colors, names of people, brands, etc. Typical systems do not consider such relationships between n-grams when performing ASR recognition. Failure to consider such groupings of n-grams when encountering new n-grams leads to inefficiency and poor ASR recognition. A common problem when training an LM based on a text corpus is that the amount of data to train is limited. Even if the text corpora are large, or even huge, they are not sufficient to make complete generalizations as easily as humans can. For example, when a person perceives a sentence such as "I live in New York", they understand that New York is the place, while the sentence "I live in London" is equally valid, even if the person has never seen this sentence in the training set. The disclosed technology can treat two sentences the same by treating the phrases as belonging to the same "class".

[0018] The disclosed technology improves ASR recognition of certain new n-grams related to classes of known n-grams. To improve ASR recognition of new n-grams, the disclosed technology safely adjusts the probability of transcribing an expected set of words / utterances while safely maintaining the probability of not using the n-gram or other alternatives to the words in the n-gram. The disclosed technology enables adjustment of ASR utterance transcription without any degradation to other utterances. The disclosed technology can be implemented as part of a decoder (referred to as an online alternative) or by changing the language model used by the decoder as a preprocessing step (referred to as an offline alternative). Specifically, the disclosed technology improves decoding and ASR recognition by grouping interchangeable phrases and words together. A word set is received from a user or external source, and the LM is modified to contain n-grams of every combination of all group members, with all relevant prefixes and suffixes of the group, regardless of whether they appear together in the LM's corpus.

[0019] When a group of words are considered to be of the same class, the disclosed technique observes the current n-grams in the LM and determines which n-grams are relevant to the classification. Relevant n-grams may be those n-grams in which group members may be replaced while still remaining valid and possible n-grams. For example, considering the case of classifying city names together, if there is an n-gram for (I, live, in, London), the disclosed technique also considers any other city name to replace London, regardless of whether it appears in the LM training corpus.

[0020] After making a decision on the relevant n-grams, the disclosed technology ensures that all group members are expected within these contexts (e.g., they have LM scores). The LM stores the probability of a suffix given a prefix, or the probability of a prefix given a suffix. This means that, essentially, the sum of all scores for the same prefix should be less than 1, because the disclosed technology assumes that it will not be exposed to all possible combinations in the corpus. When the disclosed technology changes the scores in the LM, the disclosed technology retains this property and avoids guessing or simply changing the probabilities arbitrarily. Specifically, the disclosed technology expands the existing probability mass differently. For each prefix, the disclosed technology sets a probability for each group member based on the probability of known group members, regardless of whether it appears in the original LM.

[0021] In some examples, the disclosed techniques assume that a group G of city names (g1, g2, g3, ...) with weights (w1, w2, w3, ...) associated with each city is being classified. The weights are prior knowledge about the group provided from an external source and represent the likelihood that a member of the group will appear alone. If cities are grouped together, the disclosed techniques can use population size as a proxy for city name usage. For more abstract domains such as color, the disclosed techniques can use other heuristics or metrics. A similar representative of a person's name is the first / last name in the group, or can be extracted from an external dataset, for example, a company name weight can be inferred from its brand name strength.

[0022] According to the disclosed technology, an LM including multiple n-grams is accessed, each of the multiple n-grams including a corresponding word sequence and a corresponding LM score. The disclosed technology receives a word list associated with a group classification, and each word in the word list is associated with a corresponding weight. The disclosed technology calculates the probability that a given word in the word list associated with the group classification appears in an n-gram in the LM including a separate word sequence (for example, the same prefix when the given word is a suffix, or the same suffix when the given word is a prefix) based on the LM scores of the multiple n-grams. The disclosed technology adds one or more new n-grams to the LM, the new n-grams including a combination of one or more words in the word list and the separate word sequence, and are associated with a specific LM score based on the calculated probability. In this way, the disclosed technology improves ASR recognition of n-grams including one or more words related to other n-grams with previously determined LM scores.

[0023] This significantly improves the overall ability of a social networking system to perform ASR to control operations and perform audio transcription. In this way, the disclosed technology provides a more intuitive, robust, and engaging experience. This reduces the amount of computing resources required to perform conventional social networking tasks and operations.

[0024] Networked computing environment

[0025] Figure 1 1 is a block diagram illustrating an example messaging system 100 for exchanging data (e.g., messages and associated content) over a network. The messaging system 100 includes multiple instances of a client device 102, each of the multiple instances hosting a number of applications including a messaging client 104 and other external applications 109 (e.g., third-party applications). Each messaging client 104 is communicatively coupled to other instances of the messaging client 104 (e.g., hosted on corresponding other client devices 102), a messaging server system 108, and an external application server 110 via a network 112 (e.g., the Internet). The messaging client 104 may also communicate with locally hosted third-party applications such as the external application 109 using an application program interface (API).

[0026] The client device 102 can operate as a standalone device, or can be coupled (e.g., networked) to other machines. In a networked deployment, the client device 102 can operate as a server machine or a client machine in a server-client network environment, or as a peer machine in a peer-to-peer (or distributed) network environment. The client device 102 may include, but is not limited to: a server computer, a client computer, a personal computer (PC), a tablet computer, a laptop computer, a netbook, a set-top box (STB), a personal digital assistant (PDA), an entertainment media system, a cellular phone, a smart phone, a mobile device, a wearable device (e.g., a smart watch), a smart home device (e.g., a smart appliance), other smart devices, a web device, a network router, a network switch, a network bridge, or any machine capable of performing the disclosed operations. In addition, although only a single client device 102 is shown, the term "client device" should also be considered to include a collection of machines that perform the disclosed operations individually or jointly.

[0027] In some examples, client device 102 may include AR glasses or AR headsets, where virtual content is displayed within the lenses of the glasses while the user views the real world environment through the lenses. For example, an image may be presented on a transparent display that enables the user to simultaneously view content presented on the display and real-world objects.

[0028] The messaging clients 104 are able to communicate and exchange data with other messaging clients 104 and messaging server systems 108 via the network 112. The data exchanged between the messaging clients 104 and between the messaging clients 104 and messaging server systems 108 include functions (e.g., commands for activating functions) and payload data (e.g., text, audio, video, or other multimedia data).

[0029] The messaging server system 108 provides server-side functionality to certain messaging clients 104 via the network 112. Although certain functions of the messaging system 100 are described herein as being performed by the messaging client 104 or by the messaging server system 108, it may be a design choice whether certain functions are located within the messaging client 104 or within the messaging server system 108. For example, it may be technically preferable to initially deploy certain technologies and functions within the messaging server system 108, but later migrate the technologies and functions to the messaging client 104 where the client device 102 has sufficient processing power.

[0030] The messaging server system 108 supports various services and operations provided to the messaging clients 104. Such operations include sending data to the messaging clients 104, receiving data from the messaging clients 104, and processing data generated by the messaging clients 104. As examples, the data may include message content, client device information, geo-location information, media enhancements and overlays, message content persistence conditions, social network information, watermarks (combined indications of messages and responses being read or presented to the user of the client device 102), and live event information. The exchange of data within the messaging system 100 is activated and controlled by functions available via the user interface (UI) of the messaging client 104.

[0031] Turning now specifically to the messaging server system 108, an API server 116 is coupled to and provides a programming interface to the application server 114. The application server 114 is communicatively coupled to a database server 120, which facilitates access to a database 126 that stores data associated with messages and responses processed by the application server 114. Similarly, a web server 128 is coupled to and provides a web-based interface to the application server 114. To this end, the web server 128 processes incoming network requests via the Hypertext Transfer Protocol (HTTP) and several other related protocols.

[0032] The API server 116 receives and sends message data (e.g., watermarks, commands, and message payloads) between the client device 102 and the application server 114. Specifically, the API server 116 provides a set of interfaces (e.g., routines and protocols) that can be called or queried by the messaging client 104 to activate the functionality of the application server 114. The API server 116 exposes various functions supported by the application server 114, including: account registration; login functionality; sending messages from a particular messaging client 104 to another messaging client 104 via the application server 114; sending media files (e.g., images or videos) from the messaging client 104 to the messaging server 118 and for possible access by another messaging client 104; setting up a collection of media data (e.g., a story); retrieving a friend list of the user of the client device 102; retrieving such a collection; retrieving messages and content; adding and removing entities (e.g., friends) from an entity graph (e.g., a social graph); locating friends in a social graph; and opening application events (e.g., related to the messaging client 104).

[0033] The application server 114 hosts several server applications and subsystems, including, for example, a messaging server 118, an image processing server 122, and a social network server 124. The messaging server 118 implements several message processing techniques and functions, particularly those related to aggregation and other processing of content (e.g., text and multimedia content) included in messages received from multiple instances of the messaging client 104. As will be described in further detail, text and media content from multiple sources can be aggregated into collections of content (e.g., called stories or galleries). These collections are then made available to the messaging client 104. In view of the hardware requirements for other processor and memory intensive processing of data, such processing can also be performed on the server side by the messaging server 118.

[0034] The application server 114 also includes an image processing server 122 that is dedicated to performing various image processing operations, typically on images or videos within the payload of messages sent from or received at the messaging server 118 .

[0035] The social network server 124 supports various social networking functions and services and makes them available to the messaging server 118. To this end, the social network server 124 maintains and accesses an entity graph 308 (e.g., Figure 3). Examples of functions and services supported by the social networking server 124 include identifying other users of the messaging system 100 with whom a particular user has relationships or who the particular user is "following," and also include identifying interests and other entities of a particular user.

[0036] Returning to the messaging client 104, the features and functions of the external resource (e.g., external application 109 or applet) are available to the user via the interface of the messaging client 104. The messaging client 104 receives a user selection of an option for launching or accessing features of an external resource (e.g., a third-party resource) such as an external application 109. The external resource can be a third-party application (external application 109) installed on the client device 102 (e.g., a "native application"), or a small-scale version of a third-party application (e.g., a "mini-program") hosted on the client device 102 or located at the far end of the client device 102 (e.g., on the external application server 110). The small-scale version of the third-party application includes a subset of the features and functions of the third-party application (e.g., a full-scale, native version of a third-party standalone application) and is implemented using a markup language document. In one example, the small-scale version of the third-party application (e.g., a "mini-program") is a web-based markup language version of the third-party application and is embedded in the messaging client 104. In addition to using markup language documents (eg, .*ml files), applets may include scripting languages ​​(eg, .*js files or .json files) and style sheets (eg, .*ss files).

[0037] In response to receiving a user selection of an option for launching or accessing a feature of an external resource (external application 109), the messaging client 104 determines whether the selected external resource is a web-based external resource or a locally installed external application. In some cases, the external application 109 locally installed on the client device 102 can be launched independently of the messaging client 104 and separately from the messaging client 104, for example, by selecting an icon corresponding to the external application 109 on the home screen of the client device 102. A small-scale version of such an external application can be launched or accessed via the messaging client 104, and in some examples, no part of the small-scale external application can be (or only a limited part can be) accessed outside the messaging client 104. The small-scale external application can be launched by the messaging client 104 receiving a markup language document associated with the small-scale external application from the external application server 110 and processing such a document.

[0038] In response to determining that the external resource is a locally installed external application 109, the messaging client 104 instructs the client device 102 to launch the external application 109 by executing the locally stored code corresponding to the external application 109. In response to determining that the external resource is a web-based resource, the messaging client 104 communicates with the external application server 110 to obtain a markup language document corresponding to the selected resource. The messaging client 104 then processes the obtained markup language document to present the web-based external resource within the user interface of the messaging client 104.

[0039] The messaging client 104 may notify the user of the client device 102 or other users (e.g., "friends") associated with such a user of activities occurring in one or more external resources. For example, the messaging client 104 may provide a participant in a conversation (e.g., a chat session) in the messaging client 104 with a notification related to the current or recent use of an external resource by one or more members of a user group. One or more users may be invited to join an active external resource or to start an external resource that was recently used but is currently inactive (in the friend group). The external resource may provide the participants in the conversation who each use the corresponding messaging client 104 with the ability to share items, conditions, states, or locations in the external resource with one or more members of the user group entering the chat session. The shared item may be an interactive chat card that members of the chat may interact with, such as starting a corresponding external resource, viewing specific information in an external resource, or bringing members of the chat to a specific location or state in an external resource. Within a given external resource, a response message may be sent to the user on the messaging client 104. The external resource may selectively include different media items in the response based on the current context of the external resource.

[0040] The messaging client 104 may present a list of available external resources (e.g., third-party or external applications 109 or applets) to the user to launch or access a given external resource. The list may be presented in a context-sensitive menu. For example, icons representing different external applications in the external applications 109 (or applets) may vary based on how the user launches the menu (e.g., from a conversation interface or from a non-conversation interface).

[0041] In some examples, the messaging client 104 may implement the following combination: Figure 5 The words discussed group one or more functions of the ASR system 230 .

[0042] System Architecture

[0043] Figure 21 is a block diagram showing additional details about the messaging system 100 according to some examples. Specifically, the messaging system 100 is shown to include a messaging client 104 and an application server 114. The messaging system 100 contains several subsystems that are supported on the client side by the messaging client 104 and on the server side by the application server 114. These subsystems include, for example, a transient timer system 202, a collection management system 204, an enhancement system 208, a map system 210, a game system 212, an external resource system 220, and a word grouping ASR system 230.

[0044] The transient timer system 202 is responsible for implementing temporary or time-limited access to content by the messaging client 104 and the messaging server 118. The transient timer system 202 includes several timers that selectively enable access to messages and associated content (e.g., for presentation and display) via the messaging client 104 based on duration and display parameters associated with a message or a collection of messages (e.g., a story). Additional details regarding the operation of the transient timer system 202 are provided below.

[0045] The collection management system 204 is responsible for managing collections or collections of media (e.g., collections of text, image video, and audio data). Collections of content (e.g., messages, including images, videos, text, and audio) can be organized into "event galleries" or "event stories." Such collections can be available for a specified period of time (e.g., the duration of an event related to the content). For example, content related to a concert can be made available as a "story" for the duration of the concert. The collection management system 204 can also be responsible for publishing an icon that provides notification of the existence of a particular collection to the user interface of the messaging client 104.

[0046] The collection management system 204 also includes a curation interface 206 that enables collection managers to manage and curate specific content collections. For example, the curation interface 206 enables an event organizer to curate a collection of content related to a specific event (e.g., to remove inappropriate content or redundant messages). In addition, the collection management system 204 uses machine vision (or image recognition technology) and content rules to automatically curate content collections. In some examples, compensation may be paid to users for including user-generated content in a collection. In such cases, the collection management system 204 operates to automatically pay such users for use of their content.

[0047] The enhancement system 208 provides various functions that enable users to enhance (e.g., annotate or otherwise modify or edit) media content associated with a message. For example, the enhancement system 208 provides functions related to generating and publishing media overlays for messages processed by the messaging system 100. The enhancement system 208 is operable to provide media overlays or enhancements (e.g., image filters or augmented reality items) to the messaging client 104 based on the geographic location of the client device 102. In another example, the enhancement system 208 is operable to provide media overlays to the messaging client 104 based on other information such as social network information of the user of the client device 102. Media overlays can include audio and visual content and visual effects. Examples of audio and visual content include pictures, text, logos, animations, and sound effects. In some cases, media overlays are referred to as augmented reality items. Examples of visual effects include color overlays. Audio and visual content or visual effects can be applied to media content items (e.g., photos) at the client device 102. For example, media overlays can include text, graphic elements, or images that can be superimposed on photos taken by the client device 102. In another example, the media overlay includes a location identification overlay (e.g., Venice Beach), the name of a live event, or a business name overlay (e.g., Beach Cafe). In another example, the enhancement system 208 uses the geographic location of the client device 102 to identify a media overlay that includes the name of a business at the geographic location of the client device 102. The media overlay may include other tags associated with the business. The media overlay may be stored in the database 126 and accessed by the database server 120.

[0048] In some examples, the enhancement system 208 provides a user-based publishing platform that enables a user to select a geographic location on a map and upload content associated with the selected geographic location. The user can also specify the context in which a particular media overlay should be provided to other users. The enhancement system 208 generates a media overlay that includes the uploaded content and associates the uploaded content with the selected geographic location.

[0049] In other examples, the enhancement system 208 provides a merchant-based publishing platform that enables merchants to select specific media overlays associated with a geographic location via a bidding process. For example, the enhancement system 208 associates the media overlays of the highest bidding merchant with the corresponding geographic location for a predefined amount of time. The enhancement system 208 communicates with the image processing server 122 to automatically select and activate an augmented reality experience related to an image captured by the client device 102. Once the augmented reality experience is selected, when the user scans the image using a camera in the user environment, one or more images, videos, or augmented reality graphic elements are retrieved and presented as an overlay on the scanned image. In some cases, the camera is switched to a front view (e.g., the front camera of the client device 102 is activated in response to the activation of a specific augmented reality experience), and an image from the front camera of the client device 102 instead of the rear camera of the client device 102 begins to be displayed on the client device 102. One or more images, videos, or augmented reality graphic elements are retrieved and presented as an overlay on the image captured and displayed by the front camera of the client device 102.

[0050] The enhancement system 208 enables users to create customized media overlays or augmented reality items. Such media overlays may include one or more different feature types. For example, media overlays may include features based on facial tracking, in which features based on facial tracking, one or more augmented reality items are modified based on the movement of facial features detected in received or captured images or videos. As another example, media overlays may include features based on audio clips, in which features based on audio clips, sound clips or audio clips are associated with one or more augmented reality items presented in received or captured images or videos. As another example, media overlays may include features based on gyroscopes or accelerometers, in which features based on gyroscopes or accelerometers, one or more augmented reality items are modified based on the movement of client devices 102 on which received or captured images or videos are displayed. Customized media overlays may be shared with other users of messaging applications. Other users may choose to start or access customized media overlays. In response, retrieve and use the features of customized media overlays to enhance or modify one or more images or videos presented on other users' client devices.

[0051] The mapping system 210 provides various geo-location functions and supports presentation of map-based media content and messages by the messaging client 104. For example, the mapping system 210 enables display of (e.g., stored in Figure 3The user icons or avatars (in the profile data 316 shown) are displayed to indicate the current or past locations of the user's "friends", as well as media content (e.g., a collection of messages including photos and videos) generated by such friends within the context of the map. For example, messages posted by the user to the messaging system 100 from a particular geographic location can be displayed to the "friends" of the particular user on the map interface of the messaging client 104 within the context of that particular location on the map. The user can also share his or her location and status information with other users of the messaging system 100 via the messaging client 104 (e.g., using appropriate status avatars), where the location and status information is similarly displayed to the selected user within the context of the map interface of the messaging client 104.

[0052] The game system 212 provides various game functions within the context of the messaging client 104. The messaging client 104 provides a game interface that provides a list of available games (e.g., web-based games or web-based applications) that can be launched by a user within the context of the messaging client 104 and played with other users of the messaging system 100. The messaging system 100 also enables a specific user to invite other users to participate in playing a specific game by sending an invitation from the messaging client 104 to other users. The messaging client 104 also supports both voice messaging and text messaging within the context of playing games (e.g., chatting), provides leaderboards for games, and also supports providing in-game rewards (e.g., game coins and items). Based on the intent classification of the voice input and the accurate transcription of the voice input, the messaging client 104 can perform game-based functions.

[0053] The external resource system 220 provides an interface for communicating with an external application server 110 to launch or access external resources to the messaging client 104. Each external resource (application) server 110 hosts, for example, an application based on a markup language (e.g., HTML5) or a small-scale version of an external application (e.g., a game, utility, payment, or ride-sharing application external to the messaging client 104). The messaging client 104 can launch a web-based resource (e.g., application) by accessing an HTML5 file from an external resource (application) server 110 associated with a web-based resource. In some examples, the application hosted by the external resource server 110 is programmed in JavaScript using a software development kit (SDK) provided by the messaging server 118. The SDK includes an application program interface (API) with functions that can be called or activated by a web-based application. In some examples, the messaging server 118 includes a JavaScript library that provides access to certain user data of the messaging client 104 to a given third-party resource. HTML5 is used as an example technology for programming games, but applications and resources programmed based on other technologies can be used. Based on the intent classification of the speech input and the accurate transcription of the speech input, the messaging client 104 can perform external resource-based functions.

[0054] In order to integrate the functionality of the SDK into a web-based resource, the SDK is downloaded from the messaging server 118 by the external resource (application) server 110 or received in other ways by the external resource (application) server 110. Once downloaded or received, the SDK is included as part of the application code of the web-based external resource. The code of the web-based resource can then call or activate certain functions of the SDK to integrate the features of the messaging client 104 into the web-based resource.

[0055] The SDK stored on the messaging server 118 effectively provides a bridge between external resources (e.g., a third party or external application 109 or applet and a messaging client 104). This provides users with a seamless experience of communicating with other users on the messaging client 104 while retaining the look and feel of the messaging client 104. In order to bridge the communication between the external resources and the messaging client 104, in some examples, the SDK facilitates the communication between the external resource server 110 and the messaging client 104. In some examples, the WebViewJavaScriptBridge running on the client device 102 establishes two one-way communication channels between the external resources and the messaging client 104. Messages are sent asynchronously via these communication channels between the external resources and the messaging client 104. Each SDK function activation is sent as a message and a callback. Each SDK function is implemented by constructing a unique callback identifier and sending a message with the callback identifier.

[0056] By using the SDK, not all information from the messaging client 104 is shared with the external resource server 110. The SDK limits which information is shared based on the needs of the external resource. In some examples, each external resource server 110 provides an HTML5 file corresponding to a web-based external resource to the messaging server 118. The messaging server 118 can add a visual representation (e.g., box art or other graphics) of the web-based external resource in the messaging client 104. Once the user selects the visual representation or instructs the messaging client 104 to access the features of the web-based external resource through the GUI of the messaging client 104, the messaging client 104 obtains the HTML5 file and instantiates the resources required to access the features of the web-based external resource.

[0057] The messaging client 104 presents a graphical user interface (e.g., a login page or title screen) for the external resource. During, before, or after presenting the login page or title screen, the messaging client 104 determines whether the launched external resource has been previously authorized to access the user data of the messaging client 104. In response to determining that the launched external resource has been previously authorized to access the user data of the messaging client 104, the messaging client 104 presents another graphical user interface of the external resource, which includes the functions and features of the external resource. In response to determining that the launched external resource has not been previously authorized to access the user data of the messaging client 104, after a threshold time period (e.g., 3 seconds) of displaying the login page or title screen of the external resource, the messaging client 104 slides a menu for authorizing the external resource to access the user data (e.g., animating the menu to emerge from the bottom of the screen to the middle or other portion of the screen). The menu identifies the type of user data that the external resource will be authorized to use. In response to receiving the user selection of the accept option, the messaging client 104 adds the external resource to the list of authorized external resources and enables the external resource to access the user data from the messaging client 104. In some examples, the external resource is authorized to access the user data by the messaging client 104 according to the OAuth 2 framework.

[0058] The messaging client 104 controls the type of user data shared with the external resource based on the type of external resource that is authorized. For example, an external resource including a full-scale external application (e.g., a third party or external application 109) is provided with access to a first type of user data (e.g., only a two-dimensional avatar of a user with or without different avatar characteristics). As another example, an external resource including a small-scale version of an external application (e.g., a web-based version of a third-party application) is provided with access to a second type of user data (e.g., payment information, a two-dimensional avatar of a user, a three-dimensional avatar of a user, and an avatar with various avatar characteristics). Avatar characteristics include different ways to customize the look and feel of an avatar (e.g., different poses, facial features, clothing, etc.).

[0059] The word grouping ASR system 230 accesses a LM including a plurality of n-grams, each of the plurality of n-grams including a corresponding word sequence and a corresponding LM score. The word grouping ASR system 230 receives a word list associated with a group classification, each word in the word list being associated with a corresponding weight. The word grouping ASR system 230 calculates a probability that a given word in the word list associated with the group classification appears in an n-gram in the LM including a separate word sequence (e.g., the same prefix when the given word is a suffix, or the same suffix when the given word is a prefix) based on the LM scores of the plurality of n-grams. The word grouping ASR system 230 adds one or more new n-grams to the LM, the new n-grams including a combination of one or more words in the word list with the separate word sequence, and being associated with a particular LM score based on the calculated probability. In this manner, the disclosed technique improves ASR recognition of n-grams including one or more words associated with other n-grams having previously determined LM scores.

[0060] Combination Figure 5 Additional details of the word grouping ASR system 230 are provided.

[0061] Data Architecture

[0062] Figure 3 is a schematic diagram illustrating a data structure 300 that may be stored in a database 126 of a messaging server system 108 according to some examples. Although the contents of the database 126 are illustrated as including several tables, it will be appreciated that data may be stored in other types of data structures (e.g., as an object-oriented database).

[0063] Database 126 includes message data stored in message table 302. For any particular message, the message data includes at least message sender data, message recipient (or receiver) data, and payload. Figure 4 Additional details regarding information that may be included in a message and included within the message data stored in message table 302 are described.

[0064] The entity table 306 stores entity data and is linked (e.g., by reference) to the entity graph 308 and profile data 316. The entities whose records are maintained within the entity table 306 may include individuals, corporate entities, organizations, objects, places, events, etc. Regardless of the entity type, any entity about which the messaging server system 108 stores data may be an identified entity. Each entity is provided with a unique identifier as well as an entity type identifier (not shown).

[0065] The entity graph 308 stores information about relationships and associations between entities. By way of example only, such relationships may be social, professional (e.g., working in a common company or organization), interest-based, or activity-based.

[0066] Profile data 316 stores multiple types of profile data about a particular entity. Based on the privacy settings specified by the particular entity, profile data 316 can be selectively used and presented to other users of the messaging system 100. In the case where the entity is a person, profile data 316 includes, for example, a user name, phone number, address, settings (e.g., notification and privacy settings), and an avatar representation (or a collection of such avatar representations) selected by the user. The particular user can then selectively include one or more of these avatar representations within the content of messages transmitted via the messaging system 100 and on a map interface displayed to other users by the messaging client 104. The collection of avatar representations can include a "status avatar" that presents a graphical representation of a status or activity that a user may choose to convey at a particular time.

[0067] Where the entity is a group, profile data 316 for the group may similarly include one or more avatar representations associated with the group, in addition to the group name, members, and various settings for the relevant group (eg, notifications).

[0068] The database 126 also stores enhancement data, such as overlays or filters, in an enhancement table 310. The enhancement data is associated with and applied to videos (data for videos is stored in the video table 304) and images (data for images is stored in the image table 312).

[0069] In one example, a filter is an overlay displayed as an overlay on an image or video during presentation to a recipient user. The filter can be of various types, including a user-selected filter from a set of filters presented to a sending user by the messaging client 104 when the sending user is composing a message. Other types of filters include geolocation filters (also referred to as geofilters), which can be presented to a sending user based on a geographic location. For example, a geolocation filter specific to a nearby or specific location can be presented by the messaging client 104 within a user interface based on geographic location information determined by a global positioning system (GPS) unit of the client device 102.

[0070] Another type of filter is a data filter that can be selectively presented to the sending user by the messaging client 104 based on other input or information collected during the message creation process by the client device 102. Examples of data filters include the current temperature at a particular location, the current speed the sending user is traveling, the battery life of the client device 102, or the current time.

[0071] Other augmented data that may be stored in the image table 312 include augmented reality content items (eg, corresponding to application lenses or augmented reality experiences). Augmented reality content items may be real-time special effects and sounds that may be added to an image or video.

[0072] As described above, augmented data includes augmented reality content items, overlays, image transformations, AR images, and similar items involving modifications that can be applied to image data (e.g., videos or images). This includes real-time modifications that modify the image when it is captured using a device sensor (e.g., one or more cameras) of the client device 102 and then display the image with the modifications on the screen of the client device 102. This also includes modifications to stored content (e.g., video clips in a gallery that can be modified). For example, in a client device 102 that can access multiple augmented reality content items, a user can use a single video clip with multiple augmented reality content items to see how different augmented reality content items will modify the stored clips. For example, by selecting different augmented reality content items for the content, multiple augmented reality content items that apply different pseudo-random movement models can be applied to the same content. Similarly, real-time video capture can be used with the modifications shown to show how the video image currently captured by the sensor of the client device 102 will modify the captured data. Such data may be displayed only on the screen and not stored in memory, or the content captured by the device sensors may be recorded and stored in memory with or without modification (or both). In some systems, a preview feature may simultaneously show how different augmented reality content items will look in different windows in the display. This may, for example, enable viewing of multiple windows with different pseudo-random animations on the display at the same time.

[0073] Thus, data and various systems using augmented reality content items or other such transformation systems that modify content using such data may involve detection of objects (e.g., faces, hands, bodies, cats, dogs, surfaces, objects, etc.) in video frames, tracking of such objects as they leave, enter, and move around the field of view, and modification or transformation of such objects as they are tracked. In various examples, different methods for implementing such transformations may be used. Some examples may involve: generating a three-dimensional mesh model of one or more objects; and using transformations and animated textures of the models within a video to implement the transformations. In other examples, tracking of points on an object may be utilized to place an image or texture (which may be two-dimensional or three-dimensional) at the tracked location. In yet another example, neural network analysis of a video frame may be used to place an image, model, or texture in content (e.g., an image or frame of a video). Thus, augmented reality content items refer to both images, models, and textures used to create transformations in content, as well as additional modeling and analysis information required to implement such transformations using object detection, tracking, and placement.

[0074] Real-time video processing can be performed using any kind of video data (e.g., video streams, video files, etc.) stored in the memory of any kind of computerized system. For example, a user can load video files and store them in the memory of the device, or a sensor of the device can be used to generate a video stream. In addition, computer animation models can be used to process any object, such as human faces and body parts, animals, or inanimate objects (e.g., chairs, cars, or other objects).

[0075] In some examples, when a specific modification is selected together with the content to be transformed, the elements to be transformed are identified by a computing device, and then if the elements are present in the frame of the video, they are detected and tracked. The elements of the object are modified according to the modification request, thereby transforming the frame of the video stream. For different types of transformations, the transformation of the frame of the video stream can be performed by different methods. For example, for a frame transformation that mainly involves changing the form of the elements of the object, the feature points of each element of the object are calculated (for example, using an active shape model (Active Shape Model, ASM) or other known methods). Then, a grid based on the feature points is generated for each element of at least one element of the object. The grid is used for the subsequent stage of tracking the elements of the object in the video stream. During the tracking process, the grid mentioned for each element is aligned with the position of each element. Then, additional points are generated on the grid. A first group of first points is generated for each element based on the modification request, and a group of second points is generated for each element based on the group of first points and the modification request. Then, the frame of the video stream can be transformed by modifying the elements of the object based on the group of first points, the group of second points and the grid. In such an approach, the background of the modified object may also be changed or distorted by tracking and modifying the background.

[0076] In some examples, a transformation that changes some areas of an object using elements of an object can be performed by calculating characteristic points of each element of the object and generating a grid based on the calculated characteristic points. Points are generated on the grid, and then various areas are generated based on the points. The elements of the object are then tracked by aligning the area for each element with the position for each element of at least one element, and the properties of the area can be modified based on the modification request, thereby transforming the frame of the video stream. Depending on the specific modification request, the properties of the mentioned area can be transformed in different ways. Such modifications may involve: changing the color of the area; removing at least some partial areas from the frame of the video stream; including one or more new objects in the area based on the modification request; and modifying or distorting the elements of the area or object. In various examples, any combination of such modifications or other similar modifications may be used. For certain models to be animated, some characteristic points may be selected as control points for the entire state space to be used to determine options for model animation.

[0077] In some examples of computer animation models for transforming image data using face detection, faces are detected on an image using a specific face detection algorithm (e.g., Viola-Jones). An active shape model (ASM) algorithm is then applied to the face region of the image to detect facial feature reference points.

[0078] Other methods and algorithms suitable for face detection can be used. For example, in some examples, landmarks are used to locate features, and the landmarks represent distinguishable points that are present in most of the images considered. For example, for facial landmarks, the location of the left pupil can be used. If the initial landmarks are not identifiable (for example, when a person wears an eye patch), secondary landmarks can be used. Such a landmark identification process can be used for any such object. In some examples, a set of landmarks forms a shape. The coordinates of the points in the shape can be used to represent the shape as a vector. A similarity transformation (which allows translation, scaling, and rotation) that minimizes the average Euclidean distance between the shape points is used to align one shape with another shape. The mean shape is the average value of the aligned training shapes.

[0079] In some examples, the landmark search begins with an average shape that aligns with the location and size of the face determined by a global face detector. Such a search then repeats the steps of proposing tentative shapes by template matching the image texture around each point to adjust the location of the shape points, and then conforming the tentative shapes to the global shape model until convergence occurs. In some systems, template matching alone is unreliable, and the shape model pools the results of weak template matches to form a stronger overall classifier. The entire search is repeated at each level in the image pyramid from coarse to fine resolution.

[0080] The transformation system can capture an image or video stream on a client device (e.g., client device 102) and perform complex image manipulations locally on the client device 102 while maintaining an appropriate user experience, computation time, and power consumption. Complex image manipulations can include size and shape changes, emotion transitions (e.g., changing a face from a frown to a smile), state transitions (e.g., aging a subject, reducing apparent age, changing gender), style transitions, application of graphical elements, and any other suitable image or video manipulations enabled by a convolutional neural network that has been configured to execute efficiently on the client device 102.

[0081] In some examples, a computer animation model for transforming image data can be used by a system in which a user can capture an image or video stream of the user (e.g., a selfie) using a client device 102 having a neural network, where the neural network operates as part of a messaging client 104 operating on the client device 102. A transformation system operating within the messaging client 104 determines the presence of a face within the image or video stream and provides a modification icon associated with the computer animation model for transforming the image data, or the computer animation model can exist in association with an interface described herein. The modification icon includes the following changes, which can be the basis for modifying the user's face within the image or video stream as part of the modification operation. Once the modification icon is selected, the transformation system initiates a process of transforming the user's image to reflect the selected modification icon (e.g., generating a smiling face for the user). Once the image or video stream is captured and the specified modification is selected, the modified image or video stream can be presented in a graphical user interface displayed on the client device 102. The transformation system can implement a complex convolutional neural network for a portion of the image or video stream to generate and apply the selected modification. That is, a user can capture an image or video stream, and once a modification icon is selected, the modified result can be presented to the user in real time or near real time. In addition, the modification can be persistent while the video stream is being captured and the selected modification icon remains toggled. A machine learning neural network can be used to implement such modification.

[0082] The graphical user interface presenting the modifications performed by the transformation system can provide additional interactive options to the user. Such options can be based on the interface used to initiate the selection of a particular computer animation model and content capture (e.g., initiated from a content creator user interface). In various examples, the modifications can be persistent after the modification icon is initially selected. The user can turn the modification on or off by tapping or otherwise selecting the face being modified by the transformation system, and store it for later viewing or browsing to other areas of the imaging application. In the case where multiple faces are modified by the transformation system, the user can globally switch the modification on or off by tapping or selecting a single face modified and displayed within the graphical user interface. In some examples, each face in a group of multiple faces can be modified individually, or such modifications can be individually switched by tapping or selecting a single face or a series of faces displayed within the graphical user interface.

[0083] The story table 314 stores data related to a collection of messages and associated images, videos, or audio data that are compiled into a collection (e.g., a story or gallery). The creation of a particular collection can be initiated by a particular user (e.g., each user whose record is maintained in the entity table 306). A user can create a "personal story" in the form of a collection of content that has been created and sent / broadcasted by the user. To this end, the user interface of the messaging client 104 may include a user-selectable icon to enable the sending user to add specific content to his or her personal story.

[0084] A collection may also constitute a "live story," which is a collection of content from multiple users created manually, automatically, or using a combination of manual and automatic techniques. For example, a "live story" may constitute a curated stream of user-submitted content from various locations and events. Users whose client devices have location services enabled and who are at a common location event at a particular time may be presented with the option of contributing content to a particular live story, for example, via the user interface of the messaging client 104. Live stories may be identified to the user by the messaging client 104 based on his or her location. The end result is a "live story" told from a community perspective.

[0085] Another type of content collection is called a "location story," which enables users whose client devices 102 are located in a particular geographic location (e.g., on a college or university campus) to contribute to a particular collection. In some examples, contributions to location stories may require secondary authentication to verify that the end user belongs to a particular organization or other entity (e.g., is a student on a university campus).

[0086] As mentioned above, the video table 304 stores video data, which in one example is associated with a message whose record is maintained within the message table 302. Similarly, the image table 312 stores image data associated with a message whose message data is stored in the entity table 306. The entity table 306 may associate various enhancements from the enhancement table 310 with the various images and videos stored in the image table 312 and the video table 304.

[0087] The training data 307 stores a language model including one or more n-grams. Each n-gram in the one or more n-grams includes a word or a word sequence and an associated LM score. The ASR engine uses the language model stored as the training data 307 to process the verbal input received from the user, and performs speech-based operations based on the processed verbal input. In some examples, the ASR engine uses the language model to generate a transcription of the verbal input. In some examples, one or more words associated with the same class can be added to the language model based on other n-grams of words including a class in the LM. This enables the ASR engine to improve the detection and recognition of a wider range of n-grams, which improves the overall user experience and the efficiency of operating the client device 102.

[0088] Data communication architecture

[0089] Figure 4 is a schematic diagram illustrating the structure of a message 400 according to some examples, the message 400 being generated by a messaging client 104 for transmission to another messaging client 104 or a messaging server 118. The content of a particular message 400 is used to populate a message table 302 stored in a database 126 accessible by a messaging server 118. Similarly, the content of the message 400 is stored in memory as "in-transit" or "in-flight" data of a client device 102 or application server 114. The message 400 is shown to include the following example components:

[0090] ●Message identifier 402: a unique identifier that identifies the message 400.

[0091] • Message text payload 404 : Text to be generated by a user via the user interface of the client device 102 and included in the message 400 .

[0092] • Message image payload 406 : Image data captured by a camera component of the client device 102 or retrieved from a memory component of the client device 102 and included in the message 400 . The image data for a sent or received message 400 may be stored in the image table 312 .

[0093] • Message video payload 408 : Video data captured by the camera component or retrieved from the memory component of the client device 102 and included in the message 400 . The video data for a message 400 that has been sent or received may be stored in the video table 304 .

[0094] • Message audio payload 410 : audio data captured by a microphone or retrieved from a memory component of the client device 102 and included in the message 400 .

[0095] Message enhancement data 412 : Enhancement data (eg, filters, stickers, or other annotations or enhancements) representing enhancements to be applied to the message image payload 406 , message video payload 408 , or message audio payload 410 of the message 400 .

[0096] • Message duration parameter 414: A parameter value indicating the amount of time in seconds that the content of a message (eg, message image payload 406, message video payload 408, message audio payload 410) will be presented to or made accessible to a user via the messaging client 104.

[0097] Message geolocation parameters 416: Geolocation data (e.g., latitude and longitude coordinates) associated with the content payload of the message. Multiple message geolocation parameter 416 values ​​may be included in the payload, each of which is associated with a content item included in the content (e.g., a specific image within a message image payload 406, or a specific video within a message video payload 408).

[0098] Message story identifier 418: An identifier value that identifies one or more content collections (e.g., a "story" identified in story table 314) associated with a particular content item in message image payload 406 of message 400. For example, an identifier value may be used to associate multiple images within message image payload 406 with each of multiple content collections.

[0099] Message tags 420: Each message 400 may be tagged with a plurality of tags, each of which indicates the subject of the content included in the message payload. For example, where a particular image included in the message image payload 406 depicts an animal (e.g., a lion), a tag value indicating the relevant animal may be included within the message tags 420. The tag values ​​may be manually generated based on user input, or may be automatically generated using, for example, image recognition.

[0100] • Message sender identifier 422: An identifier (eg, a messaging system identifier, an email address, or a device identifier) ​​that indicates the user of the client device 102 on which the message 400 was generated and from which the message 400 was sent.

[0101] • Message recipient identifier 424: An identifier (eg, a messaging system identifier, an email address, or a device identifier) ​​that indicates the user of the client device 102 to which the message 400 is addressed.

[0102] The content (e.g., value) of each component of message 400 may be a pointer to a location in a table in which the content data value is stored. For example, the image value in message image payload 406 may be a pointer to a location in image table 312 (or the address of a location in image table 312). Similarly, the value in message video payload 408 may point to data stored in video table 304, the value stored in message enhancement data 412 may point to data stored in enhancement table 310, the value stored in message story identifier 418 may point to data stored in story table 314, and the values ​​stored in message sender identifier 422 and message recipient identifier 424 may point to user records stored in entity table 306.

[0103] Word Grouping ASR System

[0104] Figure 5 A word grouping ASR system 230 is shown according to some examples. The word grouping ASR system 230 includes a speech module 520, an ASR module 530, a word list module 540, and a phrase generation module 510. Although all components are depicted as being part of the word grouping ASR system 230, any or all of the components may be implemented by separate devices and located in geographically different locations.

[0105] In some examples, the word grouping ASR system 230 accesses a LM including a plurality of n-grams, each of the plurality of n-grams including a corresponding word sequence and a corresponding LM score. The word grouping ASR system 230 receives a word list associated with a group classification, each word in the word list being associated with a corresponding weight, and calculates a probability that a given word in the word list associated with the group classification appears in an n-gram in the LM including a separate word sequence based on the LM scores of the plurality of n-grams. The word grouping ASR system 230 adds one or more new n-grams to the LM, the new n-grams including a combination of one or more words in the word list and the separate word sequence, and being associated with a particular LM score based on the calculated probability.

[0106] In some examples, the word grouping ASR system 230 identifies a subset of n-grams from a plurality of n-grams, the n-gram subset comprising a combination of a first portion of words in a word list associated with a group classification and a separate word sequence. The word grouping ASR system 230 detects that a second portion of words in the word list are excluded from the n-gram subset, and adds one or more new n-grams to the LM, the new n-grams comprising a combination of the second portion of words in the word list and a separate word sequence. The word grouping ASR system 230 assigns one or more LM scores to the one or more new n-grams, respectively, based on the LM score of each n-gram in the n-gram subset and the corresponding weights of the words in the word list. In some cases, the word grouping ASR system 230 adjusts the LM score of the n-gram subset in response to adding one or more new n-grams.

[0107] In some examples, the word grouping ASR system 230 queries the LM to obtain a complete list of n-grams that include any of the words in the word list, and identifies a first portion of n-grams in the complete list of n-grams that include the same word sequence. The word grouping ASR system 230 calculates a quantity representing the total number of n-grams in the LM that include the same word sequence, and generates a relevance metric based on a ratio of the first portion of n-grams to the quantity representing the total number of n-grams in the LM that include the same word sequence.

[0108] In some examples, the word grouping ASR system 230 compares the correlation metric to a threshold percentage and, in response to determining that the correlation metric exceeds the threshold percentage, associates a group tag with a first portion of n-grams in the complete list of n-grams that include the same sequence of words. The word grouping ASR system 230 uses the group tag to identify a subset of n-grams in the plurality of n-grams that include the first portion of words in the word list.

[0109] In some examples, the word grouping ASR system 230 determines that the individual word sequences are part of a prefix of a subset of n-grams that includes a first portion of words in the word list. Each word in the first portion of words in the word list may appear as a suffix after the prefix of the subset of n-grams. In this case, the word grouping ASR system 230 obtains a first LM score for the first n-gram in the subset of n-grams, and obtains a second LM score for the second n-gram in the subset of n-grams. The word grouping ASR system 230 calculates the probability as the sum of the first LM score and the second LM score.

[0110] In some cases, the word grouping ASR system 230 identifies a second portion of words in the word list that are excluded from the n-gram subset that includes the separate word sequence. The word grouping ASR system 230 combines each word in the second portion of words with the separate word sequence to add a corresponding n-gram in one or more new n-grams to the n-gram subset to form an updated n-gram subset, and assigns probabilities on the n-grams in the updated n-gram subset to associate each n-gram in the updated n-gram subset with a specific LM score.

[0111] In some examples, the word grouping ASR system 230 divides the probabilities among the n-grams in the updated n-gram subset according to the corresponding weight of each word in the word list.

[0112] In some examples, the word grouping ASR system 230 identifies a second portion of words in the word list that are excluded from the n-gram subset that includes the separate word sequence. The word grouping ASR system 230 combines each word in the second portion of words with the separate word sequence to add a corresponding n-gram in one or more new n-grams to the n-gram subset to form an updated n-gram subset, and determines that a first word in the second portion of words has a first weight that matches a second weight associated with a second word in the first portion of words.

[0113] In some examples, the word grouping ASR system 230 obtains the LM score of the first n-gram that includes the second word in the updated n-gram subset. The word grouping ASR system 230 associates the LM score of the first n-gram with the second n-gram that includes the first word in the updated n-gram subset.

[0114] In some examples, the word grouping ASR system 230 identifies a set of n-grams that include separate word sequences in the LM. The word grouping ASR system 230 normalizes the LM scores of the set of n-grams in response to associating the LM score of the first n-gram with a second n-gram in the updated subset of n-grams that includes the first word.

[0115] In some examples, the word grouping ASR system 230 determines that a first word in the second portion of words has a first weight that matches a third weight associated with a third word in the first portion of words. The word grouping ASR system 230 obtains an LM score for a second n-gram in the updated n-gram subset that includes the third word, and calculates an average of the LM scores for the first n-gram and the second n-gram. The word grouping ASR system 230 associates the average of the LM scores for the first n-gram and the second n-gram with the second n-gram in the updated n-gram subset that includes the first word.

[0116] In some examples, the word grouping ASR system 230 determines that a separate word sequence is part of a suffix of a subset of n-grams that includes a first portion of words in a word list. Each word in the first portion of words in the word list may appear as a prefix before the suffix of the subset of n-grams. In this case, the word grouping ASR system 230 calculates the sum of weights associated with the word list and obtains a first LM score for the first n-gram in the subset of n-grams. The word grouping ASR system 230 obtains a second LM score for the second n-gram in the subset of n-grams and calculates a probability based on a combination of a first ratio of a weight associated with the first word in the first portion of words to the calculated sum and the first LM score and a combination of a second ratio of a weight associated with the second word in the first portion of words to the calculated sum and the second LM score. The word grouping ASR system 230 associates the calculated probabilities with one or more new n-grams.

[0117] In some examples, the word grouping ASR system 230 determines that the separate word sequence includes the second word in the first portion of the word list. The word grouping ASR system 230 calculates a first probability based on a first sum of one or more probabilities of the separate word sequence and the first word in the word list, and calculates a second probability based on a second sum of one or more probabilities of the separate word sequence and the second word in the word list. The word grouping ASR system 230 calculates an average of the first probability and the second probability as the probability.

[0118] In some examples, the word grouping ASR system 230 identifies a second portion of words in the word list that are excluded from the n-gram subset that includes the separate word sequence. The word grouping ASR system 230 combines each word in the second portion of words with the separate word sequence to add a corresponding n-gram in one or more new n-grams to the n-gram subset to form an updated n-gram subset. The word grouping ASR system 230 assigns an average of the first probability and the second probability to the n-grams in the updated n-gram subset to associate each n-gram in the updated n-gram subset with a specific LM score.

[0119] The voice module 520 is configured to receive an audio stream including one or more words. The audio stream can be received by recording the user who speaks one or more words and generating an audio file. In some examples, the audio stream is received from another user through a messaging system or a chat system. In some examples, the audio stream is downloaded from the Internet and received from one or more websites. In some examples, the audio stream is selected from a group of pre-recorded audio streams. In this case, a user interface is presented to the user, multiple audio stream lists are presented in the user interface, and multiple audio stream lists are identified by respective icons or options. In response to receiving a user selection of an icon or option, the voice module 520 retrieves the corresponding audio stream in multiple audio streams. The voice module 520 provides an audio stream including one or more words to the ASR module 530 (which can implement an acoustic model and / or a decoder).

[0120] The ASR module 530 processes the audio stream received from the speech module 520. The ASR module 530 is configured to generate a transcription of the audio stream based on the LM including the words or phrases that have been added by the phrase generation module 510. In some examples, the ASR module 530 includes a decoder that includes phrase calculation probabilities and scores (discussed above and below). Based on the phrase calculation probabilities and scores, the ASR module 530 can generate a transcription of the audio stream.

[0121] The phrase generation module 510 identifies a set of n-grams associated with a class or category in the LM. To this end, the phrase generation module 510 receives a word list G including corresponding weights from the word list module 540. The word list module 540 generates a word list by receiving input from a user or an external source, which provides a word list corresponding to a specific class and their weights.

[0122] In some examples, the words are names of cities, countries, or states, in which case the class is a place or location. The weights for the names of cities, countries, or states are set based on population size, area size, population density, or any other parameter. The word list module 540 accesses yearbooks, atlases, databases, or other information sources to obtain real information associated with each city, country, or state, and uses this information to generate weights to be associated with each of the words in the list.

[0123] In some examples, the words are names or surnames of people. The weights of names or surnames of people are based on the frequency of occurrence of such words, the number of people with the same name and / or surname, the popularity of the name and / or surname, or any other suitable parameter. The word list module 540 accesses a database, census data, or other information source to obtain factual information associated with each name, and uses this information to generate a weight to be associated with each of the words in the list.

[0124] In some examples, the words are names of numbers. The weights of the names of numbers can be set similarly. In some cases, the names of the first ten or first 100 numbers can be associated with a greater weight than the weight associated with the rest of the set of numbers.

[0125] In some examples, the words are names of colors. The weights of the names of colors can be set similarly. In some cases, the names of primary colors can be associated with a greater weight than the weights associated with the rest of the set of colors.

[0126] The phrase generation module 510 can access the LM and search the LM based on the words in the word list received from the word list module 540. For example, the phrase generation module 510 retrieves any n-grams including one or more words in the word list from the LM. The phrase generation module 510 identifies a subset of n-grams belonging to the word class by identifying a set of identical prefixes associated with one or more words in the list. For example, the phrase generation module 510 can determine that a given n-gram includes a prefix "I live in" and a suffix including a given word in the list (e.g., London). The phrase generation module 510 can also determine that another n-gram includes the same prefix as the prefix of the given n-gram "I live in" and a suffix including another word in the list (e.g., New York). The phrase generation module 510 extracts the same prefix (sequence of words) associated with multiple words in the word list, and can search for other n-grams including the same prefix but the suffix does not include any word in the list, such as the n-gram "I live in peace". The phrase generation module 510 generates a complete list of n-grams that include the same word sequence (e.g., the same prefix), some of which include words in the word list and some of which do not include words in the word list. Specifically, for each word in the list or word, the phrase generation module 510 identifies or obtains all prefixes that contain such words and creates a common prefix set. The phrase generation module 510 then processes these prefixes one by one or all in parallel. For each prefix, all words that have n-grams with a specific prefix may already have a score, and words that do not have n-grams are added to the LM, where the score is specified according to the calculation scheme discussed above and below.

[0127] The phrase generation module 510 determines that some n-tuples in the complete list belong to the same class associated with the words in the list. For this reason, the phrase generation module 510 counts how many n-tuples in the complete list include one or more words in the word list. The phrase generation module 510 calculates the ratio of the number of n-tuples including one or more words in the word list to the total number of n-tuples sharing the same word sequence. This ratio is compared with a threshold value or a threshold percentage. In response to determining that this ratio exceeds a threshold value or a threshold percentage, the phrase generation module 510 determines that the complete list of n-tuples includes the n-tuples associated with the same class. The phrase generation module 510 forms an n-tuple subset including one or more words from the word list from the complete list.

[0128] For example, if the phrase generation module 510 queries LM for all known n-grams containing any city or name in G, the phrase generation module 510 can get a very long list of n-grams. Some may be obviously related to the class (e.g., city) as a whole (such as (I, live, in, %CITY%), (attractions, in, %CITY%), etc.), but some are specific to a single city and have no association with other cities. Take the phrase (all, roads, through, to, Rome) as an example. To solve this problem, the phrase generation module 510 only processes n-grams related to the group as a whole. To this end, the phrase generation module 510 defines a threshold percentage, such as 10 percent, for the number of group members that an n-gram must appear with in order to be considered relevant. Sometimes, not all members of a group are called unigrams, such as new cities, or members are not fully represented in the corpus. To illustrate it, the threshold is calculated based on a list of known group members (e.g., with a probability of being a unigram).

[0129] When iterating over all relevant n-grams, the phrase generation module 510 groups them together based on their "group form". For example, the phrase generation module 510 replaces all group members with a special "%GROUP%" token (such as I, live, in, %CITY%). The phrase generation module 510 then iterates over the group form, expanding back to all group members, and making sure that all group members are represented in the LM. This means that the phrase generation module 510 adds new n-grams and sometimes changes the scores of existing n-grams.

[0130] For example, the phrase generation module 510 can generate a subset of n-grams belonging to the class of the word received from the word list module 540. Specifically, Figure 6As shown, the phrase generation module 510 may use a table generated based on the words received from the word list module 540. The phrase generation module 510 generates or accesses a table 600 that lists a word list in a first column 610 and lists a weight associated with each word in the word list in a second column 620. The phrase generation module 510 accesses the LM 700 (e.g., Figure 7 ) to obtain a subset of n-grams 720 that includes a combination of the same word sequence and one or more words in the word list included in the first column 610. The phrase generation module 510 can also identify one or more n-grams 710 that include a combination of the same word sequence and a word not included in the word list. The phrase generation module 510 calculates the ratios discussed above to form a subset of n-grams 720 belonging to the word class.

[0131] The phrase generation module 510 retrieves the LM score for each n-gram in the subset 720 that includes one or more words in the list. The phrase generation module 510 stores the LM score in the raw score column 630 of the table 600. For example, the phrase generation module 510 determines that the first word 614 (e.g., a city named London) is associated with a first weight 624 and is in the n-gram (“I live in London”) in the LM 700. The phrase generation module 510 can determine that the n-gram that includes the first word 614 is associated with a first LM score 634. Similarly, the phrase generation module 510 can determine that the second word 616 (e.g., a city named Paris) is associated with a second weight 626 and is in the n-gram (“I live in Paris”) in the LM 700. The phrase generation module 510 can determine that the n-gram that includes the second word 616 is associated with a second LM score 636.

[0132] The phrase generation module 510 may determine that the third word 612 associated with the third weight 622 is in the word list but not in the n-gram subset 720. In this case, the phrase generation module 510 stores an unknown indicator in the raw score column 630 for the third word 612. The phrase generation module 510 may identify other words in the word list that are not included in the n-gram subset 720 and may similarly indicate an unknown status for the raw score column 630. These words are used to generate new n-grams to be stored and added to the n-gram subset 720 to improve the ASR module 530's recognition of such n-grams.

[0133] In some examples, phrase generation module 510 calculates or determines the scores to be associated with these added n-grams based on the probabilities or LM scores of other n-grams that do include one or more words in the word list. Typically, the "%GROUP%" tag may appear in a prefix, as a suffix, or even multiple times. Phrase generation module 510 ensures that it can be replaced by any member of the group (e.g., any word in the word list). To this end, phrase generation module 510 creates n-grams and sets scores for all group members.

[0134] In some examples, the "%GROUP%" marker is a suffix. For example, the same sequence of words associated with the n-gram subset 720 can appear before any word in the word list. Specifically, the word sequence can be the phrase "I live in" that appears in the prefix portion of the n-gram, and one or more words in the word list appear in the suffix portion of the n-gram (e.g., London). In some examples, the phrase generation module 510 redistributes the "probability mass" of known group elements. This ensures that the LM scores of other words are not adversely affected, but gives a smaller probability to the group members themselves because there are usually many group members.

[0135] In this case, the phrase generation module 510 adds together all LM scores for all group members. For example, suppose there are four cities or words in the word list, such as London, Paris, Rome, and Berlin. But only three words appear as suffixes of "I live in", with the following probabilities - 20%, 15%, 10%. That is, only three words can be found in the n-gram subset 720. This means that the probability of "%GROUP%" (any city) given "I live in" is 45% (e.g., 20%+15%+10%). The phrase generation module 510 can assign this 45% probability based on other criteria (e.g., the weights of the group members) and create new n-grams for the missing words. For example, the phrase generation module 510 can calculate P(%CITY%|I_live_in). Since there is only one suffix (I_live_in), the phrase generation module 510 can add together the probabilities of all cities included in the n-gram subset 720 and obtain P(London|I_live_in)+P(Paris|I_live_in)+P(Berlin|I_live_in)=20%+15%+10%=45%. In this case, the phrase generation module 510 determines that there is a 45% probability of seeing cities after we see "I_live_in", but there are two cities that are not included in the n-gram subset 720 (Madrid and Tokyo). The phrase generation module 510 can add the words (Madrid and Tokyo) without changing the probabilities of the other words after "I_live_in" by taking 45% of "city" and dividing it among the five cities included in the word list. In some cases, the phrase generation module 510 divides the probabilities evenly to get 9% for each city. In such a case, the phrase generation module 510 generates new n-grams that include the same word sequence (e.g., "I live in") as well as words that were not previously found in the LM (e.g., Madrid and Tokyo), adds these new n-grams to the n-gram subset 720, and accordingly changes the LM scores of all n-grams in the n-gram subset 720. For example, the phrase generation module 510 generates a changed score column 640 to reflect, for each word in the word list, the updated LM score of the n-gram subset 720. In this example, each n-gram in the n-gram subset 720 including the newly added n-grams is assigned a score of 9% based on a total probability of 45% divided by the total number of words in the word list (5).

[0136] This approach may disadvantage large cities such as London and Paris that have relatively larger weights specified in the second column 620, because they need to "share" their probabilities with the new city. One way to alleviate this problem is to spread the probabilities unevenly. Therefore, if the weights of each city in the second column 620 are London: 5, Paris: 5, Berlin: 3, Madrid: 1, Tokyo: 1, then the final probabilities stored in the changed score column 640 (45% divided by those weights) are: London 15%, Paris: 15%, Berlin: 9%, Madrid: 3%, Tokyo: 3%. If the weights of each city in the second column 620 are (London: 5, Paris: 5, Berlin: 3, Madrid: 5, Tokyo: 3), then the final probabilities stored in the changed score column 640 (45% divided by those weights) are: London 11%, Paris: 11%, Berlin: 6%, Madrid: 11%, Tokyo: 6%.

[0137] As another example, the phrase generation module 510 can assign new LM scores to new n-grams added to the n-gram subset 720 that are the same or similar to the LM scores of known group members that are ranked close to them. Thus, if, for example, "New York" does not appear in the corpus, but "London" appears in the corpus and has a similar weight and a probability of 10%, the phrase generation module 510 can also set the "New York" score to 10%. However, this violates the property that the scores of all suffixes within a prefix must not exceed 1.0, so the phrase generation module 510 can normalize all LM scores after changing all scores. Specifically, Madrid may have an unknown LM score, but has a weight similar to that of London and Paris. In this case, the LM score assigned to the new n-gram including the word "Madrid" can be a score of 17.5%, which is the average of the LM scores of the n-grams including the words London and Paris, which have weights similar to those assigned to the word Madrid. That is, the phrase generation module 510 can identify a set of words (e.g., London, Paris, and Madrid) that have weights that are within a threshold (e.g., 1) of each other and therefore can all have the same weight of 5. The phrase generation module 510 can determine that the n-gram subset 720 includes the words London and Paris, and can determine that the LM scores of these n-grams are, for example, 20% and 15%, respectively. The phrase generation module 510 can assign a new LM score 642 calculated based on an average of the determined LM scores, such as 17.5%, which is an average of 20% and 15%, to the new n-gram that includes the word "Madrid".

[0138] Similarly, the word "Tokyo" may also have an unknown LM score because the word does not appear in the n-gram subset 720. The phrase generation module 510 determines that the word "Berlin" has an LM score associated with the n-gram in the n-gram subset 720 that includes the word "Berlin" and has a weight similar to the weight of the word "Tokyo". In this case, the phrase generation module 510 may set the LM score of the word "Tokyo" to 10%, which is the same LM score as the LM score of the n-gram in the n-gram subset 720 that includes the word "Berlin". Therefore, the phrase generation module 510 stores the new LM scores of all words in column 640, which include words that were not previously included in the n-gram subset 720. For example, the LM scores are set to London: 20%, Paris: 15%, Berlin: 10%, Madrid: 17.5%, Tokyo: 10%. The problem now is that the possible suffixes of "I_live_in" include cities (including new cities) and the previous "other" words ("peace" and "harmony"). If we add all of this together, we get (20% + 15% + 10% + 17.5% + 10%) + (25% + 15% + 15%), which totals 127.5%. In order to bring the total prefix score to 100%, the phrase generation module 510 normalizes the LM scores by dividing all scores (including the "other" word) by 1.275 to generate the normalized score column 650. The LM scores for "peace" and "harmony" will also change and are not reflected in the table 600. In this case, the LM score 652 for the third word 612 is stored in the normalized score column 650.

[0139] In some examples, the phrase generation module 510 determines that one or more words in the word list appear as prefixes before the suffix that records the word sequence. Specifically, the phrase generation module 510 can determine that the n-gram subset 720 includes the same word sequence (e.g., "is lovely") behind one or more words in the word list. In this case, the phrase generation module 510 estimates the probability P ("beautiful" | "%CITY% is"), but the prefix represents multiple specific prefixes in the LM (where %CITY% is replaced by any group member). The phrase generation module 510 can first expand the prefix to all possible specific prefixes, and then estimate the expected probability. Once the phrase generation module 510 estimates P ("beautiful" | "%CITY% is"), the phrase generation module 510 checks all specific prefixes and ensures that they are all represented in the LM. If the suffix is ​​a single word (such as in the given case - "beautiful"), this means that the phrase generation module 510 must "distribute" the score to an n-gram that takes all of them. If the suffix also contains "%CITY%", the same probability must be extended to multiple n-grams using the same rules as before.

[0140] For example, the phrase generation module 510 estimates the probability of seeing "beautiful" after "<any city> is". The phrase generation module 510 may determine that only London and Tokyo are in the training set of the n-gram subset 720, but based on the weights, London is 5 times more likely to appear (overall) than Tokyo. Therefore, the phrase generation module 510 determines that the probability of seeing "beautiful" after London is 20%, and the probability of seeing "beautiful" after Tokyo is 50%. In this case, the probability of "beautiful" appearing after a general city can be calculated as: (WEIGHT(London) / SUM(weight)*P(beautiful|London_is))+(WEIGHT(Tokyo) / SUM(weight)*P(beautiful|Tokyo_is))=(5 / 6*20%)+(1 / 6*50%)=16.67%+8.33%=25%.

[0141] The phrase generation module 510 represents this probability for each city or word in the word list. Since the suffix is ​​just a single word ("beautiful"), there is no need to further divide the 25% between different suffixes. For the words "Tokyo" and "London", the phrase generation module 510 already has results from the real training set, so their LM scores are not adjusted. The phrase generation module 510 can create the following n-grams: Paris_is_beautiful: 25%; Berlin_is_beautiful: 25%; and Madrid_is_beautiful: 25%, thereby reflecting those words in the word list that are not included in the n-gram subset 720.

[0142] Group expansion also works when there are multiple group markers in the prefix. Taking (%CITY% and %CITY%) as an example, this will get the Cartesian product of all cities. When estimating the prior probability of the prefix, the phrase generation module 510 uses the independence assumption and multiplies the city probabilities together. Specifically, the grouped n-grams have %CITY% in both the prefix and the suffix. As mentioned above, the phrase generation module 510 estimates the probability of the suffix given the prefix (meaning "%CITY%" given "%CITY% is") given the prefix. But since %CITY% is in the prefix, we must calculate P(%CITY%|London_and), P(%CITY%|Paris_and), and P(%CITY%|Berlin_and), and average them according to the probability of seeing each city calculated with its given weight.

[0143] The probability can be calculated as P(%CITY%|London_sum)=P(Paris|London_sum)+P(Tokyo|London_sum)+P(Berlin|London_sum)=35%; P(%CITY%|Paris_sum)=P(London|Paris_sum)+P(Madrid|Paris_sum)=10% P(%CITY%|Berlin_and)=P(Tokyo|Berlin_and)=15%; Final calculation: P(%CITY%|%CITY%_and)=(W(London) / SUM(W)*P(%CITY%|London_and))+(W(Paris) / SUM(W)*P(%CITY%|Paris_and))+(W(Berlin) / SUM(W)*P(%CITY%|Berlin_and))=(5 / 15*35%)+(5 / 15*10%)+(3 / 15*15%)=11.67%+3.33%+3%=18%. Phrase generation module 510 may determine only three prefixes (London_and, Paris_and, Berlin_and) in the training data (e.g., in n-gram subset 720), but knows that there should be 5 prefixes (plus Tokyo and Madrid) because the word list includes 5 words. For each word, the phrase generation module 510 assigns an 18% probability of a general city among all cities (suffixes). The phrase generation module 510 can take the 18% and divide it evenly among the five cities or words, such as according to their weights, and cover the LM scores in the n-gram subset 720, or assign a probability of a similar city to each unknown city, and then normalize all scores so that the total score does not exceed 100%. For the "unknown" cities Madrid and Tokyo, in the case where the phrase generation module 510 does not find a previous n-gram in the LM (e.g., in the n-gram subset 720), the phrase generation module 510 divides the 18% by the weight. For those suffixes, the phrase generation module 510 creates a new n-gram for each city (2 prefixes, each with 5 suffixes = 10 new n-grams).

[0144] In some cases, the word list module 540 can dynamically update the word list provided to the phrase generation module 510. Whenever the phrase generation module 510 receives an update to the word list, the phrase generation module 510 performs the above-mentioned processing and steps to recalculate the LM score of the corresponding n-gram including the updated word list. In some cases, the word list module 540 accesses local and private data on the client device 102. In this case, the word list module 540 prevents such private data from being shared outside the client device 102 without prior authorization from the user. The word list module 540 can use private data such as the names of the user's friends on the messaging client 104 to generate the word list. These names can be assigned a greater weight than other names in the friend list that are not stored on the client device 102. The word list module 540 can send the name list to the phrase generation module 510 to improve the ASR recognition of any n-grams that feature or include names in the name list. The weights assigned to the name list can be dynamically updated based on the conversation in which the user participates. For example, if the user has more frequent conversations with a friend associated with a first name than with another friend associated with a second name, the word list module 540 may store a higher weight for the first name than for the second name. This in turn causes the phrase generation module 510 to calculate a higher LM score for one or more n-grams including the first name than for one or more n-grams including the second name.

[0145] Figure 8 800 is a flowchart illustrating example operations of the messaging client 104 according to some examples when performing the process 800. The process 800 may be embodied in computer-readable instructions executed by one or more processors, so that the operations of the process 800 may be performed in part or in whole by functional components of the messaging server system 108; therefore, the process 800 is described below by way of example with reference thereto. However, in other examples, at least some of the operations of the process 800 may be deployed on various other hardware configurations. The operations in the process 800 may be performed in parallel in any order, or may be skipped and omitted entirely.

[0146] At operation 801, the word grouping ASR system 230 accesses a LM comprising a plurality of n-grams, each n-gram of the plurality of n-grams comprising a respective word sequence and a corresponding LM score, as described above.

[0147] At operation 802, the word grouping ASR system 230 receives a word list associated with a group classification, each word in the word list being associated with a corresponding weight, as discussed above.

[0148] At operation 803, the word grouping ASR system 230 computes the probability that a given word in the word list associated with the group classification appears in an n-gram in the LM including the individual word sequences based on the LM scores of the plurality of n-grams, as discussed above.

[0149] At operation 804, the word grouping ASR system 230 adds one or more new n-grams to the LM, the new n-grams comprising a combination of one or more words in the word list and the individual word sequences, and associated with a particular LM score based on the calculated probabilities, as discussed above.

[0150] Machine Architecture

[0151] Fig. 9 It is a diagrammatic representation of a machine 900 within which instructions 908 (e.g., software, programs, applications, applet, app, or other executable code) may be executed for causing the machine 900 to perform any one or more of the methods discussed herein. For example, the instructions 908 may cause the machine 900 to perform any one or more of the methods described herein. The instructions 908 transform a general-purpose, unprogrammed machine 900 into a specific machine 900 that is programmed to perform the functions described and shown in the manner described. The machine 900 may operate as a standalone device or may be coupled (e.g., networked) to other machines. In a networked deployment, the machine 900 may operate as a server machine or a client machine in a server-client network environment, or as a peer machine in a peer-to-peer (or distributed) network environment. The machine 900 may include, but is not limited to, a server computer, a client computer, a personal computer (PC), a tablet computer, a laptop computer, a netbook, a set-top box (STB), a personal digital assistant (PDA), an entertainment media system, a cellular phone, a smart phone, a mobile device, a wearable device (e.g., a smart watch), a smart home device (e.g., a smart appliance), other smart devices, a web appliance, a network router, a network switch, a network bridge, or any machine capable of sequentially or otherwise executing instructions 908 specifying actions to be taken by the machine 900. In addition, although only a single machine 900 is shown, the term "machine" should also be considered to include a collection of machines that individually or jointly execute instructions 908 to perform any one or more of the methods discussed herein. For example, the machine 900 may include any of the client device 102 or a number of server devices that form part of the messaging server system 108. In some examples, the machine 900 may also include both a client system and a server system, wherein certain operations of a particular method or algorithm are performed on the server side, and certain operations of the particular method or algorithm are performed on the client side.

[0152] The machine 900 may include a processor 902, a memory 904, and an input / output (I / O) component 938 that may be configured to communicate with each other via a bus 940. In an example, the processor 902 (e.g., a central processing unit (CPU), a reduced instruction set computing (RISC) processor, a complex instruction set computing (CISC) processor, a graphics processing unit (GPU), a digital signal processor (DSP), an application specific integrated circuit (ASIC), a radio frequency integrated circuit (RFIC), another processor, or any suitable combination thereof) may include, for example, a processor 906 and a processor 910 that execute instructions 908. The term "processor" is intended to include multi-core processors, which may include two or more independent processors (sometimes referred to as "cores") that may execute instructions simultaneously. Although Fig. 9 Multiple processors 902 are shown, but the machine 900 may include a single processor with a single core, a single processor with multiple cores (e.g., a multi-core processor), multiple processors with a single core, multiple processors with multiple cores, or any combination thereof.

[0153] The memory 904 includes a main memory 912, a static memory 914, and a storage unit 916, which are all accessible by the processor 902 via the bus 940. The main memory 912, the static memory 914, and the storage unit 916 store instructions 908 that embody any one or more of the methods or functions described herein. The instructions 908 may also reside, completely or partially, within the main memory 912, within the static memory 914, within a machine-readable medium within the storage unit 916, within at least one of the processors 902 (e.g., within a cache memory of a processor), or within any suitable combination thereof during execution thereof by the machine 900.

[0154] The I / O components 938 may include various components for receiving input, providing output, generating output, sending information, exchanging information, capturing measurements, etc. The specific I / O components 938 included in a particular machine will depend on the type of machine. For example, a portable machine such as a mobile phone may include a touch input device or other such input mechanism, while a headless server machine will most likely not include such a touch input device. It will be appreciated that the I / O components 938 may include Fig. 9924 and 926. In various examples, the I / O components 938 may include a user output component 924 and a user input component 926. The user output component 924 may include a visual component (e.g., a display such as a plasma display panel (PDP), a light emitting diode (LED) display, a liquid crystal display (LCD), a projector, or a cathode ray tube (CRT)), an acoustic component (e.g., a speaker), a tactile component (e.g., a vibration motor, a resistance mechanism), other signal generators, etc. The user input component 926 may include an alphanumeric input component (e.g., a keyboard, a touch screen configured to receive alphanumeric input, an optical keyboard, or other alphanumeric input component), a point-based input component (e.g., a mouse, a touch pad, a trackball, a joystick, a motion sensor, or other pointing instrument), a tactile input component (e.g., a physical button, a touch screen or other tactile input component that provides the location and force of a touch or touch gesture), an audio input component (e.g., a microphone), etc.

[0155] In other examples, the I / O component 938 may include a biometric component 928, a motion component 930, an environmental component 932, or a positioning component 934, as well as various other components. For example, the biometric component 928 includes components for detecting expressions (e.g., hand expressions, facial expressions, voice expressions, body postures, or eye tracking), measuring biosignals (e.g., blood pressure, heart rate, body temperature, sweat, or brain waves), identifying a person (e.g., voice identification, retinal identification, facial identification, fingerprint identification, or EEG-based identification), etc. The motion component 930 includes an acceleration sensor component (e.g., an accelerometer), a gravity sensor component, and a rotation sensor component (e.g., a gyroscope).

[0156] Environmental components 932 include, for example, one or more cameras (with still image / photo and video capabilities), lighting sensor components (e.g., a photometer), temperature sensor components (e.g., one or more thermometers that detect ambient temperature), humidity sensor components, pressure sensor components (e.g., a barometer), acoustic sensor components (e.g., one or more microphones that detect background noise), proximity sensor components (e.g., an infrared sensor that detects nearby objects), gas sensors (e.g., a gas detection sensor that detects concentrations of hazardous gases for safety or measures pollutants in the atmosphere), or other components that can provide indications, measurements, or signals corresponding to the surrounding physical environment.

[0157] With respect to cameras, client device 102 may have a camera system including, for example, a front-facing camera on a front surface of client device 102 and a rear-facing camera on a rear surface of client device 102. The front-facing camera may, for example, be used to capture still images and videos (e.g., “selfies”) of a user of client device 102, which may then be enhanced with the enhancement data (e.g., filters) described above. For example, the rear-facing camera may be used to capture still images and videos in a more traditional camera mode, where the images are similarly enhanced with the enhancement data. In addition to the front-facing camera and the rear-facing camera, client device 102 may also include a 360° camera for capturing 360° photos and videos.

[0158] Additionally, the camera system of the client device 102 may include dual rear cameras (e.g., a main camera and a depth sensing camera), or even triple, quad, or quintuple rear camera configurations on the front and back sides of the client device 102. For example, these multiple camera systems may include a wide-angle camera, an ultra-wide-angle camera, a telephoto camera, a macro camera, and a depth sensor.

[0159] The positioning component 934 includes a position sensor component (for example, a GPS receiver component), an altitude sensor component (for example, an altimeter or barometer that detects air pressure, and the altitude can be obtained based on the air pressure), an orientation sensor component (for example, a magnetometer), etc.

[0160] A variety of technologies may be used to achieve communication. The I / O component 938 also includes a communication component 936 that is operable to couple the machine 900 to the network 920 or device 922 via a corresponding coupling or connection. For example, the communication component 936 may include a network interface component or other suitable device that interfaces with the network 920. In other examples, the communication component 936 may include a wired communication component, a wireless communication component, a cellular communication component, a near field communication (NFC) component, Components (e.g. Low power consumption), Device 922 may be another machine or any of a variety of peripheral devices (eg, a peripheral device coupled via USB).

[0161] In addition, the communication component 936 can detect the identifier or include a component that can be operated to detect the identifier. For example, the communication component 936 can include a radio frequency identification (RFID) tag reader component, an NFC smart tag detection component, an optical reader component (e.g., an optical sensor for detecting one-dimensional bar codes such as universal product code (UPC) bar codes, multi-dimensional bar codes such as Quick Response (QR) codes, Aztec codes, Data Matrix, Dataglyph, MaxiCode, PDF417, Ultra Code, UCC RSS-2D bar codes, and other optical codes) or an acoustic detection component (e.g., a microphone for identifying a tagged audio signal). In addition, various information can be obtained via the communication component 936, such as location via Internet Protocol (IP) geolocation, ... Signal triangulation to derive location, location via detection of NFC beacon signals that can indicate a specific location, etc.

[0162] Various memories (e.g., main memory 912, static memory 914, and memory of processor 902) and storage unit 916 may store one or more sets of instructions and data structures (e.g., software) implemented or used by any one or more of the methods or functions described herein. When executed by processor 902, these instructions (e.g., instructions 908) cause various operations to implement the disclosed examples.

[0163] The instructions 908 may be sent or received over the network 920 using a transmission medium via a network interface device (e.g., a network interface component included in the communication component 936) and using any of a number of well-known transmission protocols (e.g., the Hypertext Transfer Protocol (HTTP)). Similarly, the instructions 908 may be sent or received via a coupling (e.g., a peer-to-peer coupling) with the device 922 using a transmission medium.

[0164] Software Architecture

[0165] Fig.101000 is a block diagram illustrating a software architecture 1004 that can be installed on any one or more of the devices described herein. The software architecture 1004 is supported by hardware, such as a machine 1002 including a processor 1020, a memory 1026, and an I / O component 1038. In this example, the software architecture 1004 can be conceptualized as a stack of layers, where each layer provides specific functionality. The software architecture 1004 includes layers such as an operating system 1012, a library 1010, a framework 1008, and an application 1006. In operation, the application 1006 activates an API call 1050 through the software stack and receives a message 1052 in response to the API call 1050.

[0166] The operating system 1012 manages hardware resources and provides public services. The operating system 1012 includes, for example, a core 1014, a service 1016, and a driver 1022. The core 1014 serves as an abstraction layer between the hardware and other software layers. For example, the core 1014 provides functions such as memory management, processor management (e.g., scheduling), component management, networking, and security settings. The service 1016 can provide other public services to other software layers. The driver 1022 is responsible for controlling the underlying hardware or interfacing with the underlying hardware. For example, the driver 1022 may include a display driver, a camera driver, or Low-power drivers, Flash drivers, Serial communication drivers (e.g., USB drivers), Drivers, audio drivers, power management drivers, etc.

[0167] The library 1010 provides a common low-level infrastructure used by the application 1006. The library 1010 may include a system library 1018 (e.g., a C standard library) that provides functions such as memory allocation functions, string manipulation functions, mathematical functions, etc. In addition, the library 1010 may include an API library 1024, such as a media library (e.g., a library for supporting the presentation and manipulation of various media formats, such as Moving Picture Experts Group-4 (MPEG4), Advanced Video Coding (H.264 or AVC), Moving Picture Experts Group Layer-3 (MP3), Advanced Audio Coding (AAC), Adaptive Multi-Rate (AMR) audio codec, Joint Photographic Experts Group (JPEG or JPG), or Portable Network Graphics (PNG)), a graphics library (e.g., an OpenGL framework for presenting in two dimensions (2D) and three dimensions (3D) in graphical content on a display), a database library (e.g., SQLite providing various relational database functions), a web library (e.g., WebKit providing web browsing functions), etc. The library 1010 may also include various other libraries 1028 to provide many other APIs to the application 1006 .

[0168] The framework 1008 provides a common high-level infrastructure used by the applications 1006. For example, the framework 1008 provides various graphical user interface (GUI) functions, high-level resource management, and high-level location services. The framework 1008 can provide a wide range of other APIs that can be used by the applications 1006, some of which can be specific to a particular operating system or platform.

[0169] In an example, applications 1006 may include a home application 1036, a contacts application 1030, a browser application 1032, a book reader application 1034, a location application 1042, a media application 1044, a messaging application 1046, a game application 1048, and a variety of other applications such as external applications 1040. Applications 1006 are programs that execute functions defined in the program. Various programming languages ​​may be used to create one or more of the applications 1006 constructed in various ways, such as an object-oriented programming language (e.g., Objective-C, Java, or C++) or a procedural programming language (e.g., C or assembly language). In a specific example, external applications 1040 (e.g., an application created by an entity other than the vendor of a particular platform using ANDROID TM or IOS TM Applications developed using a software development kit (SDK) can be mobile operating systems such as IOS TM ANDROID TM , Or mobile software running on another mobile operating system. In this example, external application 1040 can activate API calls 1050 provided by operating system 1012 to facilitate the functions described herein.

[0170] Glossary

[0171] "Carrier signal" refers to any intangible medium capable of storing, encoding or carrying instructions for execution by a machine and includes digital or analog communications signals or other intangible media to facilitate transmission of such instructions. Instructions may be sent or received over a network using a transmission medium via a network interface device.

[0172] "Client Device" refers to any machine that interfaces with a communications network to obtain resources from one or more server systems or other client devices. A client device may be, but is not limited to, a mobile phone, a desktop computer, a laptop computer, a portable digital assistant (PDA), a smart phone, a tablet computer, an ultrabook, a netbook, a laptop computer, a multiprocessor system, a microprocessor-based or programmable consumer electronics product, a game console, a set-top box, or any other communications device that a user may use to access a network.

[0173] "Communications Network" means one or more parts of a network, which may be an ad hoc network, an intranet, an extranet, a virtual private network (VPN), a local area network (LAN), a wireless LAN (WLAN), a wide area network (WAN), a wireless WAN (WWAN), a metropolitan area network (MAN), the Internet, a part of the Internet, a part of the Public Switched Telephone Network (PSTN), a Plain Old Telephone Service (POTS) network, a cellular telephone network, a wireless network, A network, other type of network, or a combination of two or more such networks. For example, the network or a portion of the network may include a wireless network or a cellular network, and the coupling may be a code division multiple access (CDMA) connection, a global system for mobile communications (GSM) connection, or other type of cellular or wireless coupling. In this example, the coupling may implement any of various types of data transmission technologies, such as single carrier radio transmission technology (1xRTT), evolution data optimized (EVDO) technology, general packet radio service (GPRS) technology, enhanced data rates for GSM evolution (EDGE) technology, the third generation partnership project (3GPP) including 3G, fourth generation wireless (4G) networks, universal mobile telecommunications system (UMTS), high speed packet access (HSPA), world wide interoperability for microwave access (WiMAX), long term evolution (LTE) standards, other data transmission technologies defined by various standard setting organizations, other long distance protocols, or other data transmission technologies.

[0174] "Component" means a device, physical entity, or logic having boundaries defined by function or subroutine calls, branch points, APIs, or other techniques that provide partitioning or modularization of specific processing or control functions. Components may interface with other components via their interfaces to perform machine processes. A component may be a packaged functional hardware unit designed for use with other components and is part of a program that typically performs a specific one of the related functions.

[0175] Components may constitute software components (e.g., code implemented on a machine-readable medium) or hardware components. A "hardware component" is a tangible unit that is capable of performing certain operations and that can be configured or arranged in some physical manner. In various examples, one or more computer systems (e.g., stand-alone computer systems, client computer systems, or server computer systems) or one or more hardware components of a computer system (e.g., a processor or group of processors) may be configured by software (e.g., an application or application portion) as hardware components that operate to perform certain operations described herein.

[0176] Hardware components can also be implemented mechanically, electronically, or in any suitable combination thereof. For example, hardware components may include a dedicated circuit system or logic that is permanently configured to perform certain operations. Hardware components may be dedicated processors, such as field programmable gate arrays (FPGAs) or application specific integrated circuits (ASICs). Hardware components may also include programmable logic or circuit systems that are temporarily configured to perform certain operations by software. For example, hardware components may include software executed by general-purpose processors or other programmable processors. Once configured by such software, hardware components become specific machines (or specific components of machines) that are uniquely customized to perform configured functions, rather than general-purpose processors. It will be recognized that it can be determined for cost and time considerations whether to implement hardware components mechanically in a dedicated and permanently configured circuit system or in a temporarily configured (e.g., configured by software) circuit system. Therefore, the phrase "hardware components" (or "hardware-implemented components") should be understood to include tangible entities, i.e., entities that are physically constructed, permanently configured (e.g., hardwired) or temporarily configured (e.g., programmed) to operate in some way or perform certain operations described herein.

[0177] Consider an example where hardware components are temporarily configured (e.g., programmed), without configuring or instantiating each of the hardware components at any one time. For example, where the hardware components include a general-purpose processor that is configured by software to become a special-purpose processor, the general-purpose processor can be configured as different special-purpose processors (e.g., including different hardware components) at different times. The software configures one or more specific processors accordingly, for example, to constitute a specific hardware component at one time and to constitute different hardware components at different times.

[0178] Hardware components can provide information to other hardware components and receive information from other hardware components. Therefore, the described hardware components can be considered to be communicatively coupled. In the case of multiple hardware components simultaneously, communication can be realized by signal transmission (e.g., by appropriate circuits and buses) between or among two or more hardware components in the hardware components. In the example where multiple hardware components are configured or instantiated at different times, communication between such hardware components can be realized, for example, by storing information in a memory structure to which multiple hardware components have access rights and retrieving information in the memory structure. For example, a hardware component can perform an operation and store the output of the operation in a memory device communicatively coupled thereto. Then, other hardware components can access the memory device at a subsequent time to retrieve the stored output and process it. Hardware components can also initiate communication with input devices or output devices, and can operate resources (e.g., a collection of information).

[0179] The various operations of the example methods described herein may be performed at least in part by one or more processors that are temporarily configured (e.g., by software) or permanently configured to perform related operations. Whether temporarily configured or permanently configured, such a processor may constitute a processor-implemented component that operates to perform one or more operations or functions described herein. As used herein, a "processor-implemented component" refers to a hardware component implemented using one or more processors. Similarly, the method described herein may be implemented at least in part by a processor, wherein a specific one or more processors are examples of hardware. For example, at least some operations of the method may be performed by one or more processors 902 or processor-implemented components. In addition, one or more processors may also operate to support the execution of related operations in a "cloud computing" environment or as a "software as a service" (SaaS) operation. For example, at least some of the operations in the operation may be performed by a group of computers (as an example of a machine including a processor), wherein these operations may be accessed via a network (e.g., the Internet) and via one or more appropriate interfaces (e.g., API). The execution of certain operations may be distributed among processors, not just residing in a single machine, but deployed across several machines. In some examples, the processor or processor-implemented components may be located in a single geographic location (e.g., in a home environment, an office environment, or a server farm). In other examples, the processor or processor-implemented components may be distributed across several geographic locations.

[0180] "Computer-readable storage media" refers to both machine storage media and transmission media. Thus, the term includes both storage devices / media and carrier / modulated data signals. The terms "machine-readable medium," "computer-readable medium," and "device-readable medium" mean the same thing and may be used interchangeably in this disclosure.

[0181] "Ephemeral messages" are messages that are accessible for a limited duration. Ephemeral messages can be text, images, videos, etc. The access time for ephemeral messages can be set by the sender of the message. Alternatively, the access time can be a default setting or a setting specified by the recipient. Regardless of the setting technique, the message is transient.

[0182] "Machine storage media" refers to a single or multiple storage devices and media (e.g., centralized or distributed databases, and associated caches and servers) that store executable instructions, routines, and data. Thus, the term should be considered to include, but is not limited to, solid-state memory and optical and magnetic media, including memory internal or external to the processor. Specific examples of machine storage media, computer storage media, and device storage media include: non-volatile memory, including, for example, semiconductor memory devices such as erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), FPGA, and flash memory devices; magnetic disks, such as internal hard disks and removable disks; magneto-optical disks; and CD-ROM and DVD-ROM disks. The terms "machine storage media," "device storage media," and "computer storage media" mean the same thing and may be used interchangeably in this disclosure. The terms "machine storage media," "computer storage media," and "device storage media" expressly exclude carrier waves, modulated data signals, and other such media, at least some of which are encompassed by the term "signal media."

[0183] “Non-transitory computer-readable storage medium” refers to tangible media capable of storing, encoding, or carrying instructions to be executed by a machine.

[0184] "Signal media" refers to any intangible medium that is capable of storing, encoding, or carrying instructions executed by a machine, and includes digital or analog communication signals or other intangible media that facilitate the communication of software or data. The term "signal medium" should be deemed to include any form of modulated data signals, carrier waves, etc. The term "modulated data signal" means a signal that has one or more of its characteristics set or changed in such a manner as to encode information in the signal. The terms "transmission medium" and "signal medium" mean the same thing and may be used interchangeably in this disclosure.

[0185] Changes and modifications may be made to the disclosed examples without departing from the scope of the present disclosure. These and other changes or modifications are intended to be included within the scope of the present disclosure as expressed in the appended claims.

Claims

1. A method comprising: accessing, by one or more processors, a language model (LM) comprising a plurality of n-grams, each n-gram of the plurality of n-grams comprising a respective word sequence and a corresponding LM score; receiving a word list associated with the group classification, each word in the word list being associated with a corresponding weight; calculating, based on the LM scores for the plurality of n-grams, a probability that a given word in the word list associated with the group classification appears in an n-gram comprising a separate word sequence in the LM; as well as One or more new n-grams are added to the LM, the new n-grams comprising a combination of one or more words in the word list and the separate word sequence and associated with a specific LM score based on the calculated probability.

2. The method according to claim 1, further comprising: identifying a subset of n-grams from among the plurality of n-grams, the subset of n-grams comprising a combination of a first portion of words in the word list associated with the group classification and the separate word sequence; detecting that a second portion of words in the word list are excluded from the n-gram subset; adding to the LM the one or more new n-grams comprising a combination of the second part of words in the word list and the separate word sequence; as well as One or more LM scores are respectively assigned to the one or more new n-grams based on the LM score of each n-gram in the subset of n-grams and the corresponding weights of the words in the word list.

3. The method according to any one of claims 1 to 2, further comprising: The LM score for the subset of n-grams is adjusted in response to adding the one or more new n-grams.

4. The method according to any one of claims 1 to 3, further comprising: querying the LM to obtain a complete list of n-grams that include any word in the word list; identifying a first portion of n-grams in the complete list of n-grams that include the same word sequence; calculating a quantity representing the total number of n-grams in the LM that include the same word sequence; as well as A relevance metric is generated based on a ratio of the first portion of n-grams to the quantity representing a total number of n-grams in the LM that include the same word sequence.

5. The method according to claim 4, further comprising: comparing the correlation metric to a threshold percentage; In response to determining that the relevance metric exceeds the threshold percentage, associating a group label with the first portion of n-grams in the complete list of n-grams that include the same word sequence; as well as The group tags are used to identify a subset of n-grams in the plurality of n-grams that include the first portion of words in the word list.

6. The method according to any one of claims 1 to 5, further comprising: Determine that the separate word sequence is part of a prefix of a subset of n-grams that includes a first portion of words in the word list, wherein each word in the first portion of words in the word list appears as a suffix after the prefix of the subset of n-grams.

7. The method according to claim 6, further comprising: Obtain a first LM score for a first n-gram in the subset of n-grams; obtaining a second LM score for a second n-gram in the subset of n-grams; as well as The probability is calculated as the sum of the first LM score and the second LM score.

8. The method according to any one of claims 1 to 7, further comprising: identifying a second portion of words in the word list, the second portion of words being excluded from the subset of n-grams that includes the separate word sequence; combining each word in the second portion of words with the separate word sequence to add a corresponding n-gram of the one or more new n-grams to the n-gram subset to form an updated n-gram subset; as well as The probabilities are distributed over the n-grams in the updated n-gram subset to associate each n-gram in the updated n-gram subset with the particular LM score.

9. The method according to any one of claims 1 to 8, further comprising: The probabilities are divided among the n-grams in the updated n-gram subset according to the corresponding weight of each word in the word list.

10. The method according to any one of claims 1 to 9, further comprising: identifying a second portion of words in the word list, the second portion of words being excluded from the subset of n-grams that includes the separate word sequence; combining each word in the second portion of words with the separate word sequence to add a corresponding n-gram of the one or more new n-grams to the n-gram subset to form an updated n-gram subset; as well as A first word in the second portion of words is determined to have a first weight that matches a second weight associated with a second word in the first portion of words.

11. The method according to any one of claims 1 to 10, further comprising: Obtain the LM score of the first n-gram including the second word in the updated n-gram subset; as well as The LM score of the first n-gram is associated with a second n-gram in the updated subset of n-grams that includes the first word.

12. The method according to claim 11, further comprising: identifying a set of n-grams in the LM that include the individual word sequence; as well as In response to associating the LM score of the first n-gram with the second n-gram in the updated subset of n-grams that includes the first word, the LM scores of the set of n-grams are normalized.

13. The method according to any one of claims 1 to 12, further comprising: determining that a first word in the second portion of words has a first weight that matches a third weight associated with a third word in the first portion of words; Obtain the LM score of the second n-gram including the third word in the updated n-gram subset; calculating an average of the LM scores of the first n-tuple and the second n-tuple; as well as The average of the LM scores of the first n-gram and the second n-gram is associated with a second n-gram in the updated subset of n-grams that includes the first word.

14. The method according to any one of claims 1 to 13, further comprising: Determine that the separate word sequence is part of a suffix of an n-gram subset that includes a first portion of words in the word list, wherein each word in the first portion of words in the word list appears as a prefix preceding the suffix of the n-gram subset.

15. The method according to claim 14, further comprising: calculating a sum of said weights associated with said word list; Obtain a first LM score for a first n-gram in the subset of n-grams; obtaining a second LM score for a second n-gram in the subset of n-grams; calculating the probability based on a combination of a first ratio of the weight associated with a first word in the first portion of words to the calculated sum and the first LM score, and a combination of a second ratio of the weight associated with a second word in the first portion of words to the calculated sum and the second LM score; as well as The calculated probabilities are associated with the one or more new n-tuples.

16. The method according to any one of claims 1 to 15, further comprising: Determining that the separate word sequence includes the second word in the first portion of the word list.

17. The method according to claim 16, further comprising: calculating a first probability based on a first sum of one or more probabilities of the separate word sequence and a first word in the word list; calculating a second probability based on a second sum of one or more probabilities of the separate word sequence and a second word in the word list; and An average of the first probability and the second probability is calculated as the probability.

18. The method according to any one of claims 1 to 17, further comprising: identifying a second portion of words in the word list, the second portion of words being excluded from the subset of n-grams that includes the separate word sequence; combining each word in the second portion of words with the separate word sequence to add a corresponding n-gram of the one or more new n-grams to the n-gram subset to form an updated n-gram subset; as well as The average of the first probability and the second probability is distributed over the n-grams in the updated subset of n-grams to associate each n-gram in the updated subset of n-grams with the particular LM score.

19. A system comprising: A processor configured to perform operations comprising: accessing a language model (LM) comprising a plurality of n-grams, each n-gram of the plurality of n-grams comprising a respective word sequence and a corresponding LM score; receiving a word list associated with the group classification, each word in the word list being associated with a corresponding weight; calculating, based on the LM scores for the plurality of n-grams, a probability that a given word in the word list associated with the group classification appears in an n-gram comprising a separate word sequence in the LM; and One or more new n-grams are added to the LM, the new n-grams comprising a combination of one or more words in the word list and the separate word sequence and associated with a specific LM score based on the calculated probability.

20. A non-transitory machine-readable storage medium comprising instructions that, when executed by one or more processors, cause the one or more processors to perform operations comprising: accessing a language model (LM) comprising a plurality of n-grams, each n-gram of the plurality of n-grams comprising a respective word sequence and a corresponding LM score; receiving a word list associated with the group classification, each word in the word list being associated with a corresponding weight; calculating, based on the LM scores for the plurality of n-grams, a probability that a given word in the word list associated with the group classification appears in an n-gram comprising a separate word sequence in the LM; as well as One or more new n-grams are added to the LM, the new n-grams comprising a combination of one or more words in the word list and the separate word sequence and associated with a specific LM score based on the calculated probability.