Dialogue processing method, dialogue processing device, server and storage medium

By calculating the similarity and emotion recognition between user questions and preset questions, the reply strategy of the conversation robot is determined, and the problem of low matching between the reply content and the user's emotions is solved, and more accurate reply content output is achieved.

CN115422338BActive Publication Date: 2025-08-08CHINA CONSTRUCTION BANK +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211110955.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-13
Publication Date
2025-08-08
Estimated Expiration
2042-09-13

AI Technical Summary

Technical Problem

In the prior art, the dialogue robot cannot accurately identify the emotions in the conversation content currently issued by the user, resulting in a low degree of matching the reply content with the user's current emotions.

Method used

By calculating the similarity between user questions and preset questions, combining emotion recognition technology, we determine the response strategy identification of the user's current question, and select the most appropriate reply content to improve the matching degree.

Benefits of technology

Improve the matching degree between the reply content and the user's current emotions and enhance the accuracy of the reply content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115422338B_ABST
    Figure CN115422338B_ABST
Patent Text Reader

Abstract

The present application provides a conversation processing method, conversation processing device, server, and storage medium, relating to the fields of computer and internet technology. The conversation processing method comprises: obtaining conversation data; obtaining a preset question and multiple responses corresponding to the preset question; identifying and classifying the current user question and one or more previous conversations; determining a reply strategy identifier for the current user question; determining one of the multiple responses as the final response, and outputting the final response. The present application is used to accurately determine the emotion expressed in the user's current conversation, improve the accuracy of the response, and avoid the problem of poor matching between the response and the user's current emotion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer and Internet technology, and in particular to a dialogue processing method, a dialogue processing device, a server, and a storage medium. Background Art

[0002] To reduce user wait times and save labor costs, conversational robots are increasingly being used in various departments across various industries, such as customer service. These robots can provide tailored responses to user questions, resolving a wide range of basic customer issues.

[0003] Currently, in existing technologies, conversational robots first break down keywords in the conversation content sent by customers, then match the broken-down keywords with a pre-stored answer library and send it to the chat window to complete the answer. As user usage and user demand continue to increase, users' requirements for answer content are also becoming more and more sophisticated.

[0004] However, the inventors have discovered that the existing technology has at least the following technical problems: when the conversational robot cannot accurately identify the emotions expressed in the current conversation content of the user, it will send the reply content matched by the keyword directly to the chat window to complete the answer to the question. This may lead to a low match between the reply content and the user's current emotions due to inaccurate reply content. Summary of the Invention

[0005] The present application provides a conversation processing method, a conversation processing device, a server and a storage medium for accurately judging the emotions expressed in the conversation content currently sent by the user, improving the accuracy of the reply content, and avoiding the problem of poor matching between the reply content and the user's current emotions.

[0006] In a first aspect, the present application provides a method, comprising:

[0007] Acquire conversation data, including multiple rounds of conversation content and current user questions;

[0008] Calculating the similarity between the current user question and the preset question;

[0009] If it is determined that the similarity is greater than or equal to a preset value, obtaining the preset question and a plurality of answer contents corresponding to the preset question, wherein each answer content corresponds to a reply strategy identifier;

[0010] Identifying and classifying the current user question and one or more rounds of conversation content preceding the current user question, determining the emotion expressed by the current user question as a first emotion identifier, and determining the emotion expressed by one or more rounds of conversation content preceding the current user question as a second emotion identifier, wherein the first emotion identifier and the second emotion identifier are both elements of a preset emotion identifier set;

[0011] Determining a reply strategy identifier for the current user question based on the first emotion identifier and the second emotion identifier;

[0012] According to the reply strategy identifier, one of the multiple reply contents is determined as the final reply content, and the final reply content is output.

[0013] In a possible implementation, calculating the similarity between the current user question and the preset question includes:

[0014] Obtaining a first vector set corresponding to the preset question, and vectorizing the current user question to obtain a second vector set corresponding to the current user question;

[0015] Substitute the second vector set and each of the first vector sets into a similarity algorithm to obtain the similarity between the second vector set and each of the first vector sets.

[0016] In a possible implementation, determining the reply strategy identifier for the current user question based on the first emotion identifier and the second emotion identifier includes:

[0017] Determining a response strategy index identifier in a preset emotion identifier table according to the first emotion identifier and the second emotion identifier;

