Dialogue reply processing method and device, storage medium and electronic equipment

By extracting user historical behavior and dialogue data, combining emotion analysis feature vectors, and using preset dialogue generation models to generate reply text, it solves the problems of insufficient personalization and emotional understanding in traditional methods, and improves the accuracy and user experience of intelligent dialogue replies .

CN119271785APending Publication Date: 2025-01-07PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411379560.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-27
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

Traditional intelligent dialogue reply processing methods mainly rely on text data, lack personalization, and cannot deeply understand the intensity and context of emotions, resulting in poor experience and low accuracy.

Method used

Extract the user's historical behavior data and dialogue data, perform feature extraction, and generate reply text in combination with the sentiment analysis model. Consider the user's behavior characteristics and sentiment analysis feature vectors, and use the preset dialogue generation model to integrate multi-source data to generate reply.

Benefits of technology

Improve the accuracy and user experience of reply text, and enhance the precision and user satisfaction of emotional recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119271785A_ABST
    Figure CN119271785A_ABST
Patent Text Reader

Abstract

The invention discloses a dialogue reply processing method and device, a storage medium and electronic equipment, and relates to the technical field of artificial intelligence and the field of medical health, and the method comprises the steps: in response to an input operation of current dialogue data of a user, extracting historical data corresponding to the user, the historical data comprises user behavior data and user dialogue data; performing feature extraction based on the user behavior data to obtain user behavior feature data; feature extraction is carried out based on the user dialogue data, user dialogue feature data are obtained, and the user dialogue feature data comprise sentiment analysis feature vectors; based on the user behavior feature data, the user dialogue feature data, the current dialogue data and the user dialogue data, adopting a preset dialogue generation model to generate a reply text, and obtaining the reply text corresponding to the current dialogue data. According to the method, the accuracy of the dialogue reply text can be improved, and the user satisfaction degree and experience degree are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of artificial intelligence technology and medical health, and in particular to a dialogue reply processing method, device, storage medium and electronic device. Background Art

[0002] With the development of artificial intelligence technology, intelligent dialogue response processing methods can support functions such as disease auxiliary diagnosis, health management, and remote consultation. Traditional intelligent dialogue response processing methods mainly use deep learning-based technologies, such as the neural network model Transformer based on the self-attention mechanism and the pre-trained language model BERT, which have excellent performance in understanding and generating language. However, these models generally face several limitations. Most traditional methods only process text data and rarely combine other dimensional data, resulting in a lack of personalization in the services provided. In addition, although these models can recognize basic emotions, they usually cannot deeply understand the intensity of emotions and specific contexts, which limits their accuracy in emotional interaction. Summary of the invention

[0003] In view of this, the present invention provides a conversation reply processing method, device, storage medium and electronic device, the main purpose of which is to solve the problem that the current intelligent conversation reply processing method only generates reply text based on the input text, resulting in poor user experience and low accuracy.

[0004] To solve the above problems, the present application provides a method for processing a dialogue reply, comprising:

[0005] In response to an input operation of the user's current conversation data, extracting historical data corresponding to the user, the historical data including user behavior data and user conversation data;

[0006] Perform feature extraction based on the user behavior data to obtain user behavior feature data;

[0007] Perform feature extraction based on the user conversation data to obtain user conversation feature data, wherein the user conversation feature data includes a sentiment analysis feature vector;

[0008] Based on the user behavior feature data, the user conversation feature data, the current conversation data and the user conversation data, a preset conversation generation model is used to generate a reply text to obtain a reply text corresponding to the current conversation data.

[0009] Optionally, the extracting features based on the user behavior data to obtain user behavior feature data specifically includes:

[0010] Extracting time features based on the user behavior data to obtain an initial time feature vector corresponding to the user behavior data;

[0011] Normalizing the initial time feature vector to obtain a behavior time feature vector;

[0012] Extract frequency features based on the user behavior data to obtain an initial frequency feature vector corresponding to the user behavior data;

[0013] Normalizing the initial frequency feature vector to obtain a behavior frequency feature vector;

[0014] The behavior time feature vector and the behavior frequency feature vector are concatenated to obtain the user behavior feature data.

[0015] Optionally, the extracting features based on the user conversation data to obtain user conversation feature data specifically includes:

[0016] Based on the user conversation data, feature extraction is performed using frequency and inverse document frequency feature extraction methods to obtain an initial frequency conversation feature vector;

[0017] Based on the user conversation data, feature extraction is performed using a topic model feature extraction method to obtain an initial topic model feature vector;

[0018] Based on the user conversation data, a preset sentiment analysis model is used to perform feature extraction to obtain an initial sentiment analysis feature vector;

[0019] Normalizing the initial frequency conversation feature vector, the initial topic model feature vector, and the initial emotion feature vector to obtain a frequency conversation feature vector, a topic model feature vector, and an emotion analysis feature vector;

[0020] The frequency conversation feature vector, the topic model feature vector, and the sentiment analysis feature vector are concatenated to obtain the user conversation feature data.

[0021] Optionally, before extracting features using a preset sentiment analysis model based on the user conversation data, the method further includes: constructing the preset sentiment analysis model;

