Data search method and apparatus, and product and device

By using multi-dimensional intent understanding and similarity matching, the problem of inaccurate emoji search has been solved, achieving more accurate and richer emoji search.

WO2026158095A1PCT designated stage Publication Date: 2026-07-30TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2026-01-13
Publication Date
2026-07-30

AI Technical Summary

Technical Problem

Existing emoji search technology cannot accurately match users' search needs, resulting in inaccurate emoji searches.

Method used

By understanding multi-dimensional intent, the system obtains the intent text of the search text and performs similarity matching with text tags in the emoji library, thereby improving search accuracy.

Benefits of technology

It enables more accurate searching of emoticons that match the search text within the emoticon library, improving the accuracy and richness of the search.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2026072225_30072026_PF_FP_ABST
    Figure CN2026072225_30072026_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the present application are a data search method and apparatus, and a product and a device. The method comprises: acquiring search text and N intent understanding dimensions, wherein N is a positive integer; according to each intent understanding dimension, performing intent recognition on the search text, so as to generate intent text of the search text in each intent understanding dimension; acquiring text labels of each sticker in a sticker library, wherein the text labels of any sticker include intent labels of the sticker in the N intent understanding dimensions, respectively; and by means of the similarity between N pieces of intent text and the text labels of the stickers in the sticker library, searching the sticker library for a first sticker which matches the search text. By means of the present application, the accuracy of searching a sticker library for a sticker which matches search text can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Data search methods, devices, products and equipment

[0001] This application claims priority to Chinese Patent Application No. 2025101236043, filed on January 24, 2025, entitled “Data Search Method, Apparatus, Product and Equipment”, the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the technical field of data search, and more particularly to a data search method, apparatus, product, and device. Background Technology

[0003] In emoji search scenarios, users often face a pain point: they have a message they want to express, but struggle to find an emoji that perfectly matches its meaning. Current applications search and retrieve emojis based on the degree of overlap between the user's input text and the text within the emoji itself (e.g., the percentage of overlapping characters). However, this simple emoji search method often fails to find emojis that fully meet the user's needs, resulting in inaccurate searches. Therefore, how to accurately search for the emojis users want is a pressing issue. Summary of the Invention

[0004] This application provides a data search method, apparatus, product, and device that can improve the accuracy of searching for emoticons that match search text in an emoticon library.

[0005] This application provides a data search method, which includes:

[0006] Obtain the search text and N dimensions of intent understanding, where N is a positive integer;

[0007] The search text is subjected to intent recognition according to each intent understanding dimension, and intent text of the search text is generated in each intent understanding dimension.

[0008] Obtain the text label for each emoji in the emoji library. The text label for any emoji includes the intent label for that emoji across N intent understanding dimensions.

[0009] By comparing the similarity between N intent texts and the text tags of emoticons in the emoticon library, the first matching emoticon in the emoticon library is searched for the search text.

[0010] This application provides a data search device, which includes:

[0011] The first acquisition module is used to acquire the search text and N dimensions of intent understanding, where N is a positive integer.

[0012] The generation module is used to perform intent recognition on the search text according to each intent understanding dimension, and generate intent text of the search text in each intent understanding dimension.

[0013] The second acquisition module is used to acquire the text label of each emoji in the emoji library. The text label of any emoji includes the intent label of any emoji in N intent understanding dimensions.

[0014] The search module is used to search for the first matching emoji in the emoji library based on the similarity between N intent texts and the text tags of emojis in the emoji library.

[0015] This application provides a computer device, including a memory and a processor. The memory stores a computer program, and when the computer program is executed by the processor, the processor performs the method of this application.

[0016] This application provides a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to perform the method described in the above-mentioned aspect.

[0017] This application provides a computer program product comprising a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium and executes the computer program, causing the computer device to perform the methods provided in the various alternative embodiments described above.

[0018] This application can obtain search text, which is used to trigger a search for emoticons; and can perform intent recognition on the search text from N intent understanding dimensions to generate intent text for the search text in each intent understanding dimension, so as to obtain N intent texts, where N is a positive integer; and can also obtain the text tags of each emoticon in the emoticon library, wherein the text tags of any emoticon include the intent tags of any emoticon in each of the N intent understanding dimensions; thus, by using the similarity between the N intent texts and the text tags of the emoticons in the emoticon library, a first matching emoticon can be searched in the emoticon library for the search text. As can be seen, the method proposed in this application can perform multi-dimensional intent recognition on the search text used to search for emoticons from multiple intent understanding dimensions. The dimensions of intent recognition are richer and more comprehensive, allowing the intent text obtained from intent recognition to be more granular and reliable. Furthermore, by configuring each emoticon in the emoticons with its own intent tags in these multiple intent understanding dimensions, the intent tags of each emoticon can also be interpreted from multiple dimensions, and the intent tags of each emoticon can have sufficiently high accuracy. In this way, by using the similarity between the intent text and the text tags (intent tags) of the emoticons with granular reliability, a multi-dimensional search for emoticons that match the search text can be achieved from these multiple intent understanding dimensions, thereby improving the accuracy of searching for emoticons that match the search text in the emoticon library. Attached Figure Description

[0019] Figure 1 is a schematic diagram of a network architecture for searching emoticons provided in an embodiment of this application;

[0020] Figure 2 is a schematic diagram of a scenario provided by an embodiment of this application for searching for matching emoticons for search text;

[0021] Figure 3 is a flowchart illustrating a data search method provided in an embodiment of this application;

[0022] Figure 4 is a schematic diagram of the effect of a chat interface provided in an embodiment of this application;

[0023] Figure 5 is a schematic diagram of a process for searching and obtaining emoticons provided in an embodiment of this application;

[0024] Figure 6 is a flowchart illustrating a method for training an intent recognition model according to an embodiment of this application;

[0025] Figure 7 is a schematic diagram of the structure of an intent recognition model provided in an embodiment of this application;

[0026] Figure 8 is a flowchart illustrating a method for searching a first emoticon in an emoticon library according to an embodiment of this application;

[0027] Figure 9 is a schematic diagram illustrating the principle of obtaining the search matching degree between search text and target emoticon image according to an embodiment of this application;

[0028] Figure 10 is a schematic diagram illustrating the principle of constructing antonym pairs according to an embodiment of this application;

[0029] Figure 11 is a schematic diagram of the framework of a data processing system provided in an embodiment of this application;

[0030] Figure 12 is a schematic diagram of the structure of a data search device provided in an embodiment of this application;

[0031] Figure 13 is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0032] All data collected in this application (such as search text, text tags for emoticons, and other related data) are collected with the consent and authorization of the data owner (such as a user, organization, or enterprise), and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant regions.

[0033] The relevant technical concepts involved in this application are described herein:

[0034] Emoji templates: These are emoji images created by processing original emoji pictures or GIF (an image file format) animations. They do not contain any explicit text and only contain the main image. They can be combined with any text to create new emojis with different meanings.

[0035] Synthetic emojis (or simply synthetic emoticons): New emoticons are created by overlaying arbitrary text onto emoticon templates. This expands the scope of existing emoticons and improves the accuracy and fun of the emoticons presented to users.

[0036] AIGC: AI (Artificial Intelligence) Generated Content. In this application, it may specifically refer to the technology of generating images from text, including generating static images from text, generating dynamic GIFs or videos from text, and the generated content can be used as emoticon templates.

[0037] Please refer to Figure 1, which is a schematic diagram of a network architecture for searching emoticons provided in an embodiment of this application. As shown in Figure 1, the network architecture may include a server 200 and a cluster of terminal devices. The cluster of terminal devices may include one or more terminal devices; the number of terminal devices is not limited here. As shown in Figure 1, the multiple terminal devices may specifically include terminal device 1, terminal device 2, terminal device 3, ..., terminal device n. As shown in Figure 1, terminal device 1, terminal device 2, terminal device 3, ..., terminal device n can all be connected to the server 200 via the network, so that each terminal device can interact with the server 200 through the network connection.

[0038] As shown in Figure 1, server 200 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Terminal devices can be smart terminals such as smartphones, tablets, laptops, desktop computers, smart TVs, in-vehicle terminals, and smart home devices. The following description uses the communication between terminal device 1 and server 200 as an example to illustrate the specific implementation of this application.

[0039] Terminal device 1 may include different clients, such as instant messaging clients, browsers, video clients, etc. For clients with communication functions, this application may refer to them as communication clients. These communication clients support communication using emoticons. The solution provided in this application will be illustrated using a communication client as an example. Server 200 may be the backend server of this communication client. When a user chats with a friend in the communication client, they can enter search text to trigger an emoticon search. The communication client can send the user-entered search text to server 200, allowing server 200 to search for emoticons matching the search text in the background. The server can return the searched emoticons to the communication client, allowing the communication client to display the received emoticons in the user's chat interface for viewing and selection. The process of server 200 searching for emoticons matching the search text is described below.

[0040] Please refer to Figure 2, which is a schematic diagram of a scenario for searching for matching emoticons for search text according to an embodiment of this application. As shown in Figure 2, the server 200 in Figure 1 can perform intent recognition on the search text from N intent understanding dimensions. If the intent recognition of the search text is performed through one intent understanding dimension, the intent of the search text can be understood according to this intent understanding dimension, thereby obtaining the intent text of the search text in that intent understanding dimension. Based on this, if the intent recognition of the search text is performed through N intent understanding dimensions respectively, N intent texts can be obtained. These N intent texts may include intent text 1 to intent text N, where the intent understanding dimension may include intent understanding dimension 1 to intent understanding dimension N, and intent text 1 may correspond to intent understanding dimension 1, intent text 2 may correspond to intent understanding dimension 2, ..., intent text N may correspond to intent understanding dimension N.

[0041] Server 200 can also access an emoji library, which can contain multiple emojis. Each emoji in the emoji library has a text tag, and each emoji's text tag can include the emoji's intent tags in N intent understanding dimensions. In other words, by aggregating the intent tags of an emoji in N intent understanding dimensions (aggregating them into a set), the resulting tag set can form the text tag of that emoji.

[0042] Therefore, server 200 can search for matching emoticons in the emoticon library based on the similarity between the N intent texts of the search text and the text tags of emoticons in the emoticon library. Specifically, for a given emoticon, the more similar its text tags are to the intent texts of the search text, the better the match between the emoticon and the search text. This specific process can also be found in the relevant descriptions in the following embodiments.

[0043] Using the method provided in this application, fine-grained semantic understanding can be performed on the search text provided by the user from N intent understanding dimensions to obtain N intent texts of the search text in the N intent understanding dimensions. Thus, by the similarity between the N intent texts and the text tags of emoticons in the emoticon library, matching emoticons can be searched for more fine-grained and accurate search for the search text from the N intent understanding dimensions.

[0044] Please refer to Figure 3, which is a flowchart illustrating a data search method provided in an embodiment of this application. The executing entity in this embodiment can be a data search device (hereinafter referred to as a search device). This search device can be a computer device or a cluster of multiple computer devices. The computer device can be a server or other devices; this application does not impose any limitations on this. As shown in Figure 3, the method may include:

[0045] Step S101: Obtain the search text and N dimensions of intent understanding, where N is a positive integer.

[0046] Specifically, the search device can acquire search text, which can be used to trigger a search for emoticons. This search text can be text entered by the user (the "object") to search for emoticons. For example, the search text could be entered by the user in a communication client, specifically in the chat interface of that client, to search for emoticons used in a chat conversation. This communication client can be any client that supports communication via emoticons.

[0047] The search device can be a backend device (such as a backend server) of the communication client, and the search text obtained by the search device can be sent by the communication client to the search device. For example, the communication client can send an emoji search request to the search device, and the emoji search request can carry the search text. The search device can search for emojis using the search text carried in the emoji search request.