[0018] According to the reply strategy index identifier, a corresponding reply strategy identifier is obtained from a correspondence between preset emotion identifiers and reply strategy identifiers.

[0019] In a possible implementation, after obtaining the preset question and a plurality of answers corresponding to the preset question if it is determined that the similarity is greater than or equal to a preset value, the method further includes:

[0020] If it is determined that one or more rounds of dialogue content before the current user question do not exist, the preset default emotion identifier is stored as the second emotion identifier, wherein the preset default emotion identifier is an element in the preset emotion identifier set.

[0021] In a possible implementation, outputting the final reply content includes:

[0022] Get the preset typing speed;

[0023] Determining the duration of the final reply content according to the preset typing speed and the text length of the final reply content;

[0024] The final reply content is output according to the reply duration.

[0025] In a possible implementation, the calculation formula used to determine the response time of the final response content is:

[0026] t=len÷v

[0027] In the formula, t is the response time of the final response content, len is the text length of the final response content, and v is the preset typing speed of the final response content.

[0028] In a second aspect, the present application provides a conversation processing device, comprising:

[0029] An acquisition module is used to acquire conversation data, wherein the conversation data includes the contents of multiple rounds of conversations and the current user question;

[0030] A calculation module, used to calculate the similarity between the current user question and the preset question;

[0031] a judgment module, configured to judge whether the similarity is greater than or equal to a preset value, and if so, obtain the preset question and a plurality of answer contents corresponding to the preset question, wherein each answer content corresponds to a response strategy identifier;

[0032] a sentiment analysis module, configured to identify and classify the current user question and one or more rounds of conversation content preceding the current user question, determine the emotion expressed by the current user question as a first emotion identifier, and determine the emotion expressed by one or more rounds of conversation content preceding the current user question as a second emotion identifier, wherein the first emotion identifier and the second emotion identifier both belong to a preset emotion identifier set;

[0033] A reply control module, configured to determine a reply strategy identifier for the current user question based on the first emotion identifier and the second emotion identifier;

[0034] The reply control module is further configured to determine, according to the reply strategy identifier, one of the multiple reply contents as the final reply content, and output the final reply content.

[0035] In a third aspect, the present application provides a server, comprising: at least one processor and a memory;

[0036] The memory stores computer-executable instructions;

[0037] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the dialog processing method as described in the first aspect.

[0038] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer-executed instruction. When a processor executes the computer-executed instruction, the dialogue processing method described in the first aspect is implemented.

[0039] In a fifth aspect, the present application provides a computer program product, comprising a computer program, which, when executed by a processor, implements the dialogue processing method as described in the first aspect.

[0040] The conversation processing method, conversation processing device, server, and storage medium provided in this application first calculate the similarity between the current user question and a preset question in the acquired conversation data, then determine the difference between the similarity and a preset value. If the similarity is greater than or equal to the preset value, the preset question and the multiple responses corresponding to the preset question are found, and each response is assigned a response strategy identifier. This first obtains responses under multiple response strategies, avoiding the blind selection of a single response that could result in inaccurate responses. The current user question and one or more previous conversation rounds are then identified and classified to determine a first emotion identifier and a second emotion identifier. A response strategy identifier for the current user question is then obtained. One of the multiple responses is then determined as the final response, and the final response is output. This improves the response's match with the emotion of the user when the current user question was asked, thereby improving the accuracy of the response. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0042] Figure 1 A schematic diagram of an application scenario of the conversation processing method provided in an embodiment of the present application;

[0043] Figure 2 A flowchart of a conversation processing method provided in an embodiment of the present application;

[0044] Figure 3 A schematic diagram of the structure of a conversation processing device provided in an embodiment of the present application;

[0045] Figure 4A schematic diagram of the hardware results of the server is provided for the embodiment of the present application. DETAILED DESCRIPTION

[0046] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0047] Currently, conversational robots are increasingly being used in various departments across various industries, such as customer service. They can provide tailored responses to user questions, solving a wide range of basic customer issues. However, as the user base and user needs continue to grow, conversational robots' formulaic and blunt responses have become increasingly criticized, with some even providing irrelevant answers. Therefore, improving the accuracy of responses remains a challenge for current conversational robots. In existing technology, conversational robots first analyze keywords from incoming customer conversations. They then match these keywords to a pre-stored answer database and send the response to the chat window to complete the answer. The inventors have discovered that existing conversational robots, because they cannot accurately determine the user's current mood based on the conversation content, tend to directly send the response matched by keywords to the chat window to complete the answer. This leads to inaccurate responses and poor matching of the response to the user's current mood.

