Emotion support dialogue method, system, device and program

By using dialogue prediction models in the emotional support dialogue system, combining feature extraction, situation capture, thought recognition, action prediction and decision-making levels, the problem of lack of personalization and cognitive reasoning capabilities in dialogue in the existing system is solved, and more efficient and high-quality emotional support dialogue is achieved.

CN120216631APending Publication Date: 2025-06-27TSINGHUA UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510227484.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-27
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

The existing emotional support dialogue system ignores the social interaction characteristics in emotional support dialogue, resulting in the generated dialogue lacking personalized expression and cognitive reasoning capabilities and failing to provide truly effective emotional support.

Method used

By obtaining help-seeking information and sending it to a dialogue prediction model trained on dialogue generation data, the model includes a feature extraction layer, a situation capture layer, a thought recognition layer, an action prediction layer, and a decision-making layer to generate more targeted, empathetic and supportive responses.

Benefits of technology

A more targeted, empathetic and supportive response is achieved, effectively saving manual processing time, improving service efficiency, and improving the quality and relevance of responses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120216631A_ABST
    Figure CN120216631A_ABST
Patent Text Reader

Abstract

The invention relates to the field of artificial intelligence, and provides an emotional support dialogue method, system, device and program, and the method comprises the steps: obtaining help information which is used for representing the help target and content of a help seeker; sending the help seeking information to a dialogue prediction model to obtain a reply prediction statement output by the dialogue prediction model; wherein the dialogue prediction model is obtained by training based on dialogue generation data, and the dialogue generation data is generated by utilizing a first large language model based on roles and examples selected from a role library and a dialogue example library which are created in advance; the dialogue prediction model is used for performing feature extraction on the input help information and performing dialogue prediction based on the extracted information features to obtain a reply prediction statement. According to the invention, the conversation prediction model is utilized to quickly respond and predict the corresponding reply statement according to the help seeking information of the help seeker, so that the response with pertinence, the same center of care and support is realized, the manual processing time is effectively saved, and the service efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and particularly to an emotional support conversation method, system, device and program. Background Art

[0002] With the development of society and the rapid development of artificial intelligence technology, emotional support conversation, as an important branch of the field of natural language processing, is gradually becoming an indispensable part of human-computer interaction. Emotional support conversation is not only the transmission of information, but also the exchange and resonance of emotions. It requires the system to accurately understand the emotional state of the user and generate responses that conform to the user's mood and are full of emotional color.

[0003] Currently, the training of emotional support conversation systems mainly relies on collecting data through manual crowdsourcing methods, or simply using large language models to directly output and synthesize low-quality conversation data. Among them, the manual crowdsourcing method is a task distribution method based on the shared human resources model, and data is collected by artificially playing the roles of the person seeking help and the supporter to conduct conversations.

[0004] However, the above methods ignore the inherent social nature of Emotional Support Conversation (ESC), and are prone to ignoring the social interaction characteristics in emotional support conversations, resulting in the generated conversations lacking personalized expression and cognitive reasoning ability, and being unable to provide truly effective emotional support, which seriously restricts the practical process of emotional support conversation systems. In addition, the data collection method is not only costly, but also the amount of data is limited, greatly restricting the number of conversations collected and the diversity of topics, and it is difficult to meet the needs of large-scale training models. Summary of the Invention

[0005] The present invention provides an emotional support conversation method, system, device and program to solve the defect in the prior art that the social interaction characteristics in emotional support conversations are ignored, resulting in the generated conversations lacking personalized expression and cognitive reasoning ability, and to achieve more targeted, empathetic and supportive responses.

[0006] The present invention provides an emotional support conversation method, including: obtaining help-seeking information, where the help-seeking information is used to represent the help-seeking goal and content of the person seeking help; sending the help-seeking information to a conversation prediction model to obtain a reply prediction statement output by the conversation prediction model; wherein, the conversation prediction model is trained based on conversation generation data, and the conversation generation data is generated by using a first large language model to respectively select roles and examples from a previously created role library and conversation example library; the conversation prediction model is used to extract features from the input help-seeking information and perform conversation prediction based on the extracted information features to obtain a reply prediction statement.

[0007] An emotional support dialogue method provided by the present invention, a dialogue prediction model, includes: a feature extraction layer that extracts features from the help-seeking information to obtain information features; a situation capture layer that captures emotions from the information features and extracts context information to obtain emotion features and context features; a thought recognition layer that predicts the inner cognition of the help-seeker based on the emotion features and context features to obtain the inner cognition result of the help-seeker; an action prediction layer that predicts the behavior result based on the inner cognition result of the help-seeker to obtain the behavior prediction result; and a decision-making layer that makes a decision based on the behavior prediction result, determines the strategy and the purpose of the strategy, and generates a reply prediction statement based on the strategy and the purpose of the strategy.

