Psychological consultation model training method and device, electronic equipment and storage medium

By obtaining sample psychological counseling information and target psychological guidance strategies of multiple sample clients, a sample counseling plan for different consultation stages is generated, and the initial psychological counseling model is trained, the problem of a single psychological counseling dialogue style in the existing technology is solved, and a more diverse counseling dialogue is achieved.

CN119742030AActive Publication Date: 2025-04-01IFLYTEK CO LTD

Patent Information

Application Number
CN202411955110.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-04-01
Estimated Expiration
2044-12-27

AI Technical Summary

Technical Problem

In the prior art, for clients of the same psychological scenario category, the generated psychological counseling dialogue style is relatively single and lacks diversity.

Method used

By obtaining sample psychological counseling information and target psychological guidance strategies from multiple sample clients, a large language model is input to generate sample counseling schemes at different counseling stages, and the initial psychological counseling model is trained based on these schemes to generate more diverse counseling conversations.

Benefits of technology

It has achieved the generation of consultation programs at different stages of consultation for clients of the same target psychological scenario category, thereby improving the diversity of styles of psychological counseling conversations and providing a more personalized and richer consultation experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119742030A_ABST
    Figure CN119742030A_ABST
Patent Text Reader

Abstract

The invention provides a psychological counseling model training method and device, electronic equipment and a storage medium, and relates to the technical field of artificial intelligence, and the method comprises the steps: obtaining sample psychological counseling information of a plurality of sample visitors corresponding to a target psychological scene category; determining the age of the sample visitor and a sample psychological guidance strategy corresponding to the target psychological scene category; inputting the sample psychological consultation information and the sample psychological guidance strategy into a large language model to obtain sample consultation schemes of different consultation stages; and training the initial psychological counseling model based on the sample counseling scheme of each sample visitor to obtain a psychological counseling model. The psychological counseling model is obtained based on training of the sample counseling schemes of the different counseling stages of the sample visitors, so that the counseling schemes of the different counseling stages can be generated based on the psychological counseling model, and the style diversity of psychological counseling dialogues obtained based on the counseling schemes of the different counseling stages can be 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 in particular to a training method, device, electronic equipment and storage medium for a psychological consultation model. Background Art

[0002] With the rapid development of big model technology in recent years, the performance of dialogue systems has far exceeded people's expectations. It can not only realize simple dialogue exchanges, but also assist in searching knowledge and summarizing documents, greatly improving the role of dialogue systems in real life. Compared with traditional dialogue scenarios, psychological counseling scenarios require counselors to have not only rich psychological knowledge, but also rich communication skills. With the development of big models, big models have been applied to the field of psychological counseling.

[0003] In the related art, for all visitors of the same psychological scenario category, a sample consultation plan is usually generated based on a fixed consultation style school, and a psychological consultation dialogue is obtained based on the generated sample consultation plan.

[0004] However, in the above-mentioned related technologies, since all visitors of the same psychological scenario category obtain psychological counseling dialogues based on the same sample counseling program, the style of the obtained psychological counseling dialogues is relatively single. Summary of the invention

[0005] The present invention provides a training method, device, electronic device and storage medium for a psychological consultation model, which are used to solve the defect in the prior art that the style of psychological consultation dialogue is relatively single.

[0006] The present invention provides a training method for a psychological consultation model, comprising the following steps.

[0007] For each target psychological scene category, obtaining sample psychological consultation information of a plurality of sample visitors corresponding to the target psychological scene category; For each of the sample visitors, determining the sample psychological guidance strategy corresponding to the age of the sample visitor and the target psychological scene category; Inputting the sample psychological counseling information of the sample visitor and the sample psychological guidance strategy into the large language model, and obtaining the sample counseling schemes output by the large language model for the sample visitor at different counseling stages; Based on the sample consultation plans of each of the sample visitors, the initial psychological consultation model is trained to obtain the psychological consultation model.

[0008] According to a training method for a psychological consultation model provided by the present invention, the step of obtaining sample psychological consultation information of each of a plurality of sample visitors corresponding to the target psychological scene category comprises: Acquiring the real psychological data of the target visitor corresponding to the target psychological scene category; Inputting the real psychological data into the large language model to obtain the real psychological counseling information of the target visitor output by the large language model; Constructing first prompt information, wherein the first prompt information is used to indicate random expansion of the real psychological consultation information; The first prompt information is input into the large language model to obtain the sample psychological counseling information of each of the sample visitors output by the large language model.

[0009] According to a training method for a psychological consultation model provided by the present invention, the step of determining the age of the sample visitor and the sample psychological guidance strategy corresponding to the target psychological scene category comprises: Based on the correspondence between age groups, psychological scene categories and psychological guidance strategies, the target age group to which the sample visitor's age belongs and the sample psychological guidance strategy corresponding to the target psychological scene category are determined.

[0010] According to a training method for a psychological consultation model provided by the present invention, the sample psychological consultation information of the sample visitor and the sample psychological guidance strategy are input into a large language model to obtain sample consultation plans for the sample visitor at different consultation stages output by the large language model, including: Constructing second prompt information, wherein the second prompt information is used to instruct to generate sample consultation plans at different consultation stages based on the sample psychological consultation information of the sample visitor and the sample psychological guidance strategy; The second prompt information is input into the large language model to obtain sample consultation plans output by the large language model for different consultation stages of the sample visitors.

[0011] According to a training method for a psychological counseling model provided by the present invention, the initial psychological counseling model is trained based on the sample counseling scheme of each sample visitor to obtain the psychological counseling model, including: For each of the sample visitors, the sample psychological counseling information of the sample visitors is input into the visitor agent model, and the target guidance samples and the sample counseling plan for the sample visitors are input into the counselor agent model, and through the interaction between the visitor agent model and the counselor agent model, multiple rounds of sample psychological dialogues for the sample visitors are obtained, and the target guidance samples include real empathy response samples and / or negative guidance samples; Based on multiple rounds of sample psychological dialogues of each of the sample visitors, the initial psychological counseling model is trained to obtain the psychological counseling model.

