Interactive method, device and equipment for state assessment

By recognizing the intent of the object being evaluated and generating prompt information based on contextual knowledge, and inputting it into a large medical model, the problem of flexibility and controllability in existing state evaluation interaction methods is solved, achieving natural and controllable interactive responses.

CN117271746BActive Publication Date: 2025-12-19ANHUI IFLYHEALTH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311383632.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-24
Publication Date
2025-12-19
Estimated Expiration
2043-10-24

AI Technical Summary

Technical Problem

Existing status assessment interaction methods are inflexible, and response language is unnatural and uncontrollable, especially in complex scenarios where it is difficult to match appropriate language.

Method used

By recognizing the intent of the object being evaluated, and combining scene knowledge and historical dialogues, prompt information is generated and input into the medical big model to guide the questions in the next round of dialogue. The medical big model is trained based on multiple sets of training samples to improve the naturalness and controllability of the interaction.

Benefits of technology

It achieves natural interactive responses, avoiding stiff and unnatural issues, enhancing the flexibility and controllability of the interaction, and adapting to the needs of different scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117271746B_ABST
    Figure CN117271746B_ABST
Patent Text Reader

Abstract

The application provides an interaction method, device and equipment for state evaluation, which comprises the following steps: performing intent recognition on the response of a to-be-evaluated object in a current dialogue round, and determining the intent information of the to-be-evaluated object in the current dialogue round; determining the scene knowledge involved in the current dialogue round and the dialogue node of the next dialogue round according to the intent information; determining the prompt information of the current dialogue round according to the intent information, the scene knowledge, the dialogue node and the historical dialogue with the to-be-evaluated object; inputting the prompt information and the response of the current dialogue round into a medical large model to obtain the question of the next dialogue round, which is used for evaluating the state of the to-be-evaluated object. The scheme of the application can generate a natural interaction reply in state evaluation, and has high flexibility.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, and in particular to a state evaluation interaction method, device and equipment. BACKGROUND

[0002] At present, the mental state of young people is an important factor affecting the physical and mental health of young people. Therefore, based on the mental state screening tool, the population with poor mental state can be quickly screened out, and the population with poor mental state can be effectively prevented and intervened, which provides effective help for the mental health of young people.

[0003] At present, the state evaluation of the to-be-evaluated object is usually realized through multiple rounds of interactive dialogue with the to-be-evaluated object. Specifically, the intention of the answer of the to-be-evaluated object can be analyzed based on the state and state transition condition of the dialogue interaction defined by a person in advance, and the state is updated and integrated based on the intention, so as to interact with the to-be-evaluated object.

[0004] However, this interaction method is based on the intention of the answer of the to-be-evaluated object to select the corresponding dialogue in the pre-set candidate dialogue to reply, which has the problem of unnatural reply dialogue and poor flexibility. SUMMARY

[0005] The present application provides a state evaluation interaction method, device and equipment to solve the problem of poor flexibility of the current state evaluation interaction method.

[0006] In a first aspect, the present application provides a state evaluation interaction method, comprising:

[0007] intention recognition is performed on the response of the to-be-evaluated object in the current dialogue round to determine intention information of the to-be-evaluated object in the current dialogue round;

[0008] According to the intention information, scene knowledge related to the current dialogue round and a dialogue node of a next dialogue round are determined;

[0009] According to the intention information, the scene knowledge, the dialogue node and the historical dialogue with the to-be-evaluated object, prompt information of the current dialogue round is determined;

[0010] The prompt information and the response of the current dialogue round are input into a medical large model to obtain a question of the next dialogue round, and the question of the next dialogue round is used to evaluate the state of the to-be-evaluated object;

[0011] The medical large model is obtained based on a plurality of training samples, each of which includes a sample response of a sample dialogue turn, sample prompt information of the sample dialogue turn, and a question label of the sample response.

[0012] In a possible implementation, the determining, according to the intention information, of the scene knowledge related to the current dialogue turn and the dialogue node of the next dialogue turn includes:

[0013] determining, according to the intention information, a scene related to the current dialogue turn and a scene related to the next dialogue turn;

[0014] determining, according to the scene related to the current dialogue turn, the scene knowledge;

[0015] determining, according to the scene related to the current dialogue turn and the scene related to the next dialogue turn, the dialogue node of the next dialogue turn.

[0016] In a possible implementation, the determining, according to the scene related to the current dialogue turn, of the scene knowledge includes:

[0017] determining, in a preset knowledge base, scene constraint information matched with the scene related to the current dialogue turn;

[0018] fusing the scene constraint information to obtain the scene knowledge.

[0019] In a possible implementation, the determining, according to the scene related to the current dialogue turn and the scene related to the next dialogue turn, of the dialogue node of the next dialogue turn includes:

[0020] in a case where the scene related to the current dialogue turn and the scene related to the next dialogue turn are the same, determining, in a preset scene knowledge graph, a first dialogue node of the current dialogue turn; determining, in at least one next-turn candidate dialogue node of the first dialogue node, the dialogue node of the next dialogue turn; the preset scene knowledge graph including a plurality of dialogue nodes under scenes and topological relations between the dialogue nodes under the scenes;

[0021] in a case where the scene related to the current dialogue turn and the scene related to the next dialogue turn are different, determining, in the preset scene knowledge graph, a second dialogue node of the next dialogue turn; determining, in at least one next-turn candidate dialogue node of the second dialogue node, the dialogue node of the next dialogue turn.

[0022] In a possible implementation, the determining the prompt information of the current dialogue turn according to the intention information, the scene knowledge, the dialogue node, and the historical dialogue with the to-be-evaluated object comprises:

[0023] generating role indication information according to the intention information and the dialogue node, the role indication information being used to indicate a role to which an evaluation object interacting with the to-be-evaluated object belongs, and a background and a target of the next dialogue turn;

[0024] generating a dialogue example of the next dialogue turn according to the historical dialogue;

[0025] matching the intention information and the scene knowledge to obtain knowledge fusion information matched with the intention information;

[0026] generating structured output information according to the historical dialogue and a preset specification;

[0027] The prompt information comprises the role indication information, the dialogue example, the knowledge fusion information, and the structured output information.

[0028] In a possible implementation, the method further comprises:

[0029] obtaining a plurality of sample dialogues and sample prompt information corresponding to each of the plurality of sample dialogues;

[0030] for each of the sample dialogues, determining an input sequence and a label sequence of the sample dialogue according to the sample dialogue and the sample prompt information corresponding to the sample dialogue;

[0031] inputting the input sequence of each of the plurality of sample dialogues into an initial medical large model to obtain content output by the initial medical large model;

[0032] training the initial medical large model according to the label sequence of each of the plurality of sample dialogues and the content output by the initial medical large model.

[0033] In a possible implementation, the determining the input sequence and the label sequence of the sample dialogue according to the sample dialogue and the sample prompt information corresponding to the sample dialogue comprises:

[0034] performing word segmentation processing on the sample dialogue and the sample prompt information corresponding to the sample dialogue to obtain a plurality of segmented words arranged in sequence;

[0035] determining an index corresponding to each of the plurality of segmented words in a preset word table library;

[0036] generate the input sequence according to an order of the plurality of segmented words and an index corresponding to each of the plurality of segmented words;

[0037] perform a shift processing on the input sequence to generate the label sequence.

[0038] In a possible implementation, the method further includes:

[0039] obtain an initial sample dialogue and sample prompt information corresponding to the initial sample dialogue;