[0048] To solve the above technical problems, the embodiments of the present application provide the following technical solutions: First, the received user question is converted into a vector set, and then the similarity between the vector set and the vector set of standard questions in the question library is calculated. Based on the similarity, the standard questions in the question library are obtained. Each standard question has preset responses with multiple emotions. The user's conversation content in the current and previous rounds is then identified and classified to determine the emotion expressed in the user's conversation content in the current round, and an emotion identifier is set and the emotion identifier category to which the emotion expressed in the user's conversation content in the current round belongs is determined. Finally, the appropriate reply content is selected based on the emotion identifier category. This ensures that the reply content matches the user's current emotion to a high degree, thereby improving the accuracy of the reply.

[0049] Figure 1 A schematic diagram of an application scenario of the dialogue processing method provided in the embodiment of the present application, such as Figure 1 As shown, it includes: a terminal 101 and a server 102.

[0050] The terminal 101 is used for users to input and view conversation information, and the server 102 is used for receiving conversation information transmitted from the cloud, other servers or mobile terminals, and performing conversation interaction.

[0051] Figure 2 A flow chart of the dialogue processing method provided in the embodiment of the present application is shown as follows: Figure 2 As shown, the execution subject of the embodiment of the present application may be Figure 1 The server 102 in the illustrated embodiment may also be other computer-related devices, and the embodiment of the present application does not impose any particular limitation on this.

[0052] like Figure 2 As shown, the dialogue processing method includes the following steps:

[0053] S201: Acquire conversation data, which includes multiple rounds of conversation content and current user questions.

[0054] In this embodiment, the conversation data is the text information data or the reply content input by the user. A conversation round includes at least one sentence of conversation sent by the user and one reply content. The current user question is the question raised by the user in the current round that needs to be answered.

[0055] For example, the first round of conversation in the session data is "Hello, please help me check product No. 1" and "OK, please wait a moment", and the second round of conversation is "I have taken the order, when will it be shipped?". At this time, the current user question is "When will it be shipped?"

[0056] S202: Calculate the similarity between the current user question and the preset question.

[0057] In this embodiment, the preset questions are pre-stored standard questions. These standard questions may be questions from a frequently collected FAQ (Frequently Asked Questions), such as "When will the product be shipped?" In this embodiment, the similarity may be the number of identical characters, the number of identical vectors, or the number of identical character codes between the current user's question and the preset questions.

[0058] Specifically, in an optional embodiment of the present application, calculating the similarity between the current question and the preset question includes:

[0059] S202a: Obtain a first vector set corresponding to a preset question, and vectorize the current user question to obtain a second vector set corresponding to the current user question.

[0060] In this embodiment, a vector set is a collection of multiple vectors that can express the semantic meaning of text. Vectorization can be based on statistical methods or neural network methods to convert the conversation content into a vector set. For example, the conversation content "I like to take the high-speed rail home" is segmented into "I, like, take, high-speed rail, go home". Substituting this segmented data into a bag-of-words model, the resulting vector set is [1, 1, 1, 1, 1, 0, 0, 0].

[0061] S202b: Substitute the second vector set and each first vector set into a similarity algorithm to obtain the similarity between the second vector set and each first vector set.

[0062] In this embodiment, the similarity algorithm may be a text similarity algorithm, and the text similarity algorithm may be a cosine similarity algorithm or a Hamming distance algorithm.

[0063] S203: If it is determined that the similarity is greater than or equal to a preset value, a preset question and a plurality of answer contents corresponding to the preset question are obtained, wherein each answer content corresponds to a reply strategy identifier.

[0064] In this embodiment, the preset value may be a pre-set and stored similarity value, such as 0.9, 0.95, or another similarity value that equates the preset question with the current user's question. The reply content is the text of the reply to the preset question. The reply strategy identifier may be a classification identifier for different emotions, such as soothing, normal, or playful.