[0048] For example, if the search text could be "Hello", then the search text would be used to search for emoticons related to the text "Hello"; as another example, if the search text could be "Goodnight", then the search text would be used to search for emoticons related to the text "Goodnight"; and as yet another example, if the search text could be "Hahaha", then the search text would be used to search for emoticons related to the text "Hahaha".

[0049] The N intent understanding dimensions can be preset N dimensions of search intent for emoticons, where N is a positive integer, and the specific value of N can be determined according to the actual application scenario. These N intent understanding dimensions can be flexibly set according to the actual search needs for emoticons, and this application does not limit the specific content of these N intent understanding dimensions. The N intent understanding dimensions are described here as an example, such as including at least one of the following: keyword understanding dimension, emotion understanding dimension, and popular phrase understanding dimension.

[0050] The understanding dimension of the aforementioned keywords refers to the dimension of the keywords in the search text that needs to be understood. Therefore, the intent text generated by performing intent recognition on the search text based on the understanding dimension of these keywords can be the keywords extracted from the search text. This intent text can include at least one keyword extracted from the search text. For example, the search text could be "the gesture of wishing someone a Happy New Year," and the keyword extracted from this search text could be "wishing someone a Happy New Year."

[0051] The aforementioned dimension of emotion understanding is the dimension that requires understanding the type of emotion expressed by the search text. Therefore, the intent text generated by performing intent recognition on the search text from this dimension of emotion understanding can be an emotion word that reflects the type of emotion expressed by the search text. For example, if the search text is "anger," then the intent text in this dimension of emotion understanding can be the emotion word "anger"; similarly, if the search text is "laughing out loud," then the intent text in this dimension of emotion understanding can be the emotion word "happy."

[0052] The aforementioned dimension of understanding popular phrases refers to understanding the dimension of popular phrases associated with the search text. Therefore, the intent text generated by performing intent recognition on the search text based on the understanding dimension of the popular phrase can be the popular phrase represented (or associated with) by the search text, such as a popular internet slang term. For example, if the search text is "Working is so tiring," then the intent text on the understanding dimension of the popular phrase could be the popular phrase "workplace vibe."

[0053] Step S102: Perform intent recognition on the search text according to each intent understanding dimension, and generate intent text of the search text in each intent understanding dimension.

[0054] Specifically, for N intent understanding dimensions, the search device can perform intent recognition on the search text according to each intent understanding dimension to generate an intent text for that search text in that intent understanding dimension. Since there are N intent understanding dimensions, there can also be N intent texts accordingly. Specifically, performing intent recognition on the search text from one intent understanding dimension can generate a corresponding intent text. Therefore, one intent text corresponds to one intent understanding dimension. One intent text is used to express the search intent of the search text in that intent understanding dimension. This search intent is, for example, the intent to search for emoticons, such as the intent to search for emoticons expressing the emotion "happy".

[0055] In one implementation, taking N intent understanding dimensions, including intent understanding dimension i, as an example, the search device performs intent recognition on the search text according to one intent understanding dimension to generate intent text of the search text in that intent understanding dimension. This can include:

[0056] The search device can acquire a trained intent recognition model. This trained intent recognition model can be a pre-trained model capable of recognizing N search intents from the aforementioned N intent understanding dimensions. The specific training process of this intent recognition model can be found in the relevant description in the embodiment corresponding to Figure 6 below. The trained intent recognition model of this application can include a text encoder and N text decoders. Each text decoder corresponds to one intent understanding dimension, and each text decoder can be used to perform intent recognition on the search text at the corresponding intent understanding dimension. Therefore, for intent understanding dimension i, the text decoder corresponding to intent understanding dimension i can be used to perform intent recognition on the search text at intent understanding dimension i.

[0057] The search device can input the search text into the trained intent recognition model, which then calls the text encoder within the model to perform feature encoding on the search text, thereby generating encoded features of the search text. These encoded features can be feature vectors generated by the text encoder for the search text. Further, the search device can call the text decoder corresponding to intent understanding dimension i in the trained intent recognition model to perform feature decoding on the encoded features at intent understanding dimension i, thereby generating intent text of the search text at this intent understanding dimension i. Specifically, a text decoder can perform feature decoding on the encoded features of the search text at the corresponding intent understanding dimension to generate intent text of the search text.

[0058] In one implementation, a generation range can be set for each of the above text decoders. A text decoder can decode and generate the intent text of the search text within its set generation range. For example, for a text decoder corresponding to the understanding dimension of the above keywords, its set generation range could include multiple selectable and generated keywords, such as keywords from a thesaurus. For a text decoder corresponding to the understanding dimension of the above emotions, its set generation range could include multiple selectable and generated emotion words. For a text decoder corresponding to the understanding dimension of the above popular phrases, its set generation range could include multiple selectable and generated popular phrases.

[0059] Furthermore, the elements within the generation range corresponding to each text decoder in this application can be dynamically added or deleted, which not only increases the interpretability of the intent text generated by the text decoder, but also makes the content of the intent text generated by the text decoder controllable and modifiable.

[0060] In this application, the intent text of the search text can be empty (i.e., "null") in certain intent understanding dimensions. Specifically, the intent text of the search text in this application can have the option of being "empty" across various intent understanding dimensions. This means that when the text decoder performs feature decoding to generate intent text, it can have this "empty" generation option. For example, for search text that does not express a popular phrase, its intent text in the aforementioned popular phrase understanding dimension can be empty.

[0061] This application decouples various intent understanding dimensions, with each intent understanding dimension corresponding to a text decoder, thereby improving the flexibility of maintaining and adding / removing these dimensions. For example, when a certain intent understanding dimension is no longer needed, the text encoder corresponding to that dimension can be directly removed.

[0062] This application models the matching process from a user query (i.e., search text) to an emoticon as a multi-dimensional and open short text generation task (such as a task of generating intent text). This short text generation task can be implemented through an intent recognition model that includes a multi-task text decoder to generate multiple intent texts of the search text (i.e., the aforementioned N intent texts). This intent recognition model belongs to the sequence-to-sequence (such as the text sequence of search text) generation model.

[0063] Step S103: Obtain the text label for each emoticon in the emoticon library. The text label for any emoticon includes the intent label for that emoticon in N different intent understanding dimensions.

[0064] Specifically, the emoji library can contain many selectable and searchable emojis. The search device can obtain the text tags for each emoji in the emoji library. Any emoji can be assigned multiple text tags, and this application can achieve emoji searching through the text tags. In this application, for any emoji, the text tags of this emoji can include the intent tags of the emoji in the aforementioned N intent understanding dimensions, that is, the text tags of this emoji can include the N intent tags of the emoji in those N intent understanding dimensions. An emoji can have one intent tag in one intent understanding dimension. The N intent tags of the emoji can correspond to the N intent understanding dimensions for intent recognition of the search text.

[0065] In this application, the intent labels for emoticons on certain intent understanding dimensions can also be empty ("null"). For example, for emoticons without associated slang, their intent labels on the aforementioned slang understanding dimensions can be empty.

[0066] For example, for an angry emoji, its intention label in the above-mentioned emotion understanding dimension could be the emotion word "angry"; for an emoji of someone tired from work, its intention label in the above-mentioned popular phrase understanding dimension could be the popular phrase "work-related"; for an emoji containing the text "hello", its intention label in the above-mentioned keyword understanding dimension could be the text "hello", or in other scenarios, it could be a keyword extracted from the text contained in the emoji.

[0067] Furthermore, the text tags for emoticons in the emoticon library can also include general tags. That is, the text tags for any emoticon can include its own general tags, which can be text tags related to the emoticon's inherent expression attributes. For example, the general tags for any emoticon can include its expression type tag (used to describe the emoticon's expression type, such as "greeting," "apology," "farewell," etc.), tags indicating the text contained in the emoticon (used to describe the text contained in the emoticon, such as "hello"), and the emoticon pack to which the emoticon belongs (used to indicate which emoticon pack the emoticon belongs to, such as the "cute little yellow duck" emoticon pack), and so on. The specific text tags included in the general tags for emoticons can be set according to actual application needs.

[0068] Step S104: Based on the similarity between the text tags of N intent texts and emoticons in the emoticon library, search for the first matching emoticon in the emoticon library for the search text.

[0069] Specifically, the search device can search for matching emoticons in the emoticon library based on the similarity between N intent texts and the text tags of emoticons in the library. The emoticon found that matches the search text can be called the first emoticon. The similarity between an intent text and the text tags of an emoticon in the library is reflected by the text similarity score; the higher the score, the more similar the intent text and the text tags are. The text tags of the first emoticon can be similar to the N intent texts, and there can be multiple first emoticons.

[0070] Specifically, by comparing the similarity between N intent texts and the text tags of each emoticon in the emoticon library, the search matching degree between the search text and each emoticon can be determined. Based on the search matching degree between the search text and each emoticon, the first emoticon can be selected from the emoticon library. For details on how to determine the search matching degree between the search text and each emoticon and how to search for the first emoticon in the emoticon library, please refer to the description in the embodiment corresponding to Figure 8 below. In this application, each first emoticon can be sorted and displayed according to its search matching degree with the search text (the calculation process can be found in the relevant description in the embodiment corresponding to Figure 8 below). That is, when displaying the searched first emoticons in the communication client, the first emoticon with a higher search matching degree with the search text can be displayed earlier, and vice versa.

[0071] In one embodiment, the search device can further perform emoji expansion processing on the search text to obtain expanded emoji images, which can be referred to as second emoji images. This application can also return the expanded second emoji image to the communication client for display. When displaying emoji images in the communication client, the first emoji image can be displayed entirely in front of the second emoji image, or the first and second emoji images can be displayed in separate areas on the client interface (such as a chat interface). The display order of the various second emoji images can be random or a pre-defined order, which can be determined according to the actual application scenario.

[0072] The search text can be sent from the communication client to the search device. Therefore, the search device can return both the first emoticon and the expanded second emoticon to the communication client, so that the communication client can output the received first and second emoticons for the user to view and select.

[0073] For example, the process of expanding emoticons by searching text can include: the search device can obtain a trained language rewriting model, which can be a pre-trained model capable of rewriting the text used for emoticon search into more specific text describing the specific style of the emoticon to be generated. For instance, the trained language rewriting model could be a trained Large Language Model (LLM model).

[0074] Therefore, the search device can call the trained language rewriting model to rewrite the search text to generate an expression description text corresponding to the search text. This expression description text is the description text that rewrites the search text into the specific expression image that the user wants to find. For example, the search text could be "My back hurts so much tonight," and the corresponding expression description text could be "a cartoon cat with its paws on its back and lying on the ground crying."

[0075] In one implementation, the process of training the trained language rewriting model may include: the search device acquiring a third sample text and the language rewriting model to be trained. The third sample text may be a sample used to train the language rewriting model. The third sample text may be text that a user might input when searching for an emoticon during the training phase. The nature of the third sample text is similar to that of the search text, i.e., the third sample text may be text used to search for emoticons.

[0076] The third sample text can have a reference rewritten text. This reference rewritten text can be an ideal descriptive text that rewrites the third sample text into the specific emoji to be generated. In other words, we hope that the language rewriting model can rewrite the third sample text into its reference rewritten text. This reference rewritten text can be understood as the sample label of the third sample text.

[0077] Therefore, the search device can call the language rewriting model to be trained to perform language rewriting processing on the third sample text, and generate the sample rewritten text corresponding to the third sample text. The sample rewritten text is the text used to specifically describe the emoticon to be generated by the language rewriting model to be trained.

[0078] The search device can correct the model parameters of the language rewriting model to be trained by analyzing the differences between the sample rewritten text and the reference rewritten text, thus obtaining the trained language rewriting model. For example, the search device can generate a generation loss (i.e., loss function) for the language rewriting model to be trained on the sample rewritten text and the reference rewritten text. This generation loss could be the cross-entropy loss between the sample rewritten text and the reference rewritten text. This generation loss reflects the bias of the language rewriting model to be trained in rewriting the third sample text. It also reflects the difference between the sample rewritten text and the reference rewritten text; a larger generation loss indicates a greater difference between the sample rewritten text and the reference rewritten text, and vice versa. The search device can use this generation loss to correct the model parameters of the language rewriting model to be trained, thus obtaining the trained language rewriting model.