[0040] generate a plurality of candidate sample dialogues corresponding to the initial sample dialogue according to the initial sample dialogue and the sample prompt information corresponding to the initial sample dialogue;

[0041] generate a plurality of target sample dialogues corresponding to the initial sample dialogue according to the plurality of candidate sample dialogues; wherein the plurality of sample dialogues include the initial sample dialogue and the plurality of target sample dialogues.

[0042] In a second aspect, the present application provides an interaction device for state evaluation, comprising:

[0043] a first determination module configured to perform intent recognition on a response of a to-be-evaluated object in a current dialogue turn, and determine intent information of the to-be-evaluated object in the current dialogue turn;

[0044] a second determination module configured to determine, according to the intent information, scene knowledge involved in the current dialogue turn and a dialogue node of a next dialogue turn;

[0045] a processing module configured to determine, according to the intent information, the scene knowledge, the dialogue node and a historical dialogue with the to-be-evaluated object, prompt information of the current dialogue turn;

[0046] an interaction module configured to input the prompt information and the response of the current dialogue turn into a medical large model to obtain a question of the next dialogue turn, the question of the next dialogue turn being used to evaluate a state of the to-be-evaluated object;

[0047] wherein the medical large model is obtained by training based on a plurality of training samples, each training sample including a sample response of a sample dialogue turn, sample prompt information of the sample dialogue turn and a question label of the sample response.

[0048] In a possible implementation, the second determination module is specifically configured to:

[0049] determine, according to the intent information, a scene involved in the current dialogue turn and a scene involved in the next dialogue turn;

[0050] determine the scene knowledge according to a scene involved in the current dialogue turn;

[0051] determine the dialogue node of the next dialogue turn according to the scene involved in the current dialogue turn and the scene involved in the next dialogue turn.

[0052] In a possible implementation, the second determining module is specifically configured to:

[0053] determine scene constraint information matched with the scene involved in the current dialogue turn in a preset knowledge base;

[0054] fuse the scene constraint information to obtain the scene knowledge.

[0055] In a possible implementation, the second determining module is specifically configured to:

[0056] in the case that the scene involved in the current dialogue turn and the scene involved in the next dialogue turn are the same, determine a first dialogue node of the current dialogue turn in a preset scene knowledge graph; determine the dialogue node of the next dialogue turn in at least one next-turn candidate dialogue node of the first dialogue node; the preset scene knowledge graph comprises a plurality of dialogue nodes under scenes and topological relations between the dialogue nodes under the scenes;

[0057] in the case that the scene involved in the current dialogue turn and the scene involved in the next dialogue turn are different, determine a second dialogue node of the next dialogue turn in the preset scene knowledge graph; determine the dialogue node of the next dialogue turn in at least one next-turn candidate dialogue node of the second dialogue node.

[0058] In a possible implementation, the processing module is specifically configured to:

[0059] generate role indication information according to the intent information and the dialogue node, the role indication information being used to indicate a role to which an evaluation object interacting with the to-be-evaluated object belongs, and a background and a target of the next dialogue turn;

[0060] generate a dialogue example of the next dialogue turn according to the historical dialogue;

[0061] match the intent information and the scene knowledge to obtain knowledge fusion information matched with the intent information;

[0062] generate structured output information according to the historical dialogue and a preset specification;

[0063] The prompt information includes the role indication information, the dialogue example, the knowledge fusion information, and the structured output information.

[0064] In a possible implementation, the processing module is further configured to:

[0065] obtain a plurality of sample dialogues, and sample prompt information corresponding to each of the plurality of sample dialogues;

[0066] For each of the sample dialogues, determine an input sequence and a label sequence of the sample dialogue according to the sample dialogue and the sample prompt information corresponding to the sample dialogue;

[0067] input the input sequence of each of the plurality of sample dialogues into an initial medical large model to obtain content output by the initial medical large model;

[0068] train the initial medical large model according to the label sequence of each of the plurality of sample dialogues and the content output by the initial medical large model.

[0069] In a possible implementation, the processing module is further configured to:

[0070] perform word segmentation processing on the sample dialogue and the sample prompt information corresponding to the sample dialogue to obtain a plurality of segmented words arranged in sequence;

[0071] determine an index corresponding to each of the plurality of segmented words in a preset word table library;

[0072] generate the input sequence according to the sequence of the plurality of segmented words and the index corresponding to each of the plurality of segmented words;

[0073] perform shift processing on the input sequence to generate the label sequence.

[0074] In a possible implementation, the processing module is further configured to:

[0075] obtain an initial sample dialogue and sample prompt information corresponding to the initial sample dialogue;

[0076] generate a plurality of candidate sample dialogues corresponding to the initial sample dialogue according to the initial sample dialogue and the sample prompt information corresponding to the initial sample dialogue;

[0077] generate a plurality of target sample dialogues corresponding to the initial sample dialogue according to the plurality of candidate sample dialogues; wherein the plurality of sample dialogues include the initial sample dialogue and the plurality of target sample dialogues.

[0078] In a third aspect, the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the state evaluation interaction method according to any one of the first aspect when executing the program.

[0079] In a fourth aspect, the present application provides a non-transitory computer-readable storage medium, having a computer program stored thereon, wherein the computer program is executable by a processor to implement the state evaluation interaction method according to any one of the first aspect.

[0080] The state evaluation interaction method, device and equipment provided by the present application first perform intent recognition on the response of the to-be-evaluated object in the current dialogue turn to determine the intent information of the to-be-evaluated object in the current dialogue turn. Then, according to the intent information, the scene knowledge involved in the current dialogue turn and the dialogue skill node of the next dialogue turn are determined. And according to the intent information, the scene knowledge, the dialogue skill node and the historical dialogue with the to-be-evaluated object, the prompt information of the current dialogue turn is determined. Then the prompt information and the response of the current dialogue turn are input into the medical large model to obtain the question of the next dialogue turn, which is used to evaluate the state of the to-be-evaluated object. The medical large model is obtained by training based on multiple groups of training samples. Each group of training samples includes sample responses of sample dialogue turns, sample prompt information of sample dialogue turns and question labels of sample responses. Since the prompt information is constructed based on the intent information, the scene knowledge, the dialogue skill node and the historical dialogue with the to-be-evaluated object, it can guide the output of the medical large model. Through the constraint of the prompt information, the next round question output by the medical large model is controllable. And since the current dialogue turn is based on the response of the current dialogue turn in each interaction process, a natural interactive reply can be generated, avoiding the problem of rigid and unnatural reply. BRIEF DESCRIPTION OF DRAWINGS

[0081] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed in the embodiment or prior art description. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can also obtain other drawings according to these drawings without creative labor.

[0082] Figure 1 A dialogue system framework schematic diagram is provided for the embodiments of the present application.

[0083] Figure 2 A flowchart of the state evaluation interaction method provided by the embodiments of the present application is provided.

[0084] Figure 3A schematic diagram of a scene knowledge graph provided for an embodiment of the present application;

[0085] Figure 4 A training flowchart of a medical large model provided for an embodiment of the present application;

[0086] Figure 5 An expanded intention diagram of a sample dialogue provided for an embodiment of the present application;

[0087] Figure 6 A schematic diagram of an output next dialogue round question provided for an embodiment of the present application;

[0088] Figure 7 A structural schematic diagram of an interaction device for state evaluation provided for an embodiment of the present application;

[0089] Figure 8 An entity structural schematic diagram of an electronic device provided for an embodiment of the present application. DETAILED DESCRIPTION

