Psychological consultation method, device and equipment based on artificial intelligence and storage medium

Through the empathy model based on reinforcement learning algorithm, combined with large language models and historical dialogue records, the problem of poor emotional discrimination and intervention effects in psychological counseling is solved, and more accurate emotional recognition and psychological intervention are achieved, which enhances users Interactive experience.

CN119153040AInactive Publication Date: 2024-12-17BANGYAN TECH +1

Patent Information

Application Number
CN202411623435.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-14
Publication Date
2024-12-17
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the prior art, artificial intelligence has low accuracy in emotional discrimination in psychological counseling, poor psychological intervention effect, and cannot deeply perceive complex psychological intentions and emotional states.

Method used

Adopt empathy model trained based on reinforcement learning algorithm, and improve emotional recognition and psychological intervention by obtaining psychological counseling seed data sets, generating interrupt semantic data sets, and using large language model simulations to simulate multiple rounds of dialogues. accuracy.

Benefits of technology

It improves the accuracy of emotional discrimination, enhances the effect of psychological intervention, generates highly personalized empathetic responses, alleviates negative emotions of users, and creates a safe conversation environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119153040A_ABST
    Figure CN119153040A_ABST
Patent Text Reader

Abstract

The invention provides a psychological counseling method, device and equipment based on artificial intelligence and a storage medium. The method provided by the invention comprises the following steps: acquiring current dialogue data of a user; according to the current dialogue data of the user, an emotional model outputs a response, the emotional model is obtained through training according to a first multi-round dialogue, a natural language processing model and a reinforcement learning algorithm, and the obtaining process of the first multi-round dialogue comprises the steps that a psychological counseling seed data set is guided and synthesized into a psychological counseling case through a preset first prompt word, the psychological counseling case is simulated through a preset second prompt word to generate a first multi-round dialogue, and the acquisition process of the common situation model comprises the steps that the model is trained according to the interrupt semantic data set, the first multi-round dialogue with the score larger than a preset score threshold value serves as a second multi-round dialogue, and the output of the model is aligned with the reply of the second multi-round dialogue; and obtaining a common-situation model. According to the method, the emotion judgment accuracy can be improved, and the psychological intervention effect is enhanced.
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 in particular to an artificial intelligence-based psychological consultation method, device, equipment and storage medium. Background Art

[0002] Mental health generally refers to the normal state of an individual's mental activities, that is, normal cognition, coordinated emotions, sound will, complete personality and good adaptation, and the ability to give full play to one's maximum potential to adapt to the development and changes of life, study, work and social environment. The existence of mental health problems will have a negative impact on the development and health of individuals, and will weaken the individual's subjective well-being, reduce the individual's social adaptability, and even threaten the individual's physical health. As artificial intelligence technology has shown great potential in many fields such as medicine, education, and finance, its application in the field of mental health services is also becoming increasingly apparent. With the help of the psychological big model of artificial intelligence technology, innovative service models can be provided for medical institutions, schools, Internet platforms, etc. Although artificial intelligence technology can identify and predict certain behavioral patterns, it still cannot perceive complex psychological intentions and emotional states as deeply as humans, which makes artificial intelligence less accurate in emotional discrimination and less effective in psychological intervention when providing psychological counseling services. Summary of the invention

[0003] The purpose of the present invention is to provide a psychological consultation method, device, equipment and storage medium based on artificial intelligence to solve the technical problems of low accuracy of emotion discrimination and poor psychological intervention effect in the prior art.

[0004] The technical solution of the present invention is as follows, which provides a psychological consultation method based on artificial intelligence, including: Get the user's current conversation data; The empathy model outputs a response according to the user's current conversation data. The empathy model is obtained by training based on the first multiple rounds of conversations, the natural language processing model and the reinforcement learning algorithm. The process of obtaining the first multiple rounds of conversations includes obtaining a psychological counseling seed data set, using a large language model to guide the synthesis of the psychological counseling seed data set into multiple psychological counseling cases by presetting a first prompt word, and using the large language model to simulate the psychological counseling cases by presetting a second prompt word to generate the first multiple rounds of conversations between the user and the psychological counselor. The process of obtaining the empathy model includes generating an interruption semantic data set, training the natural language processing model according to the interruption semantic data set, dividing the first multiple rounds of conversations according to the scoring of the reward model, taking the first multiple rounds of conversations with a score greater than a preset scoring threshold as the second multiple rounds of conversations, and using the reinforcement learning algorithm to align the output of the natural language processing model with the reply of the second multiple rounds of conversations to obtain the empathy model.