[0008] An emotional support dialogue method provided by the present invention, before sending the help-seeking information to the dialogue prediction model and obtaining the reply prediction statement output by the dialogue prediction model, includes: randomly selecting any role from the role library; wherein, the role library is constructed by the help-seeker roles obtained by first extracting key information from the emotional support dialogue data screened from the dataset for mental health support based on the preset target attributes and supplementing the missing attributes of the extracted key information. The dataset for mental health support includes emotional support dialogue data of multiple mental health topics, and the emotional support dialogue data is used to represent the dialogue data corresponding to the emotional problems and the scenarios involved in the emotional problems; randomly selecting any example from the dialogue example library; wherein, the dialogue example library is constructed by the examples obtained by first supplementing the help-seeker role information and the supporter reasoning process for the target number of dialogue samples selected from the emotional support dialogue corpus; according to the selected role and the selected example, using the first large language model, obtaining the dialogue generation data, and using the dialogue generation data to train the dialogue prediction model to be trained.

[0009] An emotional support dialogue method provided by the present invention, before randomly selecting any role from the role library, includes: screening the emotional support dialogue quality of the dataset for mental health support to obtain the emotional support dialogue data; based on the preset target attributes and in combination with the preset psychological theory, extracting the key information from the emotional support dialogue data to obtain the key information; according to the key information and the emotional support dialogue data, using the second large language model, extracting the context information of the key information from the emotional support dialogue data, and predicting and supplementing the missing attributes relative to the preset target attributes based on the extracted context information to obtain the supplemented key information; constructing the help-seeker role according to the supplemented key information; and constructing the role library based on the constructed help-seeker role.

[0010] An emotional support dialogue method provided by the present invention, after obtaining the emotional support dialogue data, includes: filtering the emotional support dialogue data based on the preset sensitive words; and / or, removing the emotional support dialogue data with a length lower than the preset character length based on the preset character length.

[0011] According to an emotional support dialogue method provided by the present invention, before randomly selecting any example from the dialogue example library, it includes: selecting dialogue samples from each question category of the emotional support dialogue corpus; according to the selected dialogue samples, using a third large language model to supplement role information and predict the supporter reasoning process, so as to obtain the supplemented role of the seeker and the supporter reasoning process; generating examples according to the selected dialogue samples and the supplemented role of the seeker and the supporter reasoning process corresponding to the selected dialogue samples; and constructing a dialogue example library according to the generated examples.

[0012] According to an emotional support dialogue method provided by the present invention, selecting dialogue samples from each question category of the emotional support dialogue corpus includes: obtaining the question categories of the emotional support dialogue corpus; for each question category, performing quality scoring on all dialogue samples within the question category, and selecting a preset number of dialogue samples based on the scores from high to low.

[0013] The present invention also provides an emotional support dialogue system, including: an information acquisition module, which acquires help-seeking information, and the help-seeking information is used to represent the help-seeking goal and content of the seeker; an emotional support dialogue module, which sends the help-seeking information to a dialogue prediction model to obtain a reply prediction statement output by the dialogue prediction model; wherein, the dialogue prediction model is trained based on dialogue generation data, and the dialogue generation data is generated by using a first large language model to respectively select roles and examples from a previously created role library and dialogue example library; the dialogue prediction model is used to extract features from the input help-seeking information and perform dialogue prediction based on the extracted information features to obtain a reply prediction statement.

[0014] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, it implements the emotional support dialogue method as described in any one of the above.

[0015] The present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the emotional support dialogue method as described in any one of the above.

[0016] The present invention also provides a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the emotional support dialogue method as described in any one of the above.

[0017] The emotional support dialogue method, system, device and program provided by the present invention utilize a dialogue prediction model to quickly respond according to the help-seeking information of the help-seeker, predict corresponding reply statements, so as to achieve more targeted, empathetic and supportive responses, effectively saving manual processing time and improving service efficiency. Additionally, roles and examples are selected based on a role library and a dialogue example library, and dialogue generation data is generated with the aid of a first large language model, enabling the dialogue prediction model to learn different role characteristics and rich examples based on the dialogue generation data, so that the reply prediction statements output by the trained model closely fit the needs of the help-seeker, enhancing the quality and relevance of the response. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] To more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention, and those of ordinary skill in the art can also obtain other drawings based on these drawings without creative efforts.

[0019] Figure 1 is a flowchart of the emotional support dialogue method provided by the present invention; Figure 2 is a flowchart of generating dialogue generation data provided by the present invention; Figure 3 is a structural diagram of the emotional support dialogue system provided by the present invention; Figure 4 is a structural diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0020] To make the objectives, technical solutions and advantages of the present invention clearer, the following clearly and completely describes the technical solutions in the present invention with reference to the accompanying drawings in the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art without creative efforts based on the embodiments in the present invention fall within the protection scope of the present invention.

[0021] Figure 1 is a flowchart of the emotional support dialogue method provided by the present invention, as Figure 1 shown, the method includes: S11, obtaining help-seeking information, where the help-seeking information is used to represent the help-seeking target and content of the help-seeker; S12. Send the help request information to the dialogue prediction model to obtain the predicted reply statement output by the dialogue prediction model. The dialogue prediction model is trained based on dialogue generation data, and the dialogue generation data is generated by using the first large language model to select roles and examples from a previously created role library and dialogue example library respectively. The dialogue prediction model is used to extract features from the input help request information and perform dialogue prediction based on the extracted information features to obtain the predicted reply statement.