[0079] The goal of correcting the model parameters of the language rewriting model under training through this generation loss is to adjust the model parameters so that the generation loss approaches its minimum value (e.g., approaches 0). There can be multiple third sample texts, each with its own reference rewritten text. The search device can perform multiple rounds of iterative training on the language rewriting model under training using these multiple third sample texts, following the principles described above. When the training of the language rewriting model is complete, the trained language rewriting model can be obtained. For example, completing the training of the language rewriting model can mean: adjusting the model parameters to a convergent state, or the number of rounds of iterative training of the language rewriting model equals a set round threshold.

[0080] The search device can also acquire a text-to-image model, which is a trained model that can generate images that match the text content described by the input text. Therefore, the search device can call this text-to-image model to generate L emoticon images that match the text content described by the emoticon description text corresponding to the search text. These L emoticon images can be called L candidate emoticon images, where L is a positive integer representing the number of images the text-to-image model can generate at one time. The value of L can be the default setting of the text-to-image model, or the value of L can be set according to the actual application scenario.

[0081] Through the above process, it can be understood that since text-based image models usually cannot intuitively understand the user's search text requirements for generating emoticons, this application can rewrite the search text into emoticon description text, and then call the text-based image model to accurately generate the emoticon required by the user through the rewritten emoticon description text.

[0082] The search device can access an image-text matching model, which can be a trained model capable of predicting the relevance (or matching degree) between input text and input image. A higher relevance between the input text and image indicates a closer similarity (i.e., more relevant or more matched) between the text content and the image content. Therefore, the search device can call this image-text matching model to predict the relevance between each candidate emoticon and the corresponding emoticon description text. A candidate emoticon and its description text can have a single relevance score.

[0083] In one implementation, the search device can sort the L candidate emoticons according to their image-text relevance to the emoticon description text, from highest to lowest, to obtain a sorted set of L candidate emoticons. Among these sorted L candidate emoticons, those with higher image-text relevance to the emoticon description text are placed earlier, while those with lower image-text relevance are placed later.

[0084] The search device can generate expanded second emoticons from the first P candidate emoticons among the L sorted candidate emoticons. For example, the P candidate emoticons can serve as P emoticon templates. The search device can synthesize the search text with each of these P templates to generate P expanded second emoticons, which are the new emoticons generated through the text-to-image model. P is a positive integer, and P is less than L. The value of P can be set according to the actual application scenario.

[0085] Alternatively, the search device can generate an expanded second emoticon image from the L candidate emoticon images mentioned above, based on the candidate emoticon images whose image-text relevance to the emoticon description text is greater than or equal to a relevance threshold (which may be preset). For example, the search text can also be synthesized with each of the candidate emoticon images whose image-text relevance to the emoticon description text is greater than or equal to the relevance threshold to generate the expanded second emoticon image.

[0086] This application uses a text-based image model to generate new emoticons, which can improve the richness, fun, and adaptability of the searched emoticons to the user's query, allowing users to view a wider variety of emoticons and improving the user experience of searching for and using emoticons.

[0087] Furthermore, the process of expanding emoticons by searching text to obtain expanded second emoticons can also include:

[0088] The search device can acquire universal emoticons, which are generic template images that blend seamlessly with any text. Multiple universal emoticons can be available, and some can be pre-configured. Therefore, the search device can combine the search text with these universal emoticons to generate an expanded second emoticon. Combining the search text with a universal emoticon generates a corresponding second emoticon. This combination of search text and universal emoticon can refer to adding the search text to the universal emoticon.

[0089] For example, when adding search text to a generic emoji, the specific style of the added search text (such as font, text size, text color, text outline, etc.) can be random or preset to default.

[0090] In one implementation, if the user clicks and uses the emoticon synthesized from the generic emoticon, then subsequently, when other users also recall the emoticon synthesized from the generic emoticon and also recall the emoticon synthesized from the emoticon generated by the Wensheng image model, the emoticon synthesized from the generic emoticon can be displayed in front of the emoticon synthesized from the emoticon generated by the Wensheng image model.

[0091] The aforementioned emoticon library can include two types: an emoticon template library and a standard emoticon library. The standard emoticon library can include multiple standard emoticons, which are directly usable and can have explicit text added to them. The emoticon template library can include multiple emoticon templates, which are not directly usable and do not have explicit text added. These templates can be combined with other text to generate standard emoticons. This application can search for the first emoticon from both the emoticon template library and the standard emoticon library using the same principle. That is, the first emoticon can include either an emoticon from the emoticon template library that matches the search text, or an emoticon from the standard emoticon library that matches the search text.

[0092] Therefore, the first emoticon may include an emoticon template image, which can be an emoticon image found in an emoticon template image library that matches the search text. The process of the search device returning the first emoticon image to the communication client can include: the search device performing a composite processing on the search text and the emoticon template image to generate a composite emoticon image, which is the emoticon image obtained by combining (e.g., adding) the search text into the emoticon template image. The search device can then return the composite emoticon image to the communication client.

[0093] The first emoticon image that matches the search text obtained from the standard emoticon image library can be directly returned to the communication client without being combined with the search text. This first emoticon image likely already contains the search text, or other text that is semantically similar to the search text.

[0094] In some practical applications, real-time search for emoticons is crucial. This real-time nature means that the searched emoticon is presented to the user immediately after the user performs the search (immediate presentation means within a very short time, e.g., within 0.1 seconds). However, generating the extended second emoticon using the text-based image model may involve a delay. Therefore, this application can also use the synthesis of the general emoticon and the search text as a fallback solution, with the synthesized emoticon serving as the extended second emoticon. The emoticon generated by the text-based image model (such as candidate emoticons selected from L candidate emoticons using the aforementioned sorting or relevance threshold) can be added to the emoticon template library for use by other users who input text identical or similar to the search text when searching for emoticons. Furthermore, when adding an emoji generated by the text-generated image model to the emoji template library, corresponding text tags can be added to the emoji. These text tags can include the intent tags of the emoji across N intent understanding dimensions. For example, a large language model (which may be different from the language rewriting model mentioned above) can be used to perform language understanding on the emoji description text from N intent understanding dimensions to generate the intent tags that need to be added to the emoji generated by the text-generated image model.

[0095] Please refer to Figure 4, which is a schematic diagram of a chat interface provided in an embodiment of this application. The chat interface shown in Figure 4 can be a chat interface between a user and a friend named "Xiaoming". The search text entered in this chat interface can be "crying", and the emoticon image that matches the search text and is found using the method provided in this application can be displayed in the bottom part of the chat interface.

[0096] The method presented in this application simplifies and expands the collection of emoji libraries: it fully utilizes existing emojis (such as emoji templates) and automatically retrieves corresponding emoji templates based on the semantics of the given input text (i.e., search text), which can be expressed through intent text. Furthermore, it synthesizes more emojis from the retrieved templates without requiring manual creation or intervention to generate a large number of emojis, significantly reducing the difficulty of emoji collection and maintenance. In addition, the method provided in this application offers strong interpretability and ease of control over the retrieved emojis: through the decoupling of multi-dimensional semantic understanding (i.e., intent recognition across multiple intent understanding dimensions), it facilitates the addition or removal of intent understanding dimensions according to actual needs. Emojis can be retrieved from multiple sources based on these intent understanding dimensions, allowing for easy control over the source and display order of the retrieved results. This provides high flexibility in managing the retrieval process and results of multiple emojis.

[0097] Using the method provided in this application, multi-dimensional intent recognition can be performed on the search text used to search for emoticons from multiple intent understanding dimensions. The dimensions of intent recognition are richer and more comprehensive, allowing the intent text obtained from intent recognition to be more granular and reliable. Furthermore, by configuring each emoticon in the emoticons with its own intent tags in these multiple intent understanding dimensions, the intent tags of each emoticon can also be interpreted from multiple dimensions, and the intent tags of each emoticon can have sufficiently high accuracy. In this way, by using the similarity between the intent text and the text tags (intent tags) of the emoticons with granular reliability, a multi-dimensional search for emoticons that match the search text can be achieved from these multiple intent understanding dimensions, thereby improving the accuracy of searching for emoticons that match the search text in the emoticon library.

[0098] Please refer to Figure 5, which is a schematic diagram of a process for searching and obtaining emoticons according to an embodiment of this application. As shown in Figure 5, the process may include:

[0099] S1: The search device can obtain the search text.

[0100] S2: The search device can parse the search text (this parsing process can be intent recognition) to obtain fine-grained semantics of the search text. This fine-grained semantics can be the N intent texts generated by intent recognition of the search text. The fine-grained semantics lies in recognizing the intent of the search text from N dimensions of intent understanding; the resulting intent texts can reflect the search intent of the search text from different dimensions, thus providing greater fine-grained meaning.

[0101] S3: The search device can perform emoji retrieval (i.e., emoji search) on emoji images one by one in the emoji image library (the emoji image library here can be the aforementioned emoji template image library) using this fine-grained semantics. In one embodiment, emoji images can be searched using a pre-set relevance threshold (also called a matching threshold). If the relevance between the retrieved emoji image and the search text (which can be the search matching degree in the embodiment corresponding to Figure 8 below) is greater than or equal to the relevance threshold, it indicates that the currently retrieved emoji image and the search text are matched, and step S4 can be executed; conversely, if the relevance between the retrieved emoji image and the search text is less than the relevance threshold, it indicates that the currently retrieved emoji image and the search text are not matched, and steps S6 and S8 can be executed. Alternatively, steps S6 and S8 can be executed when the number of emoji images in the emoji image library whose relevance to the search text is greater than or equal to the relevance threshold is less than or equal to a set number threshold.

[0102] S4: The search device can synthesize the search text with the currently retrieved emoticon template image to generate a synthesized emoticon image, which can be obtained by adding the search text to the emoticon template image.

[0103] S5: The search device can use the synthesized emoticon as a search result and return it to the front end (such as a communication client) for display so that users can view and select it.

[0104] S6: The search device can generate an image prompt from the search text. For example, the search device can perform language rewriting on the search text to generate the image prompt, which can be an expression description text corresponding to the search text.

[0105] S7: The search device can input the image generation prompt into the text-based image model to generate an AIGC emoticon template image. This AIGC emoticon template image can be an emoticon selected from the L candidate emoticons generated by the text-based image model, such as one of the P candidate emoticons, or a candidate emoticon whose image-text relevance to the image generation prompt is greater than or equal to a relevance threshold. This relevance threshold can be different from the relevance threshold in step S3. Since real-time emoticon searching is required, and the AIGC emoticon generation method may have a delay, steps S6 and S7 can be executed in the background. The AIGC emoticon template image generated in step S7 can be added to the emoticon library for subsequent emoticon searches.

[0106] S8: The search device can obtain a universal template image, which can be the aforementioned general emoticon image, and the general emoticon image may not contain explicit text.

[0107] S9: The search device can combine the search text with the universal template image to generate a composite emoticon. This composite emoticon can be obtained by adding the search text to the universal template image. The composite emoticon can also be returned to the front end (such as a communication client) as a search result for user viewing and selection.

[0108] Since the speed of combining the search text with the universal template image is extremely fast, and the delay is negligible, combining the search text with the universal template image to obtain a composite emoticon can be used as a fallback solution for online execution.

[0109] Please refer to Figure 6, which is a flowchart illustrating a method for training an intent recognition model according to an embodiment of this application. As shown in Figure 6, the method may include:

[0110] Step S201: Obtain the first sample text and the intent recognition model to be trained. The intent recognition model to be trained includes a text encoder to be trained and N text decoders to be trained. Each text decoder to be trained corresponds to an intent understanding dimension. The first sample text has corresponding reference intent texts in all N intent understanding dimensions.

[0111] Specifically, the search device can acquire the first sample text and the intent recognition model to be trained. Similar to the trained intent recognition model described above, the intent recognition model to be trained can include one text encoder to be trained and N text decoders to be trained. One text decoder to be trained can correspond to one intent understanding dimension; that is, one text decoder to be trained can be used to perform intent recognition on the input text at the corresponding intent understanding dimension.

[0112] In this context, the first sample text can have corresponding reference intent texts for each of the aforementioned N intent understanding dimensions. Specifically, the first sample text can have a corresponding reference intent text for each intent understanding dimension. This reference intent text is the intent text that the desired text decoder can generate from the first sample text. In other words, the reference intent text of the first sample text for one intent understanding dimension can be the intent text that the desired text decoder for that intent understanding dimension would generate from the first sample text. The reference intent text of the first sample text for the N intent understanding dimensions can be understood as the sample tags carried by the first sample text.

[0113] Step S202: Call the text encoder to be trained to perform feature encoding processing on the first sample text to generate sample encoding features of the first sample text.

[0114] Specifically, the search device can invoke the text encoder to be trained to perform feature encoding processing on the first sample text, generating encoded features of the first sample text, which can be referred to as sample encoded features. These sample encoded features can be the feature vector generated by the text encoder to be trained embedding the first sample text (also known as feature extraction processing).

[0115] Step S203: Call N text decoders to be trained to perform feature decoding processing on the sample encoding features in the corresponding intent understanding dimension, and generate N sample intent texts of the first sample text.

[0116] Specifically, the search device can call the aforementioned N text decoders to be trained to perform feature decoding processing on the sample encoding features of the first sample text in the corresponding intent understanding dimension, thereby generating N sample intent texts of the first sample text.

[0117] Specifically, by calling a text encoder to be trained to perform feature decoding on the sample encoding features of the first sample text in the corresponding intent understanding dimension, a sample intent text can be generated from the first sample text in that intent understanding dimension. That is, one sample intent text corresponds to one intent understanding dimension.

[0118] Step S204: Based on the difference between the sample intent text and the reference intent text in the intent understanding dimension of each text decoder to be trained, generate the feature decoding loss for each text decoder to be trained for the sample encoded features.

[0119] Specifically, the search device can generate a feature decoding loss (i.e., loss function) for each text decoder to be trained, based on the differences between the sample intent text and the reference intent text in the intent understanding dimension corresponding to each text decoder to be trained. One text decoder to be trained corresponds to one feature decoding loss. For example, this feature decoding loss can be the cross-entropy loss between the sample intent text and the reference intent text.

[0120] Specifically, the feature decoding loss of a text decoder under training is generated by analyzing the differences between the sample intent text and the reference intent text in the intent understanding dimension of each sample intent text. This feature decoding loss reflects the bias of the text decoder in processing the sample encoding features. A larger feature decoding loss indicates a greater bias in the text decoder's processing of the sample encoding features, and a greater difference between the sample intent text and the reference intent text in the intent understanding dimension. Conversely, a smaller feature decoding loss indicates a smaller bias in the text decoder's processing of the sample encoding features, and a smaller difference between the sample intent text and the reference intent text in the intent understanding dimension.

[0121] Step S205: Based on the feature decoding loss of each of the N text decoders to be trained, correct the model parameters of the intent recognition model to be trained, and obtain the trained intent recognition model.

[0122] Specifically, the search device can use the N feature decoding losses of the N text decoders to be trained to correct the model parameters of the intent recognition model to be trained, including correcting the model parameters of the text encoder and the N text decoders to be trained, so as to obtain the trained intent recognition model, that is, the trained intent recognition model.

[0123] Based on the aforementioned feature decoding loss, this application can further introduce a clustering loss for the text decoder to perform feature decoding on semantically similar or identical first sample texts. This clustering loss is used to train the intent recognition model to be trained and can be referred to as the first clustering loss. The first clustering loss reflects the differences (or biases) in the text decoder's feature decoding of semantically similar or identical first sample texts. A larger first clustering loss indicates a greater difference in the text decoder's feature decoding of semantically similar or identical first sample texts; a smaller first clustering loss indicates a smaller difference. By introducing this first clustering loss, this application can make the text decoder more consistent in its feature decoding of semantically similar or identical first sample texts, thereby improving the accuracy of the text decoder's feature decoding. The specific process of generating this first clustering loss is described below.

[0124] There can be multiple first sample texts, and these multiple first sample texts can have the same reference intent text across N intent understanding dimensions. First sample texts that have the same reference intent text across N intent understanding dimensions can be considered semantically similar or identical first sample texts. That is, the reference intent texts of each of these multiple first sample texts can be the same across the same intent understanding dimension. Any one of the N text decoders to be trained can be called the target text decoder. Since the principle for generating the first clustering loss of each text decoder to be trained is the same, the following explanation will use the principle for generating the first clustering loss of the target text decoder as an example.

[0125] The target text decoder can sequentially contain multiple network layers. These layers can be referred to as first network layers. The input to each subsequent first network layer can be the output of the previous one. During the feature decoding process of the target text decoder on the sample encoded features of the first sample text, each of the multiple first network layers except the last one (which can be called the last first network layer) can generate a vector (i.e., an intermediate vector, which can be called the decoded feature) used for feature decoding of the sample encoded features of the first sample text. The last first network layer can decode the sample intent text of the first sample text from the vector generated by the second-to-last first network layer. In other words, the last first network layer ultimately generates the sample intent text, not a vector.

[0126] Therefore, during the process of feature encoding of the sample encoding features of each first sample text by the target text decoder, the search device can obtain the decoding features generated by each first network layer (excluding the last first network layer) for each first sample text. One first network layer can generate one decoding feature for one first sample text.

[0127] The search device can generate a first clustering loss for the target text decoder based on the decoding features of multiple semantically similar or identical first sample texts. This first clustering loss can be used to reflect the differences between the decoding features generated by the same first network layer for the multiple first sample texts. This application generates the first clustering loss of the target text decoder by using the decoding features generated by the multiple first network layers within the target text decoder for the first sample texts. This ensures that the feature decoding process performed by each first network layer in the target text decoder for semantically identical or similar first sample texts is consistent and uniform. This further improves the accuracy of training the intent recognition model and enhances the uniformity and consistency of the intent recognition model's processing of semantically similar or identical texts. The formula principle of this first clustering loss can be the same as that of the second clustering loss described below; however, when obtaining the first clustering loss, it is not necessary to use the generation result of the last first network layer.

[0128] The search device can correct the model parameters of the intent recognition model to be trained using the first clustering loss and feature decoding loss of each of the N text decoders to be trained. For example, the search device can sum the N first clustering losses and N feature decoding losses of the N text decoders to obtain the overall loss of the intent recognition model to be trained, and use this overall loss to correct the model parameters of the intent recognition model to obtain the trained intent recognition model. The goal of correcting the model parameters of the intent recognition model through this overall loss is to minimize the overall loss (e.g., to zero).

[0129] The aforementioned multiple first sample texts can be a batch of first sample texts used for one round of training of the intent recognition model to be trained. This application can perform multiple rounds of iterative training on the intent recognition model to be trained using multiple batches of first sample texts, following the principles described above. Specifically, to obtain the aforementioned first clustering loss, the first sample texts used in the same batch for training the intent recognition model to be trained can be semantically similar or identical; that is, the reference intent texts for each of the first sample texts in the same batch can be the same across the N intent understanding dimensions. However, the semantics of the first sample texts in different batches can be different; that is, the reference intent texts for each of the first sample texts in different batches can be different across the N intent understanding dimensions.

[0130] For example, when the model parameters of the intent recognition model to be trained are trained to a convergent state, or when the number of iterations of the intent recognition model to be trained is equal to the specified threshold, the intent recognition model to be trained can be considered to have been trained. The intent recognition model trained at this time can be regarded as the trained intent recognition model.

[0131] Through the above process, this application enables end-to-end training of intent recognition models for multiple generation tasks (i.e., multiple intent recognition tasks). Each text decoder can learn an understanding level (such as an intent understanding dimension) of the user query, and these various intent understanding dimensions are decoupled from each other. Therefore, the intent recognition model proposed in this application is a computationally efficient, highly interpretable, and pluggable / scalable model structure. For example, it allows for the flexible removal of text decoders corresponding to certain subsequently unnecessary intent understanding dimensions, or the addition of text decoders corresponding to more intent understanding dimensions.

[0132] Please refer to Figure 7, which is a schematic diagram of the structure of an intent recognition model provided in an embodiment of this application. As shown in Figure 7, the intent recognition model may include one text encoder and N text decoders, where the N text decoders may include text decoder 1 to text decoder N. Each text decoder may correspond to one intent understanding dimension, and the aforementioned N intent understanding dimensions may include intent understanding dimension 1 to intent understanding dimension N. For example, text decoder 1 may correspond to intent understanding dimension 1, text decoder 2 may correspond to intent understanding dimension 2, ..., text decoder N may correspond to intent understanding dimension N. Each text decoder can perform intent recognition on the search text at its corresponding intent understanding dimension to generate intent text corresponding to the intent understanding dimension of the search text.

[0133] The text encoder and each text decoder can be composed of multiple model units, and each model unit can be a Transformer block (the basic building block of the model). The input of each text decoder can be the output of the text encoder.

[0134] By employing the process described above in this application, the trained intent recognition model can be accurately trained. This trained intent recognition model can decouple the input text from N intent understanding dimensions, thereby identifying the accurate intent text of the input text in those N intent understanding dimensions.

[0135] Please refer to Figure 8, which is a flowchart illustrating a method for searching a first emoticon in an emoticon library according to an embodiment of this application. As shown in Figure 8, the method may include:

[0136] Step S301: Obtain the search matching degree between the search text and each emoji in the emoji library by comparing the similarity between the search text and the text tags of each emoji in the emoji library with the text and N intent texts respectively.

[0137] Specifically, the search device can also use the original search text as text for searching for emoticons. The search device can obtain the search matching degree between the search text and each emoticon in the emoticon library by comparing the similarity between the search text and its N intent texts with the text tags of each emoticon in the emoticon library. The search text can have a search matching degree with an emoticon in the emoticon library.

[0138] In this context, any emoticon in the emoticon library can be referred to as the target emoticon. Since the principle of obtaining the search matching degree between the search text and each emoticon in the emoticon library is the same, this application will take the process of obtaining the search matching degree between the search text and the target emoticon as an example for specific explanation, as described below.

[0139] The search device can obtain a trained feature embedding model, which can be a pre-trained model capable of embedding input text into its corresponding representation features. These representation features can be feature vectors generated from the input text. The specific process for training this feature embedding model is described below.

[0140] Therefore, the search device can invoke the trained feature embedding model to perform feature embedding processing on each text label of the search text, N intent texts, and the target emoticon image, respectively, to generate representation features of the search text, representation features of each intent text, and representation features of each text label of the target emoticon image (including the general label and intent label of the target emoticon image). Each text label of the target emoticon image can correspond to one representation feature; alternatively, for the efficiency of real-time emoticon image search, the representation features of each text label of the target emoticon image can be pre-generated using the trained feature embedding model.

[0141] The search device can obtain M feature similarities between the representation features of the search text and the representation features of N intent texts and the representation features of the text label of the target emoticon, where M is a positive integer. The representation features of the search text and one of its N intent texts can have a feature similarity with the representation features of one text label of the target emoticon. For example, the feature similarity between two representation features can be the cosine similarity between those two representation features. The feature similarity between the representation features of the texts can be used to reflect the similarity between texts; for example, the feature similarity between the representation features of the texts can be directly used as the text similarity between the texts.