[0005] Furthermore, we obtain the psychological counseling seed dataset, including: Crawling posts related to psychological counseling as initial seed data, grouping the initial seed data according to topic type, calculating the similarity between different groups, deduplicating multiple groups whose similarity is greater than a preset similarity threshold, filtering out the deduplicated initial seed data whose length is less than a preset length threshold, and obtaining a psychological counseling seed data set.

[0006] Furthermore, the use of a large language model to guide the synthesis of the psychological counseling seed data set into multiple psychological counseling cases by presetting the first prompt word includes: A large language model is used to guide the synthesis of the psychological counseling seed data set into multiple psychological counseling cases including titles, types, case summaries, counseling processes and experience summaries through preset first prompt words. The preset first prompt words include scenarios, case overviews, psychological analysis, diagnostic assessments, treatment recommendations, prognosis assessments and precautions.

[0007] Furthermore, the generating of the interruption semantic data set and training the natural language processing model according to the interruption semantic data set includes: A stop phrase of a random voice timbre is mixed with noise to generate an interruption semantic data set, the interruption semantic data set is combined with the second multiple rounds of dialogue to form a training data set, and the natural language processing model is trained using the training data set, so that the natural language processing model generates an interruption mark or a non-interruption mark, stops output after the interruption mark is generated, and does not stop output after the non-interruption mark is generated.

[0008] Furthermore, in the training process of the natural language processing model, it also includes: An adult scoring model and a youth scoring model are constructed, and the natural language processing model is trained by the adult scoring model and the youth scoring model. The dimensions of the adult scoring model include emotion recognition ability, analysis ability, semantic understanding ability, logic ability, ability to ask open-ended questions, ability to positively guide users, ability to continue conversations, ability to summarize contexts, ability to cope with resistance, oral expression ability and overall score; the dimensions of the youth scoring model include emotion recognition ability, emotion coping ability, encouragement and positive guidance ability, language interest and oral expression ability, semantic understanding ability, logic ability, ability to continue conversations, ability to summarize contexts, ability to cope with resistance and overall score.

[0009] Furthermore, the artificial intelligence-based psychological consultation method further includes storing historical conversation records and user memories in a database; and causing the empathy model to output a response based on the user's current conversation data, including: The retrieval enhancement generation model is used to extract the most relevant historical conversation records and user memories from the database according to the user's current conversation data, and the most relevant historical conversation records and user memories are filled into the prompt words of the empathy model, so that the empathy model outputs a response.

[0010] Furthermore, the historical conversation record is historical conversation data between the empathy model and the user, and the user memory is input into the empathy model as the historical conversation record and uses a preset second prompt word to enable the empathy model to generate a conversation summary text.

[0011] Another technical solution of the present invention is as follows: a psychological consultation device based on artificial intelligence is provided, comprising a data acquisition module and a response module; The data acquisition module is used to acquire the user's current conversation data; The response module is used to make the empathy model output a response according to the current conversation data of the user. The empathy model is obtained based on the first multi-round conversation, the natural language processing model and the training using the reinforcement learning algorithm. The acquisition process of the first multi-round conversation includes obtaining a psychological counseling seed data set, using a large language model to guide the synthesis of the psychological counseling seed data set into multiple psychological counseling cases by presetting a first prompt word, and using the large language model to simulate the psychological counseling case to generate a first multi-round conversation between the user and the psychological counselor by presetting a second prompt word. The acquisition process of the empathy model includes generating an interruption semantic data set, training the natural language processing model according to the interruption semantic data set, dividing the first multi-round conversation according to the scoring of the reward model, taking the first multi-round conversation with a score greater than a preset scoring threshold as the second multi-round conversation, and using the reinforcement learning algorithm to align the output of the natural language processing model with the reply of the second multi-round conversation to obtain the empathy model.

[0012] Another technical solution of the present invention is as follows: an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program executable by the processor, and when the processor executes the computer program, the artificial intelligence-based psychological counseling method as described in any of the above technical solutions is implemented.

[0013] Another technical solution of the present invention is as follows: a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the artificial intelligence-based psychological counseling method as described in any of the above technical solutions is implemented.

[0014] The beneficial effects of the present invention are: obtaining the user's current conversation data; making the empathy model output a response according to the user's current conversation data, the empathy model is obtained according to the first multi-round conversation, the natural language processing model and trained by the reinforcement learning algorithm, the acquisition process of the first multi-round conversation includes: obtaining a psychological counseling seed data set, using a large language model to guide the synthesis of the psychological counseling seed data set into multiple psychological counseling cases by presetting a first prompt word, using the large language model to simulate the psychological counseling case by presetting a second prompt word to generate a first multi-round conversation between the user and the psychological counselor, the acquisition process of the empathy model includes: generating an interruption semantic data set, training the natural language processing model according to the interruption semantic data set, dividing the first multi-round conversation by the score of the reward model, taking the first multi-round conversation with a score greater than a preset score threshold as the second multi-round conversation, and using the reinforcement learning algorithm to align the output of the natural language processing model with the reply of the second multi-round conversation to obtain the empathy model; through the above technical solution, the accuracy of emotion discrimination can be improved and the psychological intervention effect can be enhanced. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 A flowchart of an artificial intelligence-based psychological counseling method provided in an embodiment of the present invention.

[0016] Figure 2 A schematic diagram of the structure of an artificial intelligence-based psychological counseling device provided in an embodiment of the present invention.

[0017] Figure 3 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0018] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0019] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0020] Figure 1is a flowchart of the artificial intelligence-based psychological counseling method of an embodiment of the present invention. It should be noted that if there is substantially the same result, the artificial intelligence-based psychological counseling method of the present invention is not based on Figure 1 The process sequence shown is limited. Figure 1 As shown, the artificial intelligence-based psychological consultation method mainly includes the following steps: S101, obtaining the user's current conversation data; S102, making the empathy model output a response according to the current conversation data of the user, the empathy model is obtained according to the first multi-round conversation, the natural language processing model and trained by the reinforcement learning algorithm, the process of obtaining the first multi-round conversation includes obtaining a psychological counseling seed data set, using a large language model to guide the synthesis of the psychological counseling seed data set into multiple psychological counseling cases by presetting a first prompt word, using the large language model to simulate the psychological counseling case by presetting a second prompt word to generate a first multi-round conversation between the user and the psychological counselor, the process of obtaining the empathy model includes generating an interruption semantic data set, training the natural language processing model according to the interruption semantic data set, dividing the first multi-round conversation according to the scoring of the reward model, taking the first multi-round conversation with a score greater than a preset scoring threshold as the second multi-round conversation, and using the reinforcement learning algorithm to align the output of the natural language processing model with the reply of the second multi-round conversation to obtain the empathy model.

[0021] In some embodiments, obtaining a psychological consultation seed dataset includes: Crawling posts related to psychological counseling as initial seed data, grouping the initial seed data according to topic type, calculating the similarity between different groups, deduplicating multiple groups whose similarity is greater than a preset similarity threshold, filtering out the deduplicated initial seed data whose length is less than a preset length threshold, and obtaining a psychological counseling seed data set.

[0022] In a specific embodiment, posts related to psychological counseling can be crawled from the Internet as initial seed data. The initial seed data may include topics, discussions, and psychological counseling dialogues related to psychology on social platforms, such as a topic titled "Why am I always anxious?" All initial seed data can be grouped according to topics, the similarities between different groups are calculated, and multiple groups with similarities greater than a preset similarity threshold are deduplicated. For example, two groups with similarities greater than 0.7 are selected for deduplication. It should be noted that the MinHash algorithm can effectively estimate the similarity between sets by using a random hash function, so that duplicate content can be quickly identified in a large-scale data set, significantly improving the efficiency of data processing. In order to ensure the quality of the final psychological counseling seed data set, the length of the deduplicated initial seed data can also be filtered. For example, any post with a length of less than 50 characters (initial seed data after duplication) will be excluded to ensure that the selected data can provide sufficient information and context to avoid processing those initial seed data that are too short and cannot convey complete emotions or problems, thereby improving the effectiveness of subsequent analysis. After the above cleaning and deduplication steps, we can obtain a carefully screened low-duplication seed dataset, namely the psychological counseling seed dataset. This psychological counseling seed dataset contains a variety of psychological counseling topics, covering a variety of mental health topics from anxiety, depression to interpersonal relationships, and the total number of entries can be more than 60,000.