[0012] According to a training method for a psychological counseling model provided by the present invention, the initial psychological counseling model is trained based on multiple rounds of sample psychological dialogues of each sample visitor to obtain the psychological counseling model, including: For each of the multiple rounds of sample psychological dialogues of the sample visitors, construct third prompt information, wherein the third prompt information is used to indicate a quality evaluation of the multiple rounds of sample psychological dialogues based on at least one evaluation dimension; Inputting the third prompt information into the large language model to obtain quality evaluation results corresponding to the multiple rounds of sample psychological dialogues output by the large language model; Based on the target quality evaluation results that represent qualified quality among all the quality evaluation results, the initial psychological counseling model is trained to obtain the psychological counseling model.

[0013] According to a training method for a psychological counseling model provided by the present invention, the initial psychological counseling model is trained based on the target quality evaluation result that represents qualified quality among all the quality evaluation results to obtain the psychological counseling model, including: Based on the target information and the target quality evaluation results, the initial psychological counseling model is trained to obtain the psychological counseling model, and the target information includes at least one of the following: target psychological scene category, each sample psychological counseling information and each sample counseling plan.

[0014] The present invention also provides a training device for a psychological consultation model, comprising: An acquisition unit, for acquiring, for each target psychological scene category, sample psychological counseling information of a plurality of sample visitors corresponding to the target psychological scene category; A determination unit, for determining, for each of the sample visitors, the age of the sample visitor and the sample psychological guidance strategy corresponding to the target psychological scene category; A generating unit, used for inputting the sample psychological counseling information of the sample visitor and the sample psychological guidance strategy into the large language model, and obtaining the sample counseling schemes output by the large language model for the sample visitor at different counseling stages; The training unit is used to train the initial psychological counseling model based on the sample counseling plans of each of the sample visitors to obtain the psychological counseling model.

[0015] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, a training method for a psychological counseling model as described above is implemented.

[0016] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a training method for a psychological counseling model as described in any one of the above.

[0017] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the training method of any one of the psychological counseling models described above is implemented.

[0018] The training method, device, electronic device and storage medium of the psychological counseling model provided by the present invention obtain sample psychological counseling information of multiple sample visitors corresponding to the target psychological scene category for each target psychological scene category, determine the age of the sample visitor and the sample psychological guidance strategy corresponding to the target psychological scene category for each sample visitor, input the sample psychological counseling information and sample psychological guidance strategy of the sample visitor into the large language model, obtain the sample counseling schemes for different counseling stages of the sample visitors output by the large language model, and then train the initial psychological counseling model based on the sample counseling schemes of each sample visitor to obtain the psychological counseling model. It can be seen that the present invention can generate sample counseling schemes for different counseling stages for sample visitors of the same target psychological scene category, and then train the psychological counseling model based on the sample counseling schemes of different counseling stages of each sample visitor, so that counseling schemes for different counseling stages can be generated based on the psychological counseling model, so that the style diversity of the psychological counseling dialogues obtained based on the counseling schemes for different counseling stages can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order 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 embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0020] Figure 1 This is one of the flow charts of the training method of the psychological consultation model provided by the embodiment of the present invention.

[0021] Figure 2 This is the second flow chart of the training method of the psychological counseling model provided in the embodiment of the present invention.

[0022] Figure 3 It is a schematic diagram of sample psychological counseling information provided by an embodiment of the present invention.

[0023] Figure 4 is a schematic diagram of a sample consulting solution provided by an embodiment of the present invention.

[0024] Figure 5 It is a schematic diagram of the quality evaluation result provided by the embodiment of the present invention.

[0025] Figure 6 It is a schematic diagram of fine-tuning the initial psychological counseling model provided by an embodiment of the present invention.

[0026] Figure 7 It is a schematic diagram of the overall flow of the training method of the psychological counseling model provided by an embodiment of the present invention.

[0027] Figure 8 It is a structural schematic diagram of a training device for a psychological counseling model provided by an embodiment of the present invention.

[0028] Fig. 9 It is a schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0029] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are 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.

[0030] Combine the following Figure 1-Figure 7 The training method of the psychological counseling model of the present invention is described. The execution subject of the training method of the psychological counseling model can be an electronic device such as a terminal, a tablet computer, a computer, or a training device of the psychological counseling model set in the electronic device. The training device of the psychological counseling model can be implemented by software, hardware, or a combination of the two.

[0031] Figure 1 is one of the flow charts of the training method of the psychological consultation model provided by the embodiment of the present invention, such as Figure 1 As shown, the training method of the psychological counseling model includes the following steps: Step 101: For each target psychological scene category, obtain sample psychological counseling information of a plurality of sample visitors corresponding to the target psychological scene category.

[0032] Among them, the target psychological scenario categories can be love-related categories, learning-related categories, peer-related categories, family-related categories, adaptability-related categories, and future development-related categories, etc.

[0033] For example, for each target psychological scenario category, the sample psychological counseling information of different sample visitors under the target psychological scenario category is determined. The sample psychological counseling information includes the sample portrait information and scenario description information of the sample visitors. The sample portrait information includes the name, gender, grade, age, conversation style and personality characteristics of the sample visitors. The scenario description information includes the actual encounters, psychological problems and related demands of the sample visitors under the target psychological scenario category.

[0034] It should be noted that the sample psychological counseling information can be obtained from the Internet, or can be randomly expanded based on real psychological counseling information, and the present invention does not limit this.

