Method and device for medical guidance, electronic device, and storage medium

By combining pre-trained models and medical knowledge graphs, we can obtain the contextual information and medical knowledge of user consultation texts, achieve more accurate medical guidance, and solve the problem of insufficient accuracy in traditional methods.

CN115700581BActive Publication Date: 2025-09-09CHONGQING UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211102379.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-09
Publication Date
2025-09-09
Estimated Expiration
2042-09-09

AI Technical Summary

Technical Problem

The existing medical guidance system has low accuracy and is unable to meet user needs because traditional text embedding vectors make it difficult to obtain contextual information in the user's main complaint text.

Method used

A method combining pre-training model and medical knowledge graph is adopted to obtain the first feature embedding vector of user consultation text and the second feature embedding vector of medical knowledge entity, perform knowledge fusion, generate the third feature embedding vector, and determine the guidance department.

Benefits of technology

The accuracy of medical guidance is improved, and the guidance department corresponding to the user's consultation text can be determined more accurately, solving the problem of insufficient accuracy in traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115700581B_ABST
    Figure CN115700581B_ABST
Patent Text Reader

Abstract

The present application relates to the field of deep learning technology, and discloses a method for conducting medical guidance, the method comprising: obtaining a user consultation text, and using a preset pre-trained model to obtain a first feature embedding vector corresponding to the user consultation text. Using a preset medical knowledge graph to obtain the medical knowledge entity corresponding to the user consultation text, and obtaining a second feature embedding vector corresponding to the medical knowledge entity. Using the first feature embedding vector and the second feature embedding vector to perform knowledge fusion, a third feature embedding vector is obtained. The guidance department corresponding to the user consultation text is determined based on the first feature embedding vector and the third feature embedding vector. In this way, by using the first feature embedding vector that fuses contextual information and the third feature embedding vector that fuses knowledge in the medical knowledge graph, a more accurate guidance department can be determined. The accuracy of medical guidance is improved. The present application also discloses a device for conducting medical guidance, an electronic device, and a storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of deep learning technology, for example, to a method and device, electronic device, and storage medium for medical guidance. Background Art

[0002] Currently, due to a weak triage system, outpatients often visit large hospitals without a referral from a health professional. Unaware of which medical department to register with, they are forced to wait in long lines to consult reception staff or rely on the hospital's medical guidance system to find a referral.

[0003] During the implementation of the embodiments of the present disclosure, it was found that at least the following problems exist in the related art:

[0004] In related technologies, when guiding users through medical guidance systems, since traditional text embedding vectors are linear, it is difficult to obtain contextual information in the user's main complaint text, resulting in low accuracy and poor medical guidance effects, making it difficult to meet user needs. Summary of the Invention

[0005] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical elements or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.

[0006] The embodiments of the present disclosure provide a method and apparatus, an electronic device, and a storage medium for performing medical guidance, so as to improve the accuracy of medical guidance.

[0007] In some embodiments, the method for conducting medical guidance includes: obtaining a user consultation text, and using a preset pre-trained model to obtain a first feature embedding vector corresponding to the user consultation text, wherein the pre-trained model is used to obtain a feature embedding vector that integrates context information. Using a preset medical knowledge graph to obtain the medical knowledge entity corresponding to the user consultation text, the medical knowledge graph stores multiple medical knowledge entities and entity relationships between each medical knowledge entity. Obtaining a second feature embedding vector corresponding to the medical knowledge entity. Using the first feature embedding vector and the second feature embedding vector to perform knowledge fusion, a third feature embedding vector is obtained. Determine the guidance department corresponding to the user consultation text based on the first feature embedding vector and the third feature embedding vector.

[0008] In some embodiments, obtaining a first feature embedding vector corresponding to the user consultation text using a preset pre-trained model includes: inputting the user consultation text into the pre-trained model to obtain a first candidate feature embedding vector corresponding to the user consultation text; and performing dimensionality reduction processing on the first candidate feature embedding vector using a preset convolutional neural network to obtain the first feature embedding vector corresponding to the user consultation text.

[0009] In some embodiments, obtaining the medical knowledge entities corresponding to the user consultation text using a preset medical knowledge graph includes: performing entity recognition on the user consultation text to obtain a candidate entity set, wherein the candidate entity set includes a plurality of first candidate entities. Searching the medical knowledge graph for second candidate entities that have an entity relationship with each of the first candidate entities. Determining each of the first candidate entities and each of the second candidate entities as the medical knowledge entity corresponding to the user consultation text.

[0010] In some embodiments, obtaining a second feature embedding vector corresponding to the medical knowledge entity includes: inputting the medical knowledge entity into a preset graph neural network model to obtain a second feature embedding vector corresponding to the medical knowledge entity.