[0142] The search device can use the maximum value among the M feature similarities (i.e., the highest feature similarity) as the search match between the search text and the target emoticon. The process of obtaining these M feature similarities is described in detail below.

[0143] The target emoticon can have (i.e., be set with) K+N text labels. These K+N text labels can include K general labels and N intent labels of the target emoticon. That is, the target emoticon can have K general labels, where K is a positive integer.

[0144] The search device can calculate the feature similarity between the representation features of the search text and the representation features of the K+N text tags, resulting in K+N feature similarities. There can also be one feature similarity between the representation features of the search text and the representation features of a text tag of the target emoticon. Furthermore, the search device can calculate the feature similarity between the representation features of the N intent texts and the representation features of the K general tags of the target emoticon, resulting in N×K feature similarities. There can also be one feature similarity between the representation features of an intent text and the representation features of a general tag of the target emoticon. Additionally, the search device can calculate the feature similarity between the representation features of the N intent texts and the representation features of the N intent tags of the target emoticon, resulting in N feature similarities. There can be one feature similarity between the representation features of any intent text and the representation features of an intent tag of the target emoticon on the intent understanding dimension corresponding to that intent text. In other words, when calculating the feature similarity between the representation features of intent texts and the representation features of intent tags, it is necessary to calculate the feature similarity between intent texts and intent tags corresponding to the same intent understanding dimension.

[0145] The search device can take the K+N feature similarities, N×K feature similarities, and N feature similarities obtained above as the above M feature similarities, that is, M can be equal to (K+N)+N×K+N.

[0146] The search device can obtain the search matching degree between the search text and each emoji in the emoji library, following the same principle described above.

[0147] Please refer to Figure 9, which is a schematic diagram illustrating the principle of obtaining the search matching degree between search text and target emoticon according to an embodiment of this application. As shown in Figure 9, N can be equal to 3, and K can be equal to 4. The N intent texts of the search text may include intent text 1, intent text 2, and intent text 3. The text tags of the target emoticon may include general tag 1, general tag 2, general tag 3, general tag 4, intent tag 1, intent tag 2, and intent tag 3.

[0148] The aforementioned N dimensions of intent understanding can include intent understanding dimension 1, intent understanding dimension 2, and intent understanding dimension 3. Intent text 1 and intent label 1 can both correspond to intent understanding dimension 1, intent text 2 and intent label 2 can both correspond to intent understanding dimension 2, and intent text 3 and intent label 3 can both correspond to intent understanding dimension 3.

[0149] Therefore, the search device can calculate the feature similarity between the representation features of the search text and the representation features of each text tag of the target emoticon, calculate the feature similarity between the representation features of intent text 1 and the representation features of each general tag of the target emoticon, calculate the feature similarity between the representation features of intent text 2 and the representation features of each general tag of the target emoticon, calculate the feature similarity between the representation features of intent text 3 and the representation features of each general tag of the target emoticon, calculate the feature similarity between the representation features of intent text 1 and the representation features of intent tag 1, calculate the feature similarity between the representation features of intent text 2 and the representation features of intent tag 2, and calculate the feature similarity between the representation features of intent text 3 and the representation features of intent tag 3, thereby obtaining the above M feature similarities. Therefore, the maximum feature similarity among these M feature similarities can be used as the search matching degree between the search text and the target emoticon.

[0150] For example, the specific process of training the above-mentioned trained feature embedding model in this application may include: the search device can obtain a sample pair and a feature embedding model to be trained. The sample pair may include two second sample texts. The sample pair may have a semantic matching label (belonging to the sample label). The semantic matching label can be used to indicate whether the text semantics between the two second sample texts in the sample pair match or do not match. That is, the semantic matching label is used to indicate whether the two second sample texts in the sample pair match. Whether they match or not may refer to whether the semantics of the two second sample texts match (such as the semantics being the same or similar).

[0151] In other words, if the semantic matching tag indicates that the text semantics between the two second sample texts in the sample pair match, it means that the text semantics between the two second sample texts are similar or the same; if the semantic matching tag indicates that the text semantics between the two second sample texts in the sample pair do not match, it means that the text semantics between the two second sample texts are dissimilar or different.

[0152] The search device can call the feature embedding model to be trained to perform feature embedding processing on each second sample text in the sample pair to generate representation features for each second sample text in the sample pair. A second sample text can have one representation feature.

[0153] The representation features of the second sample text can be the feature vector generated from the second sample text.

[0154] The search device can generate a feature embedding model to be trained based on the representation features and semantic matching labels of each second sample text in the sample pair. This feature embedding loss reflects the difference between the matching degree between the representation features of the two second sample texts in the sample pair (such as the similarity between representation features) and the matching degree actually indicated by the semantic matching labels of the sample pair (such as the similarity between the two second sample texts). The larger the feature embedding loss, the larger the difference between the two matching degrees; conversely, the smaller the feature embedding loss, the smaller the difference between the two matching degrees.

[0155] Specifically, if the semantic matching label of a sample pair indicates that the textual semantics of the two second sample texts in the sample pair match, it means that the two second sample texts in the sample pair are extremely similar. In this case, we expect the representation features generated by the feature embedding model to be trained for the two second sample texts to also be extremely similar. Conversely, if the semantic matching label of a sample pair indicates that the textual semantics of the two second sample texts in the sample pair do not match, it means that the two second sample texts in the sample pair are extremely dissimilar. In this case, we expect the representation features generated by the feature embedding model to be trained for the two second sample texts to also be extremely dissimilar.

[0156] Therefore, the aforementioned feature embedding loss can also be called similarity loss. This similarity loss can be used to reflect the deviation between the difference between the representation features generated by the feature embedding model to be trained on the two second sample texts in the sample pair and our actual ideal difference. For example, this feature embedding loss can be the cross-entropy loss or cosine similarity loss generated by the representation features of the two second sample texts in the sample pair and the semantic matching labels of the sample pair, etc.

[0157] This application can correct the model parameters of the feature embedding model to be trained by using feature embedding loss to obtain the trained feature embedding model as described below.

[0158] In addition to the feature embedding loss mentioned above, this application can also introduce a clustering loss for the feature embedding model to embed features of semantically similar or identical second sample texts. This clustering loss, referred to as the second clustering loss, is used to reflect the differences (or biases) in the feature embedding model's feature embedding of semantically similar or identical second sample texts. A larger second clustering loss indicates a greater difference in feature embedding between the two types of texts, while a smaller loss indicates a smaller difference. By introducing this second clustering loss, this application makes the feature embedding model more consistent in embedding features of semantically similar or identical second sample texts and better able to distinguish between semantically different texts, thereby improving the accuracy of feature embedding. The specific process of generating this second clustering loss is described below.

[0159] There can be multiple sample pairs, which may include multiple second sample texts with similar semantics. That is, multiple second sample texts with similar semantics (i.e., similar meanings expressed by the texts) may originate from these multiple sample pairs. The feature embedding model to be trained may sequentially include multiple network layers. These network layers can be referred to as second network layers. The input of a subsequent second network layer can be the output of a previous second network layer. During the feature embedding process of the second sample text by the feature embedding model, each of these multiple second network layers can generate embedding features for the second sample text. The embedding features generated by the second network layers other than the last one can be intermediate features (i.e., features generated during intermediate processes). The embedding feature generated by the last second network layer is the representation feature of the second sample text.

[0160] Therefore, during the feature embedding process of the feature embedding model to be trained on multiple second sample texts with similar text semantics, the search device can obtain the embedding features generated by the multiple second network layers for each of the multiple second sample texts. One second network layer can generate one embedding feature for one second sample text, and the embedding feature can be a feature vector.

[0161] The search device can generate a second clustering loss for the feature embedding model to be trained on the multiple second sample texts by using the embedding features of these multiple second sample texts. This second clustering loss can be used to reflect the differences between the embedding features generated by the same second network layer on the multiple second sample texts. This application generates the second clustering loss of the feature embedding model by using the embedding features generated by the multiple second network layers in the feature embedding model on the second sample texts. This ensures that the feature embedding process performed by each second network layer in the feature embedding model on semantically similar or identical second sample texts tends to be consistent and uniform. This further improves the accuracy of training the feature embedding model and enhances the uniformity and consistency of the feature embedding model in processing semantically similar or identical texts. As shown in the following formula, the second clustering loss can be the KL loss (KL Divergence Loss, a method to measure the difference between two probability distributions, where the probability distribution can refer to the distribution formed by the elements embedded in the features), and this second clustering loss can be expressed as Loss. cluster The second clustering loss is Loss cluster The determination method can be shown in formula (1):

[0162] Wherein, B is shown in formula (1) batch D represents the number of semantically similar second sample texts within the current training batch. dim This represents the number of multiple second network layers in the feature embedding model to be trained. Since the last second network layer may have softmax (an activation function), while the second network layers before it may not have softmax, the last second network layer and the second network layers before it are represented separately in the above formula.

[0163] The multiple second sample texts can be ordered according to the order in which they are input into the feature embedding model to be trained, where i represents the i-th second sample text and j represents the j-th second network layer. i can be greater than or equal to 1 and less than or equal to B. batch Similarly, j can be greater than or equal to 1 and less than or equal to D. dim Therefore, (logits) i ) jThis represents the embedded features generated by the j-th second network layer for the i-th second sample text, (logits1). j Let represent the embedding features generated by the j-th second network layer for the 1-th second sample text, and logits1 be the second sample text that was first input into the feature embedding model to be trained among the multiple second sample texts. Similarly, This means that the last second network layer generates representation features for the i-th second sample text. This represents the embedding features generated by the last second network layer for the i-th second sample text. This represents the embedding features generated by the last second network layer for the first second sample text. This application can use the embedding features of the first second sample text in the current training batch as a benchmark to evaluate the differences between the embedding features of second sample texts with similar text semantics. That is, it can train the embedding features of multiple second sample texts with similar text semantics to be similar to the embedding features of the first second sample text.

[0164] For the first clustering loss mentioned above, the part of the formula containing the last second network layer (i.e., the part containing the softmax function) can be omitted, which is the part of the formula after the plus sign.

[0165] This application can use the aforementioned second clustering loss and feature embedding loss together to correct the model parameters of the feature embedding model to be trained, thereby obtaining the trained feature embedding model. For example, the search device can sum the second clustering loss and the feature embedding loss to obtain the overall loss of the feature embedding model to be trained, and can use this overall loss to correct the model parameters of the feature embedding model to be trained, thus obtaining the trained feature embedding model. The goal of correcting the model parameters of the feature embedding model to be trained using this overall loss can be to correct the model parameters so that the overall loss tends to a minimum value (e.g., tends to 0).

[0166] In one embodiment, this application can also generate sample pairs (referred to as antonym pairs) where the textual semantics of the two included second sample texts are opposite through antonym substitution. That is, the sample pairs can include antonym pairs; of course, the sample pairs can also include sample pairs where the textual semantics of the two included second sample texts are similar. For example, the process of obtaining the antonym pair may include:

[0167] The search device can acquire the original sample text and perform key information detection (such as keyword detection) on it to obtain G key information pieces (such as G keywords) in the original sample text, where G is a positive integer. The specific value of G can be determined based on the number of key information pieces detected in the original sample text. For example, the search device can use a trained key information detection model to perform key information detection on the original sample text to detect G key information pieces. This key information detection model can be any model capable of detecting key information with antonyms (such as antonyms) in the text.

[0168] The search device can perform G antonym substitutions on the G key information pieces in the original sample text to generate G antonym-replaced texts. Each antonym substitution is performed on one key information piece in the original sample text to obtain one antonym-replaced text. Different antonym substitutions can be performed on different key information pieces in the original sample text. Replacing key information with antonyms can mean replacing the key information with its antonym. For example, if the key information is a keyword, replacing it with its antonym can mean replacing it with its antonym. Alternatively, the antonym substitution process can also replace the key information with other words of the same word type but with completely different semantics.

