Reply information generation method and device, storage medium and electronic equipment

CN116644165BActive Publication Date: 2026-10-27INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310613232.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-26
Publication Date
2026-10-27
Estimated Expiration
2043-05-26

AI Technical Summary

Technical Problem

[0005]本申请的主要目的在于提供一种回复信息的生成方法、装置、存储介质及电子设备,以解决相关技术中聊天机器人回复用户时采用文本形式回复,回复信息的形式单一的问题

Benefits of technology

[0014]通过本申请,采用以下步骤:获取聊天机器人对用户语句的回复语句,将回复语句与模因数据库中的每个模因进行匹配,得到每个模因与回复语句的匹配值,其中,模因是指包含文本的图片;判断匹配值是否大于等于匹配值阈值;在匹配值大于等于匹配值阈值的情况下,将匹配值对应的模因确定为待定模因,得到一组待定模因;将一组待定模因中最大匹配值对应的待定模因确定为目标模因,将目标模因作为回复信息回复用户,解决了相关技术中聊天机器人回复用户时采用文本形式回复,回复信息的形式单一的问题。通过对回复语句匹配模因数据库中的模因,筛选出与回复语句的匹配值最高的模因作为回复信息回复用户,进而达到了丰富回复信息的种类,通过多样式的回复信息吸引聊天机器人的用户,提高聊天机器人的访问量的效果。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116644165B_ABST
    Figure CN116644165B_ABST
Patent Text Reader

Abstract

The application discloses a method and device for generating reply information, a storage medium and an electronic device. It relates to the field of artificial intelligence, and the method comprises the following steps: obtaining a reply statement of a chat robot to a user statement, matching the reply statement with each meme in a meme database to obtain a matching value of each meme and the reply statement, wherein the meme refers to a picture containing text; determining whether the matching value is greater than or equal to a matching value threshold; in the case where the matching value is greater than or equal to the matching value threshold, determining the meme corresponding to the matching value as a pending meme to obtain a group of pending memes; determining the pending meme corresponding to the maximum matching value in the group of pending memes as a target meme, and using the target meme as the reply information to reply to the user. Through the application, the problem of single form of reply information in the related art, in which the chat robot replies to the user in the form of text, is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence, and more specifically, to a method, apparatus, storage medium, and electronic device for generating response information. Background Technology

[0002] Casual conversation refers to conversations people engage in in daily life to exchange information or strengthen relationships. These conversations typically lack a specific purpose and can include greetings, banter, or simply exchanging information. On social media, people like to use emoticons, memes, and kaomojis to express emotions such as joy, shock, and sarcasm. In related technologies, a large number of memes are shared on some social media platforms, and websites like imgflip.com allow users to manually create memes, while some meme libraries facilitate manual meme generation.

[0003] Chatbots fall under the category of open-domain question answering in chatbots. Open-domain question answering refers to directly answering questions in a friendly manner, with chatbots leveraging the vast knowledge base of the internet to respond to users. Examples of chatbots in this technology include "Xiao A" and "Xiao B" from various application vendors. However, these chatbots typically only reply to users with text-based messages, which are often monotonous and lack engaging content.

[0004] There is currently no effective solution to the problem that chatbots in related technologies reply to users in text format, resulting in a monotonous response format. Summary of the Invention

[0005] The main objective of this application is to provide a method, apparatus, storage medium, and electronic device for generating reply information, in order to solve the problem that chatbots in the related art reply to users in the form of text, resulting in a single form of reply information.

[0006] To achieve the above objectives, according to one aspect of this application, a method for generating response information is provided. The method includes: obtaining a chatbot's response to a user's statement; matching the response with each meme in a meme database to obtain a matching value for each meme and the response, wherein a meme refers to an image containing text; determining whether the matching value is greater than or equal to a matching value threshold; if the matching value is greater than or equal to the matching value threshold, identifying the meme corresponding to the matching value as a pending meme, thus obtaining a set of pending memes; identifying the pending meme corresponding to the largest matching value in the set of pending memes as the target meme; and replying to the user with the target meme as the response information.

[0007] Optionally, matching the reply statement with each meme in the meme database to obtain the matching value between each meme and the reply statement includes: extracting the target statement for each meme using a text recognition engine, wherein the target statement is the text contained in the meme; inputting the target statement and the reply statement into a target language recognition model to obtain the similarity between the target statement and the reply statement, wherein the target language recognition model is trained by multiple sets of first training samples, each set of first training samples including a historical target statement, a historical reply statement, and a historical similarity; and determining the similarity as the matching value between the meme and the reply statement.

[0008] Optionally, the target language recognition model is obtained by: acquiring multiple historical reply statements from the chatbot to the user, and acquiring the historical target statement and historical similarity corresponding to each historical reply statement; using each historical reply statement, the historical target statement corresponding to the historical reply statement, and the historical similarity as a set of first training samples to obtain multiple sets of first training samples; inputting the multiple sets of first training samples into the language recognition pre-training model for training to obtain the trained target language recognition model.

[0009] Optionally, before extracting the target statement for each meme using the text recognition engine, the method further includes: determining whether target data for the chatbot's reply to the user has been obtained, wherein the target data is used to characterize the reply intent of the reply statement; if the target data has not been obtained, performing the step of extracting the target statement for each meme using the text recognition engine; if the target data has been obtained, inputting each meme into an intent recognition model to obtain a set of intent data for each meme, wherein the intent recognition model is trained by multiple sets of second training samples, each set of second training samples including a meme and a set of historical intent data; determining whether the set of intent data for the current meme contains target data; if the set of intent data for the current meme contains target data, performing the step of extracting the target statement for each meme using the text recognition engine; if the set of intent data for the current meme does not contain target data, performing the step of extracting the target statement for each meme using the text recognition engine for other memes, wherein the other memes are memes in the meme database other than the current meme.

[0010] Optionally, the intent recognition model is obtained by: acquiring each meme in the meme database and acquiring a set of historical intent data for the meme, wherein the historical intent data is the historical intent expressed when the meme was used; using each meme and a set of historical intent data as a set of second training samples to obtain multiple sets of second training samples; inputting the multiple sets of second training samples into a pre-trained dialogue generation model for training to obtain the trained intent recognition model.

[0011] Optionally, before replying to the user with the target meme as a reply message, the method further includes: determining whether the target statement of the target meme is the same as the reply statement; if the target statement of the target meme is different from the reply statement, replacing the target statement in the target meme with the reply statement to obtain an updated target meme, and performing the step of replying to the user with the target meme as a reply message based on the updated target meme; if the target statement of the target meme is the same as the reply statement, performing the step of replying to the user with the target meme as a reply message.

[0012] Optionally, after determining whether the matching value is greater than or equal to the matching value threshold, the method further includes: if the matching value is less than the matching value threshold, determining whether the matching values ​​of other memes and the reply statement are greater than or equal to the matching value threshold, wherein other memes are memes in the meme database other than those whose matching values ​​are less than the matching value threshold; if the matching values ​​of all memes and the reply statement are less than the matching value threshold, replying to the user with the reply statement as reply information.

[0013] To achieve the above objectives, according to another aspect of this application, a response information generation apparatus is provided. The apparatus includes: an acquisition unit, configured to acquire a chatbot's response to a user's statement, match the response with each meme in a meme database to obtain a matching value between each meme and the response, wherein a meme refers to an image containing text; a first judgment unit, configured to determine whether the matching value is greater than or equal to a matching value threshold; a first determination unit, configured to determine the meme corresponding to the matching value as a pending meme if the matching value is greater than or equal to the matching value threshold, thereby obtaining a set of pending memes; and a second determination unit, configured to determine the pending meme corresponding to the largest matching value in the set of pending memes as a target meme, and reply to the user with the target meme as the response information.

[0014] This application employs the following steps: obtaining the chatbot's response to a user's statement; matching the response with each meme in a meme database to obtain a match value for each meme and the response; where a meme refers to an image containing text; determining whether the match value is greater than or equal to a match value threshold; if the match value is greater than or equal to the match value threshold, identifying the meme corresponding to the match value as a set of undetermined memes; identifying the undetermined meme with the highest match value in the set of undetermined memes as the target meme; and using the target meme as the response to the user. This solves the problem in related technologies where chatbots respond to users in text format, resulting in a monotonous response format. By matching the response with memes in the meme database and selecting the meme with the highest match value as the response, the application enriches the types of response information, attracting chatbot users with diverse response options and increasing chatbot traffic. Attached Figure Description

[0015] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:

[0016] Figure 1 This is a flowchart of a method for generating response information according to an embodiment of this application;

[0017] Figure 2 This is a schematic diagram of a meme provided according to an embodiment of this application;

[0018] Figure 3 This is a schematic diagram of a response information generation device provided according to an embodiment of this application;

[0019] Figure 4 This is a schematic diagram of an electronic device provided according to an embodiment of this application. Detailed Implementation

[0020] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0021] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0022] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0023] For ease of description, the following explains some of the nouns or terms used in the embodiments of this application:

