Multi-agent interpretable text mental health level assessment method and system

Through multi-agent collaboration and multi-dimensional feedback mechanisms, the agent model of the mental health assessment system is optimized, which solves the problem of lack of interpretability and flexibility in the existing system, and achieves higher evaluation accuracy and user experience.

CN119626534AInactive Publication Date: 2025-03-14GUANGDONG POWER GRID CO LTD +1

Patent Information

Application Number
CN202411659081.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-20
Publication Date
2025-03-14
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing mental health assessment system relies on a single model, lacks interpretability, has low confidence, poor flexibility, and is unable to fully evaluate the model's response and evaluation results.

Method used

Multi-agent collaboration and multi-dimensional feedback mechanism are adopted to train multi-domain data sets and psychological dialogue evaluation data sets, optimize the agent model, generate multi-dimensional feedback data sets, train the effect evaluation model, and optimize the model performance.

Benefits of technology

It improves the interpretability, confidence and flexibility of the mental health rating assessment system, enhances the universality and robustness of the model, and ensures the accuracy and interpretability of the evaluation results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119626534A_ABST
    Figure CN119626534A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-agent interpretable text psychological health level assessment method and system, and the method comprises the steps: training an original agent model according to a multi-field data set and a psychological dialogue assessment data set, and obtaining a dialogue reference model and an assessment reference model; according to the two reference models, respectively processing the user question data and the multi-round dialogue data to obtain a multi-dimensional dialogue feedback data set and an evaluation feedback data set; according to the multi-dimensional dialogue feedback data set and the evaluation feedback data set, training the two reference models to obtain a dialogue effect evaluation model and an evaluation effect evaluation model; according to the two evaluation models and the psychological dialogue evaluation data set, training the two reference models to obtain a target dialogue model and a target evaluation model; according to the target dialogue model and the target evaluation model, mental health level evaluation is completed. According to the invention, through the multi-dimensional feedback mechanism training model and the cooperative work of multiple models, the interpretability and confidence of the psychological health assessment system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of mental health assessment, and in particular relates to a multi-agent interpretable text mental health level assessment method and system. Background Art

[0002] With the development of artificial intelligence and machine learning technologies, automated mental health assessment systems have gradually emerged. These systems can quickly and efficiently make preliminary assessments of mental health status by analyzing big data and applying natural language processing technology.

[0003] However, most existing health assessment systems rely on a single model and lack the ability to provide explainable assessment results. They have low confidence levels and poor flexibility. If more mental health level assessment indicators are introduced in the future, the question-and-answer effect may deteriorate. In addition, there are deficiencies in the multi-dimensional feedback mechanism, making it impossible to fully evaluate the model's responses and assessment results. Summary of the invention

[0004] In response to the shortcomings of the existing technology, the present application provides a multi-agent interpretable text mental health level assessment method and system, which improves the interpretability, confidence and flexibility of the mental health level assessment system through multi-agent collaboration and multi-dimensional feedback mechanism.

[0005] To achieve the above objectives, in a first aspect, the present invention provides a multi-agent interpretable text mental health level assessment method, comprising:

[0006] According to the multi-domain data set, a preset original intelligent agent model is trained to obtain a first intelligent agent model and a second intelligent agent model;

[0007] According to the psychological dialogue evaluation data set, respectively optimizing the first agent model and the second agent model to obtain a dialogue benchmark model and an evaluation benchmark model;

[0008] According to the dialogue benchmark model, a number of user question data are processed to obtain a multi-dimensional dialogue feedback data set; according to the evaluation benchmark model, a number of multi-round dialogue data are processed to obtain a multi-dimensional evaluation feedback data set;

[0009] According to the multi-dimensional dialogue feedback data set, the dialogue benchmark model is trained to obtain a dialogue effect evaluation model; according to the multi-dimensional evaluation feedback data set, the evaluation benchmark model is trained to obtain an evaluation effect evaluation model;

[0010] According to the dialogue effect evaluation model and the psychological dialogue evaluation data set, the dialogue benchmark model is trained to obtain a target dialogue model; according to the evaluation effect evaluation model and the psychological dialogue evaluation data set, the evaluation benchmark model is trained to obtain a target evaluation model;

[0011] Complete the mental health level assessment based on the target dialogue model and target assessment model.

[0012] Compared with the prior art, the embodiments of the present application have the following beneficial effects: by collecting multi-domain data sets, it is ensured that the model can learn from rich domain knowledge, and through iterative training, the model performance is gradually optimized to improve the versatility and robustness of the model; by constructing a psychological dialogue evaluation data set, it is ensured that the model can learn from real mental health evaluation scenarios, improve the practicality and accuracy of the model, optimize the first agent model and the second agent model respectively, obtain the dialogue benchmark model and the evaluation benchmark model, and lay the foundation for subsequent multi-dimensional feedback and reinforcement learning optimization; by processing user question data and multi-round dialogue data, a multi-dimensional dialogue feedback data set and a multi-dimensional evaluation feedback data set are generated, which can evaluate the model feedback from multiple angles. The quality of the complex and evaluation is helpful to discover the deficiencies of the model and improve the dialogue effect and evaluation effect of the model. Based on the multi-dimensional dialogue feedback dataset and the multi-dimensional evaluation feedback dataset, the dialogue baseline model and the evaluation baseline model are trained respectively to obtain the dialogue effect evaluation model and the evaluation effect evaluation model, thereby further optimizing the performance of the model. According to the dialogue effect evaluation model, the evaluation effect evaluation model and the psychological dialogue evaluation dataset, the dialogue baseline model and the evaluation baseline model are trained to obtain the target dialogue model and the target evaluation model, thereby further improving the dialogue effect and evaluation effect of the model. By collaboratively using the target dialogue model and the target evaluation model, the multi-faceted information of the user is captured more comprehensively, thereby improving the interpretability and accuracy of the evaluation results.

[0013] In some embodiments of the first aspect of the present application, the step of training a preset original agent model according to a multi-domain dataset to obtain a first agent model and a second agent model includes:

[0014] Collect knowledge documents in multiple fields and perform preprocessing to obtain multi-field data sets; wherein the preprocessing includes any one or more combinations of the following: noise processing, formatting processing and classification processing;

[0015] According to the multi-domain data set, the original agent model is iteratively trained to obtain a first agent model, and in each iterative training, the multi-domain data set is preprocessed according to the text input module of the original agent model to obtain a text embedding matrix; according to the encoder of the original agent model, the text embedding matrix is ​​processed to obtain a context semantic matrix and a history response matrix; according to the preset decoder of the original agent model, the context semantic matrix and the history response matrix are processed to obtain a complete text output;

[0016] The first agent model is copied to obtain the second agent model.

[0017] Compared with the prior art, the above embodiment has the following beneficial effects: by collecting and preprocessing multi-domain data sets, it is ensured that the model can learn from rich domain knowledge and improve the versatility and robustness of the model. Preprocessing ensures the quality and consistency of the data. Through iterative training, the model performance is gradually optimized, and finally two intelligent agent models with universal capabilities are obtained.

[0018] In some embodiments of the first aspect of the present application, optimizing the first agent model and the second agent model respectively according to the psychological dialogue evaluation dataset to obtain a dialogue benchmark model and an evaluation benchmark model includes:

[0019] Collecting a data set in the field of mental health level assessment, and constructing a psychological dialogue assessment data set based on the data set in the field of mental health level assessment; wherein the psychological dialogue assessment data set includes: historical question-and-answer dialogue data, doctor response data, and health assessment result data;

[0020] Inputting the historical question-and-answer dialogue data into the first agent model, and correcting the generated target to the doctor's reply data corresponding to the historical question-and-answer dialogue data, and iteratively training to obtain the dialogue benchmark model;

[0021] The historical question-and-answer dialogue data is input into the second agent model, and the generated target is corrected to the health assessment result data corresponding to the historical question-and-answer dialogue data, and iterative training is performed to obtain the assessment benchmark model.