[0169] For example, you can replace "you" with "I", "you" with "he", "I" with "he", "is" with "is not", "happy" with "sad", "no" with "null" (i.e., delete the word "no"), and so on. For instance, the original sample text could be "You haven't talked to me for a long time," and the antonyms could include "He hasn't talked to me for a long time", "You haven't talked to him for a long time", "You've talked to me for a long time", etc.

[0170] The search device can perform pairwise combination processing between the original sample text and G antonymous replacement texts to obtain at least one antonymous sample pair. For example, an antonymous sample pair can be composed of the original sample text and one antonymous replacement text, or an antonymous sample pair can be composed of two antonymous replacement texts.

[0171] There can be multiple original sample texts. The search device can perform antonym replacement on the key information in each original sample text according to the above principle to construct a large number of antonym sample pairs.

[0172] In this application, by constructing the above-mentioned antonymous sample pairs and training the feature embedding model to be trained using the antonymous sample pairs, the ability of the feature embedding model to be trained to distinguish texts with different (or even opposite) text semantics can be improved, thereby improving the accuracy of the feature embedding model to be trained in performing feature embedding processing on the input text.

[0173] Furthermore, the feature embedding model to be trained can undergo multiple rounds of iterative training. Therefore, after any iteration of training, inaccurate antonym pairs (i.e., poorly generated antonym pairs) can be selected from the multiple antonym pairs. In the next iteration, these selected antonym pairs can be used for focused training, allowing the feature embedding model to perform self-checks and improve its learning of poorly generated antonym pairs. For example, the inaccurate antonym pairs could include antonym pairs generated from two second sample texts where the two representation features are highly similar. For instance, "highly similar" could mean that the feature similarity (e.g., cosine similarity) between the two representation features is greater than or equal to a set similarity threshold.

[0174] Please refer to Figure 10, which is a schematic diagram illustrating the principle of constructing antonym sample pairs according to an embodiment of this application. As shown in Figure 10, G can be equal to 3 here. The search device performs antonym replacement on the key information in the original sample text, resulting in three antonym replacement texts, including antonym replacement text 1 to antonym replacement text 3. The search device can combine the original sample text and the three antonym replacement texts in pairs to construct multiple antonym sample pairs. Here, six antonym sample pairs are constructed, from antonym sample pair 1 to antonym sample pair 6.

[0175] Here, an antonym pair 1 can be constructed by combining the original sample text with the antonym replacement text 1; antonym pair 2 can be constructed by combining the original sample text with the antonym replacement text 2; antonym pair 3 can be constructed by combining the original sample text with the antonym replacement text 3; antonym pair 4 can be constructed by combining the antonym replacement text 1 with the antonym replacement text 2; antonym pair 5 can be constructed by combining the antonym replacement text 1 with the antonym replacement text 3; and antonym pair 6 can be constructed by combining the antonym replacement text 2 with the antonym replacement text 3.

[0176] The aforementioned multiple sample pairs can be a batch of sample pairs used for one round of training of the feature embedding model to be trained. This application can perform multiple rounds of iterative training on the feature embedding model to be trained using multiple batches of samples, following the principles described above. Specifically, to better obtain the aforementioned second clustering loss, the multiple sample pairs used in the same batch for training the feature embedding model to be trained in this application can include a large number (e.g., greater than or equal to a threshold number) of second sample texts with similar textual semantics. This application can identify which second sample texts in a batch of sample pairs used for one round of training the feature embedding model to be trained are semantically similar.

[0177] For example, when the model parameters of the feature embedding model to be trained are trained to a convergent state, or when the number of iterations of the feature embedding model to be trained is equal to the specified threshold, the training of the feature embedding model to be trained can be considered complete, and the feature embedding model trained at this time can be regarded as the above-mentioned trained feature embedding model.

[0178] Through the above process of this application, the training of the feature embedding model to be trained is achieved with excellent results. The trained feature embedding model can accurately distinguish texts with different textual semantics, and can also ensure uniform embedding processing of texts with similar textual semantics. Therefore, the trained feature embedding model can accurately generate the representation features of the input text.

[0179] Step S302: Based on the search matching degree between the search text and each emoticon in the emoticon library, select the first emoticon from the emoticon library.

[0180] Specifically, the search device can filter out the first emoji from the emoji library by matching the search text with each emoji in the emoji library, as described below.

[0181] In one implementation, the search device can sort the emoticons in the emoticon library according to the search match degree between the search text and each emoticon in the library, from highest to lowest, to obtain sorted emoticons. In the sorted emoticons, emoticons with a higher search match degree with the search text are placed earlier, and emoticons with a lower search match degree with the search text are placed later.

[0182] The search device can select the top Q emoticons in the sorted emoticon library as the first emoticon to be filtered out. Q is a positive integer and is less than the total number of emoticons in the emoticon library. The specific value of Q can be set according to the actual application scenario.

[0183] If there are multiple (more than one) emoji libraries, the search device can select the first emoji from each emoji library according to the same principle described above.

[0184] By employing the method described above in this application, the first emoticon is comprehensively searched from multiple levels (such as the level of the search text itself and the level of the intent text of the search text) by the similarity between the search text and its intent text and the text tag of the emoticon, so that the searched first emoticon can be richer and better meet the user's search needs for emoticons.

[0185] The method provided in this application can significantly improve the accuracy of recommending emoticons: By performing multi-dimensional intent understanding of user queries and using a text semantic emoticon retrieval algorithm, this application can accurately retrieve emoticon template images corresponding to the emotions and intents of short texts (i.e., search text) that users input in a colloquial and everyday manner. Furthermore, the expressiveness of emoticons can be further enhanced through the synthesis of text and emoticons, thereby returning emoticons that are extremely close to the user's needs.

[0186] Please refer to Figure 11, which is a schematic diagram of the framework of a data processing system provided in an embodiment of this application. As shown in Figure 11, the data processing system can generally include a peripheral operation component, an online component, and an offline component. The peripheral operation component includes a manual intervention module, an information tracking module, a whiteboard system module, and a log reporting module. The manual intervention module supports real-time incremental processing (such as adding and deleting) of emoticons. For example, when non-compliant or low-quality emoticons exist, they can be manually deleted from the emoticon library. The information tracking module can debug the system based on user feedback. The whiteboard system module can provide statistical information for operators to view and refer to, such as statistics on user emoticon usage (e.g., the number of times emoticons are used and feedback). The log reporting module can be used to report user operation data, such as user exposure and click data for emoticons.

[0187] The aforementioned online component supports the real-time retrieval and synthesis of emoticons based on search text (which can be denoted as Query). This online component can include modules for business logic, scoring logic, vector recall engines, other recall engines, and online feature storage. The business logic modules can include logic for "Query content understanding" (e.g., intent recognition), "recall & sorting distribution" (e.g., searching for emoticons and sorting and distributing them), "emoticon synthesis processing" (e.g., processing the synthesis between text and emoticon templates), "uploading results to CDN" (e.g., uploading the searched emoticons to the CDN for returning them to the front end), and "packet return" (e.g., packaging the searched emoticons and returning them to the front end).