[0022] The constructing of the preset sentiment analysis model specifically includes:

[0023] Labeling each historical conversation data to obtain each label data, wherein the label data includes an emotion label and an emotion intensity identifier;

[0024] Based on each of the label data as a training sample, a preset cross entropy loss function is used to perform model training on the preset initial sentiment analysis model to obtain the preset sentiment analysis model that meets the preset conditions.

[0025] Optionally, the extracting features based on the user conversation data using a preset sentiment analysis model to obtain an initial sentiment analysis feature vector specifically includes:

[0026] Based on the user conversation data, a preset sentiment analysis model is used to perform sentiment analysis to obtain sentiment analysis prediction data and sentiment intensity prediction data;

[0027] Performing word segmentation processing on the sentiment analysis prediction data to obtain a number of word segments;

[0028] Performing word embedding processing on each of the word segments to obtain a first sentiment analysis feature vector;

[0029] Vectorizing the emotion intensity prediction data to obtain an emotion intensity vector;

[0030] The initial sentiment analysis feature vector is obtained by performing concatenation processing based on the sentiment intensity vector and the first sentiment analysis feature vector.

[0031] Optionally, the generating of the reply text by using a preset dialogue generation model based on the user behavior feature data, the user dialogue feature data, the current dialogue data and the user dialogue data to obtain the reply text corresponding to the current dialogue data specifically includes:

[0032] Performing vectorization processing on the current conversation data and the historical conversation data to obtain a current conversation feature vector and a historical conversation feature vector;

[0033] Performing concatenation processing based on the user behavior feature data, the user conversation feature data, the current conversation feature vector, and the historical conversation feature vector to obtain a feature sequence;

[0034] Based on the feature sequence, the preset dialogue generation model is used to generate a reply text to obtain a reply text corresponding to the current dialogue data.

[0035] Optionally, the method further includes:

[0036] The user portrait corresponding to the user in the preset user feature library is updated based on the user behavior feature data and the user conversation feature data.

[0037] In order to solve the above problems, the present application provides a dialogue reply processing device, including:

[0038] A data extraction module, configured to extract historical data corresponding to the user in response to an input operation of the user's current conversation data, wherein the historical data includes user behavior data and user conversation data;

[0039] A behavior feature extraction module, used to extract features based on the user behavior data to obtain user behavior feature data;

[0040] A conversation feature extraction module, used to perform feature extraction based on the user conversation data to obtain user conversation feature data, wherein the user conversation feature data includes a sentiment analysis feature vector;

[0041] The reply text generation module is used to generate a reply text based on the user behavior feature data, the user conversation feature data, the current conversation data and the user conversation data using a preset conversation generation model to obtain a reply text corresponding to the current conversation data.

[0042] In order to solve the above problem, the present application provides a storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned dialogue reply processing method are implemented.

[0043] To solve the above problem, the present application provides an electronic device, which at least includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above-mentioned conversation reply processing method when executing the computer program on the memory.

[0044] The beneficial effects of the present application are as follows: the present application generates reply text based on the user portrait data composed of the user behavior feature data and the user conversation feature data, and combines the current conversation data and the historical conversation feature vector of the context using a preset conversation generation model to obtain a reply text corresponding to the current conversation data. The present application uses user portrait data that considers the user behavior feature data and the user conversation feature data containing the sentiment analysis feature vector, and combines the current input text and the context text to generate reply text. The reply text obtained by considering multiple source elements is more accurate, thereby improving user satisfaction and experience.

[0045] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0047] Figure 1 This is a schematic diagram of an application environment of a method for processing a conversation reply in an embodiment of the present application;

[0048] Figure 2 A flow chart of a method for processing a conversation reply provided in an embodiment of the present application is shown;

[0049] Figure 3 A flowchart of a method for processing a conversation reply provided by another embodiment of the present application is shown;

[0050] Figure 4 A structural block diagram of a conversation replying device provided in another embodiment of the present application is shown. DETAILED DESCRIPTION

[0051] Various aspects and features of the present application are described herein with reference to the accompanying drawings.

[0052] It should be understood that various modifications may be made to the embodiments of the present application. Therefore, the above description should not be considered as limiting, but only as an example of an embodiment. Other modifications within the scope and spirit of the present application will occur to those skilled in the art.

[0053] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the present application and, together with the general description of the present application given above and the detailed description of the embodiments given below, serve to explain the principles of the present application.

[0054] These and other characteristics of the present application will become apparent from the following description of a preferred form of embodiment given as a non-limiting example with reference to the accompanying drawings.

[0055] It should also be understood that although the present application has been described with reference to some specific examples, those skilled in the art will be able to readily implement many other equivalent forms of the present application.

[0056] The above and other aspects, features and advantages of the present application will become more apparent in view of the following detailed description when taken in conjunction with the accompanying drawings.

[0057] Specific embodiments of the present application are described hereinafter with reference to the accompanying drawings; however, it should be understood that the embodiments applied for are merely examples of the present application, which may be implemented in a variety of ways. Well-known and / or repeated functions and structures are not described in detail to avoid unnecessary or redundant details that obscure the present application. Therefore, the specific structural and functional details applied for herein are not intended to be limiting, but merely serve as a basis and representative basis for the claims to teach those skilled in the art to use the present application in a variety of ways with substantially any suitable detailed structure.