[0022] Compared with the prior art, the above embodiment has the following beneficial effects: by constructing a psychological dialogue evaluation data set, it is ensured that the model can learn from real mental health evaluation scenarios, thereby improving the practicality and accuracy of the model. The first agent model and the second agent model are optimized respectively to obtain a dialogue benchmark model and an evaluation benchmark model, laying the foundation for subsequent multi-dimensional feedback and reinforcement learning optimization.

[0023] In some embodiments of the first aspect of the present application, the step of processing a plurality of user question data according to the dialogue benchmark model to obtain a multi-dimensional dialogue feedback data set includes:

[0024] According to the dialogue benchmark model, each of the user question data is processed respectively to obtain a model response matrix; wherein the model response matrix includes response vectors composed of each user question data and each first model response corresponding to each user question data;

[0025] Dividing each reply vector in the model reply matrix according to a preset partitioning algorithm to obtain each first feedback comparison pair;

[0026] According to a preset psychology-related knowledge base, psychological assessment scale data and a first dimension comparison condition, each of the first feedback comparison pairs is processed to obtain a multi-dimensional dialogue feedback data set; wherein the first dimension comparison condition includes: an empathy dimension comparison condition, an understanding dimension comparison condition, an influence dimension comparison condition, an anthropomorphism dimension comparison condition, a reliability dimension comparison condition and a safety dimension comparison condition, and the multi-dimensional dialogue feedback data set includes the dimension values ​​of each of the first feedback comparison pairs under each of the first dimension comparison conditions.

[0027] Compared with the prior art, the above embodiment has the following beneficial effects: by processing user question data and generating a multi-dimensional dialogue feedback data set, the quality of the model response can be evaluated from multiple angles. This multi-dimensional feedback mechanism helps to discover the deficiencies of the model and improve the dialogue effect of the model.

[0028] In some embodiments of the first aspect of the present application, the step of processing a plurality of multi-round dialogue data according to the evaluation benchmark model to obtain a multi-dimensional evaluation feedback data set includes:

[0029] According to the evaluation benchmark model, each of the multi-round dialogue data is processed respectively to obtain an evaluation result matrix; wherein the evaluation result matrix includes evaluation vectors composed of each multi-round dialogue data and each first evaluation result corresponding to each multi-round dialogue data;

[0030] Dividing each evaluation vector in the evaluation result matrix according to a preset division algorithm to obtain each second feedback comparison pair;

[0031] According to the preset psychology-related knowledge base and psychological assessment scale data and the second dimension comparison condition, each second feedback comparison pair is processed to obtain a multi-dimensional evaluation feedback data set; wherein the second dimension comparison condition includes: effectiveness dimension comparison condition, reliability dimension comparison condition, objectivity dimension comparison condition, comprehensiveness dimension comparison condition and ethics dimension comparison condition, and the multi-dimensional evaluation feedback data set includes the dimension values ​​of each second feedback comparison pair under each second dimension comparison condition.

[0032] Compared with the prior art, the above embodiment has the following beneficial effects: by processing multi-round dialogue data and generating a multi-dimensional evaluation feedback data set, the evaluation results of the model can be evaluated from multiple angles. This multi-dimensional feedback mechanism helps to discover the deficiencies of the model in mental health assessment and improve the evaluation effect of the model.

[0033] In some embodiments of the first aspect of the present application, training the dialogue benchmark model according to the multi-dimensional dialogue feedback dataset to obtain a dialogue effect evaluation model includes:

[0034] The output layer of the dialogue benchmark model is replaced by 6 first linear layers, wherein the dimensions corresponding to each of the first linear layers are empathy dimension, understanding dimension, influence dimension, anthropomorphism dimension, reliability dimension and safety dimension respectively;

[0035] Constructing a first label mask vector for each first feedback comparison pair, and substituting the values ​​of each dimension in the multi-dimensional dialogue feedback dataset into the first label mask vector;

[0036] A first loss function is constructed according to the first label mask vector, and the dialogue benchmark model is trained according to the first loss function to obtain a dialogue effect evaluation model.

[0037] Compared with the prior art, the above embodiment has the following beneficial effects: by replacing the output layer of the dialogue benchmark model with multiple linear layers and constructing a multi-dimensional label mask vector, the model's response can be evaluated from multiple dimensions. This multi-dimensional evaluation mechanism helps to improve the dialogue effect of the model and ensure that the responses generated by the model are of high quality in multiple dimensions; the dialogue benchmark model is trained based on the multi-dimensional dialogue feedback dataset to obtain a dialogue effect evaluation model, thereby further optimizing the performance of the model.

[0038] In some embodiments of the first aspect of the present application, the step of training the evaluation benchmark model according to the multi-dimensional evaluation feedback data set to obtain the evaluation effect evaluation model includes:

[0039] The output layer of the evaluation benchmark model is replaced by five second linear layers, wherein the dimensions corresponding to each of the second linear layers are effectiveness dimension, reliability dimension, objectivity dimension, comprehensiveness dimension and ethics dimension respectively;

[0040] Constructing a second label mask vector for each second feedback comparison pair, and substituting the values ​​of each dimension in the multi-dimensional evaluation feedback data set into the second label mask vector;

[0041] According to the second label mask vector, a second loss function is constructed, and according to the second loss function, the evaluation benchmark model is trained to obtain an evaluation effect evaluation model.

[0042] Compared with the prior art, the above embodiment has the following beneficial effects: by replacing the output layer of the evaluation benchmark model with multiple linear layers and constructing a multi-dimensional label mask vector, the evaluation results of the model can be evaluated from multiple dimensions. This multi-dimensional evaluation mechanism helps to improve the evaluation effect of the model and ensure that the evaluation results generated by the model are of high quality in multiple dimensions; the evaluation benchmark model is trained based on the multi-dimensional evaluation feedback data set to obtain an evaluation effect evaluation model, thereby further optimizing the performance of the model.

[0043] In some embodiments of the first aspect of the present application, training the dialogue benchmark model according to the dialogue effect evaluation model and the psychological dialogue evaluation dataset to obtain the target dialogue model includes:

[0044] According to the dialogue benchmark model, processing a number of user question data in the psychological dialogue evaluation data set to obtain a number of first model outputs;

[0045] According to the dialogue effect evaluation model, processing each of the first model outputs to obtain each first score;

[0046] According to a preset first reinforcement learning algorithm and each of the first scores, the dialogue baseline model is updated to obtain a target dialogue model.

[0047] Compared with the prior art, the above embodiment has the following beneficial effects: by using the dialogue effect evaluation model and the psychological dialogue evaluation data set, the dialogue baseline model is optimized based on the reinforcement learning algorithm to obtain the target dialogue model; the reinforcement learning algorithm can dynamically adjust the model parameters according to the quality of the replies generated by the model, thereby further improving the dialogue effect and user experience of the model.

[0048] In some embodiments of the first aspect of the present application, completing the mental health level assessment according to the target dialogue model and the target assessment model includes:

[0049] According to the target dialogue model, the current user question data is processed to obtain the current reply data;

[0050] According to a preset preprocessing algorithm, the current user question data and the current reply data are processed to obtain current conversation record data;

[0051] According to the target assessment model and the preset psychology knowledge base, the current conversation record data is processed to generate an interpretable mental health level assessment result, and the mental health level assessment is completed.

[0052] Compared with the prior art, the above embodiment has the following beneficial effects: processing user question data through the target dialogue model to generate current response data, and combining the target evaluation model and the preset psychology knowledge base to generate interpretable mental health level evaluation results; the collaborative use of the two models not only improves the accuracy and interpretability of the evaluation results, but also enhances the user experience, enabling users to better understand the basis and reasons for the evaluation results.

[0053] In a second aspect, the embodiment of the present application also provides a multi-agent interpretable text mental health level assessment system, including: a pre-training module, an optimization module, a feedback data acquisition module, an evaluation model training module, a target model training module and a connection module;

[0054] The pre-training module is used to train a preset original agent model according to a multi-domain data set to obtain a first agent model and a second agent model;

[0055] The optimization module optimizes the first agent model and the second agent model respectively according to the psychological dialogue evaluation data set to obtain a dialogue benchmark model and an evaluation benchmark model;