[0065] For example, the current user question is "Why hasn't it been shipped yet?", and the preset question is "Why hasn't it been shipped yet?". After step S202, the similarity between the current user question and the preset question is 0.95, and the preset value is 0.9. The answer content and corresponding response strategy identifiers for the preset question "Why hasn't it been shipped yet?" are the following three:

[0066] 1. Comfort: Please don’t worry, I understand your feelings very well. The warehouse is very busy now, and the goods will usually be shipped about 1-3 days after placing the order.

[0067] 2. Normal: Usually after placing an order, we will fill out the express delivery form before 4:00 p.m. on the same day, and then ship the goods in order. Because there are a lot of express deliveries during the event, some areas may experience warehouse overflows. Please understand and wait patiently.

[0068] 3. Playful: Dear, we will arrange for your shipment as soon as possible. We will help you to rush it, and we also trouble you to wait patiently.

[0069] Regarding the three responses to the preset question "Why haven't the goods been shipped yet?" and the corresponding response strategy identifiers, the following will explain in detail how to choose a response strategy based on specific examples.

[0070] S204: Identify and classify the current user question and one or more rounds of conversation content before the current user question, determine the emotion expressed by the current user question as a first emotion identifier, and determine the emotion expressed by one or more rounds of conversation content before the current user question as a second emotion identifier, wherein the first emotion identifier and the second emotion identifier are both elements in a preset emotion identifier set.

[0071] In this embodiment, the identification and classification of conversation content or the current user question can be achieved using a pre-trained ERC (Emotion Recognition in Conversations) model. The preset emotion identifier set may include elements representing emotions such as anger, anxiety, normal, relaxed, and joyful, representing the semantic meaning of text characters. One or more rounds can be one, two, or three rounds. Multi-round conversation content refers to the number of rounds of conversation content between the previous user question and the current user question in the conversation data.

[0072] For example, if the previous user question was "Why hasn't it been shipped yet?", the emotion expressed in the current user question is determined to be normal. If the current user question is "It's been 10 days and it hasn't been shipped yet. What's going on? Give me an explanation," the first emotion is marked as normal. If the previous conversation before the current user question was "I'm so happy! I finally bought it and can't wait to get it," the second emotion is marked as joyful.

[0073] S205: Determine a reply strategy identifier for the current user question based on the first emotion identifier and the second emotion identifier.

[0074] In this embodiment, the method for determining the reply strategy identifier of the current user according to the first emotion identifier and the second emotion identifier may be a graph retrieval method.

[0075] Specifically, in an optional embodiment of the present application, step S205 includes:

[0076] Step A: Determine a reply strategy index identifier in a preset emotion identifier table according to the first emotion identifier and the second emotion identifier.

[0077] Step B: According to the reply strategy index identifier, a corresponding reply strategy identifier is obtained from the correspondence between the preset emotion identifier and the reply strategy identifier.

[0078] In this embodiment, Table 1 is a preset emotion identification table, in which a correspondence between preset cleaning identifications and reply strategy identifications is stored.

[0079]

[0080] Table 1

[0081] As shown in Table 1, the first column of the preset emotion identification table is the first emotion identification, the first row is the second emotion identification, and the data in the table are response strategy identifications. In this embodiment, the response strategy index identification is the row and column coordinates of the preset emotion table. The response strategy identification can be soothing, normal, or playful. For example, if the first emotion identification is normal and the second emotion identification is relaxed, the corresponding response strategy index identification is the fourth row and fifth column. Based on the response strategy index identification, the corresponding response strategy identification is playful.

[0082] S206: According to the reply strategy identifier, one of the multiple reply contents is determined as the final reply content, and the final reply content is output.

[0083] In this embodiment, a reply content can be selected from multiple reply contents based on the reply policy identifier. For example, the three reply policy identifiers and corresponding reply contents described in S203 are selected as the final reply content and output through server 102.

[0084] For example, when the reply strategy is marked as soothing, the corresponding reply content is "Please don't worry, I understand your feelings very well. The warehouse is very busy now, and the goods will usually be shipped about 1-3 days after placing the order."