[0022] It should be noted that the step numbers "S1N" in this specification do not represent the sequence of the emotional support dialogue method. The following specifically describes Figure 2 the emotional support dialogue method of the present invention.

[0023] Step S11. Obtain the help request information, which is used to represent the help request target and content of the help seeker. It should be noted that the help request information is input by the help seeker based on the help request target and content through the front end.

[0024] Step S12. Send the help request information to the dialogue prediction model to obtain the predicted reply statement output by the dialogue prediction model. The dialogue prediction model is trained based on dialogue generation data, and the dialogue generation data is generated by using the first large language model to select roles and examples from a previously created role library and dialogue example library respectively. The dialogue prediction model is used to extract features from the input help request information and perform dialogue prediction based on the extracted information features to obtain the predicted reply statement.

[0025] In this embodiment, the dialogue prediction model includes: a feature extraction layer that extracts features from the help request information to obtain information features; a context capture layer that captures emotions and extracts context information from the information features to obtain emotional features and context features; a thought recognition layer that predicts the inner cognition of the help seeker based on the emotional features and context features to obtain the inner cognition result of the help seeker; an action prediction layer that predicts the behavior result based on the inner cognition result of the help seeker to obtain the behavior prediction result; and a decision-making layer that makes a decision based on the behavior prediction result, determines the strategy and the purpose of the strategy, and generates the predicted reply statement based on the strategy and the purpose of the strategy.

[0026] It should be noted that the feature extraction layer first extracts the features of the help-seeking information, and then the situation capture layer captures the emotions and extracts the context information, such as "feeling extremely anxious due to the approaching work deadline", so as to comprehensively and deeply understand the input content, covering the emotional tendency and background information, and thus providing rich and accurate basis for subsequent processing; based on the thought recognition layer, the inner cognition of the help-seeker is predicted according to the emotional and context features, such as "worrying that not being able to complete the task on time will affect career development", so as to grasp the potential thoughts, needs and psychological states of the user, break through the limitation of only understanding the surface information, and make the subsequent generated response more in line with the user's psychology; further based on the action prediction layer, the possible behavioral results of the help-seeker are predicted according to the inner cognition results, such as "may procrastinate or overwork in an attempt to catch up with the progress", so as to consider in advance the subsequent situations that may be caused by the user's behavior, and thus facilitate more comprehensive consideration of various factors in subsequent decision-making, so that the generated response can effectively guide or respond to the user's behavior and its possible results; finally, the decision-making layer determines the strategy and the purpose of the strategy according to the behavior prediction result, such as "providing time management suggestions and giving emotional comfort, encouraging them to complete the task step by step", and generating a reply prediction statement, ensuring that the whole process from input information understanding to reply generation is logically coherent and well-organized, so that the generated response can closely fit the specific needs of the help-seeker, based on a deep understanding of their psychological state, rather than simply imitating the surface dialogue mode, effectively enhancing the social awareness of the supporter and improving the quality and relevance of the response.

[0027] Furthermore, corresponding analysis and judgment criteria can also be configured for the situation capture layer, the thought recognition layer, the action prediction layer and the decision-making layer respectively, which are used to verify whether the data format obtained by the corresponding layer is accurate. For example, whether the inner cognition result of the help-seeker conforms to the situation corresponding to the emotional and context features, whether the behavior prediction result conforms to the thought corresponding to the inner cognition result of the help-seeker, etc. It can be specifically set according to the actual design requirements and will not be further limited here.

[0028] Correspondingly, the help-seeking information is sent to the dialogue prediction model, and the reply prediction statement output by the dialogue prediction model is obtained, including: sending the help-seeking information to the feature extraction layer for feature extraction to obtain the information features output by the feature extraction layer; inputting the information features into the situation capture layer for emotion capture and context information extraction to obtain the emotion features and context features output by the situation capture layer; inputting the emotion features and context features into the thought recognition layer for predicting the inner cognition of the help-seeker to obtain the inner cognition result of the help-seeker output by the thought recognition layer; inputting the inner cognition result of the help-seeker into the action prediction layer for predicting the behavioral result to obtain the behavior prediction result output by the action prediction layer; inputting the behavior prediction result into the decision-making layer for decision-making, so as to generate a reply prediction statement according to the strategy and the purpose of the strategy obtained by the decision-making, and obtaining the reply prediction statement output by the decision-making layer.

[0029] In an alternative embodiment, before sending the help request information to the dialogue prediction model and obtaining the reply prediction statement output by the dialogue prediction model, it includes: randomly selecting any role from the role library; wherein, the role library is constructed from the seeker roles obtained by first extracting key information from the emotional support dialogue data filtered from the dataset for mental health support based on preset target attributes and supplementing the missing attributes of the extracted key information. The dataset for mental health support includes emotional support dialogue data on various mental health topics, and the emotional support dialogue data is used to represent the dialogue data corresponding to the emotional problems and the scenarios involved in the emotional problems; randomly selecting any example from the dialogue example library; wherein, the dialogue example library is constructed from the examples obtained by first supplementing the seeker role information and the supporter reasoning process for a target number of dialogue samples selected from the emotional support dialogue corpus; according to the selected role and the selected example, using the first large language model, obtaining dialogue generation data, and using the dialogue generation data to train the dialogue prediction model to be trained. Figure 2 Specifically, according to the selected role and the selected example, using the first large language model to obtain dialogue generation data includes: using the first large language model to generate dialogue data according to the selected role and the selected example to obtain dialogue generation data.