[0058] This specification may use the phrases "in one embodiment," "in another embodiment," "in yet another embodiment," or "in other embodiments," all of which may refer to one or more of the same or different embodiments according to the present application.

[0059] The dialogue reply processing method provided by the embodiment of the present invention can be applied in the following aspects: Figure 1 In an application environment, a client communicates with a server through a network. The server can receive the current conversation data through the client, and in response to the user's input operation of the current conversation data, extract the historical data corresponding to the user, the historical data including the user behavior data and the user conversation data; perform feature extraction based on the user behavior data to obtain the user behavior feature data; perform feature extraction based on the user conversation data to obtain the user conversation feature data, the user conversation feature data including the sentiment analysis feature vector; generate a reply text based on the user behavior feature data, the user conversation feature data, the current conversation data and the user conversation data using a preset conversation generation model to obtain the reply text corresponding to the current conversation data, and feed the reply text back to the client. In this application, feature extraction is performed on the multi-dimensional data of the user behavior data and the user conversation data to obtain the user behavior feature data and the user conversation feature data, and the integration of multi-source data can improve the accuracy of the final reply text and enhance the user experience; and introduce the sentiment intensity index and context information to improve the precision and accuracy of the sentiment recognition, and achieve a response that is closer to the user's sentiment; according to the user portrait and sentiment analysis results composed of the user behavior feature data and the user conversation feature data, a customized emotional response is generated to enhance the user satisfaction and interactive experience.

[0060] The present application embodiment provides a method for processing a dialogue reply, such as Figure 2 As shown, including:

[0061] Step S101: In response to an input operation of a user's current conversation data, extracting historical data corresponding to the user, the historical data including user behavior data and user conversation data;

[0062] In the specific implementation process of this step, the dialogue reply processing method of the present application can be applied to the medical cloud platform. Medical cloud refers to the use of "cloud computing" to create a medical and health service cloud platform based on new technologies such as cloud computing, mobile technology, multimedia, 4G communication, big data, and the Internet of Things, combined with medical technology, to achieve the sharing of medical resources and the expansion of medical scope. Because of the combination of cloud computing technology, the medical cloud improves the efficiency of medical institutions and facilitates residents to seek medical treatment. For example, the current hospital appointment registration and electronic medical records are the products of the combination of cloud computing and the medical field. The medical cloud also has the advantages of data security, information sharing, dynamic expansion, and overall layout. In response to the input operation of the user's current dialogue data, the historical initial data corresponding to the user is obtained; the historical initial data is screened to obtain the initial user behavior data and the initial user dialogue data; the initial user behavior data is cleaned to obtain the user behavior data; the initial user dialogue data is cleaned to obtain the user dialogue data; the data cleaning process includes: data deduplication processing, data formatting processing, and data noise filtering processing.

[0063] Step S102: extracting features based on the user behavior data to obtain user behavior feature data;

[0064] During the specific implementation of this step, feature extraction is performed on the user behavior data using a time feature extraction method and a behavior frequency feature extraction method to obtain a behavior time feature vector and a behavior frequency feature vector; the behavior time feature vector and the behavior frequency feature vector are concatenated to obtain the user behavior feature data.

[0065] Step S103: extracting features based on the user conversation data to obtain user conversation feature data, wherein the user conversation feature data includes a sentiment analysis feature vector;

[0066] In the specific implementation process of this step, feature extraction is performed on the user conversation data using frequency and inverse document frequency feature extraction methods, topic model feature extraction methods, and a preset sentiment analysis model to obtain a frequency conversation feature vector, a topic model feature vector, and a sentiment analysis feature vector. The frequency conversation feature vector, the topic model feature vector, and the sentiment analysis feature vector are concatenated to obtain the user conversation feature data.

[0067] Step S104: Based on the user behavior feature data, the user conversation feature data, the current conversation data and the user conversation data, a preset conversation generation model is used to generate a reply text to obtain a reply text corresponding to the current conversation data.

[0068] In the specific implementation process of this step, the current conversation data and the historical conversation data are vectorized to obtain a current conversation feature vector and a historical conversation feature vector; splicing processing is performed based on the user behavior feature data, the user conversation feature data, the current conversation feature vector and the historical conversation feature vector to obtain a feature sequence; based on the feature sequence, a reply text is generated using the preset conversation generation model to obtain a reply text corresponding to the current conversation data.

[0069] This application uses a preset conversation generation model to generate reply text based on the user portrait data composed of the user behavior feature data and the user conversation feature data, combined with the current conversation data and the historical conversation feature vector of the context, to obtain a reply text corresponding to the current conversation data. This application uses user portrait data that considers user behavior feature data and user conversation feature data containing sentiment analysis feature vectors, combined with the current input text and context text to generate reply text. The reply text obtained by considering multiple source elements is more accurate, thereby improving user satisfaction and experience.

[0070] Another embodiment of the present application provides another method for processing a dialogue reply, such as Figure 3 As shown, including:

[0071] Step S201: In response to the input operation of the user's current conversation data, extracting historical data corresponding to the user, the historical data including user behavior data and user conversation data;

[0072] In the specific implementation process of this step, in response to the user's input operation of the current conversation data, the historical initial data corresponding to the user is obtained; the historical initial data is screened to obtain the initial user behavior data and the initial user conversation data; the present application can be applied to the application scenario of intelligent question reply of the medical consultation platform, and the present application is also applicable to other intelligent chat systems or platforms; the initial user behavior data D b The mathematical expression of can be expressed as follows:

[0073]

[0074] Among them, the timestamp i The timestamp recorded for the i-th behavior; behavior type i is the type of the i-th behavior record, which may be browsing behavior, purchasing behavior, etc.; behavior content i The specific content recorded for the i-th behavior; N bis the total number of user behavior records. The initial user behavior data is cleaned to obtain the user behavior data; specifically, the initial user behavior data is deduplicated to obtain the first user behavior data, and duplicate data can be detected by calculating the hash value of each record to remove duplicate data; the first user behavior data is formatted to obtain the second user behavior data, the date and time are formatted, the text encoding is unified, the data type is converted, and the missing values ​​are processed to obtain the second user behavior data in a unified format; the second user behavior data is noise filtered to obtain the user behavior data, and meaningless characters, abnormal values ​​and other data in the second behavior data are removed to obtain the user behavior data The initial user conversation data is cleaned to obtain the user conversation data; the initial user conversation data D c The data expression can be expressed as follows:

[0075]

[0076] Among them, is the content of the jth conversation record; N c is the total number of user conversation records. The initial user conversation data is deduplicated to obtain the first user conversation data, and the duplicate data can be detected by calculating the hash value of each conversation record to remove the duplicate data; the first user conversation data is formatted to obtain the second user conversation data, the date and time are formatted, the text encoding is unified, the data type is converted, and the missing values ​​are processed to obtain the second user conversation data with a unified format; the second user conversation data is noise filtered to obtain the user conversation data, and the meaningless characters, abnormal values ​​and other data in the second conversation data are removed to obtain the user conversation data

[0077] Step S202: extracting time features based on the user behavior data to obtain an initial time feature vector corresponding to the user behavior data;

[0078] In the specific implementation process of this step, the initial time feature vector t b The mathematical expression of can be expressed as follows:

[0079]

[0080] Among them, N b The total number of user actions recorded; Timestamp iIndicates the average timestamp of behavior records; the maximum time interval is the maximum time interval between behavior records; the minimum time interval is: the minimum time interval between behavior records.

[0081] Step S203: extracting frequency features based on the user behavior data to obtain an initial frequency feature vector corresponding to the user behavior data;

[0082] In the specific implementation process of this step, the mathematical expression of the initial frequency characteristic vector can be expressed as the following formula (4):

[0083]

[0084] Among them, f b is the initial frequency feature vector; T is the total recording time period; I is the indicative function.

[0085] Step S204: normalizing the initial time feature vector and the initial frequency feature vector respectively to obtain a behavior time feature vector and a behavior frequency feature vector;

[0086] In the specific implementation process of this step, the initial time feature vector is normalized to obtain a behavior time feature vector; the behavior time feature vector The mathematical expression of can be expressed as follows:

[0087]

[0088] The initial frequency feature vector is normalized to obtain a behavior frequency feature vector; the behavior frequency feature vector The mathematical expression of can be shown as follows:

[0089]

[0090] Step S205: concatenating the behavior time feature vector and the behavior frequency feature vector to obtain the user behavior feature data;

[0091] In the specific implementation process of this step, the user behavior feature data x b The mathematical expression of can be expressed as follows:

[0092]

[0093] Among them, x b User behavior feature data; Represents the concatenation operation of feature vectors.

[0094] Step S206: extracting features based on the user conversation data by using frequency and inverse document frequency feature extraction methods to obtain an initial frequency conversation feature vector;

[0095] In the specific implementation process of this step, feature extraction is performed based on the user conversation data using frequency and inverse document frequency feature extraction methods to obtain an initial frequency conversation feature vector; the user conversation data is vectorized, and the mathematical expression of the initial frequency conversation feature vector can be shown as the following formula (8):

[0096]

[0097] Among them, v TF-IDF is the initial frequency conversation feature vector; Represents the user conversation data Perform frequency and inverse document frequency feature extraction processing.

[0098] Step S207: extracting features using a topic model feature extraction method based on the user conversation data to obtain an initial topic model feature vector;

[0099] In the specific implementation process of this step, the mathematical expression of the initial topic model feature vector can be expressed as follows:

[0100]

[0101] Among them, v LDA is the theme feature vector; Represents the user conversation data Perform topic model feature extraction processing operations.

[0102] Step S208: constructing a preset sentiment analysis model;