[0085] In summary, the dialogue processing method provided by the embodiment of the present application first calculates the similarity between the current user question and the preset question in the acquired conversation data, and then determines the size of the similarity with the preset value. If the similarity is greater than or equal to the preset value, the preset question and the multiple reply contents corresponding to the preset question are found, and each reply content corresponds to a reply strategy identifier. In this way, the reply content under multiple reply strategies is first obtained to avoid blindly selecting a reply content and causing inaccurate reply content. Then, by identifying and classifying the current user question and one or more rounds of dialogue content before the current user question, the first emotion identifier and the second emotion identifier are determined, and then the reply strategy identifier for the current user question is obtained, and then one of the multiple reply contents is determined as the final reply content, and the final reply content is output, thereby improving the matching degree between the reply content and the emotion when the user asked the current user question, and improving the accuracy of the reply content.

[0086] At the same time, this implementation uses a vector set combined with a text similarity algorithm to derive the similarity between the current user question and the preset question, so that the similarity between the current user question and the preset question is more accurate, further providing a basis for obtaining and answering more accurate answer content for the current user question.

[0087] In an optional embodiment of the present application, after S203, the following steps are further included:

[0088] S207: If it is determined that one or more rounds of dialogue content before the current user question do not exist, then the preset default emotion identifier is stored as the second emotion identifier, wherein the preset default emotion identifier is an element in the preset emotion identifier set.

[0089] In this embodiment, one or more rounds of conversation content preceding the current user question do not exist, indicating that the current user question is the first round of conversation content in the session data. In this case, a preset default emotion identifier is stored as the second emotion identifier, where the preset default emotion identifier can be an element in a preset emotion identifier set, and the preset default emotion identifier can be normal.

[0090] For example, please continue to refer to Table 1. When the second emotion label is normal, if the first emotion label is anger or anxiety, the response strategy label is comforting; if the first emotion label is normal and relaxed, the response strategy label is normal; if the first emotion label is joyful, the response strategy label is playful.

[0091] In summary, by setting the preset default emotion identifier as the second emotion identifier, if the current user question is the content of the first round of dialogue, the accurate response strategy identifier can continue to be obtained according to the current first emotion identifier and the second emotion identifier, and then a more accurate response content can be obtained as the final response content.

[0092] In an optional embodiment of the present application, outputting the final reply content in S206 includes:

[0093] Step a: Get the preset typing speed.

[0094] Step b: Determine the response time of the final response content based on the preset typing speed and the text length of the final response content.

[0095] Step c: Output the final reply content according to the reply duration.

[0096] In this embodiment, the preset typing speed may be an average human typing speed calculated through big data collection. This average human typing speed may be approximately 80 words per minute or 1.33 words per second. The text length of the final reply is the number of characters in the maximum reply. In this embodiment, the reply duration is the time it takes to type all characters of the final reply using the average human typing speed.

[0097] Specifically, in an optional embodiment of the present application, the calculation formula used to determine the response time of the final response content in step b is:

[0098] t=len÷v

[0099] Where t is the response time of the final response content, len is the text length of the final response content, and v is the preset typing speed of the final response content.

[0100] For example, the final reply is "Please don't worry. I understand your feelings. The warehouse is very busy right now, and we usually ship within 1-3 days after placing the order." Len is 41 characters, and the preset typing speed is 1.33 words per second. Substituting len = 41 characters and v = 1.33 words per second into the calculation formula, the final reply duration t = 30.8271 seconds is calculated.

[0101] In summary, by obtaining the response duration based on the preset typing speed and the text length of the final response content, and then outputting the final response content according to the response duration, the degree of anthropomorphism in the dialogue processing process is improved.

[0102] Figure 3 A structural diagram of a dialogue processing device provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, the dialogue processing device includes: an acquisition module 31, a calculation module 32, a judgment module 33, a sentiment analysis module 34 and a reply module 35.

[0103] The acquisition module 31 is used to acquire conversation data, which includes the contents of multiple rounds of conversations and the current user's questions.

[0104] The calculation module 32 is used to calculate the similarity between the current user question and the preset question.

[0105] The judgment module 33 is used to judge whether the similarity is greater than or equal to a preset value. If so, a preset question and multiple answer contents corresponding to the preset question are obtained, wherein each answer content corresponds to a reply strategy identifier.

[0106] The emotion analysis module 34 is used to identify and classify the current user question and the content of one or more rounds of conversations before the current user question, determine the emotion expressed by the current user question as the first emotion identifier, and determine the emotion expressed by the content of one or more rounds of conversations before the current user question as the second emotion identifier, wherein the first emotion identifier and the second emotion identifier both belong to a preset emotion identifier set.

