Implementation method for multi-dimensional Q&A of thyroid diseases
Through multi-dimensional question-and-answer methods, including intention recognition, multi-round question-and-answer templates and FAQ search questions and answers, the lack of multi-dimensional question-and-answer and care questions and answers in the intelligent thyroid consultation system is solved, the coverage and accuracy of the consultation are improved, and the patient's self-disease assessment and self-diagnosis of self-diseases are realized.
Patent Information
- Application Number
- CN202410570891.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-09
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2044-05-09
AI Technical Summary
The existing intelligent thyroid consultation system lacks multi-dimensional Q&A and caring Q&A, which leads to inaccurate diagnostic results and cannot meet the complex and diverse Q&A needs of thyroid diseases.
A multi-dimensional question-and-answer method for thyroid disease is designed, including intention recognition, multi-round question-and-answer semantic slot templates, FAQ search question-and-answer and logical judgment, and the patient's self-disease assessment and self-diagnosis of self-diseases through a multi-dimensional question-and-answer system are used to realize the patient's self-disease assessment and self-diagnosis of self-diseases.
It improves the coverage and accuracy of intelligent consultation on thyroid disease, meets the multi-dimensional question-and-answer needs of thyroid disease, and realizes self-disease assessment and self-diagnosis of patients.
Smart Images

