Intelligent psychological counseling method based on dynamic scale embedding and dialogue analysis
By combining dynamic scale embedding with standardized treatment plans, and utilizing the collaborative reasoning mechanism of fine-tuning models and RAG modules, the system analyzes users' chat content and emotions in real time, solving the problems of insufficient flexibility and depth in existing psychological counseling systems and achieving personalized and efficient psychological counseling.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHENGDU UNIV OF INFORMATION TECH
- Filing Date
- 2026-01-13
- Publication Date
- 2026-04-28
AI Technical Summary
Existing psychological counseling systems lack flexibility and depth, failing to meet users' diverse emotional needs and complex psychological problems. They are also difficult to personalize according to individual differences, and traditional pattern matching and fixed scripts are insufficient to understand users' deep-seated psychological motivations, resulting in low counseling efficiency.
Employing dynamic scale embedding technology and standardized treatment plan embedding technology, combined with the collaborative reasoning mechanism of the fine-tuning model and RAG module, the system analyzes the user's chat rhythm and content in real time, dynamically embeds scales and generates personalized treatment plans, constructs user profiles through multi-turn dialogues and provides comprehensive answers.
It improves the flexibility and depth of psychological counseling, enabling a better understanding of users' emotional needs, providing personalized treatment plans, and enhancing the efficiency and effectiveness of counseling.
Smart Images