[0024] A meme is an image accompanied by text, typically used on social media to express sarcastic or agitated emotions, and it spreads rapidly. A standard meme should have an image that expresses the emotion and witty text.

[0025] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.

[0026] The present invention will now be described in conjunction with preferred implementation steps. Figure 1 This is a flowchart of a method for generating response information according to an embodiment of this application, such as... Figure 1 As shown, the method includes the following steps:

[0027] Step S101: Obtain the chatbot's response to the user's statement, match the response with each meme in the meme database, and obtain the matching value between each meme and the response. Here, a meme refers to an image containing text.

[0028] Specifically, chatbots can be like "Xiao A" or "Xiao B" from various application vendors. When users chat with the chatbot, it responds based on the user's statements. The chatbot first generates a response to the user. To enhance the engagement and avoid overly simplistic replies, it doesn't simply send text-only messages. Instead, it matches the response against memes in a pre-defined meme database, selecting suitable memes as the reply. This selection process involves determining the match value of each meme that matches the response.

[0029] It's important to note that the meme database stores memes in triplets, where each meme contains text, an image, and an intent. The intent refers to the thought or emotion a user wants to express using a meme, such as sarcasm, shock, or feeling overwhelmed. Each meme can have multiple intents. Memes can be sourced from various social media platforms or through meme creation and sharing websites like imgflip.com, or manually created using the X Meme Library. Images within memes can be retrieved via search engines to find the original, text-free image of the meme. Intents can be manually labeled or assigned using a trained intent recognition model that tags the text within the meme. For memes from social media, intent can be determined manually or through a model combined with the meme's context.

[0030] Step S102: Determine whether the matching value is greater than or equal to the matching value threshold.

[0031] Specifically, the matching value can be determined based on the similarity between the target statement and the response statement in the meme, and the matching value threshold can be a manually set value to filter memes that do not match the response statement. If the matching value is less than the matching value threshold, it means that the meme corresponding to that matching value does not match the response statement.

[0032] Step S103: If the matching value is greater than or equal to the matching value threshold, the meme corresponding to the matching value is determined as a set of undetermined memes, thus obtaining a set of undetermined memes.

[0033] Specifically, if the matching value is greater than or equal to the matching value threshold, it means that the meme corresponding to the matching value matches the reply statement and can be used as a potential meme that can reply to the user. There may be multiple potential memes that match the reply statement in the meme database. Therefore, a set of potential memes is obtained.

[0034] Step S104: Determine the undetermined meme corresponding to the largest matching value among a set of undetermined memes as the target meme, and reply to the user with the target meme as the reply information.

[0035] Specifically, if there are multiple memes that match the reply statement, i.e., there is a set of undetermined memes, the undetermined meme with the largest match value among the undetermined memes will be replied to the user as the target meme. The undetermined meme with the largest match value is the meme with the highest degree of match to the reply statement, and the target meme as reply information can express an effect that is closer to the reply statement.

[0036] The method for generating response information provided in this application involves obtaining the response statement of a chatbot to a user's statement, matching the response statement with each meme in a meme database to obtain a matching value between each meme and the response statement. Here, a meme refers to an image containing text. The method then determines whether the matching value is greater than or equal to a matching value threshold. If the matching value is greater than or equal to the threshold, the meme corresponding to the matching value is identified as a set of undetermined memes. The undetermined meme with the highest matching value in this set is identified as the target meme, and the target meme is used as the response information to reply to the user. This method solves the problem in related technologies where chatbots reply to users in text format, resulting in a monotonous response format. By matching the response statement with memes in the meme database and selecting the meme with the highest matching value as the response information to reply to the user, the method enriches the types of response information, attracts chatbot users with diverse response information, and increases the chatbot's access volume.

[0037] The matching value is calculated based on the similarity between the target statement and the reply statement. Optionally, in the reply information generation method provided in this application embodiment, matching the reply statement with each meme in the meme database to obtain the matching value between each meme and the reply statement includes: extracting the target statement for each meme using a text recognition engine, wherein the target statement is the text contained in the meme; inputting the target statement and the reply statement into a target language recognition model to obtain the similarity between the target statement and the reply statement, wherein the target language recognition model is trained by multiple sets of first training samples, each set of first training samples includes a historical target statement, a historical reply statement, and a historical similarity; and determining the similarity as the matching value between the meme and the reply statement.