[0103] In the specific implementation process of this step, each historical conversation data is annotated to obtain each label data, and the label data includes a sentiment label and a sentiment intensity identifier; specifically, sentiment annotation is performed based on each historical conversation data, and an sentiment label is matched for each conversation, and the sentiment label can be a positive emotion, a negative emotion, a neutral emotion, etc.; and an optional sentiment intensity is assigned to each conversation, and the sentiment intensity can be a sentiment intensity value, and the value range of the sentiment intensity value is greater than or equal to 0 and less than or equal to 1; the sentiment intensity value can also be a sentiment intensity identifier, such as level 1, level 2..., level n, etc.; the sentiment intensity identifier can also be a strong, medium, weak, etc. identifier; specifically, the sentiment intensity identifier can be set according to actual needs; based on each of the label data as a training sample, a preset cross entropy loss function is used to train the preset initial sentiment analysis model to obtain the preset sentiment analysis model that meets the preset conditions. Specifically, a preset initial sentiment analysis model is constructed, and the preset initial sentiment analysis model can be obtained by training using the pre-trained language model Roberta model; based on each of the label data, the fully connected layer of the preset initial sentiment analysis model is used for classification to obtain the initial prediction category and the initial prediction strength corresponding to each of the label data, and the output layer of the preset initial sentiment analysis model outputs the initial sentiment prediction category and the initial sentiment prediction strength corresponding to each of the label data; based on the sentiment label carried by the label data, the sentiment strength identifier, the initial sentiment prediction category output by the preset initial sentiment analysis model, and the initial sentiment prediction strength output by the preset initial sentiment analysis model, the preset cross entropy loss function is used for calculation to obtain an initial loss value; based on the initial loss value, the model parameters of the preset initial sentiment analysis model are updated using the back propagation algorithm to obtain the current sentiment analysis model; the current sentiment analysis model is trained iteratively using the label data as a training sample, and the model parameters of the current sentiment analysis model are updated until the updated current sentiment analysis model meets the preset conditions, and the current sentiment analysis model that meets the preset conditions is determined as the preset sentiment analysis model. The preset condition may be that the number of training times is equal to a preset number threshold; the preset condition may also be that the loss value is less than or equal to a preset threshold, etc. The preset sentiment analysis model can be applied to a variety of different fields, such as speech recognition, medical diagnosis, application testing, etc.

[0104] Step S209: extracting features using a preset sentiment analysis model based on the user conversation data to obtain an initial sentiment analysis feature vector;

[0105] In the specific implementation process of this step, based on the user conversation data, a preset sentiment analysis model is used to perform sentiment analysis to obtain sentiment analysis prediction data and sentiment intensity prediction data; the sentiment analysis prediction data is segmented to obtain a number of segmented words; each segmented word is embedded to obtain a first sentiment analysis feature vector; the sentiment intensity prediction data is vectorized to obtain a sentiment intensity vector; the sentiment intensity vector and the first sentiment analysis feature vector are concatenated to obtain the initial sentiment analysis feature vector. Specifically, the sentiment intensity vector can be concatenated at the end of the first sentiment analysis feature vector to obtain the initial sentiment analysis feature vector; the mathematical expression of the initial sentiment analysis feature vector can be expressed as the following formula (10):

[0106]

[0107] Among them, v 情感 is the initial sentiment analysis feature vector; For the user conversation data Perform initial sentiment analysis feature extraction processing operations.

[0108] Step S210: normalizing the initial frequency conversation feature vector, the initial topic model feature vector, and the initial emotion feature vector to obtain a frequency conversation feature vector, a topic model feature vector, and an emotion analysis feature vector;

[0109] In the specific implementation process of this step, the initial frequency dialogue feature vector is normalized to obtain a frequency dialogue feature vector; the frequency dialogue feature vector The mathematical expression of is shown in the following formula (11):

[0110]

[0111] Where i is v TF-IDF [i] The i-th dimension of the vector.

[0112] The initial topic model feature vector is normalized to obtain a topic model feature vector; the mathematical expression of the topic model feature vector can be expressed as the following formula (12):

[0113]

[0114] Where i is v LDA The i-th dimension of the vector.

[0115] The initial sentiment feature vector is normalized to obtain a sentiment analysis feature vector; the mathematical expression of the sentiment analysis feature vector can be expressed as follows:

[0116]

[0117] Where i is the vector v 情感 The i-th dimension.

[0118] Step S211: concatenating the frequency conversation feature vector, the topic model feature vector, and the sentiment analysis feature vector to obtain user conversation feature data;

[0119] In the specific implementation process of this step, the mathematical expression of the user conversation feature data can be expressed as the following formula (14):

[0120]

[0121] in, Represents the concatenation operation of feature vectors; is the frequency conversation feature vector; is the feature vector of the topic model; is the feature vector for sentiment analysis.

[0122] Step S212: constructing a preset dialogue generation model;

[0123] In the specific implementation process of this step, the historical behavior feature data, historical user conversation feature data, historical input text data and context history data corresponding to the historical input text data of each customer are obtained; the historical behavior feature data, historical user conversation feature data, historical input text data and historical input text data corresponding to the same user are spliced ​​to obtain a historical feature sequence corresponding to the same user; based on each of the historical feature sequences, an initial conversation generation model is used to generate a reply text to obtain an initial predicted reply text corresponding to each of the historical feature sequences; based on the historical reply text corresponding to the historical feature sequence and the initial predicted reply text, a preset loss function is used to update the model parameters of the initial conversation generation model to obtain a current conversation generation model; the preset loss function may be a loss function such as a cross entropy function, and the preset loss function may be set according to actual needs; each of the historical feature sequences is input into the current conversation generation model to obtain each current predicted reply text, and based on each of the current predicted reply text and the historical reply text, a preset loss function is used to update the model parameters of the current conversation generation model; it is iterated in a loop until the model converges, and the updated current conversation generation model is determined as the preset conversation generation model. The preset dialogue generation model can be applied to a variety of different fields, such as speech recognition, medical diagnosis, application testing, etc.