[0035] Step 102: for each of the sample visitors, determine the sample psychological guidance strategy corresponding to the age of the sample visitor and the target psychological scene category.

[0036] Optionally, based on the correspondence between age groups, psychological scene categories and psychological guidance strategies, the target age group to which the age of the sample visitor belongs and the sample psychological guidance strategy corresponding to the target psychological scene category are determined.

[0037] For example, after obtaining the sample psychological counseling information of each sample visitor, the age of the sample visitor can be extracted from the sample psychological counseling information, and in the pre-constructed correspondence between age groups, psychological scene categories and psychological guidance strategies, the psychological guidance strategy corresponding to the target age group and target psychological scene category to which the age of the sample visitor belongs can be found, and the psychological guidance strategy corresponding to the target age group and target psychological scene category can be determined as the sample psychological guidance strategy.

[0038] It should be noted that for the real psychological database, we construct a system that covers all psychological scene categories as much as possible, and combine the psychological scene categories with age groups to artificially construct appropriate psychological guidance strategies. The conversation direction is controlled by the psychological guidance strategies. The corresponding relationship between age groups, psychological scene categories and psychological guidance strategies is shown in Table 1: Table 1 It should be noted that Table 1 only takes the junior high school age group, the high school age group and the college age group, the love-related category, the learning-related category, the peer-related category, the family-related category, the adaptability-related category and the future development-related category as examples for illustration. In actual applications, the adult age group, the elderly age group and other psychological scene categories may also be added, and the present invention does not limit this.

[0039] Step 103: input the sample psychological counseling information of the sample visitor and the sample psychological guidance strategy into the large language model to obtain the sample counseling solutions for the sample visitor at different counseling stages output by the large language model.

[0040] For example, when the sample psychological counseling information and sample psychological guidance strategies of the sample visitors are obtained, a prompt is constructed based on the sample psychological counseling information and the sample psychological guidance strategies of the sample visitors, and the constructed prompt is input into the large language model to obtain the sample counseling plans for the sample visitors at different counseling stages output by the large language model. For example, the counseling stages may include the trust building and evaluation stage, the emotion identification and management stage, the healthy relationship skills establishment stage, etc. The sample counseling plan is the specific diagnosis and treatment information under the corresponding counseling stage. For example, if the counseling stage is the trust building and evaluation stage, the corresponding sample counseling plan may be "humanistic therapy: create a non-judgmental and supportive atmosphere, isolate the sample visitors to express emotional confusion, and assess the sources of anxiety and stress."

[0041] Step 104: Based on the sample consultation plans of the sample visitors, the initial psychological consultation model is trained to obtain the psychological consultation model.

[0042] For example, by using the same method, we can get a sample counseling plan for each sample visitor, and then use the sample counseling plan for each sample visitor as a label, input the sample psychological counseling information of the sample visitor and the corresponding sample psychological guidance strategy into the initial psychological counseling model, and get the predicted counseling plan for the sample visitors at different counseling stages output by the initial psychological counseling model. A loss function is constructed based on the predicted counseling plan and the corresponding sample counseling plan, and the model parameters of the initial psychological counseling model are adjusted based on the loss function until the convergence conditions are met, and finally a psychological counseling model is obtained.

[0043] The training method of the psychological counseling model provided by the present invention obtains sample psychological counseling information of multiple sample visitors corresponding to the target psychological scenario category for each target psychological scenario category, determines the age of the sample visitor and the sample psychological guidance strategy corresponding to the target psychological scenario category for each sample visitor, inputs the sample psychological counseling information and the sample psychological guidance strategy of the sample visitor into the large language model, obtains the sample counseling schemes for different counseling stages of the sample visitors output by the large language model, and then trains the initial psychological counseling model based on the sample counseling schemes of each sample visitor to obtain the psychological counseling model. It can be seen that the present invention can generate sample counseling schemes for different counseling stages for sample visitors of the same target psychological scenario category, and then obtains the psychological counseling model based on the sample counseling schemes of different counseling stages of each sample visitor. Therefore, counseling schemes for different counseling stages can be generated based on the psychological counseling model, so that the style diversity of the psychological counseling dialogues obtained based on the counseling schemes for different counseling stages can be improved.

[0044] In one embodiment, Figure 2 FIG. 2 is a flow chart of the training method of the psychological consultation model provided by the embodiment of the present invention. Figure 2 As shown, the above step 101 obtains sample psychological consultation information of each of the multiple sample visitors corresponding to the target psychological scene category, which can be specifically achieved by the following steps: Step 201: Acquire the real psychological data of the target visitor corresponding to the target psychological scene category.

[0045] For example, the real psychological data of the target visitor is derived from a real target psychological counseling scenario, the quantity is relatively small, and can be a psychological counseling case in Chinese or a psychological personal statement of the target visitor, which is not limited in the present invention.

[0046] Step 202: input the real psychological data into the large language model to obtain the real psychological counseling information of the target visitor output by the large language model.

[0047] For example, when the real psychological data of the target visitor corresponding to the target psychological scene category is obtained, the real psychological data of the target visitor is input into the large language model, and the real psychological data of the target visitor is sorted through the large language model, and finally the real psychological counseling information of the target visitor is output. The real psychological counseling information of the target visitor includes the self-statement of the target visitor and the scene description information of the target visitor. The self-statement of the target visitor includes the name, grade, age, conversation style and personality characteristics of the target visitor, and the scene description information of the target visitor includes the actual encounters, psychological problems and related demands of the target visitor under the target psychological scene category.

[0048] Step 203: construct a first prompt information, wherein the first prompt information is used to indicate to randomly expand the real psychological counseling information.