[0011] In some embodiments, performing knowledge fusion using the first feature embedding vector and the second feature embedding vector to obtain a third feature embedding vector includes: obtaining the importance of the medical knowledge entity based on the first feature embedding vector and the second feature embedding vector; and performing calculation using the importance and the second feature embedding vector according to a first preset algorithm to obtain the third feature embedding vector.

[0012] In some embodiments, obtaining the importance corresponding to the medical knowledge entity based on the first feature embedding vector and the second feature embedding vector includes: performing calculations using the first feature embedding vector and the second feature embedding vector according to a second preset algorithm to obtain a second candidate feature embedding vector corresponding to the medical knowledge entity; and performing calculations using the second candidate feature embedding vector according to a third preset algorithm to obtain the importance corresponding to the medical knowledge entity.

[0013] In some embodiments, determining the guidance department corresponding to the user consultation text based on the first feature embedding vector and the third feature embedding vector includes: concatenating the first feature embedding vector and the third feature embedding vector to obtain a target vector. Calculating the target vector according to a fourth preset algorithm to obtain a probability distribution of the guidance departments. Determining the guidance department with the highest probability in the probability distribution as the guidance department corresponding to the user consultation text.

[0014] In some embodiments, the apparatus for performing medical guidance includes: a processor and a memory storing program instructions, and the processor is configured to execute the above-mentioned method for performing medical guidance when executing the program instructions.

[0015] In some embodiments, the electronic device includes the above-mentioned device for medical guidance.

[0016] In some embodiments, the storage medium stores program instructions, and when the program instructions are run, the above-mentioned method for medical guidance is executed.

[0017] The method and apparatus, electronic device, and storage medium for medical guidance provided by the embodiments of the present disclosure can achieve the following technical effects: By utilizing a first feature embedding vector that incorporates contextual information and a third feature embedding vector that incorporates knowledge from a medical knowledge graph, contextual information from the user's consultation text can be obtained while simultaneously incorporating knowledge from the medical knowledge graph. Based on the first and third feature embedding vectors, a more accurate department for medical guidance can be determined, thereby improving the accuracy of medical guidance.

[0018] The above general description and the following description are exemplary and explanatory only and are not intended to limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] One or more embodiments are exemplarily described by corresponding drawings. These exemplary descriptions and drawings do not limit the embodiments. Elements with the same reference numerals in the drawings are shown as similar elements. The drawings do not constitute a scale limitation. In addition,

[0020] Figure 1 is a schematic diagram of a method for medical guidance provided by an embodiment of the present disclosure;

[0021] Figure 2 is a schematic diagram of entity type statistics of a medical knowledge entity provided by an embodiment of the present disclosure;

[0022] Figure 3 is a schematic diagram of entity relationship statistics of a medical knowledge entity provided by an embodiment of the present disclosure;

[0023] Figure 4 This is a schematic structural diagram of a medical guidance model for medical guidance provided by an embodiment of the present disclosure;

[0024] Figure 5 is a schematic diagram of another method for medical guidance provided by an embodiment of the present disclosure;

[0025] Figure 6This is a schematic diagram of a device for medical guidance provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0026] In order to be able to understand the features and technical content of the embodiments of the present disclosure in more detail, the implementation of the embodiments of the present disclosure is described in detail below in conjunction with the accompanying drawings. The accompanying drawings are for reference only and are not used to limit the embodiments of the present disclosure. In the following technical description, for the sake of convenience of explanation, a full understanding of the disclosed embodiments is provided through multiple details. However, one or more embodiments can still be implemented without these details. In other cases, to simplify the drawings, well-known structures and devices can be simplified for display.

[0027] In the description and claims of the embodiments of the present disclosure, as well as in the accompanying drawings, the terms "first," "second," and the like are used to distinguish similar items and are not necessarily used to describe a particular order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate to describe the embodiments of the present disclosure herein. In addition, the terms "including," "having," and any variations thereof are intended to cover non-exclusive inclusions.

[0028] Unless otherwise stated, the term "plurality" means two or more.

[0029] In the embodiment of the present disclosure, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B means: A or B.

[0030] The term "and / or" describes an association between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or A and B.

[0031] The term "correspondence" may refer to an association relationship or a binding relationship. The correspondence between A and B means that there is an association relationship or a binding relationship between A and B.

[0032] Combine Figure 1 As shown, an embodiment of the present disclosure provides a method for performing medical guidance, the method comprising:

[0033] Step S101: The electronic device obtains a user consultation text.

[0034] In step S102, the electronic device obtains a first feature embedding vector corresponding to the user consultation text using a preset pre-training model; the pre-training model is used to obtain a feature embedding vector that integrates context information.

[0035] In step S103, the electronic device uses a preset medical knowledge graph to obtain the medical knowledge entity corresponding to the user consultation text; the medical knowledge graph stores multiple medical knowledge entities and entity relationships between the medical knowledge entities.

[0036] In step S104, the electronic device obtains a second feature embedding vector corresponding to the medical knowledge entity.

[0037] In step S105, the electronic device performs knowledge fusion using the first feature embedding vector and the second feature embedding vector to obtain a third feature embedding vector.

[0038] In step S106, the electronic device determines the consultation department corresponding to the user consultation text based on the first feature embedding vector and the third feature embedding vector.

[0039] The method for medical guidance provided by the embodiments of the present disclosure utilizes a first feature embedding vector that incorporates contextual information and a third feature embedding vector that incorporates knowledge from the medical knowledge graph. This allows for the acquisition of contextual information from the user's consultation text while also integrating knowledge from the medical knowledge graph. Based on the first and third feature embedding vectors, a more accurate department for medical guidance can be determined, improving the accuracy of medical guidance.

[0040] Furthermore, the electronic device uses a preset pre-training model to obtain a first feature embedding vector corresponding to the user consultation text, including: the electronic device inputs the user consultation text into the pre-training model to obtain a first candidate feature embedding vector corresponding to the user consultation text. The first candidate feature embedding vector is subjected to dimensionality reduction processing using a preset convolutional neural network to obtain a first feature embedding vector corresponding to the user consultation text. Among them, the preset pre-training model is a BERT (Bidirectional Encoder Representation from Transformers, a bidirectional encoder representation based on Transformers) pre-training model. The preset convolutional neural network is a text convolutional neural network TextCNN Network. Since the BERT pre-training model uses a deep bidirectional Transformers component, the user consultation text is input into the BERT pre-training model, and the vector corresponding to the user consultation text is mapped to a high-dimensional space to obtain a first candidate feature embedding vector. Then, the first candidate feature embedding vector is subjected to dimensionality reduction processing using a preset convolutional neural network, so as to generate a deep bidirectional language representation that integrates contextual information, that is, a first feature embedding vector.

[0041] In some embodiments, BERT is trained using a masked language model. BERT is then fine-tuned to obtain a BERT pre-trained model. To enable the BERT pre-trained model to be flexibly applied to various downstream tasks related to text analysis in natural language processing, individual sentences in a document are concatenated into a fixed-length, continuous text stream using special characters. This begins with [CLS] as a classification marker and separates sentences with the symbol [SEP]. Finally, the word segmentation tokens in the input are randomly masked according to a certain ratio as input to the Transformer encoder.

[0042] Furthermore, the electronic device inputs the user consultation text into the pre-trained model to obtain a first candidate feature embedding vector corresponding to the user consultation text, including: the electronic device uses the pre-trained model to obtain a text length of the user consultation text, compares the text length of the user consultation text with a preset text length, and obtains a comparison result. The first candidate feature embedding vector is obtained based on the comparison result.

[0043] Furthermore, the electronic device obtains a first candidate feature embedding vector based on the comparison result, including: if the comparison result shows that the text length of the user consultation text is greater than a preset text length, the electronic device deletes the portion of the user consultation text that exceeds the preset text length to obtain a target text. Obtaining a feature embedding vector for the target text, and determining the feature embedding vector of the target text as the first candidate feature embedding vector. The preset text length is 100.

[0044] In some embodiments, the user consultation text has 110 characters, and the text length of the user consultation text is 110. Since the text length of the user consultation text is greater than 100, 10 characters are deleted from the end of the user consultation text to make the text length of the user consultation text the same as the preset text length.

[0045] Furthermore, the electronic device obtains a first candidate feature embedding vector based on the comparison result, including: if the comparison result shows that the text length of the user consultation text is equal to a preset text length, the electronic device determines the user consultation text as the target text. Obtain a feature embedding vector for the target text, and determine the feature embedding vector of the target text as the first candidate feature embedding vector. The preset text length is 100.

[0046] Furthermore, the electronic device obtains a first candidate feature embedding vector based on the comparison result, including: if the comparison result shows that the text length of the user consultation text is less than a preset text length, the electronic device pads the portion of the user consultation text that is less than the preset text length with zeros to obtain a target text. Obtaining a feature embedding vector for the target text, and determining the feature embedding vector of the target text as the first candidate feature embedding vector. The preset text length is 100.

[0047] In some embodiments, the user consultation text has 80 characters, and the text length of the user consultation text is 80. Since the text length of the user consultation text is less than 100, zeros are padded from the end of the user consultation text to make the text length of the user consultation text the same as the preset text length.

[0048] Furthermore, the electronic device uses a preset medical knowledge graph to obtain the medical knowledge entities corresponding to the user consultation text, including: the electronic device performs entity recognition on the user consultation text to obtain a set of alternative entities, and the set of alternative entities includes several first alternative entities. Second alternative entities that have an entity relationship with each first alternative entity are found from the medical knowledge graph. Each first alternative entity and each second alternative entity is determined as the medical knowledge entity corresponding to the user consultation text. In this way, by obtaining the medical knowledge entities corresponding to the user consultation text in the medical knowledge graph, the problem of insufficient information in the user consultation text can be improved. Thereby, the accuracy of medical guidance is improved.