[0030] It should be added that the first large language model can be selected according to actual usage requirements, such as GPT-4, etc., and no further limitation is made here. In addition, the example includes the selected dialogue sample and the supplemented seeker role and supporter reasoning process corresponding to the selected dialogue sample, so that the help request information of the seeker in the dialogue generation data closely follows the corresponding selected role information, conforms to the degree and manner of information disclosure in the social communication context, realizes reasonable social information display, and at the same time, enables the response made by the supporter based on the help request information to be generated after the supporter reasoning process, so as to imitate the human thinking logic, deeply analyze the seeker's state, and thus generate a more targeted, empathetic and supportive response, better simulating the real emotional support dialogue, reflecting the judgment and feedback that conform to social common sense and social logic, and ensuring the fitting degree of the dialogue content with the actual social scenario. The generation of the example can be specifically referred to the following description, and no repeated elaboration is made here.

[0031]

[0032] ​For example, the role library includes impatient customers, complaining customers, and consulting customers. If it is detected that the customer has a fast speaking speed and an urgent tone, after the supporter reasoning process, it is analyzed that the customer is in a hurry to handle a transfer, and the corresponding strategy is generated: first, soothe the emotion "Don't worry, I'll help you handle it quickly", and at the same time operate efficiently "We can give priority to handling this business"; for another example, if it is detected that the customer is emotional and dissatisfied, after the supporter reasoning process, it is judged that the customer is dissatisfied due to business delays, and the corresponding strategy is generated: express understanding "I understand your anxiety and dissatisfaction", and provide a solution "We will handle it for you immediately and compensate for your losses".

[0033] In addition, using the dialogue generation data to train the dialogue prediction model to be trained includes: using the help-seeker's help information in the dialogue generation data as the input data for training, using the supporter's reply in the dialogue generation data as the label for training, and training the dialogue prediction model to be trained. It should be added that the model to be trained can be an existing algorithm model built into the training device, and this existing algorithm model usually includes an algorithm structure, or it can be an algorithm structure specified by the user, and no further limitation is made here.

[0034] In an alternative embodiment, before randomly selecting any role from the role library, it includes: performing emotional support dialogue quality screening on the dataset for mental health support to obtain emotional support dialogue data; based on the preset target attributes and combined with the preset psychological theory, extracting key information from the emotional support dialogue data to obtain key information; according to the key information and the emotional support dialogue data, using the second large language model to extract the context information of the key information from the emotional support dialogue data, and predicting and supplementing the attributes missing relative to the preset target attributes based on the extracted context information to obtain the supplemented key information; constructing a help-seeker role according to the supplemented key information; constructing a role library based on the constructed help-seeker role.

[0035] It should be added that performing emotional support dialogue quality screening on the dataset for mental health support to obtain emotional support dialogue data includes: for each attribute of the dataset for mental health support, performing quality scoring on all emotional support dialogues corresponding to the attribute, and selecting a preset number of emotional support dialogues from high to low based on the score to obtain emotional support dialogue data.

[0036] In addition, the dataset for mental health support can be a dataset created based on mental health Q&A data. For example, it can be the PsyQA dataset, which can be specifically selected according to actual usage requirements; the preset target attributes include gender, age, occupation, personality, topic, question, description, emotional label, previous attempts and effects, current goals and expectations, etc. In addition, when constructing the role library, each role is presented in the form of a key-value pair.

[0037] For example, in the customer service field, three types of data are collected: nearly ten thousand real customer service conversation records are exported from the call center; 500 hours of customer call audio is collected; 200 video clips of counter services are recorded. According to the three types of collected data, using the aforementioned method, a multi-dimensional customer role library is constructed: impatient customers, who speak fast, have a hasty tone, and are easily excited; complaining customers, who have large mood swings, high demands, and strong expressions; consulting customers, who speak slowly, need detailed explanations, and have a high level of patience.

[0038] In addition, the preset psychological theory can be selected from psychological theories in different research directions such as cognition, emotion, social interaction, and personality traits according to the target attributes to be analyzed as actually required. For example, the five-factor model of personality is selected, etc., and no further limitation is made here.

[0039] Furthermore, the second large language model can be selected based on actual design requirements. For example, it is GPT-4, to fully utilize the language understanding and inference capabilities of GPT-4 for attributes with missing role information and make reasonable guesses and supplements in combination with the scenario context. At the same time, after constructing the role of the applicant for help, it includes: conducting multiple reviews and improvements on the generated role to ensure the authenticity and reliability of each role.