[0038] Specifically, the text recognition engine can be an OCR (Optical Character Recognition) engine, the target sentence can be the text in the meme, and the target sentence can be extracted from the meme by the OCR engine. Figure 2 This is a schematic diagram of a meme provided according to an embodiment of this application, such as... Figure 2 As shown, the OCR recognition engine can... Figure 2 The target phrases "SOMEONE ON THE INTERNET" and "DISAGREES WITH ME" are extracted from the memes shown. The target language recognition model can be BERT (Bidirectional Encoder Representation from Transformers, a semantic recognition model) or ERNIE (Enhanced Representation from Knowledge Integration, a continuous learning semantic understanding model). The target language recognition model identifies whether the target phrase and the response phrase have the same semantic meaning, and the similarity between the target phrase and the response phrase is used as the meme's matching value. By determining the matching value between each meme and the response phrase, memes that can express the same meaning as the response phrase are selected.

[0039] The target language recognition model needs to be trained based on machine learning. Optionally, in the method for generating reply information provided in this application embodiment, the target language recognition model is obtained in the following way: obtaining multiple historical reply statements of the chatbot to the user, and obtaining the historical target statement and historical similarity corresponding to each historical reply statement; taking each historical reply statement, the historical target statement corresponding to the historical reply statement, and the historical similarity as a set of first training samples to obtain multiple sets of first training samples; inputting the multiple sets of first training samples into the language recognition pre-training model for training to obtain the trained target language recognition model.

[0040] Specifically, a target language recognition model is trained using deep learning techniques. The training dataset, consisting of multiple sets of initial training samples, comprises historical replies from the chatbot to users, historical target statements extracted from memes matched with these historical replies, and historical similarity scores. The training dataset is iteratively trained using pre-trained language recognition models such as BERT and ERNIE until the accuracy of the trained model meets the manually set accuracy requirements. This trained model is then used as the target language recognition pattern. The target language recognition model is trained to output matching values ​​for each meme.

[0041] When filtering memes, a portion of the memes can be pre-selected from the meme database based on the intent expressed by the reply statement. Optionally, in the reply information generation method provided in this application embodiment, before extracting the target statement for each meme using a text recognition engine, the method further includes: determining whether target data for the chatbot's reply to the user statement has been obtained, wherein the target data is used to characterize the reply intent of the reply statement; if no target data has been obtained, performing the step of extracting the target statement for each meme using a text recognition engine; if target data has been obtained, inputting each meme into an intent recognition model to obtain a set of intent data for each meme, wherein the intent recognition model is trained by multiple sets of second training samples, each set of second training samples including a meme and a set of historical intent data; determining whether the set of intent data for the current meme contains target data; if the set of intent data for the current meme contains target data, performing the step of extracting the target statement for each meme using a text recognition engine; if the set of intent data for the current meme does not contain target data, performing the step of extracting the target statement for each meme using a text recognition engine for other memes, wherein the other memes are memes in the meme database other than the current meme.

[0042] Specifically, when a chatbot generates a response, it may simultaneously generate target data representing the response intent. For example, if the chatbot generates the response "How could you say that to me?", it may also generate the target data "angry". For responses that simultaneously generate target data, a subset of memes that do not match the response intent can be pre-filtered from the meme database based on the target data, improving the matching efficiency between the response and the meme. Once the target data is obtained, each meme is input into an intent recognition model to identify a set of intent data that each meme can express. Memes that don't match the target data are filtered out by determining whether a set of intent data contains the target data. For example, if the target data represents the response intent as "angry," and meme A, when input into the intent recognition model, yields a set of intent data including "sarcasm, shock, and heavy workload," while meme B, when input into the intent recognition model, yields a set of intent data including "shock and anger," then meme A cannot express the intended response intent of "angry," and is therefore directly removed. The matching value of meme A is not needed when determining the match value between each meme and the response. Meme B, however, can express the intended response intent of "angry" within a set of intent data, so its matching value needs to be calculated when determining the match value between each meme and the response. By filtering out some memes that don't match the response based on the intent recognition model, the matching efficiency between the response and the meme database is improved.

[0043] The intent recognition model needs to be trained based on machine learning. Optionally, in the response information generation method provided in this application embodiment, the intent recognition model is obtained in the following way: each meme in the meme database is obtained, and a set of historical intent data of the meme is obtained. The historical intent data is the historical intent expressed when the meme is used; each meme and a set of historical intent data are used as a set of second training samples to obtain multiple sets of second training samples; the multiple sets of second training samples are input into a pre-trained dialogue generation model for training to obtain the trained intent recognition model.