[0124] Step S213: Based on the user behavior feature data, the user conversation feature data, the current conversation data and the user conversation data, a reply text is generated using a preset conversation generation model to obtain a reply text corresponding to the current conversation data.

[0125] In the specific implementation process of this step, the current conversation data and the historical conversation data are vectorized to obtain a current conversation feature vector and a historical conversation feature vector; based on the user behavior feature data, the user conversation feature data, the current conversation feature vector and the historical conversation feature vector, a splicing process is performed to obtain a feature sequence; specifically, the historical conversation feature vector is spliced ​​after the current conversation feature vector to generate a first feature sequence; based on the user behavior feature data x b Conversation feature data x with the user c The concatenation process is performed to obtain a second feature sequence; the mathematical expression of the second feature sequence can be expressed as the following formula (15):

[0126]

[0127] Among them, x u Represents a second feature sequence, i.e., user portrait data; the first feature sequence is spliced ​​at the end of the second feature sequence to obtain the feature sequence. Based on the user behavior feature data and the user conversation feature data, the user portrait corresponding to the user in the preset user feature library is updated, and a comprehensive and accurate user portrait is constructed and updated in real time. Based on the feature sequence, the preset conversation generation model is used to generate a reply text to obtain a reply text corresponding to the current conversation data. The intelligent conversation reply processing method of the present application can be applied to business scenarios such as intelligent diagnosis and treatment, remote consultation, etc.

[0128] This application uses a preset conversation generation model to generate reply text based on the user portrait data composed of the user behavior feature data and the user conversation feature data, combined with the current conversation data and the historical conversation feature vector of the context, to obtain a reply text corresponding to the current conversation data. This application uses user portrait data that considers user behavior feature data and user conversation feature data containing sentiment analysis feature vectors, combined with the current input text and context text to generate reply text. The reply text obtained by considering multi-source elements is more accurate, improving user satisfaction and experience. This application introduces sentiment intensity indicators and contextual historical conversation texts to generate reply texts, improve the accuracy of fine-grained emotion recognition, and optimize user experience.

[0129] Another embodiment of the present application provides a conversation reply processing device, such as Figure 4 As shown, including:

[0130] A data extraction module 1, configured to extract historical data corresponding to the user in response to an input operation of the user's current conversation data, wherein the historical data includes user behavior data and user conversation data;

[0131] A behavior feature extraction module 2 is used to extract features based on the user behavior data to obtain user behavior feature data;

[0132] A conversation feature extraction module 3, used for performing feature extraction based on the user conversation data to obtain user conversation feature data, wherein the user conversation feature data includes a sentiment analysis feature vector;

[0133] The reply text generation module 4 is used to generate a reply text based on the user behavior feature data, the user conversation feature data, the current conversation data and the user conversation data using a preset conversation generation model to obtain a reply text corresponding to the current conversation data.

[0134] In the specific implementation process, the behavior feature extraction module 2 is specifically used for: performing time feature extraction on the user behavior data to obtain an initial time feature vector corresponding to the user behavior data; normalizing the initial time feature vector to obtain a behavior time feature vector; performing frequency feature extraction based on the user behavior data to obtain an initial frequency feature vector corresponding to the user behavior data; normalizing the initial frequency feature vector to obtain a behavior frequency feature vector; and splicing the behavior time feature vector and the behavior frequency feature vector to obtain the user behavior feature data.

[0135] In the specific implementation process, the conversation feature extraction module 3 is specifically used to: perform feature extraction based on the user conversation data using frequency and inverse document frequency feature extraction methods to obtain an initial frequency conversation feature vector; perform feature extraction based on the user conversation data using a topic model feature extraction method to obtain an initial topic model feature vector; perform feature extraction based on the user conversation data using a preset sentiment analysis model to obtain an initial sentiment analysis feature vector; normalize the initial frequency conversation feature vector, the initial topic model feature vector and the initial sentiment feature vector to obtain a frequency conversation feature vector, a topic model feature vector and a sentiment analysis feature vector; and concatenate the frequency conversation feature vector, the topic model feature vector and the sentiment analysis feature vector to obtain the user conversation feature data.

[0136] In the specific implementation process, the dialogue reply processing device also includes: a preset sentiment analysis model construction module, and the preset sentiment analysis model is specifically used to: annotate each historical dialogue data to obtain each label data, and the label data includes a sentiment label and a sentiment intensity identifier; based on each of the label data as a training sample, a preset cross entropy loss function is used to perform model training on the preset initial sentiment analysis model to obtain the preset sentiment analysis model that meets the preset conditions.