[0040] In an optional embodiment, the role library contains at least 3,229 roles. By constructing a comprehensive role library of applicants for help, the rich scenarios of the real world and psychological theories are utilized to cover multi-dimensional detailed information, so as to effectively promote the social disclosure of applicants for help and greatly enhance the authenticity and diversity of the subsequent generated dialogue data.

[0041] In an optional embodiment, if the language used by the dialogue prediction model to be trained is different from the dataset used for mental health support, after obtaining the emotional support dialogue data, it includes: translating the emotional support dialogue data into the language used by the corresponding model according to the language used by the dialogue prediction model to be trained.

[0042] It should be noted that the translation can be achieved by calling a preset translation tool or a preset large language model, such as GPT-4, which can be specifically set according to actual translation requirements, and no further limitation is made here. In addition, after translation, it is also necessary to verify that the translated text is highly consistent with the original scenario in terms of semantics, emotion, and context to maintain the integrity and usability of the data.

[0043] In an optional embodiment, after obtaining the emotional support dialogue data, it further includes: filtering the emotional support dialogue data based on preset sensitive words; and / or, eliminating the emotional support dialogue data with a length lower than the preset character length, so as to ensure the security and effectiveness of the data and avoid interference or misleading to subsequent analysis.

[0044] It should be added that since the PsyQA dataset collects rich and diverse real-world help-seeking scenarios, which are presented in the form of questions and answers, covering detailed descriptions of emotional struggles and help-seeking topics, in order to ensure data quality and security, it is necessary to filter out potentially negative, sensitive words, irrelevant and sensitive topics such as professional medical treatments, etc. Through strict screening criteria and multiple verification mechanisms, the quality of the training data has been significantly improved, thus better ensuring the usability of the data. Additionally, the preset character length can be set according to actual design requirements or prior experience. For example, if 65 characters need to be retained in practice, the corresponding byte length is determined based on 65 characters as the preset character length, and no further limitation is made here.

[0045] In an alternative embodiment, before randomly selecting any example from the dialogue example library, it includes: selecting dialogue samples from each question category of the emotional support dialogue corpus; based on the selected dialogue samples, using a third large language model to supplement role information and predict the supporter reasoning process, obtaining the supplemented help-seeker role and supporter reasoning process; generating an example according to the selected dialogue samples and the supplemented help-seeker role and supporter reasoning process corresponding to the selected dialogue samples; constructing a dialogue example library according to the generated example.

[0046] It should be added that the emotional support dialogue corpus can be constructed based on different question categories and the emotional support dialogue samples corresponding to various question categories. The emotional support dialogue samples are used to represent the communication between the help-seeker and the supporter. The emotional support dialogue corpus can adopt ESConv, etc., and no further limitation is made here. Additionally, the supporter reasoning process can refer to the process of capturing the context, identifying thoughts, predicting actions, and making decisions for the extracted features in the aforementioned dialogue prediction model, enabling the AI system to conduct deeper psychological analysis, which will not be repeated here. Thus, on the basis of ensuring the fitting degree of the generated dialogue content with the actual social scenario, targeted emotional support and solutions are provided, so that the generated dialogue data has a complete portrait of the characters and background information, with real scenario support, improving the authenticity and cognitive depth of the generated dialogue data.

[0047] Furthermore, selecting dialogue samples from each question category of the emotional support dialogue corpus includes: obtaining the question categories of the emotional support dialogue corpus; for each question category, performing quality scoring on all the dialogue samples within the question category, and selecting a preset number of dialogue samples based on the scores from high to low. It should be noted that the preset number can be determined based on the total number of dialogue samples to be selected and the number of question categories.

[0048] Further, after obtaining the problem categories of the emotional support dialogue corpus, it includes: allocating weights to each problem category according to the problem categories of the emotional support dialogue corpus and in combination with a preset weight allocation rule; determining the number of samples to be selected for each problem category according to the weights allocated to each problem category and the preset total number of dialogue samples to be selected. Correspondingly, for each problem category, quality scores are given to all the dialogue samples within the problem category, and based on the scores from high to low, a preset number of dialogue samples are selected, including: for each problem category, quality scores are given to all the dialogue samples within the problem category, and based on the scores from high to low, the dialogue samples are selected according to the number of samples to be selected for the problem category.

[0049] It should be noted that the preset weight allocation rule can be configured according to prior experience to allocate corresponding weights according to the importance of different problem categories or the number of samples of different problem categories, etc. Specifically, it can be set according to actual design requirements and will not be further limited here.

[0050] In an alternative embodiment, after obtaining the dialogue generation data, it further includes: evaluating the quality, logic, and emotional support effect of the dialogue generation data to collect the dialogue generation data that meets the expectations and form a training data set for training the dialogue prediction model to be trained, providing sufficient data support for model training and evaluation.

[0051] In an alternative embodiment, after evaluating the quality, logic, and emotional support effect of the dialogue generation data, it further includes: optimizing the model training data according to the evaluation results.