[0049] For example, random expansion is performed based on the target visitor's self-statement and scene description information. Random expansion refers to random adjustment of the target visitor's name, gender, personality traits, age, grade, conversation style and other portrait information, and random adjustment of events, locations, and some character relationships. The target visitor's portrait information and random adjustment range are shown in Table 2. Based on the random adjustment range shown in Table 2, a first prompt information (Prompt) is constructed to indicate the random expansion of real psychological counseling information.

[0050] Table 2

[0051] It should be noted that Table 2 is only an example. In actual applications, other portrait information and corresponding random adjustment ranges may be added, and the present invention does not limit this.

[0052] Step 204: input the first prompt information into the large language model to obtain the sample psychological counseling information of each of the sample visitors output by the large language model.

[0053] For example, after constructing the first prompt information, the first prompt information is input into the large language model to obtain the sample psychological counseling information of the randomly expanded sample visitors output by the large language model. The same method can be used to obtain the sample psychological counseling information of each sample visitor. Figure 3 is a schematic diagram of sample psychological counseling information provided by an embodiment of the present invention, such as Figure 3 As shown, the sample psychological counseling information includes sample portrait information and scene description information of the sample visitor.

[0054] It should be noted that when the large language model outputs randomly expanded sample psychological counseling information, the randomly expanded sample psychological counseling information can also be input into the large language model, and the large language model is used to perform quality inspection on the randomly expanded sample psychological counseling information to ensure that the randomly expanded sample psychological counseling information conforms to the actual situation of the target visitor's real psychological counseling information. Specifically, the randomly expanded sample psychological counseling information is used to judge whether the sample visitor will encounter the scene description event in the sample psychological counseling information, whether the characteristics of the sample visitor are reasonable, whether the scene description is reasonable, etc. For example, for employment-related issues, if the sample psychological counseling information of the sample visitor output by the large language model includes the sample visitor's school stage as middle school, then it is determined that the sample psychological counseling information of the sample visitor output by the large language model is unreasonable and needs to be re-output.

[0055] In this embodiment, the real psychological data can be randomly expanded through a large language model, thereby achieving effective expansion of a small amount of real psychological data, obtaining sample psychological counseling information of multiple sample visitors that conform to the realistic description, and improving the diversity of psychological counseling information.

[0056] In one embodiment, the above step 103 inputs the sample psychological counseling information of the sample visitor and the sample psychological guidance strategy into the large language model to obtain the sample counseling solutions for the sample visitor at different counseling stages output by the large language model, which can be specifically implemented in the following manner: Constructing second prompt information, inputting the second prompt information into the large language model, and obtaining sample consultation plans output by the large language model for different consultation stages of the sample visitors.

[0057] The second prompt information is used to indicate the generation of sample counseling plans for different counseling stages based on the sample psychological counseling information of the sample visitor and the sample psychological guidance strategy.

[0058] For example, when the sample psychological counseling information and sample psychological guidance strategies of the sample visitors are obtained, a second prompt information (Prompt) is constructed to indicate the generation of sample counseling plans for different counseling stages based on the sample psychological counseling information and sample psychological guidance strategies of the sample visitors, and the constructed second prompt information is input into the large language model. The large language model combines the contents of different counseling schools, and targets the specific personal information (sample psychological counseling information) of the sample visitors and the psychological guidance strategies of the corresponding psychological scene categories, and outputs a personalized counseling plan suitable for the current visitor and combined with the counseling school, that is, the sample counseling plan; the specific contents of the counseling school are shown in Table 3; the sample counseling plan adjusts the counseling strategy according to the different counseling stages and the specific characteristic changes of the sample visitors. Figure 4 is a schematic diagram of a sample consulting solution provided by an embodiment of the present invention, such as Figure 4 As shown, in Figure 3 Based on the data, sample counseling plans for sample visitors can be obtained.

[0059] Table 3 It should be noted that Table 3 is only an example. In actual application, other consulting genres may be added, and the present invention does not limit this.

[0060] In this embodiment, second prompt information is constructed to indicate the generation of sample counseling plans for different counseling stages based on sample psychological counseling information and sample psychological guidance strategies of sample visitors, so that the large language model generates sample counseling plans for different counseling stages through the second prompt information and in combination with different counseling schools, and constructs personalized sample counseling plans based on the style settings of different counseling schools, thereby improving the style diversity of the generated sample counseling plans.

[0061] In one embodiment, the above step 104 trains the initial psychological counseling model based on the sample counseling plans of the sample visitors to obtain the psychological counseling model, which can be specifically implemented in the following manner: For each of the sample visitors, the sample psychological counseling information of the sample visitors is input into the visitor agent model, and the goal guidance examples and the sample counseling plans for the sample visitors are input into the counselor agent model, and through the interaction of the visitor agent model and the counselor agent model, multiple rounds of sample psychological dialogues for the sample visitors are obtained; based on the multiple rounds of sample psychological dialogues for each of the sample visitors, the initial psychological counseling model is trained to obtain the psychological counseling model.

[0062] The target guidance examples include real empathy response examples and / or negative guidance examples.

[0063] For example, the client agent model and the counselor agent model are constructed respectively, the sample psychological counseling information of the sample client is input into the client agent model, and the target guidance sample and the sample counseling plan for the sample client are input into the counselor agent model. The target guidance sample includes the real empathy response sample and the negative guidance sample as an example. Among them, the real empathy response sample is to reduce the occurrence of false empathy response of the counselor, and the negative guidance sample is used to constrain the counselor not to over-deepen the negative emotions of the client. Further, through the interaction between the client agent model and the counselor agent model, the preliminary construction of the current multi-style multi-round sample psychological dialogue is realized. Using the same method, the multi-round sample psychological dialogues of all sample clients can be obtained, and then the quality of the multi-round sample psychological dialogues of each sample client is evaluated. The initial psychological counseling model is trained based on the quality evaluation results to obtain the psychological counseling model.

[0064] It should be noted that the conversation style and personality characteristics of the sample visitors can also be input into the visitor agent model to further enhance the conversation style and enrich the conversation diversity; in addition, the visitor agent model can also introduce additional question word limit (for example, less than 50 words) to simulate the real communication scenario, which is not limited by the present invention.

[0065] It should be noted that the question type ratio control constraint and the reply word limit (for example, less than 150 words) can also be input into the counselor agent model, where the question type ratio control constraint means that in the entire conversation, the counselor's listening, questioning and suggestion sentence patterns should account for a relatively reasonable proportion to avoid a certain type of sentence pattern throughout the conversation, and try to encourage the visitor to talk while asking appropriate questions and making suggestions at key nodes, so that the reply content output by the counselor agent model is more accurate and in line with the actual communication scenario. The present invention is not limited to this.

[0066] In this embodiment, the sample psychological counseling information of the sample visitor is input into the visitor agent model, and the target guidance sample and the sample counseling plan for the sample visitor are input into the counselor agent model. Through the interaction between the visitor agent model and the counselor agent model, multiple rounds of sample psychological dialogues for the sample visitor are obtained. Due to the diversity of styles of the sample counseling plan and the introduction of the target guidance sample, the style diversity and authenticity of the generated multiple rounds of sample psychological dialogues are improved, which further improves the accuracy of the trained psychological counseling model.

[0067] In one embodiment, the initial psychological counseling model is trained based on multiple rounds of sample psychological dialogues of each sample visitor to obtain the psychological counseling model, which can be specifically implemented in the following manner: For multiple rounds of sample psychological dialogues of each sample visitor, third prompt information is constructed, and the third prompt information is input into the large language model to obtain quality evaluation results corresponding to the multiple rounds of sample psychological dialogues output by the large language model; based on the target quality evaluation results representing qualified quality in all the quality evaluation results, the initial psychological counseling model is trained to obtain the psychological counseling model.

[0068] Among them, the third prompt information is used to instruct to perform a quality evaluation on the multiple rounds of sample psychological dialogues based on at least one evaluation dimension, and the evaluation dimension includes at least one of the authenticity of the dialogue, the effectiveness of the counselor's response, and the effectiveness of the visitor's questioning.

[0069] For example, based on multiple rounds of sample psychological dialogues of sample visitors, a third prompt information (Prompt) is constructed to indicate the quality evaluation of multiple rounds of sample psychological dialogues based on at least one evaluation dimension, and the large language model further evaluates the quality of the multiple rounds of sample psychological dialogues that have been constructed through the third prompt information; the evaluation dimensions of the quality evaluation include at least one of the authenticity of the dialogue, the effect of the counselor's response, and the effect of the visitor's questioning, wherein the authenticity of the dialogue is to judge whether the current multiple rounds of sample psychological dialogues are logically smooth and whether they conform to the actual psychological counseling dialogue scene, so as to ensure that the dialogue conforms to the actual psychological dialogue scene as much as possible and the dialogue logic is smooth; the effect of the counselor's response is to ensure that the counselor's response can be truly empathetic while not deepening the visitor's negative emotions from three dimensions: whether the response is truly empathetic, whether it is correctly guided, and whether the response type and style are appropriate, and can adjust the counseling strategy at the right time, such as listening, suggesting, asking questions, etc.; the effect of the visitor's questioning is to ensure that the visitor's questioning does not deviate from the basic preset from two dimensions: whether the questioning conforms to the visitor's characteristics and whether the questioning deviates from the scene description, and to ensure that the dialogue does not deviate from the actual situation as much as possible on the premise that the visitor's characteristics and the scene description information are in line with reality. Finally, the quality evaluation results corresponding to each round of sample psychological dialogues output by the large language model are obtained; further, the target quality evaluation results representing qualified quality are screened out from all the output quality evaluation results, and then the initial psychological counseling model is trained based on the target quality evaluation results to obtain the psychological counseling model. Figure 5 is a schematic diagram of the quality evaluation result provided by the embodiment of the present invention, such as Figure 5 As shown, for multiple rounds of sample psychological dialogues with sample visitors, corresponding quality evaluation results are generated, and the quality evaluation results include the usability conclusions of each evaluation dimension. For example, if the usability conclusions of each evaluation dimension are all yes, then the quality evaluation results are determined to be the target quality evaluation results that represent qualified quality.

[0070] In this embodiment, a large language model is used to perform quality evaluation on multiple rounds of sample psychological dialogues of sample visitors based on at least one evaluation dimension, and target quality evaluation results representing qualified quality are screened out from all the output quality evaluation results. The initial psychological counseling model is then trained based on the target quality evaluation results to improve the performance of the trained psychological counseling model.

[0071] In one embodiment, the initial psychological counseling model is trained based on the target quality evaluation result that represents qualified quality among all the quality evaluation results to obtain the psychological counseling model, which can be specifically achieved in the following manner: Based on the target information and the target quality evaluation results, the initial psychological counseling model is trained to obtain the psychological counseling model, and the target information includes at least one of the following: target psychological scene category, each sample psychological counseling information and each sample counseling plan.

[0072] For example, taking the target information including psychological scene categories, sample psychological counseling information and sample counseling plans as an example, after obtaining the psychological scene categories, sample psychological counseling information, sample counseling plans and quality evaluation results through the large language model, it is also possible to manually screen out accurate target sample psychological counseling information from all sample psychological counseling information output by the large language model, and construct prompt1 for indicating random expansion based on the real psychological dialogue data of the target visitor, input prompt1 into the initial psychological counseling model, obtain the predicted psychological counseling information output by the initial psychological counseling model, use the target sample psychological counseling information as a label, and construct the first loss information based on the predicted psychological counseling information and the target sample psychological counseling information.