[0090] In order to make the objectives, technical solutions and advantages of the present application clearer, the technical solutions in the present application will be described clearly and completely below with reference to the drawings in the present application. Obviously, the described embodiments are some embodiments of the present application, but not all embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the present application.

[0091] The evaluation of the mental state is a way to determine the mental health of a population, which can be targeted to the object to be evaluated through the index items in the mental state evaluation scale, and the state of the object to be evaluated is determined by combining the responses of the object to be evaluated. In this way, people with poor mental state can be quickly screened out to assist in counseling and solving problems, thereby achieving effective prevention and intervention.

[0092] Generally speaking, the multi-round interactive dialogue can be realized by the face-to-face interview mode of the psychological consultant and the object to be evaluated. This interaction mode mainly depends on the subjective evaluation of the psychological consultant, and the result obtained is not objective.

[0093] With the development of natural language processing (NLP) technology, the evaluation of the mental state gradually transits from the artificial face-to-face interview mode to the multi-round dialogue interaction mode based on NLP. The multi-round dialogue interaction mode based on NLP usually includes a candidate dialogue template matching type interaction mode and a multi-round interaction mode based on a generative model.

[0094] The candidate dialogue template matching type interaction mode is generally based on the state and state transition condition of the dialogue interaction defined by an artificial predefinition, and the intention of the answer of the to-be-evaluated object parsed by the semantic understanding module, to update and integrate the state. Then, a state update method based on artificial rules is used to select the dialogue template of the candidate reply. The method of matching the candidate dialogue template based on artificial rules to determine the dialogue of the next round of reply does not need training, but only needs to match the appropriate dialogue in the pre-defined candidate dialogue set according to the information of the intention node by the last semantic understanding module, and the prior knowledge of the vertical field can be easily coded into the rules, so that the function can be realized simply, quickly and conveniently.

[0095] However, the candidate dialogue template matching type interaction mode has the problem of rigid and unnatural reply dialogue. This problem is particularly evident in the process of matching the candidate dialogue template using the rules pre-defined by an artificial. Since the answer of the to-be-evaluated object cannot be naturally combined with the context history to give a dynamic and natural reply, the reply dialogue is rigid and unnatural, which makes the multi-round interaction experience poor. At the same time, since the rules pre-defined by an artificial are used for matching, it is not possible to match the appropriate dialogue for different complex scenarios or previous context.

[0096] The multi-round interaction mode based on the generative model is generally a multi-round interaction based on a data-driven generative model. Specifically, the interaction mode first learns the relevant joint probability density distribution of the context history and the reply of the answer from a large amount of training corpus, and calculates the conditional probability distribution of all dialogue states as a prediction model, to directly give the dialogue of the next round of reply. In some examples, a reinforcement learning algorithm can also be introduced to calculate the conditional probability distribution of the dialogue state.

[0097] The multi-round interaction mode based on the generative model can be automatically trained according to the training data, reducing the artificial cost and having good generalization. However, there is also the problem of uncontrollable reply dialogue. Since the generative model directly generates dialogue according to the training corpus, in actual application, the quality and quantity of the training data of the multi-round dialogue are the limiting factors of the performance of the model. Due to the problems of training overfitting or insufficient training, the generated reply dialogue is often uncontrollable, and the reply dialogue also appears to be relatively divergent. The generative model does not better combine the knowledge graph in the field, and cannot combine the actual business scenario to make a related task type dialogue reply.

[0098] Therefore, the embodiments of the present application provide a state evaluation interaction method to realize the natural reply in the state evaluation process and the controllable reply dialogue when interacting with the to-be-evaluated object. The scheme of the embodiments of the present application will be introduced below with reference to the drawings.

[0099] Firstly, the embodiments of the present application will be introduced in combination with Figure 1The application provides a dialogue system framework.

[0100] Figure 1 A dialogue system framework provided by the application is shown in FIG. 1. Figure 1 The framework is a general dialogue system framework, mainly including a semantic understanding module, a dialogue management module and an answer generation module. The semantic understanding module is mainly used for intent recognition on the response of an evaluated object, determining the intent information of the evaluated object, and then inputting the determined intent information to the dialogue management module. The dialogue management module can match a corresponding reply through, for example, state tracking, strategy optimization and the like, and input to the answer generation module, so as to output a corresponding answer.

[0101] In the example of FIG. 1, Figure 1 According to different interaction modes, a voice recognition module and a voice synthesis module can be selectively set. For example, when the response of the evaluated object is voice, the voice can be recognized to obtain recognized text, so that the recognized text is input to the semantic understanding module for processing. When the answer output by the answer generation module is text, the text can be input to the voice synthesis module to convert the text into corresponding voice for output.

[0102] The scheme of the application is combined with the dialogue system framework of the example, Figure 1 The medical module is introduced to realize interaction with the evaluated object in the state evaluation scenario. The interaction method for state evaluation is introduced below. Figure 2

[0103] Figure 2 A flowchart of the interaction method for state evaluation provided by the application is shown in FIG. 2. Figure 2 The method includes the following steps.

[0104] S21, intent recognition is performed on the response of the evaluated object in the current dialogue round to determine the intent information of the evaluated object in the current dialogue round.

[0105] The evaluated object is an object that needs to be evaluated. In the application, the state evaluation can be, for example, psychological state evaluation, and the evaluated object is a user that needs to be evaluated.

[0106] ​The state evaluation is implemented based on multiple rounds of dialogues between the to-be-evaluated object and an evaluation object, which is a role to which the client belongs. Taking the psychological state evaluation as an example, the evaluation object may be, for example, a psychological consultant, a psychologist, and the like. For each round of dialogue, the evaluation object asks questions to the to-be-evaluated object, and the to-be-evaluated object answers. For the current dialogue round, the content of the answer of the to-be-evaluated object to the question is the response of the to-be-evaluated object in the current dialogue round.

[0107] After obtaining the response of the to-be-evaluated object in the current dialogue round, the client performs intent recognition on the response, thereby determining the intent information of the to-be-evaluated object in the current dialogue round. The process of intent recognition, that is, the process of semantic understanding of the response of the to-be-evaluated object, can be implemented by Figure 1 the semantic understanding module of the example.

[0108] Generally, the response of the to-be-evaluated object is in the form of speech, so the response of the to-be-evaluated object can be first subjected to speech recognition to obtain a corresponding speech recognition result, and then the speech recognition result is subjected to semantic understanding, thereby obtaining the intent information of the to-be-evaluated object in the current dialogue round.

[0109] S22, according to the intent information, determining the scenario knowledge involved in the current dialogue round and the dialogue skill node of the next dialogue round.

[0110] The scenario knowledge involved in the current dialogue round refers to the knowledge corresponding to the scenario involved in the interaction process between the to-be-evaluated object and the evaluation object, that is, the related knowledge in the field of state evaluation. Taking the depression emotion evaluation as an example, the corresponding scenario knowledge may include, for example, the knowledge of HAMD quantitative scale, the knowledge base of depression disease, and the like, and may also include the sleep quality report, the interpersonal interaction analysis report, and the like.

[0111] The dialogue skill node of the next dialogue round mainly refers to the operation that needs to be performed by the evaluation object in the next dialogue round, for example, may include comforting, feedback, transition, directly to the next question, and the like. For different intent information, the dialogue skill node of the next dialogue round may be different. For example, if it is determined according to the intent information that the emotion of the to-be-evaluated object is not good, the dialogue skill node of the next dialogue round may be comforting, to first comfort the emotion of the to-be-evaluated object; if it is determined according to the intent information that the emotion of the to-be-evaluated object is good, the dialogue skill node of the next dialogue round may be directly to the next question, and the like.

[0112] In a possible implementation, after the intention information is determined, the scene involved in the current dialogue turn and the scene involved in the next dialogue turn can be determined according to the intention information. The scene may, for example, include a scene of inquiring about a psychological state, may, for example, include a scene of inquiring about sleep, may, for example, include a scene of inquiring about depression, and the like. The scene involved in the current dialogue turn and the scene involved in the next dialogue turn can be the same or different.

[0113] According to the scene involved in the current dialogue turn, scene knowledge involved in the current dialogue turn can be determined. In a medical large model, a wide range of preset knowledge bases are involved, including knowledge in different fields of various industries. In order to make the reply tactics controllable, corresponding scene knowledge needs to be matched according to the scene involved in the current dialogue turn. Specifically, the client can determine scene constraint information matched with the scene involved in the current dialogue turn in the preset knowledge base, and then fuse the scene constraint information to obtain the scene knowledge.

[0114] For different scenes, there are corresponding scene constraint information, which can be determined through a preset mapping relationship between the scene and the scene constraint information. For example, the scene involved in the current dialogue turn is a scene of inquiring about sleep, and the scene constraint information matched with the scene may, for example, include relevant knowledge of sleep, relevant knowledge of sleep state, and the like. For example, the scene involved in the current dialogue turn is a scene of inquiring about depression, and the scene constraint information matched with the scene may, for example, include relevant knowledge of psychological state, relevant knowledge of depression state, relevant knowledge of good or bad mood, and the like. The relevant knowledge may be in various types of forms such as scales, reports, papers, and the like. After obtaining the scene constraint information matched with the scene involved in the current dialogue turn, the scene constraint information is fused to obtain corresponding scene knowledge.

[0115] After the scene involved in the current dialogue turn and the scene involved in the next dialogue turn are obtained, the tactics node of the next dialogue turn can be determined according to the scene involved in the current dialogue turn and the scene involved in the next dialogue turn.

[0116] In the embodiments of the present application, the dialogue node refers to a specific dialogue operation, which may, for example, include a counter-question, a comfort, a transition, a feedback, a direct entry into the next question, and the like. The counter-question operation refers to confirming the answer of the to-be-evaluated object or emphasizing the explanation, and is usually applied in the case where the answer of the to-be-evaluated object is less descriptive and needs to be further determined. The comfort operation refers to the operation of comforting the mood of the to-be-evaluated object in the case where the mood of the to-be-evaluated object is not good. The transition operation refers to summarizing the content of the historical dialogue and starting the next dialogue process. The feedback operation refers to the operation of making a tactful transition or requesting the to-be-evaluated object to restate in the case where the answer or intention of the to-be-evaluated object is not understood. The operation of directly entering the next question refers to the operation of directly entering the next question.

[0117] In a possible implementation, the dialogue node of the next dialogue round can be determined by pre-constructing a scene knowledge graph.

[0118] Figure 3 A schematic diagram of a scene knowledge graph provided by the embodiments of the present application is shown in FIG. 1, which is an example of a scene knowledge graph for depression state evaluation. Figure 3

[0119] In the scene knowledge graph, a plurality of scenes are included, each of which has a corresponding dialogue node, and there is a corresponding topological relationship between the dialogue nodes. Taking the example of the scene knowledge graph for depression state evaluation, Figure 3 two scenes involved in the scene knowledge graph for depression state evaluation are exemplified in FIG. 2, which are a scene of inquiring about the depression condition and a scene of inquiring about the sleep condition. Figure 3

[0120] For the scene of inquiring about the depression condition, the to-be-evaluated object can be initially inquired about whether there is a depression mood, which corresponds to the dialogue node 1. If it is determined that there is a depression mood, it corresponds to the dialogue node 1.1. The next candidate dialogue node of the dialogue node 1.1 includes the dialogue node 1.1.1 and the dialogue node 1.1.2, the operation corresponding to the dialogue node 1.1.1 is to inquire about the reason, and the operation corresponding to the dialogue node 1.1.2 is to inquire about whether it can react to the surroundings. The next candidate dialogue node of the dialogue node 1.1.2 includes the dialogue node 1.1.2.1 and the dialogue node 1.1.2.2, the operation corresponding to the dialogue node 1.1.2.1 is can, and the operation corresponding to the dialogue node 1.1.2.2 is cannot. If it is determined that there is no depression mood, it corresponds to the dialogue node 1.2, which indicates that the mood is normal.

[0121] ​​For the scene of inquiring about the depression condition, the sleep condition of the to-be-evaluated object can be inquired initially, which corresponds to the dialogue node 2. The next candidate dialogue node of the dialogue node 2 includes the dialogue node 2.1 and the dialogue node 2.2, the dialogue node 2.1 represents good sleep, and the dialogue node 2.2 represents sleep disorder. The next candidate dialogue node of the dialogue node 2.2 includes the dialogue node 2.2.1, the dialogue node 2.2.2 and the dialogue node 2.2.3, the dialogue node 2.2.1 represents difficulty in falling asleep, the dialogue node 2.2.2 represents light sleep, and the dialogue node 2.2.3 represents early awakening. The next candidate dialogue node of the dialogue node 2.2.1 includes the dialogue node 2.2.1.1, the dialogue node 2.2.1.2 and the dialogue node 2.2.1.3. The dialogue node 2.2.1.1 represents inquiring about the falling-asleep time, and the corresponding next candidate dialogue node includes the dialogue node 2.2.1.1.1 and the dialogue node 2.2.1.1.2, representing the falling-asleep time less than 0.5 h and the falling-asleep time greater than or equal to 0.5 h, respectively. The dialogue node 2.2.1.2 represents inquiring about the falling-asleep frequency, and the corresponding next candidate dialogue node includes the dialogue node 2.2.1.2.1 and the dialogue node 2.2.1.2.2, representing the falling-asleep frequency 1-5 days and the falling-asleep frequency 6-7 days, respectively. The dialogue node 2.2.1.3 represents inquiring about the continuous state, and the corresponding next candidate dialogue node includes the dialogue node 2.2.1.3.1 and the dialogue node 2.2.1.3.2, representing the same continuous state and different continuous state, respectively.

[0122] After the scene knowledge graph is constructed, the dialogue node of the next dialogue round can be determined based on the scene knowledge graph.

[0123] Specifically, in a case where the scene involved in the current dialogue round and the scene involved in the next dialogue round are the same, the first dialogue node of the current dialogue round is determined in the preset scene knowledge graph. Then, the dialogue node of the next dialogue round is determined in at least one next-round candidate dialogue node of the first dialogue node.

[0124] In the embodiments of the present application, the preset scene knowledge graph includes dialogue nodes in multiple scenes and topological relations between the dialogue nodes in the multiple scenes. The preset scene knowledge graph may, for example, be Figure 3 The scene knowledge graph of the example indicates that the current dialogue round and the next dialogue round do not need to jump out of the scene in a case where the scene involved in the current dialogue round and the scene involved in the next dialogue round are the same. Figure 3For example, if the scenario involved in the current dialogue turn and the scenario involved in the next dialogue turn are both scenarios of inquiring about depression, the current dialogue turn and the next dialogue turn are both inquiring about depression. If the first dialogue node of the current dialogue turn is dialogue node 1.1, the at least one next-turn candidate dialogue node includes dialogue node 1.1.1 and dialogue node 1.1.2, and one of dialogue node 1.1.1 and dialogue node 1.1.2 is selected as the dialogue node of the next dialogue turn.

[0125] In the case where the scenario involved in the current dialogue turn and the scenario involved in the next dialogue turn are different, the second dialogue node of the next dialogue turn is determined in the preset scenario knowledge graph. Then, the dialogue node of the next dialogue turn is determined from the at least one next-turn candidate dialogue node of the second dialogue node.

[0126] In the case where the scenario involved in the current dialogue turn and the scenario involved in the next dialogue turn are different, it is indicated that a jump out of the scenario is needed. For example, the scenario involved in the current dialogue turn is a scenario of inquiring about depression, and the scenario involved in the next dialogue turn is a scenario of inquiring about sleep, the dialogue node 2 is determined as the second dialogue node in the preset scenario knowledge graph. Correspondingly, the at least one next-turn candidate dialogue node of the second dialogue node includes dialogue node 2.1 and dialogue node 2.2, and one of dialogue node 2.1 and dialogue node 2.2 is selected as the dialogue node of the next dialogue turn. Figure 3

[0127] S23, determining prompt information of the current dialogue turn according to the intent information, the scenario knowledge, the dialogue node, and the historical dialogue with the to-be-evaluated object.

[0128] In the embodiments of the present application, the constructed prompt information mainly includes four parts, which are role indication information, dialogue example, knowledge fusion information, and structured output information, which will be introduced below.

[0129] The first part of the prompt information is the role indication information. According to the intent information of the to-be-evaluated object in the current dialogue turn and the dialogue node of the next dialogue turn, the role indication information is generated, wherein the role indication information is used to indicate the role of the evaluation object interacting with the to-be-evaluated object, and the background and target of the next dialogue turn.

[0130] ​The evaluation object is an object in conversation with the object to be evaluated, and the role to which the evaluation object belongs is the role in conversation with the object to be evaluated. In a scenario in which the object to be evaluated needs to be evaluated, the role to which the evaluation object belongs can be a professional for state evaluation. For example, in the evaluation of a depression state, the role to which the evaluation object belongs can be a psychologist, a psychological counselor, and the like. The background and target of the next dialogue turn are mainly used to indicate the operation to be performed and the target to be achieved in the next dialogue turn.

[0131] An example of role indication information is as follows:

[0132] "Present a dialogue data of a depression inquiry, as a psychologist, you need to analyze the 'historical dialogue data', combine the Hamilton Depression Scale (HAMD)-17 scale, select the most appropriate strategy from the 'interaction strategy resource library' to reply, and transition to the next question."

[0133] The role indication information of the above example indicates that the role to which the evaluation object belongs is a psychologist, and the background and target of the next dialogue turn are to analyze the 'historical dialogue data', combine the HAMD-17 scale, select the most appropriate strategy from the 'interaction strategy resource library' to reply, and transition to the next question.

[0134] The second part of the prompt information is a dialogue example. The dialogue example is mainly used to give at least one example in a state evaluation scenario, so that the medical large model can better activate the interaction capability. In the embodiment of the application, the dialogue example can be in the form of FQA, and the dialogue example only includes one round of dialogue; the dialogue example can also be in the form of multi-round interactive active question and answer, and the dialogue example can include multiple rounds of dialogue. The client can generate a dialogue example of the next dialogue turn according to the historical dialogue.

[0135] An example of a dialogue is as follows:

[0136] "historical dialogue data":

[0137] {

[0138] Psychologist: Will there be a decrease in interest in most things or in things previously enjoyed in terms of learning and interest this week?

[0139] Object to be evaluated: Yes.

[0140] };

[0141] The above dialogue example includes one round of dialogue. In the embodiment of the application, the dialogue example can be generated based on the current dialogue turn.

[0142] The third part of the prompt information is knowledge fusion information. According to the scene knowledge in the field, the knowledge in the scene can be retrieved or matched to obtain the knowledge in the scene, and injected into the large model, so as to constrain the output of the large model and increase the controllability of the output of the large model. Specifically, the client matches the intent information of the to-be-evaluated object in the current dialogue turn and the scene knowledge to obtain the knowledge fusion information matched with the intent information.

[0143] Taking the evaluation of the depressive state as an example, the knowledge of the HAMD quantitative scale is collected. The HAMD scale is a psychiatric professional language for evaluating the depressive state, and there are 17 scenes in total. At this time, the intent information obtained by NLU can obtain the scene knowledge of HAMD corresponding to the current dialogue, so the knowledge of HAMD scene can be matched through the intent information and injected into the prompt information.

[0144] Taking the HAMD quantitative scale as an example, part of the HAMD quantitative scale is shown in Table 1 as follows:

[0145] Table 1

[0146]

[0147] Then the corresponding knowledge fusion information is as follows:

[0148] “Next question”: please ask if the performance has decreased,

[0149] For example, [“Will there be a decrease in efficiency or time spent on activities due to a decrease in interest?”,

[0150] “Will the efficiency of doing things and the time spent be affected on the basis of a decrease in interest?”];

[0151] The work and interest scene in the HAMD-17 scale;

[0152] “Interaction strategy resource library”: [

[0154] “Ask the next question directly”, / / No additional processing is needed, and the next question can be directly transitioned to;

[0155] “Empathy”, / / If the reply is relatively positive and positive, appropriate affirmation and encouragement should be given. If the to-be-evaluated object shows negative, give comfort and empathy;

[0156] “Suggestion for relief”, / / When the to-be-evaluated object replies very negatively or encounters difficulties, provide suggestions on how to change, but pay attention to not crossing the line and tell them what to do. ]

[0158] The fourth part of the prompt information is structured output information. The structured output information is mainly used to constrain the output of the medical large model. In the scene of state evaluation, it is mainly used to constrain the relevance, logic and fluency of the generated text of the medical large model, and can also require the medical large model to output the number of words or the format limit. According to the historical dialogue and the preset specification, the structured output information is generated, so that the medical large model can generate the expected interactive text.

[0159] An example of structured output information is as follows:

[0160] "Requirements for generating a psychologist reply script:

[0161] 1. Combine "historical dialogue data" to generate a short script connection and ask for "next question" related content;

[0162] 2. Keep the logic of "historical dialogue data" smooth, with a certain diversity and emotion;

[0163] 3. The psychologist reply script should be concise and concise, and try not to exceed 60 words."

[0164] Based on the structured output information of the above example, the relevant constraints of the output text of the medical large model can be known, so that the expected interactive text can be generated.

[0165] S24, input the prompt information and the response of the current dialogue turn into the medical large model to obtain a question of a next dialogue turn, and the question of the next dialogue turn is used to evaluate the state of the to-be-evaluated object.

[0166] Wherein, the medical large model is obtained based on training of a plurality of training samples, each training sample including a sample response of a sample dialogue turn, a sample prompt information of the sample dialogue turn and a question label of the sample response.

[0167] The training process of the medical large model will be introduced below. Figure 4

[0168] Figure 4 The training flowchart of the medical large model provided by the embodiments of the present application is shown in FIG. 1, which includes: Figure 4

[0169] S41, obtaining a plurality of sample dialogues and a plurality of sample dialogues each corresponding to a sample prompt information.

[0170] ​​The sample dialogue is a historical dialogue between the sample to-be-evaluated object and the sample evaluation object, and the sample prompt information is constructed based on the intention information of the sample to-be-evaluated object, the sample scene indication involved in the historical dialogue between the sample to-be-evaluated object and the sample evaluation object, and the corresponding dialogue node. The implementation of constructing the sample prompt information is similar to the implementation of constructing the prompt information in the above-mentioned embodiments, and will not be described here.

[0171] Based on the data of the original dialogue interaction between the sample to-be-evaluated object and the sample evaluation object, the interactive use case can be constructed through the original multi-round dialogue corpus. However, since the amount of data of the current dialogue interaction between the sample to-be-evaluated object and the sample evaluation object is small, the self-instruct method can be used to expand and restore the pre-generation of the data set.

[0172] Figure 5 The sample dialogue provided by the embodiments of the present application expands the intention, as shown in Figure 5 The initial sample dialogue is the original historical dialogue between the sample to-be-evaluated object and the sample evaluation object, which is used as a seed instruction to generate a new sample dialogue.

[0173] Specifically, according to the initial sample dialogue and the sample prompt information corresponding to the initial sample dialogue, a plurality of candidate sample dialogues corresponding to the initial sample dialogue can be generated. For example, the initial sample dialogue and the sample prompt information corresponding to the initial sample dialogue can be input into a medical large model to obtain a plurality of candidate sample dialogues.

[0174] The plurality of generated candidate sample dialogues also need to be further screened. That is, according to the plurality of candidate sample dialogues, a plurality of target sample dialogues corresponding to the initial sample dialogue are generated; wherein the plurality of sample dialogues include the initial sample dialogue and the plurality of target sample dialogues.

[0175] One implementation is that after obtaining the plurality of candidate sample dialogues, each candidate sample dialogue is checked in a man-machine coupling manner. If the check is qualified, it can be directly determined as a target sample dialogue. If the check is unqualified, it can be modified and determined as a target sample dialogue, or directly discarded.

[0176] One implementation is to pre-train a classification model. Then input the candidate sample dialogue into the classification model to obtain the corresponding classification result, which is one of excellent, qualified, and unqualified. Then determine the candidate sample dialogue with the excellent classification result, or the candidate sample dialogue with the excellent and qualified classification results, as the target sample dialogue.

[0177] S42, for each sample dialogue, determining the input sequence and the label sequence of the sample dialogue according to the sample dialogue and the sample prompt information corresponding to the sample dialogue.

[0178] Specifically, first, the sample dialogue and the sample prompt information corresponding to the sample dialogue are subjected to word segmentation processing to obtain a plurality of segmented words arranged in order. Then, the respective indexes corresponding to the plurality of segmented words are determined in a preset vocabulary library. The preset vocabulary library includes a plurality of words, each word has a corresponding index, and the indexes corresponding to different words are different. Based on the mapping relationship between the words and the indexes in the preset vocabulary library, the respective indexes corresponding to the plurality of segmented words can be determined.

[0179] Then, the input sequence of the sample dialogue is generated according to the order of the plurality of segmented words and the respective indexes corresponding to the plurality of segmented words. The input sequence is subjected to shift processing to generate the label sequence of the sample dialogue.

[0180] An example is introduced. According to the respective indexes corresponding to the plurality of segmented words and the order of the plurality of segmented words, the generated input sequence X is:

[0181] X=[q1,q2,q3,a1,a2,a3,a4,q1,q2,q3,a1,a2,a3,a4,0,0,0]。

[0182] Wherein, X={x j ; 0<j<L}, the maximum text length is L, L is a preset value, L is a positive integer, and is used to limit the length of the input sequence and the label sequence. q1, q2, q3, a1, a2, a3, a4 are indexes corresponding to different segmented words, and 0 is a padding value.

[0183] After obtaining the input sequence X, it is right-shifted by one bit to obtain the label sequence Y:

[0184] Y=[q2,q3,a1,a2,a3,a4,q1,q2,q3,a1,a2,a3,a4,0,0,0,0]。

[0185] Wherein, Y={y j ; 0<j<L}, the maximum text length is L.

[0186] S43, inputting the input sequence of each of the plurality of sample dialogues into the initial medical large model to obtain the content output by the initial medical large model.

[0187] The input sequence of the sample dialogue is input into the initial medical large model, and the input sequence is processed by the medical large model to obtain the output content.

[0188] S44, training the initial medical large model according to the label sequence of each sample dialogue and the content output by the initial medical large model.

[0189] The structure of an example medical large model may, for example, include an N-layer mask-multi-attention structure, assuming that the dimension of the GPT hidden layer vector is d, then:

[0190] H = Sequence (MLP (X),

[0191] Score = Softmax (MLP (mask-multi-attention (H) ),

[0192] where X is the input sequence, H = {h j ,0<j<L,h j ∈R d}, H is the sequence encoding representation of the text, and Score is the content score probability output by the initial medical large model. According to the Score score probability, the word segmentation of the corresponding position in the word table can be calculated, and the final loss value is calculated by combining the cross entropy of the label sequence corresponding to the word segmentation and the AdamW optimization algorithm, so as to iterate and train the initial medical large model.

[0193] Through the above process, the training of the medical large model can be completed. After the training is completed, the prompt information and the response of the current dialogue round are input into the medical large model, and the next dialogue round question can be obtained, and the next round of interaction process with the to-be-evaluated object is started.

[0194] Figure 6 The schematic diagram of outputting the next dialogue round question provided by the embodiments of the present application is shown in Figure 6 , mainly involving a dialogue interaction module and an interaction generation module.

[0195] Taking the depression state evaluation as an example, the dialogue interaction module mainly combines Figure 1The example dialogue system framework obtains intention information of an evaluated object based on a semantic understanding module, obtains knowledge constraints of a current scene based on a knowledge graph of a depression emotion evaluation interaction HAMD and a depression disease knowledge base. Then, by constructing a depression interaction scene-based interaction knowledge graph, the intention information of the evaluated object is matched in the scene-based knowledge graph to obtain a dialogue node of the next interaction, and a jump out of the scene is performed. The jump out of the current scene mainly comprises the following steps: the prompt information and the response of the current dialogue round are input into a medical large model for reasoning, and two types of responses are output, namely, active guidance and empathic communication. The active guidance refers to further inquiry, acute event confirmation and serious behavior confirmation. The empathic communication refers to explanation clarification, comfort suggestion and the like. The two parts jointly constitute the reply dialogue of the next round in the scene.

[0196] In summary, the state evaluation interaction method provided in the embodiments of the present application first performs intention recognition on the response of the evaluated object in the current dialogue round to determine the intention information of the evaluated object in the current dialogue round. Then, according to the intention information, the scene knowledge involved in the current dialogue round and the dialogue node of the next dialogue round are determined. According to the intention information, the scene knowledge, the dialogue node and the historical dialogue with the evaluated object, the prompt information of the current dialogue round is determined. Then, the prompt information and the response of the current dialogue round are input into a medical large model to obtain the question of the next dialogue round, which is used to evaluate the state of the evaluated object. The medical large model is obtained by training a plurality of training samples. Each training sample includes a sample response of a sample dialogue round, a sample prompt information of a sample dialogue round and a question label of the sample response. Since the prompt information is constructed based on the intention information, the scene knowledge, the dialogue node and the historical dialogue with the evaluated object, it can guide the output of the medical large model. The next question output by the medical large model is controllable through the constraint of the prompt information. Since the current dialogue round is based on the response of the current dialogue round, a natural interactive reply can be generated, and the problem of rigid and unnatural reply can be avoided.

[0197] Figure 7 The structure diagram of the state evaluation interaction device provided in the embodiments of the present application is shown in FIG. 1. Figure 7 As shown in FIG. 1, the device comprises:

[0198] A first determination module 71 is configured to perform intention recognition on the response of the evaluated object in the current dialogue round to determine the intention information of the evaluated object in the current dialogue round.

[0199] A second determination module 72 is configured to determine the scene knowledge involved in the current dialogue round and the dialogue node of the next dialogue round according to the intention information.

[0200] The processing module 73 is configured to determine prompt information of the current dialogue turn according to the intention information, the scene knowledge, the dialogue node, and historical dialogue of the to-be-evaluated object.

[0201] The interaction module 74 is configured to input the prompt information and a response of the current dialogue turn into a medical large model to obtain a question of a next dialogue turn, where the question of the next dialogue turn is used to evaluate a state of the to-be-evaluated object.

[0202] The medical large model is obtained by training a plurality of training samples, and each training sample includes a sample response of a sample dialogue turn, sample prompt information of the sample dialogue turn, and a question label of the sample response.

[0203] In a possible implementation, the second determination module 72 is specifically configured to:

[0204] determine a scene involved in the current dialogue turn and a scene involved in the next dialogue turn according to the intention information;

[0205] determine the scene knowledge according to the scene involved in the current dialogue turn;

[0206] determine a dialogue node of the next dialogue turn according to the scene involved in the current dialogue turn and the scene involved in the next dialogue turn.

[0207] In a possible implementation, the second determination module 72 is specifically configured to:

[0208] determine scene constraint information matched with the scene involved in the current dialogue turn in a preset knowledge base;

[0209] fuse the scene constraint information to obtain the scene knowledge.

[0210] In a possible implementation, the second determination module 72 is specifically configured to:

[0211] in a case where the scene involved in the current dialogue turn is the same as the scene involved in the next dialogue turn, determine a first dialogue node of the current dialogue turn in a preset scene knowledge graph; and determine the dialogue node of the next dialogue turn from at least one next-round candidate dialogue node of the first dialogue node, where the preset scene knowledge graph includes a plurality of dialogue nodes under different scenes and a topological relationship between the dialogue nodes under different scenes.

[0212] In a case where the scene involved in the current dialogue turn and the scene involved in the next dialogue turn are different, a second dialogue skill node of the next dialogue turn is determined in the preset scene knowledge graph; and a dialogue skill node of the next dialogue turn is determined from at least one next-turn candidate dialogue skill node of the second dialogue skill node.

[0213] In a possible implementation, the processing module 73 is specifically configured to:

[0214] According to the intent information and the dialogue skill node, role indication information is generated, the role indication information being used to indicate a role to which an evaluation object interacting with the to-be-evaluated object belongs, and a background and a target of the next dialogue turn;

[0215] According to the historical dialogue, a dialogue example of the next dialogue turn is generated;

[0216] The intent information and the scene knowledge are matched to obtain knowledge fusion information matched with the intent information;

[0217] According to the historical dialogue and a preset specification, structured output information is generated;

[0218] The prompt information includes the role indication information, the dialogue example, the knowledge fusion information, and the structured output information.

[0219] In a possible implementation, the processing module 73 is further configured to:

[0220] A plurality of sample dialogues and respective sample prompt information corresponding to the plurality of sample dialogues are obtained;

[0221] For each sample dialogue, an input sequence and a label sequence of the sample dialogue are determined according to the sample dialogue and the sample prompt information corresponding to the sample dialogue;

[0222] Respective input sequences of the plurality of sample dialogues are input into an initial medical large model to obtain content output by the initial medical large model;

[0223] The initial medical large model is trained according to respective label sequences of the plurality of sample dialogues and the content output by the initial medical large model.

[0224] In a possible implementation, the processing module 73 is further configured to:

[0225] The sample dialogue and the sample prompt information corresponding to the sample dialogue are subjected to word segmentation processing to obtain a plurality of segmented words arranged in sequence;

[0226] determine, in a preset vocabulary library, indexes respectively corresponding to the plurality of segmented words;

[0227] generate the input sequence according to an order of the plurality of segmented words and the indexes respectively corresponding to the plurality of segmented words;

[0228] perform a shift processing on the input sequence to generate the label sequence.

[0229] In a possible implementation, the processing module 73 is further configured to:

[0230] obtain an initial sample dialogue and sample prompt information corresponding to the initial sample dialogue;

[0231] generate a plurality of candidate sample dialogues corresponding to the initial sample dialogue according to the initial sample dialogue and the sample prompt information corresponding to the initial sample dialogue;

[0232] generate a plurality of target sample dialogues corresponding to the initial sample dialogue according to the plurality of candidate sample dialogues; wherein the plurality of sample dialogues include the initial sample dialogue and the plurality of target sample dialogues.

[0233] The state evaluation interaction device provided in the embodiments of the present application can execute the technical solutions of the state evaluation interaction method in any of the above embodiments, and has similar implementation principles and beneficial effects to the implementation principles and beneficial effects of the state evaluation interaction method. For details, refer to the implementation principles and beneficial effects of the state evaluation interaction method, which will not be described here.

[0234] Figure 8 An entity structure schematic diagram of an electronic device provided in the embodiments of the present application is as follows: Figure 8As shown, the electronic device can include a processor 810, a communications interface 820, a memory 830, and a communications bus 840, wherein the processor 810, the communications interface 820, and the memory 830 complete mutual communication through the communications bus 840. The processor 810 can invoke a logic instruction in the memory 830 to execute an interaction method for state evaluation, which includes: performing intent recognition on a response of a to-be-evaluated object in a current dialogue turn, determining intent information of the to-be-evaluated object in the current dialogue turn; according to the intent information, determining scene knowledge involved in the current dialogue turn and a dialogue skill node of a next dialogue turn; according to the intent information, the scene knowledge, the dialogue skill node, and a historical dialogue with the to-be-evaluated object, determining prompt information of the current dialogue turn; inputting the prompt information and the response of the current dialogue turn into a medical large model to obtain a question of the next dialogue turn, the question of the next dialogue turn being used to evaluate a state of the to-be-evaluated object; wherein the medical large model is obtained by training based on multiple groups of training samples, each group of training samples including a sample response of a sample dialogue turn, sample prompt information of the sample dialogue turn, and a question label of the sample response.

[0235] In addition, the logic instruction in the memory 830 described above can be implemented in the form of a software functional unit and sold or used as an independent product, and can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various program code storage media.

[0236] In another aspect, the present application also provides a computer program product, which comprises a computer program, the computer program being stored in a non-transitory computer-readable storage medium, and the computer program being executable by a processor to enable a computer to perform the interaction method for state evaluation provided by any of the above method embodiments, the method comprising: performing intent recognition on a response of a current dialogue turn of a to-be-evaluated object to determine intent information of the to-be-evaluated object in the current dialogue turn; determining scenario knowledge involved in the current dialogue turn and a dialogue node of a next dialogue turn according to the intent information; determining prompt information of the current dialogue turn according to the intent information, the scenario knowledge, the dialogue node, and historical dialogues with the to-be-evaluated object; inputting the prompt information and the response of the current dialogue turn into a medical large model to obtain a question of the next dialogue turn, the question of the next dialogue turn being used to evaluate a state of the to-be-evaluated object; wherein the medical large model is obtained by training based on a plurality of training samples, each training sample comprising a sample response of a sample dialogue turn, sample prompt information of the sample dialogue turn, and a question label of the sample response.

[0237] In yet another aspect, the present application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, the computer program being executable by a processor to implement the interaction method for state evaluation provided by any of the above method embodiments, the method comprising: performing intent recognition on a response of a current dialogue turn of a to-be-evaluated object to determine intent information of the to-be-evaluated object in the current dialogue turn; determining scenario knowledge involved in the current dialogue turn and a dialogue node of a next dialogue turn according to the intent information; determining prompt information of the current dialogue turn according to the intent information, the scenario knowledge, the dialogue node, and historical dialogues with the to-be-evaluated object; inputting the prompt information and the response of the current dialogue turn into a medical large model to obtain a question of the next dialogue turn, the question of the next dialogue turn being used to evaluate a state of the to-be-evaluated object; wherein the medical large model is obtained by training based on a plurality of training samples, each training sample comprising a sample response of a sample dialogue turn, sample prompt information of the sample dialogue turn, and a question label of the sample response.

[0238] The device embodiments described above are merely illustrative, wherein the units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, i.e., can be located in one place, or can be distributed to multiple network units. Part or all of the modules can be selected based on actual needs to achieve the purposes of the embodiments. Those skilled in the art can understand and implement without creative labor.

[0239] Through the description of the above embodiments, those skilled in the art can clearly understand that the embodiments can be realized by means of software and necessary universal hardware platforms, and of course can also be realized by hardware. Based on such understanding, the above technical solutions can be embodied in the form of software products, and the computer software products can be stored in a computer readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and include a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in each embodiment or some parts of the embodiments.

[0240] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. An interactive method of state assessment, characterized by, The method comprises the following steps: performing intent recognition on a response of a to-be-evaluated object in a current dialogue turn to determine intent information of the to-be-evaluated object in the current dialogue turn; determining, according to the intent information, scenario knowledge related to the current dialogue turn and a dialogue node of a next dialogue turn; determining, according to the intent information, the scenario knowledge, the dialogue node and historical dialogues with the to-be-evaluated object, prompt information of the current dialogue turn; inputting the prompt information and the response of the current dialogue turn into a medical large model to obtain a question of the next dialogue turn, the question of the next dialogue turn being used to evaluate a state of the to-be-evaluated object; wherein the medical large model is obtained by training based on a plurality of training samples, each training sample comprising a sample response of a sample dialogue turn, sample prompt information of the sample dialogue turn and a question label of the sample response.

2. The method of claim 1, wherein, The determining, according to the intent information, of the scenario knowledge related to the current dialogue turn and the dialogue node of the next dialogue turn comprises: determining, according to the intent information, a scenario related to the current dialogue turn and a scenario related to the next dialogue turn; determining the scenario knowledge according to the scenario related to the current dialogue turn; determining the dialogue node of the next dialogue turn according to the scenario related to the current dialogue turn and the scenario related to the next dialogue turn.

3. The method of claim 2, wherein, The determining of the scenario knowledge according to the scenario related to the current dialogue turn comprises: determining, in a preset knowledge base, scenario constraint information matching the scenario related to the current dialogue turn; fusing the scenario constraint information to obtain the scenario knowledge.

4. The method of claim 2, wherein, The determining of the dialogue node of the next dialogue turn according to the scenario related to the current dialogue turn and the scenario related to the next dialogue turn comprises: in a case where the scenario related to the current dialogue turn and the scenario related to the next dialogue turn are the same, determining, in a preset scenario knowledge graph, a first dialogue node of the current dialogue turn; determining the dialogue node of the next dialogue turn from at least one next-round candidate dialogue node of the first dialogue node; the preset scenario knowledge graph comprising a plurality of dialogue nodes under different scenarios and topological relationships between the dialogue nodes under different scenarios; in a case where the scenario related to the current dialogue turn and the scenario related to the next dialogue turn are different, determining, in the preset scenario knowledge graph, a second dialogue node of the next dialogue turn; determining the dialogue node of the next dialogue turn from at least one next-round candidate dialogue node of the second dialogue node.

5. The method according to any one of claims 1 to 4, characterized in that, The determining of the prompt information of the current dialogue turn according to the intent information, the scenario knowledge, the dialogue node and the historical dialogues with the to-be-evaluated object comprises: generating, according to the intent information and the dialogue node, role indication information, the role indication information being used to indicate a role to which an evaluating object interacting with the to-be-evaluated object belongs, a background and a target of the next dialogue turn; generating, according to the historical dialogue, a dialogue example of the next dialogue turn; matching the intent information and the scene knowledge to obtain knowledge fusion information matched with the intent information; generating, according to the historical dialogue and a preset specification, structured output information; wherein the prompt information comprises the role indication information, the dialogue example, the knowledge fusion information and the structured output information.

6. The method according to any one of claims 1 to 4, characterized in that, The method further comprises: obtaining a plurality of sample dialogues and sample prompt information corresponding to each of the plurality of sample dialogues; for each of the sample dialogues, determining an input sequence and a label sequence of the sample dialogue according to the sample dialogue and the sample prompt information corresponding to the sample dialogue; inputting the input sequence of each of the plurality of sample dialogues into an initial medical large model to obtain content output by the initial medical large model; training the initial medical large model according to the label sequence of each of the plurality of sample dialogues and the content output by the initial medical large model.

7. The method of claim 6, wherein, The determining of the input sequence and the label sequence of the sample dialogue according to the sample dialogue and the sample prompt information corresponding to the sample dialogue comprises: performing word segmentation processing on the sample dialogue and the sample prompt information corresponding to the sample dialogue to obtain a plurality of segmented words arranged in order; determining an index corresponding to each of the plurality of segmented words in a preset word table library; generating the input sequence according to the order of the plurality of segmented words and the index corresponding to each of the plurality of segmented words; performing shift processing on the input sequence to generate the label sequence.

8. The method of claim 6, wherein, The method further comprises: obtaining an initial sample dialogue and sample prompt information corresponding to the initial sample dialogue; generating a plurality of candidate sample dialogues corresponding to the initial sample dialogue according to the initial sample dialogue and the sample prompt information corresponding to the initial sample dialogue; generating a plurality of target sample dialogues corresponding to the initial sample dialogue according to the plurality of candidate sample dialogues; wherein the plurality of sample dialogues comprise the initial sample dialogue and the plurality of target sample dialogues.

9. An interactive device for state assessment, characterized by comprise: a first determination module configured to perform intent recognition on a response of a to-be-evaluated object in a current dialogue turn to determine intent information of the to-be-evaluated object in the current dialogue turn; a second determination module configured to determine, according to the intent information, scene knowledge related to the current dialogue turn and a dialogue node of a next dialogue turn; a processing module configured to determine, according to the intent information, the scene knowledge, the dialogue node and a historical dialogue with the to-be-evaluated object, prompt information of the current dialogue turn; an interaction module configured to input the prompt information and the response of the current dialogue turn into a medical large model to obtain a question of the next dialogue turn, the question of the next dialogue turn being used to evaluate a state of the to-be-evaluated object; The medical large model is obtained by training based on multiple groups of training samples, and each group of training samples includes a sample response of a sample dialogue turn, sample prompt information of the sample dialogue turn, and a question label of the sample response.

10. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the state evaluation interaction method of any one of claims 1 to 8 when executing the program.

11. A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the state evaluation interaction method of any one of claims 1 to 8.

Citation Information

Patent Citations

  • Method for identifying complex intentions in task type multi-round dialogue

    CN110309170A

  • Knowledge graph-based question and answer method and device, electronic equipment and storage medium

    CN112328808A