[0023] In an embodiment of the present invention, posts related to psychological counseling are crawled as initial seed data, the initial seed data are grouped according to topic types, the similarities between different groups are calculated, multiple groups whose similarities are greater than a preset similarity threshold are deduplicated, and the deduplicated initial seed data whose length is less than a preset length threshold are filtered out to obtain a psychological counseling seed data set. A high-quality psychological counseling seed data set can be obtained, which is helpful to improve the accuracy of the empathy model in distinguishing emotions.

[0024] In some embodiments, the method of using a large language model to guide the synthesis of the psychological counseling seed data set into multiple psychological counseling cases by presetting a first prompt word includes: A large language model is used to guide the synthesis of the psychological counseling seed data set into multiple psychological counseling cases including titles, types, case summaries, counseling processes and experience summaries through preset first prompt words. The preset first prompt words include scenarios, case overviews, psychological analysis, diagnostic assessments, treatment recommendations, prognosis assessments and precautions.

[0025] In a specific embodiment, the natural language understanding capability based on a large language model (e.g., a strong commercial large language model) guides the synthesis of a psychological counseling seed data set into a psychological counseling case through a first preset prompt word. Specifically, the first preset prompt word is used to allow the large language model to summarize the topic into several parts such as title, type, case summary, counseling process, and experience summary. The first preset prompt word may include: scenario, [number]; please complete the following psychological counseling case analysis based on the above scenario; case overview, which may include a brief summary of the main situation and core issues of the case; psychological analysis, which may include analyzing the client's possible psychological problems or disorders, and exploring the potential causes and influencing factors of these problems; diagnostic assessment, which may include giving a possible psychological diagnosis and explaining the reasons; treatment suggestions, which may include proposing a psychological treatment method suitable for the client and listing specific treatment goals and steps; prognosis assessment, which may include predicting treatment effects and long-term prognosis; precautions, which may include reminding of issues that need special attention during the consultation process.

[0026] In a specific embodiment, using the large language model to simulate the psychological counseling case by presetting the second prompt word to generate the first multiple rounds of dialogue between the user and the psychological counselor can include using the strong commercial large language model to simulate the multiple rounds of dialogue between the user and the psychological counselor based on the psychological counseling case. Specifically, the first multiple rounds of dialogue can be generated by the second preset prompt word. For example, the second preset prompt word can be "You are responsible for restoring the multiple rounds of long dialogues between the user and the psychological counselor based on the psychological counseling case." By passing the psychological counseling case into the prompt word of the model (the second preset prompt word), the strong commercial large language model can output the first multiple rounds of dialogue.

[0027] In a specific embodiment, the first multiple rounds of dialogue are divided by the scoring of the reward model, and the first multiple rounds of dialogue with a score greater than a preset scoring threshold are used as the second multiple rounds of dialogue. The first multiple rounds of dialogue are filtered based on the scoring of the reward model, and high-quality psychological counseling multiple rounds of dialogue data (second multiple rounds of dialogue) are used as output. Specifically, the first multiple rounds of dialogue can be scored using the reward model and prompt words written by psychological experts. The above prompt words contain scoring standards in multiple dimensions, for example: Please score the following multiple rounds of dialogue from multiple dimensions such as human expression, emotion recognition ability, and continuous dialogue ability, with scores between 1-100: [First multiple rounds of dialogue], and the multiple rounds of dialogue with a score result not greater than the preset scoring threshold (for example, 70 points) are filtered out.

[0028] In a specific embodiment, the first multi-round dialogue (the first multi-round dialogue whose scoring result is not greater than the preset scoring threshold) can be filtered out as the third multi-round dialogue, and the output of the natural language processing model is aligned with the response of the second multi-round dialogue using a reinforcement learning algorithm to obtain an empathy model. It should be noted that the reinforcement learning algorithm is intended to optimize the model through human preference data. It directly adjusts the model parameters through preference data, bypasses the fitting of the explicit reward model and the complex reinforcement learning optimization process, can improve training efficiency, and can also avoid the instability common in traditional human feedback reinforcement learning methods, thereby generating high-quality responses and avoiding the generation of low-quality multi-round dialogue responses.

[0029] In some embodiments, generating an interruption semantic dataset and training the natural language processing model according to the interruption semantic dataset includes: A stop phrase of a random voice timbre is mixed with noise to generate an interruption semantic data set, the interruption semantic data set is combined with the second multiple rounds of dialogue to form a training data set, and the natural language processing model is trained using the training data set, so that the natural language processing model generates an interruption mark or a non-interruption mark, stops output after the interruption mark is generated, and does not stop output after the non-interruption mark is generated.