[0073] It is also possible to manually screen out accurate target sample consultation plans from all sample consultation plans output by the large language model, and construct prompt2 for indicating the generation of consultation plans for different consultation stages based on the sample psychological consultation information and sample psychological guidance strategies of the target sample visitors corresponding to the target sample consultation plans. Prompt2 is input into the initial psychological consultation model to obtain the predicted consultation plan output by the initial psychological consultation model. The target sample consultation plan is used as a label, and the second loss information is constructed based on the predicted consultation plan and the target sample consultation plan.

[0074] It is also possible to construct prompt3 for indicating quality evaluation based on the target multi-round sample psychological dialogues of the target sample visitors corresponding to the target quality evaluation results, input prompt3 into the initial psychological counseling model, obtain the predicted quality evaluation results output by the initial psychological counseling model, use the target quality evaluation results as labels, and construct third loss information based on the predicted quality evaluation results and the target quality evaluation results.

[0075] It is also possible to construct prompt4 for indicating the identification of psychological scene categories based on the real psychological dialogue data of the target visitor, input prompt4 into the initial psychological counseling model, obtain the predicted psychological scene category output by the initial psychological counseling model, use the target psychological scene category output by the large language model as a label, and construct the fourth loss information based on the predicted psychological scene category and the target psychological scene category.

[0076] Further, the total loss information is determined based on the first loss information, the second loss information, the third loss information and the fourth loss information, and the model parameters of the initial psychological counseling model are adjusted based on the total loss information until the convergence condition is reached, and finally the psychological counseling model is obtained, through which the psychological counseling model can realize the recognition of psychological scene categories, the random expansion of psychological counseling information, the generation of counseling plans, and the quality evaluation of multiple rounds of psychological dialogues. For example, the specific contents of prompt1, prompt3 and prompt4 are shown in Table 4.

[0077] Table 4 Figure 6 is a schematic diagram of fine-tuning the initial psychological counseling model provided by an embodiment of the present invention, such as Figure 6 As shown, based on the psychological scenario categories, sample psychological counseling information, sample counseling plans and quality evaluation results output by the large language model, the initial psychological counseling model is fine-tuned to obtain the psychological counseling model, thereby realizing the local deployment of the psychological counseling model.

[0078] It should be noted that after obtaining the psychological counseling model, corresponding data can be input into the psychological counseling model based on the functions of the psychological counseling model: identification of psychological scene categories, random expansion of psychological counseling information, generation of counseling plans, and quality evaluation of multiple rounds of psychological dialogues, so that the psychological counseling model can output corresponding results. The present invention will not go into details here.

[0079] In this embodiment, the initial psychological counseling model can be trained based on the psychological scene categories, sample psychological counseling information and sample counseling plans output by the large language model to obtain a psychological counseling model. The psychological counseling model can be used to recognize psychological scene categories, randomly expand psychological counseling information, generate counseling plans, and evaluate the quality of multiple rounds of psychological dialogues, thereby reducing dependence on external large language models, realizing local automation of the entire process, and improving the efficiency of data output.

[0080] Figure 7 FIG. 1 is a schematic diagram of the overall flow of the training method of the psychological consultation model provided by the embodiment of the present invention. Figure 7As shown, firstly, a real psychological data (specific encounters and related psychological problems of the target visitor) is obtained from the real psychological dialogue library; then, based on the real psychological data, real psychological counseling information such as the target visitor's self-statement and scene description is constructed, and the real psychological counseling information is randomly expanded to obtain sample psychological counseling information of multiple sample visitors; then, according to the population and in advance for the segmented psychological scene categories, the corresponding psychological guidance strategies are searched from the psychological guidance strategy library, and sample counseling plans of different styles are generated in combination with different counseling schools; the sample psychological counseling information of the sample visitor is input into the visitor agent model, and the target guidance samples and the sample counseling plans for the sample visitor are input into the counselor agent model, and through the interaction between the visitor agent model and the counselor agent model, multiple rounds of sample psychological dialogues for the sample visitor are obtained; finally, the generated multiple rounds of sample psychological dialogues are evaluated for quality based on the three dimensions of dialogue authenticity, counselor response effect, and visitor question effect, so as to obtain high-quality multi-round and multi-style psychological dialogues.

[0081] The training device for the psychological counseling model provided by the present invention is described below. The training device for the psychological counseling model described below and the training method for the psychological counseling model described above can be referred to each other.

[0082] Figure 8 is a schematic diagram of the structure of a training device for a psychological consultation model provided by an embodiment of the present invention, such as Figure 8 As shown, the training device 800 of the psychological consultation model includes an acquisition unit 801, a determination unit 802, a generation unit 803 and a training unit 804; wherein: An acquisition unit 801 is used to acquire sample psychological consultation information of each of a plurality of sample visitors corresponding to each target psychological scene category. A determination unit 802 is used to determine, for each sample visitor, the sample visitor's age and the sample psychological guidance strategy corresponding to the target psychological scene category; A generating unit 803 is used to input the sample psychological counseling information of the sample visitor and the sample psychological guidance strategy into the large language model to obtain sample counseling solutions for the sample visitor at different counseling stages output by the large language model; The training unit 804 is used to train the initial psychological counseling model based on the sample counseling plans of each of the sample visitors to obtain the psychological counseling model.

