Artificial intelligence-based dialogue processing method and device
By building a sentiment analysis network model and data tensor set optimization technology, the problems of long time consumption and low accuracy in artificial intelligence dialogue processing were solved, and efficient dialogue processing and improved user experience were achieved.
Patent Information
- Application Number
- CN202510780099.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-12
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2045-06-12
AI Technical Summary
When dealing with the complex context and semantics of Chinese, existing technologies use artificial intelligence for dialogue processing, which takes a long time, has low recognition accuracy and generalization capabilities, resulting in low efficiency and affecting user experience.
By building a sentiment analysis network model, performing data recognition and text mapping, calculating the attention distribution of word vectors, generating sentiment data and scene data tensors, and using the dialogue tensor set to optimize the dialogue model, dialogue processing for new users is realized.
It improves the efficiency and intelligence of artificial intelligence software dialogue processing, enhances the accuracy and generalization ability of dialogue intent recognition, and improves user experience.
Smart Images

Figure CN120316248B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a dialogue processing method and device based on artificial intelligence. Background Art
[0002] With the rapid development of science and technology and the improvement of people's living standards, artificial intelligence has made many breakthroughs in dialogue systems.
[0003] Currently, AI-based dialogue processing in this field is typically based on rule-based or learning methods. This approach uses dialogue management to produce corresponding decisions by identifying, analyzing, and understanding the user's expressed intentions. However, current methods require a long time to process the complex context and semantics of Chinese. Furthermore, the accuracy and generalization capabilities of AI-based dialogue processing are low, resulting in low dialogue processing efficiency and a negative impact on the user's experience. Summary of the Invention
[0004] Based on this, the purpose of the present invention is to provide a dialogue processing method and device based on artificial intelligence to at least solve the deficiencies in the above-mentioned technology.
[0005] The present invention proposes a dialogue processing method based on artificial intelligence, comprising:
[0006] Obtain historical conversation data of several users on the artificial intelligence software, and construct a user dataset for each user based on the historical conversation data;
[0007] Constructing a sentiment analysis network model, and using the sentiment analysis network model to perform data recognition on the user data set to obtain recognition results with different sentiment types;
[0008] Performing text mapping on the user dataset to obtain corresponding word vectors, encoding the word vectors, and encoding the obtained word vectors to calculate the attention distribution of the user dataset;
[0009] Constructing an emotion label, and performing data processing on the attention distribution of the user data set according to the emotion label to obtain corresponding emotion data and corresponding scene data;
[0010] Performing intent prediction on the recognition result, and performing intent classification based on the intent prediction result to obtain a corresponding intent classification result, and generating a corresponding emotion data tensor, a scene data tensor, and an intent classification tensor according to the emotion data, the scene data, and the intent classification result;
[0011] A conversation tensor set is generated using the emotion data tensor, the scene data tensor, and the intention classification tensor, a preset conversation model is optimized using the conversation tensor set, and conversation processing for new users is implemented using the obtained conversation processing model.
[0012] Furthermore, the step of constructing a user data set for each user based on each of the historical conversation data includes:
[0013] Performing data annotation on each of the historical conversation data to obtain corresponding data annotation results;
[0014] The data annotation results are input into a preset intent classification model for processing to obtain a user data set corresponding to each of the users, wherein the user data set at least includes the corresponding user intent.
[0015] Furthermore, the steps of performing data recognition on the user data set using the sentiment analysis network model to obtain recognition results with different sentiment types include:
[0016] Defining an emotion type, and performing a simulated reply on the user data set based on the emotion type and the emotion analysis network model to obtain a corresponding reply result;
[0017] The reply results are input into a preset emotion database for data recognition to obtain recognition results with different emotion types.
[0018] Furthermore, the steps of performing text mapping on the user dataset to obtain corresponding word vectors, encoding the word vectors, and encoding the obtained word vectors to calculate the attention distribution of the user dataset include:
[0019] Performing text mapping on the user dataset using a word vector model to obtain corresponding word vectors, and encoding the word vectors using a bidirectional recurrent neural network model to obtain corresponding forward word vector encoding and reverse word vector encoding;
[0020] The forward word vector encoding and the reverse word vector encoding are spliced together, and the spliced output data is projected into several different subspaces to obtain corresponding output weights to calculate the attention distribution of the user data set.
[0021] Furthermore, the calculation formulas for the forward word vector encoding and the reverse word vector encoding are:
[0022] ;
[0023] ;
[0024] Where, and Respectively The word vector output at the previous moment, Indicates the The input word vector at time t;
[0025] The calculation formula for the attention distribution of the user dataset is:
[0026] ;
[0027] ;
[0028] ;
[0029] ;
[0030] Where, Represents the output data obtained by concatenating the forward word vector encoding and the reverse word vector encoding, Indicates the All the time The activation function is used to output the data The output vector obtained by calculation is used to represent the degree of influence of the input data on the final sentiment classification; express The parameters of the activation function, Indicates output data The weight coefficient of Indicates the Output data at time Project to The output weights obtained from different subspaces are 、 、 Indicates the The projection matrix of the subspace, Indicates the All the time The output vector of the activation function, Indicates output data The total number of Indicates the Output data at time The attention weight is used to output the corresponding attention distribution according to the attention weight. ; represents the preset gating parameter matrix, express function.
[0031] Furthermore, the steps of performing intent prediction on the recognition result and performing intent classification based on the intent prediction result to obtain a corresponding intent classification result include:
[0032] Predict the intent of the recognition result, capture the context information of the recognition result through an attention mechanism, and obtain the decoded semantic representation of the recognition result through a cross-fusion algorithm;
[0033] The context information and the semantic decoding representation are concatenated to obtain a word decoding vector corresponding to the recognition result, and the word decoding vectors are summarized to obtain a corresponding intent classification result.
[0034] The present invention also provides an artificial intelligence-based dialogue processing device, comprising:
[0035] A data acquisition module is used to obtain historical conversation data of several users on the artificial intelligence software, and to construct a user data set for each user based on each historical conversation data;
[0036] A model building module is used to build a sentiment analysis network model and use the sentiment analysis network model to perform data recognition on the user data set to obtain recognition results with different sentiment types;
[0037] A text mapping module is used to perform text mapping on the user data set to obtain corresponding word vectors, encode the word vectors, and calculate the attention distribution of the user data set by encoding the obtained word vectors;
[0038] A data processing module, configured to construct an emotion label and perform data processing on the attention distribution of the user data set according to the emotion label to obtain corresponding emotion data and corresponding scene data;
[0039] An intention prediction module is used to predict the intention of the recognition result, and to classify the intention based on the intention prediction result to obtain a corresponding intention classification result, and to generate a corresponding emotion data tensor, a scene data tensor, and an intention classification tensor according to the emotion data, the scene data, and the intention classification result;
[0040] A dialogue processing module is used to generate a dialogue tensor set using the emotion data tensor, the scene data tensor and the intention classification tensor, optimize a preset dialogue model using the dialogue tensor set, and implement dialogue processing for new users using the obtained dialogue processing model.
[0041] Furthermore, the data acquisition module includes:
[0042] A data annotation unit, configured to perform data annotation on each of the historical conversation data to obtain corresponding data annotation results;
[0043] The annotation processing unit is used to input the data annotation results into a preset intention classification model for processing to obtain a user data set corresponding to each of the users, wherein the user data set at least includes the corresponding user intention.
[0044] Furthermore, the model building module includes:
[0045] A simulation reply unit, configured to define an emotion type and perform a simulation reply on the user data set based on the emotion type and the emotion analysis network model to obtain a corresponding reply result;
[0046] The data recognition unit is used to input the reply result into a preset emotion database for data recognition to obtain recognition results with different emotion types.
[0047] Furthermore, the text mapping module includes:
[0048] A text mapping unit, configured to perform text mapping on the user data set using a word vector model to obtain corresponding word vectors, and to encode the word vectors using a bidirectional recurrent neural network model to obtain corresponding forward word vector encoding and reverse word vector encoding;
[0049] A data calculation unit is used to splice the forward word vector encoding and the reverse word vector encoding, and project the spliced output data into several different subspaces to obtain corresponding output weights, so as to calculate the attention distribution of the user data set.
[0050] Furthermore, the intention prediction module includes:
[0051] An intent prediction unit, configured to predict the intent of the recognition result, capture the contextual information of the recognition result through an attention mechanism, and obtain a decoded semantic representation of the recognition result through a cross-fusion algorithm;
[0052] An intent classification unit is used to concatenate the context information and the semantic decoding representation to obtain a word decoding vector corresponding to the recognition result, and to summarize the word decoding vectors to obtain a corresponding intent classification result.
[0053] The present invention also provides a storage medium on which a computer program is stored, and when the program is executed by a processor, the above-mentioned artificial intelligence-based dialogue processing method is implemented.
[0054] The present invention also proposes a computer comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned artificial intelligence-based dialogue processing method when executing the computer program.
[0055] The artificial intelligence-based dialogue processing method and device in the present invention constructs a data set of historical dialogue data of several users, performs text mapping through the constructed data set, and uses emotional tags to calculate the attention distribution of the data set, thereby realizing the separation of emotional data and scene data, so as to realize the model's perception ability of scene data and emotional data, and improve the function of dialogue processing. By predicting the intention of the recognition results, a corresponding dialogue tensor set is constructed, and the dialogue model is optimized using the dialogue tensor set, thereby realizing dialogue processing for new users. By integrating emotional data, scene data and corresponding intent classification, the artificial intelligence software can effectively decompose user dialogue data, thereby improving the communication efficiency and intelligence of the artificial intelligence software. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 is a flow chart of the artificial intelligence-based dialogue processing method in the first embodiment of the present invention;
[0057] Figure 2 is a structural block diagram of an artificial intelligence-based dialogue processing device in a second embodiment of the present invention;
[0058] Figure 3 FIG. 4 is a structural block diagram of a computer in a third embodiment of the present invention.
[0059] The following specific embodiments will further illustrate the present invention in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION
[0060] To facilitate understanding of the present invention, the present invention will be described more fully below with reference to the accompanying drawings. The drawings illustrate several embodiments of the present invention. However, the present invention may be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and comprehensive understanding of the present invention.
[0061] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one skilled in the art to which this invention pertains. The terms used in this specification of the present invention are for the purpose of describing specific embodiments only and are not intended to limit the present invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0062] Example 1
[0063] See also Figure 1 , which shows a dialogue processing method based on artificial intelligence in a first embodiment of the present invention, and specifically includes steps S101 to S106:
[0064] S101, obtaining historical conversation data of several users on artificial intelligence software, and constructing a user data set for each user based on the historical conversation data;
[0065] Furthermore, the step S101 specifically includes steps S1011 to S1012:
[0066] S1011, performing data annotation on each of the historical conversation data to obtain corresponding data annotation results;
[0067] S1012: Input the data annotation results into a preset intent classification model for processing to obtain a user data set corresponding to each of the users, wherein the user data set at least includes the corresponding user intent.
[0068] In a specific implementation, historical conversation data of several users with artificial intelligence software is obtained, where the artificial intelligence software can be software applied to a communication device and capable of implementing related functions such as data interaction and voice interaction. The historical conversation data is generated by the user's voice interaction and / or text interaction with the artificial intelligence software and is stored in the cloud server of the artificial intelligence software;
[0069] The collected historical conversation data is preprocessed to remove irrelevant characters, punctuation marks, and word segmentation. The preprocessed data is then labeled by professionals using predefined data labeling rules. Cross-validation is performed during the labeling process to obtain the corresponding data labeling results.
[0070] Specifically, a number of text information with user intentions are obtained, and mapping is performed based on the text information and the corresponding user intentions to construct a corresponding intention classification model, and the data standard results are input into the preset intention classification model for processing to obtain the user data set corresponding to each user. It can be understood that constructing the data set corresponding to the user by combining the user intentions and the results of data annotation can enable the model to identify the user intention information in the data more quickly, thereby improving the data processing accuracy and data processing efficiency of the model.
[0071] S102, constructing a sentiment analysis network model, and using the sentiment analysis network model to perform data recognition on the user data set to obtain recognition results with different sentiment types;
[0072] Furthermore, the step S102 specifically includes steps S1021 and S1022:
[0073] S1021, defining an emotion type, and performing a simulated reply on the user dataset based on the emotion type and the emotion analysis network model to obtain a corresponding reply result;
[0074] S1022: Input the reply result into a preset emotion database for data recognition to obtain recognition results with different emotion types.
[0075] In the specific implementation, data with completed emotion type labeling is obtained, and the data is input into a preset emotion analysis sub-model (in this embodiment, the emotion analysis sub-model selects the BERT model or the Word2Vec model), and the training network of the sub-model is defined. The model training and model verification are performed using the data to obtain the corresponding emotion analysis network model. Specifically, the emotion type is defined, wherein, in this embodiment, the emotion type includes but is not limited to like, anger, sadness, happiness, disgust and the like. Based on the emotion type and the above-mentioned emotion analysis network model, a simulated reply is performed on the user data set, and the obtained reply result is input into the preset emotion database for data recognition to obtain recognition results with different emotion types. It can be understood that when the emotion type is the like type, the reply result obtained by simulating the reply to the user data set through the emotion analysis network model will contain the vocabulary or corresponding template information corresponding to the like type after data recognition through the emotion database.
[0076] S103, performing text mapping on the user dataset to obtain corresponding word vectors, encoding the word vectors, and calculating the attention distribution of the user dataset using the obtained word vector encoding;
[0077] Furthermore, the step S103 specifically includes steps S1031 and S1032:
[0078] S1031, using a word vector model to perform text mapping on the user dataset to obtain corresponding word vectors, and using a bidirectional recurrent neural network model to encode the word vectors to obtain corresponding forward word vector encoding and reverse word vector encoding;
[0079] S1032: Concatenate the forward word vector code and the reverse word vector code, and project the concatenated output data into several different subspaces to obtain corresponding output weights, so as to calculate the attention distribution of the user data set.
[0080] In a specific implementation, a word vector model (in this embodiment, the word vector model includes the GloVe model, the ELMo model, and the FastText model) is used to perform text mapping on the user data set to obtain the corresponding word vector, and a bidirectional recurrent neural network model (in this embodiment, the model includes the bidirectional GRU model, the bidirectional LSTM model, and the stacked bidirectional GRU model) is used to encode the word vector to obtain the corresponding forward word vector encoding and reverse word vector encoding, wherein the calculation formulas for the forward word vector encoding and the reverse word vector encoding are:
[0081] ;
[0082] ;
[0083] Where, and Respectively The word vector output at the previous moment, Indicates the The input word vector at time t;
[0084] Furthermore, the obtained forward word vector encoding and reverse word vector encoding are concatenated:
[0085] ;
[0086] The spliced output data Project to Different subspaces get the corresponding output weights:
[0087] ;
[0088] Where, 、 、 Indicates the The projection matrix of the subspace.
[0089] According to the calculated output weight and output data Calculate the attention distribution of the user dataset:
[0090] ;
[0091] ;
[0092] Where, Indicates the All the time The activation function is used to output the data The output vector obtained by calculation is used to represent the degree of influence of the input data on the final sentiment classification; express The parameters of the activation function, Indicates output data The weight coefficient of Indicates the All the time The output vector of the activation function, Indicates output data The total number of Indicates the Output data at time The attention weight of represents the preset gating parameter matrix, express function;
[0093] According to the above attention weight Output corresponding attention distribution .
[0094] S104, constructing an emotion label, and performing data processing on the attention distribution of the user data set according to the emotion label to obtain corresponding emotion data and corresponding scene data;
[0095] In specific implementation, corresponding emotion labels are constructed according to the above-mentioned emotion types, and the attention distribution of the user data set is processed by combining the word vector model and the inverse document frequency model to generate corresponding scene data. The attention distribution of the user data set is processed according to the emotion label, and a matching search is performed in the corresponding emotion expression library to form the corresponding emotion data. In this embodiment, after the attention distribution of the user data set is processed by setting a user threshold, the data with a calculated value greater than the threshold is marked as emotion data, and the data with a value less than the threshold is marked as scene data. In this way, the scene data and emotion data in the user data set can be separated more accurately, so as to realize the model's perception ability of scene data and emotion data and enhance the function of dialogue processing.
[0096] S105, performing intent prediction on the recognition result, and performing intent classification based on the intent prediction result to obtain a corresponding intent classification result, and generating a corresponding emotion data tensor, a scene data tensor, and an intent classification tensor according to the emotion data, the scene data, and the intent classification result;
[0097] Furthermore, the step S105 specifically includes steps S1051 and S1052:
[0098] S1051, performing intent prediction on the recognition result, capturing contextual information of the recognition result through an attention mechanism, and obtaining a decoded semantic representation of the recognition result through a cross-fusion algorithm;
[0099] S1052: Concatenate the context information and the semantic decoding representation to obtain a word decoding vector corresponding to the recognition result, and summarize the word decoding vectors to obtain a corresponding intent classification result.
[0100] In specific implementation, the recognition result is defined as , where each input word is mapped to a distributed word vector through the embedding layer, the vocabulary Each word in dimensional vector, stored in the word vector matrix , Indicates the vocabulary size, each word is represented as a word vector , therefore, the recognition results are finally encoded as a word vector sequence 、 ,in, is the sentence length.
[0101] Furthermore, in the encoding phase, the bidirectional LSTM-based encoder receives the word vector sequence of the sentence, and the output hidden state sequence is defined as , that is, the context vector corresponding to the context information of the recognition result;
[0102] In the decoding process, the weight distribution of the encoding state is calculated based on the output of the encoding process to generate the semantic attention vector and the intention recognition attention vector , where the intention recognition attention vector is the decoded semantic representation of the recognition result. At the same time, a gating mechanism is introduced to interactively fuse the semantic attention vector and the intention recognition attention vector to generate a complementary vector and , the final decoding process is defined as and ,in, That is, the decoding vector corresponding to the recognition result. The fully connected layer is used to output the decoding process to obtain the word-level intent recognition result. The intent classification of each word is summarized to obtain the final intent classification result.
[0103] Furthermore, the emotion data, scene data and intention classification results obtained above are used for tensor processing to generate corresponding emotion data tensors, scene data tensors and intention classification tensors.
[0104] S106, using the emotion data tensor, the scene data tensor and the intention classification tensor to generate a dialogue tensor set, using the dialogue tensor set to optimize the preset dialogue model, and using the obtained dialogue processing model to implement dialogue processing for new users.
[0105] In specific implementation, tensor fusion is performed using the emotion data tensor, the scene data tensor, and the intent classification tensor to obtain a corresponding dialogue tensor set, and the dialogue tensor set is used to optimize the preset dialogue model. Specifically, a preset dialogue model is selected. In this embodiment, the Hybrid model is taken as an example. It can be understood that in other optional embodiments, the model can also use other basic models, such as: RNN model, self-attention training model, etc. The spatiotemporal features and multimodal information of the dialogue tensor set are used to perform stage training on the Hybrid model. LAMB is selected as the optimizer, and the initial learning rate is set to 3e-5. Cosine annealing is used to gradually increase the learning rate in the first 10% of the training steps, and then gradually decay. At the same time, the model's intent recognition and corresponding emotional response are optimized to obtain a dialogue processing model, which is used to implement dialogue processing for new users.
[0106] In summary, the artificial intelligence-based dialogue processing method in the above-mentioned embodiment of the present invention constructs a data set of historical dialogue data of several users, performs text mapping through the constructed data set, and uses emotional tags to calculate the attention distribution of the data set, thereby realizing the separation of emotional data and scene data, so as to realize the model's perception ability of scene data and emotional data, and improve the function of dialogue processing. By predicting the intention of the recognition results, a corresponding dialogue tensor set is constructed, and the dialogue model is optimized using the dialogue tensor set, thereby realizing dialogue processing for new users. By integrating emotional data, scene data and corresponding intent classification, the artificial intelligence software can effectively decompose user dialogue data, thereby improving the communication efficiency and intelligence of the artificial intelligence software.
[0107] Example 2
[0108] On the other hand, the present invention also proposes a dialogue processing device based on artificial intelligence, please refer to Figure 2 , which shows a conversation processing device based on artificial intelligence in a second embodiment of the present invention, the system includes:
[0109] The data acquisition module 11 is used to obtain historical conversation data of several users on the artificial intelligence software, and to construct a user data set for each user based on each historical conversation data;
[0110] Furthermore, the data acquisition module 11 includes:
[0111] A data annotation unit, configured to perform data annotation on each of the historical conversation data to obtain corresponding data annotation results;
[0112] The annotation processing unit is used to input the data annotation results into a preset intention classification model for processing to obtain a user data set corresponding to each of the users, wherein the user data set at least includes the corresponding user intention.
[0113] A model building module 12 is used to build a sentiment analysis network model and use the sentiment analysis network model to perform data recognition on the user data set to obtain recognition results with different sentiment types;
[0114] Furthermore, the model building module 12 includes:
[0115] A simulation reply unit, configured to define an emotion type and perform a simulation reply on the user data set based on the emotion type and the emotion analysis network model to obtain a corresponding reply result;
[0116] The data recognition unit is used to input the reply result into a preset emotion database for data recognition to obtain recognition results with different emotion types.
[0117] A text mapping module 13 is configured to perform text mapping on the user dataset to obtain corresponding word vectors, encode the word vectors, and calculate the attention distribution of the user dataset using the obtained word vector encoding;
[0118] Furthermore, the text mapping module 13 includes:
[0119] A text mapping unit, configured to perform text mapping on the user data set using a word vector model to obtain corresponding word vectors, and to encode the word vectors using a bidirectional recurrent neural network model to obtain corresponding forward word vector encoding and reverse word vector encoding;
[0120] A data calculation unit is used to splice the forward word vector encoding and the reverse word vector encoding, and project the spliced output data into several different subspaces to obtain corresponding output weights, so as to calculate the attention distribution of the user data set.
[0121] A data processing module 14 is used to construct an emotion label and perform data processing on the attention distribution of the user data set according to the emotion label to obtain corresponding emotion data and corresponding scene data;
[0122] An intention prediction module 15 is configured to perform intention prediction on the recognition result, and perform intention classification based on the intention prediction result to obtain a corresponding intention classification result, and generate a corresponding emotion data tensor, a scene data tensor, and an intention classification tensor according to the emotion data, the scene data, and the intention classification result;
[0123] Furthermore, the intention prediction module 15 includes:
[0124] An intent prediction unit, configured to predict the intent of the recognition result, capture the contextual information of the recognition result through an attention mechanism, and obtain a decoded semantic representation of the recognition result through a cross-fusion algorithm;
[0125] An intent classification unit is used to concatenate the context information and the semantic decoding representation to obtain a word decoding vector corresponding to the recognition result, and to summarize the word decoding vectors to obtain a corresponding intent classification result.
[0126] The dialogue processing module 16 is used to generate a dialogue tensor set using the emotion data tensor, the scene data tensor and the intention classification tensor, optimize the preset dialogue model using the dialogue tensor set, and implement dialogue processing for new users using the obtained dialogue processing model.
[0127] The functions or operation steps implemented when the above modules and units are executed are substantially the same as those in the above method embodiments and will not be repeated here.
[0128] The artificial intelligence-based dialogue processing device provided in the embodiment of the present invention has the same implementation principle and technical effects as the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the system embodiment, reference can be made to the corresponding content in the aforementioned method embodiment.
[0129] Example 3
[0130] The present invention also provides a computer, see Figure 3 , shown is a computer in the third embodiment of the present invention, including a memory 10, a processor 20, and a computer program 30 stored in the memory 10 and executable on the processor 20. When the processor 20 executes the computer program 30, the above-mentioned artificial intelligence-based dialogue processing method is implemented.
[0131] The memory 10 includes at least one type of storage medium, including flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 10 may be an internal storage unit of a computer, such as the computer's hard disk. In other embodiments, the memory 10 may also be an external storage device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash memory card, etc. Furthermore, the memory 10 may include both an internal storage unit of the computer and an external storage device. The memory 10 can be used not only to store application software installed in the computer and various types of data, but also to temporarily store data that has been output or is about to be output.
[0132] Among them, in some embodiments, the processor 20 can be an electronic control unit (Electronic Control Unit, abbreviated as ECU, also known as a vehicle computer), a central processing unit (CPU), a controller, a microcontroller, a microprocessor or other data processing chip, used to run the program code stored in the memory 10 or process data, such as executing access restriction programs.
[0133] It should be pointed out that Figure 3 The structure shown does not constitute a limitation of the computer. In other embodiments, the computer may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0134] An embodiment of the present invention further provides a storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned artificial intelligence-based dialogue processing method.
[0135] Those skilled in the art will appreciate that the logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, apparatus, or device (e.g., a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device), or in conjunction with such instruction execution system, apparatus, or device. For purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by an instruction execution system, apparatus, or device, or in conjunction with such instruction execution system, apparatus, or device.
[0136] More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection with one or more wires (electronic devices), a portable computer disk cartridge (magnetic devices), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disc read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting, or processing it in another suitable manner as necessary, and then storing it in a computer memory.
[0137] It should be understood that various components of the present invention may be implemented using hardware, software, firmware, or a combination thereof. In the aforementioned embodiments, multiple steps or methods may be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one or a combination of the following technologies known in the art may be used: a discrete logic circuit having logic gate circuits for implementing logic functions on data signals, an application-specific integrated circuit having suitable combinational logic gate circuits, a programmable gate array (PGA), a field-programmable gate array (FPGA), etc.
[0138] The technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above-mentioned embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0139] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
Claims
1. A conversation processing method based on artificial intelligence, characterized in that: include: Obtain historical conversation data of several users on the artificial intelligence software, and construct a user dataset for each user based on the historical conversation data; Constructing a sentiment analysis network model, and using the sentiment analysis network model to perform data recognition on the user data set to obtain recognition results with different sentiment types; Performing text mapping on the user dataset to obtain corresponding word vectors, encoding the word vectors, and encoding the obtained word vectors to calculate the attention distribution of the user dataset; Constructing an emotion label, and performing data processing on the attention distribution of the user data set according to the emotion label to obtain corresponding emotion data and corresponding scene data; Performing intent prediction on the recognition result, and performing intent classification based on the intent prediction result to obtain a corresponding intent classification result, and generating a corresponding emotion data tensor, a scene data tensor, and an intent classification tensor according to the emotion data, the scene data, and the intent classification result; Generate a conversation tensor set using the emotion data tensor, the scene data tensor, and the intent classification tensor, optimize a preset conversation model using the conversation tensor set, and implement conversation processing for new users using the resulting conversation processing model; The steps of performing text mapping on the user data set to obtain corresponding word vectors, encoding the word vectors, and encoding the obtained word vectors to calculate the attention distribution of the user data set include: Performing text mapping on the user dataset using a word vector model to obtain corresponding word vectors, and encoding the word vectors using a bidirectional recurrent neural network model to obtain corresponding forward word vector encoding and reverse word vector encoding; Concatenating the forward word vector encoding and the reverse word vector encoding, and projecting the concatenated output data into several different subspaces to obtain corresponding output weights, so as to calculate the attention distribution of the user data set; The calculation formulas for the forward word vector encoding and the reverse word vector encoding are: ; ; Where, and Respectively The word vector output at the previous moment, Indicates the The input word vector at time t; The calculation formula for the attention distribution of the user dataset is: ; ; ; ; Where, Represents the output data obtained by concatenating the forward word vector encoding and the reverse word vector encoding, Indicates the All the time The activation function is used to output the data The output vector obtained by calculation is used to represent the degree of influence of the input data on the final sentiment classification; express The parameters of the activation function, Indicates output data The weight coefficient of Indicates the Output data at time Project to The output weights obtained from different subspaces are 、 、 Indicates the The projection matrix of the subspace, Indicates the All the time The output vector of the activation function, Indicates output data The total number of Indicates the Output data at time The attention weight is used to output the corresponding attention distribution according to the attention weight. ; represents the preset gating parameter matrix, express function; The steps of constructing an emotion label and performing data processing on the attention distribution of the user data set according to the emotion label to obtain corresponding emotion data and corresponding scene data include: Constructing corresponding emotion tags according to the emotion types, and processing the attention distribution of the user data set by combining the word vector model and the inverse document frequency model to generate corresponding scene data; The attention distribution of the user data set is processed according to the emotional label, and a matching search is performed in the corresponding emotional expression library to form corresponding emotional data. After the attention distribution of the user data set is processed by setting a user threshold, the data with a calculated value greater than the threshold is marked as emotional data, and the data less than the threshold is marked as scene data.
2. The artificial intelligence-based dialogue processing method according to claim 1, characterized in that: The step of constructing a user data set for each user based on each of the historical conversation data includes: Performing data annotation on each of the historical conversation data to obtain corresponding data annotation results; The data annotation results are input into a preset intent classification model for processing to obtain a user data set corresponding to each of the users, wherein the user data set at least includes the corresponding user intent.
3. The artificial intelligence-based dialogue processing method according to claim 1, characterized in that: The steps of performing data recognition on the user data set using the sentiment analysis network model to obtain recognition results with different sentiment types include: Defining an emotion type, and performing a simulated reply on the user data set based on the emotion type and the emotion analysis network model to obtain a corresponding reply result; The reply results are input into a preset emotion database for data recognition to obtain recognition results with different emotion types.
4. The artificial intelligence-based dialogue processing method according to claim 1, characterized in that: The steps of performing intent prediction on the recognition result and performing intent classification based on the intent prediction result to obtain a corresponding intent classification result include: Predict the intent of the recognition result, capture the context information of the recognition result through an attention mechanism, and obtain the decoded semantic representation of the recognition result through a cross-fusion algorithm; The context information and the decoded semantic representation are concatenated to obtain a word decoding vector corresponding to the recognition result, and the word decoding vectors are summarized to obtain a corresponding intent classification result.
5. A conversation processing device based on artificial intelligence, characterized in that: include: A data acquisition module is used to obtain historical conversation data of several users on the artificial intelligence software, and to construct a user data set for each user based on each historical conversation data; A model building module is used to build a sentiment analysis network model and use the sentiment analysis network model to perform data recognition on the user data set to obtain recognition results with different sentiment types; A text mapping module is used to perform text mapping on the user data set to obtain corresponding word vectors, encode the word vectors, and calculate the attention distribution of the user data set by encoding the obtained word vectors; A data processing module, configured to construct an emotion label and perform data processing on the attention distribution of the user data set according to the emotion label to obtain corresponding emotion data and corresponding scene data; An intention prediction module is used to predict the intention of the recognition result, and to classify the intention based on the intention prediction result to obtain a corresponding intention classification result, and to generate a corresponding emotion data tensor, a scene data tensor, and an intention classification tensor according to the emotion data, the scene data, and the intention classification result; a dialogue processing module, configured to generate a dialogue tensor set using the emotion data tensor, the scene data tensor, and the intent classification tensor, optimize a preset dialogue model using the dialogue tensor set, and implement dialogue processing for new users using the resulting dialogue processing model; Wherein, the text mapping module includes: A text mapping unit, configured to perform text mapping on the user data set using a word vector model to obtain corresponding word vectors, and to encode the word vectors using a bidirectional recurrent neural network model to obtain corresponding forward word vector encoding and reverse word vector encoding; A data calculation unit, configured to concatenate the forward word vector encoding and the reverse word vector encoding, and project the concatenated output data into a plurality of different subspaces to obtain corresponding output weights, so as to calculate the attention distribution of the user data set; The calculation formulas for the forward word vector encoding and the reverse word vector encoding are: ; ; Where, and Respectively The word vector output at the previous moment, Indicates the The input word vector at time t; The calculation formula for the attention distribution of the user dataset is: ; ; ; ; Where, Represents the output data obtained by concatenating the forward word vector encoding and the reverse word vector encoding, Indicates the All the time The activation function is used to output the data The output vector obtained by calculation is used to represent the degree of influence of the input data on the final sentiment classification; express The parameters of the activation function, Indicates output data The weight coefficient of Indicates the Output data at time Project to The output weights obtained from different subspaces are 、 、 Indicates the The projection matrix of the subspace, Indicates the All the time The output vector of the activation function, Indicates output data The total number of Indicates the Output data at time The attention weight is used to output the corresponding attention distribution according to the attention weight. ; represents the preset gating parameter matrix, express function; The data processing module is specifically used for: Constructing corresponding emotion tags according to the emotion types, and processing the attention distribution of the user data set by combining the word vector model and the inverse document frequency model to generate corresponding scene data; The attention distribution of the user data set is processed according to the emotional label, and a matching search is performed in the corresponding emotional expression library to form corresponding emotional data. After the attention distribution of the user data set is processed by setting a user threshold, the data with a calculated value greater than the threshold is marked as emotional data, and the data less than the threshold is marked as scene data.
6. The artificial intelligence-based dialogue processing device according to claim 5, characterized in that: The data acquisition module includes: A data annotation unit, configured to perform data annotation on each of the historical conversation data to obtain corresponding data annotation results; The annotation processing unit is used to input the data annotation results into a preset intention classification model for processing to obtain a user data set corresponding to each of the users, wherein the user data set at least includes the corresponding user intention.
7. A storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the artificial intelligence-based dialogue processing method according to any one of claims 1 to 4 is implemented.
8. A computer comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the artificial intelligence-based dialogue processing method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Intelligent emotion recognition method and device and computer readable storage medium
CN111241828A
Response method and device
CN119003710A
AI intelligent customer service response method and system based on remote digital service
CN119719319A
Online comment sentiment classification method based on BERT, BiGRU and multi-head attention mechanism
CN120030166A