[0030] In a specific embodiment, semantic interruption construction is performed in model training, and a stop phrase with a random voice tone (e.g., "stop for a moment") is synthesized, which is then mixed with noise to generate an interruption semantic data set, which is combined with the second multi-round dialogue to form a training data set. The natural language processing model is trained using the training data set so that the natural language processing model generates an interruption mark or a non-interruption mark, and stops outputting after generating the interruption mark, and does not stop outputting after generating the non-interruption mark. The model can receive long sequence data (i.e., training data set) containing stop phrases in various noises, and the model will generate a status mark in real time, i.e., an interruption mark irq or a non-interruption mark n-irq, which respectively represent the user's intention to interrupt and not interrupt. During the model reasoning process, when the model outputs the irq mark, it will stop the generation process and start listening for new questions. In order for the model to complete this task, the status mark can be used as input to enhance the model's ability to process dialogues in real time.

[0031] In some embodiments, the training process of the natural language processing model further includes: An adult scoring model and a youth scoring model are constructed, and the natural language processing model is trained by the adult scoring model and the youth scoring model. The dimensions of the adult scoring model include emotion recognition ability, analysis ability, semantic understanding ability, logic ability, ability to ask open-ended questions, ability to positively guide users, ability to continue conversations, ability to summarize contexts, ability to cope with resistance, oral expression ability and overall score; the dimensions of the youth scoring model include emotion recognition ability, emotion coping ability, encouragement and positive guidance ability, language interest and oral expression ability, semantic understanding ability, logic ability, ability to continue conversations, ability to summarize contexts, ability to cope with resistance and overall score.

[0032] In a specific embodiment, in model training, a scoring model can be used for people of different age groups (adults, teenagers and children). The adult scoring model includes the following dimensions: emotion recognition ability, analysis ability, semantic understanding ability, logic ability, ability to ask open-ended questions, ability to guide users positively, ability to continue dialogue, ability to summarize context, ability to deal with resistance, ability to express in spoken language, and overall score. Each dimension can have three score intervals, namely 1-3 points, 4-7 points, and 8-10 points. For example, in emotion recognition ability, it can accurately and meticulously recognize and understand the user's emotions in text communication, including complex, mixed or hidden emotional states, and use clear and direct language to express complex emotions. It has a high sensitivity to the subtle emotional changes, tone, and wording choices of the user in language expression, and can quickly grasp the hidden emotional core of the user's speech. It can not only recognize explicit emotions (such as anger and sadness), but also distinguish subtle emotions hidden under the surface (such as self-blame in frustration or fear in anxiety). At this time, the score of emotion recognition ability can be 10 points.

[0033] The youth scoring model includes the following dimensions: emotion recognition ability, emotion coping ability, encouragement and positive guidance ability, language interest and colloquial expression ability, semantic understanding ability, logical ability, continuous conversation ability, context summary ability, resistance coping ability, and overall score. For example, in the continuous conversation ability, the ability to maintain a conversation fluently and naturally, continue the communication through precise questions, responses and feedback, be good at capturing the key points in the user's words, and make appropriate responses based on the user's emotions and expressions to ensure that the conversation always remains in-depth and coherent. No matter how complex or sensitive the topic is, the user can be guided in a flexible and delicate manner to avoid pauses or dull moments in the conversation. The user can actively pay attention to and respond to the user's hobbies and topics of interest, and bring in topics at appropriate times to help users feel understood and valued. When the user spontaneously mentions topics of interest, the user can show active attention to increase the intimacy of the communication. At this time, the continuous conversation ability score can be 10 points. In order to prevent the model from having a negative impact on users during conversations, deduction items can be added to the scoring model, including monitoring of provocative suggestions and requirements for compliance with moral boundaries and ethical principles to ensure that the model does not produce inappropriate verbal guidance or have a negative impact on users.

[0034] In some embodiments, the artificial intelligence-based psychological counseling method further includes storing historical conversation records and user memories in a database; and causing the empathy model to output a response based on the user's current conversation data, including: The retrieval enhancement generation model is used to extract the most relevant historical conversation records and user memories from the database according to the user's current conversation data, and the most relevant historical conversation records and user memories are filled into the prompt words of the empathy model, so that the empathy model outputs a response.