[0049] In some embodiments, the user inquiry text is "What medicine should I take for high blood lipids?" Entity recognition is performed on the user inquiry text to obtain a set of candidate entities, where the first candidate entity in the set includes "blood lipids." A second candidate entity, "dyslipidemia," is found in the medical knowledge graph to have an entity relationship with the first candidate entity "blood lipids," and the entity relationship is "disease symptoms."

[0050] Optionally, the preset medical knowledge graph is obtained by crawling data from a preset medical information website to obtain unstructured web page data, and storing the unstructured web page data in a preset database. Named entity recognition is performed on the unstructured web page data to obtain medical knowledge entities. The medical knowledge entities are categorized according to preset categories and structured and stored in a preset data format. The medical knowledge graph is constructed using data in a preset data format and preset entity relationships using a preset graph database. The preset database is a MongoDB database, the preset data format is a JSON data format, and the preset graph database is a Neo4j graph database. The preset categories include: disease name, symptoms and signs, treatment department, examinations and tests, and medications. The preset entity relationships include: clinic to which the disease belongs, disease symptoms, required examinations, clinic-corresponding department, disease complications, and treatment medications. In this way, by constructing a medical knowledge graph, the results corresponding to the query statement can be visually displayed when the user performs a medical query.

[0051] In some embodiments, a Python web crawler is used to crawl data from a preset medical information website, such as the "Search for Doctors" website (http: / / www.xywy.com / ), to obtain unstructured web page data, and the unstructured web page data is stored in a MongoDB database. The unstructured web page data is subjected to named entity recognition using a bidirectional long short-term memory-conditional random field (Bi-LSTM-CRF) algorithm to obtain medical knowledge entities. The medical knowledge entities are classified according to preset categories and stored in a structured manner in a Json data format. The data in the Json data format and the preset entity relationships are used to construct a medical knowledge graph through a Neo4j graph database.

[0052] In some embodiments, a browser supported by the Neo4j graph database can be used to preview medical knowledge entities and entity relationships and execute preset query statements. By executing preset query statements, the medical knowledge graph can be added, deleted, modified, and searched. For example, by executing the query statement: MATCH(n:Disease) WHERE n.name = "Cold" RETURN n, the medical knowledge entity with the disease name "Cold" can be searched for, and all medical knowledge entities and entity relationships that have an entity relationship with "Cold" can be displayed.

[0053] Combine Figure 2 and Figure 3 As shown, Figure 2 This is a schematic diagram of entity type statistics of a medical knowledge entity provided by an embodiment of the present disclosure. Figure 3 It is a schematic diagram of entity relationship statistics of a medical knowledge entity provided by an embodiment of the present disclosure. Figure 2Entity types include disease names, symptoms and signs, departments, examinations and tests, and drugs. There are 8,807 disease name entities, such as cerebral atrophy, acute nephritic syndrome, and pediatric dyslexia. There are 5,998 symptoms and signs entities, such as localized headache, fever, and alveolar hemorrhage. There are 54 departments, such as general surgery, oncology, gynecology, and ENT. There are 3,353 examination and test entities, such as viscosity, joint examination, and hemoglobin concentration. There are 3,828 drugs entities, such as Huoxiang Zhengqi Capsules, Riluzole Tablets, and Fluconazole Granules. The total number of all medical knowledge entity types is 22,040.

[0054] Figure 3 In the data structure, entity relationship types include the disease-associated clinic (Disease_Department), disease symptoms (Disease_Symptom), disease complications (Complication), required examinations (Required_Check), the clinic's corresponding department (Department), and treatment drugs (Treat_Drug). Among them, there are 8,807 entities for the disease-associated clinic (Disease_Department), for example, "Adult Respiratory Distress Syndrome, Respiratory Department." There are 12,052 entities for the disease symptoms (Disease_Symptom), for example, "Emphysema, Respiratory Failure." There are 54,710 entities for the disease complications (Complication), for example, "Whooping Cough, Chest Tightness." There are 39,531 entities for the required examinations (Required_Check), for example, "Lung Metastasis, CT (Computed Tomography)." There are 7,976 entities for the clinic's corresponding department (Department), for example, "Gastroenterology, Internal Medicine." There are 14,656 entities in the treatment drug "Treat_Drug", for example: <pertussis, andrographolide tablets>. There are 137,732 types of entity relationships in total.

