Training method and device of psychological counseling model, electronic equipment and storage medium
By acquiring psychological counseling information and guidance strategies from sample clients, and training a psychological counseling model using a large language model and a proxy model, the problem of a monotonous dialogue style in psychological counseling was solved, and diversified and efficient counseling solutions were generated.
Patent Information
- Application Number
- CN202411955110.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2044-12-27
AI Technical Summary
In existing technologies, psychological counseling dialogues generated based on fixed counseling style schools for clients with the same psychological scenario are monotonous and lack diversity.
For each target psychological scenario category, sample psychological counseling information and guidance strategies from multiple sample clients are obtained. Sample counseling plans for different counseling stages are generated through a large language model. The initial psychological counseling model is trained through the interaction of the client agent model and the counselor agent model, and then optimized based on the quality evaluation results.
It enables the generation of counseling plans for different stages for clients with the same target psychological scenario category, improves the style diversity and authenticity of psychological counseling dialogues, and enhances the accuracy and efficiency of the counseling model.
Smart Images

Figure CN119742030B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a training method, apparatus, electronic device, and storage medium for a psychological counseling model. Background Technology
[0002] With the rapid development of large-scale modeling technology in recent years, dialogue systems have far exceeded expectations. They can not only achieve simple conversations but also assist in knowledge retrieval and document summarization, greatly enhancing their practical application. In psychological counseling scenarios, compared to traditional dialogue scenarios, counselors need not only extensive psychological knowledge but also strong communication skills. With the development of large-scale models, they have been applied to the field of psychological counseling.
[0003] In related technologies, for all visitors with the same psychological scenario category, sample counseling plans are usually generated based on a fixed counseling style and school, and psychological counseling dialogues are obtained based on the generated sample counseling plans.
[0004] However, in the aforementioned related technologies, since all visitors with the same psychological scenario category obtain psychological counseling dialogues based on the same sample counseling plan, the resulting psychological counseling dialogues have a relatively uniform style. Summary of the Invention
[0005] This invention provides a training method, apparatus, electronic device, and storage medium for a psychological counseling model, in order to address the shortcomings of existing technologies that result in a relatively monotonous style of psychological counseling dialogue.
[0006] This invention provides a training method for a psychological counseling model, comprising the following steps.
[0007] For each target psychological scenario category, obtain sample psychological counseling information of multiple sample visitors corresponding to the target psychological scenario category;
[0008] 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;
[0009] The sample psychological counseling information of the sample visitors and the sample psychological guidance strategy are input into the large language model to obtain the sample counseling plan output by the large language model for different counseling stages of the sample visitors.
[0010] Based on the sample counseling plans of each of the sample visitors, the initial psychological counseling model is trained to obtain the psychological counseling model.
[0011] According to a training method for a psychological counseling model provided by the present invention, the step of obtaining sample psychological counseling information of multiple sample clients corresponding to the target psychological scenario category includes:
[0012] Obtain the actual psychological data of the target visitors corresponding to the target psychological scene category;
[0013] The real psychological data is input into the large language model to obtain the real psychological counseling information of the target client output by the large language model;
[0014] A first prompt message is constructed, which is used to instruct the random expansion of the real psychological counseling information;
[0015] The first prompt information is input into the large language model to obtain the sample psychological counseling information of each sample visitor output by the large language model.
[0016] According to a training method for a psychological counseling model provided by the present invention, determining the sample psychological guidance strategy corresponding to the age of the sample client and the target psychological scenario category includes:
[0017] Based on the correspondence between age group, psychological scenario category, and psychological guidance strategy, the target age group to which the sample visitors belong and the sample psychological guidance strategy corresponding to the target psychological scenario category are determined.
[0018] According to a training method for a psychological counseling model provided by the present invention, the step of inputting the sample psychological counseling information of the sample clients and the sample psychological guidance strategy into a large language model to obtain the sample counseling plan output by the large language model for different counseling stages of the sample clients includes:
[0019] A second prompt message is constructed, which is used to instruct the generation of sample counseling plans for different counseling stages based on the sample psychological counseling information of the sample visitors and the sample psychological guidance strategy;
[0020] The second prompt information is input into the large language model to obtain the sample consultation plan output by the large language model for different consultation stages of the sample visitors.
[0021] According to a training method for a psychological counseling model provided by the present invention, the method involves training an initial psychological counseling model based on sample counseling protocols for each of the sample clients to obtain the psychological counseling model, comprising:
[0022] For each of the sample visitors, the sample psychological counseling information of the sample visitors is input into the visitor proxy model, and the target guidance examples and the sample counseling plan for the sample visitors are input into the counselor proxy model. Through the interaction between the visitor proxy model and the counselor proxy model, a multi-round sample psychological dialogue is obtained for the sample visitors. The target guidance examples include genuine empathetic response examples and / or negative guidance examples.
[0023] The initial psychological counseling model is trained based on multiple rounds of sample psychological dialogues with each of the sample visitors to obtain the psychological counseling model.
[0024] According to a training method for a psychological counseling model provided by the present invention, the initial psychological counseling model is trained based on multi-round sample psychological dialogues of each sample client to obtain the psychological counseling model, comprising:
[0025] For the multi-round sample psychological dialogues of each of the sample visitors, a third prompting information is constructed. The third prompting information is used to instruct the quality evaluation of the multi-round sample psychological dialogues based on at least one evaluation dimension.
[0026] The third prompt information is input into the large language model to obtain the quality evaluation results corresponding to the multi-turn sample psychological dialogue output by the large language model.
[0027] Based on the target quality evaluation results that represent qualified quality among all the aforementioned quality evaluation results, the initial psychological counseling model is trained to obtain the psychological counseling model.
[0028] 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 results representing quality compliance among all the quality evaluation results to obtain the psychological counseling model, comprising:
[0029] Based on the target information and the quality evaluation results of each target, the initial psychological counseling model is trained to obtain the psychological counseling model. The target information includes at least one of the following: target psychological scenario category, psychological counseling information of each sample, and counseling plan of each sample.
[0030] The present invention also provides a training device for a psychological counseling model, comprising:
[0031] The acquisition unit is used to acquire sample psychological counseling information of multiple sample visitors corresponding to each target psychological scene category.
[0032] The determining unit is used to determine the age of each sample visitor and the sample psychological guidance strategy corresponding to the target psychological scene category for each sample visitor.
[0033] The generation unit is used to input the sample psychological counseling information of the sample visitors and the sample psychological guidance strategy into the large language model to obtain the sample counseling plan output by the large language model for different counseling stages of the sample visitors.
[0034] The training unit is used to train the initial psychological counseling model based on the sample counseling plans of each of the sample clients, so as to obtain the psychological counseling model.
[0035] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement a training method for any of the psychological counseling models described above.
[0036] 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 the psychological counseling model as described above.
[0037] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements a training method for any of the psychological counseling models described above.
[0038] The present invention provides a training method, apparatus, electronic device, and storage medium for a psychological counseling model. For each target psychological scenario category, it acquires sample psychological counseling information from multiple sample clients corresponding to that category. For each sample client, it determines the client's age and the corresponding psychological guidance strategy for the target psychological scenario category. The sample psychological counseling information and guidance strategy are input into a large language model to obtain sample counseling plans for different counseling stages. Based on these plans, the initial psychological counseling model is trained to obtain the final psychological counseling model. Therefore, the present invention can generate sample counseling plans for different counseling stages for sample clients within the same target psychological scenario category. By training the psychological counseling model based on these plans, different counseling stages can be generated, thereby improving the stylistic diversity of psychological counseling dialogues obtained from these plans. Attached Figure Description
[0039] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0040] Figure 1 This is one of the flowcharts illustrating the training method for the psychological counseling model provided in this embodiment of the invention.
[0041] Figure 2 This is the second flowchart illustrating the training method for the psychological counseling model provided in this embodiment of the invention.
[0042] Figure 3 This is a schematic diagram of sample psychological counseling information provided in an embodiment of the present invention.
[0043] Figure 4 This is a schematic diagram of the sample consultation solution provided in an embodiment of the present invention.
[0044] Figure 5 This is a schematic diagram of the quality evaluation results provided in an embodiment of the present invention.
[0045] Figure 6 This is a schematic diagram of the fine-tuning of the initial psychological counseling model provided in the embodiments of the present invention.
[0046] Figure 7 This is a schematic diagram of the overall process of the training method for the psychological counseling model provided in this embodiment of the invention.
[0047] Figure 8 This is a schematic diagram of the structure of the training device for the psychological counseling model provided in this embodiment of the invention.
[0048] Figure 9 This is a schematic diagram of the physical structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation
[0049] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0050] The following is combined with Figures 1-7This invention describes a training method for a psychological counseling model. The subject executing this training method can be an electronic device such as a terminal, tablet computer, or computer, or a training device for the psychological counseling model installed in the electronic device. This training device can be implemented through software, hardware, or a combination of both.
[0051] Figure 1 This is one of the flowcharts illustrating the training method for the psychological counseling model provided in this embodiment of the invention, such as... Figure 1 As shown, the training method for this psychological counseling model includes the following steps:
[0052] Step 101: For each target psychological scenario category, obtain the sample psychological counseling information of multiple sample visitors corresponding to the target psychological scenario category.
[0053] Among them, the target psychological scenario categories can be related to love, learning, peers, family, adaptability, and future development.
[0054] For example, for each target psychological scenario category, the sample psychological counseling information of different sample visitors under that target psychological scenario category is determined. The sample psychological counseling information includes the sample profile information and scenario description information of the sample visitors. The sample profile information includes the sample visitors' name, gender, school level, age, dialogue style and personality traits, etc., and the scenario description information includes the sample visitors' actual encounters, psychological problems and related needs under the target psychological scenario category.
[0055] It should be noted that the sample psychological counseling information can be obtained from the Internet or randomly expanded based on real psychological counseling information; this invention does not limit this.
[0056] 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.
[0057] Optionally, based on the correspondence between age group, psychological scenario category, and psychological guidance strategy, the target age group to which the sample visitors belong and the sample psychological guidance strategy corresponding to the target psychological scenario category are determined.
[0058] 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. Then, in the pre-constructed correspondence between age range, psychological scene category and psychological guidance strategy, the psychological guidance strategy corresponding to the target age range and target psychological scene category of the sample visitor can be found. The psychological guidance strategy corresponding to the target age range and target psychological scene category is determined as the sample psychological guidance strategy.
[0059] It should be noted that, based on a real psychological database, a system was constructed that covers as many psychological scenario categories as possible. Appropriate psychological guidance strategies were then artificially developed, combining these categories with age groups. These strategies were used to control the direction of the dialogue. The correspondence between age groups, psychological scenario categories, and psychological guidance strategies is shown in Table 1.
[0060] Table 1
[0061]
[0062]
[0063] It should be noted that Table 1 only uses junior high school age group, high school age group, university age group, love-related category, learning-related category, peer-related category, family-related category, adaptability-related category, and future development-related category as examples for illustration. In practical applications, adult age group, elderly age group, and other psychological scenario categories can also be added, but this invention does not limit them.
[0064] Step 103: Input the sample psychological counseling information of the sample visitors and the sample psychological guidance strategy into the large language model to obtain the sample counseling plan output by the large language model for different counseling stages of the sample visitors.
[0065] For example, upon obtaining sample psychological counseling information and sample psychological guidance strategies from sample clients, a prompt is constructed based on this information and these strategies. This prompt is then input into a large language model to obtain sample counseling plans output by the large language model for different counseling stages of the sample clients. For example, counseling stages may include the trust-building and assessment stage, the emotion identification and management stage, and the healthy relationship skills stage. The sample counseling plan is the specific treatment information for the corresponding counseling stage. For example, if the counseling stage is the trust-building and assessment stage, the corresponding sample counseling plan could be "Humanistic therapy: creating a non-judgmental, supportive atmosphere, isolating the sample client from expressing emotional confusion, and assessing the sources of anxiety and stress."
[0066] Step 104: Based on the sample counseling plans of each of the sample visitors, train the initial psychological counseling model to obtain the psychological counseling model.
[0067] For example, using the same method, sample counseling plans for each sample client can be obtained. Then, the sample counseling plans of each sample client are used as labels. The sample psychological counseling information and corresponding sample psychological guidance strategies of the sample clients are input into the initial psychological counseling model to obtain the predicted counseling plans for different counseling stages of the sample clients output by the initial psychological counseling model. A loss function is constructed based on the predicted counseling plans and the corresponding sample counseling plans. The model parameters of the initial psychological counseling model are adjusted based on the loss function until the convergence condition is reached, and finally the psychological counseling model is obtained.
[0068] The training method for the psychological counseling model provided by this invention involves acquiring sample psychological counseling information from multiple sample clients corresponding to each target psychological scenario category. For each sample client, the method determines their age and the corresponding psychological guidance strategy for the target psychological scenario category. The sample psychological counseling information and guidance strategy are then input into a large language model to obtain sample counseling plans for different counseling stages. Based on these sample counseling plans, the initial psychological counseling model is trained to obtain the final psychological counseling model. This invention can generate sample counseling plans for different counseling stages for sample clients within the same target psychological scenario category. By training the psychological counseling model based on these plans, different counseling stages can be generated, thereby improving the stylistic diversity of psychological counseling dialogues obtained from these plans.
[0069] In one embodiment, Figure 2 This is a second flowchart illustrating the training method for the psychological counseling model provided in this embodiment of the invention. Figure 2 As shown, step 101 above obtains sample psychological counseling information for multiple sample visitors corresponding to the target psychological scene category, which can be achieved through the following steps:
[0070] Step 201: Obtain the real psychological data of the target visitors corresponding to the target psychological scene category.
[0071] For example, the real psychological data of the target client comes from real target psychological counseling scenarios, and the number of data is relatively small. It can be psychological counseling cases in Chinese or psychological personal statements of the target client. This invention does not limit this.
[0072] Step 202: Input the real psychological data into the large language model to obtain the real psychological counseling information of the target client output by the large language model.
[0073] For example, when obtaining the target client's real psychological data corresponding to the target psychological scenario category, the target client's real psychological data is input into a large language model. The large language model organizes the target client's real psychological data and finally outputs the target client's real psychological counseling information. The target client's real psychological counseling information includes the target client's self-statement and the target client's scenario description information. The target client's self-statement includes the target client's name, school level, age, dialogue style, and personality traits, etc. The target client's scenario description information includes the target client's actual encounters, psychological problems, and related needs under the target psychological scenario category.
[0074] Step 203: Construct a first prompt message, which is used to instruct the random expansion of the real psychological counseling information.
[0075] For example, random expansion is carried out based on the self-statement and scene description information of the target client. Random expansion refers to randomly adjusting the profile information of the target client, such as name, gender, personality traits, age, school level, and dialogue style, as well as randomly adjusting the event, location, and some relationships between people. The profile information of the target client and the range of random adjustments are shown in Table 2. Based on the range of random adjustments shown in Table 2, a first prompt is constructed to indicate the random expansion of real psychological counseling information.
[0076] Table 2
[0077]
[0078] It should be noted that Table 2 is only an example. In practical applications, other portrait information and corresponding random adjustment ranges can be added, and this invention does not limit this.
[0079] Step 204: Input the first prompt information into the large language model to obtain the sample psychological counseling information of each sample visitor output by the large language model.
[0080] 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. Using the same method, the sample psychological counseling information of each sample visitor can be obtained. Figure 3 This is a schematic diagram of sample psychological counseling information provided in an embodiment of the present invention, such as... Figure 3 As shown, the sample psychological counseling information includes sample client profile information and scene description information.
[0081] It should be noted that when the large language model outputs randomly expanded sample psychological counseling information, this expanded information can also be input into the large language model for quality control. This ensures that the expanded information reflects the actual psychological counseling situation of the target client. Specifically, the expanded information is used to determine whether the client will encounter the events described in the sample counseling information, whether the client's characteristics are reasonable, and whether the scenario description is reasonable. For example, for employment-related questions, if the sample counseling information output by the large language model includes the client's educational level as secondary school, then the sample counseling information output by the large language model is deemed unreasonable and needs to be re-output.
[0082] In this embodiment, real psychological data can be randomly expanded through a large language model, which effectively expands a small amount of real psychological data and obtains sample psychological counseling information of multiple sample visitors that conform to the description of reality, thereby improving the diversity of psychological counseling information.
[0083] In one embodiment, step 103 above inputs the sample psychological counseling information of the sample visitors and the sample psychological guidance strategy into a large language model to obtain the sample counseling plan output by the large language model for different counseling stages of the sample visitors. This can be achieved in the following ways:
[0084] A second prompt message is constructed and input into the large language model to obtain sample consultation plans for different consultation stages of the sample visitors, output by the large language model.
[0085] The second prompt information is used to instruct the generation of sample counseling plans for different counseling stages based on the sample psychological counseling information of the sample visitors and the sample psychological guidance strategy.
[0086] For example, upon obtaining sample psychological counseling information and sample psychological guidance strategies from sample clients, a second prompt is constructed to instruct the generation of sample counseling plans for different counseling stages based on the sample psychological counseling information and sample psychological guidance strategies from the sample clients. The constructed second prompt is input into the large language model. The large language model combines the content of different counseling schools and the psychological guidance strategies based on the specific personal information (sample psychological counseling information) of the sample clients and the corresponding psychological scenario categories, and outputs a personalized counseling plan suitable for the current client and combined with the counseling school, which is the sample counseling plan; the specific content of the counseling school is shown in Table 3; the sample counseling plan adjusts the counseling strategy according to different counseling stages and the specific characteristics of the sample clients. Figure 4This is a schematic diagram of the sample consultation solution provided in an embodiment of the present invention, such as... Figure 4 As shown, in Figure 3 Based on the data, sample counseling plans can be obtained for sample visitors.
[0087] Table 3
[0088]
[0089]
[0090]
[0091] It should be noted that Table 3 is only an example. In practical applications, content from other consulting schools can be added, and this invention does not limit this.
[0092] In this embodiment, a second prompt is constructed to instruct the generation of sample counseling plans for different counseling stages based on sample psychological counseling information and sample psychological guidance strategies of sample clients. This enables the large language model to generate sample counseling plans for different counseling stages through the second prompt and in combination with different counseling schools of thought. Personalized sample counseling plans are constructed based on the style settings of different counseling schools of thought, thereby improving the style diversity of the generated sample counseling plans.
[0093] In one embodiment, step 104 above trains the initial psychological counseling model based on the sample counseling plans of each of the sample clients to obtain the psychological counseling model. This can be achieved in the following ways:
[0094] For each of the sample visitors, the sample psychological counseling information of the sample visitors is input into the visitor proxy model, and the target guidance example and the sample counseling plan for the sample visitors are input into the counselor proxy model. Through the interaction between the visitor proxy model and the counselor proxy model, a multi-round sample psychological dialogue is obtained for the sample visitors. Based on the multi-round sample psychological dialogue of each of the sample visitors, the initial psychological counseling model is trained to obtain the psychological counseling model.
[0095] The target guidance examples include authentic empathetic response examples and / or negative guidance examples.
[0096] For example, a client-surrogate model and a counselor-surrogate model are constructed separately. Sample psychological counseling information of the sample clients is input into the client-surrogate model, while goal-oriented guidance examples and sample counseling plans for the sample clients are input into the counselor-surrogate model. Taking goal-oriented guidance examples, which include genuine empathic responses and negative guidance examples, as an example, the genuine empathic response examples are used to reduce the occurrence of false empathic responses from the counselor, while the negative guidance examples are used to restrain the counselor from excessively deepening the client's negative emotions. Furthermore, the interaction between the client-surrogate model and the counselor-surrogate model enables the initial construction of the current multi-style, multi-turn sample psychological dialogues. Using the same method, multi-turn sample psychological dialogues for each sample client can be obtained. The quality of each sample client's multi-turn sample psychological dialogue is then evaluated. Based on the quality evaluation results, the initial psychological counseling model is trained to obtain the psychological counseling model.
[0097] It should be noted that the dialogue style and personality traits of the sample visitors can also be input into the visitor proxy model to further enhance the dialogue style and enrich the dialogue diversity. In addition, the visitor proxy model can also introduce additional word limits for questions (e.g., less than 50 words) to simulate real communication scenarios, but this invention does not limit this.
[0098] It should be noted that question type ratio control constraints and reply word count limits (e.g., less than 150 words) can also be input into the counselor proxy model. Question type ratio control constraints refer to the fact that the proportion of the counselor's listening, questioning, and suggestion sentences in the entire dialogue should be relatively reasonable, avoiding the entire text being composed of one type of sentence. The goal is to encourage the client to express themselves while also providing appropriate questions and suggestions at key points, so that the reply content output by the counselor proxy model is more accurate and consistent with real communication scenarios. This invention does not impose any limitations on this.
[0099] In this embodiment, sample psychological counseling information of the sample clients is input into the client surrogate model, while goal-guided examples and sample counseling plans for the sample clients are input into the counselor surrogate model. Through the interaction between the client surrogate model and the counselor surrogate model, multi-round sample psychological dialogues for the sample clients are obtained. Due to the diverse styles of the sample counseling plans and the introduction of goal-guided examples, the style diversity and authenticity of the generated multi-round sample psychological dialogues are improved. This further enhances the accuracy of the trained psychological counseling model.
[0100] In one embodiment, the initial psychological counseling model is trained based on the multi-round sample psychological dialogues of each of the sample clients to obtain the psychological counseling model, which can be specifically implemented in the following ways:
[0101] For each of the sample visitors' multi-round psychological dialogues, a third prompting information is constructed and input into the large language model to obtain the quality evaluation results corresponding to the multi-round sample psychological dialogues output by the large language model; based on the target quality evaluation results representing qualified quality among all the quality evaluation results, the initial psychological counseling model is trained to obtain the psychological counseling model.
[0102] The third prompt information is used to instruct the quality evaluation of the multi-round sample psychological dialogue based on at least one evaluation dimension, which includes at least one of the following: dialogue authenticity, counselor response effectiveness, and visitor questioning effectiveness.
[0103] For example, based on multi-round sample psychological dialogues of sample clients, a third prompt is constructed to instruct the quality evaluation of the multi-round sample psychological dialogues based on at least one evaluation dimension. The large language model further evaluates the quality of the constructed multi-round sample psychological dialogues through the third prompt. The evaluation dimensions of the quality evaluation include at least one of the following: dialogue authenticity, counselor response effectiveness, and client questioning effectiveness. Among them, dialogue authenticity is to judge whether the current multi-round sample psychological dialogue is logically smooth and whether it conforms to the actual psychological counseling dialogue scenario, so as to ensure that the dialogue conforms to the real psychological dialogue scenario as much as possible and that the dialogue is logically smooth. The counselor response effectiveness is to ensure that the counselor's response is genuinely empathetic while not deepening the client's negative emotions, and can adjust the counseling strategy at the appropriate time, such as listening, giving advice, and asking questions, from three dimensions: whether the response is genuinely empathetic, whether it is correctly guided, and whether the response type and style are appropriate. The counselor's response is to ensure that the client's questions do not deviate from the basic premise, and to ensure that the dialogue does not deviate from the actual situation, provided that the client's characteristics and the scenario description information are consistent with reality. Finally, the quality evaluation results of each multi-round sample psychological dialogue output by the large language model are obtained; further, the target quality evaluation results representing qualified quality are selected 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 This is a schematic diagram of the quality evaluation results provided in an embodiment of the present invention, such as... Figure 5 As shown, for the multi-round sample psychological dialogue of the sample visitors, the corresponding quality evaluation results are generated. The quality evaluation results include the usability conclusion of each evaluation dimension. For example, if the usability conclusion of each evaluation dimension is yes, then the quality evaluation result is determined to be the target quality evaluation result that represents the quality as qualified.
[0104] In this embodiment, a large language model is used to evaluate the quality of multi-round sample psychological dialogues of sample visitors based on at least one evaluation dimension. Target quality evaluation results representing acceptable quality are then selected from all 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.
[0105] In one embodiment, the initial psychological counseling model is trained based on the target quality evaluation results that represent qualified quality among all the aforementioned quality evaluation results to obtain the psychological counseling model. This can be achieved in the following ways:
[0106] Based on the target information and the quality evaluation results of each target, the initial psychological counseling model is trained to obtain the psychological counseling model. The target information includes at least one of the following: target psychological scenario category, psychological counseling information of each sample, and counseling plan of each sample.
[0107] For example, taking the target information as including psychological scene categories, psychological counseling information of each sample, and counseling plan of each sample, after obtaining the psychological scene categories, sample psychological counseling information, sample counseling plans, and quality evaluation results through the large language model, the accurate target sample psychological counseling information can be manually selected from all the sample psychological counseling information output by the large language model. Based on the real psychological dialogue data of the target client, a prompt1 is constructed to indicate random expansion. The prompt1 is input into the initial psychological counseling model to obtain the predicted psychological counseling information output by the initial psychological counseling model. The target sample psychological counseling information is used as a label, and the first loss information is constructed based on the predicted psychological counseling information and the target sample psychological counseling information.
[0108] It is also possible to manually select accurate target sample counseling plans from all sample counseling plans output by the large language model, and construct prompt2 based on the sample psychological counseling information and sample psychological guidance strategies of the target sample clients corresponding to the target sample counseling plans to indicate the generation of counseling plans at different counseling stages. Input prompt2 into the initial psychological counseling model to obtain the predicted counseling plan output by the initial psychological counseling model. Use the target sample counseling plan as a label, and construct the second loss information based on the predicted counseling plan and the target sample counseling plan.
[0109] Furthermore, based on the target sample visitor's psychological dialogue corresponding to the target quality evaluation result, a prompt3 can be constructed to instruct on quality evaluation. The prompt3 is then input into the initial psychological counseling model to obtain the predicted quality evaluation result output by the initial psychological counseling model. The target quality evaluation result is used as a label, and a third loss information is constructed based on the predicted quality evaluation result and the target quality evaluation result.
[0110] Furthermore, based on the real psychological dialogue data of the target visitor, prompt4 can be constructed to indicate the identification of psychological scene categories. Prompt4 is input into the initial psychological counseling model to obtain the predicted psychological scene category output by the initial psychological counseling model. The target psychological scene category output by the large language model is used as the label, and a fourth loss information is constructed based on the predicted psychological scene category and the target psychological scene category.
[0111] Furthermore, based on the first, second, third, and fourth loss information, the total loss information is determined. The model parameters of the initial psychological counseling model are then adjusted based on this total loss information until convergence is achieved, ultimately resulting in the psychological counseling model. This model enables the identification of psychological scenario categories, the random expansion of psychological counseling information, the generation of counseling plans, and the quality evaluation of multi-round psychological dialogues. For example, the specific contents of prompt1, prompt3, and prompt4 are shown in Table 4.
[0112] Table 4
[0113]
[0114]
[0115]
[0116] Figure 6 This is a schematic diagram of the fine-tuning of the initial psychological counseling model provided in the embodiments of the present invention, such as... Figure 6 As shown, based on the psychological scene 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, thus realizing the local deployment of the psychological counseling model.
[0117] It should be noted that after obtaining the psychological counseling model, based on the functions of the psychological counseling model, such as the identification of psychological scene categories, random expansion of psychological counseling information, generation of counseling plans, and quality evaluation of multi-round psychological dialogues, corresponding data can be input into the psychological counseling model so that the psychological counseling model can output corresponding results. This invention will not elaborate further here.
[0118] 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 identify psychological scene categories, randomly expand psychological counseling information, generate counseling plans, and evaluate the quality of multi-round psychological dialogues. This reduces the dependence on external large language models, realizes local automation of the entire process, and improves the efficiency of data output.
[0119] Figure 7 This is a schematic diagram of the overall process of the training method for the psychological counseling model provided in this embodiment of the invention, as shown below. Figure 7 As shown, firstly, real psychological data (the specific experiences and related psychological problems of the target client) is obtained from a real psychological dialogue database. Then, based on the real psychological data, real psychological counseling information such as the target client's self-statement and scene description is constructed. This real psychological counseling information is randomly expanded to obtain sample psychological counseling information for multiple sample clients. Next, based on the subdivided psychological scene categories and the target population, corresponding psychological guidance strategies are searched from a psychological guidance strategy database, and sample counseling plans of different styles are generated by combining different counseling schools. The sample psychological counseling information of the sample clients is input into the client surrogate model, and the target guidance example and the sample counseling plan for the sample clients are input into the counselor surrogate model. Through the interaction between the client surrogate model and the counselor surrogate model, multi-round sample psychological dialogues for the sample clients are obtained. Finally, the generated multi-round sample psychological dialogues are evaluated for quality based on three dimensions: dialogue authenticity, counselor response effect, and client questioning effect, thus obtaining high-quality multi-round, multi-style psychological dialogues.
[0120] The training device for the psychological counseling model provided by the present invention will be described below. The training device for the psychological counseling model described below can be referred to in correspondence with the training method for the psychological counseling model described above.
[0121] Figure 8 This is a schematic diagram of the structure of the training device for the psychological counseling model provided in an embodiment of the present invention, as shown below. Figure 8 As shown, the training device 800 for the psychological counseling model includes an acquisition unit 801, a determination unit 802, a generation unit 803, and a training unit 804; wherein:
[0122] The acquisition unit 801 is used to acquire sample psychological counseling information of multiple sample visitors corresponding to each target psychological scene category.
[0123] The determining unit 802 is used to determine the age of each sample visitor and the sample psychological guidance strategy corresponding to the target psychological scene category for each sample visitor.
[0124] The generation unit 803 is used to input the sample psychological counseling information of the sample visitors and the sample psychological guidance strategy into the large language model to obtain the sample counseling plan output by the large language model for different counseling stages of the sample visitors.
[0125] Training unit 804 is used to train the initial psychological counseling model based on the sample counseling plans of each of the sample clients, so as to obtain the psychological counseling model.
[0126] The training device for the psychological counseling model provided by this invention acquires sample psychological counseling information from multiple sample clients corresponding to each target psychological scenario category. For each sample client, it determines the client's age and the corresponding psychological guidance strategy for the target psychological scenario category. The sample psychological counseling information and guidance strategy are input into a large language model to obtain sample counseling plans for different counseling stages. Based on these sample counseling plans, the initial psychological counseling model is trained to obtain the final psychological counseling model. This invention can generate sample counseling plans for different counseling stages for sample clients within the same target psychological scenario category. By training the psychological counseling model based on these plans, different counseling stages can be generated, thereby improving the stylistic diversity of psychological counseling dialogues obtained from these plans.
[0127] Based on any of the above embodiments, the acquisition unit 801 is specifically used for:
[0128] Obtain the actual psychological data of the target visitors corresponding to the target psychological scene category;
[0129] The real psychological data is input into the large language model to obtain the real psychological counseling information of the target client output by the large language model;
[0130] A first prompt message is constructed, which is used to instruct the random expansion of the real psychological counseling information;
[0131] The first prompt information is input into the large language model to obtain the sample psychological counseling information of each sample visitor output by the large language model.
[0132] Based on any of the above embodiments, the determining unit 802 is specifically used for:
[0133] Based on the correspondence between age group, psychological scenario category, and psychological guidance strategy, the target age group to which the sample visitors belong and the sample psychological guidance strategy corresponding to the target psychological scenario category are determined.
[0134] Based on any of the above embodiments, the generation unit 803 is specifically used for:
[0135] A second prompt message is constructed, which is used to instruct the generation of sample counseling plans for different counseling stages based on the sample psychological counseling information of the sample visitors and the sample psychological guidance strategy;
[0136] The second prompt information is input into the large language model to obtain the sample consultation plan output by the large language model for different consultation stages of the sample visitors.
[0137] Based on any of the above embodiments, the training unit 804 is specifically used for:
[0138] For each of the sample visitors, the sample psychological counseling information of the sample visitors is input into the visitor proxy model, and the target guidance examples and the sample counseling plan for the sample visitors are input into the counselor proxy model. Through the interaction between the visitor proxy model and the counselor proxy model, a multi-round sample psychological dialogue is obtained for the sample visitors. The target guidance examples include genuine empathetic response examples and / or negative guidance examples.
[0139] The initial psychological counseling model is trained based on multiple rounds of sample psychological dialogues with each of the sample visitors to obtain the psychological counseling model.
[0140] Based on any of the above embodiments, the training unit 804 is further specifically used for:
[0141] For the multi-round sample psychological dialogues of each of the sample visitors, a third prompting information is constructed. The third prompting information is used to instruct the quality evaluation of the multi-round sample psychological dialogues based on at least one evaluation dimension.
[0142] The third prompt information is input into the large language model to obtain the quality evaluation results corresponding to the multi-turn sample psychological dialogue output by the large language model.
[0143] Based on the target quality evaluation results that represent qualified quality among all the aforementioned quality evaluation results, the initial psychological counseling model is trained to obtain the psychological counseling model.
[0144] Based on any of the above embodiments, the training unit 804 is further specifically used for:
[0145] Based on the target information and the quality evaluation results of each target, the initial psychological counseling model is trained to obtain the psychological counseling model. The target information includes at least one of the following: target psychological scenario category, psychological counseling information of each sample, and counseling plan of each sample.
[0146] Figure 9 This is a schematic diagram of the physical structure of the electronic device provided in the embodiments of the present invention, such as... Figure 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 through the communication bus 940. The processor 910 can call logical instructions in the memory 930 to execute a training method for a psychological counseling model, the method including: for each target psychological scene category, obtaining sample psychological counseling information of multiple sample clients corresponding to the target psychological scene category;
[0147] 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;
[0148] The sample psychological counseling information of the sample visitors and the sample psychological guidance strategy are input into the large language model to obtain the sample counseling plan output by the large language model for different counseling stages of the sample visitors.
[0149] Based on the sample counseling plans of each of the sample visitors, the initial psychological counseling model is trained to obtain the psychological counseling model.
[0150] Furthermore, the logical instructions in the aforementioned memory 930 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0151] On the other hand, the present invention also provides a computer program product, the computer program product including a computer program, the computer program being able to be stored on a non-transitory computer-readable storage medium, the computer program being executed by a processor, the computer being able to execute the training method of the psychological counseling model provided by the above methods, the method including: for each target psychological scene category, obtaining sample psychological counseling information of multiple sample visitors corresponding to the target psychological scene category;
[0152] 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;
[0153] The sample psychological counseling information of the sample visitors and the sample psychological guidance strategy are input into the large language model to obtain the sample counseling plan output by the large language model for different counseling stages of the sample visitors.
[0154] Based on the sample counseling plans of each of the sample visitors, the initial psychological counseling model is trained to obtain the psychological counseling model.
[0155] In another aspect, 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 the psychological counseling model provided by the above methods, the method comprising: for each target psychological scene category, obtaining sample psychological counseling information of multiple sample visitors corresponding to the target psychological scene category;
[0156] 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;
[0157] The sample psychological counseling information of the sample visitors and the sample psychological guidance strategy are input into the large language model to obtain the sample counseling plan output by the large language model for different counseling stages of the sample visitors.
[0158] Based on the sample counseling plans of each of the sample visitors, the initial psychological counseling model is trained to obtain the psychological counseling model.
[0159] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0160] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0161] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A training method for a psychological counseling model, characterized in that, include: For each target psychological scenario category, obtain sample psychological counseling information for multiple sample visitors corresponding to the target psychological scenario category. The sample psychological counseling information includes sample profile information and scenario description information of the sample visitors. 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; The sample psychological counseling information of the sample visitors and the sample psychological guidance strategy are input into the large language model to obtain the sample counseling plan output by the large language model for different counseling stages of the sample visitors. For each of the sample visitors, the sample psychological counseling information of the sample visitors is input into the visitor proxy model, and the target guidance examples and the sample counseling plan for the sample visitors are input into the counselor proxy model. Through the interaction between the visitor proxy model and the counselor proxy model, a multi-round sample psychological dialogue is obtained for the sample visitors. The target guidance examples include genuine empathetic response examples and / or negative guidance examples. Based on the multi-round sample psychological dialogues of each of the sample visitors, the initial psychological counseling model is trained to obtain the psychological counseling model.
2. The training method for the psychological counseling model according to claim 1, characterized in that, The step of obtaining sample psychological counseling information for multiple sample visitors corresponding to the target psychological scene category includes: Obtain the actual psychological data of the target visitors corresponding to the target psychological scene category; The real psychological data is input into the large language model to obtain the real psychological counseling information of the target client output by the large language model; A first prompt message is constructed, which is used to instruct the random expansion of the real psychological counseling information; The first prompt information is input into the large language model to obtain the sample psychological counseling information of each sample visitor output by the large language model.
3. The training method for the psychological counseling model according to claim 1, characterized in that, The sample psychological guidance strategy for determining the age of the sample visitors and the target psychological scenario category includes: Based on the correspondence between age group, psychological scenario category, and psychological guidance strategy, the target age group to which the sample visitors belong and the sample psychological guidance strategy corresponding to the target psychological scenario category are determined.
4. The training method for the psychological counseling model according to claim 1, characterized in that, The process involves inputting the sample psychological counseling information and the sample psychological guidance strategy of the sample clients into a large language model to obtain sample counseling plans output by the large language model for different counseling stages of the sample clients, including: A second prompt message is constructed, which is used to instruct the generation of sample counseling plans for different counseling stages based on the sample psychological counseling information of the sample visitors and the sample psychological guidance strategy; The second prompt information is input into the large language model to obtain the sample consultation plan output by the large language model for different consultation stages of the sample visitors.
5. The training method for the psychological counseling model according to claim 1, characterized in that, The initial psychological counseling model is trained based on multi-round sample psychological dialogues with each of the sample visitors to obtain the psychological counseling model, including: For the multi-round sample psychological dialogues of each of the sample visitors, a third prompting information is constructed. The third prompting information is used to instruct the quality evaluation of the multi-round sample psychological dialogues based on at least one evaluation dimension. The third prompt information is input into the large language model to obtain the quality evaluation results corresponding to the multi-turn sample psychological dialogue output by the large language model. Based on the target quality evaluation results that represent qualified quality among all the aforementioned quality evaluation results, the initial psychological counseling model is trained to obtain the psychological counseling model.
6. The training method for the psychological counseling model according to claim 5, characterized in that, The initial psychological counseling model is trained based on the target quality evaluation results representing quality compliance from all the aforementioned quality evaluation results to obtain the psychological counseling model, including: Based on the target information and the quality evaluation results of each target, the initial psychological counseling model is trained to obtain the psychological counseling model. The target information includes at least one of the following: target psychological scenario category, psychological counseling information of each sample, and counseling plan of each sample.
7. A training device for a psychological counseling model, characterized in that, include: The acquisition unit is used to acquire sample psychological counseling information of multiple sample visitors corresponding to each target psychological scene category. The sample psychological counseling information includes sample profile information and scene description information of the sample visitors. The determining unit is used to determine the age of each sample visitor and the sample psychological guidance strategy corresponding to the target psychological scene category for each sample visitor. The generation unit is used to input the sample psychological counseling information of the sample visitors and the sample psychological guidance strategy into the large language model to obtain the sample counseling plan output by the large language model for different counseling stages of the sample visitors. The training unit is used to input the sample psychological counseling information of each sample visitor into the visitor proxy model, and input the target guidance example and the sample counseling plan for each sample visitor into the counselor proxy model. Through the interaction between the visitor proxy model and the counselor proxy model, a multi-round sample psychological dialogue is obtained for each sample visitor. The target guidance example includes a genuine empathetic response example and / or a negative guidance example. Based on the multi-round sample psychological dialogues of each of the sample visitors, the initial psychological counseling model is trained to obtain the psychological counseling model.
8. 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 for the psychological counseling model as described in any one of claims 1 to 6.
9. 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, it implements the training method of the psychological counseling model as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Psychological counseling method and device based on controlled text generation and terminal equipment
CN114661864A
Psychological counseling strategy generation method and device based on intelligent agent, equipment and medium
CN118964598A