[0035] In a specific embodiment, the retrieval enhancement generation technology can be used to enhance the ability of the empathy model by combining the retrieval enhancement generation model, and the user memory and historical conversation records are stored in a searchable database. The content of the chat between the empathy model and the user is the historical conversation record; the historical conversation record is input into the empathy model and the prompt word is used to let the empathy model generate a conversation summary text, which is the user memory. The prompt word of the empathy model, for example, please summarize the following historical conversation record into a text of no more than 200 words: [Historical Conversation Record], and different historical conversation records can be filled in the brackets. When the user interacts, the retrieval enhancement generation model will extract the most relevant user memory and historical conversation records from the database according to the current conversation, and then fill the retrieved information into the prompt word of the empathy model as context input to generate a more targeted and personalized response, which can improve the coherence of the conversation and enable the empathy model to gradually adapt to the needs and emotions of the user. The response is the empathy model's reply to the user's conversation data.

[0036] In a specific embodiment, a knowledge graph can be established for user memory based on graph RAG (Retrieval-augmented Generation) technology. The database includes the user's memory and the knowledge graph. The content of the user's memory includes the vector obtained after the user's memory is embedded in the model. When searching, the retrieval-augmented generation model will first extract the named entities from the current conversation, and then search the knowledge graph to see whether these named entities exist. If so, the description information stored in the graph will be returned; the current conversation can be input into the embedding model to generate a vector, and then the similarity is calculated with the vector in the user's memory. The most relevant user memory is the one whose similarity exceeds the set threshold. The above results are all the most relevant memory texts, which will be given to the prompt words of the empathy model at the same time; among them, the retrieved information is plain text, that is, summary text. The prompt words of the empathy model, for example, please generate a reply based on the following user memory: [user memory text].

[0037] In some embodiments, the historical conversation record is historical conversation data between the empathy model and the user, and the user memory is input into the empathy model as the historical conversation record and uses a preset second prompt word to enable the empathy model to generate a conversation summary text.

[0038] In a specific embodiment, the empathy model can also perform psychological intervention. The retrieval enhancement generation technology can be used to store intervention skill triggers in a searchable database. When the user interacts, the retrieval enhancement generation model will extract the most relevant intervention skill triggers from the database based on the current conversation, and then fill the corresponding intervention skill information into the prompt words of the empathy model as intervention skill prompts to generate more targeted intervention responses. The intervention skill trigger can be "I have been feeling low lately, and even my daily routines are boring. I have also lost interest in my favorite music and movies, and I always feel that nothing can make me happy." The prompt words can be, for example, please follow the following intervention skills and generate a response to the user's question: [Intervention skill information].

[0039] The artificial intelligence psychological counseling method provided by the embodiment of the present invention obtains the user's current dialogue data; according to the user's current dialogue data, the empathy model outputs a response, the empathy model is obtained according to the first multi-round dialogue, the natural language processing model and the reinforcement learning algorithm. The acquisition process of the first multi-round dialogue includes obtaining a psychological counseling seed data set, using a large language model to guide the synthesis of the psychological counseling seed data set into multiple psychological counseling cases by presetting a first prompt word, and using the large language model to simulate the psychological counseling case by presetting a second prompt word to generate a first multi-round dialogue between the user and the psychological counselor. The acquisition process of the empathy model includes generating an interruption semantic data set, training the natural language processing model according to the interruption semantic data set, dividing the first multi-round dialogue according to the score of the reward model, taking the first multi-round dialogue with a score greater than a preset score threshold as the second multi-round dialogue, and using the reinforcement learning algorithm to align the output of the natural language processing model with the reply of the second multi-round dialogue to obtain the empathy model; the accuracy of emotion discrimination can be improved and the psychological intervention effect can be enhanced. The artificial intelligence psychological counseling method provided by the embodiment of the present invention can generate highly personalized empathetic responses based on the user's emotional state, thereby alleviating the user's negative emotions and creating a safe conversation environment.

[0040] Based on the above artificial intelligence-based psychological consultation method, an embodiment of the present invention provides an artificial intelligence-based psychological consultation device, the structural diagram of which is as follows: Figure 2 As shown, the artificial intelligence-based psychological consultation device 20 includes a data acquisition module 21 and a response module 22; The data acquisition module 21 is used to acquire the user's current conversation data; The response module 22 is used to make the empathy model output a response according to the current conversation data of the user. The empathy model is obtained based on the first multi-round conversation, the natural language processing model and trained by the reinforcement learning algorithm. The acquisition process of the first multi-round conversation includes obtaining a psychological counseling seed data set, using a large language model to guide the synthesis of the psychological counseling seed data set into multiple psychological counseling cases by presetting a first prompt word, and using the large language model to simulate the psychological counseling case to generate a first multi-round conversation between the user and the psychological counselor by presetting a second prompt word. The acquisition process of the empathy model includes generating an interruption semantic data set, training the natural language processing model according to the interruption semantic data set, dividing the first multi-round conversation by the scoring of the reward model, taking the first multi-round conversation with a score greater than a preset scoring threshold as the second multi-round conversation, and using the reinforcement learning algorithm to align the output of the natural language processing model with the reply of the second multi-round conversation to obtain the empathy model.