[0137] In the specific implementation process, the conversation feature extraction module 3 is also used to: perform sentiment analysis based on the user conversation data using a preset sentiment analysis model to obtain sentiment analysis prediction data and sentiment intensity prediction data; perform word segmentation processing on the sentiment analysis prediction data to obtain a number of word segments; perform word embedding processing on each of the word segments to obtain a first sentiment analysis feature vector; perform vectorization processing on the sentiment intensity prediction data to obtain a sentiment intensity vector; perform splicing processing based on the sentiment intensity vector and the first sentiment analysis feature vector to obtain the initial sentiment analysis feature vector.

[0138] In the specific implementation process, the reply text generation module 4 is specifically used to: vectorize the current conversation data and the historical conversation data to obtain a current conversation feature vector and a historical conversation feature vector; perform splicing processing based on the user behavior feature data, the user conversation feature data, the current conversation feature vector and the historical conversation feature vector to obtain a feature sequence; generate a reply text based on the feature sequence using the preset conversation generation model to obtain a reply text corresponding to the current conversation data.

[0139] In a specific implementation process, the conversation reply processing device also includes: an updating module, and the updating module is specifically used to update the user portrait corresponding to the user in the preset user feature library based on the user behavior feature data and the user conversation feature data.

[0140] This application uses a preset conversation generation model to generate reply text based on the user portrait data composed of the user behavior feature data and the user conversation feature data, combined with the current conversation data and the historical conversation feature vector of the context, to obtain a reply text corresponding to the current conversation data. This application uses user portrait data that considers user behavior feature data and user conversation feature data containing sentiment analysis feature vectors, combined with the current input text and context text to generate reply text. The reply text obtained by considering multiple source elements is more accurate, thereby improving user satisfaction and experience.

[0141] Another embodiment of the present application provides a storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the following method steps are implemented:

[0142] Step 1: In response to the user's input operation of current conversation data, extracting historical data corresponding to the user, the historical data including user behavior data and user conversation data;

[0143] Step 2: extracting features based on the user behavior data to obtain user behavior feature data;

[0144] Step 3: extracting features based on the user conversation data to obtain user conversation feature data, wherein the user conversation feature data includes a sentiment analysis feature vector;

[0145] Step 4: Based on the user behavior feature data, the user conversation feature data, the current conversation data and the user conversation data, a preset conversation generation model is used to generate a reply text to obtain a reply text corresponding to the current conversation data.

[0146] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0147] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0148] The specific implementation process of the above method steps can be found in the embodiments of any of the above-mentioned dialogue reply processing methods, and this embodiment will not be repeated here.

[0149] This application uses a preset conversation generation model to generate reply text based on the user portrait data composed of the user behavior feature data and the user conversation feature data, combined with the current conversation data and the historical conversation feature vector of the context, to obtain a reply text corresponding to the current conversation data. This application uses user portrait data that considers user behavior feature data and user conversation feature data containing sentiment analysis feature vectors, combined with the current input text and context text to generate reply text. The reply text obtained by considering multiple source elements is more accurate, thereby improving user satisfaction and experience.

[0150] Another embodiment of the present application provides an electronic device, which may be a server, and the electronic device includes a processor, a memory, a network interface, and a database connected via a system bus. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile and / or volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external client via a network connection. When the electronic device program is executed by the processor, it implements the functions or steps of a server-side method for processing a conversation reply.

[0151] In one embodiment, an electronic device is provided, which may be a client. The electronic device includes a processor, a memory, a network interface, a display screen, and an input device connected via a system bus. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external server via a network connection. When the electronic device program is executed by the processor, the functions or steps on the client side of a conversation reply processing method are implemented.

[0152] Another embodiment of the present application provides an electronic device, comprising at least a memory and a processor, wherein the memory stores a computer program, and the processor implements the following method steps when executing the computer program in the memory:

[0153] Step 1: In response to the user's input operation of current conversation data, extracting historical data corresponding to the user, the historical data including user behavior data and user conversation data;

[0154] Step 2: extracting features based on the user behavior data to obtain user behavior feature data;

[0155] Step 3: extracting features based on the user conversation data to obtain user conversation feature data, wherein the user conversation feature data includes a sentiment analysis feature vector;

[0156] Step 4: Based on the user behavior feature data, the user conversation feature data, the current conversation data and the user conversation data, a preset conversation generation model is used to generate a reply text to obtain a reply text corresponding to the current conversation data.

[0157] The specific implementation process of the above method steps can be found in the embodiments of any of the above-mentioned dialogue reply processing methods, and this embodiment will not be repeated here.

[0158] This application uses a preset conversation generation model to generate reply text based on the user portrait data composed of the user behavior feature data and the user conversation feature data, combined with the current conversation data and the historical conversation feature vector of the context, to obtain a reply text corresponding to the current conversation data. This application uses user portrait data that considers user behavior feature data and user conversation feature data containing sentiment analysis feature vectors, combined with the current input text and context text to generate reply text. The reply text obtained by considering multiple source elements is more accurate, thereby improving user satisfaction and experience.