[0083] The training device of the psychological counseling model provided by the present invention obtains sample psychological counseling information of multiple sample visitors corresponding to the target psychological scenario category for each target psychological scenario category, determines the age of the sample visitor and the sample psychological guidance strategy corresponding to the target psychological scenario category for each sample visitor, inputs the sample psychological counseling information and the sample psychological guidance strategy of the sample visitor into the large language model, obtains the sample counseling schemes for different counseling stages of the sample visitors output by the large language model, and then trains the initial psychological counseling model based on the sample counseling schemes of each sample visitor to obtain the psychological counseling model. It can be seen that the present invention can generate sample counseling schemes for different counseling stages for sample visitors of the same target psychological scenario category, and then obtains the psychological counseling model based on the sample counseling schemes of different counseling stages of each sample visitor. Therefore, counseling schemes for different counseling stages can be generated based on the psychological counseling model, so that the style diversity of the psychological counseling dialogues obtained based on the counseling schemes for different counseling stages can be improved.

[0084] Based on any of the above embodiments, the acquiring unit 801 is specifically used for: Acquiring the real psychological data of the target visitor corresponding to the target psychological scene category; Inputting the real psychological data into the large language model to obtain the real psychological counseling information of the target visitor output by the large language model; Constructing first prompt information, wherein the first prompt information is used to indicate random expansion of the real psychological consultation information; The first prompt information is input into the large language model to obtain the sample psychological counseling information of each of the sample visitors output by the large language model.

[0085] Based on any of the foregoing embodiments, the determining unit 802 is specifically configured to: Based on the correspondence between age groups, psychological scene categories and psychological guidance strategies, the target age group to which the sample visitor's age belongs and the sample psychological guidance strategy corresponding to the target psychological scene category are determined.

[0086] Based on any of the above embodiments, the generating unit 803 is specifically used for: Constructing second prompt information, wherein the second prompt information is used to instruct to generate sample consultation plans at different consultation stages based on the sample psychological consultation information of the sample visitor and the sample psychological guidance strategy; The second prompt information is input into the large language model to obtain sample consultation plans output by the large language model for different consultation stages of the sample visitors.

[0087] Based on any of the above embodiments, the training unit 804 is specifically used for: For each of the sample visitors, the sample psychological counseling information of the sample visitors is input into the visitor agent model, and the target guidance samples and the sample counseling plan for the sample visitors are input into the counselor agent model, and through the interaction between the visitor agent model and the counselor agent model, multiple rounds of sample psychological dialogues for the sample visitors are obtained, and the target guidance samples include real empathy response samples and / or negative guidance samples; Based on multiple rounds of sample psychological dialogues of each of the sample visitors, the initial psychological counseling model is trained to obtain the psychological counseling model.

[0088] Based on any of the above embodiments, the training unit 804 is further specifically configured to: For each of the multiple rounds of sample psychological dialogues of the sample visitors, construct third prompt information, wherein the third prompt information is used to indicate a quality evaluation of the multiple rounds of sample psychological dialogues based on at least one evaluation dimension; Inputting the third prompt information into the large language model to obtain quality evaluation results corresponding to the multiple rounds of sample psychological dialogues output by the large language model; Based on the target quality evaluation results that represent qualified quality among all the quality evaluation results, the initial psychological counseling model is trained to obtain the psychological counseling model.

[0089] Based on any of the above embodiments, the training unit 804 is further specifically configured to: Based on the target information and the target quality evaluation results, the initial psychological counseling model is trained to obtain the psychological counseling model, and the target information includes at least one of the following: target psychological scene category, each sample psychological counseling information and each sample counseling plan.

[0090] Fig. 9 is a schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention, such as Fig. 9 As shown, the electronic device may include: a processor 910, a communications interface 920, a memory 930 and a communication bus 940, wherein the processor 910, the communications interface 920 and the memory 930 communicate with each other via the communication bus 940. The processor 910 may call the logic instructions in the memory 930 to execute the training method of the psychological counseling model, the method comprising: for each target psychological scene category, obtaining sample psychological counseling information of each of a plurality of sample visitors corresponding to the target psychological scene category; For each of the sample visitors, determining the sample psychological guidance strategy corresponding to the age of the sample visitor and the target psychological scene category; Inputting the sample psychological counseling information of the sample visitor and the sample psychological guidance strategy into the large language model, and obtaining the sample counseling solutions for the sample visitor at different counseling stages output by the large language model; Based on the sample consultation plans of each of the sample visitors, the initial psychological consultation model is trained to obtain the psychological consultation model.

[0091] In addition, the logic instructions in the above-mentioned memory 930 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform 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, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0092] On the other hand, the present invention also provides a computer program product, the computer program product includes a computer program, the computer program can be stored in a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the training method of the psychological counseling model provided by the above methods, the method comprising: for each target psychological scene category, obtaining sample psychological counseling information of each of a plurality of sample visitors corresponding to the target psychological scene category; For each of the sample visitors, determining the sample psychological guidance strategy corresponding to the age of the sample visitor and the target psychological scene category; Inputting the sample psychological counseling information of the sample visitor and the sample psychological guidance strategy into the large language model, and obtaining the sample counseling solutions for the sample visitor at different counseling stages output by the large language model; Based on the sample consultation plans of each of the sample visitors, the initial psychological consultation model is trained to obtain the psychological consultation model.

[0093] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to execute the training method of the psychological counseling model provided by the above methods, the method comprising: for each target psychological scene category, obtaining sample psychological counseling information of each of a plurality of sample visitors corresponding to the target psychological scene category; For each of the sample visitors, determining the sample psychological guidance strategy corresponding to the age of the sample visitor and the target psychological scene category; Inputting the sample psychological counseling information of the sample visitor and the sample psychological guidance strategy into the large language model, and obtaining the sample counseling schemes output by the large language model for the sample visitor at different counseling stages; Based on the sample consultation plans of each of the sample visitors, the initial psychological consultation model is trained to obtain the psychological consultation model.

[0094] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0095] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for 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.

[0096] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A training method for a psychological counseling model, characterized in that: include: For each target psychological scene category, obtaining sample psychological consultation information of a plurality of sample visitors corresponding to the target psychological scene category; For each of the sample visitors, determining the sample psychological guidance strategy corresponding to the age of the sample visitor and the target psychological scene category; Inputting the sample psychological counseling information of the sample visitor and the sample psychological guidance strategy into the large language model, and obtaining the sample counseling schemes output by the large language model for the sample visitor at different counseling stages; Based on the sample consultation plans of each of the sample visitors, the initial psychological consultation model is trained to obtain the psychological consultation model.

2. The training method of the psychological consultation model according to claim 1, characterized in that: The step of obtaining sample psychological consultation information of each of a plurality of sample visitors corresponding to the target psychological scenario category includes: Acquiring the real psychological data of the target visitor corresponding to the target psychological scene category; Inputting the real psychological data into the large language model to obtain the real psychological counseling information of the target visitor output by the large language model; Constructing first prompt information, wherein the first prompt information is used to indicate random expansion of the real psychological consultation information; The first prompt information is input into the large language model to obtain the sample psychological counseling information of each of the sample visitors output by the large language model.

3. The training method of the psychological consultation model according to claim 1, characterized in that: The step of determining the sample visitor's age and the sample psychological guidance strategy corresponding to the target psychological scene category includes: Based on the correspondence between age groups, psychological scene categories and psychological guidance strategies, the target age group to which the sample visitor's age belongs and the sample psychological guidance strategy corresponding to the target psychological scene category are determined.

4. The training method of the psychological consultation model according to claim 1, characterized in that: The sample psychological counseling information and the sample psychological guidance strategy of the sample visitor are input into the large language model to obtain the sample counseling solutions for the sample visitor at different counseling stages output by the large language model, including: Constructing second prompt information, wherein the second prompt information is used to instruct to generate sample consultation plans at different consultation stages based on the sample psychological consultation information of the sample visitor and the sample psychological guidance strategy; The second prompt information is input into the large language model to obtain sample consultation plans output by the large language model for different consultation stages of the sample visitors.

5. The training method of the psychological consultation model according to claim 1, characterized in that: The initial psychological counseling model is trained based on the sample counseling scheme of each sample visitor to obtain the psychological counseling model, including: For each of the sample visitors, the sample psychological counseling information of the sample visitors is input into the visitor agent model, and the target guidance samples and the sample counseling plan for the sample visitors are input into the counselor agent model, and through the interaction between the visitor agent model and the counselor agent model, multiple rounds of sample psychological dialogues for the sample visitors are obtained, and the target guidance samples include real empathy response samples and / or negative guidance samples; Based on multiple rounds of sample psychological dialogues of each of the sample visitors, the initial psychological counseling model is trained to obtain the psychological counseling model.

6. The training method of the psychological consultation model according to claim 5, characterized in that: The initial psychological counseling model is trained based on multiple rounds of sample psychological dialogues of each sample visitor to obtain the psychological counseling model, including: For each of the multiple rounds of sample psychological dialogues of the sample visitors, construct third prompt information, wherein the third prompt information is used to indicate a quality evaluation of the multiple rounds of sample psychological dialogues based on at least one evaluation dimension; Inputting the third prompt information into the large language model to obtain quality evaluation results corresponding to the multiple rounds of sample psychological dialogues output by the large language model; Based on the target quality evaluation results that represent qualified quality among all the quality evaluation results, the initial psychological counseling model is trained to obtain the psychological counseling model.

7. The training method of the psychological consultation model according to claim 6, characterized in that: The training of the initial psychological counseling model based on the target quality evaluation result that indicates qualified quality among all the quality evaluation results to obtain the psychological counseling model includes: Based on the target information and the target quality evaluation results, the initial psychological counseling model is trained to obtain the psychological counseling model, and the target information includes at least one of the following: target psychological scene category, each sample psychological counseling information and each sample counseling plan.

8. A training device for a psychological consultation model, characterized in that: include: An acquisition unit, for acquiring, for each target psychological scene category, sample psychological counseling information of a plurality of sample visitors corresponding to the target psychological scene category; A determination unit, for determining, for each of the sample visitors, the age of the sample visitor and the sample psychological guidance strategy corresponding to the target psychological scene category; A generating unit, used for inputting the sample psychological counseling information of the sample visitor and the sample psychological guidance strategy into the large language model, and obtaining the sample counseling schemes output by the large language model for the sample visitor at different counseling stages; The training unit is used to train the initial psychological counseling model based on the sample counseling plans of each of the sample visitors to obtain the psychological counseling model.

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, it implements the training method of the psychological counseling model as described in any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the training method of the psychological counseling model as described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Psychological counseling method and device based on controlled text generation and terminal equipment

    CN114661864A

  • Man-machine collaborative psychological counseling method and system and storage medium

    CN116052843A

  • Conversation information generation method and device, server and storage medium

    CN116821303A

  • Psychological counseling strategy generation method and device based on intelligent agent, equipment and medium

    CN118964598A

  • Method and apparatus for determining psychological counseling training scheme

    US20220277833A1

Cited By

  • Personalized student psychological consultation method and system based on grouped mixed expert model

    CN120688644A

  • Personalized Student Psychological Counseling Methods and Systems Based on Grouped Hybrid Expert Models

    CN120688644B

  • Psychological consultation model training method and device, electronic equipment and storage medium

    CN120781052A

  • Training method and device of psychological counseling model, electronic equipment and storage medium

    CN120781052B

  • Psychological model fine tuning method and system based on five-dimensional role and closed-loop feedback

    CN122177365A