[0044] Specifically, the pre-trained dialogue generation model can be a model with discrete latent variables, such as PLATO. The pre-trained dialogue generation model is trained using deep learning techniques. The training dataset, i.e., multiple sets of second training samples, consists of memes and a set of historical intent data corresponding to each meme. The historical intent data can be manually labeled intent data based on the context of the meme's application. The training dataset is iteratively trained using a pre-trained dialogue generation model such as PLATO until the accuracy of the trained model meets the manually set accuracy requirements. This trained model is then used as the intent recognition model. The intent recognition model is then used to filter out memes whose intents do not match the response statements.

[0045] The target statement in the target meme can be replaced as needed. Optionally, in the method for generating reply information provided in this application embodiment, before replying to the user as reply information using the target meme, the method further includes: determining whether the target statement of the target meme is the same as the reply statement; if the target statement of the target meme is different from the reply statement, replacing the target statement in the target meme with the reply statement to obtain an updated target meme, and performing the step of replying to the user as reply information using the updated target meme; if the target statement of the target meme is the same as the reply statement, performing the step of replying to the user as reply information using the target meme.

[0046] Specifically, some of the selected target memes still have instances where the text within the meme and the response statement don't match well. Therefore, for target memes that don't match, i.e., when the target statement of the target meme differs from the response statement, an updated target meme can be generated automatically using the X meme generation library. This is done by combining the response statement with the original image of the target meme. The original image, without text, can be retrieved using a search engine. By automatically generating the updated target meme, the intent expressed by the updated target meme is more closely matched to the response statement, preventing inaccurate responses from chatbots to users.

[0047] For example, if a chatbot generates the response "Are you kidding me?", and then finds the target meme 's' with the highest match value in the meme database, the target statement in target meme 's' is "Are you kidding me?". Directly using the target meme as the response is not very effective. Instead, the X meme generation library can be used to replace the target statement "Are you kidding me?" in target meme 's' with "Are you kidding me?", generating an updated target meme and sending it to the user.

[0048] It is also possible that none of the memes in the meme database match the reply statement. Optionally, in the reply information generation method provided in this application embodiment, after determining whether the matching value is greater than or equal to the matching value threshold, the method further includes: if the matching value is less than the matching value threshold, determining whether the matching value of other memes and the reply statement is greater than or equal to the matching value threshold, wherein other memes are memes in the meme database other than those whose matching value is less than the matching value threshold; if the matching value of all memes and the reply statement is less than the matching value threshold, replying to the user with the reply statement as reply information.

[0049] Specifically, the chatbot doesn't replace all user responses with memes. Only when none of the memes in the meme database match the response—that is, when the match value for all memes is less than the threshold—is the response itself sent directly to the user. By adding memes to the chatbot's responses instead of simple text replies, the chatbot becomes more engaging and attracts more users.

[0050] For example, a user sends the chatbot the message "Hey A, you seem different today." The chatbot generates the response "Thank you for your compliment, I'm happy" and the response intent "Grateful and happy." By analyzing the response intent, most memes in the meme database that don't match "Grateful and happy" are removed. Then, the matching values ​​between the remaining memes and the response are calculated one by one. If all the matching values ​​are less than the matching threshold, "Thank you for your compliment, I'm happy" is directly sent to the user as the response.

[0051] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0052] This application also provides a response information generation apparatus. It should be noted that the response information generation apparatus of this application can be used to execute the response information generation method provided in this application. The response information generation apparatus provided in this application will be described below.

[0053] Figure 3 This is a schematic diagram of a response information generation apparatus provided according to an embodiment of this application. For example... Figure 3 As shown, the device includes:

[0054] The acquisition unit 10 is used to acquire the chatbot's response to the user's statement, match the response with each meme in the meme database, and obtain the matching value between each meme and the response. Here, a meme refers to an image containing text.

[0055] The first judgment unit 20 is used to determine whether the matching value is greater than or equal to the matching value threshold.

[0056] The first determining unit 30 is used to determine the meme corresponding to the matching value as a meme to be determined when the matching value is greater than or equal to the matching value threshold, and obtain a set of memes to be determined.

[0057] The second determining unit 40 is used to determine the undetermined meme corresponding to the largest matching value in a set of undetermined memes as the target meme, and reply to the user with the target meme as the reply information.

[0058] The reply information generation device provided in this application embodiment obtains the reply statement of the chatbot to the user's statement through the acquisition unit 10, matches the reply statement with each meme in the meme database to obtain the matching value of each meme and the reply statement, where a meme refers to an image containing text; the first judgment unit 20 judges whether the matching value is greater than or equal to the matching value threshold; the first determination unit 30 determines the meme corresponding to the matching value as a pending meme when the matching value is greater than or equal to the matching value threshold, obtaining a set of pending memes; the second determination unit 40 determines the pending meme corresponding to the largest matching value in the set of pending memes as the target meme, and uses the target meme as the reply information to reply to the user. This solves the problem in related technologies where chatbots reply to users in text form, resulting in a single form of reply information. By matching the reply statement with memes in the meme database, the meme with the highest matching value with the reply statement is selected as the reply information to reply to the user, thereby enriching the types of reply information and attracting chatbot users with diverse reply information, thus increasing the number of visits to the chatbot.

[0059] Optionally, in the response information generation apparatus provided in this application embodiment, the acquisition unit 10 includes: an extraction module, used to extract a target statement from each meme using a text recognition engine, wherein the target statement is the text contained in the meme; an input module, used to input the target statement and the response statement into a target language recognition model to obtain the similarity between the target statement and the response statement, wherein the target language recognition model is trained by multiple sets of first training samples, each set of first training samples including a historical target statement, a historical response statement and a historical similarity; and a determination module, used to determine the similarity as the matching value between the meme and the response statement.

[0060] Optionally, in the response information generation device provided in this application embodiment, the target language recognition model is obtained in the following way: acquiring multiple historical response statements of the chatbot to the user, and acquiring the historical target statement and historical similarity corresponding to each historical response statement; taking each historical response statement, the historical target statement and historical similarity corresponding to the historical response statement as a set of first training samples to obtain multiple sets of first training samples; inputting the multiple sets of first training samples into the language recognition pre-training model for training to obtain the trained target language recognition model.

[0061] Optionally, in the response information generation apparatus provided in this application embodiment, the apparatus further includes: a second judgment unit, configured to determine whether target data of the chatbot's response to the user's statement is obtained, wherein the target data is used to characterize the response intent of the response statement; a first execution unit, configured to execute the step of extracting the target statement for each meme through a text recognition engine when the target data is not obtained; an input unit, configured to input each meme into an intent recognition model when the target data is obtained, to obtain a set of intent data for each meme, wherein the intent recognition model is trained by multiple sets of second training samples, each set of second training samples including a meme and a set of historical intent data; a third judgment unit, configured to determine whether the set of intent data of the current meme contains target data; a second execution unit, configured to execute the step of extracting the target statement for each meme through a text recognition engine when the set of intent data of the current meme contains target data; and a third execution unit, configured to execute the step of extracting the target statement for each meme through a text recognition engine for other memes when the set of intent data of the current meme does not contain target data, wherein the other memes are memes in the meme database other than the current meme.

[0062] Optionally, in the response information generation apparatus provided in this application embodiment, the intent recognition model is obtained in the following manner: each meme in the meme database is obtained, and a set of historical intent data of the meme is obtained, wherein the historical intent data is the historical intent expressed when the meme is used; each meme and a set of historical intent data are used as a set of second training samples to obtain multiple sets of second training samples; the multiple sets of second training samples are input into a pre-trained dialogue generation model for training to obtain a trained intent recognition model.

[0063] Optionally, in the response information generation apparatus provided in this application embodiment, the apparatus further includes: a fourth judgment unit, configured to determine whether the target statement of the target meme is the same as the response statement; a replacement unit, configured to replace the target statement in the target meme with the response statement when the target statement of the target meme is different from the response statement, to obtain an updated target meme, and to perform the step of replying to the user with the target meme as response information based on the updated target meme; and a fourth execution unit, configured to perform the step of replying to the user with the target meme as response information when the target statement of the target meme is the same as the response statement.

[0064] Optionally, in the response information generation apparatus provided in this application embodiment, the apparatus further includes: a fifth judgment unit, configured to determine whether the matching value of other memes and the response statement is greater than or equal to the matching value threshold when the matching value is less than the matching value threshold, wherein other memes are memes in the meme database other than those whose matching value is less than the matching value threshold; and a response unit, configured to reply to the user as response information when the matching value of all memes and the response statement is less than the matching value threshold.

[0065] The device for generating response information includes a processor and a memory. The aforementioned acquisition unit 10, first judgment unit 20, first determination unit 30, and second determination unit 40 are all stored in the memory as program units. The processor executes the aforementioned program units stored in the memory to realize the corresponding functions.

[0066] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured; by adjusting kernel parameters, the variety of response messages can be increased, attracting chatbot users and improving chatbot traffic through diverse response options.

[0067] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0068] This invention provides a computer-readable storage medium storing a program that, when executed by a processor, implements a method for generating response information. The method includes: acquiring a chatbot's response to a user's statement; matching the response with each meme in a meme database to obtain a matching value for each meme and the response, wherein a meme refers to an image containing text; determining whether the matching value is greater than or equal to a matching value threshold; if the matching value is greater than or equal to the matching value threshold, identifying the meme corresponding to the matching value as a pending meme, thus obtaining a set of pending memes; identifying the pending meme corresponding to the largest matching value in the set of pending memes as the target meme; and replying to the user with the target meme as the response information.

[0069] This invention provides a processor for running a program, wherein the program executes a method for generating response information during runtime.

[0070] Figure 4 This is a schematic diagram of an electronic device provided according to an embodiment of this application. For example... Figure 4As shown, electronic device 401 includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it implements the following steps: a method for generating response information. The method includes: acquiring a chatbot's response to a user's statement; matching the response with each meme in a meme database to obtain a matching value between each meme and the response, where a meme refers to an image containing text; determining whether the matching value is greater than or equal to a matching value threshold; if the matching value is greater than or equal to the matching value threshold, identifying the meme corresponding to the matching value as a pending meme, obtaining a set of pending memes; identifying the pending meme corresponding to the largest matching value in the set of pending memes as the target meme; and replying to the user with the target meme as the response information. The device in this document can be a server, PC, PAD, mobile phone, etc.

[0071] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program with the following method steps: a method for generating response information. The method includes: obtaining a chatbot's response to a user's statement; matching the response with each meme in a meme database to obtain a matching value for each meme and the response, wherein a meme refers to an image containing text; determining whether the matching value is greater than or equal to a matching value threshold; if the matching value is greater than or equal to the matching value threshold, determining the meme corresponding to the matching value as a pending meme, obtaining a set of pending memes; determining the pending meme corresponding to the largest matching value in the set of pending memes as the target meme; and replying to the user with the target meme as the response information.

[0072] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0073] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1A device that provides the functions specified in one or more boxes.

[0074] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0075] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0076] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0077] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0078] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0079] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0080] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0081] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A method for generating response information, characterized in that, include: The system obtains the chatbot's response to the user's statement, matches the response with each meme in the meme database, and obtains the matching value between each meme and the response. Here, a meme refers to an image containing text, and the meme database stores memes in the form of triples, where each meme contains text, an image, and an intent. Matching the reply statement with each meme in the meme database to obtain a matching value between each meme and the reply statement includes: extracting a target statement from each meme using a text recognition engine, wherein the target statement is the text contained in the meme; inputting the target statement and the reply statement into a target language recognition model to obtain a similarity between the target statement and the reply statement, wherein the target language recognition model is trained from multiple sets of first training samples, each set of first training samples including a historical target statement, a historical reply statement, and a historical similarity; and determining the similarity as the matching value between the meme and the reply statement. Before extracting the target statement for each meme using a text recognition engine, the method further includes: determining whether target data for the chatbot's reply to the user has been obtained, wherein the target data is used to characterize the reply intent of the reply statement; if the target data has not been obtained, performing the step of extracting the target statement for each meme using a text recognition engine; if the target data has been obtained, inputting each meme into an intent recognition model to obtain a set of intent data for each meme, wherein the intent recognition model is trained by multiple sets of second training samples, each set of second training samples including a meme and a set of historical intent data; determining whether the set of intent data for the current meme contains the target data; if the set of intent data for the current meme contains the target data, performing the step of extracting the target statement for each meme using a text recognition engine; if the set of intent data for the current meme does not contain the target data, performing the step of extracting the target statement for each meme using a text recognition engine for other memes, wherein the other memes are memes in the meme database other than the current meme; Determine whether the matching value is greater than or equal to the matching value threshold; If the matching value is greater than or equal to the matching value threshold, the meme corresponding to the matching value is determined as a meme to be determined, and a set of memes to be determined is obtained. The meme with the largest matching value in the set of undetermined memes is determined as the target meme, and the target meme is used as the reply information to reply to the user. Before replying to the user with the target meme as a response message, the method further includes: Determine whether the target statement of the target meme is the same as the response statement; If the target statement of the target meme is different from the response statement, the target statement in the target meme is replaced with the response statement to obtain an updated target meme. Based on the updated target meme, the step of replying to the user with the target meme as the response information is executed. The updated target meme is generated automatically by the meme generation library. If the target statement of the target meme is the same as the response statement, the step of replying to the user with the target meme as the response information is executed; After determining whether the matching value is greater than or equal to the matching value threshold, the method further includes: If the matching value is less than the matching value threshold, it is determined whether the matching value of other memes with the reply statement is greater than or equal to the matching value threshold, wherein the other memes are memes in the meme database other than those whose matching value is less than the matching value threshold; If the matching value between all memes and the response statement is less than the matching value threshold, the response statement will be used as the response information to reply to the user.