[0056] The feedback data acquisition module is used to process a number of user question data according to the dialogue benchmark model to obtain a multi-dimensional dialogue feedback data set, and to process a number of multi-round dialogue data according to the evaluation benchmark model to obtain a multi-dimensional evaluation feedback data set;

[0057] The evaluation model training module is used to train the dialogue benchmark model according to the multi-dimensional dialogue feedback data set to obtain a dialogue effect evaluation model, and to train the evaluation benchmark model according to the multi-dimensional evaluation feedback data set to obtain an evaluation effect evaluation model;

[0058] The target model training module is used to train the dialogue benchmark model according to the dialogue effect evaluation model and the psychological dialogue evaluation data set to obtain a target dialogue model; and to train the evaluation benchmark model according to the evaluation effect evaluation model and the psychological dialogue evaluation data set to obtain a target evaluation model;

[0059] The connection module is used to complete the mental health level assessment according to the target dialogue model and the target assessment model.

[0060] Compared with the prior art, the embodiments of the present application have the following beneficial effects: by collecting multi-domain data sets, it is ensured that the model can learn from rich domain knowledge, and through iterative training, the model performance is gradually optimized to improve the versatility and robustness of the model; by constructing a psychological dialogue evaluation data set, it is ensured that the model can learn from real mental health evaluation scenarios, improve the practicality and accuracy of the model, optimize the first agent model and the second agent model respectively, obtain the dialogue benchmark model and the evaluation benchmark model, and lay the foundation for subsequent multi-dimensional feedback and reinforcement learning optimization; by processing user question data and multi-round dialogue data, a multi-dimensional dialogue feedback data set and a multi-dimensional evaluation feedback data set are generated, which can evaluate the model feedback from multiple angles. The quality of the complex and evaluation is helpful to discover the deficiencies of the model and improve the dialogue effect and evaluation effect of the model. Based on the multi-dimensional dialogue feedback dataset and the multi-dimensional evaluation feedback dataset, the dialogue baseline model and the evaluation baseline model are trained respectively to obtain the dialogue effect evaluation model and the evaluation effect evaluation model, thereby further optimizing the performance of the model. According to the dialogue effect evaluation model, the evaluation effect evaluation model and the psychological dialogue evaluation dataset, the dialogue baseline model and the evaluation baseline model are trained to obtain the target dialogue model and the target evaluation model, thereby further improving the dialogue effect and evaluation effect of the model. By collaboratively using the target dialogue model and the target evaluation model, the multi-faceted information of the user is captured more comprehensively, thereby improving the interpretability and accuracy of the evaluation results. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1 : A flow chart of a multi-agent interpretable text mental health level assessment method provided in some embodiments of the present invention.

[0062] Figure 2 : A structural diagram of a multi-agent interpretable text mental health level assessment system provided in some embodiments of the present invention.

[0063] Figure 3 : A schematic diagram of the model architecture of an original intelligent agent model provided in some embodiments of the present invention.

[0064] Figure 4 : A schematic diagram of the coding layer structure of an original intelligent agent model provided in some embodiments of the present invention.

[0065] Figure 5 : A schematic diagram of the decoding layer structure of an original intelligent agent model provided in some embodiments of the present invention. DETAILED DESCRIPTION

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

[0067] Embodiment 1:

[0068] Please refer to Figure 1 , a multi-agent interpretable text mental health level assessment method provided by an embodiment of the present invention, comprising steps S1 to S6:

[0069] Step S1: According to the multi-domain data set, a preset original intelligent agent model is trained to obtain a first intelligent agent model and a second intelligent agent model.

[0070] In some embodiments of the present application, step S1 can be implemented by the following preferred implementations:

[0071] S11: Collect knowledge documents in multiple fields and perform preprocessing to obtain a multi-field data set; wherein the preprocessing includes any one or more combinations of the following: noise processing, formatting processing and classification processing;

[0072] S12: According to the multi-domain data set, iteratively train the original agent model to obtain a first agent model, and in each iterative training, pre-process the multi-domain data set according to the text input module of the original agent model to obtain a text embedding matrix; according to the encoder of the original agent model, process the text embedding matrix to obtain a context semantic matrix and a history response matrix; according to the preset decoder of the original agent model, process the context semantic matrix and the history response matrix to obtain a complete text output;

[0073] like Figure 3 A schematic diagram of the model architecture of an original intelligent agent model is shown, wherein the text input module includes: a text cleaning layer, a text encoding layer and a text embedding layer.

[0074] The text cleaning layer is used to further clean the text data, including removing special characters, stop words and punctuation marks to ensure the cleanliness and consistency of the text;

[0075] The text encoding layer converts the cleaned text into digital codes using a vocabulary;

[0076] The text embedding layer inputs the digital code into the embedding matrix to generate the corresponding text embedding matrix; wherein the embedding matrix includes word embedding and position embedding. The word embedding converts each word into a vector of fixed dimension, and the position embedding encodes the relative position information of the word in the sentence into a vector. The formula is as follows:

[0077] E(x i )=E word (x i )+E pos (i); where E(x i ) is the embedding vector of the i-th word, E word (x i ) is the word embedding vector, E pos (i) is the position embedding vector, i is the position index of the word, x i Represents the i-th word.

[0078] Furthermore, if Figure 4 The schematic diagram of the encoding layer structure of an original intelligent agent model shown in FIG. The structure of the intelligent agent model includes multiple encoders, each of which includes a multi-head attention mechanism layer and a feedforward neural network layer to generate a context semantic matrix of the same size and a new history reply matrix; each encoding layer of the encoder outputs a hidden layer matrix of the same size as the input, and each sublayer has a residual connection, which directly adds the input and output matrices of each sublayer and performs layer normalization. The sublayer output is:

[0079] SubLayerOutput = LayerNorm(x+Sublayer(x)); wherein x is the text embedding matrix, Sublayer(x) is the residual processing performed on the outputs of the two sublayers of the coding layer, and LayerNorm() is the normalization processing.

[0080] Each attention head has an independent Query matrix W Q 、Key matrix W K and Value matrix W V , the input embedding vector X is respectively Q , W K and W V Multiply them to generate Query, Key, and Value vectors:

[0081] Q=W Q X; K = W K X; V = W V X;

[0082] By calculating the dot product similarity between these vectors and normalizing the dot product similarity using the Softmax activation function, we get the attention distribution matrix, which is then multiplied by the Value vector to get the attention output of each head:

[0083] where d k Represents the dimension of the K(Key) vector.

[0084] The multi-head attention mechanism layer uses the Concat function to merge the output vectors of all heads and add them to a matrix W to be learned. O The final multi-head attention output is obtained by multiplication and input into the feedforward neural network layer; wherein the Concat function represents concatenating the matrices in sequence:

[0085] Conat(Attention1,…,Attention i ,…,Attention n )=

[0086] [Attention1|…|Attention i |…|Attention L ]; Among them, Attention i represents the output of the i-th attention head, L is the number of attention heads, and the concatenated matrix dimension is L×d, where d is the dimension of the attention head output vector.

[0087] The concatenated matrix and a matrix to be learned W O Multiply them together to get the final multi-head attention output, expressed as:

[0088] MultiHead(Q,K,V)=W O ·Conat(Attention1,…,Attention i ,…,Attention L );

[0089] Among them, W O The dimension is d word ×(L×d), used to convert the concatenated vector back to the original dimension of the model, d word is the dimension of a single word input to the model.

[0090] The feedforward neural network layer includes two fully connected layers. The first fully connected layer expands the dimension of the multi-head attention output vector and uses the ReLU activation function for nonlinear transformation. The second fully connected layer shrinks the dimension back to the input size:

[0091] FCN1(x)=ReLU(xW1+b1); FCN2(x)=FCN1(x)W2+b2; where,

[0092] are all model parameters to be trained, d ff is the number of neurons in the middle hidden layer.

[0093] The context semantic matrix and the history response matrix output by the encoder are input into the psychological response vector output by the decoder including several encoding layers, and the psychological response vector output by the decoder is appended to the history response matrix; wherein the response vector output by the decoder is obtained from the last row in the matrix output by the last decoding layer.