[0055] In some embodiments, the first candidate entity in the candidate entity set includes: coronary heart disease. The second candidate entity that has an entity relationship with coronary heart disease found from the medical knowledge graph includes: Huixinkang Tablets, Suxiao Jiuxin Pills, Yi'anning Pills, Yixintong Tablets, Tongmai Granules, Tongyitang, resting imaging, dynamic electrocardiogram, enzyme test, exercise imaging, electrocardiogram, sudden death, rheumatic fever, menopausal syndrome, mitral valve regurgitation, arrhythmia, dyspnea, palpitations, heart palpitations, heart failure, chronic atrial fibrillation, tachycardia, fatigue and cardiology, etc. Among them, the entity relationship between Huixinkang Tablets, Suxiao Jiuxin Pills, Yi'anning Pills, Yixintong Tablets, Tongmai Granules and Tongyitang and coronary heart disease is Treat_Drug. The entity relationship between resting imaging, dynamic electrocardiogram, enzyme test and exercise imaging and coronary heart disease is Required_Check. The entity relationship between sudden death, rheumatic fever, menopausal syndrome, and mitral regurgitation and coronary heart disease is "Complication." The entity relationship between arrhythmia, dyspnea, palpitations, heart palpitations, heart failure, chronic atrial fibrillation, tachycardia, and fatigue and coronary heart disease is "Disease_Symptom." The entity relationship between the Department of Cardiology and coronary heart disease is "Disease_Department."

[0056] Furthermore, the electronic device obtains a second feature embedding vector corresponding to the medical knowledge entity, including: the electronic device inputs the medical knowledge entity into a preset graph neural network model to obtain a second feature embedding vector corresponding to the medical knowledge entity. The preset graph neural network model is a CompGCN (Composition-based Multi-Relational Graph Convolutional Networks, multi-relational heterogeneous graph neural network) model. In this way, the feature embedding vector of each entity in the medical knowledge graph can be obtained through the CompGCN model, which facilitates the fusion of knowledge in the medical knowledge graph and can solve the problem of insufficient description of user consultation texts.

[0057] Furthermore, the electronic device inputs the medical knowledge entity into a preset graph neural network model to obtain a second feature embedding vector corresponding to the medical knowledge entity, including: calculating Obtain the second feature embedding vector corresponding to the i-th medical knowledge entity. Where u is the first candidate entity, r is the entity relationship between the first candidate entities, To characterize the and Perform synthesis. is the embedding of the first candidate entity in the lth layer of the CompGCN model, l is the number of network layers of the CompGCN model, k is the embedding of the entity relationship between the second candidate entities in the lth layer in the CompGCN model. i is the second candidate entity, N(k i ) is a set of second candidate entities. The entity relationship parameters are set, and the entity relationship parameters are obtained through model learning.

[0058] Furthermore, the electronic device uses the first feature embedding vector and the second feature embedding vector to perform knowledge fusion to obtain a third feature embedding vector, including: the electronic device obtains the importance corresponding to the medical knowledge entity based on the first feature embedding vector and the second feature embedding vector. According to a first preset algorithm, the importance and the second feature embedding vector are used to perform calculations to obtain the third feature embedding vector. In this way, by using the first feature embedding vector and the second feature embedding vector to perform knowledge fusion to obtain the third feature embedding vector, the dual attention mechanism can be used to reduce the interference of noise data in the text and knowledge entities, thereby improving the accuracy of medical guidance.

[0059] Furthermore, the electronic device obtains the importance corresponding to the medical knowledge entity based on the first feature embedding vector and the second feature embedding vector, including: the electronic device performs calculations using the first feature embedding vector and the second feature embedding vector according to a second preset algorithm to obtain a second candidate feature embedding vector corresponding to the medical knowledge entity; and performs calculations using the second candidate feature embedding vector according to a third preset algorithm to obtain the importance corresponding to the medical knowledge entity.

[0060] Furthermore, the electronic device calculates the first feature embedding vector and the second feature embedding vector according to the second preset algorithm to obtain a second candidate feature embedding vector corresponding to the medical knowledge entity, including: the electronic device calculates G i =tanh(W1[z i ⊕r t ]) obtain the second candidate feature embedding vector corresponding to the medical knowledge entity. Among them, G i is the second candidate feature embedding vector corresponding to the i-th medical knowledge entity. W1 is the preset first learnable weight matrix, z i is the second feature embedding vector corresponding to the i-th medical knowledge entity, r t The first feature embedding vector corresponding to the user query text. ⊕ is used to represent vector concatenation.

[0061] Furthermore, the electronic device calculates the importance of the medical knowledge entity by using the second candidate feature embedding vector according to the third preset algorithm, including: the electronic device calculates Obtain the importance of medical knowledge entity correspondence. Among them, α i is the importance of the i-th medical knowledge entity to the user's consultation text, is the transposed matrix of the preset second learnable weight matrix, G i is the second candidate feature embedding vector corresponding to the i-th medical knowledge entity.