2. The method according to claim 1, characterized in that, The target language recognition model is obtained in the following way: Obtain multiple historical reply statements from the chatbot's responses to users, and obtain the historical target statement and historical similarity corresponding to each historical reply statement; Each historical reply statement, the historical target statement corresponding to the historical reply statement, and the historical similarity are used as a first training sample to obtain the multiple sets of first training samples. The multiple sets of first training samples are input into the language recognition pre-training model for training to obtain the trained target language recognition model.

3. The method according to claim 1, characterized in that, The intent recognition model is obtained in the following way: Each meme in the meme database is retrieved, and a set of historical intent data for the meme is retrieved, wherein the historical intent data is the historical intent expressed when the meme was used; Each meme and the set of historical intent data are used as a set of second training samples to obtain the multiple sets of second training samples; The multiple sets of second training samples are input into the pre-trained dialogue generation model for training to obtain the trained intent recognition model.

4. A device for generating response information, characterized in that, include: The acquisition unit is used to acquire the chatbot's response to the user's statement, match the response with each meme in the meme database, and obtain the matching value between each meme and the response. The meme refers to an image containing text. The meme database stores memes in the form of triples, and each meme contains text, image and intent. The acquisition unit further includes: an extraction module, used to extract a target statement from each meme using a text recognition engine, wherein the target statement is the text contained in the meme; an input module, used to input the target statement and the response statement into a target language recognition model to obtain the similarity between the target statement and the response statement, wherein the target language recognition model is trained by multiple sets of first training samples, each set of first training samples including a historical target statement, a historical response statement, and a historical similarity; and a determination module, used to determine the similarity as the matching value between the meme and the response statement. The device further includes: a second judgment unit, configured to determine whether target data of the chatbot's reply to the user's statement has been obtained, wherein the target data is used to characterize the reply intent of the reply statement; a first execution unit, configured to execute the step of extracting the target statement from each meme using a text recognition engine when the target data has not been obtained; an input unit, configured to input each meme into an intent recognition model when the target data has been obtained, to obtain a set of intent data for each meme, wherein the intent recognition model is trained by multiple sets of second training samples, each set of second training samples including a meme and a set of historical intent data; a third judgment unit, configured to determine whether the set of intent data for the current meme contains the target data; a second execution unit, configured to execute the step of extracting the target statement from each meme using a text recognition engine when the set of intent data for the current meme contains the target data; and a third execution unit, configured to execute the step of extracting the target statement from each meme using a text recognition engine for other memes when the set of intent data for the current meme does not contain the target data, wherein the other memes are memes in the meme database other than the current meme. The first judgment unit is used to determine whether the matching value is greater than or equal to the matching value threshold. The first determining unit is configured to determine the meme corresponding to the matching value as a meme to be determined when the matching value is greater than or equal to the matching value threshold, thereby obtaining a set of memes to be determined. The second determining unit is used to determine the undetermined meme corresponding to the largest matching value in the set of undetermined memes as the target meme, and to reply to the user with the target meme as reply information; The device further includes: a fourth judgment unit, used to judge whether the target statement of the target meme is the same as the reply statement; a replacement unit, used to replace the target statement in the target meme with the reply statement when the target statement of the target meme is different from the reply statement, to obtain an updated target meme, and to perform the step of replying to the user with the target meme as reply information based on the updated target meme, wherein the updated target meme is generated automatically by a meme generation library; and a fourth execution unit, used to perform the step of replying to the user with the target meme as reply information when the target statement of the target meme is the same as the reply statement. The device further includes: a fifth judgment unit, used to determine whether the matching value of other memes and the reply statement is greater than or equal to the matching value threshold when the matching value is less than the matching value threshold, wherein other memes are memes in the meme database other than those whose matching value is less than the matching value threshold; and a reply unit, used to reply to the user as reply information when the matching value of all memes and the reply statement is less than the matching value threshold.

5. A non-volatile storage medium, characterized in that, The non-volatile storage medium includes a stored program, wherein when the program is executed, it controls the device where the non-volatile storage medium is located to perform the method for generating response information as described in any one of claims 1 to 3.

6. An electronic device, characterized in that, It includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the method for generating response information as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Question answering method, device and equipment and storage medium

    CN111506717A