[0041] For other details about how the modules in the artificial intelligence-based psychological counseling device 20 implement the above-mentioned technical solution, please refer to the description of the artificial intelligence-based psychological counseling method provided in the above-mentioned invention embodiment, which will not be repeated here.

[0042] Based on the above artificial intelligence-based psychological consultation method, an embodiment of the present invention further provides an electronic device, a structural diagram of which is shown in FIG. Figure 3 As shown, the device 30 includes a processor 31 and a memory 32 coupled to the processor 31. The memory 32 stores a computer program, and when the computer program is executed by the processor 31, the processor 31 executes the steps of the artificial intelligence-based psychological counseling method in the above embodiment.

[0043] For other details about how the processor 31 in the electronic device implements the above technical solution, please refer to the description of the artificial intelligence-based psychological counseling method provided in the above invention embodiment, which will not be repeated here.

[0044] Among them, the processor 31 can also be called a CPU (Central Processing Unit), and the processor 31 may be an integrated circuit chip with signal processing capabilities; the processor 31 can also be a general-purpose processor, DSP (Digital Signal Process), ASIC (Application Specific Integrated Circuit), FPGA (Field Programmable Gate Array) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, among which the general-purpose processor can be a microprocessor or the processor 31 can also be any conventional processor, etc.

[0045] The embodiment of the present invention also provides a computer-readable storage medium, on which a readable computer program is stored; wherein the computer program can be stored in the above storage medium in the form of a software product, including several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, magnetic disk or optical disk, ROM (Read-Only Memory), RAM (Random Access Memory) and other media that can store program codes, or terminal devices such as computers, servers, mobile phones, and tablets.

[0046] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0047] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0048] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium.

[0049] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0050] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a server, or a data center to another website site, a computer, a server, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.

[0051] The technical solution provided by the present application is introduced in detail above. The principles and implementation methods of the present application are explained by using specific examples in the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

[0052] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0053] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices and computer program products according to the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0054] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0055] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0056] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A psychological consultation method based on artificial intelligence, characterized in that: include: Get the user's current conversation data; The empathy model outputs a response according to the user's current conversation data. The empathy model is obtained by training based on the first multiple rounds of conversations, the natural language processing model and the reinforcement learning algorithm. The process of obtaining the first multiple rounds of conversations includes obtaining a psychological counseling seed data set, using a large language model to guide the synthesis of the psychological counseling seed data set into multiple psychological counseling cases by presetting a first prompt word, and using the large language model to simulate the psychological counseling cases by presetting a second prompt word to generate the first multiple rounds of conversations between the user and the psychological counselor. The process of obtaining the empathy model includes generating an interruption semantic data set, training the natural language processing model according to the interruption semantic data set, dividing the first multiple rounds of conversations according to the scoring of the reward model, taking the first multiple rounds of conversations with a score greater than a preset scoring threshold as the second multiple rounds of conversations, and using the reinforcement learning algorithm to align the output of the natural language processing model with the reply of the second multiple rounds of conversations to obtain the empathy model.

2. The artificial intelligence-based psychological consultation method according to claim 1, characterized in that: Get the psychological counseling seed dataset, including: Crawling posts related to psychological counseling as initial seed data, grouping the initial seed data according to topic type, calculating the similarity between different groups, deduplicating multiple groups whose similarity is greater than a preset similarity threshold, filtering out the deduplicated initial seed data whose length is less than a preset length threshold, and obtaining a psychological counseling seed data set.

3. The artificial intelligence-based psychological consultation method according to claim 1, characterized in that: The method of using a large language model to guide and synthesize the psychological counseling seed data set into multiple psychological counseling cases by presetting a first prompt word includes: A large language model is used to guide the synthesis of the psychological counseling seed data set into multiple psychological counseling cases including titles, types, case summaries, counseling processes and experience summaries through preset first prompt words. The preset first prompt words include scenarios, case overviews, psychological analysis, diagnostic assessments, treatment recommendations, prognosis assessments and precautions.