[0062] Furthermore, the electronic device calculates the importance and the second feature embedding vector according to the first preset algorithm to obtain the third feature embedding vector, including: the electronic device calculates Get the third feature embedding vector. Among them, k r is the third feature embedding vector, j is the total number of medical knowledge entities, α i is the importance of the i-th medical knowledge entity to the user consultation text, z i is the second feature embedding vector corresponding to the i-th medical knowledge entity.

[0063] Furthermore, the electronic device determines the guidance department corresponding to the user consultation text based on the first feature embedding vector and the third feature embedding vector, including: the electronic device concatenates the first feature embedding vector and the third feature embedding vector to obtain a target vector. A fourth preset algorithm is used to perform calculations using the target vector to obtain a probability distribution of the guidance departments. The guidance department with the highest probability in the probability distribution is determined as the guidance department corresponding to the user consultation text.

[0064] Furthermore, the electronic device connects the first feature embedding vector and the third feature embedding vector to obtain a target vector, including: the electronic device calculates Q = [r t ⊕k r ] to obtain the target vector. Where Q is the target vector, k r is the third feature embedding vector, r t The first feature embedding vector corresponding to the user query text. ⊕ is used to represent vector concatenation.

[0065] Furthermore, a fourth preset algorithm is used to calculate using the target vector to obtain a probability distribution of the guidance department, including: obtaining the probability distribution of the guidance department by calculating p(y|s)=softmax(tanh(WQ+b)). Wherein, p(y|s) is the probability distribution of the guidance department, W is the weight of the fully connected layer, b is the bias value of the fully connected layer, and Q is the target vector.

[0066] Furthermore, the most likely referral department in the probability distribution is obtained by the following method: Get the most likely referral department. is the guidance department with the highest probability, and p(y|s) is the probability distribution of the guidance department.

[0067] Optionally, combined Figure 4As shown, an embodiment of the present disclosure provides a structural schematic diagram of a medical guidance model for performing medical consultations. The medical guidance model is a KIAN (Knowledge Interactive Attention Network) model. The medical guidance model includes a text feature extraction module, an external knowledge embedding module, an attention mechanism and knowledge fusion module, and an output module. The text feature extraction module is configured to utilize a preset pre-trained model to obtain a first feature embedding vector corresponding to the user consultation text. The text feature extraction module utilizes the BERT pre-trained model to map each character or word in the user consultation text to a high-dimensional vector space, and then utilizes a text convolutional neural network (TextCNN Network) to perform dimensionality reduction processing on the first candidate feature embedding vector to obtain the first feature embedding vector corresponding to the user consultation text. The external knowledge embedding module is configured to perform named entity recognition on the user consultation text to obtain a set of candidate entities, and then query a preset medical knowledge graph to identify second candidate entities that have an entity relationship with each first candidate entity in the candidate entity set, and determine the first candidate entity and the second candidate entity as medical knowledge entities. The preset graph neural network model CompGCN is then utilized to obtain the second feature embedding vector corresponding to the medical knowledge entity. The attention mechanism and knowledge fusion module is used to perform weighted calculation on the first feature embedding vector and the second feature embedding vector to obtain the third feature embedding vector. The weighted calculation symbol is In this way, the external knowledge embedding obtained from the medical knowledge graph can be integrated through the attention mechanism, and the interference of noise data in the text and knowledge entities can be reduced by using the dual attention mechanism, thereby improving the accuracy of medical guidance. The output module is used to connect the first feature embedding vector and the third feature embedding vector to obtain the target vector. The probability distribution of the guidance department is obtained by calculating the fully connected layer and the normalized exponential function Softmax function. The guidance department with the highest probability is then determined as the guidance department corresponding to the user consultation text. In this way, since the KIAN model combines medical knowledge graph and deep learning, compared with the traditional linear text embedding model, this application obtains the contextual information of the user consultation text through the BERT model and integrates the external knowledge in the medical knowledge graph. It can solve the problem of insufficient description in the user consultation text, thereby improving the accuracy of users when conducting medical guidance.

[0068] The KIAN medical guidance model system identifies the appropriate medical department for outpatients based on their primary complaint. Furthermore, the KIAN medical guidance model system can facilitate emerging online hospital registration and online medical diagnosis services, which require outpatients to first identify the correct department. This is because outpatient complaints are typically brief and contain a lot of noisy information. To address this, the system incorporates a medical knowledge graph, a deep learning framework that integrates external medical knowledge sources. A dual-attention mechanism is also proposed to mitigate the interference of noisy words and knowledge entities.

[0069] Optionally, the medical guidance model is optimized by a preset loss function. The preset loss function is a maximum likelihood estimation function, i.e. Where L(θ) is the loss value, θ is the set of all parameters in the medical guidance model, S is the training sample set, and the training sample set includes multiple sample user consultation texts. s is the sample user consultation text, Consult the true label corresponding to the sample user text s.