[0107] The reply control module 35 is configured to determine a reply strategy identifier for the current user question based on the first emotion identifier and the second emotion identifier. The reply control module 35 is further configured to determine one of the multiple reply contents as the final reply content based on the reply strategy identifier and output the final reply content.

[0108] The dialogue processing device provided in this embodiment can be used to execute the technical solution of the above-mentioned method embodiment. Its implementation principle and technical effects are similar and will not be described in detail in this embodiment.

[0109] In an optional embodiment of the present application, the acquisition module 31 is further configured to obtain a first vector set corresponding to a preset question, and vectorize the current user question to obtain a second vector set corresponding to the current user question. The calculation module 32 is further configured to substitute the second vector set and each first vector set into a similarity algorithm to obtain a similarity between the second vector set and each first vector set.

[0110] In an optional embodiment of the present application, the reply control module 35 is also used to determine the reply strategy index identifier in the preset emotion identifier table based on the first emotion identifier and the second emotion identifier, and obtain the corresponding reply strategy identifier from the correspondence between the preset emotion identifier and the reply strategy identifier based on the reply strategy index identifier.

[0111] In an optional embodiment of the present application, the judgment module 33 is also used to determine whether one or more rounds of conversation content before the current user question exist. If the judgment result is that it does not exist, the emotion analysis module 34 is also used to store the preset default emotion identifier as the second emotion identifier, wherein the preset default emotion identifier is an element in the preset emotion identifier set.

[0112] In an optional embodiment of the present application, the acquisition module 31 is further configured to acquire a preset typing speed. The calculation module 32 is further configured to determine the duration of the final reply based on the preset typing speed and the length of the final reply. The reply control module 35 is further configured to output the final reply according to the duration.

[0113] In an optional embodiment of the present application, the calculation module 32 is used to determine the reply time of the final reply content according to the preset typing speed and the text length of the final reply content, and the calculation formula used is:

[0114] t=len÷v

[0115] Where t is the response time of the final response content, len is the text length of the final response content, and v is the preset typing speed of the final response content.

[0116] Figure 4 A schematic diagram of the hardware results of the server is provided for the embodiment of the present application. The server can be a conversation robot, a host computer or a conversation software in a mobile terminal, such as Figure 4 As shown, the server includes: at least one processor 401 and a memory 402.

[0117] The processor 401 is used to store computer-executable instructions.

[0118] The memory 402 is configured to execute computer-executable instructions stored in the memory to implement the various steps involved in the above method embodiment. For details, please refer to the relevant description in the above method embodiment.

[0119] Optionally, the memory 402 may be independent or integrated with the processor 401 .

[0120] When the memory 402 is independently provided, the controller further includes a bus 403 for connecting the memory 402 and the processor 401 .

[0121] An embodiment of the present invention further provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the dialogue processing method provided in the above embodiment is implemented.

[0122] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the dialogue processing method provided in the above embodiment.

[0123] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules described above is merely a logical function division. In actual implementation, there may be other division methods, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interface, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0124] The modules described above as separate components may or may not be physically separate, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed across multiple network elements. Some or all of these modules may be selected to implement the solution of this embodiment according to actual needs.

[0125] In addition, the functional modules in various embodiments of the present invention may be integrated into a single processing unit, each module may exist physically separately, or two or more modules may be integrated into a single unit. The aforementioned modular units may be implemented in the form of hardware or hardware plus software functional units.

[0126] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform some steps of the method of each embodiment of the present application.

[0127] It should be understood that the processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), or application-specific integrated circuits (ASICs). A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the present invention may be directly implemented by a hardware processor or implemented by a combination of hardware and software modules in the processor.

[0128] The memory may include a high-speed RAM memory, and may also include non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk.

[0129] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. Buses can be categorized as address buses, data buses, and control buses. For ease of illustration, the buses in the drawings of this application are not limited to just one bus or just one type of bus.

[0130] The storage medium may be implemented by any type of volatile or non-volatile memory device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage medium may be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0131] An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and the storage medium can be located in an application-specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in an electronic device or a main control device.