[0052] In summary, the embodiments of the present invention utilize a dialogue prediction model to quickly respond according to the help-seeking information of the help-seeker and predict the corresponding reply sentences, so as to achieve a more targeted, empathetic, and supportive response, effectively saving manual processing time and improving service efficiency; in addition, roles and examples are selected based on the role library and the dialogue example library, and the first large language model is used to generate dialogue generation data, so that the dialogue prediction model can learn different role characteristics and rich examples based on the dialogue generation data, and the reply prediction sentences output by the trained model closely meet the needs of the help-seeker, improving the quality and relevance of the response.

[0053] The emotional support dialogue system provided by the present invention will be described below. The emotional support dialogue system described below can be mutually referred to with the emotional support dialogue method described above.

[0054] Figure 3 A schematic structural diagram of an emotional support dialogue system is shown. The system includes: An information acquisition module 31 that acquires help-seeking information, where the help-seeking information is used to represent the help-seeking goal and content of the help-seeker; The emotional support dialogue module 32 sends the help-seeking information to the dialogue prediction model, and obtains the predicted reply statement output by the dialogue prediction model. Among them, the dialogue prediction model is trained based on dialogue generation data, and the dialogue generation data is generated by using the first large language model to select roles and examples from the previously created role library and dialogue example library respectively. The dialogue prediction model is used to extract features from the input help-seeking information and perform dialogue prediction based on the extracted information features to obtain the predicted reply statement.

[0055] In this embodiment, the dialogue prediction model includes: a feature extraction layer that extracts features from the help-seeking information to obtain information features; a situation capture layer that captures emotions and extracts context information from the information features to obtain emotion features and context features; a thought recognition layer that predicts the inner cognition of the help-seeker based on the emotion features and context features to obtain the inner cognition result of the help-seeker; an action prediction layer that predicts the behavior result based on the inner cognition result of the help-seeker to obtain the behavior prediction result; a decision-making layer that makes a decision based on the behavior prediction result, determines the strategy and the purpose of the strategy, and generates a predicted reply statement based on the strategy and the purpose of the strategy.

[0056] Correspondingly, the emotional support dialogue module 32 is used to: send the help-seeking information to the feature extraction layer for feature extraction to obtain the information features output by the feature extraction layer; input the information features into the situation capture layer for emotion capture and context information extraction to obtain the emotion features and context features output by the situation capture layer; input the emotion features and context features into the thought recognition layer for predicting the inner cognition of the help-seeker to obtain the inner cognition result of the help-seeker output by the thought recognition layer; input the inner cognition result of the help-seeker into the action prediction layer for predicting the behavior result to obtain the behavior prediction result output by the action prediction layer; input the behavior prediction result into the decision-making layer for decision-making, so as to generate a predicted reply statement according to the strategy and the purpose of the strategy obtained by the decision-making, and obtain the predicted reply statement output by the decision-making layer.

[0057] In an alternative embodiment, the device further includes: a role selection module that randomly selects any role from a role library before sending the help request information to the dialogue prediction model and obtaining the reply prediction statement output by the dialogue prediction model; wherein the role library is constructed from the client roles obtained by first extracting the key information from the emotional support dialogue data filtered from the dataset for mental health support based on preset target attributes and supplementing the missing attributes of the extracted key information. The dataset for mental health support includes emotional support dialogue data on various mental health topics, and the emotional support dialogue data is used to represent the dialogue data corresponding to the emotional problems and the scenarios involved in the emotional problems; an example selection module that randomly selects any example from a dialogue example library; wherein the dialogue example library is constructed from the examples obtained by first supplementing the client role information and the supporter reasoning process for a target number of dialogue samples selected from the emotional support dialogue corpus; a statement generation module that uses a first large language model to obtain dialogue generation data according to the selected role and the selected example; and a model training module that uses the dialogue generation data to train the dialogue prediction model to be trained.

[0058] Specifically, the statement generation module is configured to: use the first large language model to generate dialogue data according to the selected role and the selected example to obtain dialogue generation data.

[0059] In addition, the model training module is configured to: use the client help request information in the dialogue generation data as the input data for training, and use the supporter's reply in the dialogue generation data as the label for training to train the dialogue prediction model to be trained.

[0060] In an alternative embodiment, the device further includes: a dialogue screening module that screens the quality of the emotional support dialogue for the dataset for mental health support to obtain emotional support dialogue data before randomly selecting any role from the role library; an information extraction module that extracts key information from the emotional support dialogue data based on preset target attributes and in combination with preset psychological theories to obtain key information; a first supplementation module that uses a second large language model to extract the context information of the key information from the emotional support dialogue data according to the key information and the emotional support dialogue data, and predicts and supplements the attributes missing relative to the preset target attributes based on the extracted context information to obtain the supplemented key information; a role construction module that constructs client roles according to the supplemented key information; and a role library construction module that constructs a role library based on the constructed client roles.

[0061] It should be added that the dialogue screening module is configured to: perform quality scoring on all the emotional support dialogues corresponding to each attribute of the dataset for mental health support, and select a preset number of emotional support dialogues from high to low based on the scores to obtain emotional support dialogue data.

[0062] The device further includes: a verification module, which, after constructing the role of the seeker, conducts multiple reviews and improvements on the generated role to ensure the authenticity and reliability of each role.