[0159] The non-company software tools or components that appear in the embodiments of this application are merely examples and do not represent actual use. The above embodiments are only exemplary embodiments of this application and are not intended to limit this application. The scope of protection of this application is defined by the claims. Those skilled in the art may make various modifications or equivalent substitutions to this application within the essence and scope of protection of this application, and such modifications or equivalent substitutions shall also be deemed to fall within the scope of protection of this application.

Claims

1. A method for processing a dialogue reply, characterized in that: include: In response to an input operation of the user's current conversation data, extracting historical data corresponding to the user, the historical data including user behavior data and user conversation data; Perform feature extraction based on the user behavior data to obtain user behavior feature data; Perform feature extraction based on the user conversation data to obtain user conversation feature data, wherein the user conversation feature data includes a sentiment analysis feature vector; Based on the user behavior feature data, the user conversation feature data, the current conversation data and the user conversation data, a preset conversation generation model is used to generate a reply text to obtain a reply text corresponding to the current conversation data.

2. The method according to claim 1, characterized in that The extracting features based on the user behavior data to obtain user behavior feature data specifically includes: Extracting time features based on the user behavior data to obtain an initial time feature vector corresponding to the user behavior data; Normalizing the initial time feature vector to obtain a behavior time feature vector; Extract frequency features based on the user behavior data to obtain an initial frequency feature vector corresponding to the user behavior data; Normalizing the initial frequency feature vector to obtain a behavior frequency feature vector; The behavior time feature vector and the behavior frequency feature vector are concatenated to obtain the user behavior feature data.

3. The method according to claim 1, characterized in that The extracting features based on the user conversation data to obtain the user conversation feature data specifically includes: Based on the user conversation data, feature extraction is performed using frequency and inverse document frequency feature extraction methods to obtain an initial frequency conversation feature vector; Based on the user conversation data, feature extraction is performed using a topic model feature extraction method to obtain an initial topic model feature vector; Based on the user conversation data, a preset sentiment analysis model is used to perform feature extraction to obtain an initial sentiment analysis feature vector; Normalizing the initial frequency conversation feature vector, the initial topic model feature vector, and the initial emotion feature vector to obtain a frequency conversation feature vector, a topic model feature vector, and an emotion analysis feature vector; The frequency conversation feature vector, the topic model feature vector, and the sentiment analysis feature vector are concatenated to obtain the user conversation feature data.

4. The method according to claim 3, characterized in that Before extracting features using a preset sentiment analysis model based on the user conversation data, the method further includes: constructing the preset sentiment analysis model; The constructing of the preset sentiment analysis model specifically includes: Labeling each historical conversation data to obtain each label data, wherein the label data includes an emotion label and an emotion intensity identifier; Based on each of the label data as a training sample, a preset cross entropy loss function is used to perform model training on the preset initial sentiment analysis model to obtain the preset sentiment analysis model that meets the preset conditions.

5. The method according to claim 3, characterized in that The extracting features based on the user conversation data using a preset sentiment analysis model to obtain an initial sentiment analysis feature vector specifically includes: Based on the user conversation data, a preset sentiment analysis model is used to perform sentiment analysis to obtain sentiment analysis prediction data and sentiment intensity prediction data; Performing word segmentation processing on the sentiment analysis prediction data to obtain a number of word segments; Performing word embedding processing on each of the word segments to obtain a first sentiment analysis feature vector; Vectorizing the emotion intensity prediction data to obtain an emotion intensity vector; The initial sentiment analysis feature vector is obtained by performing concatenation processing based on the sentiment intensity vector and the first sentiment analysis feature vector.

6. The method according to claim 1, characterized in that The step of generating a reply text based on the user behavior feature data, the user conversation feature data, the current conversation data, and the user conversation data using a preset conversation generation model to obtain a reply text corresponding to the current conversation data specifically includes: Performing vectorization processing on the current conversation data and the historical conversation data to obtain a current conversation feature vector and a historical conversation feature vector; Performing concatenation processing based on the user behavior feature data, the user conversation feature data, the current conversation feature vector, and the historical conversation feature vector to obtain a feature sequence; Based on the feature sequence, the preset dialogue generation model is used to generate a reply text to obtain a reply text corresponding to the current dialogue data.

7. The method according to claim 6, characterized in that The method further comprises: The user portrait corresponding to the user in the preset user feature library is updated based on the user behavior feature data and the user conversation feature data.

8. A conversation reply processing device, characterized in that: include: A data extraction module, configured to extract historical data corresponding to the user in response to an input operation of the user's current conversation data, wherein the historical data includes user behavior data and user conversation data; A behavior feature extraction module, used to extract features based on the user behavior data to obtain user behavior feature data; A conversation feature extraction module, used to perform feature extraction based on the user conversation data to obtain user conversation feature data, wherein the user conversation feature data includes a sentiment analysis feature vector; The reply text generation module is used to generate a reply text based on the user behavior feature data, the user conversation feature data, the current conversation data and the user conversation data using a preset conversation generation model to obtain a reply text corresponding to the current conversation data.

9. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the conversation reply processing method described in any one of claims 1 to 7 are implemented.

10. An electronic device, characterized in that: The method comprises at least a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the conversation reply processing method according to any one of claims 1 to 7 when executing the computer program on the memory.