[0132] Those skilled in the art will appreciate that all or part of the steps in the above-described method embodiments can be implemented using hardware associated with program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0133] In the technical solution of this application, the collection, storage, use, processing, transmission, provision and disclosure of information such as financial data or user data involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0134] The present invention is intended to illustrate the technical solution of the present application rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some or all of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solution from the scope of the technical solution of the embodiments of the present application.

Claims

1. A method for processing a conversation, characterized in that: include: Acquire conversation data, including multiple rounds of conversation content and current user questions; Calculating the similarity between the current user question and the preset question; If it is determined that the similarity is greater than or equal to a preset value, obtaining the preset question and a plurality of answer contents corresponding to the preset question, wherein each answer content corresponds to a reply strategy identifier; If it is determined that one or more rounds of conversation content before the current user question do not exist, storing a preset default emotion identifier as a second emotion identifier, wherein the preset default emotion identifier is an element in the preset emotion identifier set; Identifying and classifying the current user question and one or more rounds of conversation content preceding the current user question, determining the emotion expressed by the current user question as a first emotion identifier, and determining the emotion expressed by one or more rounds of conversation content preceding the current user question as a second emotion identifier, wherein the first emotion identifier and the second emotion identifier are both elements of a preset emotion identifier set; Determining a reply strategy identifier for the current user question based on the first emotion identifier and the second emotion identifier includes: determining a reply strategy index identifier in a preset emotion identifier table based on the first emotion identifier and the second emotion identifier; obtaining a corresponding reply strategy identifier from a correspondence between preset emotion identifiers and reply strategy identifiers based on the reply strategy index identifier; According to the reply strategy identifier, one of the multiple reply contents is determined as the final reply content, and the final reply content is output.

2. The method according to claim 1, characterized in that The calculating the similarity between the current user question and the preset question includes: Obtaining a first vector set corresponding to the preset question, and vectorizing the current user question to obtain a second vector set corresponding to the current user question; Substitute the second vector set and each of the first vector sets into a similarity algorithm to obtain the similarity between the second vector set and each of the first vector sets.

3. The method according to claim 1, characterized in that The final response content is output, including: Get the preset typing speed; Determining the duration of the final reply content according to the preset typing speed and the text length of the final reply content; The final reply content is output according to the reply duration.

4. The method according to claim 3, characterized in that The calculation formula used to determine the response time of the final response content is: t=len÷v In the formula, t is the response time of the final response content, len is the text length of the final response content, and v is the preset typing speed of the final response content.

5. A dialogue processing device, characterized in that: include: An acquisition module is used to acquire conversation data, wherein the conversation data includes the contents of multiple rounds of conversations and the current user question; A calculation module, used to calculate the similarity between the current user question and the preset question; a judgment module, configured to judge whether the similarity is greater than or equal to a preset value, and if so, obtain the preset question and a plurality of answer contents corresponding to the preset question, wherein each answer content corresponds to a response strategy identifier; The judgment module is further configured to store a preset default emotion identifier as a second emotion identifier if it is determined that one or more rounds of conversation content before the current user question do not exist, wherein the preset default emotion identifier is an element in the preset emotion identifier set; a sentiment analysis module, configured to identify and classify the current user question and one or more rounds of conversation content preceding the current user question, determine the emotion expressed by the current user question as a first emotion identifier, and determine the emotion expressed by one or more rounds of conversation content preceding the current user question as a second emotion identifier, wherein the first emotion identifier and the second emotion identifier both belong to a preset emotion identifier set; A reply control module, configured to determine a reply strategy identifier for the current user question based on the first emotion identifier and the second emotion identifier; The reply control module is specifically configured to: determine a reply strategy index identifier in a preset emotion identifier table according to the first emotion identifier and the second emotion identifier; and obtain a corresponding reply strategy identifier from a correspondence between preset emotion identifiers and reply strategy identifiers according to the reply strategy index identifier; The reply control module is further configured to determine, according to the reply strategy identifier, one of the multiple reply contents as the final reply content, and output the final reply content.

6. A server, characterized in that: include: at least one processor and memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the dialog processing method according to any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer-executable instruction. When a processor executes the computer-executable instruction, the dialogue processing method according to any one of claims 1 to 4 is implemented.

8. A computer program product, characterized in that The invention comprises a computer program, which implements the dialogue processing method according to any one of claims 1 to 4 when executed by a processor.