Figure CN118352003B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of intelligent thyroid medicine, and specifically relates to a method for implementing multi-dimensional question-and-answering for thyroid diseases. Background Art
[0002] Unlike chronic conditions like hypertension and diabetes, thyroid disease involves multiple departments and involves complex and diverse Q&A content. To improve the coverage and accuracy of patient Q&A, a multi-dimensional Q&A format must be designed.
[0003] Emotions are the key trigger of thyroid disease, so caring questions and answers are introduced; thyroid diseases cover endocrinology, surgery, oncology, imaging, and radiotherapy and chemotherapy, and the forms of questions and answers are complex and diverse. In order to increase the coverage rate of questions and answers, multiple rounds of questions and answers are needed to ensure the accuracy of the diagnosis results. However, the current thyroid intelligent consultation does not include caring questions and answers, and the diagnosis results are not accurate. Therefore, there is an urgent need to implement multi-dimensional question and answer operations in the field of thyroid intelligent diagnosis. Summary of the Invention
[0004] In order to solve the lack of multi-dimensional question-and-answer operations and caring questions and answers in the existing field of intelligent thyroid diagnosis, this application designs a method for implementing multi-dimensional question-and-answer operations for thyroid diseases, in order to realize the design of multi-dimensional question-and-answer formats in the field of intelligent diagnosis of thyroid diseases, thereby improving the coverage and accuracy of intelligent questions and answers.
[0005] A method for implementing multi-dimensional question-answering for thyroid disease, comprising the following steps:
[0006] Step S1: After the patient inputs a question, the first-layer intention recognition model of the multi-dimensional question-answering system determines whether the question is caring or asking for a diagnosis. If the question is caring, the system enters the caring Q&A process; otherwise, the system enters the asking for a diagnosis.
[0007] Step S2: Enter the inquiry intention, establish a multi-round question-answering model based on the semantic slot template, and conduct the second-level question-answering;
[0008] Step S3: When the intent is not summarized in the semantic slot template or the knowledge queried in the graph is empty, the system switches to FAQ retrieval and allows the retrieval robot to provide a backup response as the final step of the intelligent consultation.
[0009] Step S4: Through multiple solidified template question-and-answer interactions, the multidimensional question-and-answer system makes logical judgments based on existing medical rules and deep learning models, enabling patients to self-assess and self-diagnose their diseases.
[0010] Preferably, the FAQ retrieval and answering mainly includes the construction of FAQ knowledge base, question recall, text matching and sorting, and FAQ retrieval model optimization and update;
[0011] Step S31: The recall module uses a two-way recall method combining term recall and semantic vector recall to fully recall similar questions.
[0012] Step S32: retrieve a set of questions in the FAQ knowledge base that are highly relevant to the patient's question through recall, and then use the text matching ranking model to screen out the top k most similar questions and return them to the patient;
[0013] Step S33: Finally, by recording and analyzing the user's click behavior, the FAQ retrieval model is continuously updated and optimized in a targeted manner.
[0014] Preferably, in step S2, the multi-round question-answering model based on the semantic slot template is a module combination method based on intention induction, entity recognition, entity linking, and semantic slot template model design to realize multi-round question-answering based on the knowledge graph.
[0015] Preferably, the design method of the semantic slot template is:
[0016] Step S21: First, natural language understanding is achieved through intent recognition and slot filling, so that the machine can understand the patient's question;
[0017] Step S22: Utilize the intent recognition model to obtain the intent of the question, and utilize the slot filling model to obtain the entities and entity types in the question. Errors, omissions, and mis-entries by the patient are mapped to standardized entities in the knowledge base through online entity linking based on a synonymous entity library and search engine.
[0018] Step S23: Finally, fill the slot value according to the slot type under the intention.
[0019] Preferably, in step S23, if the slot value obtained by the current round of entity recognition is empty, the historical conversation is loaded to obtain the slot value for filling, thereby realizing slot succession based on the historical conversation.
[0020] Preferably, in step S22, if the intent recognition is empty, the intents of the historical conversations closest to the current conversation are loaded in sequence for intent succession.
[0021] Preferably, the design method of the semantic slot template further includes: confirming, negating, and asking clarification questions and answers, and the specific method is:
[0022] For questions with low confidence, we further clarify the patient's questions by asking clarification questions. Based on the patient's affirmative or negative response, we follow up on the previous round of questions to perform slot succession and intention inheritance to achieve question-answering.
[0023] For questions with higher confidence, the response generation strategy is directly adopted;
[0024] Set the intent recognition threshold to 0.8. After softmax normalization by the intent recognition model for each category, the corresponding intent intensity is obtained. If the confidence level meets the threshold we set, greater than or equal to 0.8, then according to the structured semantic parsing slot_info obtained by the natural language understanding model, combined with the query template, query the database, and splice the query content with the reply_template in the semantic slot template to complete the reply generation;
[0025] If the intent confidence level is between 0.4 and 0.8, then for the intent with the highest confidence level, further clarify the patient's question through a rhetorical question. If a positive reply from the patient is obtained, then query the database according to this intent to generate a reply;
[0026] If the intent confidence level is even lower, less than 0.4, then intent inheritance is required. If it still does not meet the set reply threshold after inheritance, then it is processed as an ununderstood question and enters the FAQ retrieval and question-answering module.
[0027] Preferably, in the step S22, in order to enrich different questioning methods for each intent and improve the generalization ability of the model, the Chinese data augmentation tool NLPCDA is also used to perform entity synonym and homophone replacement, and the SimBERT model is used to generate similar sentences;
[0028] In addition, training corpus needs to be generated based on the combination of template keywords, and randomly select one from each template keyword to splice into an intent training corpus.
[0029] Preferably, in the step S22, considering the intent classification task, different proper nouns will affect the accuracy of the classification model. Therefore, after completing the question entity recognition task, replace the specific entities in the sentence with the corresponding entity category expressions, such as using ydis, ysym, ydrug to replace disease, symptom, and drug entities respectively, and use the replaced content as the training data for question intent recognition;
[0030] Add category numbers as classification labels for different intent types, and cut and pad according to the longest field; the slot filling model uses TMCBERT - BiLSTM - CRF, and incorporates adversarial training, hierarchical learning rate, and learning rate decay strategies. The intent recognition model uses TMCBERT - TextCNN to achieve a better classification effect for medical short text questions.
[0031] The advantages and effects of this application are as follows:
[0032] This application designs a method for implementing multi-dimensional Q&A for thyroid diseases, including: S1. After the patient inputs a question, the intention recognition model in the first layer of the multi-dimensional Q&A system determines whether the question is a concern or consultation intention. If the concern intention is hit, enter the concern Q&A; otherwise, enter the consultation intention. S2. Enter the consultation intention, establish a multi-round Q&A model based on the semantic slot template, and conduct the second-layer Q&A. S3. When the intention not summarized in the semantic slot template or the knowledge retrieved from the graph is empty, transfer to the FAQ retrieval Q&A, and let the retrieval robot be the fallback response for the last link of intelligent consultation. S4. Through multiple fixed template Q&A interactions, the multi-dimensional Q&A system conducts logical judgments to achieve the patient's self-disease assessment and self-diagnosis. Through the above design, this application can achieve multi-dimensional Q&A in the field of intelligent consultation for thyroid diseases, thereby improving the coverage rate and accuracy of intelligent Q&A.
[0033] The above description is only an overview of the technical solution of this application. In order to be able to understand the technical means of this application more clearly, so as to be implemented in accordance with the content of the specification, and in order to make the above and other purposes, features and advantages of this application more obvious and understandable, the following takes the preferred embodiments of this application and describes them in detail with the accompanying drawings as follows.
[0034] Based on the following detailed description of the specific embodiments of this application in conjunction with the accompanying drawings, those skilled in the art will more clearly understand the above and other purposes, advantages and features of this application. Brief Description of the Drawings
[0035] In order to more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are some embodiments of this application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts do not necessarily draw according to the actual ratio.
[0036] Figure 1 Multi-dimensional Q&A implementation design diagram designed for this application;
[0037] Figure 2 Question and answer service module - semantic parsing diagram designed for this application;
[0038] Figure 3 Partial concern type corpus diagram designed for this application;
[0039] Figure 4 Question and answer technical flow chart designed based on the semantic slot template for this application;
[0040] Figure 5Code diagram of the slot filling part designed for this application;
[0041] Figure 6 Code diagram of the partial intention semantic slot template design designed for this application;
[0042] Figure 7 Semantic vector recall flow chart designed for this application;
[0043] Figure 8 Disease self-diagnosis timing diagram designed for this application;
[0044] Figure 9 Symptom one-hop node entity vector representation diagram designed for this application;
[0045] Figure 10 Structure diagram of the TMCBERT-TransD-CNN model designed for this application;
[0046] Figure 11 Precision diagram under different convolution sizes and quantities designed for this application;
[0047] Figure 12 Flow chart of electronic medical record similarity calculation designed for this application;
[0048] Figure 13 Architecture diagram of the TMCBABC model designed for this application;
[0049] Figure 14 Architecture diagram of the intention recognition model designed for this application. Detailed implementation manners
[0050] To make the objectives, technical solutions and advantages of the embodiments of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of this application. Apparently, the described embodiments are some but not all of the embodiments of this application. In the following description, specific details such as specific configurations and components are provided only to assist in a comprehensive understanding of the embodiments of this application. Therefore, those skilled in the art should understand that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this application. Additionally, descriptions of known functions and structures are omitted for clarity and conciseness in the embodiments.
[0051] It should be understood that the "one embodiment" or "this embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of this application. Therefore, the "one embodiment" or "this embodiment" that appears throughout the specification does not necessarily refer to the same embodiment. Additionally, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner.
[0052] In addition, this application may repeat reference numerals and / or letters in different instances. This repetition is for the purpose of simplicity and clarity and does not in itself indicate a relationship between the various embodiments and / or configurations discussed.
[0053] The term "and / or" in this document is merely a description of the relationship between associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, B exists alone, and both A and B exist simultaneously. The term " / and" in this document describes another relationship between associated objects, indicating that there can be two relationships. For example, A / and B can represent: A exists alone, and both A and B exist. Additionally, the character " / " in this document generally indicates that the associated objects before and after are in an "or" relationship.
[0054] The term "at least one" in this document is merely a description of the relationship between associated objects, indicating that there can be three relationships. For example, at least one of A and B can represent: A exists alone, both A and B exist simultaneously, and B exists alone.
[0055] It should also be noted that in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprising", "including" or any other variation thereof are intended to cover non-exclusive inclusion.
[0056] Embodiment 1
[0057] A multi-dimensional question-and-answer form will be designed. Emotion is a key inducer of thyroid diseases, so caring questions and answers are introduced; thyroid diseases cover the endocrinology department, surgical department, oncology department, imaging department, radiotherapy and chemotherapy department, and the question-and-answer forms are complex and diverse. To improve the high coverage rate of questions and answers, multi-round questions and answers, FAQ retrieval questions and template questions for interacting with patients are introduced; in addition, to achieve high accuracy and interpretability of the consultation reply, deep learning and thyroid medical artificial templates are combined to achieve natural language semantic understanding. Next, it will be elaborated separately from the multi-dimensional question-and-answer design and the implementation of each module of the multi-dimensional question-and-answer.
[0058] I. Thyroid multi-dimensional question-and-answer and entity linking
[0059] 1. Implementation of multi-dimensional question-and-answer
[0060] Thyroid diseases are not like chronic diseases such as hypertension and diabetes. This disease covers multiple departments, and the Q&A content is complex and diverse. In order to improve the coverage rate and accuracy of patient Q&A, multi-dimensional Q&A is designed, and its Q&A forms include four major modules: care Q&A based on logistic regression, multi-round Q&A designed based on semantic slot templates, retrieval Q&A based on density clustering, and template Q&A based on medical rules and patient interaction. The implementation design of multi-dimensional Q&A is as Figure 1 shown.
[0061] There is a strong correlation between thyroid diseases and emotions. Positive emotional guidance can be achieved through a single-round conversation of care Q&A; medical Q&A is related to the life and health of patients, and the accuracy of model replies is of primary importance. Therefore, multi-round Q&A based on manually designed semantic slot templates and knowledge graphs is adopted. When a certain intention is hit, according to the design of the slot values of that intention and the reply strategy, patients' questions can be accurately answered; the Q&A designed based on semantic slot templates can only solve common consultation intentions. In order to further improve the coverage rate of intelligent Q&A, when the intention not summarized in the semantic slot template or the knowledge queried in the graph is empty, it will be transferred to the FAQ retrieval Q&A, and the retrieval robot will be used as the fallback reply for the last link of intelligent consultation. In addition, in order for the system to have good scalability, the multi-dimensional Q&A design adopts a two-layer intention recognition mode, decoupling the care Q&A and medical consultation modules. In the future, the two modules can be optimized and model-trained separately, and the modules do not affect each other.
[0062] 2. Entity Linking Based on Synonymous Entity Library and Search Engine
[0063] The core link of the design based on semantic slot templates is the semantic understanding of patients' questions, including question intention recognition and slot filling. Through the model's natural language understanding of the user's input question, the user's intention and entity-structured semantic information are returned. Then, according to the query template in the semantic slot template, a Cypher query statement or query instruction is obtained, and the database is retrieved to obtain the query result. Finally, the query result is inserted into the reply template to return the answer to the question that conforms to the Chinese communication habit. Among them, intention recognition is based on the TMCBERT-TextCNN model. Slot filling is based on the TMCBERT-Adv-BiLSTM-CRF model. The semantic parsing process is as Figure 2 shown.
[0064] Semantic parsing process of "What are the symptoms of hyperthyroid crisis in the elderly?" in the above figure: The entity "hyperthyroid crisis in the elderly" is obtained through the slot filling model, and then the canonical entity "thyroid storm in the elderly" in the knowledge base is obtained through entity linking. At the same time, the intent recognition model obtains the intent category as the relationship type "disease - symptom". Considering that users lacking medical expertise may abbreviate, miswrite, or omit when inputting questions, the entity obtained by the slot filling model may be non - canonical. To solve this problem, after identifying the question entity, first retrieve and match based on the synonym entity library. If the match fails, then call the online entity linking module based on the search engine as a supplement to achieve the mapping to the canonical entity.
[0065] By searching for the entity obtained by the entity recognition model in the Baidu search engine and using the crawler tool, the candidate entity set returned by the Web is parsed in real - time.
[0066] Analyze the Web page, define XPath rules, and parse out the top 10 entities to add to the candidate entity set. Since the search engine itself has completed the sorting of candidate entities, the candidate entity set in the top 10 has the highest relevance to the search entity item. De - duplicate the candidate entities and then match the synonym entity library in turn. If the query is successful, return the canonical entity; otherwise, record the user's query statement and query entity item in the system log file, and analyze the log regularly for knowledge supplementation and update.
[0067] II. Care - giving Q&A Based on Logistic Regression
[0068] Emotion is a key influencing factor in thyroid diseases. A word of encouragement or care from a doctor can be of great help to the patient's condition. Through the single - round care - giving Q&A dialogue, doctors can achieve positive emotional guidance for patients.
[0069] The intents of care - giving Q&A are hello, goodbye, emotional_guidance, deny, accept, isrobot. To bring a better user experience and increase the flexibility and diversity of responses, 40 responses are manually sorted for each care - giving intent. When a certain intent is hit, a response in that care - giving intent is randomly returned to achieve different care - giving responses to the same care question from patients. Some care - giving corpus are as Figure 3 shown:
[0070] After the patient enters a question, the first-layer intent recognition model is used to determine whether the question is a care or consultation intent. Considering the obvious characteristic differences between care intent and consultation intent, complex neural network models such as deep-layer TextCNN and LSTM are not required. Therefore, for the first-layer intent recognition, a relatively lightweight and faster-inference-speed logistic regression and GBDT (Gradient Boosting Decision Tree) fusion algorithm is adopted, achieving high classification accuracy and classification efficiency. If the care intent is hit, it enters the care Q&A; otherwise, it enters the consultation intent. For the second-layer detailed consultation intent, the similarity between intents is relatively high and it is not easy to distinguish. Therefore, a classification model based on deep learning is adopted.
[0071] III. Multi-turn Q&A Based on Semantic Slot Templates
[0072] For the multi-turn Q&A designed based on semantic slot templates, the underlying knowledge base is the thyroid knowledge graph. There are two ways of the Q&A route based on the knowledge graph. One is the combination of the intent induction, entity recognition, entity linking, and semantic slot template design modules, and the other is the combination of the entity recognition, entity linking, subgraph recall, and path ranking modules. The former is suitable for scenarios with clear intent classification in a fixed domain. The advantage is that according to the recognized intent, its reply generation will return according to the reply strategy in the semantic slot template design, with high reply accuracy and good user experience. The disadvantage is that all intents and the slots and reply templates under each intent must be designed in advance, and the model cannot complete the reply for uninduced intents. The second combination method does not require defining specific intents. Only need to link to the entities in the knowledge base, perform entity-related subgraph recall, and then use the ranking model to realize the similarity ranking of the path and the question. Its Q&A coverage rate is relatively high, but the disadvantage is that it may answer off-topic and the reply accuracy is relatively low.
[0073] Considering that the thyroid specialty Q&A belongs to a fixed domain and its consultation intent is relatively clear, in order to meet the high precision and interpretability of medical consultations, the module combination method based on intent induction, entity recognition, entity linking, and semantic slot template design is adopted to implement the multi-turn Q&A based on the knowledge graph.
[0074] 1. Semantic Slot Template Design
[0075] The implementation of the Q&A technology based on semantic slot templates mainly involves natural language understanding of the question sentence, dialogue state tracking based on slot and intent inheritance, reply strategy template design, and natural language generation tasks that conform to the daily communication habits. Its Q&A technical process is as Figure 4 shown:
[0076] First, enable the machine to understand the patient's question and achieve natural language understanding through intent recognition and slot filling. Use the intent recognition model to obtain the intent of the question, and at the same time use the slot filling model to obtain the entities and entity types in the question. Map the cases of patients' wrong, missing, or incorrect input to the canonical entities in the knowledge base through online entity linking based on the synonymous entity library and search engine. Finally, fill the slot values according to the slot types under the intent. For example, for the question "What is hyperthyroidism?", the intent of "definition" is obtained. Combining with the slot type list obtained from the semantic slot template slots, only the disease is available. Then use the canonical entity "hyperthyroidism" obtained through entity linking to fill the slot value slot_values corresponding to the disease. The relevant code is as Figure 5 shown:
[0077] Medical Q&A is related to the life and health of patients. Through the design of semantic slot templates, combine the deep learning model with the thyroid medicine artificial template to achieve high precision and interpretability of the consultation reply. The design of semantic slot templates includes intent design, intent slot type design, query statement template design, reply template design, and rhetorical clarification template design. When a certain intent is hit, the answer to the question can be accurately returned through the designed template. The design of some intent semantic slot templates is as Figure 6 shown:
[0078] During the Q&A process for thyroid patients, it is often necessary to interact with doctors in multiple rounds to achieve the purpose of the consultation. In addition, during the Q&A process, for the same disease entity or intent, according to the communication habit, the patient will not repeat the input many times in the question. Therefore, in order to meet the patient's better Q&A experience, introduce dialogue state tracking to achieve multi-round Q&A interaction that conforms to the real Q&A scenario. If the slot value obtained by entity recognition in this round is empty, load the historical dialogue to obtain the slot value for filling and achieve slot inheritance based on the historical dialogue. Similarly, if the intent recognition is empty, load the intent of the historical dialogue closest to the current dialogue in turn for intent inheritance. Achieve dialogue state tracking through slot inheritance and intent inheritance.
[0079] In actual question-and-answer scenarios, in addition to regular questions containing entities and intentions, there are also scenarios of confirmation, negation, and rhetorical question clarification. For questions with low confidence, the system can further clarify the patient's question through rhetorical questions. Based on the patient's affirmative or negative response, slot inheritance and intention inheritance are achieved by tracking the previous question to implement the question-and-answer response. For questions with high confidence, a response generation strategy is directly adopted. If the intention recognition threshold is set to 0.8, the corresponding intention intensity is obtained after softmax normalization of each category by the intention recognition model. If the confidence meets the threshold we set, greater than or equal to 0.8, then according to the structured semantic parsing slot_info obtained by the natural language understanding model, combined with the query template, query the database, and splice the query content into the reply_template in the semantic slot template to complete the response generation. If the intention confidence is between 0.4 and 0.8, then according to the intention with the highest confidence, further clarify the patient's question through a rhetorical question. If a positive response from the patient is obtained, query the database and generate a response according to this intention. If the intention confidence is even lower, less than 0.4, then intention inheritance needs to be performed. If the set response threshold is still not met after inheritance, it is treated as an ununderstood question and enters the FAQ retrieval question-and-answer module.
[0080] 2. Dataset Enhancement Processing
[0081] By analyzing the doctor-patient Q&A of a certain company and the thyroid consultation needs, and combining with the thyroid disease knowledge graph, a total of 18 Q&A intentions were determined. Some Q&A intentions are shown in Table 1. The question sentence dataset was pre-annotated and manually annotated, and the Label-studio annotation tool was also used. The original question sentence data is stored as a txt format file, and the annotation data is stored as a Json format file.
[0082] In order to enrich different questioning methods for each intention and improve the generalization ability of the model, the Chinese data enhancement tool NLPCDA was used to replace entities with near-synonymous and near-homophonic words, and the SimBERT model was used to generate similar sentences. In addition, a training corpus was generated based on the combination of template keywords. A random extraction was made from each template keyword and spliced into an intention training corpus. For example, for the intention of disease symptom manifestation, the question sentence corpus can be spliced as template = "{greet}{disease}{symptom}". Using the above data enhancement methods, more than 40,000 Q&A training corpora were finally generated.
[0083] Table 1 Part of the Q&A Intention Categories
[0084]
[0085]
[0086] The above dataset can be directly used for slot filling tasks. Considering that different proper nouns can affect the accuracy of the classification model in intent classification tasks, after completing the question entity recognition task, the specific entities in the sentence are replaced with corresponding entity category expressions. For example, ydis, ysym, and ydrug are used to replace disease, symptom, and drug entities, respectively. These replacements serve as training data for question intent recognition. Table 2 shows some of the data:
[0087] Table 2 Intent recognition training data examples
[0088] Intention Category Example Question Disease What disease might one have ifysym appears? What disease is ydrug effective for? Symptom What are the symptoms of ydis? What symptoms does ydis have? Medication What are the recommended medications for ydis? Which medications are helpful for treating ydis? Complication What other diseases can ydis cause? What diseases are one likely to get after having ydis
[0089] Different intent types are labeled with category numbers, and the longest field is segmented and padded. The slot filling model uses TMCBERT-BiLSTM-CRF, incorporating adversarial training and layered learning rate and learning rate decay strategies. The intent recognition model uses TMCBERT-TextCNN, achieving good classification results for short medical texts.
[0090] 4. Retrieval Question Answering Based on Two-Way Recall and Text Matching
[0091] Thyroid disease covers multiple departments, and the content of questions and answers is complex and diverse. To improve the coverage of patient questions and answers, when the semantic slot template does not include intent or the knowledge query in the graph is empty, the FAQ search question and answer function is switched to, allowing the search robot to provide a backup response at the end of the intelligent consultation.
[0092] FAQ question-answering primarily involves building an FAQ knowledge base, question recall, text matching and ranking, and model optimization and updates. First, the recall module uses a two-way recall method combining term recall and semantic vector recall to comprehensively recall similar questions. This recall method retrieves a set of questions from the FAQ knowledge base that are highly relevant to the patient's question. A text matching and ranking model is then used to select the top k most similar questions and return them to the patient. Finally, by recording and analyzing user click behavior, the model is continuously updated and optimized in a targeted manner.
[0093] 1 Two-way recall based on term and semantic vector
[0094] First, the Term recall of full-text retrieval is implemented through the distributed full-text retrieval framework es (Elasticsearch). The BM25 text similarity calculation is used to recall similar problems at the entity level. For example, for the question "Can hypothyroid patients eat seafood?", word segmentation is first performed, and relevant questions containing the set of words after word segmentation are found according to the inverted index, obtaining a candidate set of 20 to 30 questions. Here, Term will recall all question sets related to hypothyroidism, including questions that are not relevant to the patient's inquiry intention. Es can only perform text matching at the entity string level and cannot achieve recall at the semantic level. If only es recall is done, many irrelevant questions will be recalled. Therefore, semantic vector recall needs to be combined to compensate for the recall defects of es and improve the recall quality.
[0095] Semantic vector recall uses the open-source tool Faiss of Facebook to implement vector retrieval recall. The vector index is constructed offline and retrieved and recalled in real time online. The flowchart of semantic vector recall is as Figure 7 shown:
[0096] Offline, the text vectorization representation model is used to vectorize the content of the corpus, obtaining a vector matrix containing all the corpus. The Faiss tool is used to construct the database question vector index to achieve fast retrieval and recall. At the same time, online, the same text vectorization representation model is used to vectorize the input question. In this embodiment, the 12-layer SimBERT model is used online and offline to achieve the text vectorization semantic representation of the question. The Euclidean distance and inner product in Faiss are used to calculate the similarity between vectors, obtaining the Topk index ID values with the highest similarity.
[0097] There are various different index types in Faiss, including Flat index, IVFx Flat index, PQx product quantization index, and IVFx PQy inverted product quantization index, which can be selected and used in combination according to different data volumes and specific scenarios. Flat uses brute-force retrieval to calculate the patient's question and all question vectors in the corpus. IVFx Flat uses inverted brute-force retrieval, narrowing the search range through clustering, slightly alleviating the problem of slow retrieval speed of the Flat index, but only being able to retrieve local optimal results; PQx compresses the vectors, saving a large amount of memory, and is suitable for scenarios with a large number of documents, low recall requirements, and tight memory resources. IVFx PQy combines the inverted and product quantization indexes, achieving a balance between retrieval speed and recall rate.
[0098] The recall results of the Flat indexing method are the most accurate and the recall rate is also the highest. However, all problem vectors need to be loaded into memory, which occupies a large amount of memory resources and the recall speed is relatively slow. Considering that the total number of thyroid-related Q&A pairs in Company D is currently within 200,000, and the memory of the deployed machines can bear it, and the accuracy of medical consultations is always the top priority, the Flat indexing construction method is therefore selected. IndexFlatL2 within Flat is used to build the index. After recall, the set of sentence corresponding ids is returned. The index id and qid in Faiss form a mapping relationship. The qid is found through the index id, and then the recalled sentence list qaList is found through the qid. In the later stage, as the Q&A data of Company D continues to accumulate and the number of Q&A pairs reaches 500,000, the IVFx PQy indexing construction method will be adopted.
[0099] 2 Text similarity sorting based on QQ matching
[0100] Through the complementarity of Term and semantic recall, a comprehensive recall of relevant question sets is achieved. Next, a text matching model is used for similarity sorting to find the top k questions most relevant to the patient's question.
[0101] The text matching sorting model SimBERT is used as the initial weight and fine-tuned. The set of questions that meet the set threshold after sorting is returned to the user. Text matching includes QA matching and QQ matching. QA matching is to match the user's question with the answers in the FAQ knowledge base. QQ matching is to match the user's question with the questions in the FAQ knowledge base. Considering that the patient's questions are often more colloquial, while the answers in the FAQ knowledge base are standard and unified written expressions integrated by professional doctors, the difference in expression will affect the effect of the text matching model; if the answers in the knowledge base are multi-modal, QA matching cannot complete the text matching task; in addition, according to the patient's feedback on the reply, such as being too professional to understand, the reply is not comprehensive, etc., the doctor will regularly improve and update the replies in the FAQ library. If QA matching is used for modeling, the model needs to be updated; in the FAQ library, generally new Qs are added without changing the Qs, the probability of Q changing is very small, while the probability of A changing is relatively large. Therefore, this embodiment adopts QQ modeling, fully decoupling the training and learning of the algorithm model from the doctor's answer editing. The mapping between different Q&As and answers is arbitrarily controllable, increasing the flexibility and scalability of the system.
[0102] Considering that the recalled entities may not be consistent with the entities in the question, in the sorting process, an entity recognition model is needed to identify whether the entities in the patient's question and the recalled question set are consistent, and entity-level sorting is achieved by calculating the intersection and union ratio of the entities in the patient's question and the recalled question set. Semantic-level sorting is achieved by calculating the semantic matching similarity at the sentence level through the bert_qqmatch method. Finally, the entity-level weight is determined to be 0.2 and the semantic-level weight is determined to be 0.8 through parameter adjustment. Finally, the weighted sentence is selected for text matching to obtain the sorting result.
[0103] V Template-based Q&A for Interaction with Patients Based on Medical Rules
[0104] The thyroid specialty covers the endocrinology department, surgical department, oncology department, imaging department, radiotherapy and chemotherapy department. There is fixed medical template knowledge in different departments. Through the template-based Q&A fixed for different disease types in different departments, key information of patients can be efficiently collected, helping doctors quickly locate patients' problems. At the same time, through multiple interactions of template-based Q&A, the system makes logical judgments based on existing medical rules and deep learning models, enabling patients to achieve self-disease assessment and self-diagnosis. The template-based Q&A in this embodiment includes quick Q&A functions such as disease self-diagnosis, retrieval of similar electronic medical records, personalized pre-questioning, disease assessment, follow-up plan, and medical calculator.
[0105] 1 Disease Self-Diagnosis Process
[0106] (1) Medical Rules for Disease Diagnosis
[0107] Combined with thyroid diagnosis monographs and literature, several basic diagnosis rules were summarized under the guidance of experts:
[0108] Rule 1: Take the union of the symptoms shown by 95% of the patients with disease Q to obtain the set SymptomSet[Q1, Q2,.., Q n , without considering special cases, we believe that disease Q will only show one or more symptoms in SymptomSet.
[0109] Rule 2: Based on Rule 1, if patient A has disease Q, patient A may show any one or more symptoms in SymptomSet, or may not show any one of its symptoms.
[0110] Rule 3: Based on Rule 1, when a patient B shows symptoms outside SymptomSet, without considering concurrent diseases, it can be considered that patient B does not have disease Q.
[0111] Rule 4: Based on Rule 1, when a patient C shows one symptom in SymptomSet, he may have disease Q.
[0112] (2) Disease diagnosis process
[0113] For pre - diagnosis patients, through a question - and - answer form, first let the patient select the body part with discomfort. According to the selected body part, the system shows the common main symptoms of the corresponding part to the patient. Based on the selected body part and main symptoms of the patient, by retrieving and counting the potential disease sets in the symptom sub - graph of the thyroid knowledge graph, and according to the obtained disease sets, further let the patient select the accompanying symptoms and symptom - related attributes. Based on the medical diagnosis rules in the thyroid field, screen out the six most likely diseases, and then send them into the disease diagnosis model based on deep learning to obtain the final disease diagnosis order. Its sequence diagram is as Figure 8 shown:
[0114] Through multiple interactions with the patient, gradually narrow the corresponding possible disease range according to the symptoms and symptom attributes, and finally obtain a disease diagnosis result with a relatively high probability value. The system will return the disease introduction, typical symptoms, etiology and prevention, clinical manifestations, examination items, diagnostic criteria, nursing and diet advice and other pre - diagnosis knowledge of the disease together. Help patients do a good job in self - management of the disease and find doctors good at treating this disease.
[0115] Since diseases will present different symptoms at different times, and the symptoms shown by some patients may exactly appear in the special cases in the medical diagnosis rule 1 of diseases. In addition, there are various difficult and complicated diseases in medical diagnosis and treatment, all of which require the rich clinical experience of doctors. Therefore, the disease self - diagnosis of this system is for the pre - diagnosis prediction of common and frequently - occurring diseases of the thyroid gland. For the concurrent diseases of the thyroid gland and the difficult and complicated diseases in the thyroid field, examinations and further face - to - face consultations with doctors are required.
[0116] 2 Optimization and experiment of the disease self - diagnosis model
[0117] (1) Model principle and optimization
[0118] Considering the thyroid - specific diseases, the amount of symptom and disease data is limited. And the CNN model has a fast training speed, can achieve the desired training effect with relatively less data, is not prone to over - fitting phenomenon, and currently the CNN model is widely used in disease diagnosis and has achieved good results. The CNN model usually has a single - channel input. In order to improve the disease diagnosis prediction effect and extract more effective features, this embodiment uses a three - channel input to optimize the disease self - diagnosis model. The three channels include the symptom word vector input by the patient, the symptom entity vector in the thyroid - specific disease atlas, and the symptom one - hop node entity vector in the thyroid - specific disease atlas.
[0119] The word - vector representation of symptoms uses the medical pre - training model TMCBERT. The entity vector representation of the knowledge graph uses the translation model TransD to obtain the low - dimensional vector representation of the entity. The entity - vectorization process of the symptom one - hop node in the knowledge graph is as Figure 9As shown below:
[0120] First, according to the disease symptoms input by the patient, a knowledge spectrum sub - graph associated with the input symptoms is extracted through the knowledge graph and medical diagnosis rules. Then, the entity vectors of the knowledge sub - graph and the symptom word vectors obtained using the TransD model are mapped to the same space. Through formula (4 - 4), the entity vectors are mapped to the word vector space while preserving the original semantic relationship. By transformation, entity vectors and word vectors with the same dimension and size are obtained, and then they are sent into the CNN model through vector matrix superposition. M is the transformation matrix, b is the bias, and tanh is a continuous transformation function.
[0121] f(e)=tanh(Me + b) (4 - 4)
[0122] Convolution kernels of different sizes are adopted, and max - pooling is used to retain the maximum features. Finally, it is sent into the softmax classifier to achieve normalization, and the probability value p(y i ) of the i - th disease is obtained according to formula (4 - 5), where s j and b j represent the output parameters and biases, and n represents the total number of predicted disease output types.
[0123]
[0124] (2) Model Structure
[0125] The three - channel input enables the CNN model to learn a more abundant representation of disease symptom features, improving the disease diagnosis effect of the model. The overall structure of the CNN disease diagnosis model integrating the knowledge graph is as Figure 10 shown below:
[0126] (3) Experimental Settings
[0127] The thyroid knowledge graph is selected as the data source, and the electronic medical record diagnosis results of thyroid patients from Company D are used as the evaluation criterion to conduct a comparative experiment on the disease diagnosis model. The parameter settings of the model are shown in Table 3:
[0128] Table 3 Disease Diagnosis Model Parameters
[0129] Parameter Value TMCBERT - Number of Layers 12 TMCBERT - Number of Self - Attention Heads 12 TMCBERT - Word Vector Dimension 768 Entity Vector Dimension 768 Epoch_Size 50 Batch_Size 16 Convolution Kernel Size (h = 2,k = 768)(h = 3,k = 768)(h = 4,k = 768) Number of Convolution Kernels 180 Learning Rate 1e-2 dropout 0.3
[0130] (4) Experimental Results and Analysis
[0131] Since the most concerned aspect in medical disease diagnosis is the prediction accuracy, the accuracy is selected as the experimental evaluation criterion. To verify the influence of hyperparameter settings on the model, the control variable method is used to test the convolution kernel size and the number of convolution kernels, as Figure 11As shown in the figure above, it can be seen that when the convolutional kernel size w is fixed, the model can extract more features as the number of convolutional kernels m increases, thus improving the accuracy of the model. However, when the number of convolutional kernels increases to a certain extent, the model performance will decline instead. Similarly, when the number of convolutional kernels m is fixed, analyze the impact of the types of convolutional sizes w on the model performance. To sum up, when the convolutional kernel size w is 2, 3, 4 and the number of convolutional kernels m is 180, the model obtains the optimal result.
[0132] Taking the classical classification algorithm Support Vector Machine as the baseline, its performance comparison is shown in Table 4:
[0133] Table 4 Performance Comparison of Disease Diagnosis Models
[0134]
[0135]
[0136] It can be found that in the diagnosis of thyroid diseases, deep learning performs better than the traditional machine learning classification algorithm SVM. The accuracy rate is increased by 2.2% compared with the TMCBERT-CNN model and 4% compared with the Word2vec-TransD-CNN. By introducing the knowledge graph entity vector representation, the complexity of the model TMCBERT-TransD-CNN increases and more training time is required. However, the accuracy rate is significantly improved compared with other models, and the accuracy rate is the most crucial indicator for measuring the model performance in the medical field. By using the TransD model entity vector representation of symptom word vectors, knowledge subgraph symptoms and symptom one-hop nodes as the three-channel input of CNN, more semantic effective features are extracted, improving the disease diagnosis and prediction effect.
[0137] 3 Implementation of Other Medical Rule-Based Template Q&A
[0138] Electronic Medical Records (EMR) is the core carrier of doctors' clinical experience. Through retrieving similar medical records, it can provide doctors with clinical decision-making basis, reduce medical errors, and can more accurately push high-frequency disease questions and answers to patients, improve the drug safety coefficient, predict the disease development trend, and take timely disease prevention and response measures. By retrieving similar medical records, expert experience can be brought to grass-roots doctors, promoting the development of the entire thyroid disease medical service system.
[0139] The analysis of thyroid electronic medical records data can be divided into text type and numerical type. The text type data mainly includes patient symptoms, symptom attributes, etc. The numerical type data mainly includes the numerical records of examination results. The idea of finding similar EMRs is to first calculate the similarity of these two types of data respectively, then calculate the weight coefficients of these two types of data according to the analytic hierarchy process, and finally obtain the comprehensive similarity through weighting. The calculation process is as Figure 12 shown:
[0140] When two patients show a certain symptom at the same time, the symptom similarity is marked as 1. The frequency of each symptom appearing in all symptoms is used as a weighting factor to calculate the similarity of the symptom text type data. At the same time, doctors judge the possibility of diseases by analyzing the severity of each examination index and the index value. For indexes with the same grade, the similarity is 1. Doctors score each index, determine the importance weight through the analytic hierarchy process, and calculate the similarity of the numerical type data. Then calculate the weight coefficients of these two types of data according to the analytic hierarchy process, and finally obtain the EMR similarity through weighting. Its calculation process condenses the clinical experience of experts and has high value.
[0141] In addition, medical tool libraries such as personalized pre-inquiry, disease assessment, postoperative medication adjustment, report interpretation, and follow-up plan are realized by logical judgment based on doctors' manual collation and medical rule templates, which are not the focus of this system's research and will not be specifically described here.
[0142] Example 2
[0143] Based on Example 1, this example mainly introduces the optimization and experiment of the slot filling model;
[0144] (1) Model principle and optimization
[0145] First, obtain word embedding vectors with the help of the pre-trained model TMCBERT in the medical field, and then capture the sentence semantic information through the feature extraction layer BiLSTM to obtain hidden state representations. On the basis of BiLSTM, use CRF for sequence joint annotation. The decoding layer CRF obtains the dependency relationship between predicted labels by training the state transition matrix and assigns appropriate labels to the current character. In summary, the slot filling task in this example is implemented using the joint model TMCBERT-BiLSTM-CRF.
[0146] To further improve the model effect, a hierarchical learning rate and learning rate decay optimization strategy are used. Since the word embedding layer is pre-trained using TMCBERT and the parameters have reached a good level, the learning rate cannot be set too large. The parameters of the BiLSTM layer and the fully connected layer are randomly initialized. If the number of learning times is insufficient or the learning rate is too small, the randomly initialized parameters cannot be well optimized during backpropagation. Therefore, a smaller learning rate is set for the pre-trained layer and a larger learning rate is set for the subsequent layer during training.
[0147] In addition, to improve the robustness of the model and the entity recognition ability, adversarial training is introduced. To ensure that the semantic change caused by small perturbations is not significant, the perturbations in natural language processing tasks are generally added to the Embedding layer rather than directly to the original samples. In this embodiment, small perturbations are added to the Token Embeddings layer, and by introducing noise, as a way of regularization, the overfitting of the model is reduced. The loss function for introducing adversarial perturbations is shown in the Min—MAX formula (4-1):
[0148]
[0149] The calculation of the small perturbation value uses the FGM (Fast Gradient Method) calculation method, as shown in formula (4-2), r adv represents the adversarial perturbation for each character, and ε represents the strength of the adversarial perturbation.
[0150] r adv = ε·g bert / ||g bert ||2 (4-2)
[0151] (2) Model structure
[0152] The model obtained by integrating adversarial training into the word embedding layer of the slot filling model TMCBERT-BiLSTM-CRF is denoted as TMCBERT-Adv-BiLSTM-CRF, abbreviated as TMCBABC. By leveraging the powerful feature extraction ability of the Transformer in TMCBERT, word embedding representations are obtained and fed into the BiLSTM layer to obtain the bidirectional semantic representation of the sentence sequence. Finally, through the conditional random field CRF layer, the CRF selects the label sequence with the highest prediction score as the best answer through the transition matrix. The structure of the TMCBABC model is as Figure 13 shown:[[]]
[0153] (3) Experimental settings
[0154] The same cloud host is also used, and its hardware environment is the same as that of the DKCPA model. According to the statistics of the length of the questions, the maximum sequence length of the text is set to 54. A single-layer BiLSTM is used, and the CRF decoding layer uses the Viterbi algorithm to find the optimal path to achieve the output of the predicted labels. In the experiment, after fine-tuning the parameters, the BiLSTM layer is set to 500 times the initial learning rate, and the fully connected Dense layer is set to 300 times the initial learning rate. The parameter settings of the slot filling model are shown in Table 5:[[]]
[0155] Table 5 Parameter settings of the slot filling model
[0156] Parameter Value TMCBERT - Number of Layers 12 TMCBERT - Number of Self - Attention Heads 12 TMCBERT - Word Vector Dimension 768 Epoch_Size 100 Longest Sequence Length 54 Batch_Size 16 lstm_units 128 dropout 0.1 TMCBERT Learning Rate 5e-5 BiLSTM Layer Learning Rate 300×(5e-5) Fully Connected Layer Learning Rate 500×(5e-5) Optimizer Adam
[0157] (4) Experimental Results and Analysis
[0158] According to the principle of controlling variables, ensure the consistency of the experimental software and hardware environment. To test the effectiveness of the model, the classical sequence labeling BERT - BiLSTM - CRF (BBC) model is used as the baseline, and is compared with the proposed TMCBABC, TMCBABC joint hierarchical learning rate, abbreviated as TMCBABChlr, in terms of performance. By comparing the TMCBABC and TMCBBC models, analyze the value of incorporating adversarial training. By comparing the TMCBABC and TMCBABChlr models, analyze the effect of the hierarchical learning rate on the model. The actual effects of the four models are compared as shown in Table 6 below:
[0159] Table 6 Performance Comparison of Slot Filling Models
[0160]
[0161]
[0162] Based on the experimental results analysis of the model comparison in the above table: (1) The comparison of the experimental results between the BBC and TMCBBC models shows that the pre - trained model TMCBERT in the biomedical field performs better than BERT in Chinese medical natural language processing tasks. (2) By comparing the experimental results of the TMCBBC and TMCBABC models, it is found that after adding tiny adversarial perturbations, the precision rate decreases from 79.2% to 77.3%, but the recall rate and F1 - value of the model are both improved. The recall rate is increased by 5.8%, and the F1 - value is increased by 1.6%. This shows that adding tiny perturbations radv in the Token Embeddings layer and implementing the representation learning of adversarial perturbations radv can improve the robustness and scalability of the model. (3) Compared with the TMCBABC model, the F1 - value of the TMCBABChlr model is increased by 3.9%, which proves the effectiveness of setting the hierarchical learning rate in improving the model performance. A smaller learning rate is set for the word embedding layer of TMCBERT, and by fine - tuning, the original parameters of TMCBERT are maintained at a good level, preventing the deformation of the pre - trained model parameters. While a larger learning rate is set for the BiLSTM and fully - connected layers, and by increasing the learning speed of the model, the synchronization with the training of TMCBERT is maintained, thus improving the performance of the model.
[0163] Example 3
[0164] Based on Example 1, this example mainly introduces the design and experiment of the intent recognition model
[0165] (1) Model Principle and Design
[0166] Models based on the convolutional neural network (CNN) have shown outstanding performance in tasks such as entity extraction, disease prediction, multi-label classification of medical cases, and classification of consultation intentions in the medical field. TextCNN is proposed based on CNN. By analyzing a large amount of doctor-patient Q&A data, it is found that the length of the dialogue sentence sequence generally does not exceed 50 words, indicating that the input of the intention recognition model in this embodiment is short text, and TextCNN has obvious advantages in processing short text classification. In addition, the TextCNN model has fewer training parameters, belongs to a lightweight model, can converge quickly, and greatly facilitates the engineering practice of the thyroid Q&A system. Combining the advantages of the pre-trained model TMCBERT in word vector representation and the advantage of classifying implicit sentence intentions, and the advantage of TextCNN in short text intention classification, this embodiment proposes a combined TMCBERT-TextCNN model to achieve intention classification of patient questions.
[0167] To obtain different semantic feature expressions, multiple convolutional kernels of different sizes are used, and through the max-pooling layer and the fully connected layer, the final output y is obtained, as shown in formula (4-3):
[0168] y = softmax(w d ·(z * r) + b d ) (4-3)
[0169] To prevent the model from overfitting, z will be randomly discarded with a certain probability. This embodiment uses a mask vector to implement dropout. In the above formula, r ∈ R m is the mask vector. The probabilities of the elements of the mask vector being 1 and 0 are p and 1 - p respectively. The symbol * represents element-wise multiplication, and the z elements corresponding to the 0 positions will be discarded.
[0170] (2) Model structure
[0171] In terms of word vector representation, the pre-trained model TMCBERT is used. After obtaining the vectorized representation of the input question sentence, it is sent into the TextCNN model to obtain the final intention classification. The structure designed by the model is as Figure 14 shown:
[0172] (3) Experimental settings
[0173] The parameters of the TMCBERT word embedding layer are the same as those of the slot filling model. Considering that the meaning of words is often related to the characteristics formed by neighboring words, and there are too many convolutional layers, which are prone to gradient explosion and gradient disappearance. Therefore, the intention recognition model in this embodiment uses one layer of convolution. After parameter tuning, the final model parameter settings are shown in Table (4-5):
[0174] Table 4-5 Intention recognition model parameters
[0175] )Parameter Value TMCBERT - Number of Layers 12 TMCBERT - Number of Self - Attention Heads 12 TMCBERT - Word Vector Dimension 768 Epoch_Size 30 Longest Sequence Length 54 Batch_Size 16 Number of TextCNN Convolution Layers 1 TextCNN Convolution Kernel Size (h = 2,k = 768)(h = 3,k = 768)(h = 4,k = 768) Total Number of TextCNN Convolution Kernels 768 dropout 0.2 Learning Rate 5e-5 Optimizer Adam
[0176] (4) Experimental Results and Analysis
[0177] To verify the effectiveness of the TMCBERT-TextCNN model for intent classification, it was compared with TMCBERT and the traditional TextCNN classification model. The evaluation results are shown in Table (4-6):
[0178] Table 4-6 Comparison of the Performance of Intent Recognition Models
[0179] Model P(%) R(%) F1(%) TMCBERT 89.5 88.4 88.9 TextCNN 82.8 83.4 83.4 TMCBERT - TextCNN 88.2 92.2 90.1
[0180] Based on the analysis of the experimental results of the model comparison in the above table: (1) TextCNN is the one with relatively poor performance among the three models. The F1 value is 5.5% lower than that of the TMCBERT model and 6.7% lower than that of the TMCBERT-TextCNN model. The introduction of the bidirectional attention mechanism of the pre-trained model TMCBERT fully obtains the influence weights of each word on the context words, so the classification effect is better than that of the traditional short text classification model TextCNN. (2) The F1 value of using the TMCBERT-TextCNN model for classification is 1.2% higher than that of using the CLS output classification of TMCBERT. It can be analyzed that TMCBERT can often achieve better classification for some sentences with implicit expressions; the short text classification model TextCNN has better ability to extract local features and is more sensitive to keywords; integrating the ideas of TMCBERT and TextCNN effectively improves the performance of the intent recognition model and can better explore the semantic information of short texts.
[0181] The above are only the preferred embodiments of the present invention, and it does not limit the protection scope of the present invention accordingly. For those skilled in the art, various changes and modifications can be made to the present invention. Any changes, modifications, substitutions, integrations, and parameter changes made to these embodiments through conventional substitutions or capable of achieving the same functions without departing from the principles and spirits of the present invention fall within the protection scope of the present invention.
Claims
1. A method for implementing multi-dimensional question-answering for thyroid disease, characterized in that: The following steps are involved: Step S1: After the patient inputs a question, the first-layer intention recognition model of the multi-dimensional question-answering system determines whether the question is caring or asking for a diagnosis. If the question is caring, the system enters the caring Q&A process; otherwise, the system enters the asking for a diagnosis. Step S2: Enter the inquiry intention, establish a multi-round question-answering model based on the semantic slot template, and conduct the second-level question-answering; Step S3: When the intent is not summarized in the semantic slot template or the knowledge found in the graph is empty, the system switches to FAQ retrieval and allows the retrieval robot to provide a fallback response as the final step of the intelligent consultation. Step S4: Through multiple solidified template question-answering interactions, the multi-dimensional question-answering system makes logical judgments based on existing medical rules and deep learning models, enabling patients to self-assess and self-diagnose their diseases; The design method of semantic slot template is: Step S21: First, natural language understanding is achieved through intent recognition and slot filling, so that the machine can understand the patient's question; Step S22: Utilize the intent recognition model to obtain the intent of the question, and utilize the slot filling model to obtain the entities and entity types in the question. Errors, omissions, and mis-entries by the patient are mapped to standardized entities in the knowledge base through online entity linking based on a synonymous entity library and search engine. By searching for entities obtained by the entity recognition model in the Baidu search engine, the candidate entity set returned by the web is parsed in real time using crawler tools; Analyze the web page, define XPath rules, parse the top 10 entities, and add them to the candidate entity set. Since the search engine has already sorted the candidate entities, the candidate entity set in the top 10 has the highest relevance to the search entity term. De-duplicate candidate entities and match them against the synonymous entity database. If the query is successful, the canonical entity is returned. Otherwise, the user's query statement and query entity items are recorded in the system log file. The log is analyzed regularly to supplement and update knowledge. Step S23: Finally, fill the slot value according to the slot type under the intention; Different intent types are labeled with category numbers, and the longest field is cut and padded. The slot filling model uses TMCBERT-BiLSTM-CRF, incorporating adversarial training and layered learning rate and learning rate decay strategies. The intent recognition model uses TMCBERT-TextCNN. The FAQ retrieval question answering mainly includes the construction of FAQ knowledge base, question recall, text matching ranking and FAQ retrieval model optimization and update; Step S31: The recall module uses a two-way recall method combining term recall and semantic vector recall to fully recall similar questions. Semantic vector recall uses Facebook's open-source tool Faiss to implement vector retrieval and recall, building a vector index offline and performing real-time retrieval and recall online. Offline, a text vectorization representation model is used to vectorize the corpus content, generating a vector matrix containing all the corpus. Faiss is then used to construct a database question vector index for fast retrieval and recall. Simultaneously, the same text vectorization representation model is used online to vectorize the input question. The 12-layer SimBERT model is used both online and offline to implement text vectorization semantic representation of the question. Euclidean distance and inner product in Faiss are used to calculate the similarity between vectors, obtaining the top k index ID values with the highest similarity. Step S32: retrieve a set of questions in the FAQ knowledge base that are highly relevant to the patient's question through recall, and then use the text matching ranking model to screen out the top k most similar questions and return them to the patient; Step S33: Finally, by recording and analyzing the user's click behavior, the FAQ retrieval model is continuously updated and optimized in a targeted manner; A three-channel input is used to optimize the disease self-diagnosis model; the three channels include the symptom word vector input by the patient, the symptom entity vector in the disease-specific thyroid atlas, and the symptom one-hop node entity vector in the disease-specific thyroid atlas. The word vector representation of symptoms uses the medical pre-trained model TMCBERT; the knowledge graph entity vector representation uses the translation model TransD to obtain a low-dimensional vector representation of the entity.
2. The method for implementing multi-dimensional question-answering of thyroid disease according to claim 1, characterized in that: The design method of the semantic slot template also includes: confirmation, negation, and rhetorical question clarification scenarios, and the specific method is: For questions with low confidence, we further clarify the patient's questions by asking clarification questions. Based on the patient's affirmative or negative response, we follow up on the previous round of questions to perform slot succession and intention inheritance to achieve question-answering. For questions with higher confidence, the response generation strategy is directly adopted; The intent recognition threshold is set to 0.
8. Each category is normalized by the softmax of the intent recognition model to obtain the corresponding intent strength. If the confidence level meets the set threshold and is greater than or equal to 0.8, the structured semantic parsing slot_info obtained by the natural language understanding model is combined with the query template to query the database. The query content is obtained and the reply template in the semantic slot template is spliced to complete the reply generation. If the intention confidence is between 0.4 and 0.8, then the intention with the highest confidence is used to further clarify the patient's question by asking a counter-question. If the patient responds affirmatively, the database is queried based on this intention to generate a response. If the intent confidence is lower, less than 0.4, then intent continuation is required. If it still does not meet the set response threshold after continuation, it will be treated as an ununderstood question and enter the FAQ retrieval question and answer module.
Citation Information
Patent Citations
Information retrieval method based on question and answer library, question and answer system and computing equipment
CN115292459A
Medical question-answering system and method based on pain perception and active interaction
CN115714030A
Medical question-answering system based on improved named entity recognition and construction method thereof
CN116719913A
Doctor reply system based on dialogue assistant
CN117373699A