Figure CN121938568A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent psychological counseling, and in particular to an intelligent psychological counseling method based on dynamic scale embedding and dialogue analysis. Background Technology
[0002] In my country, only 9.5% of patients with depressive disorders have received treatment, and only 0.5% of them have received adequate treatment. Benefiting from strong market demand, the number of psychological counseling institutions is constantly increasing. However, while the market is booming, the psychological counseling industry also faces many challenges. The main reasons are the uneven distribution of psychological counseling resources; high-quality counselors are concentrated in large cities, making it difficult for remote areas to access professional services. On the other hand, service costs are high; counselors require long-term professional training, making it difficult to reduce labor costs, and the lengthy counseling process leads to high fees per session. Furthermore, due to traditional thinking, people are hesitant to express their mental health problems, resulting in slow responses to offline counseling and difficulty in quickly intervening in the face of sudden psychological crises. Artificial intelligence-based intelligent psychological counseling systems, due to their efficiency and convenience, have become an important supplementary tool.
[0003] Traditional psychological counseling involves appointments at mental health institutions. Patients needing counseling must travel to the city center to register for an assessment. After completing this complex process and being matched with a therapist, they must wait several business days to schedule an appointment. A course of treatment can last from 1-3 weeks to 1-3 months, with each session requiring a visit to the institution. This traditional approach is time-consuming and labor-intensive, and suffers from issues such as difficulty in verifying qualifications, unclear pricing, and a mix of qualified and unqualified practitioners. Furthermore, the shortage of professional therapists prevents access to readily available professional counseling, and limitations imposed by economic, time, and location constraints significantly restrict the reach of psychological counseling.
[0004] Early intelligent psychological counseling systems employed rule-based intent recognition and fixed-script generation. These systems responded to user questions using preset keywords and simple question-and-answer templates. While providing timely responses, they lacked flexibility and depth, failing to meet diverse emotional needs and complex psychological issues. Furthermore, fixed scripts can feel mechanical and unnatural to users, hindering the establishment of trust. Relying on preset rules and fixed scripts limits the processing of only a limited range of rule-compliant inputs. When faced with complex and varied user questions, especially those exceeding the preset rules, they cannot provide accurate and appropriate responses. They also cannot flexibly adjust to individual user differences (such as personality, experience, and emotional state), failing to meet the personalized needs of different users during the counseling process and providing feedback truly tailored to the user's psychological state. Simply relying on pattern matching and fixed scripts makes it difficult to truly understand the deeper psychological motivations and emotional needs behind user problems, tending to remain superficial and failing to uncover deeper psychological issues, thus hindering in-depth counseling.
[0005] Simple industry-specific data fine-tuning solutions are currently being explored in some research attempts to improve the performance of pre-trained models in the field of psychological counseling by fine-tuning them with simple industry-specific data. These solutions typically use a small amount of psychological counseling dialogue data to fine-tune a large language model, enabling it to generate responses more consistent with psychological counseling scenarios. However, due to the limited data volume and relatively simple fine-tuning methods, the models still have shortcomings in handling complex emotions and professional issues, and they do not fully consider the different personal styles of different psychological counselors, including language styles and therapeutic styles. As a result, even fine-tuned psychological counseling models may not meet the individual needs of patients for counselors with different styles. Especially in the Chinese context, psychological counseling models struggle to accurately understand and respond to users' emotional expressions. Furthermore, existing solutions mostly use single-turn dialogue data, lacking the contextual dependencies in multi-turn interactions (such as tracking user emotional changes and the progression of dialogue logic), leading to a lack of coherence and specificity in subsequent responses, hindering the deepening of the counseling process. Moreover, dialogue alone cannot provide a comprehensive understanding of the user's situation, and is insufficient to address the user's deeper psychological problems in a targeted manner.
[0006] The aforementioned shortcomings make it difficult for existing psychological counseling solutions to meet practical application needs in terms of comprehensive performance (localized and concentrated resources, timeliness, empathy, guidance, and professionalism) in psychological counseling scenarios. Therefore, it is of significant research value to study a dynamic, more adaptable, and more flexible intelligent psychological counseling method that combines artificial intelligence technology. Summary of the Invention
[0007] To address the shortcomings of existing technologies, this invention proposes an intelligent psychological counseling method based on dynamic scale embedding and dialogue analysis. The method is characterized by employing dynamic scale embedding technology, standardized treatment plan embedding technology, and a collaborative reasoning mechanism. The dynamic scale embedding technology analyzes the user's chat rhythm and content during real-time dialogue and dynamically embeds the scale at appropriate times. The standardized treatment plan embedding technology uses a dynamic decision engine to analyze the dialogue rhythm in real time, updating the user profile in real time based on the user's completed scale, and providing a feasible standardized treatment plan at the appropriate time. The collaborative reasoning mechanism, based on a fine-tuning model and a RAG module, involves the fine-tuning model performing preliminary understanding and analysis when the user asks a question, while the RAG module retrieves relevant knowledge and feeds it back to the fine-tuning model, generating a comprehensive response, specifically including: Step 1: Investigate the current status of the psychological counseling medical industry and identify high-frequency application scenarios; design an initial sample data template; obtain real psychological counseling dialogue data and perform anonymization processing; have experts manually screen the obtained real dialogue data to select dialogue data that reaches the preset dialogue rounds, and manually mark the scoring and detailed basis; at the same time, organize the dialogue content according to the initial sample data template and record the scale data used in the counseling process. Step 2: Select a suitable base model, conduct pre-evaluation and performance testing on the base model, fine-tune the base model using real multi-turn dialogue data collected in Step 1, and score the responses of the fine-tuned model through third-party scoring and manual verification until the base model's average score on the three scoring labels is ≥4. Step 3: Dynamic scale embedding technology. A scale knowledge base is built and embedded into a dynamic scale retrieval system. During the user's dialogue with the intelligent consultation system, the user's chat rhythm and content are analyzed. The decision engine determines whether it is the appropriate time to embed the scale, dynamically embeds the matching psychological scale, and guides the user to fill in the scale. The dynamic scale embedding process includes: feature extraction, dynamic scale decision engine, decision state determination, scale embedding, and continued natural dialogue. Step 4: Fine-tuning the collaborative reasoning mechanism between the model and the RAG module. The fine-tuning model continuously builds user profiles through dialogue with users. First, it conducts a preliminary analysis of the user's psychological state, activates the RAG module to retrieve information related to the current task from the knowledge base, and integrates the retrieved information and the user's dialogue into the information fusion unit. Then, it is passed to the fine-tuning model so that the fine-tuning model can refer to professional psychological counseling experience to give a comprehensive psychological counseling answer. The reasoning process incorporates an embedded scale triggering mechanism and a dynamic weight adjustment mechanism. Step 5: Standardized treatment plan embedding technology. First, the model is fine-tuned to perform real-time analysis of user sentiment based on the dialogue and to complete the user profile. The decision engine and the user-filled scale are used to verify whether the new dialogue information is consistent with historical data. At the same time, the user data is mapped to a multi-dimensional assessment vector based on the user-filled scale. Then, the RAG module is used to retrieve matching treatment plans from the professional knowledge base. Based on the multi-dimensional assessment vector, the most relevant treatment plan and assistance strategy are determined. Finally, the model is fine-tuned to generate a standardized treatment plan based on the completed user profile and the context of the dialogue. Step 6: Training and learning of the overall system, transforming the professional psychological knowledge text database into a vector database and configuring its retrieval engine, designing a knowledge-dialogue fusion mechanism for secondary filtering of knowledge fragments, converting the filtered knowledge fragments into contextual cues that the fine-tuned model can recognize, learning to call the RAG module for collaborative reasoning during training, and learning the embedding timing of psychological scales by updating the mutual information threshold. Step 7: System performance evaluation and iterative optimization.
[0008] According to a preferred embodiment, the processing flow of the collaborative reasoning mechanism in step 4 specifically includes: Step 41: Design the collaborative reasoning process. First, start the fine-tuned model that has been finely trained on a specific dataset and has strong context understanding and generation capabilities. After building a basic user profile, activate the RAG module to retrieve information related to the current task from an external knowledge base. Step 42: Collaborative Reasoning Mechanism. First, the fine-tuning model performs preliminary understanding and analysis based on the psychological questions raised by the user, identifying the user's emotional state and consultation intentions. Then, the retrieval submodule of the RAG module retrieves relevant data from the knowledge base based on the preliminary analysis results of the fine-tuning model and feeds it back to the information fusion unit along with the user's psychological questions. The information fusion unit inserts the retrieved knowledge into the user's questions as annotations and then transmits it to the fine-tuning model to generate a comprehensive psychological consultation Q&A. Step 43: Embed the scale triggering mechanism, determine the triggering time through semantic understanding, automatically push the matching assessment scale, and generate personalized treatment plans based on the assessment results, so as to upgrade the consultation system from passive companionship to active intervention; Step 44: Dynamic weight adjustment mechanism, dynamically adjust the weights of professional knowledge and fine-tuning model according to the dialogue stage.
[0009] According to a preferred embodiment, the processing flow of step 5, the standardized treatment plan embedding technology, specifically includes: Step 51: Real-time user sentiment analysis. First, the modal data of the user's text and voice are merged. A fine-tuning model is used to analyze the user's dialogue in real time to identify basic sentiment categories and specific sentiments. Then, the sentiment dictionary and the fine-tuning model are combined to calculate the sentiment intensity score and track the sentiment fluctuation trend. The user's sentiment changes under different topics are recorded to identify trigger points. Finally, a user sentiment report is generated based on the analysis results. Step 52: User profile completion. The user profile is stored in the form of a knowledge graph. The nodes include user attributes, psychological state and behavioral relationships. After each conversation, the nodes are updated and the user profile is completed based on the user sentiment report using a graph algorithm, and missing values are filled in. Step 53: Standardize user information in multiple dimensions. Based on the information from the questionnaires filled out by the users and with reference to authoritative psychological standards, define multi-dimensional evaluation indicators and map the user data onto the evaluation dimensions to obtain a multi-dimensional evaluation vector. Step 54: Embedding standardized treatment plans. First, the RAG module is used to retrieve matching treatment plans from the professional knowledge base. Based on the multidimensional evaluation vector, the most relevant treatment plan is found through similarity calculation and an assistance strategy is specified. Then, the model is fine-tuned to personalize the retrieved assistance strategy and generate standardized treatment plans based on the completed user profile and the context of the dialogue.
[0010] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. The dynamic scale embedding technology proposed in this invention dynamically embeds a matched psychological scale based on mutual information threshold according to the user's chat rhythm and content during the dialogue between the user and the intelligent consultation system, and guides the user to fill in the scale.
[0011] 2. The standardized treatment plan embedding technology proposed in this invention uses a dynamic decision engine to analyze the rhythm of the conversation in real time, and combines the user's completed questionnaire to update the user profile in real time. It provides a practical and standardized treatment plan at the appropriate time, so as to complete the psychotherapy in a more natural and imperceptible way.
[0012] 3. The collaborative reasoning mechanism of the fine-tuning module and the RAG module proposed in this invention allows the fine-tuning model to perform preliminary understanding and analysis when a user asks a question, while the RAG module retrieves relevant knowledge and feeds it back to the fine-tuning model. The fine-tuning model then combines the information from both modules to generate a comprehensive answer. This collaborative reasoning mechanism fully leverages the model's natural language processing capabilities and knowledge retrieval and fusion capabilities to improve the quality and professionalism of the answers. Attached Figure Description
[0013] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a diagram illustrating the overall technical architecture of the method of this invention; Figure 3 This is a diagram of the dynamic scale embedding framework of the present invention; Figure 4 This is a diagram of the collaborative reasoning framework of the present invention; Figure 5 It is an interactive flowchart of a standardized treatment plan. Detailed Implementation
[0014] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific embodiments and the accompanying drawings. It should be understood that these descriptions are merely exemplary and not intended to limit the scope of the invention. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concept of the invention.
[0015] The following is a detailed explanation with reference to the accompanying drawings.
[0016] The fine-tuning model of this invention refers to the base model learning the dialogue style of a psychological counselor and supplementing psychological counseling-related knowledge after further incremental learning on prepared data, without losing the original knowledge and performance.
[0017] The main technical points and innovations of this invention include: collecting multiple rounds of real data and performing manual annotation by experts, embedding dynamic scales and standardized treatment plans, fine-tuning the model and collaborative reasoning of the RAG module, and a dual standard of "manual + automatic" model evaluation and optimization.
[0018] Since real-life psychological counseling sessions with therapists involve dialogues and multi-dimensional rating data, this invention collects multi-round real-life dialogue data from partner psychological counseling institutions, covering a variety of significant psychological issues. The data undergoes preprocessing, including cleaning, format standardization, and anonymization, to ensure data quality. Furthermore, in collaboration with experts, manual labeling and rating, along with detailed criteria, are completed to enable the model to accurately identify user emotions and provide appropriate empathetic responses, thereby enhancing the model's empathy and dialogue guidance capabilities.
[0019] The technology embeds dynamic scales and standardized treatment plans, using a dynamic decision engine to analyze the conversation rhythm in real time, update user profiles, and provide customized scales or standardized treatment plans at the appropriate time to complete psychotherapy in a more natural and seamless way.
[0020] The fine-tuning model and the RAG module collaborate in reasoning. When a user poses a question, the fine-tuning model performs initial understanding and analysis, while the RAG module retrieves relevant knowledge and feeds it back to the fine-tuning model. The fine-tuning model then combines this information to generate a comprehensive answer. This collaborative reasoning mechanism fully leverages the model's natural language processing and knowledge retrieval capabilities to improve the quality and professionalism of the answers.
[0021] Model performance evaluation and iterative optimization employ a dual-standard evaluation method combining manual and automated assessments to comprehensively evaluate indicators such as empathy, guidance, professionalism, fluency, consistency, and safety. Based on the evaluation results, problems are identified and iterative optimizations are performed until the model achieves satisfactory results across all indicators, ensuring the provision of high-quality psychological counseling services to users.
[0022] This invention proposes an intelligent psychological counseling method based on dynamic scale embedding and dialogue analysis. Text feature matching serves as the behavioral reference for the large model; for example, a psychological counselor's handbook serves as the reference for each round of psychotherapy. Scales are dynamically provided to users based on the dialogue rhythm. A mutual information threshold function is used as the objective function for cross-domain sentiment analysis to fine-tune the model, improving its cross-diagnosis psychotherapy capabilities and thus meeting the needs of different styles of psychological counseling. The collaborative reasoning of the fine-tuned model and the RAG module effectively ensures the stability of psychotherapy effects and improves treatment efficiency. The mutual information threshold function mainly serves as an indicator of whether to embed the scale. A mathematical formula calculates the mutual information value between the user's response and the scale. The mutual information value reflects the user's emotional tendency. When the mutual information value exceeds a set threshold (initially a random number, further adjusted to a reasonable value during system learning in step 6), it indicates that this is the optimal time to embed the scale.
[0023] This invention utilizes multi-round, progressive fine-tuning with real data to enable the model to learn empathy and guidance logic that aligns with Chinese language habits (addressing the deficiency in emotional adaptability), supplements professional knowledge through text feature matching (addressing the deficiency in professional expertise), dynamically matches psychological scales to obtain detailed user profiles, and uses a mutual information threshold function to ensure the model achieves stable therapeutic effects in different situations. Finally, it achieves seamless integration of "emotional expression + knowledge application" through a collaborative reasoning mechanism (addressing the deficiency in poor collaboration). The technical solution of this invention mainly includes four stages: model construction and fine-tuning, system construction and training, and model consultation.
[0024] Model Construction and Fine-tuning Phase: For the base model, based on its traditional Transformer structure, a cue embedding sequence consisting of n tokens is embedded. This sequence has two layers: one for upward projection and one for downward projection. A cross-layer transfer structure is set up to ensure that feature information of different fine granularities can be directly passed to deeper layers. The choice of base model depends on the model size (to meet the inference requirements of a single RTX4090), the model structure (requiring a Transformer structure), and the model performance (conducting multiple rounds of dialogue with the base model to determine if its response speed, fluency, and other metrics are high enough).
[0025] Using a complete psychological counseling dialogue context, including a multi-turn Chinese dataset of “user question A - counselor response BABAB…” (this dataset has been approved for collection and training), based on the pre-trained model, the mutual information threshold function is used as the objective function. This reduces the model training burden while improving the model’s cross-diagnosis psychotherapy capabilities, enabling it to learn richer empathic expressions and diverse yet stable styles.
[0026] System Setup and Training Phase: A collaborative reasoning approach using a fine-tuning model and the RAG module is employed. The fine-tuning model continuously builds a basic user profile through dialogue with the user. First, a preliminary analysis of the user's psychological state is performed, activating the RAG module to retrieve task-related information from the knowledge base. Then, the RAG module's generation sub-module combines the analysis results from the fine-tuning model with the retrieved information to generate a comprehensive psychological counseling question and answer. An embedded scale triggering mechanism and a dynamic weight adjustment mechanism are incorporated into the reasoning process. Simultaneously, user data is mapped onto multi-dimensional assessment vectors based on the user-completed scales. The RAG module then retrieves matching treatment plans from the professional knowledge base, determining the most relevant treatment plan and assistance strategy based on the multi-dimensional assessment vectors. Finally, the fine-tuning model generates a standardized treatment plan based on the completed user profile and the context of the dialogue. In actual counseling, through user sentiment analysis, the model continuously trains itself and updates its coping strategies in real time.
[0027] In the model consultation phase: While ensuring smooth dialogue between the fine-tuned model and the user, rich empathy, and fulfillment of the user's emotional needs, a professional psychological counseling knowledge base is constructed. Additional text feature matching is performed on the user's questions and the model's output to ensure the fine-tuned model can self-check the compliance and legality of its responses, ensuring there are no factual illusions (i.e., the model-generated content is inconsistent with verifiable real-world facts). A scale knowledge base is built to provide the user with the most suitable scale in real time, allowing the system to fully understand the user's psychological state. The model reviews the complete dialogue process with the user, constructing a complete user profile based on the user's behavioral logic and psychological state, combined with scale results. After obtaining sufficient information or upon the user's request, precise and targeted standardized treatment plans are provided to ensure counseling effectiveness.
[0028] While the steps can be roughly divided, there are relationships between them, and these divisions do not fully represent the technical solution of this invention. Steps 1 to 2: Model construction and fine-tuning stage. Steps 3 to 4, 7: System setup and training stage. Steps 5 to 6: Model consultation stage.
[0029] The psychological counseling technical solution proposed in this invention will now be described in detail with reference to the accompanying drawings. Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a diagram of the overall technical architecture of the method of this invention.
[0030] Step 1: Investigate the current status of the psychological counseling medical industry and identify high-frequency application scenarios, and design an initial sample data template; obtain real psychological counseling dialogue data and perform anonymization processing; experts manually screen the obtained real dialogue data to select dialogue data that reaches the preset dialogue rounds, and manually mark the scoring and detailed basis; at the same time, organize the dialogue content according to the initial sample data template, and record the data of various scales used in the counseling process.
[0031] Step 11: Investigate the current status of the mental health counseling industry, actively communicate and exchange ideas with relevant companies and hospitals, discuss the composition of relevant datasets, collect and refer to a large number of currently available mental health counseling datasets, cover more different types of mental health problems, and identify high-frequency application scenarios.
[0032] Step 12: Based on the high-frequency application scenarios identified in Step 11, design an initial sample data template.
[0033] User input template: Simulate expressions of different emotional intensities, such as mild anxiety: "I haven't been sleeping well lately"; severe anxiety: "I'm having insomnia all night, my heart is beating very fast, and I feel like I'm going to break down."
[0034] Counselor's response template: A combination of empathy, guidance, and professional advice, such as "I can feel your suffering right now (empathy). How long has this been going on? (guidance) Long-term insomnia may be related to anxiety. We can try breathing exercises first (professional advice)."
[0035] Step 13: In the acquisition of real dialogue datasets, institutional experts, referring to medical experience in related fields of psychology, screen typical psychological counseling dialogue data to ensure the professionalism of the dialogue data.
[0036] Specifically, the process involves multiple rounds of filtering based on the logic of "user input → consultant response → user secondary feedback → consultant secondary response" to ensure that each conversation is limited to 3 to 8 rounds, thus covering the entire process from problem expression to in-depth needs discovery.
[0037] Step 14: Organize the dialogue content from the psychological counseling process according to the initial sample data template. For text and voice dialogue information, use advanced natural language processing technology for transcription and parsing to ensure accurate conversion into multi-turn dialogue examples that the model can understand and learn. Simultaneously record the data of various scales used in the psychological counseling process, and annotate them as a reference for dynamic scale embedding technology to achieve dynamic analysis of scale data.
[0038] Step 15: De-identify the real dialogue data to protect user privacy while ensuring data availability.
[0039] Automated data anonymization is performed based on the principles of minimization, irreversibility, and consistency. The minimization principle means that only critical data involving user privacy is anonymized, minimizing the impact on data integrity. The irreversibility principle ensures that the anonymized data cannot be restored to its original state through conventional means, guaranteeing user privacy security. The consistency principle ensures that the anonymized data maintains its original data format and logical relationships, guaranteeing data usability and consistency.
[0040] Step 16: Experts manually annotate and score the acquired real dialogue data and refine the scoring criteria. The scoring includes three tags: empathy, guidance, and professionalism, and each tag has a corresponding scoring standard.
[0041] The labeled data will be used for model fine-tuning in step 2 and system learning in step 7, as well as for model evaluation. Experts will manually label and score the multi-round text data (1-5 points), with scores including three tags: empathy, guidance, and professionalism, each with corresponding scoring criteria. The training data will be labeled and scored to filter out high-quality training data. After the base model is fine-tuned, the fine-tuned model will be evaluated. Experts will also randomly select some outputs from the fine-tuned model and manually label and score them to assess whether the fine-tuned model meets the required standards in various aspects.
[0042] The scoring criteria for the empathy tag are: whether the response includes expressions of empathy (such as "I understand how you feel" or "This must be very upsetting for you") and whether it matches the user's emotions (such as whether the response addresses "anger" rather than "sadness" when the user expresses "anger").
[0043] 1 point: No empathy expressed, and the response is unrelated to the user's emotions (e.g., if the user says "sad", the response is "you should be happier"). 3 points: Includes basic empathetic phrases (such as "I understand how you feel"), but does not accurately match the intensity of emotions (e.g., if the user is severely anxious, only responds "It must be a bit tough"). 5 points: Uses concrete empathetic expressions (such as "That feeling of a racing heart and sleepless nights must be very frightening to you"), perfectly matching the user's emotional type and intensity.
[0044] The scoring criteria for guiding labels are: whether the response contains guiding statements (such as "Could you tell me more about the situation?" or "What do you think might be the reason behind this?") and whether it promotes a deeper conversation (such as guiding the conversation from surface emotions to deeper needs).
[0045] 1 point: No guiding statement, just direct advice (such as "You should see a doctor"); 3 points: Includes leading questions, but does not drive the conversation deeper (e.g., when a user says "I had a fight with my family," the response is "Why did you fight?"). 5 points: Uncover deeper needs through progressive questioning (e.g., "When you argue, do you care most about your family's attitude or the right or wrong of the matter itself? (leading to needs) This may be related to your usual communication patterns (connecting to a professional perspective)").
[0046] The scoring criteria for professionalism labels are: whether the response uses standard psychological terminology (such as "cognitive bias" and "emotion regulation" instead of colloquial and incorrect expressions) and whether it complies with psychological counseling ethics (such as not giving inappropriate advice and not denying the user's feelings).
[0047] 1 point: Using incorrect terminology (such as calling “depressive mood” “depression”) or violating ethics (such as “it’s nothing to worry about, don’t overthink it”). 3 points: The terminology is correct but basic (e.g., "This is anxiety"), with no ethical issues; 5 points: Precise use of professional terminology (e.g., "This could be a typical manifestation of generalized anxiety disorder") and adherence to ethical standards (e.g., "Your feelings are very reasonable, and we can discuss coping strategies together").
[0048] Step 2: Select a suitable base model, conduct pre-evaluation and performance testing on the base model, fine-tune the base model based on the real multi-turn dialogue data collected in Step 1, and score the responses of the fine-tuned model through third-party scoring and manual verification until the base model's average score on the three scoring labels is ≥4 points, making the fine-tuned base model more empathetic.
[0049] The fine-tuned model is derived from the base model by fine-tuning it using knowledge from a specific domain. Generally speaking, the fine-tuned model retains the expressive power of the base model while also possessing the conversational style of a psychotherapist. However, at this stage, the fine-tuned model only has conversational functionality; it does not embed scales, generate standardized treatment plans, or have access to professional knowledge bases for retrieval. After a complete system is built (i.e., fine-tuned model + RAG, etc.), further learning is required to enable the fine-tuned model to use other modules, ultimately becoming a fully functional system.
[0050] Step 21: Combining the needs of Chinese psychological counseling scenarios and technology adaptability, select the base model based on the set constraints, including language adaptability, memory usage, and inference efficiency.
[0051] The specific constraints of language adaptability are: the application scenarios of this invention are mainly Chinese contexts, and its performance in Chinese semantic understanding and emotion recognition should be better than that of English models of the same scale, and it should be able to better capture the implicit emotional expressions of Chinese users (such as the emotions conveyed through interjections such as "ai" and "ba").
[0052] The specific constraints on GPU memory usage are: clearly defining the GPU memory limit (e.g., 24GB / 40GB / 80GB) of the target deployment environment (e.g., local server, cloud instance). A balance needs to be found between model capabilities and hardware costs, selecting models with different parameter levels such as 7B (7 billion), 13B, and 34B for comparative testing. Models supporting quantization techniques (e.g., GPTQ, AWQ, GGUF) should be given priority. Using quantization schemes such as INT4 and FP8 can reduce model memory usage by 50%-75%.
[0053] The specific constraints on inference efficiency are: psychological counseling dialogues require high interactivity, and users cannot tolerate long waiting times. A threshold for end-to-end response latency (e.g., 200ms-500ms) must be set to evaluate the model's generation speed (tokens / second) on the target hardware.
[0054] Step 22: Base Model Acquisition and Local Deployment. Based on existing models, such as ChatGLM, Wenxin Yiyan, and Tongyi Qianwen, obtain complete model files through official channels like Huggingface, including configuration files, weight files, and word segmenter files. Download the model to your local server, configure the environment according to the documentation, and run it using the preset program to ensure that no parts of the model are missing.
[0055] Step 23: Base Model Pre-evaluation and Performance Benchmarking. Before fine-tuning, a psychological counseling capability benchmarking test is conducted on the original model to identify initial performance shortcomings and provide a reference for fine-tuning goals.
[0056] Step 24: Base Model Adaptation Adjustment. Considering the specificities of psychological counseling scenarios, the base model undergoes preprocessing adjustments. The input format is standardized to a "system prompt + multi-turn dialogue" structure. The system prompt is fixed as: "You are a professional Chinese psychological counselor. You need to patiently listen to the user's concerns, understand their emotions and provide empathetic responses, guide the dialogue deeper through questioning, and provide professional and ethical advice. Avoid using templated statements; responses should be natural and fluent." This ensures the base model maintains a consistent role positioning during fine-tuning and reasoning.
[0057] Step 25: The fine-tuning process consists of three stages. The first stage focuses on learning the two labels of empathy and guidance. The second stage balances the weights of the three labels of empathy, guidance, and professionalism. The third stage retrains the low-scoring samples based on the feedback from the validation set.
[0058] Specifically, in the first stage (rounds 1-3), higher weights are assigned to the two labels in the loss function (40% each), and professionalism accounts for 20%; in the second stage (rounds 4-6), the weights of the three labels are balanced (33.3% each) to enhance comprehensive capabilities; in the third stage (rounds 7-8), based on the feedback from the validation set, targeted retraining is performed on low-scoring samples (≤2 points for a certain label) to improve weaknesses.
[0059] Step 26: Third-party scoring and human verification. A large language model, such as DeepSeek, is used as an automatic scoring tool to rate the responses of the fine-tuned model based on "empathy, guidance, and professionalism" (1-5 points). The mean score and standard deviation are calculated. Using third-party scoring can shorten scoring time and improve training efficiency.
[0060] The expert team in step 13 then manually reviews the scoring results, focusing on checking the consistency between the automatic scoring and the human judgment (e.g., DeepSeek's "professionalism" scoring deviation > 1 point for samples). The final result is "automatic score × 0.7 + human score × 0.3".
[0061] Step 27: Iterative optimization of the model. For dimensions with low scores in the evaluation (such as the average score of "guidance" for a certain type of question being <3 points), identify the reasons and make modifications.
[0062] Step 28: Repeat steps 1 to 2 until the model's average score on all three categories of indicators is ≥4.
[0063] Step 3: Dynamic scale embedding technology. During the dialogue between the user and the intelligent counseling system, matching psychological scales are dynamically embedded according to the user's chat rhythm and content, and the user is guided to fill in the scale.
[0064] Step 31: User Chat Rhythm Analysis. By monitoring indicators such as user input speed, pause time, and sentence length, the chat rhythm with the user is comprehensively analyzed. This involves extracting features from the user's input, feeding these features into a scale decision engine, which then determines whether the current moment is appropriate for embedding the scale.
[0065] Step 32: User Chat Content Analysis. This invention utilizes deep learning algorithms, such as word vector-based feature extraction algorithms, to perform semantic analysis and sentiment recognition on user chat content, extracting keywords and sentiment tendencies. Through in-depth analysis of chat content, it further identifies the mental health issues that users are currently concerned about, such as stress management, emotion regulation, and interpersonal relationships.
[0066] The innovation of this invention lies mainly in the innovation of model structure and processing method. It uses the model and these modules to accurately and comprehensively grasp the rhythm of user consultation, and proactively provides scales to supplement the required information when appropriate, and can also provide customized solutions.
[0067] Step 33: Dynamically Matching Psychological Scales. Based on the user's chat rhythm and content analysis results, the system dynamically selects the psychological scale that best matches the user's current state and needs from a pre-set psychological scale library. The scale library includes various types of professional psychological scales, such as the Self-Rating Anxiety Scale (SAS), the Self-Rating Depression Scale (SDS), and the Perceived Stress Scale (PSS), ensuring comprehensive coverage of the user's potential mental health needs. The purpose of dynamically matching the psychological scale library is to: proactively collect the necessary user information to improve the user profile, rather than passively waiting for the user to provide information, and seamlessly insert scales, ensuring a smooth and consistent psychological counseling experience for the user.
[0068] Step 34: Embed the scale to guide completion. Embed the psychological scale matched in Step 33 in a natural and user-friendly manner within the chat interface, avoiding interruptions to the user's chat experience.
[0069] The system uses intelligent prompts to invite users to fill out a questionnaire, such as, "It seems you've been feeling a bit anxious lately. Could you take a few minutes to fill out this anxiety self-assessment questionnaire so we can better understand your situation and provide assistance?" Step 35: Real-time Feedback and Adjustment. After the user completes the questionnaire, the system immediately scores and analyzes the results to help construct a complete user profile, which serves as the basis for subsequent dialogue. The system then provides feedback to the user at an appropriate time, offering preliminary mental health advice.
[0070] Based on user feedback and further conversations, the types of scales and guidance strategies embedded later are dynamically adjusted to ensure the continuity and accuracy of the assessment process.
[0071] like Figure 3 The diagram shown is a framework diagram of the dynamic scale embedding of this invention. A summary description of the complete process of dynamically embedding the scale, in conjunction with the accompanying drawings, is provided below: feature extraction, dynamic scale decision engine, decision state determination, scale embedding, and continued natural dialogue.
[0072] Feature extraction: Acquire the user's multimodal input, including text and speech, and merge the speech modality into the text modality. Use word vector-based feature extraction algorithms to complete the sentiment analysis and feature extraction of the user's dialogue information.
[0073] Dynamic scale decision engine: The extracted feature vectors are fed into the dynamic scale decision engine to calculate the scale mutual information value.
[0074] Decision state determination: Determine whether dynamic embedding of the scale is needed based on the comparison result between the mutual information value and the mutual information threshold.
[0075] Scale embedding: If a scale needs to be dynamically embedded, the scale items are matched and selected based on the dialogue history and embedded into the dialogue for the user to fill in.
[0076] Continue natural dialogue: After the form is completed, the model updates the user profile and provides more targeted psychological counseling.
[0077] In a dynamic scale decision engine, the Q value is the expected cumulative reward, which can be expressed by the following formula: ; Q(s, a) represents the expected cumulative discounted reward for performing action a in state s. E refers to the expected value, because the environment (user)'s reaction has a certain degree of randomness, so the Q value is a probability average. This is the discount factor (range 0-1), which determines how much importance we place on future rewards. The closer it is to 0, the more "short-sighted" the engine is, only caring about immediate rewards; the closer it is to 1, the more "far-sighted" the engine is, sacrificing short-term gains for long-term benefits. In this patent, the system in each dialogue state s... t The algorithm calculates the Q-values of all possible actions (no embedding, embedding PHQ-9, embedding GAD-7, etc.) and then selects the action with the highest Q-value, as it is considered the most advantageous choice in the long run. For the multi-objective reward function R... t Quantifying engine actions t The quality of [something] needs to be considered in order to balance clinical effectiveness and user experience.
[0078] Dynamic scale embedding technology is used in both the training and consultation phases. The system training uses all modules, and essentially the system training is a process of extensive consultation. During consultation, the dynamic scale decision engine monitors in real time whether the scale needs to be inserted.
[0079] Step 4: Fine-tuning the collaborative reasoning between the model and the RAG module. The fine-tuning model continuously builds user profiles through dialogue with the user. First, it conducts a preliminary analysis of the user's psychological state, activates the RAG module to retrieve information related to the current task from the knowledge base, and integrates the retrieved information and the user's dialogue into the information fusion unit. Then, it is passed to the fine-tuning model so that the fine-tuning model can refer to professional psychological counseling experience to provide a comprehensive psychological counseling answer. The reasoning process incorporates an embedded scale triggering mechanism and a dynamic weight adjustment mechanism.
[0080] Step 41: Design the collaborative reasoning process. First, start the finely tuned model that has been meticulously trained on a specific dataset, possessing strong contextual understanding and generation capabilities. After building a basic user profile, activate the RAG module to retrieve information relevant to the current task from an external knowledge base. The external knowledge base refers to a professional knowledge base or other relevant knowledge base.
[0081] The professional knowledge base and the scale knowledge base are two independent knowledge bases with different query logics. In the professional knowledge base, each user's statement is compared with the knowledge in the base to determine whether there is any professional knowledge useful for the current situation. The scale knowledge base (or scale question bank) first determines whether it is the right time to insert the scale (based on a dynamic scale decision engine). After confirming that the scale should be inserted, it then selects scale questions from the scale question bank based on the context to achieve customized scales and seamless consultation.
[0082] Step 42: Collaborative reasoning mechanism. First, the fine-tuning model performs preliminary understanding and analysis based on the psychological questions raised by the user, identifying the user's emotional state and consultation intention. Then, the retrieval submodule of the RAG module retrieves relevant data from the knowledge base based on the preliminary analysis results of the fine-tuning model and feeds it back to the information fusion unit along with the user's psychological questions. The information fusion unit inserts the retrieved knowledge into the user's questions as annotations and then transmits it to the fine-tuning model to generate a comprehensive psychological counseling question and answer.
[0083] Based on the collaborative reasoning mechanism, the answers from the fine-tuned model include both model-based reasoning results and support from a professional knowledge base.
[0084] Step 43: Embed the scale trigger mechanism. Unlike fixed-node trigger assessments, the system forces users to fill out the scale for the first time. The trigger timing is determined through semantic understanding. For example, if a user mentions "insomnia, low mood, and lack of interest in things" three times in a row, a matching assessment scale will be automatically pushed. Based on the assessment results (such as an SAS score ≥ 60 points), a personalized treatment plan will be generated, such as "basic cognitive behavioral therapy exercises + suggestions for exercise twice a week". This upgrades the consultation system from passive companionship to active intervention.
[0085] Step 44: Dynamic weight adjustment mechanism, dynamically adjust the weights of professional knowledge and fine-tuning model according to the dialogue stage.
[0086] Specifically, in the initial stage (rounds 1-2), knowledge accounts for 30% of the weight, and fine-tuning the model accounts for 70% (prioritizing empathy and guidance). In the in-depth stage (rounds 3 and above), the knowledge weight increases to 50% (increasing the proportion of professional knowledge when users begin to discuss specific issues). In crisis intervention scenarios, knowledge accounts for 80% (prioritizing the use of standardized language from crisis intervention guidelines). Collaborative reasoning is implemented during the model building stage.
[0087] Figure 4 It is a collaborative reasoning flowchart, such as Figure 4 As shown, the collaborative reasoning framework mainly includes: user input of consultation information, dual-path information processing, central decision-making, and output system response. First, the user inputs the consultation question. The system will split the user's dialogue content into two paths: one path is sent to the RAG knowledge base to match the professional consultation background knowledge corresponding to the task, and the other path is sent to the fine-tuning model for sentiment analysis (at this time, only part of the structure of the fine-tuning model is used). The sentiment analysis results and professional background knowledge are then handed over to the central decision-making neural analysis to determine whether dynamic scale embedding is needed.
[0088] If dynamic scale embedding is not performed, the data is passed to the information fusion unit, which integrates professional knowledge, emotions, and user input questions and submits them to the fine-tuning model. The fine-tuning model then generates the final response and outputs it to the user.
[0089] If dynamic scale embedding is performed, the process switches to the dynamic scale embedding framework for further scale matching. Finally, the scale items are integrated into a single table, and a response is generated for the user to fill out.
[0090] The dynamic weight calculation function in the central decision-making process is responsible for analyzing the current dialogue state and determining the ratio of freely generated knowledge to knowledge base references. Its output is a knowledge weight between 0 and 1. The formula is defined as follows: ; in, It is the knowledge weight, which is the proportion of content from the RAG knowledge base in the final response; is the Sigmoid function, which can compress any value to the range (0,1), making the weight changes smooth and stable; g(t) is the turn factor, a function that increases with time (dialogue turns), so that as the dialogue progresses, the system will tend to use more expertise; S is the crisis signal score, which is derived by the system in real time from analyzing user input.
[0091] For example, if a user mentions the word "suicide," S=1.0; mentioning "insomnia," S=0.3; and not mentioning any keywords, S=0. K represents the question's professionalism, calculated by assessing the overall similarity between the user's question and the professional knowledge base. The more professional and specific the user's question, the higher the K value. w1, w2, and w3 are preset hyperparameters that determine which of the three factors—"round," "crisis signal," and "professionalism"—has a greater impact on the weighting.
[0092] Step 5: Standardized treatment plan embedding technology. First, the model is fine-tuned to perform real-time analysis of user sentiment based on the dialogue and to complete the user profile. The decision engine and scale analysis are used to verify whether the new dialogue information is consistent with historical data. At the same time, user data is mapped to multi-dimensional assessment vectors by combining the scale filled in by the user. Then, the RAG module is used to retrieve matching treatment plans from the professional knowledge base. Based on the multi-dimensional assessment vectors, the most relevant treatment plans and assistance strategies are determined. Finally, the model is fine-tuned to generate standardized treatment plans based on the completed user profile and the context of the dialogue.
[0093] Step 51: Real-time User Sentiment Analysis. First, the user's multiple modal inputs (including text and speech) are modally merged. This involves combining the speech with the text content after it passes through the encoding layer before transmitting them together, thus unifying the modality. A fine-tuning model is then used to analyze the user's dialogue in real time, identifying basic sentiment categories (e.g., positive, negative, neutral) and specific sentiments (e.g., anxiety, depression, anger). Then, combining the sentiment dictionary and the fine-tuning model, a sentiment intensity score is calculated, and sentiment fluctuation trends are tracked. The consultation system records the user's sentiment changes under different topics to identify trigger points. Finally, a user sentiment report is generated based on the analysis results, including the dominant sentiment, peak intensity, and sentiment stability indicators. The user sentiment report is used for user profile completion in Step 52.
[0094] Step 52: User profile completion. User profiles are stored in the form of a knowledge graph, with nodes including user attributes, psychological states, and behavioral relationships. After each conversation, the consultation system updates the nodes using a graph algorithm based on the user's sentiment report and fills in missing values (inference-based completion of user background).
[0095] Furthermore, the system verifies the consistency between new information and historical data through decision engine and scale analysis to avoid contradictions. If a user previously mentioned "stable employment" but later says "unemployed," the system will mark the contradiction and initiate a clarification dialogue. The completed user profile includes static attributes (age, gender, etc.) and dynamic attributes (current psychological state, problem severity, etc.).
[0096] Step 53: Standardize user information in multiple dimensions. Based on the information from the questionnaires filled out by users and with reference to authoritative psychological standards, define multi-dimensional evaluation indicators and map user data onto these evaluation dimensions.
[0097] Step 54: Embedding standardized treatment plans. First, the RAG module is used to retrieve matching treatment plans from professional knowledge bases (such as psychology textbooks and clinical guidelines). Based on the user's multidimensional evaluation vector in step 63, the most relevant treatment plan is found through similarity calculation and an assistance strategy is specified. Then, the model is fine-tuned to personalize the retrieved assistance strategy and generate standardized treatment plans based on the completed user profile and the context of the conversation.
[0098] The assistance strategies are transformed into natural conversational text through a fine-tuned model to ensure fluency. The assistance strategies are embedded in the form of suggestions, such as "Based on your situation, I suggest trying the following relaxation exercises...". Simultaneously, the system generates standardized treatment plans for users to refer to.
[0099] Figure 5 This is a flowchart of the standardized treatment plan interaction process. First, the person seeking help undergoes a mental health assessment. If potential risks are detected or external tools are needed, a psychological testing scale is provided for further assessment. Then, an assistance strategy and a standardized treatment plan are generated. At the same time, the system predicts the person seeking help's reaction. If there is risk information, that is, information that may have a negative impact on the person seeking help, the system will feed back to the psychological counseling robot to regenerate the standardized treatment plan.
[0100] Standardized treatment plans are not necessarily provided only after the conclusion of psychological counseling. They can also be offered during the conversation, once sufficient information has been gathered or the user requests help. Standardized treatment plans are not the final outcome of the conversation, but rather an output plan delivered midway through. Similar to scales, they are presented to the user in a suggestive manner based on their needs or the completeness of their profile. Whether the conversation ends depends on the user's desire to continue.
[0101] Step 6: System setup and operation. The professional psychological knowledge text database is transformed into a vector database and its retrieval engine is configured. A knowledge-dialogue fusion mechanism is designed to perform secondary filtering of knowledge fragments. Finally, the filtered knowledge fragments are converted into contextual cues that the fine-tuned model can recognize. During training, the model learns to call the RAG module for collaborative reasoning and learns the embedding timing of psychological scales by updating the mutual information threshold.
[0102] Step 61: Scale knowledge base construction. Select a scale knowledge base and vectorize the scales within it. Based on the vectorized representation, construct a dynamic embedded scale retrieval system.
[0103] Choose a comprehensive knowledge base containing various scales and covering a wide range of fields. The selected knowledge base should possess high authority and reliability to ensure the effectiveness of subsequent applications.
[0104] The selected scale is vectorized, that is, the text information in the scale is converted into a vector representation in a high-dimensional space, which facilitates subsequent retrieval and analysis.
[0105] A dynamically embedded scale retrieval system is constructed, utilizing vectorized scale data for efficient searching. Dynamic embedding technology can adjust the retrieval strategy in real time based on user-input query information, improving the flexibility and adaptability of the retrieval process. Through dynamic embedding, the system can better capture user intent and enhance retrieval results.
[0106] Step 62: Construct a psychology knowledge base. Determine the sources of knowledge base content based on expert advice, and select authoritative textbooks or clinical guidelines as the data sources for the knowledge base.
[0107] We communicated with experts to determine the sources of the knowledge base content, selecting from authoritative textbooks and clinical guidelines in the psychology industry, such as: core chapters of Chinese textbooks such as "Theory and Practice of Psychological Counseling and Treatment" and "Introduction to Clinical Psychology" (extracting the "Intervention Methods" and "Case Analysis" modules); and diagnostic criteria and intervention procedures from "Guidelines for Clinical Psychotherapy of the Chinese Association for Mental Health" and "Guidelines for the Prevention and Treatment of Depression".
[0108] Step 63: Build the vector database and configure the retrieval engine. Based on RAG technology, a vector database is used to store professional knowledge base data. By fine-tuning the model, knowledge fragments in the professional knowledge base are converted into vectors of a set dimension, generating a vector index. The retrieval engine and the vector database are deeply integrated because database queries require a query basis, while the overall query is completed by the retrieval engine. The retrieval engine configuration essentially refers to choosing which similarity analysis method to use as the query basis, how many data points to retrieve each time, and what similarity threshold is considered relevant (see Step 64). Common methods include Euclidean distance and cosine similarity calculation.
[0109] Step 64: Configure search parameters. Set the TopK value to 5, which means returning the 5 most relevant search results. Set the similarity threshold to 0.7, which means that results below this threshold are considered as having no relevant knowledge and will not be returned.
[0110] Step 65: Design a knowledge-dialogue fusion mechanism and build a knowledge filter to perform secondary filtering on the five most relevant knowledge fragments retrieved, removing content that conflicts with the current dialogue context. For example, if the user has stated that they have "undergone cognitive behavioral therapy," then the filter will include fragments containing "suggest trying cognitive behavioral therapy."
[0111] Step 66: Design a knowledge injection template to transform the knowledge fragments selected in Step 65 into contextual cues that the base model can understand and recognize, and provide the scale at the appropriate time.
[0112] Step 6 involves simulating several dialogues after the system is built. This allows the fine-tuned model to become familiar with the other modules' assistance in completing the psychological counseling process. Through continuous psychological counseling, using the user's emotions as a benchmark, the model updates its decision-making parameters for self-improvement. Steps 61-63 pertain to system construction, while steps 64-66 explain the source and usage logic of some parameters.
[0113] Step 7: Continuous learning and iterative optimization of the system.
[0114] Step 7.1: After the initial system setup, steps 1-2 need to be repeated to update the system decision engines, except for the fine-tuning model.
[0115] Step 7.2: Entering the psychological counseling stage, the system will use the user's emotional analysis as a standard to further update its parameters and continuously learn and improve.
[0116] Through the above technical solutions, the present invention has achieved significant progress and beneficial effects in the following four aspects.
[0117] First, the quality of the psychological counseling language model was improved (fluency, empathy, consistency, guidance, safety, and professionalism). The original ChatGLM3-6B model, which had not been fine-tuned with specific psychological counseling data, was selected as the baseline. A test set of 1000 previously unseen multi-turn psychological counseling dialogues was reserved from the constructed dataset. A combination of manual and automated evaluation was used. Manual evaluation: Three senior psychological counselors were hired to conduct double-blind scoring (1-5 points) on the outputs of the baseline and experimental models on the test set, with scoring dimensions of empathy (Em), guidance (Gu), and professionalism (Pr). Automated evaluation: DeepSeek-v3 was used as the automated scoring tool to score the fluency, consistency, and safety of the responses (1-5 points). The experimental results are shown in Table 1. It can be seen that the evaluation values of the method in this invention are higher than those of the manual and automated evaluation methods, indicating a performance improvement.
[0118] Table 1. Experimental results for the six evaluation dimensions
[0119] Secondly, compared to traditional parameter fine-tuning, LoRA reduces memory usage and training time (baseline method). On a unified RTX3090 (24G) server, the same dataset was used to train for 20 epochs. The training time and memory usage were recorded during model training. The model was then retrained using LoRA for comparison. The results are shown in Table 2.
[0120] Table 2 Comparison of experimental results on memory usage and training time
[0121] Third, the model inference efficiency is significantly improved (baseline model: ChatGLM3-6B), as shown in Table 3.
[0122] Table 3 Comparison of experimental results on memory usage and training time
[0123] Fourth, the output format is diversified. Traditional psychological counseling robots can only communicate through text, while the method of this invention can accept both text and voice conversations. At the same time, it can dynamically embed questionnaires for users to fill in and generate personalized and standardized treatment plans in real time.
[0124] It should be noted that the specific embodiments described above are exemplary, and those skilled in the art can devise various solutions inspired by the disclosure of this invention. These solutions all fall within the scope of this invention and its protection. Those skilled in the art should understand that this specification and its accompanying drawings are illustrative and not intended to limit the scope of the claims. The scope of protection of this invention is defined by the claims and their equivalents.
Claims
1. An intelligent psychological counseling method based on dynamic scale embedding and dialogue analysis, characterized in that, The method proposes dynamic scale embedding technology, standardized treatment plan embedding technology, and collaborative reasoning mechanism. The dynamic scale embedding technology analyzes the user's chat rhythm and chat content during real-time dialogue and selects an appropriate time to dynamically embed the scale. The standardized treatment plan embedding technology uses a dynamic decision engine to analyze the conversation rhythm in real time and update the user profile in real time based on the user's completed questionnaires, providing a practical and standardized treatment plan at the appropriate time; based on the collaborative reasoning mechanism of the fine-tuning model and the RAG module, when the user asks a question, the fine-tuning model performs preliminary understanding and analysis, the RAG module retrieves relevant knowledge and feeds it back to the fine-tuning model to generate a comprehensive answer, specifically including: Step 1: Investigate the current status of the psychological counseling medical industry and identify high-frequency application scenarios; design an initial sample data template; obtain real psychological counseling dialogue data and perform anonymization processing; have experts manually screen the obtained real dialogue data to select dialogue data that reaches the preset dialogue rounds, and manually mark the scoring and detailed basis; at the same time, organize the dialogue content according to the initial sample data template and record the scale data used in the counseling process. Step 2: Select a suitable base model, conduct pre-evaluation and performance testing on the base model, fine-tune the base model using real multi-turn dialogue data collected in Step 1, and score the responses of the fine-tuned model through third-party scoring and manual verification until the base model's average score on the three scoring labels is ≥4. Step 3: Dynamic scale embedding technology. A scale knowledge base is built and embedded into a dynamic scale retrieval system. During the user's dialogue with the intelligent consultation system, the user's chat rhythm and content are analyzed. The decision engine determines whether it is the appropriate time to embed the scale, dynamically embeds the matching psychological scale, and guides the user to fill in the scale. The dynamic scale embedding process includes: feature extraction, dynamic scale decision engine, decision state determination, scale embedding, and continued natural dialogue. Step 4: Fine-tuning the collaborative reasoning mechanism between the model and the RAG module. The fine-tuning model continuously builds user profiles through dialogue with users. First, it conducts a preliminary analysis of the user's psychological state, activates the RAG module to retrieve information related to the current task from the knowledge base, and integrates the retrieved information and the user's dialogue into the information fusion unit. Then, it is passed to the fine-tuning model so that the fine-tuning model can refer to professional psychological counseling experience to give a comprehensive psychological counseling answer. The reasoning process incorporates an embedded scale triggering mechanism and a dynamic weight adjustment mechanism. Step 5: Standardized treatment plan embedding technology. First, the model is fine-tuned to perform real-time analysis of user sentiment based on the dialogue and to complete the user profile. The decision engine and the user-filled scale are used to verify whether the new dialogue information is consistent with historical data. At the same time, the user data is mapped to a multi-dimensional assessment vector based on the user-filled scale. Then, the RAG module is used to retrieve matching treatment plans from the professional knowledge base. Based on the multi-dimensional assessment vector, the most relevant treatment plan and assistance strategy are determined. Finally, the model is fine-tuned to generate a standardized treatment plan based on the completed user profile and the context of the dialogue. Step 6: Training and learning of the overall system, transforming the professional psychological knowledge text database into a vector database and configuring its retrieval engine, designing a knowledge-dialogue fusion mechanism for secondary filtering of knowledge fragments, converting the filtered knowledge fragments into contextual cues that the fine-tuned model can recognize, learning to call the RAG module for collaborative reasoning during training, and learning the embedding timing of psychological scales by updating the mutual information threshold. Step 7: System performance evaluation and iterative optimization.
2. The consultation method as described in claim 1, characterized in that, Step 4, the collaborative reasoning mechanism's processing flow, specifically includes: Step 41: Design the collaborative reasoning process. First, start the fine-tuned model that has been finely trained on a specific dataset and has strong context understanding and generation capabilities. After building a basic user profile, activate the RAG module to retrieve information related to the current task from an external knowledge base. Step 42: Collaborative Reasoning Mechanism. First, the fine-tuning model performs preliminary understanding and analysis based on the psychological questions raised by the user, identifying the user's emotional state and consultation intentions. Then, the retrieval submodule of the RAG module retrieves relevant data from the knowledge base based on the preliminary analysis results of the fine-tuning model and feeds it back to the information fusion unit along with the user's psychological questions. The information fusion unit inserts the retrieved knowledge into the user's questions as annotations and then transmits it to the fine-tuning model to generate a comprehensive psychological consultation Q&A. Step 43: Embed the scale triggering mechanism, determine the triggering time through semantic understanding, automatically push the matching assessment scale, and generate personalized treatment plans based on the assessment results, so as to upgrade the consultation system from passive companionship to active intervention; Step 44: Dynamic weight adjustment mechanism, dynamically adjust the weights of professional knowledge and fine-tuning model according to the dialogue stage.
3. The consultation method as described in claim 2, characterized in that, Step 5, the process of embedding standardized treatment protocols, specifically includes: Step 51: Real-time user sentiment analysis. First, the modal data of the user's text and voice are merged. A fine-tuning model is used to analyze the user's dialogue in real time to identify basic sentiment categories and specific sentiments. Then, the sentiment dictionary and the fine-tuning model are combined to calculate the sentiment intensity score and track the sentiment fluctuation trend. The user's sentiment changes under different topics are recorded to identify trigger points. Finally, a user sentiment report is generated based on the analysis results. Step 52: User profile completion. The user profile is stored in the form of a knowledge graph. The nodes include user attributes, psychological state and behavioral relationships. After each conversation, the nodes are updated and the user profile is completed based on the user sentiment report using a graph algorithm, and missing values are filled in. Step 53: Standardize user information in multiple dimensions. Based on the information from the questionnaires filled out by the users and with reference to authoritative psychological standards, define multi-dimensional evaluation indicators and map the user data onto the evaluation dimensions to obtain a multi-dimensional evaluation vector. Step 54: Embedding standardized treatment plans. First, the RAG module is used to retrieve matching treatment plans from the professional knowledge base. Based on the multidimensional evaluation vector, the most relevant treatment plan is found through similarity calculation and an assistance strategy is specified. Then, the model is fine-tuned to personalize the retrieved assistance strategy and generate standardized treatment plans based on the completed user profile and the context of the dialogue.