[0094] like Figure 5 The schematic diagram of the decoding layer structure of an original intelligent agent model shown in the figure, each decoding layer will output a hidden layer matrix of the same size as the input, and the structure is similar to the encoding layer, containing two multi-head attention mechanism layers with residual addition mechanism and one fully connected layer, and the residual addition output of each sublayer will also undergo a layer normalization LayerOutput operation; the multi-head attention mechanism layer of the decoding layer is exactly the same in structure as the multi-head attention mechanism layer of the encoding layer, but the input is different, and the fully connected layer of the decoding layer is exactly the same in structure as the fully connected layer of the encoding layer.

[0095] After being processed by the output layer, each reply vector generated by the decoder is output as a word in real time, and finally a complete text output is formed. The output layer includes a linear layer, a Softmax layer and a word embedding layer; the linear layer maps the hidden state of the model to the dimension of the vocabulary, and the output of the linear layer is expressed as:

[0096] z=W linear ·h+b linear ; where h is the hidden state vector generated by the decoder (i.e., the output of the decoder), W linear is the weight matrix of the linear layer, with dimension V×d word , V is the vocabulary size, b linear is the bias vector.

[0097] The Softmax layer is used to convert the linear layer output z into a probability distribution with a value interval of [0,1], which is used to represent the probability of each word, and the sum of the probabilities of all words is 1. The word embedding layer selects the next generated word from the vocabulary according to the probability distribution output by the Softmax layer.

[0098] After several iterations of training, the first agent model is obtained;

[0099] S13: Copy the first agent model to obtain the second agent model.

[0100] In this embodiment, step S1 collects and preprocesses multi-domain data sets to ensure that the model can learn from rich domain knowledge and improve the versatility and robustness of the model. Preprocessing ensures the quality and consistency of the data. Through iterative training, the model performance is gradually optimized, and finally two intelligent agent models with universal capabilities are obtained.

[0101] Step S2: According to the psychological dialogue evaluation data set, the first agent model and the second agent model are optimized respectively to obtain a dialogue benchmark model and an evaluation benchmark model.

[0102] In some embodiments of the present application, step S2 can be implemented by the following preferred implementations:

[0103] S21: Collecting a data set in the field of mental health level assessment, and constructing a psychological dialogue assessment data set based on the data set in the field of mental health level assessment;

[0104] The psychological dialogue evaluation dataset includes: historical question-and-answer dialogue data, doctor response data, and health evaluation result data, which are expressed as follows:

[0105] Historical question-answering dialogue data: Input = {P1, D1, ..., D r-1 ,P r},r∈Z + ; where P = {P1,…,P r} represents the user's question, D={D1,…,D r-1} is the doctor's answer, r is the number of dialogue rounds; each item in the input consists of several words i∈[1,2r-1],n i is the number of words in the ith input.

[0106] Doctor’s response data: Response = {y1,…y k},k∈Z + ;

[0107] Health evaluation result data: Evaluation = {z1,…z l},l∈Z + ;

[0108] S22: Input the historical question-and-answer dialogue data into the first agent model, and modify the generated target to the doctor's response data corresponding to the historical question-and-answer dialogue data, and iteratively train to obtain the dialogue benchmark model.

[0109] Preferably, the loss function loss(θ) used in iterative training of the first agent model can be:

[0110]

[0111] Among them, D Psy_Chat The label of the psychological dialogue evaluation dataset, is the original agent model with parameters θ, Res is the model The predicted response matrix, Response is the doctor response matrix after the doctor response data is preprocessed.

[0112] S23: Input the historical question-and-answer dialogue data into the second agent model, and correct the generated target to the health assessment result data corresponding to the historical question-and-answer dialogue data, and iteratively train to obtain the assessment benchmark model.

[0113] Preferably, the loss function loss′(θ) used in iterative training of the second agent model can be:

[0114]

[0115] Among them, Eval is the model The predicted health assessment result matrix, Evaluation is the health assessment result matrix after the health assessment result data is preprocessed.

[0116] In this embodiment, step S2 ensures that the model can learn from real mental health assessment scenarios by constructing a psychological dialogue assessment dataset, thereby improving the practicality and accuracy of the model. The first agent model and the second agent model are optimized respectively to obtain a dialogue benchmark model and an evaluation benchmark model, laying the foundation for subsequent multi-dimensional feedback and reinforcement learning optimization.

[0117] Step S3: According to the dialogue benchmark model, a number of user question data are processed to obtain a multi-dimensional dialogue feedback data set; according to the evaluation benchmark model, a number of multi-round dialogue data are processed to obtain a multi-dimensional evaluation feedback data set.

[0118] In some embodiments of the present application, step S3 can be implemented by the following preferred implementations:

[0119] S31: According to the dialogue benchmark model, each of the user question data is processed separately to obtain a model response matrix; wherein the model response matrix includes response vectors composed of each user question data and each first model response corresponding to the user question data.