[0063] In an alternative embodiment, if the language used by the dialogue prediction model to be trained is different from the dataset for mental health support, the device further includes: a translation module, which, after obtaining the emotional support dialogue data, translates the emotional support dialogue data into the language used by the corresponding model according to the language used by the dialogue prediction model to be trained.

[0064] In an alternative embodiment, the dialogue screening module is further configured to: after obtaining the emotional support dialogue data, filter the emotional support dialogue data based on preset sensitive words; and / or, eliminate the emotional support dialogue data with a length lower than the preset character length based on the preset character length, so as to ensure the security and effectiveness of the data and avoid interference or misleading to subsequent analysis.

[0065] In an alternative embodiment, the device further includes: a sample selection module, which selects dialogue samples from each question category of the emotional support dialogue corpus before randomly selecting any example from the dialogue example library; a second supplement module, which, according to the selected dialogue samples, uses a third large language model to perform role information supplementation and supporter reasoning process prediction to obtain the supplemented seeker role and supporter reasoning process; an example generation module, which generates examples according to the selected dialogue samples and the supplemented seeker role and supporter reasoning process corresponding to the selected dialogue samples; an example library construction module, which constructs a dialogue example library according to the generated examples.

[0066] Further, the sample selection module includes: a category acquisition unit, which acquires the question categories of the emotional support dialogue corpus; a sample selection unit, which, for each question category, performs quality scoring on all dialogue samples within the question category and selects a preset number of dialogue samples based on the scores from high to low.

[0067] Furthermore, the sample selection module further includes: a weight assignment unit, which, after acquiring the question categories of the emotional support dialogue corpus, assigns weights to each question category according to the question categories of the emotional support dialogue corpus and in combination with a preset weight assignment rule; a quantity determination unit, which determines the quantity of samples to be selected for each question category according to the weights assigned to each question category and the preset total quantity of dialogue samples to be selected. Correspondingly, the sample selection unit is configured to: for each question category, perform quality scoring on all dialogue samples within the question category and select dialogue samples according to the quantity of samples to be selected for the question category based on the scores from high to low.

[0068] In an alternative embodiment, the device further includes an evaluation module that, after obtaining the dialogue generation data, evaluates the quality, logic, and emotional support effect of the dialogue generation data to collect the dialogue generation data that meets the expectations and form a training data set for training the dialogue prediction model to be trained, providing sufficient data support for model training and evaluation.

[0069] In an alternative embodiment, the device further includes an optimization module that, after evaluating the quality, logic, and emotional support effect of the dialogue generation data, optimizes the model training data according to the evaluation results.

[0070] In summary, the embodiments of the present invention utilize a dialogue prediction model to quickly respond according to the help-seeking information of the help-seeker, predict the corresponding reply statement, effectively saving the manual processing time and improving the service efficiency. Additionally, based on the role library and dialogue example library, roles and examples are selected, and the first large language model is used to generate dialogue generation data to achieve more targeted, empathetic, and supportive responses, enabling the dialogue prediction model to learn different role characteristics and rich examples based on the dialogue generation data, making the reply prediction statements output by the trained model closely match the needs of the help-seeker and improving the quality and relevance of the responses.

[0071] Figure 4 An example of the physical structure diagram of an electronic device is shown as Figure 4 As shown, the electronic device may include a processor 410, a communication interface 420, a memory 430, and a communication bus 440. Among them, the processor 410, the communication interface 420, and the memory 430 communicate with each other through the communication bus 440. The processor 410 can call the logical instructions in the memory 430 to execute the emotional support dialogue method, which includes: obtaining help-seeking information for representing the help-seeking goal and content of the help-seeker; sending the help-seeking information to the dialogue prediction model to obtain the reply prediction statement output by the dialogue prediction model; wherein, the dialogue prediction model is trained based on the dialogue generation data, and the dialogue generation data is generated by using the first large language model based on the roles and examples respectively selected from the previously created role library and dialogue example library; the dialogue prediction model is used to extract features from the input help-seeking information and perform dialogue prediction based on the extracted information features to obtain the reply prediction statement.

[0072] In addition, when the logical instructions in the above-mentioned memory 430 can be implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.

[0073] On the other hand, the present invention also provides a computer program product. The computer program product includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the emotional support dialogue method provided by the above-mentioned various methods. The method includes: obtaining help-seeking information, where the help-seeking information is used to represent the help-seeking goal and content of the help-seeker; sending the help-seeking information to a dialogue prediction model to obtain a reply prediction statement output by the dialogue prediction model; wherein, the dialogue prediction model is trained based on dialogue generation data, and the dialogue generation data is generated by using a first large language model to respectively select roles and examples from a previously created role library and a dialogue example library; the dialogue prediction model is used to extract features from the input help-seeking information and perform dialogue prediction based on the extracted information features to obtain a reply prediction statement.