[0070] Combine Figure 5 As shown, an embodiment of the present disclosure provides a method for performing medical guidance, the method comprising:

[0071] Step S501: The electronic device obtains a user consultation text.

[0072] In step S502, the electronic device obtains a first feature embedding vector corresponding to the user consultation text using a preset pre-training model; the pre-training model is used to obtain a feature embedding vector that integrates context information.

[0073] In step S503, the electronic device uses a preset medical knowledge graph to obtain the medical knowledge entity corresponding to the user consultation text; the medical knowledge graph stores multiple medical knowledge entities and entity relationships between the medical knowledge entities.

[0074] Step S504: The electronic device obtains a second feature embedding vector corresponding to the medical knowledge entity.

[0075] In step S505, the electronic device performs knowledge fusion using the first feature embedding vector and the second feature embedding vector to obtain a third feature embedding vector.

[0076] In step S506, the electronic device connects the first feature embedding vector and the third feature embedding vector to obtain a target vector.

[0077] In step S507 , the electronic device performs calculations using the target vector according to a fourth preset algorithm to obtain a probability distribution of the medical guidance departments.

[0078] In step S508, the electronic device determines the guidance department with the highest probability in the probability distribution as the guidance department corresponding to the user consultation text.

[0079] The method for medical guidance provided by the embodiments of the present disclosure utilizes a first feature embedding vector that incorporates contextual information and a third feature embedding vector that incorporates knowledge from the medical knowledge graph. This allows for the acquisition of contextual information from the user's consultation text while also integrating knowledge from the medical knowledge graph. By concatenating the first and third feature embedding vectors to obtain a target vector, and then obtaining the probability distribution of the guidance department based on the target vector, a more accurate guidance department can be determined. This improves the accuracy of medical guidance.

[0080] Combine Figure 6 As shown, an embodiment of the present disclosure provides a device for performing medical guidance, including a processor 600 and a memory 601. Optionally, the device may also include a communication interface 602 and a bus 603. The processor 600, the communication interface 602, and the memory 601 can communicate with each other through the bus 603. The communication interface 602 can be used for information transmission. The processor 600 can call the logic instructions in the memory 601 to execute the method for performing medical guidance of the above embodiment.

[0081] The device for medical guidance provided by the embodiments of the present disclosure utilizes a first feature embedding vector that incorporates contextual information and a third feature embedding vector that incorporates knowledge from the medical knowledge graph. This allows for the acquisition of contextual information from the user's consultation text while also integrating knowledge from the medical knowledge graph. Based on the first and third feature embedding vectors, a more accurate department for medical guidance can be determined, thereby improving the accuracy of medical guidance.

[0082] In addition, the logic instructions in the memory 601 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.

[0083] The memory 601 is a computer-readable storage medium that can be used to store software programs and computer-executable programs, such as program instructions / modules corresponding to the methods in the embodiments of the present disclosure. The processor 600 executes the program instructions / modules stored in the memory 601 to perform functional applications and data processing, thereby implementing the method for medical guidance in the above-mentioned embodiments.

[0084] The memory 601 may include a program storage area and a data storage area. The program storage area may store an operating system and at least one application required for a function; the data storage area may store data generated based on the use of the terminal device. Furthermore, the memory 601 may include a high-speed random access memory and a non-volatile memory.

[0085] An embodiment of the present disclosure provides an electronic device, including the above-mentioned device for medical guidance.

[0086] Optionally, the electronic device includes a computer, a tablet computer, a server or other device.

[0087] The electronic device provided by the embodiments of the present disclosure utilizes a first feature embedding vector that incorporates contextual information and a third feature embedding vector that incorporates knowledge from the medical knowledge graph. This allows for the acquisition of contextual information from the user's consultation text while also integrating knowledge from the medical knowledge graph. Based on the first and third feature embedding vectors, a more accurate department for medical guidance can be determined, improving the accuracy of medical guidance.

[0088] An embodiment of the present disclosure provides a storage medium storing program instructions, which, when run, execute the above-mentioned method for medical guidance.

[0089] An embodiment of the present disclosure provides a computer program product, which includes a computer program stored on a computer-readable storage medium. The computer program includes program instructions, which, when executed by a computer, cause the computer to execute the above-mentioned method for medical guidance.

[0090] The aforementioned computer-readable storage medium may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.

[0091] The technical solution of the embodiments of the present disclosure may be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiments of the present disclosure. The aforementioned storage medium may be a non-transitory storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program code, or a transient storage medium.