[0120] For example, obtain the user input Q from the user question data, generate m different model reply outputs Res according to the dialogue benchmark model1×m {Res1,…,Res m}, m ∈ Z + , to obtain [Q|Res 1×m , where Res ij (1 < i < m) is a single response of the model. Repeat the above operation n times to obtain a model response matrix R = [Q n×1 |Res n×m ;

[0121] S32: According to the preset partitioning algorithm, partition each response vector in the model response matrix to obtain each first feedback comparison pair.

[0122] For example, use the permutation and combination method to partition each vector [Q|Res 1×m into first feedback comparison pairs (Q, Res1, Res2), where represents the combination operation

[0123] S33: According to the preset psychology-related knowledge base, psychological assessment scale data, and the first dimension comparison conditions, process each of the first feedback comparison pairs to obtain a multi-dimensional dialogue feedback data set; wherein, the first dimension comparison conditions include: empathy dimension comparison conditions, understanding dimension comparison conditions, influence dimension comparison conditions, anthropomorphic dimension comparison conditions, reliability dimension comparison conditions, and security dimension comparison conditions, and the multi-dimensional dialogue feedback data set includes the dimension values of each of the first feedback comparison pairs under each of the first dimension comparison conditions.

[0124] For example, in one implementation, in any one dimension, if Res1 is better than Res2, then assign a value of 1 in this dimension, otherwise -1, and if the two responses are similar, assign a value of 0, thus constructing a multi-dimensional dialogue feedback data set.

[0125] S34: According to the evaluation benchmark model, process each of the multi-round dialogue data respectively to obtain an evaluation result matrix; wherein, the evaluation result matrix includes each evaluation vector composed of each multi-round dialogue data and each first evaluation result corresponding to each multi-round dialogue data;

[0126] For example, obtain the multi-round dialogue input C from the multi-round dialogue data, and according to the evaluation benchmark model, generate m different evaluation result outputs Eval 1×m {Eval1,…,Eval m}, m ∈ Z + , to obtain [C|Eval 1×m , where Eval i(1 < i < m) is the single evaluation result of the model. Repeat the above operation n times to obtain an evaluation result matrix E = [C n×1 |Eval n×m .

[0127] S35: According to the preset partitioning algorithm, partition each evaluation vector in the evaluation result matrix to obtain each second feedback comparison pair.

[0128] For example, use the permutation and combination method to partition each vector [C|Eval 1×m into second feedback comparison pairs (C, Eval1, Eval2).

[0129] S36: According to the preset psychology-related knowledge base, psychological assessment scale data, and second dimension comparison conditions, process each of the second feedback comparison pairs to obtain a multi-dimensional evaluation feedback data set; wherein, the second dimension comparison conditions include: validity dimension comparison conditions, reliability dimension comparison conditions, objectivity dimension comparison conditions, comprehensiveness dimension comparison conditions, and ethics dimension comparison conditions, and the multi-dimensional evaluation feedback data set includes the dimension values of each of the second feedback comparison pairs under each of the second dimension comparison conditions.

[0130] For example, in one implementation, in any dimension, if Eval1 is better than Eval2, then assign a value of 1 in this dimension, otherwise -1, and if the two evaluation results are similar, then assign a value of 0, so as to construct and obtain a multi-dimensional evaluation feedback data set.

[0131] In this embodiment, step S3 generates a multi-dimensional dialogue feedback data set by processing user question data, which can evaluate the quality of the model's response from multiple perspectives; by processing multi-round dialogue data, a multi-dimensional evaluation feedback data set is generated, which can evaluate the evaluation results of the model from multiple perspectives; this multi-dimensional feedback mechanism helps to discover the deficiencies of the model in mental health assessment and improve the dialogue effect and evaluation effect of the model.

[0132] Step S4: According to the multi-dimensional dialogue feedback data set, train the dialogue benchmark model to obtain a dialogue effect evaluation model, and according to the multi-dimensional evaluation feedback data set, train the evaluation benchmark model to obtain an evaluation effect evaluation model.

[0133] In some embodiments of the present application, step S4 can be implemented through the following preferred implementation:

[0134] S41: Replace the output layer of the dialogue benchmark model with 6 first linear layers, where the dimensions corresponding to each of the first linear layers are empathy dimension, understanding dimension, influence dimension, anthropomorphic dimension, reliability dimension, and safety dimension respectively.

[0135] S42: construct a first label mask vector for each first feedback comparison pair, and substitute the numerical values ​​of each dimension in the multi-dimensional dialogue feedback data set into the first label mask vector; wherein the length of the first label mask vector is 5.

[0136] S43: constructing a first loss function according to the first label mask vector, and training the dialogue benchmark model according to the first loss function to obtain a dialogue effect evaluation model;

[0137] For example, the first loss function loss1(θ) may be:

[0138]

[0139] Among them, r θ (Q, Res) is the scalar output score of the evaluation model for the user question Q and the single model response Res when the model parameter is θ, M m is the first label mask vector, D r1 Label for the multi-dimensional dialogue feedback dataset.

[0140] S44: replacing the output layer of the evaluation benchmark model with five second linear layers, wherein the dimensions corresponding to each of the second linear layers are effectiveness dimension, reliability dimension, objectivity dimension, comprehensiveness dimension and ethics dimension respectively;

[0141] S45: construct a second label mask vector for each second feedback comparison pair, and substitute the numerical values ​​of each dimension in the multi-dimensional evaluation feedback data set into the second label mask vector; wherein the length of the second label mask vector is 5.

[0142] S46: constructing a second loss function according to the second label mask vector, and training the evaluation benchmark model according to the second loss function to obtain an evaluation effect evaluation model;

[0143] For example, the second loss function loss2(θ) may be:

[0144]

[0145] Among them, r θ (C, Eval) is the scalar output score of the dialogue effect evaluation model for multi-round dialogue C and a single model response Eval when the model parameter is θ, M m ' is the second label mask vector, D r2 Labels for multi-dimensional evaluation feedback datasets.

[0146] In this preferred embodiment, step S4 replaces the output layer of the dialogue benchmark model with multiple linear layers and constructs a multi-dimensional label mask vector, so that the model's responses and evaluation results can be evaluated from multiple dimensions. This multi-dimensional evaluation mechanism helps to improve the dialogue effect and evaluation effect of the model, ensuring that the responses and evaluation results generated by the model are of high quality in multiple dimensions. Based on the multi-dimensional dialogue feedback dataset and the multi-dimensional evaluation feedback dataset, the dialogue benchmark model and the evaluation benchmark model are trained to obtain the dialogue effect evaluation model and the evaluation effect evaluation model, further optimizing the performance of the model.

[0147] Step S5: According to the dialogue effect evaluation model and the psychological dialogue evaluation data set, the dialogue benchmark model is trained to obtain a target dialogue model; according to the evaluation effect evaluation model and the psychological dialogue evaluation data set, the evaluation benchmark model is trained to obtain a target evaluation model.

[0148] In some embodiments of the present application, step S5 can be implemented by the following preferred implementations:

[0149] S51: processing a plurality of user question data in the psychological dialogue evaluation data set according to the dialogue benchmark model to obtain a plurality of first model outputs;

[0150] For example, a user input q is randomly extracted from the psychological dialogue evaluation dataset, and a model response Res is generated using the dialogue effect evaluation. q , which is the first model output.

[0151] S52: processing the first model outputs according to the dialogue effect evaluation model to obtain first scores;

[0152] For example, the extracted user input q and its corresponding model reply Res q , as the input of the dialogue effect evaluation model, and obtain the score r of the dialogue effect evaluation model θ (q,Res q ), which is the first score.

[0153] S53: According to a preset first reinforcement learning algorithm and each of the first scores, the dialogue baseline model is updated to obtain a target dialogue model.

[0154] Preferably, the preset first reinforcement learning algorithm may be as follows:

[0155]

[0156] in, is the dialogue baseline model, is the distribution of data used for reinforcement learning, π SFTTo supervise the training model, D pretrain is the distribution of training data during pre-training, β is the KL reward coefficient, and γ is the loss coefficient of pre-training.

[0157] S54: processing a plurality of multi-round dialogue data in the psychological dialogue evaluation data set according to the evaluation benchmark model to obtain a plurality of second model outputs;

[0158] For example, randomly extract a multi-round dialogue c from the psychological dialogue evaluation dataset and use the evaluation benchmark model to generate a model evaluation result Eval c , which is the second model output.

[0159] S55: processing each of the second model outputs according to the evaluation effect assessment model to obtain each second score;

[0160] For example, the extracted multi-round dialogue c and its corresponding model reply Eval c , as the input of the evaluation effect evaluation model, and obtain the score r of the evaluation effect evaluation model θ (c,Eval c ), which is the second score.

[0161] S56: According to a preset second reinforcement learning algorithm and each of the second scores, the evaluation benchmark model is updated to obtain a target evaluation model.

[0162] Preferably, the preset second reinforcement learning algorithm may be as follows:

[0163]

[0164] in, To evaluate the baseline model, is the distribution of data used for reinforcement learning.

[0165] In this preferred embodiment, step S5 optimizes the dialogue benchmark model and the evaluation benchmark model based on the reinforcement learning algorithm by using the dialogue effect evaluation model, the evaluation effect evaluation model and the psychological dialogue evaluation data set to obtain the target dialogue model and the target evaluation model. The reinforcement learning algorithm can dynamically adjust the model parameters according to the quality of the response generated by the model or the quality of the evaluation result, so as to further improve the dialogue effect, evaluation effect and credibility of the model.

[0166] Step S6: Complete the mental health level assessment according to the target dialogue model and the target assessment model.

[0167] In some embodiments of the present application, step S6 can be implemented by the following preferred implementations:

[0168] S61: Processing the current user question data according to the target dialogue model to obtain current reply data;

[0169] S62: Processing the current user question data and the current reply data according to a preset preprocessing algorithm to obtain current conversation record data;

[0170] Preferably, the preprocessing algorithm includes any one or combination of the following: removal of stop words and word segmentation processing and word vector embedding operations.

[0171] S63: According to the target assessment model and the preset psychology knowledge base, the current conversation record data is processed to generate an interpretable mental health level assessment result, and the mental health level assessment is completed.

[0172] Step S6 processes the user question data through the target dialogue model to generate current response data, and combines the target evaluation model and the preset psychological knowledge base to generate an interpretable mental health level evaluation result; the collaborative use of the two models not only improves the accuracy and interpretability of the evaluation results, but also enhances the user experience, enabling users to better understand the basis and reasons for the evaluation results.

[0173] In summary, compared with the prior art, the embodiments of the present application have the following beneficial effects: by collecting multi-domain data sets, it is ensured that the model can learn from rich domain knowledge, and through iterative training, the model performance is gradually optimized to improve the versatility and robustness of the model; by constructing a psychological dialogue evaluation data set, it is ensured that the model can learn from real mental health evaluation scenarios, improve the practicality and accuracy of the model, optimize the first agent model and the second agent model respectively, and obtain the dialogue benchmark model and the evaluation benchmark model, laying the foundation for subsequent multi-dimensional feedback and reinforcement learning optimization; by processing user question data and multi-round dialogue data, a multi-dimensional dialogue feedback data set and a multi-dimensional evaluation feedback data set are generated, which can evaluate the model from multiple angles. The quality of the type of response and evaluation is helpful to discover the deficiencies of the model and improve the dialogue effect and evaluation effect of the model. Based on the multi-dimensional dialogue feedback dataset and the multi-dimensional evaluation feedback dataset, the dialogue baseline model and the evaluation baseline model are trained respectively to obtain the dialogue effect evaluation model and the evaluation effect evaluation model, thereby further optimizing the performance of the model. According to the dialogue effect evaluation model, the evaluation effect evaluation model and the psychological dialogue evaluation dataset, the dialogue baseline model and the evaluation baseline model are trained to obtain the target dialogue model and the target evaluation model, thereby further improving the dialogue effect and evaluation effect of the model. By collaboratively using the target dialogue model and the target evaluation model, the multi-faceted information of the user is captured more comprehensively, thereby improving the interpretability and accuracy of the evaluation results.

[0174] Embodiment 2:

[0175] Please refer to Figure 2Based on the same inventive concept, an embodiment of the present invention discloses a multi-agent interpretable text mental health level assessment system, including: a pre-training module M1, an optimization module M2, a feedback data acquisition module M3, an evaluation model training module M4, a target model training module M5 and a connection module M6.

[0176] The pre-training module M1 is used to train a preset original agent model according to a multi-domain data set to obtain a first agent model and a second agent model.

[0177] The pre-training module M1 includes: a collection unit, a pre-training unit and a replication unit; the collection unit is used to collect knowledge documents in multiple fields and perform pre-processing to obtain a multi-field data set;

[0178] Further, the preprocessing includes any one or more combinations of the following: noise processing, formatting processing and classification processing;

[0179] The pre-training unit is used to iteratively train the original intelligent agent model according to the multi-domain data set to obtain a first intelligent agent model, and in each iterative training, pre-process the multi-domain data set according to the text input module of the original intelligent agent model to obtain a text embedding matrix; process the text embedding matrix according to the encoder of the original intelligent agent model to obtain a context semantic matrix and a history response matrix; process the context semantic matrix and the history response matrix according to the preset decoder of the original intelligent agent model to obtain a complete text output; the copying unit is used to copy the first intelligent agent model to obtain the second intelligent agent model.

[0180] In the embodiment of the present application, the pre-training module M1 collects and pre-processes multi-domain data sets to ensure that the model can learn from rich domain knowledge and improve the versatility and robustness of the model. Pre-processing ensures the quality and consistency of the data. Through iterative training, the model performance is gradually optimized, and finally two intelligent agent models with general capabilities are obtained.

[0181] The optimization module M2 is used to optimize the first agent model and the second agent model respectively according to the psychological dialogue evaluation data set to obtain a dialogue benchmark model and an evaluation benchmark model.

[0182] The optimization module M2 includes: a data set construction unit, a first optimization unit and a second optimization unit; the data set construction unit is used to collect a data set in the field of mental health level assessment, and construct a psychological dialogue assessment data set based on the data set in the field of mental health level assessment; wherein the psychological dialogue assessment data set includes: historical question-and-answer dialogue data, doctor's reply data and health assessment result data; the first optimization unit is used to input the historical question-and-answer dialogue data into the first intelligent agent model, and correct the generated target to the doctor's reply data corresponding to the historical question-and-answer dialogue data, and iteratively train to obtain the dialogue benchmark model; the second optimization unit is used to input the historical question-and-answer dialogue data into the second intelligent agent model, and correct the generated target to the health assessment result data corresponding to the historical question-and-answer dialogue data, and iteratively train to obtain the assessment benchmark model.

[0183] In the embodiment of the present application, the optimization module M2 ensures that the model can learn from real mental health assessment scenarios by constructing a psychological dialogue assessment data set, thereby improving the practicality and accuracy of the model. The first agent model and the second agent model are optimized respectively to obtain a dialogue benchmark model and an evaluation benchmark model, laying the foundation for subsequent multi-dimensional feedback and reinforcement learning optimization.

[0184] The feedback data acquisition module M3 is used to process a number of user question data according to the dialogue benchmark model to obtain a multi-dimensional dialogue feedback data set, and to process a number of multi-round dialogue data according to the evaluation benchmark model to obtain a multi-dimensional evaluation feedback data set.

[0185] The feedback data acquisition module M3 includes: a dialogue feedback data acquisition unit; the dialogue feedback data acquisition unit is used to process each of the user question data according to the dialogue benchmark model to obtain a model response matrix; wherein the model response matrix includes each response vector composed of each user question data and each first model response corresponding to each user question data;

[0186] Dividing each reply vector in the model reply matrix according to a preset partitioning algorithm to obtain each first feedback comparison pair;

[0187] According to a preset psychology-related knowledge base, psychological assessment scale data and a first dimension comparison condition, each of the first feedback comparison pairs is processed to obtain a multi-dimensional dialogue feedback data set; wherein the first dimension comparison condition includes: an empathy dimension comparison condition, an understanding dimension comparison condition, an influence dimension comparison condition, an anthropomorphism dimension comparison condition, a reliability dimension comparison condition and a safety dimension comparison condition, and the multi-dimensional dialogue feedback data set includes the dimension values ​​of each of the first feedback comparison pairs under each of the first dimension comparison conditions.

[0188] In an embodiment of the present application, the feedback data acquisition module M3 generates a multi-dimensional dialogue feedback data set by processing user question data, which can evaluate the quality of model responses from multiple angles. This multi-dimensional feedback mechanism helps to discover the deficiencies of the model and improve the dialogue effect of the model.

[0189] Furthermore, the feedback data acquisition module M3 further includes: an evaluation feedback data acquisition unit; the evaluation feedback data acquisition unit is used to process each of the multi-round dialogue data according to the evaluation benchmark model to obtain an evaluation result matrix; wherein the evaluation result matrix includes each evaluation vector composed of each multi-round dialogue data and each first evaluation result corresponding to each multi-round dialogue data;

[0190] Dividing each evaluation vector in the evaluation result matrix according to a preset division algorithm to obtain each second feedback comparison pair;

[0191] According to the preset psychology-related knowledge base and psychological assessment scale data and the second dimension comparison condition, each second feedback comparison pair is processed to obtain a multi-dimensional evaluation feedback data set; wherein the second dimension comparison condition includes: effectiveness dimension comparison condition, reliability dimension comparison condition, objectivity dimension comparison condition, comprehensiveness dimension comparison condition and ethics dimension comparison condition, and the multi-dimensional evaluation feedback data set includes the dimension values ​​of each second feedback comparison pair under each second dimension comparison condition.

[0192] In an embodiment of the present application, the feedback data acquisition module M3 also generates a multi-dimensional evaluation feedback data set by processing multiple rounds of dialogue data, which can evaluate the evaluation results of the model from multiple angles. This multi-dimensional feedback mechanism helps to discover the deficiencies of the model in mental health assessment and improve the evaluation effect of the model.

[0193] The evaluation model training module M4 is used to train the dialogue benchmark model according to the multi-dimensional dialogue feedback data set to obtain a dialogue effect evaluation model, and to train the evaluation benchmark model according to the multi-dimensional evaluation feedback data set to obtain an evaluation effect evaluation model.

[0194] The evaluation model training module M4 includes: a dialogue evaluation model training unit; the dialogue evaluation model training unit is used to replace the output layer of the dialogue benchmark model with 6 first linear layers, wherein the dimensions corresponding to each of the first linear layers are empathy dimension, understanding dimension, influence dimension, anthropomorphism dimension, reliability dimension and safety dimension respectively;

[0195] Constructing a first label mask vector for each first feedback comparison pair, and substituting the values ​​of each dimension in the multi-dimensional dialogue feedback dataset into the first label mask vector;

[0196] A first loss function is constructed according to the first label mask vector, and the dialogue benchmark model is trained according to the first loss function to obtain a dialogue effect evaluation model.

[0197] In an embodiment of the present application, the evaluation model training module M4 replaces the output layer of the dialogue benchmark model with multiple linear layers and constructs a multi-dimensional label mask vector. It can evaluate the model's responses from multiple dimensions. This multi-dimensional evaluation mechanism helps to improve the model's dialogue effect and ensure that the responses generated by the model are of high quality in multiple dimensions. The dialogue benchmark model is trained based on the multi-dimensional dialogue feedback dataset to obtain a dialogue effect evaluation model, thereby further optimizing the model's performance.

[0198] Furthermore, the evaluation model training module M4 further includes: an evaluation model training unit; the evaluation model training unit is used to replace the output layer of the evaluation benchmark model with 5 second linear layers, wherein the dimensions corresponding to each of the second linear layers are effectiveness dimension, reliability dimension, objectivity dimension, comprehensiveness dimension and ethics dimension respectively;

[0199] Constructing a second label mask vector for each second feedback comparison pair, and substituting the values ​​of each dimension in the multi-dimensional evaluation feedback data set into the second label mask vector;

[0200] According to the second label mask vector, a second loss function is constructed, and according to the second loss function, the evaluation benchmark model is trained to obtain an evaluation effect evaluation model.

[0201] In an embodiment of the present application, the evaluation model training module M4 can also evaluate the evaluation results of the model from multiple dimensions by replacing the output layer of the evaluation benchmark model with multiple linear layers and constructing a multi-dimensional label mask vector. This multi-dimensional evaluation mechanism helps to improve the evaluation effect of the model and ensure that the evaluation results generated by the model are of high quality in multiple dimensions. The evaluation benchmark model is trained based on the multi-dimensional evaluation feedback data set to obtain an evaluation effect evaluation model, thereby further optimizing the performance of the model.

[0202] The target model training module M5 is used to train the dialogue benchmark model according to the dialogue effect evaluation model and the psychological dialogue evaluation data set to obtain a target dialogue model; and to train the evaluation benchmark model according to the evaluation effect evaluation model and the psychological dialogue evaluation data set to obtain a target evaluation model.

[0203] The target model training module M5 includes: a dialogue target model training unit; the dialogue target model training unit is used to process a number of user question data in the psychological dialogue evaluation data set according to the dialogue benchmark model to obtain a number of first model outputs;

[0204] According to the dialogue effect evaluation model, processing each of the first model outputs to obtain each first score;

[0205] According to a preset first reinforcement learning algorithm and each of the first scores, the dialogue baseline model is updated to obtain a target dialogue model.

[0206] In an embodiment of the present application, the target model training module M5 obtains the target dialogue model by optimizing the dialogue baseline model based on the reinforcement learning algorithm by using the dialogue effect evaluation model and the psychological dialogue evaluation data set; the reinforcement learning algorithm can dynamically adjust the model parameters according to the quality of the responses generated by the model, thereby further improving the dialogue effect and user experience of the model.

[0207] Furthermore, the target model training module M5 further includes: an evaluation target model training unit; the evaluation target model training unit is used to process a plurality of multi-round dialogue data in the psychological dialogue evaluation data set according to the evaluation benchmark model to obtain a plurality of second model outputs;

[0208] According to the evaluation effect assessment model, processing each of the second model outputs to obtain each second score;

[0209] According to the preset second reinforcement learning algorithm and each of the second scores, the evaluation benchmark model is updated to obtain a target evaluation model.

[0210] In an embodiment of the present application, the target model training module M5 also obtains a target evaluation model by optimizing the evaluation benchmark model based on a reinforcement learning algorithm by using an evaluation effect evaluation model and a psychological dialogue evaluation data set; the reinforcement learning algorithm can dynamically adjust the model parameters according to the quality of the evaluation results generated by the model, thereby further improving the evaluation effect and credibility of the model.

[0211] The connection module M6 is used to complete the mental health level assessment according to the target dialogue model and the target assessment model.

[0212] The connection module M6 includes: a current reply output module, a current record output module and an evaluation result output module; the current reply output module is used to process the current user question data according to the target dialogue model to obtain the current reply data; the current record output module is used to process the current user question data and the current reply data according to a preset preprocessing algorithm to obtain the current dialogue record data; the evaluation result output module is used to process the current dialogue record data according to the target evaluation model and a preset psychology knowledge base, generate an explainable mental health level assessment result, and complete the mental health level assessment.

[0213] The connection module M6 of this embodiment processes user question data through the target dialogue model, generates current response data, and combines the target evaluation model and the preset psychology knowledge base to generate an interpretable mental health level evaluation result; the collaborative use of the two models not only improves the accuracy and interpretability of the evaluation results, but also enhances the user experience, enabling users to better understand the basis and reasons for the evaluation results.

[0214] In summary, compared with the prior art, the embodiments of the present application have the following beneficial effects: by collecting multi-domain data sets, it is ensured that the model can learn from rich domain knowledge, and through iterative training, the model performance is gradually optimized to improve the versatility and robustness of the model; by constructing a psychological dialogue evaluation data set, it is ensured that the model can learn from real mental health evaluation scenarios, improve the practicality and accuracy of the model, optimize the first agent model and the second agent model respectively, and obtain the dialogue benchmark model and the evaluation benchmark model, laying the foundation for subsequent multi-dimensional feedback and reinforcement learning optimization; by processing user question data and multi-round dialogue data, a multi-dimensional dialogue feedback data set and a multi-dimensional evaluation feedback data set are generated, which can evaluate the model from multiple angles. The quality of the type of response and evaluation is helpful to discover the deficiencies of the model and improve the dialogue effect and evaluation effect of the model. Based on the multi-dimensional dialogue feedback dataset and the multi-dimensional evaluation feedback dataset, the dialogue baseline model and the evaluation baseline model are trained respectively to obtain the dialogue effect evaluation model and the evaluation effect evaluation model, thereby further optimizing the performance of the model. According to the dialogue effect evaluation model, the evaluation effect evaluation model and the psychological dialogue evaluation dataset, the dialogue baseline model and the evaluation baseline model are trained to obtain the target dialogue model and the target evaluation model, thereby further improving the dialogue effect and evaluation effect of the model. By collaboratively using the target dialogue model and the target evaluation model, the multi-faceted information of the user is captured more comprehensively, thereby improving the interpretability and accuracy of the evaluation results.

[0215] The division of the modules described above is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules may be combined or integrated into another system.

[0216] The specific embodiments described above further describe the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.

Claims

1. A multi-agent interpretable text mental health level assessment method, characterized in that: include: According to the multi-domain data set, a preset original intelligent agent model is trained to obtain a first intelligent agent model and a second intelligent agent model; According to the psychological dialogue evaluation data set, respectively optimizing the first agent model and the second agent model to obtain a dialogue benchmark model and an evaluation benchmark model; According to the dialogue benchmark model, a number of user question data are processed to obtain a multi-dimensional dialogue feedback data set; according to the evaluation benchmark model, a number of multi-round dialogue data are processed to obtain a multi-dimensional evaluation feedback data set; According to the multi-dimensional dialogue feedback data set, the dialogue benchmark model is trained to obtain a dialogue effect evaluation model; according to the multi-dimensional evaluation feedback data set, the evaluation benchmark model is trained to obtain an evaluation effect evaluation model; According to the dialogue effect evaluation model and the psychological dialogue evaluation data set, the dialogue benchmark model is trained to obtain a target dialogue model; according to the evaluation effect evaluation model and the psychological dialogue evaluation data set, the evaluation benchmark model is trained to obtain a target evaluation model; Complete the mental health level assessment based on the target dialogue model and target assessment model.

2. A multi-agent interpretable text mental health level assessment method as claimed in claim 1, characterized in that: The method of training a preset original agent model according to the multi-domain data set to obtain a first agent model and a second agent model includes: Collect knowledge documents in multiple fields and perform preprocessing to obtain multi-field data sets; wherein the preprocessing includes any one or more combinations of the following: noise processing, formatting processing and classification processing; According to the multi-domain data set, the original intelligent agent model is iteratively trained to obtain a first intelligent agent model, and in each iterative training, the multi-domain data set is preprocessed according to the text input module of the original intelligent agent model to obtain a text embedding matrix; according to the encoder of the original intelligent agent model, the text embedding matrix is ​​processed to obtain a context semantic matrix and a history response matrix; according to the preset decoder of the original intelligent agent model, the context semantic matrix and the history response matrix are processed to obtain a complete text output; The first agent model is copied to obtain the second agent model.

3. A multi-agent interpretable text mental health level assessment method as claimed in claim 2, characterized in that: The step of optimizing the first agent model and the second agent model respectively according to the psychological dialogue evaluation data set to obtain a dialogue benchmark model and an evaluation benchmark model comprises: Collecting a data set in the field of mental health level assessment, and constructing a psychological dialogue assessment data set based on the data set in the field of mental health level assessment; wherein the psychological dialogue assessment data set includes: historical question-and-answer dialogue data, doctor response data, and health assessment result data; Inputting the historical question-and-answer dialogue data into the first agent model, and correcting the generated target to the doctor's reply data corresponding to the historical question-and-answer dialogue data, and iteratively training to obtain the dialogue benchmark model; The historical question-and-answer dialogue data is input into the second agent model, and the generated target is corrected to the health assessment result data corresponding to the historical question-and-answer dialogue data, and iterative training is performed to obtain the assessment benchmark model.

4. A multi-agent interpretable text mental health level assessment method as claimed in claim 3, characterized in that: The method of processing a plurality of user question data according to the dialogue benchmark model to obtain a multi-dimensional dialogue feedback data set includes: According to the dialogue benchmark model, each of the user question data is processed respectively to obtain a model response matrix; wherein the model response matrix includes response vectors composed of each user question data and each first model response corresponding to each user question data; Dividing each reply vector in the model reply matrix according to a preset partitioning algorithm to obtain each first feedback comparison pair; According to a preset psychology-related knowledge base, psychological assessment scale data and a first dimension comparison condition, each of the first feedback comparison pairs is processed to obtain a multi-dimensional dialogue feedback data set; wherein the first dimension comparison condition includes: an empathy dimension comparison condition, an understanding dimension comparison condition, an influence dimension comparison condition, an anthropomorphism dimension comparison condition, a reliability dimension comparison condition and a safety dimension comparison condition, and the multi-dimensional dialogue feedback data set includes the dimension values ​​of each of the first feedback comparison pairs under each of the first dimension comparison conditions.

5. A multi-agent interpretable text mental health level assessment method as claimed in claim 4, characterized in that: According to the evaluation benchmark model, a plurality of multi-round dialogue data are processed to obtain a multi-dimensional evaluation feedback data set, including: According to the evaluation benchmark model, each of the multi-round dialogue data is processed respectively to obtain an evaluation result matrix; wherein the evaluation result matrix includes evaluation vectors composed of each multi-round dialogue data and each first evaluation result corresponding to each multi-round dialogue data; Dividing each evaluation vector in the evaluation result matrix according to a preset division algorithm to obtain each second feedback comparison pair; According to the preset psychology-related knowledge base and psychological assessment scale data and the second dimension comparison condition, each second feedback comparison pair is processed to obtain a multi-dimensional evaluation feedback data set; wherein the second dimension comparison condition includes: effectiveness dimension comparison condition, reliability dimension comparison condition, objectivity dimension comparison condition, comprehensiveness dimension comparison condition and ethics dimension comparison condition, and the multi-dimensional evaluation feedback data set includes the dimension values ​​of each second feedback comparison pair under each second dimension comparison condition.

6. A multi-agent interpretable text mental health level assessment method as claimed in claim 5, characterized in that: The step of training the dialogue benchmark model according to the multi-dimensional dialogue feedback data set to obtain a dialogue effect evaluation model includes: The output layer of the dialogue benchmark model is replaced by 6 first linear layers, wherein the dimensions corresponding to each of the first linear layers are empathy dimension, understanding dimension, influence dimension, anthropomorphism dimension, reliability dimension and safety dimension respectively; Constructing a first label mask vector for each first feedback comparison pair, and substituting the values ​​of each dimension in the multi-dimensional dialogue feedback dataset into the first label mask vector; A first loss function is constructed according to the first label mask vector, and the dialogue benchmark model is trained according to the first loss function to obtain a dialogue effect evaluation model.

7. A multi-agent interpretable text mental health level assessment method as claimed in claim 6, characterized in that: The step of training the evaluation benchmark model according to the multi-dimensional evaluation feedback data set to obtain an evaluation effect evaluation model includes: The output layer of the evaluation benchmark model is replaced by five second linear layers, wherein the dimensions corresponding to each of the second linear layers are effectiveness dimension, reliability dimension, objectivity dimension, comprehensiveness dimension and ethics dimension respectively; Constructing a second label mask vector for each second feedback comparison pair, and substituting the values ​​of each dimension in the multi-dimensional evaluation feedback data set into the second label mask vector; According to the second label mask vector, a second loss function is constructed, and according to the second loss function, the evaluation benchmark model is trained to obtain an evaluation effect evaluation model.

8. A multi-agent interpretable text mental health level assessment method as claimed in claim 7, characterized in that: The step of training the dialogue benchmark model according to the dialogue effect evaluation model and the psychological dialogue evaluation data set to obtain a target dialogue model includes: According to the dialogue benchmark model, processing a number of user question data in the psychological dialogue evaluation data set to obtain a number of first model outputs; According to the dialogue effect evaluation model, processing each of the first model outputs to obtain each first score; According to a preset first reinforcement learning algorithm and each of the first scores, the dialogue baseline model is updated to obtain a target dialogue model.

9. A multi-agent interpretable text mental health level assessment method as claimed in claim 8, characterized in that: The mental health level assessment is completed according to the target dialogue model and the target assessment model, including: According to the target dialogue model, the current user question data is processed to obtain the current reply data; According to a preset preprocessing algorithm, the current user question data and the current reply data are processed to obtain current conversation record data; According to the target assessment model and the preset psychology knowledge base, the current conversation record data is processed to generate an interpretable mental health level assessment result, and the mental health level assessment is completed.

10. A multi-agent interpretable text mental health level assessment system, characterized in that: include: Pre-training module, optimization module, feedback data acquisition module, evaluation model training module, target model training module and connection module; The pre-training module is used to train a preset original agent model according to a multi-domain data set to obtain a first agent model and a second agent model; The optimization module optimizes the first agent model and the second agent model respectively according to the psychological dialogue evaluation data set to obtain a dialogue benchmark model and an evaluation benchmark model; The feedback data acquisition module is used to process a number of user question data according to the dialogue benchmark model to obtain a multi-dimensional dialogue feedback data set, and to process a number of multi-round dialogue data according to the evaluation benchmark model to obtain a multi-dimensional evaluation feedback data set; The evaluation model training module is used to train the dialogue benchmark model according to the multi-dimensional dialogue feedback data set to obtain a dialogue effect evaluation model, and to train the evaluation benchmark model according to the multi-dimensional evaluation feedback data set to obtain an evaluation effect evaluation model; The target model training module is used to train the dialogue benchmark model according to the dialogue effect evaluation model and the psychological dialogue evaluation data set to obtain a target dialogue model; and to train the evaluation benchmark model according to the evaluation effect evaluation model and the psychological dialogue evaluation data set to obtain a target evaluation model; The connection module is used to complete the mental health level assessment according to the target dialogue model and the target assessment model.

Citation Information

Patent Citations

  • Medical question and answer reply method and system based on doctor feedback and reinforcement learning

    CN116383364A

  • Cloud platform reply method and device, equipment and storage medium

    CN117909475A

  • Human-like value alignment method and system based on multi-dimensional feedback reinforcement learning

    CN118013016A

  • Psychological counseling dialogue evaluation system based on large language model

    CN118983091A

Cited By

  • Psychological crisis comprehensive perception system and method based on AI and multi-source data

    CN120636801A

  • AI mental health assessment and grading early warning system and method based on multi-modal fusion

    CN120884292A

  • AI mental health assessment and grading early warning system and method based on multi-modal fusion

    CN120884292B