[0074] On another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it is implemented to execute the emotional support dialogue method provided by the above-mentioned various methods. The method includes: obtaining help-seeking information, where the help-seeking information is used to represent the help-seeking goal and content of the help-seeker; sending the help-seeking information to a dialogue prediction model to obtain a reply prediction statement output by the dialogue prediction model; wherein, the dialogue prediction model is trained based on dialogue generation data, and the dialogue generation data is generated by using a first large language model to respectively select roles and examples from a previously created role library and a dialogue example library; the dialogue prediction model is used to extract features from the input help-seeking information and perform dialogue prediction based on the extracted information features to obtain a reply prediction statement.

[0075] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without creative work.

[0076] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0077] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments or equivalently replace some of the technical features. These modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. An emotional support dialogue method, characterized in that: include: Acquiring help information, wherein the help information is used to characterize the help-seeking goal and content of the help-seeker; Sending the help information to a dialogue prediction model to obtain a reply prediction sentence output by the dialogue prediction model; wherein the dialogue prediction model is trained based on dialogue generation data, and the dialogue generation data is generated by using a first language model based on roles and examples selected from a previously created role library and dialogue example library, respectively; The dialogue prediction model is used to extract features of the input help information, and perform dialogue prediction based on the extracted information features to obtain a reply prediction sentence.

2. The emotional support dialogue method according to claim 1, characterized in that: The dialogue prediction model includes: A feature extraction layer extracts features from the help information to obtain information features; A context capture layer performs sentiment capture on the information features and extracts context information to obtain sentiment features and context features; The thought recognition layer predicts the inner cognition of the help seeker based on the emotional features and the context features to obtain the inner cognition result of the help seeker; The action prediction layer predicts the behavior results of the help-seeker's inner cognitive results to obtain the behavior prediction results; The decision layer makes decisions based on the behavior prediction results, determines the strategy and the purpose of the strategy, and generates a response prediction statement based on the strategy and the purpose of the strategy.

3. The emotional support dialogue method according to claim 1, characterized in that: Before sending the help information to the dialogue prediction model to obtain the reply prediction sentence output by the dialogue prediction model, the method includes: Randomly select any role from a role library; wherein the role library is constructed by extracting key information from emotional support dialogue data screened from a data set for mental health support based on preset target attributes, and supplementing the extracted key information with missing attributes to obtain a help-seeker role, the data set for mental health support includes emotional support dialogue data on a variety of mental health topics, and the emotional support dialogue data is used to characterize dialogue data corresponding to emotional problems and scenes involving the emotional problems; Randomly select any example from a dialogue example library; wherein the dialogue example library is constructed based on examples obtained by supplementing a target number of dialogue samples selected from an emotional support dialogue corpus with help-seeker role information and supporter reasoning process; According to the selected role and the selected example, the first language model is used to obtain dialogue generation data, and the dialogue prediction model to be trained is trained using the dialogue generation data.

4. The emotional support dialogue method according to claim 3, characterized in that: Before randomly selecting any character from the character pool, including: Perform emotional support conversation quality screening on the dataset used for mental health support to obtain emotional support conversation data; Based on preset target attributes and in combination with preset psychological theories, key information is extracted from the emotional support dialogue data to obtain key information; According to the key information and the emotional support dialogue data, using the second language model, context information of the key information is extracted from the emotional support dialogue data, and based on the extracted context information, attributes missing from the preset target attributes are predicted and supplemented to obtain supplemented key information; Construct the help-seeker role based on the supplemented key information; Build a role library based on the constructed help-seeker roles.

5. The emotional support dialogue method according to claim 4, characterized in that: After obtaining emotional support conversation data, including: filtering the emotional support dialogue data based on preset sensitive words; and / or, Based on a preset character length, the emotional support dialogue data having a length shorter than the preset character length is eliminated.

6. The emotional support dialogue method according to claim 3, characterized in that: Before randomly selecting any example from the conversation example library, include: Select dialogue samples from each question category in the emotional support dialogue corpus; According to the selected dialogue samples, the third language model is used to supplement the role information and predict the supporter reasoning process, so as to obtain the supplemented help-seeker role and supporter reasoning process; Generate an example according to the selected dialogue sample and the supplemented help-seeker role and supporter reasoning process corresponding to the selected dialogue sample; Based on the generated examples, a dialogue example library is constructed.

7. The emotional support dialogue method according to claim 6, characterized in that: Conversation samples were selected from various question categories in the emotional support dialogue corpus, including: Question categories for obtaining emotional support dialogue corpus; For each question category, all dialogue samples within the question category are scored for quality, and a preset number of dialogue samples are selected based on the scores from high to low.

8. An emotional support dialogue system, characterized in that: include: An information acquisition module is used to acquire help-seeking information, wherein the help-seeking information is used to characterize the help-seeking goal and content of the help-seeker; The emotional support dialogue module sends the help information to the dialogue prediction model to obtain a reply prediction sentence output by the dialogue prediction model; wherein the dialogue prediction model is trained based on dialogue generation data, and the dialogue generation data is generated by using the first language model based on roles and examples selected from a previously created role library and dialogue example library, respectively; The dialogue prediction model is used to extract features of the input help information, and perform dialogue prediction based on the extracted information features to obtain a reply prediction sentence.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the emotional support dialogue method as described in any one of claims 1 to 7 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the emotional support dialogue method as described in any one of claims 1 to 7 is implemented.