CN116884576A - Psychological assessment method and device based on artificial intelligence and computer equipment - Google Patents

Psychological assessment method and device based on artificial intelligence and computer equipment Download PDF

Info

Publication number
CN116884576A
CN116884576A CN202310939410.1A CN202310939410A CN116884576A CN 116884576 A CN116884576 A CN 116884576A CN 202310939410 A CN202310939410 A CN 202310939410A CN 116884576 A CN116884576 A CN 116884576A
Authority
CN
China
Prior art keywords
psychological
reply
title
sample
word
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310939410.1A
Other languages
Chinese (zh)
Inventor
黄雅雯
李悦翔
段皓然
万凡
龙洋
郑冶枫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202310939410.1A priority Critical patent/CN116884576A/en
Publication of CN116884576A publication Critical patent/CN116884576A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16HHEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
    • G16H20/00ICT specially adapted for therapies or health-improving plans, e.g. for handling prescriptions, for steering therapy or for monitoring patient compliance
    • G16H20/70ICT specially adapted for therapies or health-improving plans, e.g. for handling prescriptions, for steering therapy or for monitoring patient compliance relating to mental therapies, e.g. psychological therapy or autogenous training
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Abstract

The application relates to a psychological assessment method, a psychological assessment device, a psychological assessment computer device, a psychological assessment storage medium and a psychological assessment computer program product based on artificial intelligence. The method comprises the following steps: coding each text in the psychological consultation text packet respectively to obtain a plurality of coded data; performing first attention processing on the coded data corresponding to each word in the psychological consultation title to obtain a first attention processing result, and determining a state degree label corresponding to the psychological consultation title based on the first attention processing result; performing second attention processing on the coded data corresponding to each reply to obtain a second attention processing result, and determining at least one state degree label corresponding to each reply based on the second attention processing result; and determining the psychological state degree information of the object to be evaluated according to the state degree label corresponding to the at least one reply and the state degree label corresponding to the psychological consultation title. By adopting the method, the determination efficiency of the psychological state can be improved.

Description

Psychological assessment method and device based on artificial intelligence and computer equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a psychological assessment method, apparatus, computer device, and storage medium based on artificial intelligence.
Background
Along with the gradual and vigorous social competition, people commonly bear various psychological pressures, psychological disorders and psychological diseases occur frequently, and the trend of increasing is presented, so that the social pressure and the economic pressure are greatly increased. Therefore, the psychological state is accurately and timely identified, and social pressure and economic pressure can be relieved.
Traditional psychological state assessment is generally that psychological consultants chat one to analyze psychological emotion changes of people so as to determine psychological states of people. However, determining the psychological state by means of the psychological consultant chatting one to one consumes a lot of manpower and material resources, thereby reducing the efficiency of determining the psychological state.
Disclosure of Invention
In view of the foregoing, it is desirable to provide an artificial intelligence-based psychological assessment method, apparatus, computer device, computer readable storage medium, and computer program product that can improve psychological assessment efficiency.
In a first aspect, the present application provides an artificial intelligence based psychological assessment method, the method comprising:
Acquiring a psychological consultation text packet of an object to be evaluated, and respectively encoding each text in the psychological consultation text packet to acquire a plurality of encoded data;
when the psychological consultation text packet comprises a psychological consultation title and at least one reply associated with the psychological consultation title, performing first attention processing on coding data corresponding to each word in the psychological consultation title, based on first contribution weight of each word in the psychological consultation title to determining a state degree label corresponding to the psychological consultation title, obtaining a first attention processing result corresponding to the psychological consultation title, and decoding the first attention processing result to obtain the state degree label corresponding to the psychological consultation title;
when the coded data corresponding to each reply is subjected to second attention processing, respectively aiming at each reply, determining second contribution weights of state degree labels corresponding to the replies based on the replies to obtain second attention processing results corresponding to the replies, and respectively decoding each second attention processing result to obtain state degree labels corresponding to the replies;
And determining the psychological state degree information of the object to be evaluated according to the state degree label corresponding to the at least one reply and the state degree label corresponding to the psychological consultation title.
In a second aspect, the present application also provides an artificial intelligence based psychological assessment apparatus, the apparatus comprising:
the coding module is used for acquiring a psychological consultation text packet of the object to be evaluated, and respectively coding each text in the psychological consultation text packet to acquire a plurality of coded data;
the attention processing module is used for obtaining a first attention processing result based on first contribution weight of each word in the psychological consultation title to the state degree label corresponding to the psychological consultation title when carrying out first attention processing on the coded data corresponding to each word in the psychological consultation title under the condition that the psychological consultation text packet comprises the psychological consultation title and at least one reply associated with the psychological consultation title, and decoding the first attention processing result to obtain the state degree label corresponding to the psychological consultation title; when the coded data corresponding to each reply is subjected to second attention processing, respectively aiming at each reply, determining second contribution weights of state degree labels corresponding to the replies aiming at the replies based on the replies to obtain second attention processing results, and respectively decoding each second attention processing result to obtain the state degree labels corresponding to the replies;
And the state determining module is used for determining the psychological state degree information of the object to be evaluated according to the state degree label corresponding to the at least one reply and the state degree label corresponding to the psychological consultation title.
In one embodiment, the attention processing module is further configured to, when the psychological consultation text packet includes a psychological consultation title and does not include a reply associated with the psychological consultation title, perform third attention processing on the encoded data corresponding to each word in the psychological consultation title, determine, based on a third contribution weight of each word pair in the psychological consultation title, whether the psychological state of the object to be evaluated belongs to a preset second state category, obtain a third attention processing result corresponding to the psychological consultation title, and determine, based on the third attention processing result, whether the psychological state of the object to be evaluated belongs to the preset second state category.
In one embodiment, the artificial intelligence based psychological assessment method is performed by determining a psychological assessment model based on a state; the psychological assessment state determining model comprises a multi-classification model and a two-classification model; the multi-classification model is used for determining the psychological state degree information, and the psychological state degree information comprises at least one of degree grade of the psychological of the object to be evaluated of the object to be detected under a preset first state category and psychological intervention measures adopted; the classification model is used for determining whether the psychological state of the object to be evaluated belongs to a preset second state category. In one embodiment, the encoding module is further configured to determine paragraph information of the psychological consulting title, and encode the paragraph information of the psychological consulting title to obtain a segment encoding vector corresponding to the psychological consulting title; determining the position information of the aimed segmentation word in the psychological consultation title aiming at each segmentation word in the psychological consultation title, and encoding the position information to obtain a position encoding vector corresponding to the aimed segmentation word; and carrying out word embedding processing on the aimed segmentation word to obtain a word coding vector corresponding to the aimed segmentation word, and obtaining coding data corresponding to the aimed segmentation word according to a segment coding vector corresponding to the psychological consultation title, a position coding vector corresponding to the aimed segmentation word and a word coding vector.
In one embodiment, the encoding module is further configured to encode, for each reply in the at least one reply, paragraph information of the reply to be targeted, to obtain a segment encoding vector corresponding to the reply to be targeted; respectively carrying out position coding and word embedding processing on each word in the aimed reply to obtain a position coding vector and a word coding vector corresponding to each word in the aimed reply; determining coding sub-data corresponding to each word in the aimed reply according to the segment coding vector corresponding to the aimed reply, the position coding vector corresponding to each word in the aimed reply and the word coding vector; and obtaining the coded data corresponding to the aimed reply according to the coded sub-data corresponding to each word in the aimed reply.
In one embodiment, the attention processing module is further configured to determine, for each word segment in the psychological consultation title, a correlation between the encoded data of the targeted word segment and the encoded data of each word segment in the psychological consultation title; determining a first contribution weight set corresponding to the specific word segment according to the correlation degree between the coded data of the specific word segment and the coded data of each word segment in the psychological consultation title; the first contribution weight set comprises first contribution weights corresponding to each word in the psychological consultation title; based on the first contribution weight set corresponding to the specific word, carrying out fusion processing on the coded data of each word to obtain fusion coded data corresponding to the specific word; splicing the fusion coding data corresponding to each word segment to obtain spliced fusion coding data; and decoding the spliced fusion encoded data to obtain a state degree label corresponding to the psychological consultation title. In one embodiment, the at least one reply corresponds to the second attention processing result respectively, and the second attention processing result comprises fusion coding data corresponding to the at least one reply respectively; the attention processing module is further used for obtaining decoding data corresponding to a previous reply before the current reply for each reply in the psychological consultation data packet; determining second contribution weights corresponding to each reply in the psychological consultation data packet according to the decoding data corresponding to the previous reply and the coding data corresponding to each reply in the psychological consultation data packet; determining fusion coding data corresponding to the current reply according to the coding data corresponding to each reply in the psychological consultation data packet and the corresponding second contribution weight; determining the decoding data corresponding to the current reply according to the fusion coding data corresponding to the current reply, the decoding data corresponding to the previous reply and the state degree label, and determining the state degree label corresponding to the current reply based on the decoding data corresponding to the current reply; and entering a state degree label determining process of the next round, taking the next reply after the current reply in the psychological consultation data packet as a new current reply, and returning to execute the step of obtaining the decoding data corresponding to the previous reply before the current reply until the state degree label corresponding to each reply in the psychological consultation data packet is obtained.
In one embodiment, the attention processing module is further configured to determine a correlation between the decoded data corresponding to the previous reply and the encoded data corresponding to each reply in the psychological consulting data packet, respectively; and according to the determined relevance, determining a second contribution weight corresponding to each reply in the psychological consultation data packet.
In one embodiment, the attention processing module is further configured to perform dot product operation on the decoded data corresponding to the previous reply and the encoded data corresponding to each reply in the psychological consultation data packet, so as to obtain a dot product operation result corresponding to each reply in the psychological consultation data packet; and regarding each dot product operation result, taking the pointed dot product operation result as the correlation degree between the decoding data corresponding to the previous reply and the encoding data corresponding to the corresponding reply.
In a third aspect, the present application also provides a computer device, where the computer device includes a memory and a processor, where the memory stores a computer program, and where the processor implements steps in any of the artificial intelligence based psychological assessment methods provided by the embodiments of the present application when the computer program is executed.
In a fourth aspect, the present application also provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of any of the artificial intelligence based psychological assessment methods provided by the embodiments of the present application.
In a fifth aspect, the present application also provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of any of the artificial intelligence based psychological assessment methods provided by the embodiments of the present application.
According to the psychological assessment method, device, computer equipment, storage medium and computer program product based on artificial intelligence, the text in the psychological consultation text packet can be encoded by acquiring the psychological consultation text packet of the object to be assessed, and encoded data containing semantic information in the text can be obtained. By obtaining the encoded data containing the semantic information, the encoded data corresponding to the psychological consultation title and the encoded data corresponding to the reply can be respectively subjected to attention processing, so that the model can pay more attention to the information which is more valuable for generating the state degree label, and thus, the more accurate state degree label corresponding to the psychological consultation title and the state degree label corresponding to the reply can be obtained based on the more valuable information, and thus, the more accurate psychological state degree information can be obtained based on the more accurate state degree label. Because the application can automatically generate the psychological state degree information, compared with the traditional method which needs psychological consultants to chat one by one to determine the psychological state of the object to be evaluated, the method can greatly improve the determination efficiency of the psychological state of the object to be evaluated. In addition, the application can generate a state degree label aiming at the psychological consultation title and each reply, so that the model can combine a plurality of state degree labels to obtain more accurate psychological state degree information.
In a first aspect, the present application provides an artificial intelligence based psychological assessment method, the method comprising:
acquiring a psychological consultation sample text packet and a sample label set corresponding to the psychological consultation sample text packet; the psychological consultation sample text pack includes at least one sample text; the sample label set comprises sample labels corresponding to the at least one sample text respectively;
respectively encoding sample texts in the psychological consultation sample text packet to obtain sample encoding data corresponding to each sample text in the psychological consultation sample text packet;
performing attention processing based on sample coding data corresponding to each sample text in the psychological consultation sample text packet to obtain a plurality of weighted sample coding data, and decoding the weighted sample coding data to obtain a prediction label corresponding to each sample text in the psychological consultation sample text packet;
training a psychological assessment model according to the sample label set and the prediction labels corresponding to each sample text in the psychological consultation sample text packet; the trained psychological assessment model is used for determining the psychological state of the object to be assessed.
In a second aspect, the present application also provides an artificial intelligence based psychological assessment apparatus, the apparatus comprising:
the training data acquisition module is used for acquiring a psychological consultation sample text packet and a sample label set corresponding to the psychological consultation sample text packet; the psychological consultation sample text pack includes at least one sample text; the sample label set comprises sample labels corresponding to the at least one sample text respectively;
the prediction tag determining module is used for respectively encoding sample texts in the psychological consultation sample text packet to obtain sample encoding data corresponding to each sample text in the psychological consultation sample text packet; performing attention processing based on sample coding data corresponding to each sample text in the psychological consultation sample text packet to obtain a plurality of weighted sample coding data, and decoding the weighted sample coding data to obtain a prediction label corresponding to each sample text in the psychological consultation sample text packet;
the model parameter adjustment module is used for training a psychological assessment model according to the sample label set and the prediction labels corresponding to each sample text in the psychological consultation sample text packet; the trained psychological assessment model is used for determining the psychological state of the object to be assessed.
In one embodiment, the training data acquisition module is further configured to acquire a pre-trained label annotation model; the label labeling model is obtained by training a natural language task processing model through a sample psychological consultation title; performing label prediction on the sample replies in the psychological consultation text packet through the label labeling model to obtain sample labels corresponding to the sample replies; and generating a corresponding sample label set through the sample labels corresponding to the sample replies.
In one embodiment, during training, model parameters of the psychological assessment model are adjusted in a direction to minimize generalization risk and experience risk; the generalization risk is determined by a generalization risk function; the generalized risk function is used for determining the expectation that the psychological assessment model outputs a sample label set based on a psychological consultation sample text packet; the experience risk is determined by an experience risk function; the experience risk function is used for determining errors between sample tags in the sample tag set and corresponding prediction tags; in the training process, the psychological assessment model is located in a preset generalized boundary; the generalization boundary is obtained by minimizing the complexity of the set of hypothetical classes.
In a third aspect, the present application also provides a computer device, where the computer device includes a memory and a processor, where the memory stores a computer program, and where the processor implements steps in any of the artificial intelligence based psychological assessment methods provided by the embodiments of the present application when the computer program is executed.
In a fourth aspect, the present application also provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of any of the artificial intelligence based psychological assessment methods provided by the embodiments of the present application.
In a fifth aspect, the present application also provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of any of the artificial intelligence based psychological assessment methods provided by the embodiments of the present application.
According to the psychological assessment method, the psychological assessment device, the computer equipment, the storage medium and the computer program product based on the artificial intelligence, sample texts in the psychological consultation sample text packet can be respectively encoded by acquiring the psychological consultation sample text packet and the sample label set, and sample encoded data can be obtained. By deriving the sample encoded data, attention can be given to the sample encoded data so that the model can focus on more valuable information, thereby outputting more accurate predictive labels based on the more valuable information. By outputting the predictive label, the psychological assessment model to be trained can be trained based on the predictive label and the sample label set, and therefore the trained psychological assessment model is obtained. Because the trained psychological assessment model can automatically generate psychological state degree information, compared with the traditional method that psychological consultants need to chat one by one to determine the psychological state of the object to be assessed, the method and the device can greatly improve the determination efficiency of the psychological state of the object to be assessed.
Drawings
FIG. 1 is a diagram of an application environment for an artificial intelligence based psychological assessment method in one embodiment;
FIG. 2 is a flow diagram of an artificial intelligence based psychological assessment method in one embodiment;
FIG. 3 is a schematic diagram of a central office advisory text package in one embodiment;
FIG. 4 is a schematic diagram of task processing in one embodiment;
FIG. 5 is a schematic diagram of a central management assessment model according to one embodiment;
FIG. 6 is a diagram illustrating the determination of encoded data corresponding to a reply in one embodiment;
FIG. 7 is a schematic diagram of the generation of status level tags in one embodiment;
FIG. 8 is a flow chart of an overall mental assessment method based on artificial intelligence in one embodiment;
FIG. 9 is a flow diagram of a mental assessment method based on artificial intelligence in one embodiment;
FIG. 10 is a flow chart of a mental assessment method based on artificial intelligence in one embodiment;
FIG. 11 is a diagram showing a comparison of Chinese and English word clouds in one embodiment;
FIG. 12 is a word cloud contrast schematic for depressive and non-depressive in one embodiment;
FIG. 13 is a block diagram of an artificial intelligence based psychological assessment device in one embodiment;
FIG. 14 is a block diagram of an artificial intelligence based psychological assessment device according to another embodiment;
Fig. 15 is an internal structural view of a computer device in one embodiment.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
The psychological assessment method based on artificial intelligence provided by the embodiment of the application can be applied to an application environment shown in figure 1. Wherein the terminal 102 communicates with the server 104 via a network. The data storage system may store data that the server 104 needs to process. The data storage system may be integrated on the server 104 or may be located on the cloud or other servers. Both the terminal 102 and the server 104 may be used separately to perform the artificial intelligence based psychological assessment method provided in embodiments of the present application. The terminal 102 and the server 104 may also cooperate to perform the artificial intelligence based psychological assessment method provided in embodiments of the present application. Taking the example that the terminal 102 and the server 104 can cooperate to execute the psychological assessment method based on artificial intelligence provided in the embodiment of the present application as an example, when the terminal 102 obtains the psychological consulting text packet of the object to be assessed, the psychological consulting text packet can be sent to the server 104, so that the server can determine the psychological state of the object to be assessed based on the received psychological consulting text packet. The terminal 102 may be, but not limited to, various desktop computers, notebook computers, smart phones, tablet computers, internet of things devices, and portable wearable devices, where the internet of things devices may be smart speakers, smart televisions, smart air conditioners, smart vehicle devices, and the like. The portable wearable device may be a smart watch, smart bracelet, headset, or the like. The server 104 may be implemented as a stand-alone server or as a server cluster of multiple servers.
It should be noted that the terms "first," "second," and the like as used herein do not denote any order, quantity, or importance, but rather are used to distinguish one element from another. The singular forms "a," "an," or "the" and similar terms do not denote a limitation of quantity, but rather denote the presence of at least one, unless the context clearly dictates otherwise. The numbers of "plural" or "multiple" etc. mentioned in the embodiments of the present application each refer to the number of "at least two", for example, "plural" means "at least two", and "multiple" means "at least two".
The present application relates to artificial intelligence (Artificial Intelligence, AI), which is a theory, method, technique and application system that simulates, extends and expands human intelligence, senses the environment, acquires knowledge and uses knowledge to obtain optimal results using a digital computer or a machine controlled by a digital computer. In other words, artificial intelligence is an integrated technology of computer science that attempts to understand the essence of intelligence and to produce a new intelligent machine that can react in a similar way to human intelligence. Artificial intelligence, i.e. research on design principles and implementation methods of various intelligent machines, enables the machines to have functions of sensing, reasoning and decision.
In one embodiment, as shown in fig. 2, a psychological assessment method based on artificial intelligence is provided, and the method is applied to a computer device, which may be a terminal or a server in fig. 1, for example. The psychological assessment method based on artificial intelligence comprises the following steps:
step 202, obtaining a psychological consulting text packet of an object to be evaluated, and respectively encoding each text in the psychological consulting text packet to obtain a plurality of encoded data.
The object to be evaluated refers to an object of a psychological state to be determined, and the object to be evaluated can be a natural person or a virtual person. The psychological consultation text package is a text package including at least one text. Wherein, the text can be psychological consultation title or reply related to the psychological consultation title; that is, the psychological consulting text packet may include a psychological consulting title and a reply associated with the psychological consulting title, or the psychological consulting text may include a psychological consulting title without including a reply associated with the psychological consulting title. The psychological consultation title may be a title sent by the subject to be evaluated, and the reply related to the psychological consultation title may be multiple rounds of dialogue content related to the consultation title. For example, referring to FIG. 3, the psychological consultation title may be 301 in FIG. 3 and the reply may be 302 in FIG. 3. The replies can be questions sent by other objects or replies to questions by the object to be evaluated, and can also be comments sent by other objects. FIG. 3 illustrates a schematic diagram of a central management advisory text package in one embodiment.
Specifically, the computer device may obtain a psychological consulting text packet of the object to be evaluated, and encode each text in the psychological consulting text packet by using an encoder, so as to obtain a plurality of encoded data.
In one embodiment, the object to be evaluated may issue a psychological consulting title, and other objects may reply to the psychological consulting title, and the object to be evaluated may also reply to replies issued by other objects, so that, after multiple rounds of conversations, a psychological consulting title package including the psychological consulting title and replies related to the psychological consulting title may be obtained.
In one embodiment, before obtaining the psychological consulting title package of the object to be evaluated, authorization of the object to be evaluated may be obtained, and after the object to be evaluated authorizes the computer device, the computer device obtains the psychological consulting title package of the object to be evaluated again.
In one embodiment, the process of encoding the text may be a process of extracting features from the text, and the encoded data obtained by encoding may be semantic features learned by performing semantic learning on the text.
In one embodiment, the psychological consulting title and the reply related to the psychological consulting title may be encoded first to obtain a plurality of encoded data, and then the psychological consulting text packet may be obtained based on the plurality of encoded data.
In one embodiment, the computer device may encode the text by a BERT (Bidirectional Encoder Representations from Transformers, bi-directional encoder characterizations from a transformer) model to obtain encoded data.
Step 204, when the psychological consulting text packet includes a psychological consulting title and a plurality of replies associated with the psychological consulting title, performing first attention processing on the coded data corresponding to each word in the psychological consulting title, determining a first contribution weight of the state degree label corresponding to the psychological consulting title based on each word in the psychological consulting title, obtaining a first attention processing result corresponding to the psychological consulting title, and decoding the first attention processing result to obtain the state degree label corresponding to the psychological consulting title.
In particular, referring to FIG. 4, the artificial intelligence based psychological assessment method of the present application corresponds to two tasks. The first task is to determine whether the psychological state of the subject to be evaluated belongs to a preset second state category, and whether the psychological state of the subject to be evaluated belongs to an abnormal category may be determined by including a psychological consulting text packet including a psychological consulting title and not including a reply related to the psychological consulting title, for example, a psychological consulting text packet including a psychological consulting title and not including a reply related to the psychological consulting title. The second task is to determine the level of the psychological of the subject to be evaluated under the preset first state category, and the level of the psychological of the subject to be evaluated under the preset first state category may be determined by a psychological consulting text packet including a psychological consulting title and a reply related to the psychological consulting title, for example, the level of psychological tendency of the subject to be evaluated to harm others or oneself may be determined by a psychological consulting text packet including a psychological consulting title and a reply related to the psychological consulting title. FIG. 4 illustrates a schematic diagram of task processing in one embodiment.
When the plurality of encoded data are obtained, if classification is directly performed based on the plurality of encoded data to determine the psychological state of the object to be evaluated, the time information in the psychological consultation text packet is lost. The attention mechanism may process the time series data and obtain corresponding results based on more valuable information. Therefore, the application applies the attention mechanism on the coded data to obtain the time information in the psychological consultation text packet, and further obtains more accurate psychological states of the object to be processed based on the time information.
More specifically, when the psychological consultation text packet includes a psychological consultation title and a reply associated with the psychological consultation title, the computer device may perform a second task, the computer device performs a first attention process on the encoded data corresponding to each of the divided words in the psychological consultation title based on the divided words in the psychological consultation title, determines which divided words should be more paid attention to under the task of generating a state degree label corresponding to the psychological consultation title, to obtain a first attention process result corresponding to the psychological consultation title, and generates a state degree label corresponding to the psychological consultation title based on the first attention process result. And the state degree label is used for representing the degree grade of the object to be evaluated under the first state category. The preset first state category may be a psychological abnormality category or an injury category. For example, the state degree label can be used for representing the degree of psychological abnormality of the object to be evaluated; or may be used to characterize the extent to which the subject under evaluation tends to injure itself or others.
In one embodiment, the computer device may determine the first contribution weight corresponding to each word segment based on the attention mechanism, so that the computer device performs weighted summation processing on the encoded data corresponding to each word segment and the corresponding first contribution weight to obtain weighted summation data, where the weighted summation data is a first attention processing result corresponding to the psychological consultation title, and further decodes the weighted summation data to obtain the state degree label corresponding to the psychological consultation title.
In one embodiment, an attention mechanism is preset in the computer device, so that the attention weight corresponding to each word segment can be obtained through the preset attention mechanism. For example, the attention mechanism can be used for determining which word to pay more attention to under the task of generating the state degree label corresponding to the psychological consultation title, so that the attention weight of the word to pay more attention to is improved.
And step 206, when the second attention processing is performed on the coded data corresponding to each of the plurality of replies, determining the second contribution weight of the state degree label corresponding to the reply based on the at least one reply pair, obtaining a second attention processing result, and respectively decoding each second attention processing result to obtain at least one state degree label corresponding to each reply.
Specifically, when the psychological consultation text packet includes a psychological consultation title and replies related to the psychological consultation title, the computer device may execute a second task, and the computer device performs a second attention processing on the encoded data corresponding to each reply based on the encoded data corresponding to each reply, thereby obtaining a second attention processing result, and obtains a state degree label corresponding to each reply based on the second attention result.
In one embodiment, the computer device may generate a respective status level tag for each reply in turn, so that, when each status level tag is generated, the computer device determines a second attention processing result, and generates a corresponding status level tag based on the determined second attention processing result. For example, when the status level tag corresponding to the first reply needs to be generated, the computer device may determine, through an attention mechanism, which replies should be paid more attention to under the task of generating the status level tag corresponding to the first reply, to obtain a second contribution weight set corresponding to the first reply, where the second contribution weight set corresponding to the first reply includes a second contribution weight corresponding to each reply. The computer device performs weighted summation on the coded data corresponding to each reply according to the second contribution weight set corresponding to the first reply to obtain a second attention processing result corresponding to the first reply, and the computer device can further determine a state degree label corresponding to the first reply based on the second attention processing result. When the state level label corresponding to the second reply needs to be generated, the computer device may determine, through the attention mechanism, which replies should be paid more attention to under the task of generating the state level label corresponding to the second reply, so as to obtain a second attention processing result corresponding to the second reply, and further the computer device may determine the state level label corresponding to the second reply based on the second attention processing result. And by analogy, the state degree label corresponding to each reply in the psychological consultation text packet can be obtained. Step 206, determining the psychological state degree information of the object to be evaluated according to the state degree label corresponding to the psychological consultation title and the state degree labels corresponding to the replies.
Specifically, when the state degree label corresponding to the psychological consulting title and the state degree label corresponding to each reply in the psychological consulting text packet are obtained, the computer device may determine the psychological state degree information of the object to be evaluated according to the state degree label corresponding to the psychological consulting title and the state degree label corresponding to each reply in the psychological consulting text packet. For example, the psychological state degree information of the object to be evaluated may be specifically a target state degree label of the object to be evaluated, the computer device is provided with a pre-trained classifier, and the target state degree label of the object to be evaluated is output based on the state degree label corresponding to the psychological consultation title and the state degree label corresponding to each reply in the psychological consultation text packet through the pre-trained classifier, so as to reflect the degree of the object to be evaluated under the preset first state category through the target state degree label.
In one embodiment, the computer device may use the most frequently occurring state level label as the target state level label, generate a psychological intervention measure corresponding to the target state level label, and determine psychological state information of the object to be evaluated based on the target state level label and the corresponding psychological intervention measure. In one embodiment, the state degree label may be a probability value, and the computer device may perform an average operation on each probability value to obtain a probability average value. The computer device may generate a psychological intervention measure corresponding to the probability mean value, and obtain psychological state information of the object to be evaluated based on the probability mean value and the generated psychological intervention measure.
In one embodiment, the artificial intelligence based psychological assessment method is performed by a psychological assessment model; the psychological assessment model comprises a multi-classification model; the mental state information is obtained through a multi-classification model, and the mental state information comprises at least one of the degree level of the object to be evaluated under the preset target state category and the psychological intervention measures adopted.
Specifically, the above-described artificial intelligence-based psychological assessment method may be performed by a psychological assessment model, which may be used to perform two tasks, since the artificial intelligence-based psychological assessment method may correspond to the two tasks. Wherein the psychological assessment model may comprise a bi-classification model through which a first task may be performed and a multi-classification model through which a second task may be performed. Thus, the above-described mental state degree information is obtained by a multi-classification model. For example, referring to fig. 5, a multi-classification model and a bi-classification model may be deployed in the psychological assessment model, and by using the multi-classification model, it may be determined which classification of the multiple degree classifications the psychological state of the subject to be assessed belongs to, so as to obtain the psychological state degree information of the subject to be assessed based on the determined classification. FIG. 5 illustrates a schematic diagram of a central management assessment model, according to one embodiment.
In one embodiment, the psychological state degree information may include at least one of a degree level of the psychological state of the subject to be evaluated under a preset first state category, and psychological intervention taken. For example, when the first status category is an injury category, the mental state degree information may include the degree to which the subject to be evaluated tends to injure itself or others, and may also include mental intervention measures taken by the subject to be evaluated.
In the psychological assessment method based on artificial intelligence, the text in the psychological consultation text packet can be encoded by acquiring the psychological consultation text packet of the object to be assessed, so that encoded data containing semantic information in the text can be obtained. By obtaining the encoded data containing the semantic information, the encoded data corresponding to the psychological consultation title and the encoded data corresponding to the reply can be respectively subjected to attention processing, so that the model can pay more attention to the information which is more valuable for generating the state degree label, and thus, the more accurate state degree label corresponding to the psychological consultation title and the psychological consultation label corresponding to the reply can be obtained based on the more valuable information, and therefore, the more accurate psychological state degree information can be obtained based on the more accurate state degree label. Because the application can automatically generate the psychological state degree information, compared with the traditional method which needs psychological consultants to chat one by one to determine the psychological state of the object to be evaluated, the method can greatly improve the determination efficiency of the psychological state of the object to be evaluated. In addition, the application can generate a state degree label aiming at the psychological consultation title and each reply, so that the model can combine a plurality of state degree labels to obtain more accurate psychological state degree information.
In one embodiment, the psychological assessment model comprises a classification model; the method further comprises the following steps: when the psychological consultation text packet comprises a psychological consultation title and does not comprise replies associated with the psychological consultation title, performing third attention processing on the coding data corresponding to each word in the psychological consultation title through a classification model, determining whether the psychological state of the object to be evaluated belongs to a third contribution weight of a preset second state category based on each word pair in the psychological consultation title, obtaining a third attention processing result, and determining whether the psychological state of the object to be evaluated belongs to the preset second state category based on the third attention processing result.
In particular, since the artificial intelligence based psychological assessment method may correspond to two tasks, the psychological assessment model may also be used to perform two tasks. Referring to fig. 5, the psychological assessment model may include a classification model in addition to a multi-classification model. A psychological consulting text packet including a psychological consulting title but not including a reply associated with the psychological consulting title may be processed through the classification model to determine whether the psychological state of the subject to be evaluated belongs to a preset second state class. When the preset second state type is a state abnormality type, determining whether the psychology of the object to be evaluated is abnormal or not through a classification model.
When determining whether the psychological state of the object to be evaluated is abnormal through the classification model, the classification model can conduct third attention processing on the coding data corresponding to each word in the psychological consultation title, so that a third attention processing result is obtained, and whether the psychological state of the object to be evaluated belongs to a preset second state class is determined based on the third attention processing result. The third attention processing may refer to the first attention processing described above. The present embodiment is not described herein.
In the above embodiment, by setting the classification model and the multi-classification model, the computer device can adaptively select the models based on the content in the received psychological consulting text packet, so that when the psychological consulting text packet only includes the psychological consulting title, the psychology of the object to be processed can be classified into two categories, and when the psychological consulting text packet includes the psychological consulting title and the reply, the psychology of the object to be processed can be classified into more fine multi-categories, thereby improving the flexibility of psychological assessment. In addition, since the multi-classification process is performed only when the psychological consultation title and the reply are included in the psychological consultation text packet, the model can output more accurate psychological state degree information based on more information.
In one embodiment, the encoding step of the psychological consultation title includes: determining paragraph information of the psychological consultation title, and coding the paragraph information of the psychological consultation title to obtain a paragraph coding vector corresponding to the psychological consultation title; determining the position information of the aimed segmentation word in the psychological consultation title aiming at each segmentation word in the psychological consultation title, and encoding the position information to obtain a position encoding vector corresponding to the aimed segmentation word; and carrying out word embedding processing on the aimed segmentation word to obtain a word coding vector corresponding to the aimed segmentation word, and obtaining coded data corresponding to the aimed segmentation word according to the segment coding vector corresponding to the psychological consultation title, the position coding vector corresponding to the aimed segmentation word and the word coding vector.
Specifically, when the psychological consultation title is obtained, the computer device may perform encoding processing on the psychological consultation title through an encoder in the psychological assessment model. The encoder may determine paragraph information of the psychological consultation title. The paragraph information may be a position of a sentence to be currently encoded in a paragraph of text, which is used to distinguish different sentences in the paragraph of text. The encoder can encode the paragraph information to obtain a segment encoding vector corresponding to the psychological consultation title. Further, the encoder can perform word segmentation processing on the psychological consultation title to obtain a plurality of words in the psychological consultation title. For convenience of description, the word in the psychological consultation title will be referred to as title word. For any title word i in the psychological consultation title, the computer equipment performs word embedding processing on the title word i so as to map the title word i into a high-dimensional space and obtain a word coding vector corresponding to the title word i. The computer device may further determine a position of the title word i in the psychological consultation title, for example, determine what word the title word i is in the psychological consultation title, and encode the position to obtain a position encoding vector corresponding to the title word i.
Further, the computer device superimposes the segment code vector corresponding to the psychological consultation title, the word code vector corresponding to the title word i and the position code vector corresponding to the title word i to obtain code data corresponding to the title word i. The encoder can encode each title word in the manner described above, so as to obtain the encoded data corresponding to each title word in the psychological consultation title.
It is easy to understand that, whether determining the psychological state degree information of the object to be evaluated or determining whether the psychological state of the object to be evaluated belongs to the preset second state category, the encoder encodes the psychological consultation title according to the above method, so as to obtain the encoding data corresponding to each title word in the psychological consultation title.
In this embodiment, by encoding each title word in the psychological consulting title, a foundation is laid for determining the label corresponding to the psychological consulting title in the following process.
In one embodiment, the encoding step of the at least one reply comprises: for each reply in at least one reply, encoding paragraph information of the reply to be aimed to obtain a segment encoding vector corresponding to the reply to be aimed; respectively carrying out position coding and word embedding processing on each word in the aimed reply to obtain a position coding vector and a word coding vector corresponding to each word in the aimed reply; determining coding sub-data corresponding to each word in the aimed reply according to the segment coding vector corresponding to the aimed reply, the position coding vector corresponding to each word in the aimed reply and the word coding vector; and obtaining the code data corresponding to the aimed reply according to the code sub-data corresponding to each word in the aimed reply.
In particular, in the case where the psychological consulting text bundle includes replies corresponding to psychological consulting titles, the encoder in the psychological assessment model may encode each reply separately. For any reply i in the psychological consultation text packet, the encoder can determine paragraph information of the reply i and encode the paragraph information of the reply i to obtain a paragraph code vector corresponding to the reply i. For descriptive convenience, the word in the reply will be referred to as a reply word. Further, the encoder can respectively perform position coding and word embedding processing on each reply word in the reply i to obtain a position coding vector and a word coding vector corresponding to each reply word. For any reply word i in the reply i, the encoder can superimpose the segment code vector corresponding to the reply i, the position code vector corresponding to the reply word i and the word code vector corresponding to the reply word i to obtain the code sub-data corresponding to the reply word i. The encoder synthesizes the encoded sub data corresponding to each reply word in the reply i, and then obtains the encoded data corresponding to the reply i.
For example, referring to fig. 6, when two replies are included in the psychological consultation text packet, the encoder may obtain a segment code vector, a word code vector and a position code vector corresponding to each reply segmentation. Wherein the segment code vectors of the reply segmentation in the same reply are the same. Further, the encoder superimposes the segment code vector, the word code vector and the position code vector corresponding to each reply word to obtain the code sub-data corresponding to each reply word, so that the encoder can determine the corresponding code data based on the obtained code sub-data. FIG. 6 is a diagram illustrating the determination of encoded data corresponding to a reply in one embodiment.
In this embodiment, by performing encoding processing on each reply, the psychological assessment model may learn respective semantic information of each reply, so that the psychological assessment model is convenient to accurately determine the psychological state of the object to be assessed based on the learned semantic information.
In one embodiment, when performing first attention processing on the encoded data corresponding to each word in the psychological consultation title, based on a first contribution weight of each word pair in the psychological consultation title to determining a state degree label corresponding to the psychological consultation title, obtaining a first attention processing result, and decoding the first attention processing result to obtain the state degree label corresponding to the psychological consultation title, including: for each word in the psychological consultation title, determining the relativity between the coding data of the word in question and the coding data of each word in the psychological consultation title; determining a first contribution weight set corresponding to the specific word according to the correlation degree between the coded data of the specific word and the coded data of each word in the psychological consultation title; the first contribution weight set comprises first contribution weights corresponding to each word in the psychological consultation title; based on a first contribution weight set corresponding to the specific word, carrying out fusion processing on the coded data of each word to obtain fusion coded data; splicing the fusion coding data corresponding to each word to obtain spliced fusion coding data; and decoding the spliced and fused encoded data to obtain a state degree label corresponding to the psychological consultation title.
Specifically, two attention processing paths may be deployed in the multi-classification model in the psychological assessment model, where one of the attention processing paths is used for performing attention processing on the encoded data corresponding to the psychological consultation title, and the other of the attention processing paths is used for performing attention processing on the encoded data corresponding to the reply. When the attention processing is required to be performed on the coded data corresponding to the psychological consultation title, the multi-classification model can determine the current title word and the correlation between the current title word and each title word for each title word in the psychological consultation title, and determine the first contribution weight set corresponding to the current title word based on the correlation. The first contribution weight set comprises first contribution weights corresponding to the title word. And the multi-classification model performs weighted summation processing on the coded data corresponding to each title word according to the first contribution weight set corresponding to the current title word to obtain fused coded data corresponding to the current title word. For example, the multi-classification model may determine a correlation between decoded data corresponding to a previous subject matter word and encoded data corresponding to each subject matter word, where the higher the correlation, the greater the first contribution weight.
Further, when determining the fusion encoded data corresponding to each title word, the computer device may splice the fusion encoded data to obtain spliced fusion encoded data, and decode the spliced fusion encoded data to obtain a state degree label corresponding to the psychological consultation title.
It is easy to understand that the classification model in the psychological assessment model may also determine whether the psychological state of the object to be assessed belongs to the preset second state classification in the above manner.
In this embodiment, the state degree label corresponding to the psychological consulting title is obtained through the attention mechanism, so that the model can obtain the state degree label based on the time dimension information in the psychological consulting title, and the determined state degree label is more accurate.
In one embodiment, the at least one reply to the respective second attention processing result includes at least one reply to the respective fusion encoded data; when the second attention processing is performed on the coded data corresponding to each reply, for each reply of the at least one reply, based on the second contribution weight of the at least one reply to the state degree label corresponding to the reply, a second attention processing result is obtained, and each second attention processing result is decoded to obtain the state degree label corresponding to each reply, including: for each reply in the psychological consultation data packet, obtaining decoding data corresponding to a previous reply before the current reply; determining a second contribution weight corresponding to each reply in the psychological consultation data packet according to the decoding data corresponding to the previous reply and the coding data corresponding to each reply in the psychological consultation data packet; determining fusion coding data corresponding to the current reply according to the coding data corresponding to each reply in the psychological consultation data packet and the corresponding second contribution weight; determining decoding data corresponding to the current reply according to the fusion coding data corresponding to the current reply, decoding data corresponding to the previous reply and a state degree label, and determining the state degree label corresponding to the current reply based on the decoding data corresponding to the current reply; and entering a state degree label determining process of the next round, taking the next reply after the current reply in the psychological consultation data packet as a new current reply, and returning to the step of acquiring the decoding data corresponding to the previous reply before the current reply to continue until the state degree label corresponding to each reply in the psychological consultation data packet is obtained.
Specifically, two attention processing paths may be deployed in the multi-classification model in the psychological assessment model, where one of the attention processing paths is used for performing attention processing on the encoded data corresponding to the psychological consultation title, and the other of the attention processing paths is used for performing attention processing on the encoded data corresponding to the reply. In the process of performing attention processing on the coded data corresponding to the replies through another attention processing path, for each reply in the psychological consulting data packet, the multi-classification model can determine the current reply and acquire the decoded data corresponding to the previous reply before the current reply. For example, referring to fig. 7, when the current reply is reply 3, the multi-classification model may acquire decoded data q2. Further, the multi-classification model may determine the second contribution weight corresponding to each reply according to the decoded data corresponding to the previous reply and the encoded data corresponding to each reply, and obtain the fusion encoded data corresponding to the current reply through the encoded data corresponding to each reply and the corresponding second contribution weight. The multi-classification model determines the decoding data corresponding to the current reply according to the fusion coding data corresponding to the current reply, the decoding data corresponding to the previous reply and the state degree label, and generates the decoding data corresponding to the current reply. For example, the multi-classification model performs convolution processing on the fusion encoded data corresponding to the current reply, the decoded data corresponding to the previous reply and the state degree label to obtain the decoded data corresponding to the current reply, so that the decoded data corresponding to the current reply generates the state degree label corresponding to the current reply. The computer device may take the next reply after the current reply in the psychological consulting data packet as the new current reply, and continue to execute in the manner described above until the status level label corresponding to the last reply is obtained. FIG. 7 illustrates a schematic of the generation of a status level tag in one embodiment.
In one embodiment, for the first reply in the psychological consulting data packet, the encoded data of the first reply may be used as the decoded data corresponding to the previous reply.
In this embodiment, the state degree label corresponding to the reply is obtained through the attention mechanism, so that the model can obtain the state degree label based on the information of the time dimension in at least one reply, and the determined state degree label is more accurate.
In one embodiment, determining the second contribution weight corresponding to each reply in the psychological consulting data packet according to the decoded data corresponding to the previous reply and the respective coded data corresponding to each reply in the psychological consulting data packet includes: determining the correlation degree between the decoding data corresponding to the previous reply and the coding data corresponding to each reply in the psychological consultation data packet respectively; and determining a second contribution weight corresponding to each reply in the psychological consultation data packet according to the determined relevance.
In particular, the multi-classification model may determine the second contribution weight by relevance. For example, referring to fig. 7, when there are four replies and the encoded data corresponding to the four replies are h1 to h4, the multi-classification model may determine the correlation between the decoded data q2 corresponding to the previous reply and h1 to h4, so as to determine the respective second contribution weight of each reply based on the correlation between the decoded data q2 and h1 to h 4. Wherein, the higher the correlation, the greater the second contribution weight.
In one embodiment, when the second contribution weight is determined, the multi-classification model may rootAnd carrying out weighted summation processing according to the second contribution weight to obtain the decoding data corresponding to the current reply. For example, the multi-classification model may derive the decoded data corresponding to the current reply by the following formula:wherein X is i Coded data corresponding to the ith reply, a i And the second contribution weight corresponding to the ith reply. When obtaining the decoding data Z corresponding to the current reply i The multi-classification model may also determine the status level label to which the current reply corresponds based on the following formula: />Wherein (1)>Is a state degree label, f 2 Is a linear model with a parameter v.
In one embodiment, determining the correlation between the decoded data of the previous reply and the encoded data of each reply in the psychological consulting data packet, respectively, includes: respectively carrying out dot product operation on the decoding data corresponding to the previous reply and the coding data corresponding to each reply in the psychological consultation data packet to obtain the dot product operation result corresponding to each reply in the psychological consultation data packet; and regarding each dot product operation result, taking the pointed dot product operation result as the correlation degree between the decoding data corresponding to the previous reply and the encoding data corresponding to the corresponding reply.
In particular, the multi-classification model may obtain the correlation between the decoded data and the corresponding encoded data by means of dot product operation. For example, the multi-classification model may perform dot product operation on the decoded data corresponding to the previous reply and the encoded data corresponding to the 2 nd reply to obtain the correlation between the decoded data corresponding to the previous reply and the encoded data corresponding to the 2 nd reply.
In one embodiment, the multi-classification model may also obtain the correlation between the corresponding decoded data and the corresponding encoded data by an additive model, a scaled click model.
In the above embodiment, since the higher the correlation is, the more valuable the encoded data is characterized, by determining the correlation, the model can be focused in the more valuable encoded data, so that the result of the model output based on the more valuable encoded data can be more accurate.
In general, in the present application, referring to fig. 8, the first front end may transmit the psychological consulting text packet of the subject to be evaluated to the back end, so that the psychological assessment model in the back end may process the received psychological consulting text packet to output the result, and transmit the result to the second front end for presentation. The first front end and the second front end may be the same front end or may not be the same front end. FIG. 8 illustrates an overall flow diagram of an artificial intelligence based psychological assessment method in one embodiment.
In one embodiment, as shown in fig. 9, a psychological assessment method based on artificial intelligence is provided, and the method is applied to a computer device, which may be a terminal or a server in fig. 1, for example. The psychological assessment method based on artificial intelligence comprises the following steps:
step 902, acquiring a psychological consultation sample text packet and a sample label set corresponding to the psychological consultation sample text packet; the psychological consultation sample text package includes at least one sample; the sample tag set includes sample tags corresponding to each of the at least one sample text.
Specifically, training of the psychological assessment model is also required before the psychological assessment model is used. When training of the psychological assessment model is required, the computer device may obtain an instance package. For example, the instance package may include a plurality of psychological counseling sample text packages and respective sample tag sets for each psychological counseling sample package. For example, instance package p= ((U1, Y1), (U2, Y2) … (UN, YN)), where U1 to UN are psychological consultation sample text packages, and Y1 to YN are the corresponding sample tag sets.
In one embodiment, the psychological consultation sample text packet may be a text packet generated based on a chinese corpus, so that the model obtained based on the psychological consultation sample text packet training may also identify the chinese.
In one embodiment, the psychological counseling sample text packet includes at least one sample text, for example, the psychological counseling sample text packet may include a sample psychological counseling title and a sample reply associated with the sample psychological counseling title, and the psychological counseling sample text packet may also include only the sample psychological counseling title. It is readily understood that when a psychological counseling title is used for model training, the psychological counseling title is called a sample psychological counseling title, and when a reply is used for model training, the reply is called a sample reply. When the psychological counseling sample text packet includes a sample psychological counseling title and a sample reply associated with the sample psychological counseling title, that is, when the psychological counseling sample text packet ui= (UT, UR), the sample label set corresponding to the psychological counseling sample text packet may include a sample label corresponding to the sample psychological counseling title and a sample label corresponding to each sample reply. Where UT is a text package that includes a sample psychological consulting title and UR is a text package that includes a sample reply.
In one embodiment, when the psychological counseling sample text packet is used to train the multi-classification model in the psychological assessment model, the sample labels y in the sample label set corresponding to the psychological counseling sample text packet are: y is E (1, … k), and k is more than or equal to 2.
And 904, respectively encoding sample texts in the psychological counseling sample text packet to obtain sample encoding data corresponding to each sample text in the psychological counseling sample text packet.
Specifically, the computer device may input the psychological counseling sample text packet into the psychological assessment model to be trained, and encode the sample text in the psychological counseling sample text packet through the psychological assessment model to be trained, so as to obtain sample encoding data corresponding to each sample text in the psychological counseling sample text packet. The coding mode can refer to the coding mode of the texts in the psychological consultation text packet.
Step 906, performing attention processing based on the sample coding data corresponding to each sample text in the psychological consultation sample text packet to obtain a plurality of weighted sample coding data, and decoding the weighted sample coding data to obtain a prediction label corresponding to each sample text in the psychological consultation sample text packet.
Specifically, the psychological assessment model to be trained may perform attention processing on the sample coding data corresponding to each sample text in the psychological consulting sample text packet, so as to determine, based on the attention processing result, a prediction label corresponding to each sample text in the psychological consulting sample text packet. The method of performing attention processing on the sample encoded data may be referred to as the above-described method of performing attention processing on the encoded data. The weighted sample encoded data refers to data obtained by weighted summation of corresponding encoded data based on corresponding contribution weights.
In one embodiment, when the psychological counseling sample text includes a sample psychological counseling title and a reply corresponding to the sample psychological counseling title, the prediction label corresponding to each sample text may be predicted psychological state degree information, for example, may be a degree level of the predicted corresponding subject psychology under a preset first state category. When the psychological counseling sample text includes a sample psychological counseling title and does not include a sample reply, the prediction label corresponding to the sample text may be whether the predicted psychological state of the corresponding object belongs to a preset second state category.
Step 908, training the psychological assessment model according to the sample label set and the prediction labels corresponding to each sample text in the psychological consultation sample text packet; the trained psychological assessment model is used for determining the psychological state of the object to be assessed.
Specifically, after the prediction label is obtained, the model parameters of the psychological assessment model can be adjusted through the sample label set and the determined sample label, so that the psychological assessment model with the adjusted model parameters can output the prediction label which is closer to the sample label set.
In one embodiment, the predictive label is updated in order to converge the psychological assessment model. The sample tag set is mainly set to provide priori knowledge to the psychological assessment model for learning, and then the prediction tags are the results of self-model learning using the psychological assessment model.
According to the psychological assessment method based on artificial intelligence, the sample texts in the psychological consultation sample text packet can be respectively encoded by acquiring the psychological consultation sample text packet and the sample label set, so that sample encoded data can be obtained. By deriving the sample encoded data, attention can be given to the sample encoded data so that the model can focus on more valuable information, thereby outputting more accurate predictive labels based on the more valuable information. By outputting the predictive label, the psychological assessment model to be trained can be trained based on the predictive label and the sample label set, and therefore the trained psychological assessment model is obtained. Because the trained psychological assessment model can automatically generate psychological state degree information, compared with the traditional method that psychological consultants need to chat one by one to determine the psychological state of the object to be assessed, the method and the device can greatly improve the determination efficiency of the psychological state of the object to be assessed.
In one embodiment, the method further comprises: acquiring a pre-trained label labeling model; the label labeling model is obtained by training a natural language task processing model through a sample psychological consultation title; carrying out label prediction on sample replies in the psychological consultation text packet through a label labeling model to obtain sample labels corresponding to the sample replies; and generating a corresponding sample label set through the sample labels corresponding to the sample replies.
In particular, since a large number of sample replies are available, it takes a considerable amount of time for the researchers to label the sample replies. Therefore, a pre-trained label labeling model can be obtained, and label labeling processing is carried out on the sample reply through the pre-trained label labeling model so as to obtain a corresponding sample label. The pre-trained label labeling model may be obtained by training a natural language task processing model based on a sample psychological consultation title, for example, the pre-trained label labeling model may be obtained by training a BERT model based on a sample psychological consultation title, and the trained BERT model is the label labeling model. The BERT model has the capability of text classification and emotion analysis, so that a sample psychological consultation title can be input into the BERT model, a prediction label corresponding to the sample psychological consultation title is output through the BERT model, and model parameters of the BERT model are adjusted through differences between the sample label corresponding to the sample psychological consultation title and the prediction label, so that a trained BERT model is obtained.
In this embodiment, by obtaining the label labeling model, label labeling processing can be performed on the sample reply based on the label labeling model, so that compared with the traditional label labeling processing performed in a manual mode, the determination efficiency of the sample label corresponding to the sample reply is greatly improved.
In one embodiment, model parameters of the psychological assessment model are adjusted in a direction to minimize generalization risk and experience risk during training; the generalization risk is determined by a generalization risk function; a generalization risk function for determining a desire of a psychological assessment model to output a sample tag set based on a psychological consultation sample text packet; the empirical risk is determined by an empirical risk function; an empirical risk function is used to determine the error between a sample tag in the sample tag set and a corresponding predicted tag.
In particular, the psychological assessment model may be trained by minimizing generalization risk and experience risk. The prediction level of the generalization risk characterization model in front of the new data. The empirical risk characterizes the difference between the predictive tag and the sample tag. Let T.epsilon.Rd be the instance space. The psychological consulting sample text package U is a limited set of choices from T, where there may be multiple instances of each psychological consulting sample text package U. During training, the learner receives an instance package p= ((U1, y 1), (Un, yn))e (2 t×{ -1,1 }), where each psychological consultation sample text package is drawn independently according to some unknown distribution D over 2t×{ -1,1 }. In training a psychological assessment model, the following hypothesis classes are typically used:
F={f w :U→max t∈U <w,U>The W is less than or equal to N. Wherein wI represents the 2-norm of w; u is a psychological consultation sample text packet; f (f) w Is a hypothetical class; w is a parameter in the hypothesis class. Wherein the hypothesis class is a psychological assessment model of the hypothesis. Assume thatIs a zero-loss function of binary classification, where y is the sample tag, ++>To predict tags. The goal of the training is to find the hypothesis f that the generalization risk and experience risk are small w E F. Risk of generalization->And experience risk->The definition is as follows:
wherein E represents the desire, thusThe representative psychological assessment model outputs the expectations of the sample tab set based on the psychological consultation sample text packet. />Representing the sum of the errors between each sample tag in the sample tag set and the corresponding predictive tag.
In one embodiment, for experience risk minimization, a convex proxy loss (e.g., hinge loss l ub ) Thus, the convex proxy loss can be used to represent l U Proxy loss of (a)And causeThe process is as follows:
in this embodiment, in the training process, the trained state model is obtained by facing the direction of minimizing the generalization risk and the experience risk, so that the trained state model not only has good generalization performance, but also has good accuracy.
In one embodiment, during the training process, the psychological assessment model is located at a preset generalized boundary; the generalization boundary is obtained by minimizing the complexity of the set of hypothetical classes.
Specifically, both the psychological assessment model during training and the trained psychological assessment model lie between an upper and lower bound on the correct function. Let the hypothesis class: f= { F w :U→max t∈U <w,U>Let T be the instance space, T be the collection of any number, and A be the collection of any number. Order theThe psychometric assessment model is characterized between the upper and lower bounds of the correct function. The following interfaces are applicable to any +.>The complexity of the set of classes is assumed to be:
finding minimisationThe generalized boundaries can be obtained. Wherein L and LAN represent laplace transforms, a is a set of a preset number, and N is a set of real numbers. />Representing the computational complexity corresponding to the two classification models in the psychological assessment model, < >>U in (B) i A psychological consultation sample text packet for training the classification model in the psychological assessment model; />Representing the computational complexity corresponding to the multiple classification model in the psychological assessment model,/for>U in (B) i A psychological consultation sample text pack for training the multi-classification model in the psychological assessment model.
In this embodiment, since the psychological assessment model and the trained psychological assessment model in the training process are both located between the preset upper and lower bounds, the psychological assessment model is located between one upper and lower bounds, so that the psychological assessment model can be trained normally, and the trained psychological assessment model is obtained.
In one embodiment, referring to FIG. 10, FIG. 10 provides an artificial intelligence based psychological assessment method in one embodiment:
step 1002, a computer device obtains a psychological consulting sample text packet and a sample label set corresponding to the psychological consulting sample text packet.
Step 1004, the computer equipment encodes sample texts in the psychological counseling sample text packet respectively to obtain sample encoding data corresponding to each sample text in the psychological counseling sample text packet; and carrying out attention processing based on sample coding data corresponding to each sample text in the psychological consultation sample text packet to obtain an attention processing result, and determining a prediction label corresponding to each sample text in the psychological consultation sample text packet according to the attention processing result.
Step 1006, the computer device trains the psychological assessment model according to the sample label set and the prediction labels corresponding to each sample text in the psychological consultation sample text packet; the trained psychological assessment model is used for determining the psychological state of the object to be assessed.
In step 1008, the computer device obtains the psychological consulting text packet of the object to be evaluated, determines the paragraph information of the psychological consulting title in the psychological consulting text packet, and encodes the paragraph information of the psychological consulting title to obtain the segment encoding vector corresponding to the psychological consulting title.
Step 1010, for each word in the psychological consultation title, the computer device determines the position information of the word in the psychological consultation title and encodes the position information to obtain a position encoding vector corresponding to the word; and carrying out word embedding processing on the aimed segmentation word to obtain a word coding vector corresponding to the aimed segmentation word, and obtaining coded data corresponding to the aimed segmentation word according to the segment coding vector corresponding to the psychological consultation title, the position coding vector corresponding to the aimed segmentation word and the word coding vector.
Step 1012, when the psychological consulting text packet includes replies, aiming at each reply in the psychological consulting text packet, the computer equipment encodes paragraph information of the aimed reply to obtain a segment encoding vector corresponding to the aimed reply; respectively carrying out position coding and word embedding processing on each word in the aimed reply to obtain a position coding vector and a word coding vector corresponding to each word in the aimed reply; determining coding sub-data corresponding to each word in the aimed reply according to the segment coding vector corresponding to the aimed reply, the position coding vector corresponding to each word in the aimed reply and the word coding vector; and obtaining the code data corresponding to the aimed reply according to the code sub-data corresponding to each word in the aimed reply.
Step 1014, for each word in the psychological consultation title, determining a correlation between the encoded data of the word in question and the encoded data of each word in the psychological consultation title; determining a first contribution weight set corresponding to the specific word according to the correlation degree between the coded data of the specific word and the coded data of each word in the psychological consultation title; the first contribution weight set comprises a first contribution weight corresponding to each word in the psychological consultation title; and based on the first contribution weight set corresponding to the specific word, carrying out fusion processing on the coded data of each word to obtain fusion coded data corresponding to the specific word.
Step 1016, splicing the fusion coded data corresponding to each word segment to obtain spliced fusion coded data; and decoding the spliced and fused encoded data to obtain a state degree label corresponding to the psychological consultation title.
At step 1018, for each reply in the psychological consulting data packet, the computer device obtains decoded data corresponding to the immediately preceding reply that precedes the current reply.
Step 1020, the computer device determines a second contribution weight corresponding to each reply in the psychological consulting data packet according to the decoded data corresponding to the previous reply and the respective encoded data corresponding to each reply in the psychological consulting data packet; determining decoding data corresponding to the current reply according to the corresponding coding data and the corresponding second contribution weight of each reply in the psychological consultation data packet; and determining a state degree label corresponding to the current reply according to the decoded data corresponding to the current reply.
Step 1022, entering the state degree label determining process of the next round, and the computer device taking the next reply after the current reply in the psychological consulting data packet as the new current reply, and returning to execute the step of obtaining the decoded data corresponding to the previous reply before the current reply until the state degree label corresponding to each reply in the psychological consulting data packet is obtained.
In step 1024, the computer device determines the mental state degree information of the object to be evaluated according to the at least one reply corresponding to the state degree label and the state degree label corresponding to the mental consultation title.
In step 1026, in the case that the psychological consulting text packet includes the psychological consulting title and does not include the reply associated with the psychological consulting title, the computer device performs the third attention processing on the encoded data corresponding to each word in the psychological consulting title through the two-classification model, so as to obtain the third attention processing result, and determines whether the psychological state of the object to be evaluated belongs to the preset second state category based on the third attention processing result.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
The application also provides an application scene, which applies the psychological assessment method based on artificial intelligence. Specifically, the application of the psychological assessment method based on artificial intelligence in the application scene is as follows:
whether the psychological state of the object to be evaluated belongs to the preset second state category can be specifically whether the object to be evaluated is depressed; the level of the psychological level of the object to be evaluated under the preset first state category may specifically be the level that the object to be evaluated tends to injure itself or injure others. Currently, the number of people with depression is increasing and starts to grow to a degree that is not negligible. In order to determine whether an object to be evaluated has depression and how much the object to be evaluated tends to hurt itself or other people, the present application proposes a new idea combining multi-instance learning with an attention mechanism, called MIA, wherein each text in the package is an instance. The present application uses social media data to improve model performance. Depressed people share their current moods and prefer to communicate with others and seek assistance on the internet as compared to real life. Referring to fig. 11, words used by subjects suffering from chinese-english depression can be obtained by analyzing the words published by each subject through word cloud. It can be seen that subjects with depression will use more negative mood words (hard, depression, cranky) and negative words (do not love, dar not, cannot, no) in chinese literature. In addition, subjects with depression will often use the term depression in chinese literature. Referring to fig. 12, depressed subjects and words published by non-depressed subjects can be analyzed by word clouds, and it can be seen that depressed subjects use more negative vocabulary than non-depressed subjects. Thus, whether a corresponding subject is depressed may be determined by the text that the subject publishes. Fig. 11 shows a comparative schematic diagram of a chinese-english word cloud in one embodiment. Figure 12 shows a word cloud contrast schematic for depression and non-depression in one embodiment.
Based on this, the application can train the model through the corpus so that the trained model can recognize the emotion of the object. The data set adopted in the training process is a corpus generated for the application of the artificial intelligence technology in the psychological counseling field, is the first open corpus in the counseling field, is also the most widely disclosed Chinese counseling session corpus, and comprises 20,000 pieces of counseling data, wherein each piece of counseling data comprises multiple rounds of dialogue contents and corresponding classification labels. Psychological disorders and rescue-like conditions. The psychological assessment model obtained through training can be used for processing detection and intervention tasks. The detection task may be used to determine whether the subject to be evaluated is depressed; the intervention task can be used to identify potential injuries they may cause (to oneself or others) and take the necessary precautions.
For the encoder in the psychological assessment model, four models can be introduced as follows:
BERT-base-Chinese, traditional pre-trained model, contains 12 layers, 768-hidden,12-heads,110M parameters.
ALBERT-base-v2, ALBERT is a "compact version" of BERT, which is a popular unsupervised language representation learning algorithm. ALBERT trains models using the "no dropout", "additional training data" and "long training time" strategies.
BERTweet-base, BERTweet is the first public large language model to be pre-trained for english tweets. The corpus used to pretrain the BERTweet consisted of 850M english tweets.
XLNet-Chinese-base, XLNet is a novel unsupervised language representation learning model, reaching the most advanced level in emotion analysis.
In terms of data sets, we use EFAD for two tasks. There are 907 positive samples and 907 negative samples. Each sample (psychological consulting sample text package) has one title data and several reply data, or one title. For the test task (i.e., the first task described above), the data set may be divided into five minutes to obtain training samples and test samples. Furthermore, for an intervention task (i.e., the second task described above), the dataset may be halved to obtain training samples and test samples.
In terms of evaluation, a different evaluation index may be used to evaluate the performance of the model for each of the two tasks we propose. Since the detection task is a standard classification task, a general classification index can be used as the standard. The intervention task was a multi-classification task and performance was assessed using accuracy, macro-recovery, macro-precision, macro-F1.
It is emphasized that the detection of depression requires clinical identification, and that the present application only provides a reference result prior to a diagnosis of bed medicine, i.e. the present application only provides an intermediate result.
The application further provides an application scene, and the application scene applies the psychological assessment method based on artificial intelligence. Specifically, the application of the psychological assessment method based on artificial intelligence in the application scene is as follows:
whether the psychological state of the object to be evaluated belongs to the preset second state category can be specifically whether the emotion of the object to be evaluated is abnormal; the level of the psychological level of the subject to be evaluated under the preset first state category may specifically be the level of emotional abnormality of the subject to be evaluated. Whether the emotion of the object to be evaluated is abnormal or not can be determined through the psychological evaluation model, or the emotion abnormality degree of the object to be evaluated is determined, so that feasible suggestions are provided based on the emotion abnormality degree.
The above application scenario is only illustrative, and it is to be understood that the application of the artificial intelligence-based psychological assessment method provided by the embodiments of the present application is not limited to the above scenario.
Based on the same inventive concept, the embodiment of the application also provides an artificial intelligence-based psychological assessment device for realizing the artificial intelligence-based psychological assessment method. The implementation of the solution provided by the device is similar to that described in the above method, so the specific limitations in one or more embodiments of the artificial intelligence based psychological assessment device provided below may be referred to above for limitations of the artificial intelligence based psychological assessment method, and will not be described herein.
In one embodiment, as shown in FIG. 13, there is provided an artificial intelligence based psychological assessment apparatus 1300 comprising: an encoding module 1302, an attention processing module 1304, and a state determination module 1306, wherein:
the coding module 1302 is configured to obtain a psychological consulting text packet of an object to be evaluated, and code each text in the psychological consulting text packet respectively to obtain a plurality of coded data;
an attention processing module 1304, configured to, when the psychological consulting text packet includes a psychological consulting title and at least one reply associated with the psychological consulting title, perform first attention processing on the encoded data corresponding to each word in the psychological consulting title, obtain a first attention processing result corresponding to the psychological consulting title based on a first contribution weight of each word pair in the psychological consulting title to determining a state degree label corresponding to the psychological consulting title, and decode the first attention processing result to obtain a state degree label corresponding to the psychological consulting title; when the coded data corresponding to each reply is subjected to second attention processing, respectively aiming at each reply, determining second contribution weights of state degree labels corresponding to the replies aiming at each reply based on the at least one reply pair to obtain second attention processing results corresponding to each reply, and respectively decoding each second attention processing result to obtain state degree labels corresponding to each reply;
The state determining module 1306 is configured to determine, according to the state degree label corresponding to each reply and the state degree label corresponding to the psychological consulting title, psychological state degree information of the object to be evaluated.
In one embodiment, the artificial intelligence based psychological assessment means is performed by a psychological assessment model; the psychological assessment model comprises a multi-classification model and a two-classification model; the multi-classification model is used for determining the psychological state degree information, and the psychological state degree information comprises at least one of degree grade of the psychological of the object to be evaluated of the object to be detected under a preset first state category and psychological intervention measures adopted; the classification model is used for determining whether the psychological state of the object to be evaluated belongs to a preset second state category.
In one embodiment, the psychological assessment model comprises a classification model; the attention processing module 1304 is further configured to, when the psychological consulting text packet includes a psychological consulting title and does not include a reply associated with the psychological consulting title, perform third attention processing on the encoded data corresponding to each word in the psychological consulting title, determine, based on a third contribution weight of each word pair in the psychological consulting title, whether the psychological state of the object to be evaluated belongs to a preset second state category, obtain a third attention processing result, and decode the third attention processing result to obtain whether the psychological state of the object to be evaluated belongs to the preset second state category.
In one embodiment, the encoding module 1302 is further configured to determine paragraph information of the psychological consulting title, and encode the paragraph information of the psychological consulting title to obtain a segment encoding vector corresponding to the psychological consulting title; determining the position information of the aimed segmentation word in the psychological consultation title aiming at each segmentation word in the psychological consultation title, and encoding the position information to obtain a position encoding vector corresponding to the aimed segmentation word; and carrying out word embedding processing on the aimed segmentation word to obtain a word coding vector corresponding to the aimed segmentation word, and obtaining coding data corresponding to the aimed segmentation word according to a segment coding vector corresponding to the psychological consultation title, a position coding vector corresponding to the aimed segmentation word and a word coding vector.
In one embodiment, the encoding module 1302 is further configured to encode, for each reply of the at least one reply, paragraph information of the reply to be targeted, to obtain a segment encoding vector corresponding to the reply to be targeted; respectively carrying out position coding and word embedding processing on each word in the aimed reply to obtain a position coding vector and a word coding vector corresponding to each word in the aimed reply; determining coding sub-data corresponding to each word in the aimed reply according to the segment coding vector corresponding to the aimed reply, the position coding vector corresponding to each word in the aimed reply and the word coding vector; and obtaining the coded data corresponding to the aimed reply according to the coded sub-data corresponding to each word in the aimed reply.
In one embodiment, the attention processing module 1304 is further configured to determine, for each word segment in the psychological consultation header, a correlation between the encoded data of the word segment in question and the encoded data of each word segment in the psychological consultation header; determining a first contribution weight set corresponding to the specific word segment according to the correlation degree between the coded data of the specific word segment and the coded data of each word segment in the psychological consultation title; the first contribution weight set comprises first contribution weights corresponding to each word in the psychological consultation title; based on the first contribution weight set corresponding to the specific word, carrying out fusion processing on the coded data of each word to obtain fusion coded data corresponding to the specific word; splicing the fusion coding data corresponding to each word segment to obtain spliced fusion coding data; and decoding the spliced fusion encoded data to obtain a state degree label corresponding to the psychological consultation title.
In one embodiment, the attention processing module 1304 is further configured to, for each reply in the psychological consulting package, obtain decoded data corresponding to a previous reply that precedes the current reply; determining a second contribution weight corresponding to each reply in the psychological consultation data packet according to the decoding data corresponding to the previous reply and the coding data corresponding to each reply in the psychological consultation data packet; determining fusion coding data corresponding to the current reply according to the coding data corresponding to each reply in the psychological consultation data packet and the corresponding second contribution weight; determining decoding data corresponding to the current reply according to the fusion coding data corresponding to the current reply, decoding data corresponding to the previous reply and a state degree label, and determining the state degree label corresponding to the current reply based on the decoding data corresponding to the current reply; and entering a state degree label determining process of the next round, taking the next reply after the current reply in the psychological consultation data packet as a new current reply, and returning to the step of acquiring the decoding data corresponding to the previous reply before the current reply to continue until the state degree label corresponding to each reply in the psychological consultation data packet is obtained.
In one embodiment, the attention processing module 1304 is further configured to correlate the decoded data corresponding to the previous reply with the encoded data corresponding to each reply in the psychological consulting data packet; and according to the determined relevance, determining a second contribution weight corresponding to each reply in the psychological consultation data packet.
In one embodiment, the attention processing module 1304 is further configured to perform dot product operation on the decoded data corresponding to the previous reply and the encoded data corresponding to each reply in the psychological consulting data packet, so as to obtain a dot product operation result corresponding to each reply in the psychological consulting data packet; and regarding each dot product operation result, taking the pointed dot product operation result as the correlation degree between the decoding data corresponding to the previous reply and the encoding data corresponding to the corresponding reply.
In one embodiment, as shown in FIG. 14, there is provided an artificial intelligence based psychological assessment apparatus 1400 comprising: a training data acquisition module 1402, a predictive label determination module 1404, and a model parameter adjustment module 1406, wherein:
A training data obtaining module 1402, configured to obtain a psychological consultation sample text packet and a sample tag set corresponding to the psychological consultation sample text packet; the psychological consultation sample text pack includes at least one sample text; the sample label set comprises sample labels corresponding to the at least one sample text respectively;
the prediction tag determining module 1404 is configured to encode sample texts in the psychological counseling sample text packet respectively, so as to obtain sample encoding data corresponding to each sample text in the psychological counseling sample text packet; performing attention processing based on sample coding data corresponding to each sample text in the psychological consultation sample text packet to obtain a plurality of weighted sample coding data, and decoding the weighted sample coding data to obtain a prediction label corresponding to each sample text in the psychological consultation sample text packet;
the model parameter adjustment module 1406 is configured to train a psychological assessment model according to the sample tag set and a prediction tag corresponding to each sample text in the psychological consultation sample text packet; the trained psychological assessment model is used for determining the psychological state of the object to be assessed.
In one embodiment, the training data acquisition module 1402 is further configured to acquire a pre-trained label annotation model; the label labeling model is obtained by training a natural language task processing model through a sample psychological consultation title; performing label prediction on the sample replies in the psychological consultation text packet through the label labeling model to obtain sample labels corresponding to the sample replies; and generating a corresponding sample label set through the sample labels corresponding to the sample replies.
In one embodiment, during training, model parameters of the psychological assessment model are adjusted in a direction to minimize generalization risk and experience risk; the generalization risk is determined by a generalization risk function; the generalized risk function is used for determining the expectation that the psychological assessment model outputs a sample label set based on a psychological consultation sample text packet; the experience risk is determined by an experience risk function; the experience risk function is used for determining errors between sample tags in the sample tag set and corresponding prediction tags; in the training process, the psychological assessment model is located in a preset generalized boundary; the generalization boundary is obtained by minimizing the complexity of the set of hypothetical classes.
The above-described modules in the artificial intelligence-based psychological assessment apparatus may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, and the internal structure of which may be as shown in fig. 15. The computer device includes a processor, a memory, an Input/Output interface (I/O) and a communication interface. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface is connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is for storing mental assessment data based on artificial intelligence. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement an artificial intelligence based psychological assessment method.
It will be appreciated by those skilled in the art that the structure shown in fig. 15 is merely a block diagram of a portion of the structure associated with the present inventive arrangements and is not limiting of the computer device to which the present inventive arrangements are applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In an embodiment, there is also provided a computer device comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the steps of the method embodiments described above when the computer program is executed.
In one embodiment, a computer-readable storage medium is provided, storing a computer program which, when executed by a processor, implements the steps of the method embodiments described above.
In one embodiment, a computer program product or computer program is provided that includes computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in the above-described method embodiments.
It should be noted that, the user information (including but not limited to user equipment information, user personal information, etc.) and the data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present application are information and data authorized by the user or sufficiently authorized by each party, and the collection, use and processing of the related data need to comply with the related laws and regulations and standards of the related country and region.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the embodiments provided herein may include at least one of a relational database and a non-relational database. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processor referred to in the embodiments provided in the present application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, or the like, but is not limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples illustrate only a few embodiments of the application and are described in detail herein without thereby limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of the application should be assessed as that of the appended claims.

Claims (17)

1. A psychological assessment method based on artificial intelligence, the method comprising:
acquiring a psychological consultation text packet of an object to be evaluated, and respectively encoding each text in the psychological consultation text packet to acquire a plurality of encoded data;
when the psychological consultation text packet comprises a psychological consultation title and at least one reply associated with the psychological consultation title, performing first attention processing on coding data corresponding to each word in the psychological consultation title, based on first contribution weight of each word in the psychological consultation title to determining a state degree label corresponding to the psychological consultation title, obtaining a first attention processing result corresponding to the psychological consultation title, and decoding the first attention processing result to obtain the state degree label corresponding to the psychological consultation title;
When the coded data corresponding to each reply is subjected to second attention processing, respectively aiming at each reply, determining second contribution weights of state degree labels corresponding to the replies based on the replies to obtain second attention processing results corresponding to the replies, and respectively decoding each second attention processing result to obtain state degree labels corresponding to the replies;
and determining the psychological state degree information of the object to be evaluated according to the state degree label corresponding to the at least one reply and the state degree label corresponding to the psychological consultation title.
2. The method according to claim 1, wherein the method further comprises:
when the psychological consultation text packet comprises a psychological consultation title and does not comprise replies associated with the psychological consultation title, carrying out third attention processing on the coding data corresponding to each word in the psychological consultation title, determining whether the psychological state of the object to be evaluated belongs to a preset third contribution weight of a second state category based on each word in the psychological consultation title, obtaining a third attention processing result corresponding to the psychological consultation title, and decoding the third attention processing result to obtain whether the psychological state of the object to be evaluated belongs to the preset second state category.
3. The method of claim 2, wherein the artificial intelligence based psychological assessment method is performed based on a psychological assessment model; the psychological assessment model comprises a multi-classification model and a two-classification model;
the multi-classification model is used for determining the psychological state degree information, and the psychological state degree information comprises at least one of degree grade of the psychological of the object to be evaluated of the object to be detected under a preset first state category and psychological intervention measures adopted;
the classification model is used for determining whether the psychological state of the object to be evaluated belongs to a preset second state category.
4. The method of claim 1, wherein the encoding step of the psychological consultation title comprises:
determining paragraph information of the psychological consultation title, and coding the paragraph information of the psychological consultation title to obtain a segment coding vector corresponding to the psychological consultation title;
determining the position information of the aimed segmentation word in the psychological consultation title aiming at each segmentation word in the psychological consultation title, and encoding the position information to obtain a position encoding vector corresponding to the aimed segmentation word;
And carrying out word embedding processing on the aimed segmentation word to obtain a word coding vector corresponding to the aimed segmentation word, and obtaining coding data corresponding to the aimed segmentation word according to a segment coding vector corresponding to the psychological consultation title, a position coding vector corresponding to the aimed segmentation word and a word coding vector.
5. The method of claim 1, wherein the encoding of the at least one reply comprises:
for each reply in the at least one reply, encoding paragraph information of the aimed reply to obtain a segment encoding vector corresponding to the aimed reply;
respectively carrying out position coding and word embedding processing on each word in the aimed reply to obtain a position coding vector and a word coding vector corresponding to each word in the aimed reply;
determining coding sub-data corresponding to each word in the aimed reply according to the segment coding vector corresponding to the aimed reply, the position coding vector corresponding to each word in the aimed reply and the word coding vector;
and obtaining the coded data corresponding to the aimed reply according to the coded sub-data corresponding to each word in the aimed reply.
6. The method of claim 1, wherein when performing the first attention processing on the encoded data corresponding to each word in the psychological consulting title, determining the first contribution weight of the state degree label corresponding to the psychological consulting title based on each word pair in the psychological consulting title, to obtain a first attention processing result corresponding to the psychological consulting title, and decoding the first attention processing result to obtain the state degree label corresponding to the psychological consulting title, includes:
for each word in the psychological consultation title, determining the correlation between the coded data of the word in question and the coded data of each word in the psychological consultation title;
determining a first contribution weight set corresponding to the specific word segment according to the correlation degree between the coded data of the specific word segment and the coded data of each word segment in the psychological consultation title; the first contribution weight set comprises first contribution weights corresponding to each word in the psychological consultation title;
based on the first contribution weight set corresponding to the specific word, carrying out fusion processing on the coded data of each word to obtain fusion coded data corresponding to the specific word;
Splicing the fusion coding data corresponding to each word segment to obtain spliced fusion coding data;
and decoding the spliced fusion encoded data to obtain a state degree label corresponding to the psychological consultation title.
7. The method of claim 1, wherein the at least one reply to each corresponding second attention processing result comprises each corresponding fusion encoded data of the at least one reply; when the second attention processing is performed on the encoded data corresponding to each of the at least one reply, determining, for each of the at least one reply, a second contribution weight of a state degree label corresponding to the reply based on the at least one reply pair, to obtain a second attention processing result corresponding to each of the at least one reply, and decoding each of the second attention processing results to obtain a state degree label corresponding to each of the at least one reply, including:
for each reply in the psychological consultation data packet, obtaining decoding data corresponding to a previous reply before the current reply;
determining second contribution weights corresponding to each reply in the psychological consultation data packet according to the decoding data corresponding to the previous reply and the coding data corresponding to each reply in the psychological consultation data packet;
Determining fusion coding data corresponding to the current reply according to the coding data corresponding to each reply in the psychological consultation data packet and the corresponding second contribution weight;
determining the decoding data corresponding to the current reply according to the fusion coding data corresponding to the current reply, the decoding data corresponding to the previous reply and the state degree label, and determining the state degree label corresponding to the current reply based on the decoding data corresponding to the current reply;
and entering a state degree label determining process of the next round, taking the next reply after the current reply in the psychological consultation data packet as a new current reply, and returning to execute the step of obtaining the decoding data corresponding to the previous reply before the current reply until the state degree label corresponding to each reply in the psychological consultation data packet is obtained.
8. The method of claim 7, wherein the determining the respective second contribution weights for each reply in the psychological consulting data packet based on the decoded data for the previous reply and the respective encoded data for each reply in the psychological consulting data packet, comprises:
Determining the correlation degree between the decoding data corresponding to the previous reply and the coding data corresponding to each reply in the psychological consultation data packet respectively;
and according to the determined relevance, determining a second contribution weight corresponding to each reply in the psychological consultation data packet.
9. The method of claim 8, wherein said determining a correlation between the decoded data of the previous reply and the respective encoded data of each reply in the psychological consulting data packet, comprises:
performing dot product operation on the decoding data corresponding to the previous reply and the coding data corresponding to each reply in the psychological consultation data packet respectively to obtain a dot product operation result corresponding to each reply in the psychological consultation data packet;
and regarding each dot product operation result, taking the pointed dot product operation result as the correlation degree between the decoding data corresponding to the previous reply and the encoding data corresponding to the corresponding reply.
10. A psychological assessment method based on artificial intelligence, the method comprising:
acquiring a psychological consultation sample text packet and a sample label set corresponding to the psychological consultation sample text packet; the psychological consultation sample text pack includes at least one sample text; the sample label set comprises sample labels corresponding to the at least one sample text respectively;
Respectively encoding sample texts in the psychological consultation sample text packet to obtain sample encoding data corresponding to each sample text in the psychological consultation sample text packet;
performing attention processing based on sample coding data corresponding to each sample text in the psychological consultation sample text packet to obtain a plurality of weighted sample coding data, and decoding according to the weighted sample coding data to obtain a prediction label corresponding to each sample text in the psychological consultation sample text packet;
training a psychological assessment model according to the sample label set and the prediction labels corresponding to each sample text in the psychological consultation sample text packet; the trained psychological assessment model is used for determining the psychological state of the object to be assessed.
11. The method according to claim 10, wherein the method further comprises:
acquiring a pre-trained label labeling model; the label labeling model is obtained by training a natural language task processing model through a sample psychological consultation title;
performing label prediction on the sample replies in the psychological consultation text packet through the label labeling model to obtain sample labels corresponding to the sample replies;
And generating a corresponding sample label set through the sample labels corresponding to the sample replies.
12. The method of claim 10, wherein model parameters of the psychological assessment model are adjusted in a direction to minimize generalization risk and experience risk during training; the generalization risk is determined by a generalization risk function; the generalized risk function is used for determining the expectation that the psychological assessment model outputs a sample label set based on a psychological consultation sample text packet; the experience risk is determined by an experience risk function; the experience risk function is used for determining errors between sample tags in the sample tag set and corresponding prediction tags;
in the training process, the psychological assessment model is located in a preset generalized boundary; the generalization boundary is obtained by minimizing the complexity of the set of hypothetical classes.
13. An artificial intelligence based psychological assessment device, the device comprising:
the coding module is used for acquiring a psychological consultation text packet of the object to be evaluated, and respectively coding each text in the psychological consultation text packet to acquire a plurality of coded data;
The attention processing module is used for obtaining a first attention processing result corresponding to the psychological consultation title based on first contribution weight of each word in the psychological consultation title to the state degree label corresponding to the psychological consultation title when the psychological consultation text packet comprises the psychological consultation title and at least one reply associated with the psychological consultation title and the first attention processing result is decoded, and the state degree label corresponding to the psychological consultation title is obtained; when the coded data corresponding to each reply is subjected to second attention processing, respectively aiming at each reply, determining second contribution weights of state degree labels corresponding to the replies based on the replies to obtain second attention processing results corresponding to the replies, and respectively decoding each second attention processing result to obtain state degree labels corresponding to the replies;
And the state determining module is used for determining the psychological state degree information of the object to be evaluated according to the state degree label corresponding to the at least one reply and the state degree label corresponding to the psychological consultation title.
14. An artificial intelligence based psychological assessment device, the device comprising:
the training data acquisition module is used for acquiring a psychological consultation sample text packet and a sample label set corresponding to the psychological consultation sample text packet; the psychological consultation sample text pack includes at least one sample text; the sample label set comprises sample labels corresponding to the at least one sample text respectively;
the prediction tag determining module is used for respectively encoding sample texts in the psychological consultation sample text packet to obtain sample encoding data corresponding to each sample text in the psychological consultation sample text packet; performing attention processing based on sample coding data corresponding to each sample text in the psychological consultation sample text packet to obtain a plurality of weighted sample coding data, and decoding the weighted sample coding data to obtain a prediction label corresponding to each sample text in the psychological consultation sample text packet;
The model parameter adjustment module is used for training a psychological assessment model according to the sample label set and the prediction labels corresponding to each sample text in the psychological consultation sample text packet; the trained psychological assessment model is used for determining the psychological state of the object to be assessed.
15. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any one of claims 1 to 12 when the computer program is executed.
16. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 12.
17. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any one of claims 1 to 12.
CN202310939410.1A 2023-07-27 2023-07-27 Psychological assessment method and device based on artificial intelligence and computer equipment Pending CN116884576A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310939410.1A CN116884576A (en) 2023-07-27 2023-07-27 Psychological assessment method and device based on artificial intelligence and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310939410.1A CN116884576A (en) 2023-07-27 2023-07-27 Psychological assessment method and device based on artificial intelligence and computer equipment

Publications (1)

Publication Number Publication Date
CN116884576A true CN116884576A (en) 2023-10-13

Family

ID=88262036

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310939410.1A Pending CN116884576A (en) 2023-07-27 2023-07-27 Psychological assessment method and device based on artificial intelligence and computer equipment

Country Status (1)

Country Link
CN (1) CN116884576A (en)

Similar Documents

Publication Publication Date Title
CN111444709B (en) Text classification method, device, storage medium and equipment
KR102222451B1 (en) An apparatus for predicting the status of user&#39;s psychology and a method thereof
CN110263150B (en) Text generation method, device, computer equipment and storage medium
Yeomans et al. The politeness Package: Detecting Politeness in Natural Language.
CN112131350B (en) Text label determining method, device, terminal and readable storage medium
US11734519B2 (en) Systems and methods for slot relation extraction for machine learning task-oriented dialogue systems
CN111738004A (en) Training method of named entity recognition model and named entity recognition method
US20220129621A1 (en) Bert-based machine-learning tool for predicting emotional response to text
CN112084334B (en) Label classification method and device for corpus, computer equipment and storage medium
US11900518B2 (en) Interactive systems and methods
CN110377733B (en) Text-based emotion recognition method, terminal equipment and medium
CN113254610A (en) Multi-round conversation generation method for patent consultation
CN112131883A (en) Language model training method and device, computer equipment and storage medium
CN112287672A (en) Text intention recognition method and device, electronic equipment and storage medium
CN113987187A (en) Multi-label embedding-based public opinion text classification method, system, terminal and medium
CN111145914B (en) Method and device for determining text entity of lung cancer clinical disease seed bank
Yordanova et al. Automatic detection of everyday social behaviours and environments from verbatim transcripts of daily conversations
WO2021001517A1 (en) Question answering systems
WO2024021685A1 (en) Reply content processing method and media content interactive content interaction method
CN113704466B (en) Text multi-label classification method and device based on iterative network and electronic equipment
CN115169472A (en) Music matching method and device for multimedia data and computer equipment
CN116884576A (en) Psychological assessment method and device based on artificial intelligence and computer equipment
CN114911922A (en) Emotion analysis method, emotion analysis device and storage medium
Lin et al. Generative Adversarial Network for Joint Headline and Summary Generation
CN115248846B (en) Text recognition method, device and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication