Model dialogue method and device, computer equipment, readable storage medium and program product
By introducing intention understanding and emotion recognition modules into the artificial intelligence model, identifying and adjusting the text intentions and emotions entered by the user, the problem of inaccurate responses to low-quality input texts in the prior art is solved, and the dialogue response is improved Accuracy and personalization.
Patent Information
- Application Number
- CN202411769115.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-01-10
AI Technical Summary
The existing artificial intelligence model has low response accuracy to user input text, mainly due to inaccurate intention and emotion recognition caused by low quality of input text.
By entering the intent understanding model and emotion recognition model of the conversation text input by the user, identify the intent information and emotional labels of the text, and adjust it in combination with the dialogue model, so that the output dialogue response text is more in line with the user's intention and emotions.
The accuracy of model dialogue is improved, so that the output dialogue response text is more in line with the user's true intentions and emotions, and the quality of the response of the artificial intelligence system to user input is improved.
Smart Images

Figure CN119293216A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a model dialogue method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] With the development of computer technology, artificial intelligence technology has gradually matured. Currently, users can already perform natural language dialogue and other operations through artificial intelligence models such as natural language models and large language models. Artificial intelligence models rely on the text provided by users to respond and output corresponding results. The accuracy of artificial intelligence responses reflects the value of artificial intelligence models. At present, the results of artificial intelligence model dialogues are based on the quality of the text initially input by the user. When the quality of the text is low, the artificial intelligence model cannot output accurate response results, resulting in reduced accuracy of the response of the artificial intelligence model.
[0003] Therefore, current AI models suffer from low accuracy in responding to user input text. Summary of the invention
[0004] Based on this, it is necessary to provide a model dialogue method, device, computer equipment, computer-readable storage medium and computer program product that can improve the accuracy in response to the above technical problems.
[0005] In a first aspect, the present application provides a model dialogue method, the method comprising:
[0006] Get the dialog text entered by the user;
[0007] Inputting the conversation text into a trained intention understanding model, and having the intention understanding model output corresponding text intention information based on the conversation text;
[0008] Inputting the conversation text into a trained emotion recognition model, and having the emotion recognition model output a corresponding text emotion label based on the conversation text;
[0009] The text intention information, the text emotion label and the dialogue text are input into a trained dialogue model, and the dialogue model outputs a dialogue response text corresponding to the dialogue text based on the text intention information, the text emotion label and the dialogue text.
[0010] In one embodiment, the step of inputting the conversation text into a trained intention understanding model, and having the intention understanding model output corresponding text intention information based on the conversation text, includes:
[0011] Inputting the conversation text into a trained intent understanding model, and allowing the intent understanding model to identify the intent type and text slot information corresponding to the conversation text;
[0012] According to the intention type and the text slot information, text intention information corresponding to the dialogue text is output.
[0013] In one embodiment, the identifying, by the intent understanding model, the intent type and text slot information corresponding to the conversation text includes:
[0014] The intention understanding model performs part-of-speech tagging on the dialogue text based on a bidirectional long short-term memory network to obtain part-of-speech information corresponding to the dialogue text; based on the bidirectional long short-term memory network and conditional random field in the intention understanding model, entity recognition is performed on the dialogue text to obtain entity information corresponding to the dialogue text;
[0015] identifying the intent type corresponding to the conversation text according to the bidirectional encoder representation network in the intent understanding model, the part-of-speech information, and the entity information;
[0016] According to the bidirectional long short-term memory network and the conditional random field, the part-of-speech information and the entity information, the text slot information corresponding to the dialogue text is identified.
[0017] In one embodiment, the step of inputting the conversation text into a trained emotion recognition model, and having the emotion recognition model output a corresponding text emotion label based on the conversation text, comprises:
[0018] The conversation text is input into a trained emotion recognition model, and the emotion recognition model obtains a historical conversation text corresponding to the conversation text. Based on the bidirectional encoder representation network in the emotion recognition model, the conversation text and the historical conversation text, a corresponding text emotion label is output.
[0019] In one embodiment, the step of inputting the text intent information, the text emotion label, and the dialogue text into a trained dialogue model, and outputting a dialogue response text corresponding to the dialogue text based on the text intent information, the text emotion label, and the dialogue text by the dialogue model, comprises:
[0020] Inputting the text intention information, text emotion label and the dialogue text into a trained dialogue model, and extracting feature information corresponding to the dialogue text by the dialogue model;
[0021] Generate an adjusted dialogue text according to the text intention information, the text emotion label and the feature information; the intention and emotion of the adjusted dialogue text are matched with the text intention information and the text emotion label respectively;
[0022] Outputting corresponding dialogue response text according to the adjusted dialogue text.
[0023] In one embodiment, after the dialogue model outputs a dialogue response text corresponding to the dialogue text based on the text intent information, the text emotion tag and the dialogue text, the method further includes:
[0024] Obtaining an evaluation text input based on the adjusted dialogue text;
[0025] The evaluation text is input into the emotion recognition model, and the emotion recognition model outputs a corresponding evaluation text emotion label based on the evaluation text;
[0026] Determining the evaluation type corresponding to the evaluation text according to the emotional label of the evaluation text;
[0027] The evaluation text, the evaluation text emotion label and the evaluation type are input into the dialogue model; the dialogue model adjusts the dialogue text based on the evaluation text, the evaluation text emotion label and the evaluation type to improve the matching degree between the dialogue response text and the user's emotion; and outputs a corresponding dialogue response text based on the adjusted dialogue text.
[0028] In a second aspect, the present application provides a model dialogue device, the device comprising:
[0029] The acquisition module is used to obtain the dialogue text input by the user;
[0030] An intention understanding module, configured to input the conversation text into a trained intention understanding model, and the intention understanding model outputs corresponding text intention information based on the conversation text;
[0031] A sentiment analysis module, used for inputting the conversation text into a trained sentiment recognition model, and having the sentiment recognition model output a corresponding text sentiment label based on the conversation text;
[0032] The response module is used to input the text intention information, text emotion label and the dialogue text into a trained dialogue model, and the dialogue model outputs a dialogue response text corresponding to the dialogue text based on the text intention information, text emotion label and the dialogue text.
[0033] In a third aspect, the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0034] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.
[0035] In a fifth aspect, the present application provides a computer program product, including a computer program, which implements the steps of the above method when executed by a processor.
[0036] The above-mentioned model dialogue method, apparatus, computer device, computer-readable storage medium and computer program product recognize the textual intention information of the dialogue text input by the user through the intention understanding model, recognize the textual emotion tag of the dialogue text based on the emotion recognition model, and output the corresponding dialogue response text based on the dialogue model in combination with the textual intention information, textual emotion tag and dialogue text. Compared with the traditional method of directly outputting dialogue response to the user's text, this solution first understands the intention and emotion of the input text, and after recognizing the intention and emotion of the text, the dialogue model can adjust the input text based on the intention and emotion, so that the output dialogue response text is more in line with the user's intention and emotion, thereby improving the accuracy of the model dialogue. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0038] FIG1 is a schematic diagram of a flow chart of a model dialogue method in one embodiment;
[0039] FIG2 is a schematic flow chart of an intention understanding step in one embodiment;
[0040] FIG3 is a schematic diagram of a flow chart of an emotion recognition step in one embodiment;
[0041] FIG4 is a flow chart of a dialogue response step in one embodiment;
[0042] FIG5 is a schematic flow chart of an evaluation step in one embodiment;
[0043] FIG6 is a schematic diagram of a flow chart of a model dialogue method in another embodiment;
[0044] FIG7 is a flow chart of a model dialogue method in yet another embodiment;
[0045] FIG8 is a block diagram of a model dialogue device in one embodiment;
[0046] FIG. 9 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0048] In one embodiment, as shown in FIG1 , a model dialogue method is provided. This embodiment is described by taking the method applied to a terminal as an example. It is understandable that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server, including the following steps S202 to S208. Among them:
[0049] Step S202, obtaining the dialogue text input by the user.
[0050] Among them, with the development of artificial intelligence, users can now have conversations through artificial intelligence dialogue models that can perform NLP (Natural Language Processing). NLP is a branch of artificial intelligence and linguistics that involves the use of computer algorithms to understand and process human language. The goal of NLP is to enable computers to "understand" natural language so that they can perform various language-related tasks. Users can have conversations with dialogue models in the terminal through the terminal. The dialogue model in the terminal requires prompts input by users to output corresponding response texts. Among them, in the field of artificial intelligence and natural language processing, prompts refer to text inputs or instructions used to stimulate or guide artificial intelligence systems, such as chatbots, language models, or dialogue models, to make specific responses. Prompts can be a question, a statement, a request, or any other form of text that is intended to stimulate artificial intelligence systems to generate answers, perform tasks, or exhibit certain behaviors.
[0051] The terminal may be provided with a trained dialogue model, and the dialogue model outputs a corresponding dialogue response text based on the dialogue text input by the user. The user may input the corresponding dialogue text in the terminal, for example, input the dialogue text on the model dialogue page, and the terminal may obtain the dialogue text input by the user as the initial prompt. The dialogue text may be any text input by the user, such as a question, a statement, a request or any other form of text. The terminal may analyze the initial dialogue text through multiple models, and then output the dialogue response text through the dialogue model.
[0052] Step S204: input the conversation text into the trained intention understanding model, and the intention understanding model outputs corresponding text intention information based on the conversation text.
[0053] Among them, an intention understanding model may be provided in the terminal. The terminal may pre-iteratively train the intention understanding model to be trained based on the dialogue text samples and their corresponding text intention information samples to obtain a trained intention understanding model. The terminal may perform intention understanding on the above dialogue text to understand the user's intention. Among them, the terminal may input the above dialogue text into the trained intention understanding model, and after the intention understanding model performs intention understanding on the dialogue text, it outputs the corresponding text intention information. Among them, the text intention information represents the intention represented by the dialogue text input by the user. Based on the text intention information, the terminal can better understand the intention of the dialogue text input by the user.
[0054] Step S206: input the conversation text into a trained emotion recognition model, and the emotion recognition model outputs a corresponding text emotion label based on the conversation text.
[0055] Among them, an emotion recognition model may be provided in the terminal. The terminal may pre-iteratively train the emotion recognition model to be trained based on the dialogue text samples and their corresponding text emotion label samples to obtain a trained emotion recognition model. The terminal may perform emotion recognition on the above dialogue text to realize the recognition of the user's emotion. Among them, the terminal may input the above dialogue text into the trained emotion recognition model, and after the emotion recognition model performs emotion recognition on the dialogue text, it outputs the corresponding text emotion label. Among them, the text emotion label represents the label of the emotion represented by the dialogue text input by the user. Based on the text emotion information, the terminal can better understand the emotion of the dialogue text input by the user.
[0056] Step S208, input the text intention information, text emotion label and dialogue text into the trained dialogue model, and the dialogue model outputs the dialogue response text corresponding to the dialogue text based on the text intention information, text emotion label and dialogue text.
[0057] Among them, a dialogue model can also be set in the terminal. The terminal can pre-train the dialogue model to be trained based on the text intention information sample, the text emotion label sample and the dialogue text sample, and obtain the trained dialogue model. Thus, the terminal can use the above dialogue model to output the dialogue response text corresponding to the dialogue text input by the user. Among them, the dialogue text input by the user may be difficult for the dialogue model to understand, so the dialogue model can combine the above text intention information and text emotion label information to perform intent and emotion analysis on the above dialogue text, and then make corresponding adjustments to the above dialogue text.
[0058] For example, the terminal can input the text intent information output by the intention understanding model and the text emotion label output by the emotion recognition model into the trained dialogue model in combination with the initial dialogue text. The dialogue model can adjust the dialogue text based on the text intent information and the text emotion label so that the dialogue text better meets the requirements of model recognition and the user's intention and emotion represented by the dialogue text are clearer, so that the dialogue model generates the corresponding dialogue response text. The dialogue model can adjust the dialogue text based on the text intent information and the text emotion label to obtain an adjusted dialogue text with clearer intention and emotion and more matching the user's real intention and emotion, so that the dialogue model generates the corresponding dialogue response text based on the adjusted dialogue text and outputs the dialogue response text corresponding to the dialogue text.
[0059] In the above model dialogue method, the textual intention information of the dialogue text input by the user is identified through the intention understanding model, the textual emotion label of the dialogue text is identified based on the emotion recognition model, and the dialogue model combines the textual intention information, the textual emotion label and the dialogue text to output the corresponding dialogue response text. Compared with the traditional method of directly outputting dialogue response to the user's text, this solution first understands the intention and emotion of the input text, and after identifying the intention and emotion of the text, the dialogue model can adjust the input text based on the intention and emotion, so that the output dialogue response text is more in line with the user's intention and emotion, thereby improving the accuracy of the model dialogue.
[0060] In one embodiment, the conversation text is input into a trained intent understanding model, and the intent understanding model outputs corresponding text intent information based on the conversation text, including: inputting the conversation text into a trained intent understanding model, and the intent understanding model identifies the intent type and text slot information corresponding to the conversation text; and outputting the text intent information corresponding to the conversation text according to the intent type and text slot information.
[0061] In this embodiment, the terminal can analyze the intention of the dialogue of the above dialogue text through the intention understanding model. Among them, the intention understanding model can include multiple models and networks. The terminal can input the above dialogue text into the trained intention understanding model, and the intention understanding model can identify the intention type and text slot information corresponding to the dialogue text based on multiple models and networks. Among them, the intention type represents the type of intention represented by the user's dialogue text, and the intention type can be obtained by intent classification through the intention understanding model; the text slot information represents the slot information in the dialogue text, and the slot information refers to the key information points contained in the intent, which is used to fill the parameters required for the intent. In natural language processing, especially in dialogue systems, slots are detailed information that helps the terminal identify the user's intention. For example, the user's input is "I want to book a double room in City A tomorrow night." For the intention of "booking a hotel", the following slots may be defined: location: City A; date: tomorrow night; room type: double room, etc. Therefore, the dialogue model of the terminal can use the above intention type and text slot information to more accurately obtain the details of the user's needs.
[0062] After the intent understanding model in the terminal obtains the above-mentioned intent type and text slot information, it can output the text intent information corresponding to the dialogue text according to the intent type and text slot information. The above-mentioned intent type and text slot information can be identified using different networks in the intent understanding model respectively.
[0063] In one embodiment, an intent understanding model identifies the intent type and text slot information corresponding to a conversation text, including: the intent understanding model performs part-of-speech tagging on the conversation text based on a bidirectional long short-term memory network to obtain part-of-speech information corresponding to the conversation text; performs entity recognition on the conversation text based on the bidirectional long short-term memory network and conditional random field in the intent understanding model to obtain entity information corresponding to the conversation text; identifies the intent type corresponding to the conversation text based on the bidirectional encoder representation network, part-of-speech information and entity information in the intent understanding model; identifies the text slot information corresponding to the conversation text based on the bidirectional long short-term memory network and conditional random field, part-of-speech information and entity information.
[0064] In this embodiment, the intent understanding model includes but is not limited to BiLSTM (Bidirectional Long Short-Term Memory), BERT (Bidirectional Encoder Representations from Transformers), and CRF (conditional random field). Among them, the intent understanding model can perform part-of-speech tagging on the dialogue text based on the bidirectional long short-term memory network to obtain the part-of-speech information corresponding to the dialogue text. The terminal can also perform entity recognition on the dialogue text based on the bidirectional long short-term memory network and conditional random field in the intent understanding model to obtain the entity information corresponding to the dialogue text, so that the terminal identifies the intent type corresponding to the dialogue text according to the bidirectional encoder representation network, part-of-speech information, and entity information in the intent understanding model.
[0065] For text slot information, the terminal can identify the text slot information corresponding to the dialogue text in the intent understanding model based on the bidirectional long short-term memory network and conditional random field, part-of-speech information and entity information. In addition, the terminal can also pre-process the dialogue text in the intent understanding model and then output the above-mentioned intent type and text slot information.
[0066] Specifically, as shown in FIG2 , FIG2 is a flow chart of the intent understanding step in one embodiment. After the intent understanding model obtains the dialogue text input by the user, it can preprocess the input dialogue text, including text clarity and standardization. For example, the terminal removes irrelevant characters, punctuation marks, and stop words in the dialogue text through the intent understanding model, and unifies the vocabulary morphology through lowercase conversion, stem extraction, or word form restoration.
[0067] In addition, the terminal can perform word segmentation processing on the above-mentioned dialogue text through the intention understanding model. For example, the terminal uses the NLTK (Natural Language Toolkit) tool in the intention understanding model to segment the text, divide the dialogue text into independent vocabulary units, and implement preprocessing of the above-mentioned dialogue text. In addition, the terminal can also perform part-of-speech tagging and named entity recognition through the intention understanding model. The intention understanding model uses BiLSTM for part-of-speech tagging and combines BiLSTM with CRF for named entity recognition, also known as entity recognition, to identify specific entities in the dialogue text.
[0068] The terminal can also use the intent understanding model to perform dependency syntactic analysis. For example, the intent understanding model uses a dependency syntactic analyzer to construct the grammatical structure of sentences in the conversation text. The intent understanding model can perform intent recognition and sequence labeling, thereby realizing the recognition of intent types and text slot information. Among them, the terminal uses the BERT model in the intent understanding model to classify the processed conversation text, obtain the corresponding intent type, and use the BiLSTM-CRF model for sequence labeling to identify the key slot information in the input conversation text, thereby obtaining the above-mentioned text slot information. The intent understanding model finally outputs the recognized intent type and text slot information, so that the terminal can pass the intent type and text slot information to the conversation model for further processing.
[0069] Through the above embodiments, the terminal can use the intent understanding model to identify the intent type and text slot information of the dialogue text input by the user, so that the terminal can accurately capture the user's true intent based on the intent type and text slot information, and provide clear intent information for subsequent steps, thereby improving the accuracy of the text output by the dialogue model.
[0070] In one embodiment, the conversation text is input into a trained emotion recognition model, and the emotion recognition model outputs a corresponding text emotion label based on the conversation text, including: inputting the conversation text into a trained emotion recognition model, obtaining a historical conversation text corresponding to the conversation text by the emotion recognition model, and outputting a corresponding text emotion label based on a bidirectional encoder representation network, the conversation text, and the historical conversation text in the emotion recognition model.
[0071] In this embodiment, the terminal can analyze the emotion of the conversation of the above-mentioned conversation text through an emotion recognition model. Among them, the emotion recognition model can include multiple models and networks. The terminal can input the above-mentioned conversation text into a trained emotion recognition model, and the emotion recognition model can identify the text emotion label corresponding to the conversation text based on multiple models and networks. Among them, the text emotion label represents the label of the emotion represented by the conversation text. Including but not limited to labels such as "positive", "negative", "happy", "sad", "affirmative", and "question".
[0072] The emotion recognition model can identify text emotion tags by combining context. The context information can be obtained through the historical conversation text of the user in this conversation. The terminal can input the above conversation text into the trained emotion recognition model, obtain the historical conversation text corresponding to the conversation text in the emotion recognition model, and identify the text emotion tag corresponding to the conversation text based on the bidirectional encoder representation network in the emotion recognition model, combining the conversation text and the historical conversation text, and output the corresponding text emotion tag. The terminal can pre-process the above conversation text before identifying the text emotion tag.
[0073] Specifically, as shown in FIG3, FIG3 is a flow chart of the emotion recognition step in one embodiment. The terminal can pre-process the above-mentioned dialogue text. For example, the terminal can clean the dialogue text input by the user to ensure the purity of the text. The terminal can then perform word segmentation processing to split the dialogue text into independent vocabulary units. Then perform part-of-speech tagging. The terminal can also perform sentiment analysis and tendency recognition on the dialogue text after the above processing. For example, the terminal uses the BERT (Bidirectional Encoder Representations from Transformers, bidirectional encoder representation network) model to deeply identify the emotional tendency of the text to ensure the accuracy of the sentiment analysis. The terminal can also perform context analysis. The terminal can analyze the user's historical emotional data, such as the above-mentioned historical dialogue text, to provide sentiment analysis closely related to the context and enhance the depth and breadth of emotion recognition. Thus, the terminal can convert the identified emotional tendency into a label form, output the text emotional label, and provide directly available emotional information for the dialogue model to achieve more personalized and accurate recommendations.
[0074] Through this embodiment, the terminal can use the emotion recognition model to accurately evaluate the emotional tendency of the dialogue text input by the user, and provide an in-depth understanding of the emotional state for the dialogue model, so that the dialogue model can output more accurate dialogue response text, thereby improving the accuracy of the model response.
[0075] In one embodiment, text intent information, text emotion labels and dialogue text are input into a trained dialogue model, and the dialogue model outputs dialogue response text corresponding to the dialogue text based on the text intent information, text emotion labels and dialogue text, including: inputting text intent information, text emotion labels and dialogue text into a trained dialogue model, and extracting feature information corresponding to the dialogue text by the dialogue model; generating adjusted dialogue text according to the text intent information, text emotion labels and feature information; matching the intent and emotion of the adjusted dialogue text with the text intent information and text emotion labels respectively; and outputting corresponding dialogue response text according to the adjusted dialogue text.
[0076] In this embodiment, after the terminal iteratively trains the dialogue model to be trained, the trained dialogue model can be obtained. The terminal can use the trained dialogue model to respond to the dialogue text. The terminal can input the identified text intention information, text emotion label and dialogue text into the trained dialogue model, and the dialogue model can extract the feature information corresponding to the dialogue text, so that the terminal generates an adjusted dialogue text based on the text intention information, text emotion label and feature information through the dialogue model, wherein the intention emotion of the adjusted dialogue text matches the text intention information and the text emotion label respectively, that is, the dialogue model optimizes the dialogue text input by the user based on the text intention information and the text emotion label, so that the intention and emotion of the dialogue text input by the user are more obvious, which is convenient for the dialogue model to understand and respond. Therefore, the dialogue model can respond according to the adjusted dialogue text, and after generating the dialogue response text that meets the above intention and emotion, the generated dialogue response text is output. The dialogue model can be a recommendation model, which is used to recommend corresponding information based on the dialogue text input by the user, and output it in the form of dialogue response text.
[0077] Specifically, as shown in FIG. 4, FIG. 4 is a flow chart of a dialogue response step in an embodiment. Among them, the terminal can pre-process the above-mentioned input dialogue text through the dialogue model. For example, after the terminal receives the text intent information, text emotion tags and the initial dialogue text through the dialogue model, the terminal can clean the input data, remove invalid information, and extract features through the dialogue model, identify key information, and vectorize the extracted feature information through the dialogue model to convert the text data into a format that can be processed by the model. Thus, the terminal can perform feature integration, and the terminal can effectively integrate the text intent information, text emotion tags and other extracted features through the dialogue model to form the input basis of the recommendation model. Thus, the terminal performs personalized recommendations for the above-mentioned dialogue text based on the dialogue model, and the terminal can generate personalized dialogue text that meets user needs and emotional state based on the Seq2Seq (sequence to sequence) model of the neural network in the dialogue model, that is, the above-mentioned adjusted dialogue text, to ensure the fit of the recommended content. The terminal outputs the generated personalized dialogue text as a recommendation result through the dialogue model, and provides the input dialogue text for the response of the dialogue model. That is, the dialogue model outputs the corresponding dialogue response text based on the adjusted dialogue text, so that the dialogue response text is more in line with user needs and emotional state.
[0078] In this embodiment, the terminal generates a highly personalized adjusted dialogue text through a dialogue model according to the user's intention, emotional state and initial dialogue text, thereby ensuring the relevance and personalization of the input dialogue text, and outputs a dialogue response text that meets the user's needs and emotions based on the adjusted dialogue text, thereby improving the accuracy of the model response.
[0079] In one embodiment, after the dialogue model outputs a dialogue response text corresponding to the dialogue text based on the text intention information, the text emotion label and the dialogue text, it also includes: obtaining an evaluation text input based on the adjusted dialogue text; inputting the evaluation text into an emotion recognition model, and the emotion recognition model outputting a corresponding evaluation text emotion label based on the evaluation text; determining an evaluation type corresponding to the evaluation text according to the evaluation text emotion label; inputting the evaluation text, the evaluation text emotion label and the evaluation type into the dialogue model, and the dialogue model adjusts the dialogue text based on the evaluation text, the evaluation text emotion label and the evaluation type to improve the matching degree between the dialogue response text and the user's emotion, and outputting a corresponding dialogue response text based on the adjusted dialogue text.
[0080] In this embodiment, the user can evaluate the adjusted dialogue text generated by the above dialogue model, so that the dialogue model can be adjusted and optimized accordingly based on the evaluation of the adjusted dialogue text to better meet the user's intentions and emotions. After the dialogue model outputs the above dialogue response text, the terminal can obtain the evaluation text input based on the adjusted dialogue text. The terminal can then input the evaluation text into the emotion recognition model, and the emotion recognition model outputs the corresponding evaluation text emotion label based on the evaluation text. The evaluation text emotion label represents the label of the emotion corresponding to the evaluation text.
[0081] The emotion recognition model can determine the evaluation type corresponding to the evaluation text according to the emotion label of the evaluation text, including but not limited to positive, negative, etc. Therefore, the terminal can input the evaluation text, the emotion label of the evaluation text and the evaluation type into the dialogue model, and the dialogue model adjusts the dialogue text based on the evaluation text, the emotion label of the evaluation text and the evaluation type to improve the matching degree between the dialogue response text and the user's emotion, and outputs the corresponding dialogue response text based on the adjusted dialogue text. Among them, the adjusted dialogue text can be a text adjusted based on the evaluation text.
[0082] Specifically, as shown in FIG5 , FIG5 is a flow chart of the evaluation step in an embodiment. After receiving the dialogue response text of the dialogue model response, the user evaluates the above-adjusted dialogue text according to its quality and provides valuable feedback information, such as the above-mentioned evaluation text. The terminal can clean the collected feedback data, remove irrelevant information, and perform standardization processing to ensure the quality and consistency of the data. The terminal can also use the emotion recognition model to evaluate the emotional tendency in the user feedback and obtain the corresponding text emotion label. The terminal can also classify the evaluation content. For example, the terminal can carefully classify the user's evaluation content, distinguish key dimensions such as relevance and accuracy, obtain the above-mentioned evaluation type, and provide structured data for further analysis. The terminal can output the processed and analyzed feedback data, that is, the above-mentioned adjusted dialogue text, so that the terminal uses the adjusted dialogue text as the input of the dialogue model to achieve continuous optimization and improvement of the dialogue text.
[0083] Through this embodiment, the terminal can comprehensively collect and deeply analyze the user's evaluation of the optimized dialogue text in terms of relevance, accuracy and emotional expression, ensuring efficient processing and analysis of feedback. In addition, the dialogue text is adjusted based on user feedback, and the dialogue response text is output based on the adjusted dialogue text, thereby improving the accuracy of the model response.
[0084] In an exemplary embodiment, as shown in Figure 6, Figure 6 is a flow chart of the model dialogue method in another embodiment. In this embodiment, the terminal can use the initial dialogue text input by the user as the initial data of the system. The initial dialogue text first passes through the intention understanding model. This model is based on natural language processing technology, parses the dialogue text input by the user and recognizes the user's intention, and adopts advanced semantic analysis and keyword recognition technology to better understand user needs and provide accurate user intention information for subsequent steps.
[0085] The terminal can also input the initial conversation text into a sentiment analysis model, which evaluates the emotional tendency of the user input, such as positive, negative or neutral. Based on the sentiment analysis algorithm, the system can understand the user's emotional state and provide a basis for generating conversation text that meets the user's emotional needs. The terminal can generate a new conversation text, such as the above-mentioned adjusted conversation text, from the conversation model based on the user's intention and emotional state and the user's initial conversation text. Among them, the conversation model uses a machine learning algorithm to combine the user's historical data and current input to create a personalized conversation text that meets the user's needs, that is, the above-mentioned adjusted conversation text. The terminal uses this conversation text as the input for the conversation model to respond and generates a corresponding response output, such as the above-mentioned conversation response text.
[0086] Among them, the user can perform corresponding operations according to the satisfaction of the response output. If it meets the expectations, the dialogue text optimization process ends. If it does not meet the expectations, the evaluation feedback model is started, and the user evaluates the relevance, accuracy and emotional expression of the adjusted dialogue text. The system starts the dialogue model again based on the user feedback to generate a new dialogue text, such as the adjusted dialogue text above, so that the dialogue model generates high-quality dialogue text through continuous learning and adaptation.
[0087] The specific process of the terminal using the intention understanding model, the emotion recognition model and the dialogue model to output the dialogue response text can be shown in Figure 7, which is a flow chart of the model dialogue method in another embodiment. Among them, the user inputs the initial dialogue text. The terminal passes the initial dialogue text through the intention understanding model, outputs the user intention and slot information as text intention information. The terminal passes the initial dialogue text through the emotion analysis model, converts the identified emotional tendency into a label form, and outputs the text emotion label.
[0088] The terminal uses the user intention, initial dialogue text, and emotion label as inputs to the dialogue model, and trains to generate new dialogue text, namely the adjusted dialogue text. The optimized dialogue text is used as the input of the model response, and the corresponding response output is generated after model training, such as the dialogue response text.
[0089] Among them, the user can judge whether the response output meets the requirements. If it does, the system workflow ends; if it does not meet the requirements, the user inputs evaluation feedback into the evaluation feedback model, such as the above-mentioned evaluation text, and the model processes the output feedback data as the input of the dialogue model to generate the dialogue text again, such as further adjusting the adjusted dialogue text to obtain a new adjusted dialogue text, and performing a model response based on the new adjusted dialogue text to obtain a new dialogue response text.
[0090] Through the above embodiments, the terminal first understands the intention and emotion of the input text, and after identifying the intention and emotion of the text, the dialogue model can adjust the input text based on the intention and emotion, so that the output dialogue response text is more in line with the user's intention and emotion, improving the accuracy of the model dialogue. It also improves the relevance and personalization of the dialogue text and improves the quality of the artificial intelligence system's response to user input.
[0091] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0092] Based on the same inventive concept, the embodiment of the present application also provides a model dialogue device for implementing the model dialogue method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more model dialogue device embodiments provided below can refer to the limitations of the model dialogue method above, and will not be repeated here.
[0093] In an exemplary embodiment, as shown in FIG8 , a model dialogue device is provided, including: an acquisition module 500, an intention understanding module 502, a sentiment analysis module 504, and a response module 506, wherein:
[0094] The acquisition module 500 is used to acquire the dialogue text input by the user.
[0095] The intention understanding module 502 is used to input the dialogue text into the trained intention understanding model, and the intention understanding model outputs corresponding text intention information based on the dialogue text.
[0096] The sentiment analysis module 504 is used to input the conversation text into a trained sentiment recognition model, and the sentiment recognition model outputs a corresponding text sentiment label based on the conversation text.
[0097] The response module 506 is used to input the text intention information, text emotion label and dialogue text into the trained dialogue model, and the dialogue model outputs the dialogue response text corresponding to the dialogue text based on the text intention information, text emotion label and dialogue text.
[0098] In one embodiment, the above-mentioned intention understanding module 502 is used to input the dialogue text into a trained intention understanding model, and the intention understanding model identifies the intention type and text slot information corresponding to the dialogue text; according to the intention type and text slot information, outputs the text intention information corresponding to the dialogue text.
[0099] In one embodiment, the above-mentioned intention understanding module 502 is used to perform part-of-speech tagging on the dialogue text based on the bidirectional long short-term memory network by the intention understanding model to obtain the part-of-speech information corresponding to the dialogue text; perform entity recognition on the dialogue text based on the bidirectional long short-term memory network and conditional random field in the intention understanding model to obtain the entity information corresponding to the dialogue text; identify the intent type corresponding to the dialogue text according to the bidirectional encoder representation network, part-of-speech information and entity information in the intention understanding model; identify the text slot information corresponding to the dialogue text according to the bidirectional long short-term memory network and conditional random field, part-of-speech information and entity information.
[0100] In one embodiment, the sentiment analysis module 504 is used to input the conversation text into a trained sentiment recognition model, obtain the historical conversation text corresponding to the conversation text through the sentiment recognition model, and output the corresponding text sentiment label based on the bidirectional encoder representation network, the conversation text and the historical conversation text in the sentiment recognition model.
[0101] In one embodiment, the above-mentioned response module 506 is used to input text intention information, text emotion labels and dialogue text into a trained dialogue model, and the dialogue model extracts feature information corresponding to the dialogue text; generates an adjusted dialogue text according to the text intention information, text emotion labels and feature information; matches the intention and emotion of the adjusted dialogue text with the text intention information and text emotion labels respectively; and outputs a corresponding dialogue response text according to the adjusted dialogue text.
[0102] In one embodiment, the above-mentioned device also includes: an evaluation module, which is used to obtain an evaluation text input based on the adjusted dialogue text; input the evaluation text into an emotion recognition model, and the emotion recognition model outputs a corresponding evaluation text emotion label based on the evaluation text; determine the evaluation type corresponding to the evaluation text according to the evaluation text emotion label; input the evaluation text, the evaluation text emotion label and the evaluation type into the dialogue model, and the dialogue model adjusts the dialogue text based on the evaluation text, the evaluation text emotion label and the evaluation type to improve the matching degree between the dialogue response text and the user's emotion, and outputs the corresponding dialogue response text based on the adjusted dialogue text.
[0103] Each module in the above model dialogue device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0104] In an exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG9. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected via a system bus, and the communication interface, the display unit, and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer 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 input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner may be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a model dialogue method is implemented. The display unit of the computer device is used to form a visually visible picture, which may be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0105] Those skilled in the art will understand that the structure shown in FIG. 9 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0106] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the above-mentioned model dialogue method when executing the computer program.
[0107] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned model dialogue method is implemented.
[0108] In one embodiment, a computer program product is provided, including a computer program, which implements the above-mentioned model dialogue method when executed by a processor.
[0109] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0110] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method 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 the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0111] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above 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 application.
[0112] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A model dialogue method, characterized in that: The method comprises: Get the dialog text entered by the user; Inputting the conversation text into a trained intention understanding model, and having the intention understanding model output corresponding text intention information based on the conversation text; Inputting the conversation text into a trained emotion recognition model, and having the emotion recognition model output a corresponding text emotion label based on the conversation text; The text intention information, the text emotion label and the dialogue text are input into a trained dialogue model, and the dialogue model outputs a dialogue response text corresponding to the dialogue text based on the text intention information, the text emotion label and the dialogue text.
2. The method according to claim 1, characterized in that: The step of inputting the conversation text into a trained intention understanding model, and having the intention understanding model output corresponding text intention information based on the conversation text, includes: Inputting the conversation text into a trained intent understanding model, and allowing the intent understanding model to identify the intent type and text slot information corresponding to the conversation text; According to the intention type and the text slot information, text intention information corresponding to the dialogue text is output.
3. The method according to claim 2, characterized in that The identifying, by the intent understanding model, the intent type and text slot information corresponding to the dialogue text includes: The intention understanding model performs part-of-speech tagging on the dialogue text based on a bidirectional long short-term memory network to obtain part-of-speech information corresponding to the dialogue text; based on the bidirectional long short-term memory network and conditional random field in the intention understanding model, entity recognition is performed on the dialogue text to obtain entity information corresponding to the dialogue text; identifying the intent type corresponding to the conversation text according to the bidirectional encoder representation network in the intent understanding model, the part-of-speech information, and the entity information; According to the bidirectional long short-term memory network and the conditional random field, the part-of-speech information and the entity information, the text slot information corresponding to the dialogue text is identified.
4. The method according to claim 1, characterized in that: The step of inputting the conversation text into a trained emotion recognition model, and having the emotion recognition model output a corresponding text emotion label based on the conversation text, comprises: The conversation text is input into a trained emotion recognition model, and the emotion recognition model obtains a historical conversation text corresponding to the conversation text. Based on the bidirectional encoder representation network in the emotion recognition model, the conversation text and the historical conversation text, a corresponding text emotion label is output.
5. The method according to claim 1, characterized in that The step of inputting the text intention information, the text emotion label, and the dialogue text into a trained dialogue model, and having the dialogue model output a dialogue response text corresponding to the dialogue text based on the text intention information, the text emotion label, and the dialogue text, comprises: Inputting the text intention information, text emotion label and the dialogue text into a trained dialogue model, and extracting feature information corresponding to the dialogue text by the dialogue model; Generate an adjusted dialogue text according to the text intention information, the text emotion label and the feature information; the intention and emotion of the adjusted dialogue text are matched with the text intention information and the text emotion label respectively; Outputting corresponding dialogue response text according to the adjusted dialogue text.
6. The method according to any one of claims 1 to 5, characterized in that: After the dialogue model outputs the dialogue response text corresponding to the dialogue text based on the text intention information, the text emotion tag and the dialogue text, the method further includes: Obtaining an evaluation text based on the adjusted dialogue text input; The evaluation text is input into the emotion recognition model, and the emotion recognition model outputs a corresponding evaluation text emotion label based on the evaluation text; Determining the evaluation type corresponding to the evaluation text according to the emotional label of the evaluation text; The evaluation text, the evaluation text emotion label and the evaluation type are input into the dialogue model; the dialogue model adjusts the dialogue text based on the evaluation text, the evaluation text emotion label and the evaluation type to improve the matching degree between the dialogue response text and the user's emotion; and outputs a corresponding dialogue response text based on the adjusted dialogue text.
7. A model dialogue device, characterized in that: The device comprises: The acquisition module is used to obtain the dialogue text input by the user; An intention understanding module, configured to input the conversation text into a trained intention understanding model, and the intention understanding model outputs corresponding text intention information based on the conversation text; A sentiment analysis module, used for inputting the conversation text into a trained sentiment recognition model, and having the sentiment recognition model output a corresponding text sentiment label based on the conversation text; The response module is used to input the text intention information, text emotion label and the dialogue text into a trained dialogue model, and the dialogue model outputs a dialogue response text corresponding to the dialogue text based on the text intention information, text emotion label and the dialogue text.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.