[0092] The above description and the accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent only possible variations. Unless explicitly required, individual components and functions are optional, and the order of operations may vary. Parts and features of some embodiments may be included in or replace parts and features of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to also include plural forms. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of one or more associated listings. In addition, when used in this application, the term "comprise" and its variations "comprises" and / or comprising refer to the presence of stated features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups of these. In the absence of further restrictions, an element defined by the sentence "comprising a..." does not exclude the presence of other identical elements in the process, method or device that includes the element. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the various embodiments can be referenced to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can be found in the description of the method part.

[0093] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. The technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present disclosure. The technicians will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0094] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units can be merely a logical functional division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, and can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected to implement this embodiment according to actual needs. In addition, the functional units in the embodiments of the present disclosure may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0095] The flowcharts and block diagrams in the accompanying drawings show the possible implementation architectures, functions and operations of the systems, methods and computer program products according to the embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment or part of the code, and the module, program segment or part of the code contains one or more executable instructions for implementing the specified logical functions. In some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, or they can sometimes be executed in the opposite order, which can depend on the functions involved. In the descriptions corresponding to the flowcharts and block diagrams in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in an order different from that disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, or they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified function or action, or may be implemented by a combination of dedicated hardware and computer instructions.

Claims

1. A method for medical guidance, characterized in that: include: Get user consultation text; Obtaining a first feature embedding vector corresponding to the user consultation text using a preset pre-trained model; The pre-trained model is used to obtain a feature embedding vector that integrates context information; Obtaining the medical knowledge entity corresponding to the user consultation text using a preset medical knowledge graph; the medical knowledge graph stores a plurality of medical knowledge entities and entity relationships between the medical knowledge entities; Obtaining a second feature embedding vector corresponding to the medical knowledge entity; Performing knowledge fusion using the first feature embedding vector and the second feature embedding vector to obtain a third feature embedding vector; Determine the consultation department corresponding to the user consultation text according to the first feature embedding vector and the third feature embedding vector; Performing knowledge fusion using the first feature embedding vector and the second feature embedding vector to obtain a third feature embedding vector includes: By calculation Obtain the second candidate feature embedding vector corresponding to the medical knowledge entity; wherein, is the second candidate feature embedding vector corresponding to the i-th medical knowledge entity; is the preset first learnable weight matrix, is the second feature embedding vector corresponding to the i-th medical knowledge entity, The first feature embedding vector corresponding to the user consultation text; Used to represent vector splicing; By calculation The importance of obtaining correspondence between medical knowledge entities; among them, is the importance of the i-th medical knowledge entity to the user's consultation text, is the transposed matrix of the preset second learnable weight matrix, is the second candidate feature embedding vector corresponding to the i-th medical knowledge entity; By calculation Get the third feature embedding vector; where, is the third feature embedding vector, is the total number of medical knowledge entities, is the importance of the i-th medical knowledge entity to the user's consultation text, is the second feature embedding vector corresponding to the i-th medical knowledge entity; Wherein, determining the consultation department corresponding to the user consultation text according to the first feature embedding vector and the third feature embedding vector includes: Concatenate the first feature embedding vector and the third feature embedding vector to obtain a target vector; The probability distribution of the guidance department is obtained by calculating p(y|s)=softmax(tanh(WQ+b)); where p(y|s) is the probability distribution of the guidance department, W is the weight of the fully connected layer, b is the bias value of the fully connected layer, and Q is the target vector; The guidance department with the highest probability in the probability distribution is determined as the guidance department corresponding to the user consultation text.

2. The method according to claim 1, characterized in that Obtaining a first feature embedding vector corresponding to the user consultation text using a preset pre-trained model includes: Inputting the user consultation text into the pre-trained model to obtain a first candidate feature embedding vector corresponding to the user consultation text; A preset convolutional neural network is used to perform dimensionality reduction processing on the first candidate feature embedding vector to obtain a first feature embedding vector corresponding to the user consultation text.

3. The method according to claim 1, characterized in that The medical knowledge entity corresponding to the user consultation text is obtained using a preset medical knowledge graph, including: Performing entity recognition on the user consultation text to obtain a candidate entity set; the candidate entity set includes a plurality of first candidate entities; Searching the medical knowledge graph for second candidate entities that have entity relationships with each of the first candidate entities; Each of the first candidate entities and each of the second candidate entities is determined as the medical knowledge entity corresponding to the user consultation text.

4. The method according to claim 1, wherein Obtaining a second feature embedding vector corresponding to the medical knowledge entity includes: The medical knowledge entity is input into a preset graph neural network model to obtain a second feature embedding vector corresponding to the medical knowledge entity.

5. A device for medical guidance, comprising a processor and a memory storing program instructions, characterized in that: The processor is configured to execute the method for medical guidance according to any one of claims 1 to 4 when running the program instructions.

6. An electronic device, characterized in that: The invention comprises the device for medical guidance as claimed in claim 5.

7. A storage medium storing program instructions, characterized in that: When the program instructions are executed, the method for medical guidance according to any one of claims 1 to 4 is executed.