[0188] The scoring logic module can include "multi-path recall" (such as recalling emoticons through intent text, text-generated images, or emoticon synthesis), "feature completion" (such as collecting some features of newly added emoticons (such as usage popularity), and "ranking and scoring" (such as ranking and scoring the searched emoticons).

[0189] The aforementioned vector retrieval engine modules may include "text vector retrieval" (such as retrieval of representation features generated from text) and "image vector retrieval" (such as retrieval of representation features generated from text labels of emoticons). The other retrieval engine modules mentioned above may be reserved for future additions of necessary processing engines. The aforementioned online feature storage module can be used to store "raw content" (such as original emoticons; emoticons in the emoticon library are usually obtained by processing original emoticons (such as size or format regularization)) and "mined features" (such as the popularity of emoticon usage).

[0190] The aforementioned offline component supports capabilities such as the creation, integration, preprocessing, and indexing of emoji template libraries. This offline component can include modules for data integration (providing a unified data entry point), feature calculation, index building, and data storage. The data integration module can include "original emoji content integration" (e.g., integrating original emoji images) and "asynchronous feature integration" (e.g., text representation features). The feature calculation module can include "emoji vector calculation" (e.g., calculating the representation features of text labels for emoji images) and "emoji popularity statistics." For example, when sorting searched emoji images, not only the search matching degree between the emoji image and the search text can be considered, but also the usage popularity of the emoji image. These two factors can be weighted and summed to obtain the final ranking score for the emoji images.

[0191] The index building module may include "vector format index building" (such as building an index from the text labels of an emoticon to the representation features of those text labels) and "text format index building" (such as building an index from an emoticon to its text labels, or building an index from search text to its intent text, etc.). The data storage module may include "permanent storage of original content / feature vectors" (such as permanently storing the original emoticon and its text label representation features for emoticons that have already been added to the database) and "temporary storage of original content / feature vectors" (such as temporarily storing the original emoticon and its text label representation features for emoticons that are still under review and have not yet been added to the database).

[0192] This application enables efficient searching and processing of emoticons through the collaborative work of the various modules mentioned above.

[0193] Please refer to Figure 12, which is a schematic diagram of the structure of a data search device provided in an embodiment of this application. As shown in Figure 12, the data search device 120 may include: a first acquisition module 1201, a generation module 1202, a second acquisition module 1203, and a search module 1204.

[0194] The first acquisition module 1201 is used to acquire the search text and N intent understanding dimensions, where N is a positive integer;

[0195] The generation module 1202 is used to perform intent recognition on the search text according to each intent understanding dimension, and generate intent text of the search text in each intent understanding dimension.

[0196] The second acquisition module 1203 is used to acquire the text label of each emoticon in the emoticon library. The text label of any emoticon includes the intent label of any emoticon in N intent understanding dimensions.

[0197] Search module 1204 is used to search for a first matching emoticon in the emoticon library based on the similarity between N intent texts and the text tags of emoticons in the emoticon library.

[0198] In one implementation, the N intent understanding dimensions include intent understanding dimension i;

[0199] The generation module 1202 performs intent recognition on the search text according to each intent understanding dimension, and generates intent text for the search text in each intent understanding dimension in the following ways:

[0200] Obtain the trained intent recognition model, which includes a text encoder and N text decoders, with each text decoder corresponding to an intent understanding dimension.

[0201] The text encoder is invoked to perform feature encoding on the search text, generating the encoded features of the search text;

[0202] The text decoder corresponding to the intent understanding dimension i is invoked to perform feature decoding processing on the encoded features on the intent understanding dimension i, generating the intent text of the search text on the intent understanding dimension i.

[0203] In one embodiment, the data search device 120 further includes a training module 1205, which is used for:

[0204] Obtain the first sample text and the intent recognition model to be trained. The intent recognition model to be trained includes a text encoder to be trained and N text decoders to be trained. Each text decoder to be trained corresponds to an intent understanding dimension. The first sample text has corresponding reference intent texts in all N intent understanding dimensions.

[0205] The text encoder to be trained is invoked to perform feature encoding processing on the first sample text, generating the sample encoding features of the first sample text.

[0206] Call N text decoders to be trained to perform feature decoding processing on the sample encoded features in the corresponding intent understanding dimension, and generate N sample intent texts of the first sample text;

[0207] Based on the difference between the sample intent text and the reference intent text in the intent understanding dimension of each text decoder to be trained, a feature decoding loss is generated for each text decoder to be trained, targeting the encoded features of the sample.

[0208] The model parameters of the intent recognition model are corrected based on the feature decoding loss of each of the N text decoders to be trained, and the trained intent recognition model is obtained.

[0209] In one implementation, there are multiple first sample texts, and these multiple first sample texts have the same reference intent text across N intent understanding dimensions. Any N text decoders to be trained include a target text decoder, which is any one of the N text decoders to be trained. The target text decoder contains multiple first network layers. The training module 1205 corrects the model parameters of the intent recognition model to be trained based on the feature decoding loss of each of the N text decoders to be trained, obtaining the trained intent recognition model in the following manner:

[0210] During the process of the target text decoder performing feature decoding on the sample encoding features of each first sample text, the decoding features generated by each first network layer (excluding the last first network layer) for each first sample text are obtained.

[0211] The target text decoder generates a first clustering loss for multiple first sample texts based on the decoding features of multiple first sample texts. The first clustering loss is used to reflect the differences between the decoding features generated by the same first network layer for multiple first sample texts.

[0212] By using the first clustering loss and feature decoding loss of each of the N text decoders to be trained, the model parameters of the intent recognition model to be trained are corrected, and the trained intent recognition model is obtained.

[0213] In one implementation, the search module 1204 searches for a first matching emoticon in the emoticon library based on the similarity between N intent texts and the text tags of emoticons in the emoticon library, including:

[0214] The search matching degree between the search text and each emoji in the emoji library is obtained by comparing the similarity between the search text and the text tags of each of the N intent texts with the text tags of each emoji in the emoji library.

[0215] Based on the search match between the search text and each emoji in the emoji library, the first emoji is selected from the emoji library.

[0216] In one implementation, the emoji library includes target emojis, which are any emojis in the emoji library; the search module 1204 obtains the search matching degree between the search text and each emoji in the emoji library by measuring the similarity between the search text and the text tags of N search texts with each emoji in the emoji library, including:

[0217] The trained feature embedding model is invoked to perform feature embedding processing on each text label of the search text, N intent texts, and target expression image, generating representation features of the search text, representation features of each intent text, and representation features of each text label of the target expression image.

[0218] Obtain the representation features of the search text and the representation features of N intent texts and the representation features of the text labels of the target emoticon image, and obtain the M feature similarities between them. The feature similarities between the representation features of the texts are used to reflect the similarity between the texts, and M is a positive integer.

[0219] The maximum feature similarity among the M feature similarities is taken as the search matching degree between the search text and the target emoticon.

[0220] In one implementation, the text label of any emoticon includes a general label for that emoticon, and the target emoticon has K+N text labels, which include K general labels and N intent labels of the target emoticon, where K is a positive integer;

[0221] The search module 1204 obtains the similarity of M features between the representation features of the search text and the representation features of N intent texts and the representation features of the text labels of the target emoticon image, including:

[0222] Calculate the K+N feature similarities between the representation features of the search text and the representation features of K+N text labels, and calculate the feature similarity between the representation features of the search text and the representation features of a text label of the target emoticon.

[0223] Calculate N×K feature similarities between the representation features of N intent texts and the representation features of K general labels. There is one feature similarity between the representation features of an intent text and the representation features of a general label of a target emoticon.

[0224] Calculate the N feature similarities between the representation features of N intent texts and the representation features of N intent labels. The representation features of any intent text have a feature similarity with the representation features of an intent label of the target facial image in the intent understanding dimension corresponding to any intent text.

[0225] The K+N feature similarities, N×K feature similarities, and N feature similarities are determined to be M feature similarities.

[0226] In one embodiment, the training module 1205 is further configured to:

[0227] Obtain sample pairs and feature embedding models to be trained. Each sample pair includes two second sample texts and has a semantic matching label. The semantic matching label indicates whether the text semantics between the two second sample texts in the sample pair match or do not match.

[0228] The feature embedding model to be trained is invoked to perform feature embedding processing on each second sample text in the sample pair, generating representation features for each second sample text in the sample pair;

[0229] Based on the representation features and semantic matching labels of each second sample text in the sample pair, the feature embedding loss of the feature embedding model to be trained is generated.

[0230] The model parameters of the feature embedding model to be trained are corrected based on the feature embedding loss, and the trained feature embedding model is obtained.

[0231] In one implementation, there are multiple sample pairs, including multiple second sample texts with similar semantics. The feature embedding model to be trained includes multiple second network layers. The training module 1205 corrects the model parameters of the feature embedding model to be trained based on the feature embedding loss to obtain the trained feature embedding model in the following ways:

[0232] During the process of feature embedding processing of the second sample text in multiple sample pairs by the feature embedding model to be trained, the embedding features generated by multiple second network layers for each second sample text in multiple second sample texts are obtained.

[0233] The feature embedding model to be trained is generated based on the embedding features of multiple second sample texts. The second clustering loss is used to reflect the differences between the embedding features generated by the same second network layer for multiple second sample texts.

[0234] The model parameters of the feature embedding model to be trained are corrected based on the second clustering loss and the feature embedding loss, and the trained feature embedding model is obtained.

[0235] In one embodiment, the training module 1205 is further configured to:

[0236] Obtain the original sample text and perform key information detection on the original sample text to obtain G key information in the original sample text, where G is a positive integer;

[0237] G key pieces of information in the original sample text are subjected to G negation replacements to generate G negation replacement texts of the original sample text. One negation replacement is used to negate one key piece of information in the original sample text to obtain one negation replacement text.

[0238] The original sample text and G antonymous replacement texts are combined in pairs to obtain at least one sample pair.

[0239] In one implementation, the search module 1204 selects a first emoticon from the emoticon library based on the search matching degree between the search text and each emoticon in the emoticon library, including:

[0240] The emojis in the emoji library are sorted in descending order of the search match between the search text and each emoji in the emoji library to obtain the sorted emojis.

[0241] The first Q emoticons in the sorted emoticon image library are selected as the first emoticon, where Q is a positive integer and less than the total number of emoticons in the emoticon image library.

[0242] In one implementation, the search text is sent by the communication client; the search module 1204 is also used for:

[0243] The search text is used to expand the emoticons, resulting in an expanded second emoticon image.

[0244] The first and second emoticons are returned to the communication client.

[0245] In one implementation, the search module 1204 performs emoji expansion processing based on the search text to obtain an expanded second emoji image, including:

[0246] The trained language rewriting model is invoked to rewrite the search text and generate the corresponding emoji description text.

[0247] The text-to-image model is called to generate L candidate emoji images based on the emoji description text, and the text-to-image matching model is called to predict the text-to-image relevance between each candidate emoji image and the emoji description text, where L is a positive integer;

[0248] The L candidate emoticons are sorted in descending order of their relevance to the text description, resulting in a sorted set of L candidate emoticons.

[0249] The first P candidate emojis among the sorted L candidate emojis are taken as the second emojis, where P is a positive integer and P is less than L.

[0250] In one embodiment, the training module 1205 is further configured to:

[0251] Obtain a third sample text and a language rewriting model to be trained. The third sample text has a reference rewriting text.

[0252] The language rewriting model to be trained is invoked to perform language rewriting on the third sample text, generating the sample rewritten text corresponding to the third sample text.

[0253] Based on the differences between the sample rewritten text and the reference rewritten text, the model parameters of the language rewriting model to be trained are corrected to obtain the trained language rewriting model.

[0254] In one implementation, the search module 1204 performs emoji expansion processing based on the search text to obtain an expanded second emoji image, including:

[0255] Get generic emoticons;

[0256] The search text and a generic emoticon are combined to generate a second emoticon.

[0257] In one implementation, the first emoticon image includes an emoticon template image; the process by which the search module 1204 returns the first emoticon image to the communication client includes:

[0258] The search text and emoji template images are combined to generate composite emoji images.

[0259] The synthesized emoticon is returned to the communication client.

[0260] According to one embodiment of this application, the steps involved in the data search method shown in FIG3 can be executed by various modules in the data search device 120 shown in FIG12. For example, step S101 shown in FIG3 can be executed by the first acquisition module 1201 in FIG12, step S102 shown in FIG3 can be executed by the generation module 1202 in FIG12, step S103 shown in FIG3 can be executed by the second acquisition module 1203 in FIG12, and step S104 shown in FIG3 can be executed by the search module 1204 in FIG12.

[0261] The method proposed in this application can perform multi-dimensional intent recognition on the search text used to search for emoticons from multiple intent understanding dimensions. Furthermore, it can configure the intent tags of each emoticon in the emoticon image library on each of these multiple intent understanding dimensions. Thus, by comparing the similarity between the multiple intent texts generated by intent recognition of the search text and the text tags (including intent tags) of the emoticons in the emoticon library, a multi-dimensional search for emoticons that match the search text can be achieved from these multiple intent understanding dimensions, thereby improving the accuracy of searching for emoticons that match the search text in the emoticon library.

[0262] According to one embodiment of this application, the modules in the data search device 120 shown in FIG12 can be individually or entirely merged into one or more units, or some of the units can be further divided into multiple functionally smaller sub-units to achieve the same operation without affecting the technical effect of the embodiment of this application. The above modules are based on logical function division. In practical applications, the function of one module can also be implemented by multiple units, or the function of multiple modules can be implemented by one unit. In other embodiments of this application, the data search device 120 may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by multiple units working together.

[0263] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0264] According to one embodiment of this application, a computer program capable of executing the steps involved in the corresponding methods shown in the various embodiments of this application can be run on a general-purpose computer device (which may include processing elements and storage elements such as a central processing unit (CPU), random access storage medium (RAM), and read-only storage medium (ROM)) to construct the data search device 120 shown in FIG12. The aforementioned computer program can be recorded on a computer-readable recording medium, and can be loaded into and run in the aforementioned computer device via the computer-readable recording medium.

[0265] Please refer to Figure 13, which is a schematic diagram of the structure of a computer device provided in an embodiment of this application. As shown in Figure 13, the computer device 1000 may include: a processor 1001, a network interface 1004, and a memory 1005. Furthermore, in some embodiments, the computer device 1000 may also include: a user interface 1003, and at least one communication bus 1002. The communication bus 1002 is used to implement communication between these components. The user interface 1003 may include a display screen and a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory, such as at least one disk storage device. Optionally, the memory 1005 may also be at least one storage device located remotely from the aforementioned processor 1001. As shown in Figure 13, the memory 1005, as a computer storage medium, may include an operating system, a network communication module, a user interface module, and a device control application.

[0266] In the computer device 1000 shown in Figure 13, the network interface 1004 provides network communication functions; the user interface 1003 is mainly used to provide an input interface for the user; and the processor 1001 can be used to call the device control application stored in the memory 1005 to achieve:

[0267] Get the search text, which is used to trigger a search for emojis;

[0268] The search text is subjected to intent recognition from N intent understanding dimensions, generating N intent texts of the search text. Each intent text corresponds to one intent understanding dimension, and N is a positive integer.

[0269] Obtain the text label for each emoji in the emoji library. The text label for any emoji includes the intent label for that emoji across N intent understanding dimensions.

[0270] By comparing the similarity between N intent texts and the text tags of emoticons in the emoticon library, the first matching emoticon in the emoticon library is searched for the search text.

[0271] It should be understood that the computer device 1000 described in the embodiments of this application can execute the data search method described in the various embodiments of this application, and can also execute the data search device 120 described in the embodiment corresponding to FIG12 above, which will not be repeated here. In addition, the beneficial effects of using the same method will not be repeated here.

[0272] Furthermore, it should be noted that this application also provides a computer-readable storage medium storing a computer program. When a processor executes the computer program, it can perform the data search methods described in the various embodiments of this application; therefore, these descriptions will not be repeated here. Additionally, the beneficial effects of using the same method will also not be repeated. For technical details not disclosed in the embodiments of the computer storage medium involved in this application, please refer to the description of the method embodiments of this application.

[0273] As an example, the aforementioned computer program can be deployed and executed on a single computer device, or deployed and executed on multiple computer devices located in one location, or executed on multiple computer devices distributed across multiple locations and interconnected via a communication network. These multiple computer devices distributed across multiple locations and interconnected via a communication network can form a blockchain network.

[0274] The aforementioned computer-readable storage medium can be an internal storage unit of the computer device, such as a hard drive or memory. It can also be an external storage device, such as a plug-in hard drive, smart media card (SMC), secure digital (SD) card, or flash card. Furthermore, the computer-readable storage medium can include both internal and external storage units of the computer device. This computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. It can also be used to temporarily store data that has been output or will be output.

[0275] This application provides a computer program product comprising a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium and executes the computer program, causing the computer device to perform the data search methods described in the embodiments of this application; therefore, these descriptions will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated. For technical details not disclosed in the embodiments of the computer-readable storage medium involved in this application, please refer to the description of the method embodiments of this application.

[0276] The terms "first," "second," etc., in the specification, claims, and drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the term "comprising," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or device that includes a series of steps or units is not limited to the listed steps or modules, but may optionally include steps or modules not listed, or may optionally include other step units inherent to these processes, methods, apparatuses, products, or devices.

[0277] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this application.

[0278] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.

Claims

1. A data search method characterized by, The method is performed by a search device, and the method includes: Obtain the search text and N dimensions of intent understanding, where N is a positive integer; The search text is subjected to intent recognition according to each of the intent understanding dimensions, and intent text of the search text is generated in each of the intent understanding dimensions; Obtain the text label for each emoji in the emoji library. The text label for any emoji includes the intent label for that emoji in each of the N intent understanding dimensions. By analyzing the similarity between the N intent texts and the text tags of the emoticons in the emoticon library, a first matching emoticon is searched in the emoticon library for the search text.

2. The method of claim 1, wherein, The N dimensions of intent understanding include intent understanding dimension i; The step of performing intent recognition on the search text according to each of the intent understanding dimensions, and generating intent text for the search text in each of the intent understanding dimensions, includes: Obtain a trained intent recognition model, which includes a text encoder and N text decoders, with each text decoder corresponding to one intent understanding dimension. The text encoder is invoked to perform feature encoding processing on the search text, generating the encoded features of the search text; The text decoder corresponding to the intent understanding dimension i is invoked to perform feature decoding processing on the encoded features on the intent understanding dimension i, thereby generating the intent text of the search text on the intent understanding dimension i.

3. The method according to any one of claims 1 to 2, characterized in that, The method further includes: Obtain a first sample text and an intent recognition model to be trained. The intent recognition model to be trained includes a text encoder to be trained and N text decoders to be trained. Each text decoder to be trained corresponds to one of the intent understanding dimensions. The first sample text has a corresponding reference intent text in each of the N intent understanding dimensions. The text encoder to be trained is invoked to perform feature encoding processing on the first sample text, generating sample encoding features of the first sample text; The N text decoders to be trained are invoked to perform feature decoding processing on the encoded features of the sample in the corresponding intent understanding dimension, so as to generate N sample intent texts of the first sample text; Based on the difference between the sample intent text and the reference intent text in the intent understanding dimension of each text decoder to be trained, a feature decoding loss is generated for each text decoder to be trained for the encoded features of the sample. The model parameters of the intent recognition model to be trained are corrected based on the feature decoding loss of each of the N text decoders to be trained, so as to obtain the trained intent recognition model.

4. The method according to any one of claims 1 to 3, characterized in that, There are multiple first sample texts, and these multiple first sample texts have the same reference intent text across the N intent understanding dimensions. The N text decoders to be trained include a target text decoder, which is any one of the N text decoders to be trained. The target text decoder contains multiple first network layers. The process of correcting the model parameters of the intent recognition model to be trained based on the feature decoding loss of each of the N text decoders to be trained, thereby obtaining the trained intent recognition model, includes: During the process of the target text decoder performing feature decoding on the sample encoding features of each first sample text, the decoding features generated by each of the multiple first network layers (excluding the last first network layer) for each first sample text are obtained. Based on the decoding features of the plurality of first sample texts, the target text decoder generates a first clustering loss for the plurality of first sample texts. The first clustering loss is used to reflect the differences between the decoding features generated by the same first network layer for the plurality of first sample texts. By using the first clustering loss and feature decoding loss of each of the N text decoders to be trained, the model parameters of the intent recognition model to be trained are corrected, and the trained intent recognition model is obtained.

5. The method according to any one of claims 1 to 4, characterized in that, The step of searching for a first matching emoticon in the emoticon library for the search text based on the similarity between the N intent texts and the text tags of emoticons in the emoticon library includes: By comparing the similarity between the N intent texts and the text tags of each emoji in the emoji library, the search matching degree between the search text and each emoji in the emoji library is obtained. Based on the search matching degree between the search text and each emoji in the emoji library, the first emoji is selected from the emoji library.

6. The method according to any one of claims 1 to 5, characterized in that, The emoji library includes target emojis, which are any emojis in the emoji library; obtaining the search matching degree between the search text and each emoji in the emoji library by comparing the similarity between the search text and the text tags of each of the N search texts with the text tags of each emoji in the emoji library includes: The trained feature embedding model is invoked to perform feature embedding processing on each text label of the search text, the N intent texts, and the target emoticon, respectively, to generate the representation features of the search text, the representation features of each intent text, and the representation features of each text label of the target emoticon; Obtain the M feature similarities between the representation features of the search text and the representation features of the N intent texts and the representation features of the text labels of the target emoticon, where the feature similarity between the representation features of the texts is used to reflect the similarity between the texts, and M is a positive integer; The maximum feature similarity among the M feature similarities is taken as the search matching degree between the search text and the target emoticon.

7. The method according to any one of claims 1 to 6, characterized in that, The text tags of any emoticon include the general tags of that emoticon. The target emoticon has K+N text tags, which include K general tags and N intent tags of the target emoticon, where K is a positive integer. The step of obtaining the representation features of the search text and the representation features of the N intent texts and the representation features of the text labels of the target emoticon image, and the similarity of M features, includes: Calculate the K+N feature similarities between the representation features of the search text and the representation features of the K+N text tags, and find that the representation features of the search text have a feature similarity with the representation features of a text tag of the target emoticon. Calculate N×K feature similarities between the representation features of the N intent texts and the representation features of the K general labels, respectively. There is one feature similarity between the representation features of an intent text and the representation features of a general label of the target emoticon. Calculate N feature similarities between the representation features of the N intent texts and the representation features of the N intent tags. The representation feature of any intent text has a feature similarity with the representation feature of an intent tag in the intent understanding dimension corresponding to any intent text. The K+N feature similarities, the N×K feature similarities, and the N feature similarities are determined as the M feature similarities.

8. The method according to any one of claims 1 to 7, characterized in that, The method further includes: Obtain sample pairs and feature embedding models to be trained. Each sample pair includes two second sample texts and has a semantic matching label. The semantic matching label indicates whether the text semantics between the two second sample texts in the sample pair match or do not match. The feature embedding model to be trained is invoked to perform feature embedding processing on each second sample text in the sample pair, generating representation features for each second sample text in the sample pair; Based on the representation features of each second sample text in the sample pair and the semantic matching label, the feature embedding loss of the feature embedding model to be trained is generated; The model parameters of the feature embedding model to be trained are corrected based on the feature embedding loss to obtain the trained feature embedding model.

9. The method according to any one of claims 1 to 8, characterized in that, The sample pairs are multiple, and each sample pair includes multiple second sample texts that are semantically similar. The feature embedding model to be trained includes multiple second network layers. The step of correcting the model parameters of the feature embedding model to be trained based on the feature embedding loss to obtain the trained feature embedding model includes: During the process of feature embedding processing of the second sample text in the plurality of sample pairs by the feature embedding model to be trained, the embedding features generated by the plurality of second network layers for each of the plurality of second sample texts are obtained; Based on the embedding features of the multiple second sample texts, the feature embedding model to be trained generates a second clustering loss for the multiple second sample texts. The second clustering loss is used to reflect the differences between the embedding features generated by the same second network layer for the multiple second sample texts. The model parameters of the feature embedding model to be trained are corrected based on the second clustering loss and the feature embedding loss to obtain the trained feature embedding model.

10. The method according to any one of claims 1 to 9, characterized in that, The method further includes: Obtain the original sample text and perform key information detection on the original sample text to obtain G key information in the original sample text, where G is a positive integer; G key information in the original sample text are subjected to G negation replacements to generate G negation replacement texts of the original sample text. Each negation replacement is used to negate one key information in the original sample text to obtain one negation replacement text. The original sample text and the G antonymous replacement texts are combined in pairs to obtain at least one sample pair.

11. The method according to any one of claims 1 to 10, characterized in that, The step of selecting the first emoticon from the emoticon library based on the search matching degree between the search text and each emoticon in the emoticon library includes: The emoticons in the emoticon library are sorted in descending order of the search match between the search text and each emoticon in the emoticon library to obtain sorted emoticons. The first Q emoticons in the sorted emoticon image library are selected as the first emoticon image, where Q is a positive integer and is less than the total number of emoticons in the emoticon image library.

12. The method according to any one of claims 1 to 11, characterized in that, The search text is sent by a communication client; the method further includes: Based on the search text, emoji expansion processing is performed to obtain an expanded second emoji image; The first emoticon and the second emoticon are returned to the communication client.

13. The method according to any one of claims 1 to 12, characterized in that, The process of expanding the emoticon based on the search text to obtain an expanded second emoticon image includes: The trained language rewriting model is invoked to rewrite the search text, generating an expression description text corresponding to the search text. The text-to-image model is invoked to generate L candidate emoji images based on the emoji description text, and the text-to-image matching model is invoked to predict the text-to-image relevance between each candidate emoji image and the emoji description text, where L is a positive integer; The L candidate emoticons are sorted in descending order of the relevance between each candidate emoticon and the emoticon description text to obtain the sorted L candidate emoticons. The second emoticon is generated based on the first P candidate emoticons among the L sorted candidate emoticons, where P is a positive integer and P is less than L.

14. The method according to any one of claims 1 to 13, characterized in that, The method further includes: Obtain a third sample text and a language rewriting model to be trained, wherein the third sample text has a reference rewriting text; The language rewriting model to be trained is invoked to perform language rewriting processing on the third sample text, generating sample rewritten text corresponding to the third sample text. Based on the differences between the sample rewritten text and the reference rewritten text, the model parameters of the language rewriting model to be trained are corrected to obtain the trained language rewriting model.

15. The method according to any one of claims 1 to 14, wherein The process of expanding the emoticon based on the search text to obtain an expanded second emoticon image includes: Get generic emoticons; The search text and the general emoticon are combined to generate the second emoticon.

16. The method according to any one of claims 1 to 15, wherein, The first emoticon image includes an emoticon template image; The process of returning the first emoticon to the communication client includes: The search text and the emoticon template image are combined to generate a composite emoticon image; The synthesized emoticon is returned to the communication client.

17. A data search apparatus characterized by comprising: The data search device is applied to a search device, and the device includes: The first acquisition module is used to acquire the search text and N dimensions of intent understanding, where N is a positive integer. A generation module is used to perform intent recognition on the search text according to each of the intent understanding dimensions, and generate intent text of the search text in each of the intent understanding dimensions; The second acquisition module is used to acquire the text tag of each emoticon in the emoticon library. The text tag of any emoticon includes the intent tag of the emoticon in the N intent understanding dimensions. The search module is used to search for a first matching emoticon in the emoticon library based on the similarity between the N intent texts and the text tags of emoticons in the emoticon library.

18. A computer program product, characterised in that, The computer program product includes a computer program stored in a computer-readable storage medium, the computer program being adapted to be read and executed by a processor to cause a computer device having the processor to perform the method of any one of claims 1-16.

19. A computer device, comprising: It includes a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the method according to any one of claims 1-16.

20. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted to be loaded by a processor and to execute the steps of the method according to any one of claims 1-16.