4. The artificial intelligence-based psychological consultation method according to claim 1, characterized in that: The generating of the interruption semantic data set and training the natural language processing model according to the interruption semantic data set includes: A stop phrase of a random voice timbre is mixed with noise to generate an interruption semantic data set, the interruption semantic data set is combined with the second multiple rounds of dialogue to form a training data set, and the natural language processing model is trained using the training data set, so that the natural language processing model generates an interruption mark or a non-interruption mark, stops output after the interruption mark is generated, and does not stop output after the non-interruption mark is generated.

5. The artificial intelligence-based psychological consultation method according to claim 1, characterized in that: The training process of the natural language processing model also includes: An adult scoring model and a youth scoring model are constructed, and the natural language processing model is trained by the adult scoring model and the youth scoring model. The dimensions of the adult scoring model include emotion recognition ability, analysis ability, semantic understanding ability, logic ability, ability to ask open-ended questions, ability to positively guide users, ability to continue conversations, ability to summarize contexts, ability to cope with resistance, oral expression ability and overall score; the dimensions of the youth scoring model include emotion recognition ability, emotion coping ability, encouragement and positive guidance ability, language interest and oral expression ability, semantic understanding ability, logic ability, ability to continue conversations, ability to summarize contexts, ability to cope with resistance and overall score.

6. The artificial intelligence-based psychological consultation method according to claim 1, characterized in that: The artificial intelligence-based psychological consultation method further includes storing historical conversation records and user memories in a database; The empathy model is caused to output a response according to the current conversation data of the user, including: The retrieval enhancement generation model is used to extract the most relevant historical conversation records and user memories from the database according to the user's current conversation data, and the most relevant historical conversation records and user memories are filled into the prompt words of the empathy model, so that the empathy model outputs a response.

7. The artificial intelligence-based psychological consultation method according to claim 6, characterized in that: The historical conversation record is the historical conversation data between the empathy model and the user, and the user memory is the historical conversation record input into the empathy model and uses a preset second prompt word to enable the empathy model to generate a conversation summary text.

8. A psychological consultation device based on artificial intelligence, characterized in that: It includes a data acquisition module and a response module; The data acquisition module is used to acquire the user's current conversation data; The response module is used to make the empathy model output a response according to the current conversation data of the user. The empathy model is obtained based on the first multi-round conversation, the natural language processing model and the training using the reinforcement learning algorithm. The acquisition process of the first multi-round conversation includes obtaining a psychological counseling seed data set, using a large language model to guide the synthesis of the psychological counseling seed data set into multiple psychological counseling cases by presetting a first prompt word, and using the large language model to simulate the psychological counseling case to generate a first multi-round conversation between the user and the psychological counselor by presetting a second prompt word. The acquisition process of the empathy model includes generating an interruption semantic data set, training the natural language processing model according to the interruption semantic data set, dividing the first multi-round conversation according to the scoring of the reward model, taking the first multi-round conversation with a score greater than a preset scoring threshold as the second multi-round conversation, and using the reinforcement learning algorithm to align the output of the natural language processing model with the reply of the second multi-round conversation to obtain the empathy model.

9. An electronic device, comprising a memory and a processor, wherein the memory stores a computer program executable by the processor, wherein: When the processor executes the computer program, the artificial intelligence-based psychological counseling method as described in any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the artificial intelligence-based psychological counseling method as described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Man-machine conversation system and method

    CN114691852A

  • Psychological counseling model training and psychological counseling processing method and device and electronic equipment

    CN117438047A

  • Electric power professional knowledge intelligent question answering system construction method based on large language model

    CN117609421A

  • Full-duplex dialogue system and method, electronic equipment and storage medium

    CN118366458A

  • Psychological counseling dialogue data set generation method, device and equipment and storage medium

    CN118445776A

Cited By

  • Cognitive chain enhanced college student group psychological health dialogue system construction method

    CN119785979A

  • Multi-user group precise auxiliary diagnosis and treatment method and device for obesity diseases

    CN119889653A

  • Dialogue model evaluation and dialogue remodeling method, equipment and medium

    CN120012946A

  • Student psychological toughness measurement and feedback method based on large language model

    CN120471035A

  • A method for measuring and providing feedback on students' psychological resilience based on a large language model

    CN120471035B