CN115473864B - Robot chatting method, computer device and storage medium - Google Patents

Robot chatting method, computer device and storage medium Download PDF

Info

Publication number
CN115473864B
CN115473864B CN202211360971.8A CN202211360971A CN115473864B CN 115473864 B CN115473864 B CN 115473864B CN 202211360971 A CN202211360971 A CN 202211360971A CN 115473864 B CN115473864 B CN 115473864B
Authority
CN
China
Prior art keywords
information
emotion
question
user
generation model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211360971.8A
Other languages
Chinese (zh)
Other versions
CN115473864A (en
Inventor
史文鑫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Bank Co Ltd
Original Assignee
Ping An Bank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Bank Co Ltd filed Critical Ping An Bank Co Ltd
Priority to CN202211360971.8A priority Critical patent/CN115473864B/en
Publication of CN115473864A publication Critical patent/CN115473864A/en
Application granted granted Critical
Publication of CN115473864B publication Critical patent/CN115473864B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/02User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail using automatic reactions or user delegation, e.g. automatic replies or chatbot-generated messages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/284Lexical analysis, e.g. tokenisation or collocates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis

Abstract

The application discloses a robot chat method, computer equipment and storage medium, wherein the method comprises the following steps: receiving information input by a user and judging the type of the information; responding to the type of the information to be matched with a preset question-answer generation model, and acquiring emotion information and/or theme information in the information through the question-answer generation model; and returning a reply corresponding to the information to the user based on the emotion information and/or the theme information. According to the method and the device, the emotion interaction of the robot in chatting with the user is improved, the communication efficiency of the robot and the user is improved, and the chatting experience of the user is improved.

Description

Robot chatting method, computer device and storage medium
Technical Field
The application relates to the technical field of finance, in particular to a robot chatting method, computer equipment and a storage medium.
Background
Man-machine conversation has been one of the important research directions in the field of natural language processing, and intelligent customer service has been widely used and has received a great deal of attention. In the related art, intelligent customer service mainly uses a FAQ (knowledge base) -based question-answering system, but the replies outputted by the intelligent customer service lack diversity. Moreover, the intelligent customer service based on the FAQ question answering system is harder and has no emotion color when replying to the user problem, and the experience of the user is affected.
Disclosure of Invention
In view of this, the present application provides a robot chat method, a computer device and a storage medium, so as to solve the problems of lack of diversity, hardness in reply and lack of emotion color in the prior art.
In order to solve the technical problem, the first technical scheme provided by the application is as follows: provided is a robot chatting method, including: receiving information input by a user and judging the type of the information; responding to the type of the information to be matched with a preset question-answer generation model, and acquiring emotion information and/or theme information in the information through the question-answer generation model; and returning a reply corresponding to the information to the user based on the emotion information and/or the theme information.
Optionally, if the type of the information is matched with a preset question-answer generation model, acquiring emotion information and/or topic information in the information through the question-answer generation model, including: acquiring the emotion information and/or the topic information in the information, and judging whether the emotion information and/or the topic information are matched with the emotion information and/or the topic information preset in the question-answer generation model; wherein the affective information includes positive and negative emotions, and the subject information includes music, sports, movies, life, education, work, travel, medical, or financial; and responding to the judgment result to be matched, and generating replies corresponding to the emotion information and/or the theme information through the question and answer generation model.
Optionally, if the type of the information is matched with a preset question-answer generation model, the emotion information and/or the topic information in the information is obtained through the question-answer generation model, and the method further includes: responding to the judgment result as mismatch; or, in response to the question-answer generation model not storing the affective information and/or the topic information in the information; and returning a first reply strategy to the user.
Optionally, the responding to the judging result is matching includes: extracting an intermediate semantic vector from the information to decode the information; supplementing the emotion information and/or the topic information to the decoding process; analyzing the information input by the user and the emotion thereof through the intermediate semantic vector, the emotion information and/or the theme information so as to obtain the meaning of the information; and replying to the user based on the meaning of the information.
Optionally, before obtaining the meaning of the information, the method includes: introducing an attention mechanism to trace back the information; performing word decomposition on the information, and giving different weights to each word according to the importance of each word to decoding at the current moment; acquiring the probability of each word in the information in an output layer through the decoding process; outputting the meaning of the information.
Optionally, said extracting an intermediate semantic vector from said information decodes said information, including: inputting the information into the question-answer generation model to obtain a digital matrix corresponding to the information; calculating the digital matrix to obtain a digital result corresponding to the information; converting the digital result into text information through the question-answer generation model; and outputting the text information.
Optionally, the receiving the information input by the user and judging the type of the information include: responding to the type of the information as a question-answer type, and calling a knowledge base to provide replies corresponding to the information for the user; and in response to the type of the information being open or having emotion tendencies, invoking the question-answer generation model to identify the information so as to obtain the emotion information and/or the theme information of the information.
Optionally, the returning a reply corresponding to the information to the user based on the emotion information and/or the topic information includes: responding to the emotion information as the positive emotion, and returning a reply matched with the positive emotion to the user; and responding to the emotion information as a negative emotion, and returning a reply matched with the negative emotion to the user so as to placebo the user.
In order to solve the technical problem, the second technical scheme provided by the application is as follows: there is provided a computer device comprising: a processor and a memory, the memory being coupled to the processor for storing a computer program executable on the processor; wherein the processor, when executing the computer program, implements the method of any of the above.
In order to solve the technical problem, a third technical scheme provided by the application is as follows: there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of any of the above.
The beneficial effects of this application: compared with the prior art, the robot chat method is characterized in that emotion information and/or theme information of information input by a user is judged through a question-answer generation model, and then a reply corresponding to the information input by the user is returned to the user based on the emotion information and/or theme information. The problem that the replies of the existing intelligent customer service lack of diversity and emotion colors can be solved, so that the replies of the intelligent customer service integrate the theme information and emotion information of the user, emotion interaction of the robot in chatting with the user is greatly improved, communication efficiency of the robot and the user is improved, and chatting experience of the user is also improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a block diagram of the overall flow of a robot chat method provided in an embodiment of the present application;
FIG. 2 is a flow chart of sub-steps of step S1 provided by an embodiment of the present application;
FIG. 3 is a flow chart of sub-steps of step S2 provided by an embodiment of the present application;
FIG. 4 is a flow chart of the sub-steps of step S22 provided by an embodiment of the present application;
FIG. 5 is a flow chart of the sub-steps of step S221 provided by an embodiment of the present application;
FIG. 6 is a schematic block diagram of decoding information to extract an intermediate semantic vector according to one embodiment of the present application;
FIG. 7 is a flow chart of sub-steps of step S223 provided by an embodiment of the present application;
FIG. 8 is a block diagram of an attention mechanism model of the Seq2Seq model provided by an embodiment of the present application;
FIG. 9 is a flow chart of the sub-steps of step S3 provided by an embodiment of the present application;
FIG. 10 is a schematic diagram of chat interactions between a user and a bot provided in an embodiment of the present application;
FIG. 11 is a block diagram schematically illustrating the structure of an electronic device according to an embodiment of the present application;
fig. 12 is a schematic block diagram of a computer-readable storage medium according to an embodiment of the present application.
Detailed Description
The following description of the technical solutions in the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The terms "first," "second," and the like, herein are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "first", "second", or "first" may include at least one such feature, either explicitly or implicitly. All directional indications (such as up, down, left, right, front, back … …) in the embodiments of the present application are merely used to explain the relative positional relationship, movement, etc. between the components in a particular gesture (as shown in the drawings), and if the particular gesture changes, the directional indication changes accordingly. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
If the technical scheme of the application relates to personal information, the product applying the technical scheme of the application clearly informs the personal information processing rule before processing the personal information, and obtains independent consent of the individual. If the technical scheme of the application relates to sensitive personal information, the product applying the technical scheme of the application obtains individual consent before processing the sensitive personal information, and simultaneously meets the requirement of 'explicit consent'. For example, a clear and remarkable mark is set at a personal information acquisition device such as a camera to inform that the personal information acquisition range is entered, personal information is acquired, and if the personal voluntarily enters the acquisition range, the personal information is considered as consent to be acquired; or on the device for processing the personal information, under the condition that obvious identification/information is utilized to inform the personal information processing rule, personal authorization is obtained by popup information or a person is requested to upload personal information and the like; the personal information processing rule may include information such as a personal information processor, a personal information processing purpose, a processing mode, and a processing personal information type.
Man-machine conversation has been one of the important research directions in the field of natural language processing, and intelligent customer service has been widely used in banking, online shopping and other financial technologies, so that a plurality of business lines have been paid attention to. The intelligent customer service system aims at solving the condition that a large amount of manpower is required in the traditional customer service mode, and in recent years, with the progress of man-machine interaction technology, a dialogue system is gradually applied to practical application, and people hope that the intelligent customer service can provide higher service quality when aiming at special problems or special users while saving manpower.
The inventors of the present application found that: currently, banks mainly use FAQ (knowledge base) -based question-answering systems, but the replies output by them lack diversity. Moreover, the intelligent customer service based on the FAQ question answering system is harder and has no emotion color when replying to the user problem, and the experience of the user is affected.
In order to solve the problems, the application provides a robot chat method, a computer device and a storage medium.
For dialog-generating tasks, the most common approach in the field in recent years is the cyclic neural network (RNN) based Seq2Seq model. The Seq2Seq model is generally composed of two parts: the first part is an Encoder part, which is used for representing an input sequence with the length of N and is an original sequence; the second part is a Decoder part for mapping the representation extracted by the Encoder to an output M-length sequence, which is the target sequence. In the dialogue generation task, the user problem is the original sequence, and the reply content is the target sequence.
In the chat function, the robot chat method embeds the seq2seq model into the emotion information and the theme information, so that more diversified replies can be provided, the replies have emotion colors, and the user experience can be improved. The robot generating the model learns how to simulate the human dialogue by utilizing a large amount of paired question-answer data, and can generate corresponding replies aiming at different topics, and even the content which does not appear in the human dialogue corpus training the model can generate the corresponding replies. Thus, based on the generative model, the user can complete a conversation with the bot for any topic content of interest to the user. The method aims at generating replies for users by using a generating method in the chat process, and increasing emotion information for the replies generated by the model, so that the emotion richness of robot chat is improved.
Referring to fig. 1 and 2, fig. 1 is an overall flow chart of a robot chat method according to an embodiment of the present application, and fig. 2 is a flow chart of a sub-step of step S1 according to an embodiment of the present application.
The robot chatting method provided by the application comprises the following steps:
s1: and receiving information input by a user and judging the type of the information.
Specifically, in an application scenario of a certain man-machine conversation, for example, a user consults a bank's online customer service on a bank APP. The user inputs a section of text information, the information is sent to the intelligent customer service system of the bank, and the intelligent customer service is automatically docked with the customer at first. The intelligent customer service system carries out preliminary judgment on information input by a user through the central control platform so as to judge whether the information input by the user is a knowledge question-answering type problem or an open type problem or a problem with emotion tendency and the like. The knowledge question-and-answer type question can be understood that the user consults a certain function and service of the bank, and then the FAQ of the bank can be called to automatically answer the function and service. An open question may be understood as a question with no fixed answer, and no answer to the relevant question in the FAQ of the bank. The problem with emotion tendencies can be understood as a problem that a user has emotion colors, such as a problem that the user is dissatisfied with a certain function, service, etc., and expresses an emotion such as dissatisfaction, anger, etc.
In one embodiment, the step S1 of receiving information input by a user and determining the type of the information includes:
S11: and in response to the type of the information being a question-answer type, invoking a knowledge base to provide replies corresponding to the information for the user.
Specifically, after determining the specific type of information input by the user, various answer strategies in the bank/enterprise can be invoked to answer the question for the user. After the central control platform judges the information input by the user to be a question-answer type, the FAQ is correspondingly called to provide corresponding answers for the user. For example, a user asks: how the bank card without the open bank performs the online payment. The FAQ may invoke the relevant answer to provide the user with a reply: the online payment can be carried out through the function of the Unionpay online payment, and the online payment can be carried out only by the card number and the password, so that the online payment is convenient, and the online payment is supported by both a deposit card and a credit card. Of course, the user may be further replied to: and the function of the Unionpay online payment is that each user pays 2000 yuan for a single payment limit, 5000 yuan for a single day and the like, so that the user can pay reasonably according to the payment limit during payment. Of course, where the user does not understand the response to the FAQ, the user may continue to ask, and generally, the response to the question is set in the FAQ.
S12: and in response to the type of the information being open or having emotion tendencies, invoking a question-answer generation model to identify the information so as to obtain emotion information and/or theme information of the information.
In particular, when a question of a user is not a question-and-answer type, but an open question or a question with emotional tendency, since there is no fixed answer and the user may be in a state of being angry at this time, it is important for the user to reply and emotion pacify. At this time, firstly, a question and answer generation model is called from a plurality of answer strategies of the intelligent customer service system to identify user input information so as to judge emotion information of a user and/or topic information corresponding to a problem presented by the user. The affective information can include positive and negative emotions, such as happy, difficult, disappointed or excited, etc. The subject information may include music, sports, movies, life, education, work, travel, medical or financial, etc. Thus, corresponding emotion information and/or theme information references are provided for subsequent replies, and more accurate and emotional replies are provided for users.
S2: and responding to the matching of the type of the information and a preset question-answer generation model, and acquiring emotion information and/or theme information in the information through the question-answer generation model.
Specifically, as shown in fig. 10, the question-answer generation model in the present application is mainly used for replying to the open problem or the problem with emotion tendency of the user, and when the central control platform determines that the information type input by the user is matched with the information type corresponding to the question-answer generation model preset in the present application, the question-answer generation model in the present application is called to determine emotion information and/or topic information in the information input by the user.
For example, if a user proposes that a certain function in a bank APP is not good, a subject related to information cannot be focused, or a question is not in a main business of a bank/enterprise, a question and answer generation model is called to judge the subject of the information or the emotion of the user, and a section of speech answer is generated in a targeted manner to the user. Such as: the small major first generates qi and we will improve continuously afterwards. There is also a spam response if the question robot presented by the user is not answered, for example: the problem is also not clear to me, i are also in learning. Or inputting strategies such as manual customer service conversion and the like.
It can be understood that if the information type input by the user is not matched with the information type corresponding to the question-answer generation model preset in the application, the question-answer generation model is not called, and other strategies in the intelligent customer service system, such as FAQ, calling online customer service and the like, are called. It can be understood that up to several tens of reply strategies are stored in the intelligent customer service system, and the question-answer generation model is only one of the reply strategies.
Referring to fig. 3, fig. 3 is a flow chart of the substeps of step S2 according to an embodiment of the present application.
In an embodiment, in response to the type of the information being matched with the preset question-answer generation model, the step S2 of obtaining emotion information and/or topic information in the information through the question-answer generation model may include:
s21: and acquiring emotion information and/or topic information in the information, and judging whether the emotion information and/or topic information are matched with emotion information and/or topic information preset in the question-answer generation model.
Specifically, it can be understood that before judging whether the emotion information and/or the topic information of the information input by the user are matched with the emotion information and/or the topic information in the question-answer generation model preset in the application, the emotion information and/or the topic information in the information input by the user should be acquired first. That is, it is first grasped what emotion the user is in the current state, for example, happy, hard, or angry. And judging whether the emotion information and/or the theme information of the user can be matched with the emotion information and/or the theme information preset in the question-answer generation model.
S22: and responding to the judgment result as matching, and generating replies corresponding to the emotion information and/or the theme information through a question and answer generation model.
Specifically, if the judgment result is that the emotion information and/or the topic information of the user are matched with the emotion information and/or the topic information preset in the question-answer generation model, the question-answer generation model of the application can generate a reply matched with the information input by the user. Therefore, after the judgment result is that the user is matched, the corresponding reply with emotion can be generated directly through the question-answer generation model.
Referring to fig. 4 to 6, fig. 4 is a flow chart of the substeps of step S22 provided in an embodiment of the present application, fig. 5 is a flow chart of the substeps of step S221 provided in an embodiment of the present application, and fig. 6 is a schematic block diagram of decoding an intermediate semantic vector extracted from information provided in an embodiment of the present application.
Further, the step S22 of responding to the determination result as matching includes:
s221: an intermediate semantic vector is extracted from the information to decode the information.
Specifically, as shown in fig. 6, before the information input by the user is determined, the text information input by the user is first "transcoded", because generally, the robot cannot directly recognize the text, but can only recognize the encoded information corresponding to the text information. Therefore, it is necessary to extract an intermediate semantic vector for the information inputted by the user to perform decoding of the information.
Specifically, the step S221 of extracting an intermediate semantic vector from the information to decode the information includes:
s2211: inputting the information into a question-answer generation model to obtain a digital matrix corresponding to the information.
Specifically, firstly inputting information input by a user into the question-answer generation model, generating a digital matrix which can be identified by the question-answer generation model through a Seq2Seq model, and representing the information input by the user by using the digital matrix. And establishing a mapping relation between the text information and the numbers through a Seq2Seq model, so that the text information is converted into a number matrix which can be identified by a question-answer generation model. It can be understood that the text input by the user is the source sequence, the reply of the robot to the user is the target sequence, and the number corresponding to the text information is the intermediate semantic vector based on the mapping relation of the conversion between the text information and the number.
S2212: and calculating the digital matrix to obtain a digital result corresponding to the information.
Specifically, the digital matrix formed by converting the text information is calculated, and the calculated logic and algorithm are based on the Seq2Seq model, for example, the functional relation:
Figure 986412DEST_PATH_IMAGE001
wherein x represents input text information, y represents output text information, t is time corresponding to the text information, and output text corresponding to the input text information can be calculated by the formula. For specific function calculation procedures, reference may be made to the function calculation procedure of the Seq2Seq model, which is not described in detail herein.
S2213: and converting the digital result into text information through a question-answer generation model.
Specifically, the result calculated by the digital matrix is converted into text information through a question-answer generation model, so that the content which can be understood by a user is output.
S2214: and outputting the text information.
Specifically, the text generated by the question-answer generation model is directly output to the user as a reply corresponding to the information input by the user.
S222: the decoding process is supplemented with affective information and/or theme information.
Specifically, in the traditional Seq2Seq model, the text information obtained by directly decoding the Seq2Seq model is a rigid reply without emotion, so that a user obviously feels chatting with a machine without emotion, and the experience of the user is affected. Therefore, as shown in fig. 6, the emotion information and/or topic information corresponding to the information input by the user and obtained by the question and answer generation model are added as supplementary information in the process of decoding the information input by the user, so that the replies obtained after decoding are more rich in emotion colors.
S223: analyzing information and emotion input by a user through the intermediate semantic vector, emotion information and/or theme information to obtain meaning of the information;
Specifically, the meaning of text information input by a user is obtained by comprehensively analyzing the information input by the user and the emotion of the user attached to the information through an intermediate semantic vector obtained by converting the information input by the user and emotion information and/or theme information obtained through a question-answer generation model.
Referring to fig. 7 and 8, fig. 7 is a flow chart illustrating a sub-step of step S223 provided in an embodiment of the present application, and fig. 8 is a diagram illustrating an attention mechanism model of the Seq2Seq model provided in an embodiment of the present application.
Optionally, before the step S223 of obtaining the meaning of the information, it may include:
s2230: the attention introducing mechanism backtracks the information.
In particular, the Seq2Seq model, while capable of producing good results in conversations, is prone to producing meaningless safety replies. The reason is that the decoder in the Seq2Seq model only receives the last state output of the encoder, and this mechanism does not work well for source sequences that deal with long-term dependencies. Because the state memory of the decoder gradually weakens and even loses the information of the source sequence along with the continuous generation of new words, a certain difference exists between the finally obtained target sequence and the source sequence, and the decoding accuracy is affected. Thus, one effective way to alleviate this problem is to introduce a mechanism of attention.
The attention mechanism adopts a backtracking strategy to link each time step of the current decoding stage with the context of the text information of the encoding stage so as to avoid the situation that the source sequence information is gradually lost in the decoding process.
S2231: the information is word decomposed and each word is given a different weight according to the importance of each word to the decoding of the current time.
Specifically, because each word in the source sequence has an effect on each time step in the decoding process, the attention mechanism can give different weights to each word according to the importance of the word, and some words have larger contributions to the word decoded at the current moment and some have smaller contributions, so that giving different weights to each word can provide more accurate reference for the output layer. A block diagram of the attention mechanism model used in the present embodiment is shown in fig. 8.
S2232: the probability of each word in the information at the output layer is obtained through the decoding process.
Specifically, in the frame of the Seq2Seq model that introduces the attention mechanism, the embodiment can obtain the probability of each word at the output layer by giving different weights to each word, so that the output layer of the decoder predicts the probability of the word according to the input, and the robot can output more accurate and richer emotion color for the reply of the user. The objective function of the training process of the attention mechanism and the search strategy in the prediction process are consistent with the conventional RNN, and will not be described here.
S2233: the meaning of the output information.
Specifically, after the information input by the user is traced back according to the attention mechanism, the meaning of the more accurate information is obtained, and the meaning is output.
S224: the user is replied to based on the meaning of the information.
Specifically, after the more accurate and more emotional information meaning is obtained, the question-answer generation model can provide answer content for the user based on the information meaning.
Exemplary: user input: you can be truly stupid.
Reply 1. Owner does not like me, and the small security (robot name) is good to principal.
Reply 2, let you not get happy.
In an embodiment, in response to the type of the information being matched with the preset question-answer generation model, the step S2 of obtaining emotion information and/or topic information in the information through the question-answer generation model may further include:
s23: responding to the judgment result as mismatch; or, responding to the emotion information and/or topic information in the non-stored information of the question-answer generation model;
in particular, it can be appreciated that in actual communication with intelligent customer service, sometimes the user's problem may be ambiguous and the emotion information may be ambiguous, and then it may not be possible to match the emotion information and/or topic information stored in the question-answer generation model. Or, the emotion and topic information carried in the information input by the user is sometimes too complex, and emotion information and/or topic information matched with the emotion and topic information is not stored in the question-answer generation model, so that the result of judging the emotion information and/or topic information in the question-answer generation model and the information input by the user is also not matched.
S24: a first reply policy is returned to the user.
Specifically, when the judgment result is that the first answer strategy is not matched, the intelligent customer service system replies to the user by adopting the preset first answer strategy. The first reply policy may include a display box for directly displaying "enter manual service", or may output: the owner, the problem is that the mind is not in the middle of learning.
S3: and returning a reply corresponding to the information to the user based on the emotion information and/or the theme information.
Specifically, the replies of the method are from a corpus which carries out model training on a question-answer generation model and is arranged in advance. Because the cost of arranging the corpus is high, the method collects some open chat corpora and adds the operation data of the online users of the security robot. In order to save labor cost, text cluster analysis is carried out on all user problems, and after a cluster result is obtained, a most representative sample is extracted from each cluster aiming at high-frequency clusters with more samples in the clusters. Aiming at representative samples of the high-frequency clusters, answers are written by operating annotators and topic information and emotion information are annotated, wherein each question is written by a plurality of annotators so as to increase the diversity of the answers, then the answers are finally collected uniformly and checked on a corpus, and after unreasonable answers are removed or modified, the answers are saved as final knowledge data and are used as a knowledge base for chat questions and answers based on knowledge questions and answers. In addition, the set of high-frequency question reflux and answer labeling flow mechanism can be used for constructing the initial knowledge data of the question-answer generation model, can also be used for regularly refluxing unresolved question data after the capacity is online, and is also applicable to the data supplementing process. The final training corpus data size is more than 3 ten thousand question-answer pairs, and the application trains the data and obtains a question-answer generation model.
Referring to fig. 9 and 10, fig. 9 is a block flow diagram of a sub-step of step S3 provided in an embodiment of the present application, and fig. 10 is a schematic diagram of chat interaction between a user and a robot provided in an embodiment of the present application.
Further, based on the emotion information and/or the topic information, a step S3 of returning a reply corresponding to the information to the user includes:
s31: and responding to the emotion information as the positive emotion, and returning a reply matched with the positive emotion to the user.
Specifically, for example, in an online shopping application scenario, a user may input that a certain product is very satisfied: the product quality of your store is good, the color value is high, I will continue to buy back after that-! Then, the question and answer generation model can acquire positive emotion of happiness, excitement and the like of the emotion information of the user, and can provide the following replies for the user at the moment: the mind is happy for you, and also thank you for our trust, we will continue to strive; or, you happy and i happy, can make you satisfied with being the biggest happy and the like, and strengthen the positive emotion of the user.
S32: in response to the affective information being a negative emotion, a reply is returned to the user that matches the negative emotion to comfort the user.
Specifically, in another shopping scenario, for example, a user asks: how much more than ten days My express delivery has not yet been achieved. The emotion information and the theme information are acquired from the information input by the user, so that the emotion information of the user is negative emotion, and particularly, the emotion information can be angry, anger and the like. The subject of the user mention is the express age of shopping. Then the intelligent customer service may first reply: you do not generate qi first to pacify the emotion of the user, and then reply aiming at the theme mentioned by the user in combination with specific conditions. For example: because of epidemic situation, the region where you are is sealed and controlled, and the express delivery is not past. It can be understood that in the intelligent customer service system, the reply strategies are various, and the application mainly focuses on carrying out emotion pacifying on the user, namely carrying out some emotion pacifying according to topics input by the user or carrying out targeted answers.
For another example, in a finance/financial application scenario, the user inputs: the my funds lose money every day.
The recovery 1 is that the owner does not generate qi and the market is bad.
The recovery is 2, the small arming is carried out, and the market is good in fluctuation.
In summary, through testing the robot chat method and the chat method of the native seq2seq model, operation data of one month are obtained, and finally the following results are obtained:
TABLE 1
Test subjects Recovery qualification rate Average length of number of recovered words 5-20 word length ratio
Native seq2seq model 0.41% 5.1 44.3%
Chat method of the application 0.74% 8.3 94.3%
As can be seen from table 1 above: the robot chat method is obviously superior to the chat method of the native seq2seq model adopted in the prior art in terms of the number of reply words and the qualification rate. Therefore, the chatting method combining the emotion information and the theme information greatly improves the emotion interaction of the robot in chatting with the user, improves the communication efficiency of the robot and the user, and improves the chatting experience of the user.
The robot chat method disclosed by the application comprises the following steps: receiving information input by a user and judging the type of the information; responding to the type of the information to be matched with a preset question-answer generation model, and acquiring emotion information and/or theme information in the information through the question-answer generation model; and returning a reply corresponding to the information to the user based on the emotion information and/or the theme information. Solves the problem that the reply of the existing intelligent customer service lacks diversity and emotion colors. The intelligent customer service reply integrates the theme information and the emotion information, so that emotion interaction of the robot in chatting with the user is greatly improved, communication efficiency of the robot and the user is improved, and chatting experience of the user is also improved.
Referring to fig. 11, fig. 11 is a schematic block diagram of an electronic device according to an embodiment of the present application.
The electronic device 200 may include, in particular, a processor 210 and a memory 220. The memory 220 is coupled to the processor 210.
The processor 210 is used to control the operation of the electronic device 200, and the processor 210 may also be referred to as a CPU (Central Processing Unit ). The processor 210 may be an integrated circuit chip with signal processing capabilities. Processor 210 may also be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. A general purpose processor may be a microprocessor or the processor 210 may be any conventional processor or the like.
The memory 220 is used to store a computer program, which may be a RAM, a ROM, or other type of storage device. In particular, the memory may include one or more computer-readable storage media, which may be non-transitory. The memory may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory is used to store at least one piece of program code.
The processor 210 is configured to execute a computer program stored in the memory 220 to implement the robot chat method described in the embodiments of the robot chat method of the present application.
In some implementations, the electronic device 200 may further include: a peripheral interface 230, and at least one peripheral. The processor 210, memory 220, and peripheral interface 230 may be connected by a bus or signal line. Individual peripheral devices may be connected to peripheral device interface 230 by buses, signal lines, or circuit boards. Specifically, the peripheral device includes: at least one of radio frequency circuitry 240, display 250, audio circuitry 260, and power supply 270.
Peripheral interface 230 may be used to connect at least one Input/output (I/O) related peripheral to processor 210 and memory 220. In some embodiments, processor 210, memory 220, and peripheral interface 230 are integrated on the same chip or circuit board; in some other implementations, either or both of the processor 210, the memory 220, and the peripheral interface 230 may be implemented on separate chips or circuit boards, which is not limited in this embodiment.
The Radio Frequency circuit 240 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 240 communicates with the communication network and other communication devices through electromagnetic signals, and the radio frequency circuit 240 is a communication circuit of the electronic device 200. The radio frequency circuit 240 converts an electrical signal into an electromagnetic signal for transmission, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 240 includes: antenna systems, RF transceivers, one or more amplifiers, tuners, oscillators, digital signal processors, codec chipsets, subscriber identity module cards, and so forth. The radio frequency circuit 240 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: the world wide web, metropolitan area networks, intranets, generation mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and/or WiFi (Wireless Fidelity ) networks. In some embodiments, the radio frequency circuit 240 may also include NFC (Near Field Communication ) related circuits, which are not limited in this application.
The display 250 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When display 250 is a touch display, display 250 also has the ability to collect touch signals at or above the surface of display 250. The touch signal may be input as a control signal to the processor 210 for processing. At this time, the display 250 may also be used to provide virtual buttons and/or virtual keyboards, also referred to as soft buttons and/or soft keyboards. In some embodiments, the display 250 may be one, disposed on the front panel of the electronic device 200; in other embodiments, the display 250 may be at least two, respectively disposed on different surfaces of the electronic device 200 or in a folded design; in other embodiments, the display 250 may be a flexible display disposed on a curved surface or a folded surface of the electronic device 200. Even more, the display 250 may be arranged in a non-rectangular irregular pattern, i.e., a shaped screen. The display 250 may be made of LCD (Liquid Crystal Display ), OLED (Organic Light-Emitting Diode) or other materials.
The audio circuitry 260 may include a microphone and a speaker. The microphone is used for collecting sound waves of users and the environment, converting the sound waves into electric signals, and inputting the electric signals to the processor 210 for processing, or inputting the electric signals to the radio frequency circuit 240 for voice communication. For purposes of stereo acquisition or noise reduction, the microphone may be multiple and separately disposed at different locations of the electronic device 200. The microphone may also be an array microphone or an omni-directional pickup microphone. The speaker is used to convert electrical signals from the processor 210 or the radio frequency circuit 240 into sound waves. The speaker may be a conventional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, not only the electric signal can be converted into a sound wave audible to humans, but also the electric signal can be converted into a sound wave inaudible to humans for ranging and other purposes. In some embodiments, audio circuit 260 may also include a headphone jack.
Power supply 270 is used to power the various components in electronic device 200. Power supply 270 may be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When power supply 270 includes a rechargeable battery, the rechargeable battery may be a wired rechargeable battery or a wireless rechargeable battery. The wired rechargeable battery is a battery charged through a wired line, and the wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery may also be used to support fast charge technology.
For detailed descriptions of the functions and execution processes of each functional module or component in the embodiment of the electronic device 200 of the present application, reference may be made to the descriptions in the embodiment of the robot chat method of the present application, which are not described herein.
In several embodiments provided herein, it should be understood that the disclosed electronic device 200 and robotic chat method may be implemented in other ways. For example, the various embodiments of the electronic device 200 described above are merely illustrative, e.g., the division of modules or units is merely a logical functional division, and there may be additional divisions of actual implementation, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
Referring to fig. 12, fig. 12 is a schematic block diagram of a computer readable storage medium according to an embodiment of the present application.
Referring to fig. 12, the above-described integrated units, if implemented in the form of software functional units and sold or used as independent products, may be stored in the computer-readable storage medium 300. Based on such understanding, the technical solution of the present application may be embodied essentially or in part or all or part of the technical solution contributing to the prior art or in the form of a software product stored in a storage medium, including several instructions/computer programs to cause a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform all or part of the steps of the methods of the embodiments of the present invention. And the aforementioned storage medium includes: various media such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk or an optical disk, and electronic devices such as a computer, a mobile phone, a notebook computer, a tablet computer, and a camera having the above-described storage media.
The description of the execution process of the program data in the computer readable storage medium 300 may be described with reference to the embodiments of the robot chat method described above, and will not be repeated here.
The foregoing description is only of embodiments of the present application, and is not intended to limit the scope of the patent application, and all equivalent structures or equivalent processes using the descriptions and the contents of the present application or other related technical fields are included in the scope of the patent application.

Claims (9)

1. A robotic chat method comprising:
receiving information input by a user, judging the type of the information, and acquiring a reply strategy to be called by the information, wherein the reply strategy comprises the following steps:
responding to the type of the information as a question-answer type, and calling a knowledge base to provide replies corresponding to the information for the user;
responding to the type of the information to be open or with emotion tendency, calling a question-answer generation model to identify the information so as to obtain emotion information and/or theme information of the information; wherein the subject information includes music, sports, movies, life, education, work, travel, medical, or financial;
Responding to the type of the information to be matched with a preset question-answer generation model, and acquiring the emotion information and/or the theme information in the information through the question-answer generation model; the question and answer generation model fuses an original Seq2Seq model, the emotion information and/or the theme information, and introduces an attention mechanism to trace back the information, and trains the question and answer generation model through knowledge data;
returning a reply corresponding to the information to the user based on the emotion information and/or the topic information; the replies are from a corpus which carries out model training on the question-answer generation model and is arranged in advance.
2. The method of claim 1, wherein the step of determining the position of the substrate comprises,
and if the type of the information is matched with a preset question-answer generation model, acquiring emotion information and/or theme information in the information through the question-answer generation model, wherein the method comprises the following steps of:
acquiring the emotion information and/or the topic information in the information, and judging whether the emotion information and/or the topic information are matched with the emotion information and/or the topic information preset in the question-answer generation model; wherein the affective information includes positive and negative emotions;
And responding to the judgment result to be matched, and generating replies corresponding to the emotion information and/or the theme information through the question and answer generation model.
3. The method of claim 2, wherein the step of determining the position of the substrate comprises,
and if the type of the information is matched with a preset question-answer generation model, acquiring emotion information and/or theme information in the information through the question-answer generation model, and further comprising:
responding to the judgment result as mismatch; or, in response to the question-answer generation model not storing the affective information and/or the topic information in the information;
and returning a first reply strategy to the user.
4. The method of claim 2, wherein the step of determining the position of the substrate comprises,
the responding to the judging result being the matching comprises the following steps:
extracting an intermediate semantic vector from the information to decode the information;
supplementing the emotion information and/or the topic information to the decoding process;
analyzing the information input by the user and the emotion thereof through the intermediate semantic vector, the emotion information and/or the theme information so as to obtain the meaning of the information;
and replying to the user based on the meaning of the information.
5. The method of claim 4, wherein the step of determining the position of the first electrode is performed,
before the meaning of the information is obtained, the method comprises the following steps:
performing word decomposition on the information, and giving different weights to each word according to the importance of each word to decoding at the current moment;
acquiring the probability of each word in the information in an output layer through the decoding process;
outputting the meaning of the information.
6. The method of claim 4, wherein the step of determining the position of the first electrode is performed,
said extracting an intermediate semantic vector from said information to decode said information comprises:
inputting the information into the question-answer generation model to obtain a digital matrix corresponding to the information;
calculating the digital matrix to obtain a digital result corresponding to the information;
converting the digital result into text information through the question-answer generation model;
and outputting the text information.
7. The method of claim 1, wherein the step of determining the position of the substrate comprises,
the return of a reply corresponding to the information to the user based on the emotion information and/or the topic information comprises the following steps:
responding to the emotion information as the positive emotion, and returning a reply matched with the positive emotion to the user;
And responding to the emotion information as a negative emotion, and returning a reply matched with the negative emotion to the user so as to placebo the user.
8. A computer device, comprising:
a processor;
a memory coupled to the processor for storing a computer program executable on the processor;
wherein the processor, when executing the computer program, implements the method of any of claims 1 to 7.
9. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the method of any of claims 1 to 7.
CN202211360971.8A 2022-11-02 2022-11-02 Robot chatting method, computer device and storage medium Active CN115473864B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211360971.8A CN115473864B (en) 2022-11-02 2022-11-02 Robot chatting method, computer device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211360971.8A CN115473864B (en) 2022-11-02 2022-11-02 Robot chatting method, computer device and storage medium

Publications (2)

Publication Number Publication Date
CN115473864A CN115473864A (en) 2022-12-13
CN115473864B true CN115473864B (en) 2023-04-28

Family

ID=84336449

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211360971.8A Active CN115473864B (en) 2022-11-02 2022-11-02 Robot chatting method, computer device and storage medium

Country Status (1)

Country Link
CN (1) CN115473864B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117032467B (en) * 2023-10-08 2024-01-09 成都卓拙科技有限公司 Method, device, electronic equipment and storage medium for interaction with chat robot

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017041372A1 (en) * 2015-09-07 2017-03-16 百度在线网络技术(北京)有限公司 Man-machine interaction method and system based on artificial intelligence
WO2019000170A1 (en) * 2017-06-26 2019-01-03 Microsoft Technology Licensing, Llc Generating responses in automated chatting
WO2021184311A1 (en) * 2020-03-19 2021-09-23 中山大学 Method and apparatus for automatically generating inference questions and answers

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105577529B (en) * 2015-12-30 2019-03-05 上海智臻智能网络科技股份有限公司 Robot customer service and its client service method, intelligent customer service system
CN105893344A (en) * 2016-03-28 2016-08-24 北京京东尚科信息技术有限公司 User semantic sentiment analysis-based response method and device
CN105895101A (en) * 2016-06-08 2016-08-24 国网上海市电力公司 Speech processing equipment and processing method for power intelligent auxiliary service system
CN106855879A (en) * 2016-12-14 2017-06-16 竹间智能科技(上海)有限公司 The robot that artificial intelligence psychology is seeked advice from music
CN111127031A (en) * 2018-10-11 2020-05-08 上海智臻智能网络科技股份有限公司 Intelligent customer service system interaction method, intelligent customer service robot and storage medium
CN111026855A (en) * 2019-12-06 2020-04-17 易小博(武汉)科技有限公司 Intelligent customer service response method, system, controller and medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017041372A1 (en) * 2015-09-07 2017-03-16 百度在线网络技术(北京)有限公司 Man-machine interaction method and system based on artificial intelligence
WO2019000170A1 (en) * 2017-06-26 2019-01-03 Microsoft Technology Licensing, Llc Generating responses in automated chatting
WO2021184311A1 (en) * 2020-03-19 2021-09-23 中山大学 Method and apparatus for automatically generating inference questions and answers

Also Published As

Publication number Publication date
CN115473864A (en) 2022-12-13

Similar Documents

Publication Publication Date Title
US11842164B2 (en) Method and apparatus for training dialog generation model, dialog generation method and apparatus, and medium
CN107947951B (en) Groups of users recommended method, device and storage medium and server
EP3660854B1 (en) Triage dialogue method, device, and system
Malik et al. Adoption of chatbots for learning among university students: Role of perceived convenience and enhanced performance
CN110288077A (en) A kind of synthesis based on artificial intelligence is spoken the method and relevant apparatus of expression
CN108121799A (en) Recommendation method, apparatus, storage medium and the mobile terminal of revert statement
CN109543200A (en) A kind of text interpretation method and device
CN107305578A (en) Human-machine intelligence's answering method and device
CN115473864B (en) Robot chatting method, computer device and storage medium
CN106921749A (en) For the method and apparatus of pushed information
CN110335596A (en) Products Show method, apparatus, equipment and storage medium based on speech recognition
Griol et al. Modeling the user state for context-aware spoken interaction in ambient assisted living
CN110379411A (en) For the phoneme synthesizing method and device of target speaker
CN107329760A (en) Information cuing method, device, terminal and storage medium
CN106847273A (en) The wake-up selected ci poem selection method and device of speech recognition
Li et al. Multimodal emotion recognition and state analysis of classroom video and audio based on deep neural network
US20220198153A1 (en) Model training
CN114047900A (en) Service processing method and device, electronic equipment and computer readable storage medium
CN108132717A (en) Recommendation method, apparatus, storage medium and the mobile terminal of candidate word
CN112307186A (en) Question-answering service method, system, terminal device and medium based on emotion recognition
CN112800189A (en) Human-computer interaction method and device, intelligent robot and storage medium
Walther et al. Towards a conversational expert system for rhetorical and vocal quality assessment in call center talks.
Seema et al. Doctor Chatbot-Smart Health Prediction
CN116933800B (en) Template-based generation type intention recognition method and device
CN113707185B (en) Emotion recognition method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant