A medical question-answering system and method based on pain perception and active interaction
By designing a medical Q&A system that combines deep learning models and multi-round dialogue technology, the problem of inefficiency in existing systems is solved, and more accurate medical information provision and more efficient human-machine Interaction.
Patent Information
- Application Number
- CN202211395530.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-09
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2042-11-09
AI Technical Summary
The existing medical Q&A system is difficult to deeply understand user language, and the traditional human-computer interaction methods are complex and inefficient, so it is impossible to effectively conduct multiple rounds of dialogue and human-computer interaction in the medical field.
设计了一种基于疼痛感知和主动交互的医疗问答系统,结合闲聊意图模块、疼痛意图感知模块、多轮问答模块、知识图谱问答模块和人机交互模块,通过深度学习模型(如Bert+TextCNN和BiLSTM+CRF)进行疾病意图识别和实体识别,实现多轮对话和人机交互。
The system can more accurately understand the user's medical intentions, provide accurate answers, and relieve user anxiety through active interaction modules, and improve user stickiness of the user experience and dialogue system.
Smart Images

Figure CN115714030B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of human-computer dialogue, and in particular relates to a medical question-and-answer system and method based on pain perception and active interaction. Background Art
[0002] Among the existing question-answering systems, the question-answering systems can be roughly divided into three types, namely, question-answering systems based on question-answering pairs, question-answering systems based on generation, and question-answering systems based on knowledge bases. The question-answering technology of question-answering systems based on question-answering pairs also has a defect, that is, the answer must contain at least one word or phrase contained in the user's question. If not, the correct answer cannot be returned to the user. However, human language is naturally complex, and this method cannot understand the user's language in depth; the question-answering system based on generation is suitable for dialogue systems in open fields, but since the question-answering system in the medical field belongs to a specific field, this method is not suitable; the question-answering system based on a knowledge base is suitable for building a question-answering system in a specific field, and it cannot be guaranteed that the knowledge base takes into account all the knowledge in the field. In response to the above problems in the dialogue scenario in the medical field, a question-answering system based on a combination of knowledge base and question-answering pairs is used in the design of the question-answering system, which not only ensures that the question-answering system can fully understand the user's intentions but also return relatively accurate answers.
[0003] In traditional medical question-and-answer systems, human-computer interaction is rare. Usually, the system will not continue the conversation after the user has consulted the relevant information. In traditional human-computer interaction, users usually start interacting with the machine directly. In this way, users usually pass their commands to the robot through peripherals such as keyboards or mice. This human-computer method is complicated and inefficient. For users without experience, this traditional human-computer interaction method has become an obstacle for users to communicate with robots. Summary of the invention
[0004] In view of the shortcomings of the prior art, the present invention proposes a medical question-and-answer system and method based on pain perception and active interaction, the system comprising: a chat intention module, a pain intention perception module, a question-and-answer pair module, a multi-round question-and-answer module, a knowledge graph question-and-answer module and a human-computer interaction module;
[0005] The chat intention module is used to identify the user's intention according to the user input information, and if the identification result is a chat intention statement, return a chat answer to the user according to the chat intention statement, otherwise, send the non-chat intention statement to the pain intention perception module;
[0006] The pain intention perception module is used to perform disease intention recognition and pain perception on non-chatting intention sentences. If pain intention is recognized, pain intention information is generated and sent to the human-computer interaction module; the disease intention confidence of the non-chatting intention sentence is calculated, and the non-chatting intention sentence with low confidence is sent to the question-answer pair module, and the non-chatting intention sentence with high confidence is sent to the multi-round dialogue module;
[0007] The multi-round dialogue module is used to perform disease entity recognition on non-chatting intent sentences with high confidence to obtain recognition results; and send the recognition results to the knowledge graph question-answering module;
[0008] The knowledge graph question-answering module is used to perform knowledge query based on the recognition result, obtain the query result, and determine whether the query result contains information related to the disease. If so, an answer is generated based on the query result and the answer is returned to the user; otherwise, the query result is sent to the question-answering module;
[0009] The question-answer module returns an answer to the user according to the non-chatting intention statement or query result;
[0010] The human-computer interaction module is used to perform human-computer interaction with the user according to the user's historical input information and pain intention information.
[0011] Preferably, the question-answer pair module retrieves the answer from the question-answer pair database according to the non-chat intention statement or query result and returns it to the user.
[0012] Preferably, the chat intention module searches for chat answers from a chat intention question and answer database according to the chat intention statement, and returns the chat answers to the user.
[0013] Preferably, the pain intention perception module inputs the non-chatty intention sentence into the question classification model, and the output of the question classification model is the pain intention recognition result; the question classification model uses the disease-related intention recognition data set as training data and is trained using a deep learning method.
[0014] Furthermore, the question classification model is a Bert+TextCNN model, and the training process of the model includes:
[0015] Obtain disease-related intent recognition datasets and corresponding labels, semanticize the labels, and obtain label name embeddings;
[0016] The tag name embedding is combined with the original tag to jointly represent the tag of the data;
[0017] Input the data set and the corresponding labels into the Bert model, perform feature extraction on the output of the Bert model, and obtain CLS features and token features;
[0018] Input the extracted features into the TextCNN model to obtain CNN features; concatenate CNN features and CLS features;
[0019] The concatenated features are input into a fully connected layer, and the softmax function is used as the activation function for multi-classification, and the classification results are output;
[0020] The Sigmoid cross entropy loss is used to train the model and adjust the model parameters to obtain the trained Bert+TextCNN model.
[0021] Preferably, the multi-round dialogue module uses a BiLSTM+CRF model to perform disease entity recognition on non-chatting intent sentences with high confidence; the process of training the BiLSTM+CRF model includes:
[0022] Obtain disease-related entity datasets;
[0023] Perform BIO annotation on disease-related entity datasets and encode entity data and annotations separately;
[0024] Use the dictionary to convert the encoded entity data and annotations into a word vector matrix, use the word vector matrix as the input of embedding, and get the output of embedding;
[0025] The output of embedding is input into BiLSTM to obtain the score matrix; the score matrix is input into CRF for classification and judgment to obtain the label prediction value of each entity.
[0026] Preferably, the process of the multi-round dialogue module performing disease entity recognition on non-chat intent sentences with high confidence includes: identifying the disease entities of the non-chat intent sentences, obtaining recognition results, performing slot inheritance and slot filling on the recognition results, and obtaining updated recognition results.
[0027] Preferably, the knowledge graph question-and-answer module retrieves entities related to the recognition results from the knowledge graph, obtains query results and generates answers based on the query results; the knowledge graph is constructed using the neo4j graph database.
[0028] A medical question-answering method based on pain perception and active interaction, comprising:
[0029] S1: Perform chat intention recognition on the user's input information. If it is recognized as a chat intention statement, a chat answer is returned to the user. Otherwise, disease intention recognition and pain perception are performed;
[0030] S2: If the pain intent is identified, pain intent information is generated; the disease intent confidence of the non-chatting intent sentence is calculated. If the confidence is low, the answer is retrieved from the question-answer pair database based on the non-chatting intent sentence and returned to the user; if the confidence is high, disease entity recognition is performed on the non-chatting intent sentence to obtain the recognition result;
[0031] S3: query the knowledge graph based on the recognition result to obtain the query result, and determine whether the query result contains information related to the disease. If so, generate an answer based on the query result and return the answer to the user; otherwise, retrieve the answer from the question-answer database based on the query result and return it to the user;
[0032] S4: judging whether the human-computer interaction conditions are met according to the pain intention information and the user's historical input information; if so, performing human-computer interaction according to the user's historical input information.
[0033] The beneficial effects of the present invention are:
[0034] The question-and-answer system of the present invention fully combines the advantages of various question-and-answer system types, so that users can not only obtain the disease information they want when consulting related disease information, but also enable the machine to actively perceive human pain and take active care of users, thereby alleviating users' anxiety; a multi-round dialogue mechanism is adopted in the dialogue mechanism, and this method makes the entire human-computer interaction process more effective and reasonable, thereby improving the user experience of the question-and-answer system and increasing the user stickiness of the dialogue system. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 This is a flow chart of the medical question-answering system based on pain perception and active interaction in the present invention;
[0036] Figure 2 This is a demonstration process of multiple rounds of dialogue in the present invention. DETAILED DESCRIPTION
[0037] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0038] The present invention proposes a medical question-answering system and method based on pain perception and active interaction, such as Figure 1 As shown, the system includes: a chat intention module, a pain intention perception module, a question-answer pair module, a multi-round question-answer module, a knowledge graph question-answer module and a human-computer interaction module;
[0039] The chat intention module is used to identify the user's intention based on the user input information. If the identification result is a chat intention sentence, a chat answer is returned to the user according to the chat intention sentence. Otherwise, the non-chat intention sentence is sent to the pain intention perception module.
[0040] The chat intention module uses a traditional machine learning model to identify intent. Specifically, TF-IDF is used to extract features from user input information. TF-IDF (Term Frequency-Inverse Document Frequency) is a statistical method used to evaluate the importance of a word to a document set or one of the documents in a corpus. The importance of a word increases in direct proportion to the number of times it appears in a document, but at the same time it decreases in inverse proportion to the frequency of its appearance in the corpus. The extracted features are input into a logistic regression model for training, and the trained logistic regression model is used to identify user intent. In some embodiments, logistic regression is often used in multi-classification tasks.
[0041] The user input information is input into the machine learning model, and the chat intention recognition result is output. If the user input information is recognized as a chat intention sentence, the chat answer is found in the chat intention question and answer database, and the chat answer is returned to the user; among them, the chat intention question and answer database contains a large number of reply templates for chat sentences.
[0042] The pain intention perception module is used to identify disease intention and pain perception for non-chatting intention sentences. If pain intention is recognized, pain intention information is generated and sent to the human-computer interaction module; the disease intention confidence of non-chatting intention sentences is calculated, and non-chatting intention sentences with low confidence are sent to the question-answer pair module, and non-chatting intention sentences with high confidence are sent to the multi-round dialogue module. The confidence level can be determined by a preset confidence threshold.
[0043] In order to identify whether a non-chatty intent sentence has pain intent, the pain intention perception module includes a question classification model, and the non-chatty intent sentence is input into the question classification model. The output of the question classification model is the pain intent recognition result; the question classification model uses a disease-related intent recognition data set as training data and is trained using a deep learning method; the intent recognition task is a multi-intent detection task, which belongs to the category of multi-label classification. Preferably, the question classification model can be a Bert+TextCNN model. The Bert model is a pre-trained language representation model and a bidirectional encoding representation of the Transformer. It not only uses a masked language model, but also generates a bidirectional language representation. TextCNN is a deformation of the input layer of the traditional CNN. It has only one convolution layer and one maximum pooling layer. Finally, the output is externally connected to softmax for n classification. It is widely used in text classification tasks. The training process of the entire model includes:
[0044] Obtain disease-related intent recognition datasets and corresponding labels, semanticize the labels, and obtain label name embedding.
[0045] The label name embedding is combined with the original label to jointly represent the label of the data.
[0046] Traditional multi-label tasks study the classification problem in which each instance is associated with a set of labels at the same time, and select more appropriate labels by the confidence with the correct label. In order to better calculate the relevance of label instances, the present invention semanticizes the labels and embeds the label name as the center of the Embedding space, and represents each label together with the label of the original training instance. This refines the representation of different classes. This allows the label representation to better describe the category semantics while being separated from each other; the combined label representation is:
[0047] y i ~ =α×V(y i )+(1-α)y i
[0048] Among them, y i ~ Represents the combined label, y i represents the prototype representation obtained by the training example, that is, the original label; V(y i ) is the label name embedding representation of the original label, here V(y i ) from when the prototype represents the deflection of the vector.
[0049] The data set and the corresponding labels are input into the Bert model, and the output of the Bert model is subjected to feature extraction to obtain CLS features and token features.
[0050] The extracted features are input into the TextCNN model to obtain CNN features; the CNN features are concatenated with the CLS features.
[0051] The concatenated features are input into a fully connected layer, and the softmax function is used as the activation function for multi-classification, and the classification result, i.e., the pain intention recognition result, is output.
[0052] The model is trained using Sigmoid cross entropy loss, and the model parameters are adjusted to obtain a trained Bert+TextCNN model; preferably, the loss function is:
[0053]
[0054] Where N represents the number of possible labels, f(y i )=f(x,y i ,S), S represents the training set, Y * is the standard label set. Ⅱ(.) is an indicator function, and σ represents the Sigmoid function.
[0055] Since the process of picking a threshold using label numbers is indistinguishable, training the model via the above loss function is a meta-learning process that learns meta-parameters (meta-threshold, kernel regression, similarity metric calculation) to improve non-parametric learning on unseen tasks.
[0056] The multi-round dialogue module is used to perform disease entity recognition on non-chatting intent sentences with high confidence to obtain recognition results; and send the recognition results to the knowledge graph question and answer module.
[0057] like Figure 2 As shown, the process of disease entity recognition of non-chatting intent sentences with high confidence by the multi-round dialogue module includes: identifying the disease entity of the non-chatting intent sentence, obtaining the recognition result, and performing slot inheritance and slot filling on the recognition result to obtain an updated recognition result. Preferably, the recognition result includes the intent entity, the disease entity, and the recognition confidence. If the disease entity is not recognized, the current recognition result is inherited and filled according to the recognition result of the previous round to obtain an updated recognition result.
[0058] The multi-round dialogue module can use the BiLSTM+CRF model to identify disease entities for non-chat intent sentences with high confidence. The process of training the BiLSTM+CRF model (bidirectional long short-term memory model + conditional random field model) includes:
[0059] Obtain disease-related entity datasets;
[0060] Perform BIO annotation on disease-related entity datasets and encode entity data and annotations separately;
[0061] Use the dictionary to convert the encoded entity data and annotations into a word vector matrix, use the word vector matrix as the input of embedding, and get the output of embedding;
[0062] The output of embedding is input into BiLSTM to obtain the score matrix; the score matrix is input into CRF for classification and judgment to obtain the label prediction value of each entity, that is, the recognition result of disease entity recognition.
[0063] The multi-round dialogue module cooperates with the knowledge graph question and answer module and the question and answer pair module to achieve a multi-round dialogue effect between the user and the system.
[0064] The knowledge graph question and answer module is used to perform knowledge query based on the recognition results, obtain query results, and determine whether the query results contain information related to the disease. If so, an answer is generated based on the query results and returned to the user; otherwise, the query results are sent to the question and answer module.
[0065] The knowledge graph question-answering module retrieves entities related to the recognition results from the knowledge graph, obtains the query results and generates answers based on the query results; the knowledge graph is constructed using the neo4j graph database. Specifically, a disease-related data set is obtained, and then the schema of the data set is defined. Relationships and entities are extracted from the data set according to the schema, and a knowledge graph is constructed according to a certain strategy.
[0066] The question-answer pair module returns an answer to the user based on the non-chat intent statement or query result. Specifically, the answer is retrieved from the question-answer pair database based on the non-chat intent statement or query result and returned to the user. At the same time, the question-answer pair module also returns a confidence level, which reflects the accuracy of the answer given by the question-answer pair module. If the confidence level is relatively low, the user is prompted to re-enter the correct disease-related consultation information.
[0067] The human-computer interaction module is used to perform human-computer interaction with the user according to the user's historical input information and pain intention information. The user's historical input information includes the current conversation and the historical conversation records. The human-computer interaction module determines whether the human-computer interaction conditions are met according to the pain intention information. If so, the human-computer interaction module extracts the recommended topic according to the user's historical input information, and performs human-computer interaction with the user based on the recommended topic, so as to achieve the effect of active care for the user's pain.
[0068] The present invention also proposes a medical question-answering method based on pain perception and active interaction, which can be used to implement the above-mentioned medical question-answering system based on pain perception and active interaction, and includes the following steps:
[0069] S1: Perform chat intention recognition on the user's input information. If it is recognized as a chat intention statement, return the chat answer to the user. Otherwise, perform disease intention recognition and pain knowledge recognition.
[0070] S2: If the pain intent is identified, pain intent information is generated; the disease intent confidence of the non-chatting intent sentence is calculated. If the confidence is low, the answer is retrieved from the question-answer pair database based on the non-chatting intent sentence and returned to the user; if the confidence is high, disease entity recognition is performed on the non-chatting intent sentence to obtain the recognition result;
[0071] S3: query the knowledge graph based on the recognition result to obtain the query result, and determine whether the query result contains information related to the disease. If so, generate an answer based on the query result and return the answer to the user; otherwise, retrieve the answer from the question-answer database based on the query result and return it to the user;
[0072] S4: judging whether the human-computer interaction conditions are met according to the pain intention information and the user's historical input information; if so, performing human-computer interaction according to the user's historical input information.
[0073] It should be noted that a person skilled in the art can understand that all or part of the processes in the above method embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes in the above method embodiments. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0074] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the method embodiment, since it is basically similar to the system embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the system embodiment. The system embodiment described above is merely schematic, and the units and modules described as separate components may or may not be physically separated. In addition, some or all of the units and modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. A person of ordinary skill in the art can understand and implement it without paying creative labor.
[0075] The above embodiments further illustrate the purpose, technical solutions and advantages of the present invention in detail. It should be understood that the above embodiments are only preferred implementation modes of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made to the present invention within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A medical question-answering system based on pain perception and active interaction, characterized in that: include: Chat intention module, pain intention perception module, question-answer pair module, multi-round question-answer module, knowledge graph question-answer module and human-computer interaction module; The chat intention module is used to identify the user's intention according to the user input information, and if the identification result is a chat intention statement, return a chat answer to the user according to the chat intention statement, otherwise, send the non-chat intention statement to the pain intention perception module; The pain intention perception module is used to perform disease intention recognition and pain perception on non-chatting intention sentences. If pain intention is recognized, pain intention information is generated and sent to the human-computer interaction module. Calculate the disease intent confidence of non-chatting intent sentences, send non-chatting intent sentences with low confidence to the question-answer pair module, and send non-chatting intent sentences with high confidence to the multi-round dialogue module; The pain intention perception module inputs the non-chatting intention sentence into the question classification model, and the output of the question classification model is the pain intention recognition result; The question classification model is trained using a deep learning method with a disease-related intent recognition dataset as training data; The question classification model is the Bert+TextCNN model. The training process of this model includes: Obtain disease-related intent recognition datasets and corresponding labels, semanticize the labels, and obtain label name embeddings; The tag name embedding is combined with the original tag to jointly represent the tag of the data; Input the data set and the corresponding labels into the Bert model, perform feature extraction on the output of the Bert model, and obtain CLS features and token features; Input the extracted features into the TextCNN model to obtain CNN features; concatenate CNN features and CLS features; The concatenated features are input into a fully connected layer, and the softmax function is used as the activation function for multi-classification, and the classification results are output; The model is trained using Sigmoid cross entropy loss, and the model parameters are adjusted to obtain the trained Bert+TextCNN model. The multi-round dialogue module is used to perform disease entity recognition on non-chatting intent sentences with high confidence to obtain recognition results; and send the recognition results to the knowledge graph question-answering module; The knowledge graph question-answering module is used to perform knowledge query based on the recognition result, obtain the query result, and determine whether the query result contains information related to the disease. If so, an answer is generated based on the query result and the answer is returned to the user; otherwise, the query result is sent to the question-answering module; The question-answer module returns an answer to the user according to the non-chatting intention statement or query result; The human-computer interaction module is used to perform human-computer interaction with the user according to the user's historical input information and pain intention information.
2. A medical question-answering system based on pain perception and active interaction according to claim 1, characterized in that: The question-answer pair module retrieves answers from a question-answer pair database according to non-chatting intent statements or query results and returns them to the user.
3. A medical question-answering system based on pain perception and active interaction according to claim 1, characterized in that: The chat intention module searches for chat answers from a chat intention question and answer database according to the chat intention statement, and returns the chat answers to the user.
4. A medical question-answering system based on pain perception and active interaction according to claim 1, characterized in that: The multi-round dialogue module uses the BiLSTM+CRF model to perform disease entity recognition on non-chat intent sentences with high confidence; The process of training the BiLSTM+CRF model includes: Obtain disease-related entity datasets; Perform BIO annotation on disease-related entity data sets, and encode entity data and annotations separately; Use the dictionary to convert the encoded entity data and annotations into a word vector matrix, use the word vector matrix as the input of embedding, and get the output of embedding; The output of embedding is input into BiLSTM to obtain the score matrix; the score matrix is input into CRF for classification and judgment to obtain the label prediction value of each entity.
5. A medical question-answering system based on pain perception and active interaction according to claim 1, characterized in that: The process of the multi-round dialogue module performing disease entity recognition on non-chatting intent sentences with high confidence includes: recognizing the disease entities of the non-chatting intent sentences, obtaining recognition results, performing slot inheritance and slot filling on the recognition results, and obtaining updated recognition results.
6. A medical question-answering system based on pain perception and active interaction according to claim 1, characterized in that: The knowledge graph question-answering module retrieves entities related to the recognition results from the knowledge graph, obtains query results and generates answers based on the query results; the knowledge graph is constructed using the neo4j graph database.
7. A medical question-answering method based on the pain perception and active interactive medical question-answering system according to claim 1, characterized in that: include: S1: Perform chat intention recognition on the user's input information. If it is recognized as a chat intention statement, a chat answer is returned to the user. Otherwise, disease intention recognition and pain perception are performed; S2: if pain intention is identified, pain intention information is generated; Calculate the disease intent confidence of the non-chatting intent sentence. If the confidence is low, retrieve the answer from the question-answer pair database based on the non-chatting intent sentence and return it to the user; if the confidence is high, perform disease entity recognition on the non-chatting intent sentence to obtain the recognition result; S3: query the knowledge graph based on the recognition result to obtain the query result, and determine whether the query result contains information related to the disease. If so, generate an answer based on the query result and return the answer to the user; otherwise, retrieve the answer from the question-answer database based on the query result and return it to the user; S4: judging whether the human-computer interaction conditions are met according to the pain intention information and the user's historical input information; if so, performing human-computer interaction according to the user's historical input information.
Citation Information
Patent Citations
Artificial-intelligence auxiliary interrogation diagnosis system
CN107247868A
Knowledge-graph-based human-machine conversation control system and method
CN107943998A