Medical knowledge graph establishment method and device, medical knowledge graph query method and device
By extracting entities from doctor-patient dialogue data and generating a medical knowledge graph, it solves the problem in the existing technology that medical knowledge graphs cannot accurately describe the relationship between diseases and diagnosis and treatment methods, and achieves more accurate disease prediction and query results.
Patent Information
- Application Number
- CN201911164403.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-11-25
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2039-11-25
AI Technical Summary
The existing medical knowledge graph cannot accurately describe the complex relationship between symptoms, diseases and diagnosis and treatment methods, resulting in inaccurate user query results.
By extracting patient entities and doctor entities from a large amount of doctor-patient dialogue data, a neural network model is used to generate a medical knowledge graph, and entity categories are marked in the graph, entity correlations are calculated, and a visual graph and query prediction results are generated.
It achieves an accurate description of the relationship between symptoms, diseases and diagnosis and treatment methods, improves the accuracy and query efficiency of disease prediction results, and the output results are more natural and consistent with conversation habits.
Smart Images

Figure CN112836058B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and specifically to a method and device for establishing a medical knowledge graph, and also to a method and device for querying a medical knowledge graph. Background Art
[0002] At present, with the development of the Internet and computer technology, the amount of information on the Internet has also increased rapidly, and knowledge graph technology has developed rapidly. Knowledge graph, also known as knowledge domain visualization or knowledge domain mapping map, is a series of various graphics that show the development process and structural relationship of knowledge. It uses visualization technology to describe knowledge resources and their carriers, and mine, analyze, construct, draw and display knowledge and their mutual connections.
[0003] Most existing medical knowledge graphs are simply constructed based on knowledge or medical records. Since there is usually an intricate relationship between symptoms, diseases and diagnosis and treatment methods in the medical field, existing medical knowledge graphs cannot provide users with accurate and effective query results. Summary of the invention
[0004] On the one hand, an embodiment of the present invention provides a method and device for establishing a medical knowledge graph to accurately describe the relationship between symptoms, diseases and diagnosis and treatment methods.
[0005] On the other hand, an embodiment of the present invention provides a medical knowledge graph query method and device, which can provide users with more accurate disease prediction results.
[0006] To this end, the present invention provides the following technical solutions:
[0007] A method for establishing a medical knowledge graph, the method comprising:
[0008] Obtain a large amount of medical and patient-related data, and process each medical and patient-related data into patient data and doctor data;
[0009] Performing named entity extraction on the patient data and the doctor data respectively to obtain a patient entity and a doctor entity;
[0010] Determine the patient embedding vector and doctor embedding vector corresponding to each entity using the pre-established patient vector conversion model and doctor vector conversion model respectively;
[0011] A medical knowledge graph is generated according to the patient embedding vector and the doctor embedding vector corresponding to each entity, and the entity category to which each entity belongs is marked in the medical knowledge graph.
[0012] Optionally, the patient vector conversion model and the doctor vector conversion model are both neural network models; the method further comprises establishing the patient vector conversion model and the doctor vector conversion model in the following manner:
[0013] Collect multiple pieces of doctor-patient related data, and use each piece of doctor-patient related data as a training data;
[0014] Perform named entity extraction on each training data to obtain patient entity samples and doctor entity samples;
[0015] The patient entity samples are used to train a patient vector conversion model, and the doctor entity samples are used to train a doctor vector conversion model.
[0016] Optionally, the method further comprises:
[0017] Perform dimensionality reduction on the patient embedding vector and doctor embedding vector corresponding to each entity;
[0018] Generate a visual medical knowledge graph based on the embedded vector after dimensionality reduction.
[0019] Optionally, the method further comprises:
[0020] Calculate correlations between different entities;
[0021] The correlations between the different entities are recorded in the medical knowledge graph.
[0022] A medical knowledge graph query method, the method comprising:
[0023] Receive user input information;
[0024] Performing named entity extraction on the input information to obtain a user entity;
[0025] Determining an embedding vector corresponding to the user entity;
[0026] Searching for similar patient entities in a pre-established medical knowledge graph according to the embedding vector corresponding to the user entity;
[0027] Determine a similar doctor entity according to the doctor embedding vector corresponding to the similar patient entity;
[0028] generating a prediction result according to the similar doctor entity;
[0029] The prediction result is output.
[0030] Optionally, searching for similar patient entities in a pre-established medical knowledge graph according to the embedding vector corresponding to the user entity includes:
[0031] Obtaining a patient embedding vector corresponding to each patient entity in the medical knowledge graph;
[0032] Calculate the distance between the patient embedding vector corresponding to each patient entity and the embedding vector corresponding to the user entity respectively;
[0033] The patient entity with the largest distance is regarded as a similar patient entity.
[0034] Optionally, determining a similar doctor entity according to the doctor embedding vector corresponding to the similar patient entity includes:
[0035] Find the doctor entity pointed to by the doctor embedding vector corresponding to the similar patient entity;
[0036] Calculate the distance between each doctor entity and the pointed doctor entity;
[0037] Doctor entities whose distance is greater than the set threshold are regarded as similar doctor entities.
[0038] Optionally, determining a similar doctor entity according to the doctor embedding vector corresponding to the similar patient entity includes:
[0039] The doctor embedding vector corresponding to the similar patient entity is input into a pre-established prediction model, and the similar doctor entity is obtained according to the output of the prediction model.
[0040] Optionally, generating a prediction result according to the similar doctor entity includes:
[0041] If there are multiple similar doctor entities, the likelihood of each similar doctor entity is calculated respectively;
[0042] Generate predictions based on similar doctor entities from most likely to least likely.
[0043] Optionally, the outputting the prediction result includes:
[0044] Converting the prediction result into natural language text;
[0045] The natural language text is output.
[0046] Optionally, converting the prediction result into natural language text includes:
[0047] Filling the prediction result into a preset template to obtain a natural language text; or
[0048] The prediction result is input into a pre-established text conversion model, and a natural language text is obtained according to the output of the text conversion model.
[0049] A medical knowledge graph establishment device, the device comprising:
[0050] The data collection module is used to obtain a large amount of doctor-patient related data and process each doctor-patient related data into patient data and doctor data;
[0051] An entity extraction module, used to extract named entities from the patient data and the doctor data respectively to obtain patient entities and doctor entities;
[0052] A vector conversion module, used to determine a patient embedding vector and a doctor embedding vector corresponding to each entity by using a pre-established patient vector conversion model and a doctor vector conversion model respectively;
[0053] The graph generation module is used to generate a medical knowledge graph based on the patient embedding vector and the doctor embedding vector corresponding to each entity, and mark the entity category to which each entity belongs in the medical knowledge graph.
[0054] Optionally, both the patient vector conversion model and the doctor vector conversion model are neural network models;
[0055] The device also includes a model building module for building a patient vector conversion model and a doctor vector conversion model; the model building module includes:
[0056] A training data collection unit, used to collect multiple segments of doctor-patient related data, and use each segment of doctor-patient related data as a piece of training data;
[0057] An entity extraction unit is used to extract named entities from each training data to obtain patient entity samples and doctor entity samples;
[0058] A training unit is used to train a patient vector conversion model using the patient entity sample, and to train a doctor vector conversion model using the doctor entity sample.
[0059] Optionally, the device further comprises:
[0060] A dimensionality reduction processing module is used to perform dimensionality reduction processing on the patient embedding vector and the doctor embedding vector corresponding to each entity;
[0061] The view generation module is used to generate a visual medical knowledge graph based on the embedded vector after dimensionality reduction.
[0062] Optionally, the device comprises:
[0063] A correlation calculation module, used to calculate the correlation between different entities;
[0064] A recording module is used to record the correlation between the different entities in the medical knowledge graph.
[0065] A medical knowledge graph query device, comprising:
[0066] A receiving module, used for receiving user input information;
[0067] A user entity extraction module, used to extract named entities from the input information to obtain user entities;
[0068] A vector calculation module, used to determine the embedding vector corresponding to the user entity;
[0069] An entity search module, used to search for similar patient entities in a pre-established medical knowledge graph according to the embedding vector corresponding to the user entity;
[0070] A doctor entity determination module, used to determine similar doctor entities according to the doctor embedding vectors corresponding to the similar patient entities;
[0071] A prediction result determination module, used for generating a prediction result according to the similar doctor entity;
[0072] An output module is used to output the prediction result.
[0073] Optionally, the entity search module includes:
[0074] A vector acquisition unit, used to acquire a patient embedding vector corresponding to each patient entity in the medical knowledge graph;
[0075] A first distance calculation unit, used to respectively calculate the distance between the patient embedding vector corresponding to each patient entity and the embedding vector corresponding to the user entity;
[0076] The first selection unit is used to select the patient entity with the largest distance as a similar patient entity.
[0077] Optionally, the doctor entity determination module includes:
[0078] A search unit, used to search for a doctor entity pointed to by a doctor embedding vector corresponding to the similar patient entity;
[0079] A second distance calculation unit, used for calculating the distance between each doctor entity and the pointed doctor entity;
[0080] The second selection unit is used to select doctor entities whose distance is greater than a set threshold as similar doctor entities.
[0081] Optionally, the doctor entity determination module is specifically used to input the doctor embedding vector corresponding to the similar patient entity into a pre-established prediction model, and obtain a similar doctor entity according to the output of the prediction model.
[0082] Optionally, the prediction result determination module includes:
[0083] A possibility calculation unit, used for respectively calculating the possibility of each similar doctor entity when there are multiple similar doctor entities;
[0084] The prediction result generating unit is used to generate prediction results according to similar doctor entities in descending order of likelihood.
[0085] Optionally, the output module includes:
[0086] A text conversion unit, used for converting the prediction result into a natural language text;
[0087] A text output unit is used to output the natural language text.
[0088] Optionally, the text conversion unit includes:
[0089] A template conversion unit, used to fill the prediction result into a preset template to obtain a natural language text; or
[0090] The model conversion unit is used to input the prediction result into a pre-established text conversion model and obtain natural language text according to the output of the text conversion model.
[0091] A computer device, comprising: one or more processors, a memory;
[0092] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the aforementioned method.
[0093] A readable storage medium stores instructions thereon, wherein the instructions are executed to implement the above-mentioned method.
[0094] The medical knowledge graph establishment method and device provided in the embodiment of the present invention extract patient entities and doctor entities from a large amount of collected doctor-patient dialogue data, generate a medical knowledge graph based on the patient embedding vectors and doctor embedding vectors of each entity, and mark the entity category corresponding to each entity in the medical knowledge graph, so that the medical knowledge graph can accurately describe the relationship between symptoms, diseases and diagnosis and treatment methods.
[0095] Furthermore, by performing dimensionality reduction processing on the embedded vector, a visual medical knowledge graph can be generated to visualize the abstract medical data, so that the relationship between entities can be observed more intuitively.
[0096] The medical knowledge graph query method and device provided by the embodiment of the present invention performs named entity extraction on the received user input information to obtain the user entity, and determines the embedding vector corresponding to the user entity, searches for similar patient entities in the pre-established medical knowledge graph according to the embedding vector corresponding to the user entity, determines similar doctor entities according to the doctor embedding vector corresponding to the similar patient entity, generates prediction results according to the similar doctor entities, and outputs the prediction results. Since the medical knowledge graph can accurately describe the relationship between symptoms, diseases and diagnosis and treatment methods, more accurate disease prediction results can be obtained when querying using the medical knowledge graph; and the query results can be obtained simply and quickly.
[0097] Furthermore, converting the prediction results generated according to the similar doctor entities into natural language text output can make the query results provided to the user more natural and in line with conversation habits. BRIEF DESCRIPTION OF THE DRAWINGS
[0098] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0099] Figure 1 This is a flow chart of a method for establishing a medical knowledge graph according to an embodiment of the present invention;
[0100] Figure 2 is another flow chart of the method for establishing a medical knowledge graph according to an embodiment of the present invention;
[0101] Figure 3 This is a flow chart of a medical knowledge graph query method according to an embodiment of the present invention;
[0102] Figure 4 This is a structural block diagram of a device for establishing a medical knowledge graph according to an embodiment of the present invention;
[0103] Figure 5 This is another structural block diagram of the medical knowledge graph establishment device according to an embodiment of the present invention;
[0104] Figure 6 This is a structural block diagram of a medical knowledge graph query device according to an embodiment of the present invention;
[0105] Figure 7 is a block diagram of a device for a medical knowledge graph query method according to an exemplary embodiment;
[0106] Figure 8 It is a schematic diagram of the structure of the server in an embodiment of the present invention. DETAILED DESCRIPTION
[0107] In order to enable persons skilled in the art to better understand the solutions of the embodiments of the present invention, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings and implementation modes.
[0108] An embodiment of the present invention provides a method and device for establishing a medical knowledge graph, which extracts patient entities and doctor entities from a large amount of collected doctor-patient conversation data, generates a medical knowledge graph based on the patient embedding vector and doctor embedding vector of each entity, and marks the entity category corresponding to each entity in the medical knowledge graph.
[0109] like Figure 1 FIG. 1 is a flow chart of a method for establishing a medical knowledge graph according to an embodiment of the present invention, comprising the following steps:
[0110] Step 101, obtain a large amount of doctor-patient related data, and process each doctor-patient related data into patient data and doctor data.
[0111] The doctor-patient related data may include a complete consultation dialogue data when the patient visits the doctor, and may also include medical question and answer data or medical records, and may also include online medical question and answer data and cases, to increase the completeness of the map and improve the accuracy of the prediction results.
[0112] In the embodiment of the present invention, the data of each complete consultation is used as a set of doctor-patient related data. Usually, in the doctor-patient related data, there is often a state where the patient and the doctor speak alternately. In view of this situation, the data corresponding to the patient in a set of doctor-patient related data is integrated into a segment to form the patient data, and the data corresponding to the doctor is integrated into a segment to form the doctor data.
[0113] Step 102, performing named entity extraction on the patient data and doctor data respectively to obtain patient entities and doctor entities.
[0114] For example, for patient data, we extract patient entities: disease, symptoms, body parts, patient's gender, age, affected body parts, diet, sleep, etc.; for doctor data, we extract doctor entities: disease, symptoms, body parts (the disease, symptoms, and body parts in the doctor entity represent the content of their diagnosis or inquiry), department, medicine, examination methods, treatment methods, etc.
[0115] Step 103, respectively determine the patient embedding vector and the doctor embedding vector corresponding to each entity using the pre-established patient vector conversion model and the doctor vector conversion model.
[0116] The patient vector conversion model and the doctor vector conversion model can both be neural network models, such as BERT (Bidirectional Encoder Representations from Transformers), LSTM (Long Short-Term Memory), GloVe model, etc. The establishment process of the patient vector conversion model and the doctor vector conversion model is as follows:
[0117] (1) Collect multiple pieces of doctor-patient related data and use each piece of doctor-patient related data as a training data;
[0118] (2) Perform named entity extraction on each training data to obtain patient entity samples and doctor entity samples;
[0119] (3) The patient entity sample is used for training or fine-tuning (an adjustment method for a neural network model such as BERT) to obtain a patient vector conversion model, and the doctor entity sample is used for training or fine-tuning (an adjustment method for a neural network model such as BERT) to obtain a doctor vector conversion model.
[0120] Specifically, one or more non-repeating target entities are selected from a conversation each time, and all patient entities in the conversation are used to predict the target entity to train the patient vector conversion model, and updated using a suitable loss function (such as SGD (Stochastic Gradient Descent), Adam algorithm, etc.) to obtain model parameters; similarly, all doctor entities in the conversation are used to predict the target entity to train the doctor vector conversion model.
[0121] Accordingly, when using the vector conversion model to determine the embedding vector corresponding to each entity, the above entities can be input into the vector conversion model, and the embedding vector corresponding to the entity can be obtained according to the output of the vector conversion model. The patient embedding vector corresponding to the entity is obtained by using the patient vector conversion model, and the doctor embedding vector corresponding to the entity is obtained by using the doctor vector conversion model.
[0122] It should be noted that, regardless of whether it is a patient entity or a doctor entity, each entity corresponds to two embedding vectors, namely, a patient embedding vector pointing to the patient, and a doctor embedding vector pointing to the doctor.
[0123] Step 104, generating a medical knowledge graph according to the patient embedding vector and the doctor embedding vector corresponding to each entity, and marking the entity category to which each entity belongs in the medical knowledge graph.
[0124] It should be noted that each entity in the knowledge graph corresponds to two embedding vectors, namely the patient embedding vector pointing to the patient and the doctor embedding vector pointing to the doctor.
[0125] The medical knowledge graph records the embedding vectors of each entity and the directions of each embedding vector, that is, the entity category to which the embedding vector belongs. In other words, it records each entity in the vector space. The entity category can include major categories, namely the patient entity and the doctor entity mentioned above, and each major category can also include minor categories. For example, for the doctor entity, it can be further divided into minor categories such as diseases and drugs.
[0126] The medical knowledge graph establishment method provided in the embodiment of the present invention extracts patient entities and doctor entities from a large amount of collected doctor-patient dialogue data, generates a medical knowledge graph based on the patient embedding vectors and doctor embedding vectors of each entity, and marks the entity category corresponding to each entity in the medical knowledge graph, so that the medical knowledge graph can accurately describe the relationship between symptoms, diseases and diagnosis and treatment methods.
[0127] like Figure 2 FIG. 1 is another flow chart of a method for establishing a medical knowledge graph according to an embodiment of the present invention, comprising the following steps:
[0128] Step 201, obtain a large amount of doctor-patient related data, and process each doctor-patient related data into patient data and doctor data.
[0129] Step 202, performing named entity extraction on the patient data and doctor data respectively to obtain patient entities and doctor entities.
[0130] Step 203, respectively determine the patient embedding vector and the doctor embedding vector corresponding to each entity using the pre-established patient vector conversion model and the doctor vector conversion model.
[0131] Step 204: perform dimensionality reduction processing on the patient embedding vector and doctor embedding vector corresponding to each entity.
[0132] For example, the feature data (i.e., the embedding vectors corresponding to each entity) can be reduced in dimensionality through algorithms such as PCA (Principal Component Analysis) and LDA.
[0133] Step 205: Generate a visualized medical knowledge graph based on the embedded vector after dimensionality reduction processing.
[0134] It can be seen that by reducing the dimensionality of the embedded vector, a visual medical knowledge graph can be generated, and the abstract medical data can be visualized, so that the relationship between entities can be observed more intuitively.
[0135] Furthermore, the correlation between different entities can also be calculated based on the embedding vectors corresponding to each entity (which can be the embedding vectors before dimensionality reduction or the embedding vectors after dimensionality reduction). In an embodiment of the present invention, the correlation between different entities can be determined based on the distance between the entities. The closer the distance, the stronger the correlation. For example, the cosine distance, absolute distance, etc. between different entities can be calculated based on the embedding vectors corresponding to each entity; the correlation between the entities can be determined based on the distance between the entities.
[0136] The calculation of the above correlation is mainly aimed at the correlation between patient entities and patient entities, and the correlation between doctor entities and doctor entities.
[0137] It should be noted that, in the visualized medical knowledge graph, the embedding vector of each entity and the entity category to which the embedding vector belongs are also recorded.
[0138] In practical applications, the following can be generated simultaneously: Figure 1 The non-visual medical knowledge graph described in the embodiment and Figure 2 The visualized medical knowledge graph described in the embodiment can also generate one of them as needed, which is not limited to this embodiment of the present invention.
[0139] Utilizing the above-mentioned medical knowledge graph, an embodiment of the present invention also provides a medical knowledge graph query method, which extracts a patient entity from the user's input information and determines an embedding vector corresponding to the patient entity; then searches for similar patient entities in the above-mentioned medical knowledge graph, and determines similar doctor entities based on the doctor embedding vectors corresponding to the similar patient entities; then generates a prediction result based on the similar doctor entities; and outputs the prediction result.
[0140] like Figure 3 FIG. 1 is a flow chart of a medical knowledge graph query method according to an embodiment of the present invention, comprising the following steps:
[0141] Step 301: receiving user input information.
[0142] Step 302: perform named entity extraction on the input information to obtain user entities.
[0143] The method of extracting named entities can adopt the existing technology, which will not be described in detail.
[0144] Step 303: Determine the embedding vector corresponding to the user entity.
[0145] Specifically, the embedded vector corresponding to the user entity can be obtained by using a pre-established patient vector conversion model. The patient vector conversion model has been described in detail in the previous embodiment of the medical knowledge graph establishment method, and will not be repeated here.
[0146] Step 304: Search for similar patient entities in a pre-established medical knowledge graph based on the embedding vector corresponding to the user entity.
[0147] The patient entity similar to the user entity, ie, the similar patient entity, may be determined by the distance between entities. The distance may be, for example, a cosine distance, an absolute distance, or the like.
[0148] Specifically, the patient embedding vector corresponding to each patient entity in the medical knowledge graph is obtained, the distance between the patient embedding vector corresponding to each patient entity and the embedding vector corresponding to the user entity is calculated respectively, and the patient entity with the largest distance is taken as a similar patient entity.
[0149] Step 305: Determine similar doctor entities based on the doctor embedding vectors corresponding to the similar patient entities.
[0150] Specifically, the doctor entity corresponding to the patient entity can be determined by searching or predicting.
[0151] The search method is as follows: first, search for the doctor entity pointed to by the doctor embedding vector corresponding to the similar patient entity; calculate the distance between each doctor entity and the pointed doctor entity, and select the doctor entity whose distance is greater than the set distance threshold as the search result, that is, the similar doctor entity. The distance between entities can be calculated as described above, that is, using the corresponding embedding vectors of the two to calculate the cosine distance, absolute distance, etc.
[0152] Of course, if the medical knowledge graph records the correlation between different entities, the similar doctor entity can also be determined directly based on the correlation. For example, a doctor entity whose correlation with the pointed doctor entity is greater than a set correlation threshold is regarded as a similar doctor entity.
[0153] The prediction method is to use a pre-established prediction model, input the doctor embedding vector corresponding to the similar patient entity into the prediction model, and obtain the similar doctor entity according to the output of the prediction model. The prediction model can adopt a neural network model or a statistical model (such as SVM), and the model can use the existing doctor-patient dialogue data to predict the doctor entity according to the input doctor embedding vector.
[0154] Step 306: Generate a prediction result based on the similar doctor entity.
[0155] It should be noted that there may be one or more similar doctor entities. In the case of multiple similar doctor entities, the corresponding prediction results can be generated based on the likelihood of each similar doctor entity (for example, the likelihood of each similar doctor entity is obtained by performing softmax calculations based on the distance between each similar doctor entity and the pointed doctor entity). Specifically, the likelihood of each similar doctor entity can be calculated separately, and the prediction results can be generated based on the similar doctor entities in descending order of likelihood.
[0156] Step 307: output the prediction result.
[0157] It should be noted that, in practical applications, the prediction results may be directly output, or they may be processed first to make the output content more natural. Specifically, the prediction results may be converted into natural language text, and then the natural language text may be output.
[0158] The prediction result can be converted into natural language text in any of the following ways:
[0159] 1) Filling the prediction result into a preset template to obtain a natural language text;
[0160] 2) Inputting the prediction result into a pre-established text conversion model, and obtaining natural language text according to the output of the text conversion model.
[0161] The training process of the text conversion model is as follows: extract the entity of each sentence through NER (Named Entity Recognition), and use keywords or neural networks to obtain the intention of each sentence, including affirmation, negation and question. The training model generates the original sentence through the entity and intention, and finally obtains the text conversion model.
[0162] The following example further illustrates the process of obtaining prediction results using the medical knowledge graph query method of the present invention.
[0163] Assume that the user's input information is "Always coughing recently". Through named entity extraction, the user entity obtained is "cough". The embedding vector corresponding to the user entity is calculated to be [0.5, 0.5]. Then, the medical knowledge graph is searched and the similar patient entity is "cough". The similar doctor entities determined based on the similar patient entity are as follows: disease category: "cold", "bronchitis", and drug category: "acute bronchitis syrup".
[0164] When there are multiple similar doctor entities, the probability of each similar doctor entity is calculated separately. The calculation results are: the probability of "cold" is 0.4, the probability of "bronchitis" is 0.6, and the probability of "acute bronchitis syrup" is 0.8.
[0165] Based on the above calculation results, the prediction result output in the form of natural language text is "It is very likely to be bronchitis, or it may be a cold. It is recommended to take acute bronchitis syrup to relieve symptoms."
[0166] The medical knowledge graph query method provided by the embodiment of the present invention performs named entity extraction on the received user input information to obtain a user entity, and determines the embedding vector corresponding to the user entity, searches for similar patient entities in the pre-established medical knowledge graph according to the embedding vector corresponding to the user entity, determines similar doctor entities according to the doctor embedding vectors corresponding to the similar patient entities, generates prediction results according to the similar doctor entities, and outputs the prediction results. Since the medical knowledge graph can accurately describe the relationship between symptoms, diseases and diagnosis and treatment methods, more accurate disease prediction results can be obtained when querying using the medical knowledge graph; and query results can be obtained simply and quickly.
[0167] Accordingly, an embodiment of the present invention also provides a medical knowledge graph establishment device, such as Figure 4 Shown is a structural block diagram of the device.
[0168] In this embodiment, the device includes the following modules:
[0169] The data collection module 401 is used to obtain a large amount of doctor-patient related data and process each doctor-patient related data into patient data and doctor data;
[0170] An entity extraction module 402 is used to extract named entities from the patient data and the doctor data to obtain patient entities and doctor entities;
[0171] A vector conversion module 403 is used to determine a patient embedding vector and a doctor embedding vector corresponding to each entity by using a pre-established patient vector conversion model and a doctor vector conversion model respectively;
[0172] The graph generation module 404 is used to generate a medical knowledge graph according to the patient embedding vector and the doctor embedding vector corresponding to each entity, and mark the entity category to which each entity belongs in the medical knowledge graph.
[0173] In an embodiment of the present invention, the doctor-patient related data may include conversation data when the patient visits the doctor, and may also include medical question and answer data or medical records, and may also include medical question and answer data and cases on the Internet, so as to increase the completeness of the graph and improve the accuracy of the prediction results.
[0174] The patient vector conversion model and the doctor vector conversion model can both adopt a neural network model, which can be pre-established by a model establishment module (not shown). The model establishment module may include the following units:
[0175] A training data collection unit, used to collect multiple segments of doctor-patient related data, and use each segment of doctor-patient related data as a piece of training data;
[0176] An entity extraction unit is used to extract named entities from each training data to obtain patient entity samples and doctor entity samples;
[0177] A training unit is used to train a patient vector conversion model using the patient entity sample, and to train a doctor vector conversion model using the doctor entity sample.
[0178] Accordingly, when the vector conversion module 403 determines the embedding vector corresponding to each entity using the vector conversion model, the above entities can be input into the vector conversion model, and the embedding vector corresponding to the entity can be obtained according to the output of the vector conversion model. The patient embedding vector is obtained by using the patient vector conversion model, and the doctor embedding vector is obtained by using the doctor vector conversion model.
[0179] The medical knowledge graph establishment device provided in an embodiment of the present invention extracts patient entities and doctor entities from a large amount of collected doctor-patient dialogue data, generates a medical knowledge graph based on the patient embedding vectors and doctor embedding vectors of each entity, and marks the entity category corresponding to each entity in the medical knowledge graph, so that the medical knowledge graph can accurately describe the relationship between symptoms, diseases and diagnosis and treatment methods.
[0180] like Figure 5 Shown is another structural block diagram of the medical knowledge graph establishment device according to an embodiment of the present invention.
[0181] and Figure 4 The difference of the embodiment shown is that, in this embodiment, the device further includes the following modules:
[0182] A dimensionality reduction processing module 501 is used to perform dimensionality reduction processing on the patient embedding vector and the doctor embedding vector corresponding to each entity;
[0183] The view generation module 502 is used to generate a visualized medical knowledge graph based on the embedded vector after dimensionality reduction processing.
[0184] Furthermore, in another embodiment of the device of the present invention, it may also include: a correlation calculation module and a recording module (not shown).
[0185] The correlation calculation module 501 is used to calculate the correlation between different entities; for example, the correlation between different entities can be determined according to the distance between the entities. The correlation calculation module 501 may specifically include the following units:
[0186] A distance calculation unit is used to calculate the distance between different entities based on the embedding vectors corresponding to each entity, such as cosine distance, absolute distance, etc.;
[0187] The correlation determination unit is used to determine the correlation between the entities according to the distance between the entities.
[0188] Among them, the recording module is used to record the correlation between the different entities in the medical knowledge graph.
[0189] It should be noted that the calculation of the above correlation is mainly aimed at the correlation between patient entities and patient entities, and the correlation between doctor entities and doctor entities.
[0190] By using the medical knowledge graph establishment device provided by the embodiment of the present invention, not only can a medical knowledge graph that can accurately describe the relationship between symptoms, diseases and diagnosis and treatment methods be established, but also a visual medical knowledge graph can be generated by performing dimensionality reduction processing on the embedded vector, and abstract medical data can be visualized, so that the relationship between each entity can be observed more intuitively.
[0191] Accordingly, an embodiment of the present invention also provides a medical knowledge graph query device, such as Figure 6 Shown is a structural block diagram of the device.
[0192] In this embodiment, the medical knowledge graph query device includes the following modules:
[0193] Receiving module 601, used to receive user input information;
[0194] A user entity extraction module 602, configured to extract named entities from the input information to obtain user entities;
[0195] A vector calculation module 603, used to determine an embedding vector corresponding to the user entity;
[0196] An entity search module 604 is used to search for similar patient entities in a pre-established medical knowledge graph according to the embedding vector corresponding to the user entity;
[0197] A doctor entity determination module 605 is used to determine similar doctor entities according to the doctor embedding vectors corresponding to the similar patient entities;
[0198] A prediction result determination module 606, configured to generate a prediction result according to the similar doctor entity;
[0199] The output module 607 is used to output the prediction result.
[0200] The user entity extraction module 602 may specifically use a pre-established patient vector conversion model to obtain an embedding vector corresponding to the user entity. The patient vector conversion model may be pre-established by a corresponding model building module (not shown). The model building module may be a part of the device of the present invention or may be independent of the device, which is not limited in this embodiment of the present invention.
[0201] The entity search module 604 may specifically determine a patient entity similar to the user entity according to the distance between entities. For example, the entity search module 604 may include the following units:
[0202] A vector acquisition unit, used to acquire a patient embedding vector corresponding to each patient entity in the medical knowledge graph;
[0203] A first distance calculation unit, used to respectively calculate the distance between the patient embedding vector corresponding to each patient entity and the embedding vector corresponding to the user entity;
[0204] The first selection unit is used to select the patient entity with the largest distance as a similar patient entity.
[0205] Of course, if the medical knowledge graph records the correlation between different entities, the entity search module 604 can also directly determine the patient entity similar to the user entity based on the correlation, for example, taking the patient entity whose correlation is greater than the set correlation threshold as a similar patient entity.
[0206] The doctor entity determination module 605 can specifically determine the doctor entity corresponding to the patient entity by searching or predicting.
[0207] Accordingly, in a specific implementation of the doctor entity determination module 605, the doctor entity determination module 605 may include the following units:
[0208] A search unit, used to search for a doctor entity pointed to by a doctor embedding vector corresponding to the similar patient entity;
[0209] A second distance calculation unit, used for calculating the distance between each doctor entity and the pointed doctor entity;
[0210] The second selection unit is used to select doctor entities whose distance is greater than a set distance threshold as similar doctor entities.
[0211] In another specific implementation of the doctor entity determination module 605, the doctor entity determination module 605 may input the doctor embedding vector corresponding to the similar patient entity into a pre-established prediction model, and obtain a similar doctor entity according to the output of the prediction model.
[0212] It should be noted that there may be one or more similar doctor entities. In the case of only one similar doctor entity, the prediction result determination module 606 can generate a prediction result based on the similar doctor entity. In the case of multiple similar doctor entities, the prediction result determination module 606 can generate a prediction result based on these similar doctor entities. For example, the prediction result determination module 606 can generate a prediction result through the following units:
[0213] A possibility calculation unit, used for respectively calculating the possibility of each similar doctor entity when there are multiple similar doctor entities;
[0214] The prediction result generating unit is used to generate prediction results according to similar doctor entities in descending order of likelihood.
[0215] It should be noted that, in a specific implementation, the output module 607 may directly output the prediction result. For example, if the prediction result is "cold", the prediction result is directly output.
[0216] In another specific implementation, the output module 607 may also convert the prediction result into a natural language text, and then output the natural language text. Accordingly, the output module 607 may include: a text conversion unit and a text output unit; wherein:
[0217] The text conversion unit is used to convert the prediction result into a natural language text;
[0218] The text output unit is used to output the natural language text.
[0219] The text conversion unit may convert the prediction result into a natural language text in a variety of ways. For example, the text conversion unit may include: a template conversion unit or a model conversion unit; wherein:
[0220] The template conversion unit is used to fill the prediction result into the preset template to obtain a natural language text;
[0221] The model conversion unit is used to input the prediction result into a pre-established text conversion model, and obtain a natural language text according to the output of the text conversion model.
[0222] The medical knowledge graph query device provided by the embodiment of the present invention performs named entity extraction on the received user input information to obtain a user entity, and determines the embedding vector corresponding to the user entity, searches for similar patient entities in a pre-established medical knowledge graph based on the embedding vector corresponding to the user entity, determines similar doctor entities based on the doctor embedding vectors corresponding to the similar patient entities, generates prediction results based on the similar doctor entities, and outputs the prediction results. Since the medical knowledge graph can accurately describe the relationship between symptoms, diseases and diagnosis and treatment methods, more accurate disease prediction results can be obtained when querying using the medical knowledge graph; and query results can be obtained simply and quickly. Furthermore, converting the prediction results generated based on the similar doctor entities into natural language text output can make the query results provided to users more natural and in line with conversation habits.
[0223] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0224] It should be noted that the method and apparatus of the embodiments of the present invention can be applied to various terminal devices, such as mobile phones, computers, notebooks and other devices.
[0225] Figure 7 800 is a block diagram of a device for a medical knowledge graph query method according to an exemplary embodiment. For example, the device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0226] Reference Figure 7 , the device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .
[0227] The processing component 802 generally controls the overall operation of the device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0228] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0229] The power component 806 provides power to the various components of the device 800. The power component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 800.
[0230] The multimedia component 808 includes a screen that provides an output interface between the device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0231] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the device 800 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
[0232] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.
[0233] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the device 800, and the sensor assembly 814 can also detect the position change of the device 800 or a component of the device 800, the presence or absence of user contact with the device 800, the orientation or acceleration / deceleration of the device 800, and the temperature change of the device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0234] The communication component 816 is configured to facilitate wired or wireless communication between the device 800 and other devices. The device 800 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0235] In an exemplary embodiment, the apparatus 800 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above methods.
[0236] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by the processor 820 of the device 800 to complete the above-mentioned key mis-touch error correction method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0237] A non-temporary computer-readable storage medium, when the instructions in the storage medium are executed by the processor of a mobile terminal, enables the mobile terminal to execute a method for correcting accidental key presses, the method comprising: during the user input process, obtaining the pressing information when each key is triggered; determining the mistakenly triggered key based on the obtained pressing information; correcting the mistakenly triggered key; and determining each candidate word corresponding to the complete input string after correction.
[0238] Figure 8 1 is a schematic diagram of the structure of the server in an embodiment of the present invention. The server 1900 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 1922 (for example, one or more processors) and memory 1932, and one or more storage media 1930 (for example, one or more mass storage devices) storing application programs 1942 or data 1944. Among them, the memory 1932 and the storage medium 1930 can be short-term storage or permanent storage. The program stored in the storage medium 1930 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processing unit 1922 can be configured to communicate with the storage medium 1930 and execute a series of instruction operations in the storage medium 1930 on the server 1900.
[0239] The server 1900 may also include one or more power supplies 1926, one or more wired or wireless network interfaces 1950, one or more input and output interfaces 1958, one or more keyboards 1956, and / or, one or more operating systems 1941, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0240] A non-temporary computer-readable storage medium, when the instructions in the storage medium are executed by a processor of a device, enables the device to execute the above-mentioned key mis-touch correction method.
[0241] Those skilled in the art will readily appreciate other embodiments of the invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed in this disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.
[0242] It should be understood that the present invention is not limited to the precise structure described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
[0243] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for establishing a medical knowledge graph, characterized in that: The method comprises: Obtain a large amount of medical and patient-related data, and process each medical and patient-related data into patient data and doctor data; Performing named entity extraction on the patient data and the doctor data respectively to obtain a patient entity and a doctor entity; The patient embedding vector and the doctor embedding vector corresponding to each entity are determined by using a pre-established patient vector conversion model and a pre-established doctor vector conversion model respectively; the patient vector conversion model and the pre-established doctor vector conversion model are both neural network models; the patient vector conversion model and the pre-established doctor vector conversion model are established in the following manner: Collect multiple segments of doctor-patient related data, and use each segment of doctor-patient related data as a piece of training data; perform named entity extraction on each piece of training data to obtain patient entity samples and doctor entity samples; use the patient entity samples to train the patient vector conversion model, and use the doctor entity samples to train the doctor vector conversion model; Generate a medical knowledge graph according to the patient embedding vectors and doctor embedding vectors corresponding to each entity, and mark the entity category to which each entity belongs in the medical knowledge graph; the generating of the medical knowledge graph according to the patient embedding vectors and doctor embedding vectors corresponding to each entity includes: performing dimensionality reduction processing on the patient embedding vectors and doctor embedding vectors corresponding to each entity; and generating a visualized medical knowledge graph according to the embedding vectors after dimensionality reduction processing; Searching for similar patient entities in the medical knowledge graph according to the embedding vector corresponding to the user entity; Determining similar doctor entities according to the doctor embedding vectors corresponding to the similar patient entities; determining similar doctor entities according to the doctor embedding vectors corresponding to the similar patient entities comprises: Find the doctor entity pointed to by the doctor embedding vector corresponding to the similar patient entity; Calculate the distance between each doctor entity and the pointed doctor entity; The doctor entities whose distance is less than or equal to the set threshold are regarded as similar doctor entities; or, Inputting the doctor embedding vector corresponding to the similar patient entity into a pre-established prediction model, and obtaining a similar doctor entity according to the output of the prediction model; Generate a prediction result according to the similar doctor entity; generating the prediction result according to the similar doctor entity includes: if there are multiple similar doctor entities, respectively calculating the possibility of each similar doctor entity; generating a prediction result according to the similar doctor entities in descending order of possibility; The prediction result is output.
2. The method according to claim 1, characterized in that The method further comprises: Calculate correlations between different entities; The correlations between the different entities are recorded in the medical knowledge graph.
3. A medical knowledge graph query method, characterized in that: The method comprises: Receive user input information; Performing named entity extraction on the input information to obtain a user entity; Determining an embedding vector corresponding to the user entity; Searching for similar patient entities in a pre-established medical knowledge graph according to the embedding vector corresponding to the user entity; the medical knowledge graph is generated based on the method described in any one of claims 1-2; Determining similar doctor entities according to the doctor embedding vectors corresponding to the similar patient entities; determining similar doctor entities according to the doctor embedding vectors corresponding to the similar patient entities comprises: Find the doctor entity pointed to by the doctor embedding vector corresponding to the similar patient entity; Calculate the distance between each doctor entity and the pointed doctor entity; The doctor entities whose distance is less than or equal to the set threshold are regarded as similar doctor entities; or, Inputting the doctor embedding vector corresponding to the similar patient entity into a pre-established prediction model, and obtaining a similar doctor entity according to the output of the prediction model; Generate a prediction result according to the similar doctor entity; generating the prediction result according to the similar doctor entity includes: if there are multiple similar doctor entities, respectively calculating the possibility of each similar doctor entity; generating a prediction result according to the similar doctor entities in descending order of possibility; The prediction result is outputted.
4. The method according to claim 3, characterized in that The searching for similar patient entities in a pre-established medical knowledge graph according to the embedding vector corresponding to the user entity includes: Obtaining a patient embedding vector corresponding to each patient entity in the medical knowledge graph; Calculate the distance between the patient embedding vector corresponding to each patient entity and the embedding vector corresponding to the user entity respectively; The patient entity with the closest distance is regarded as a similar patient entity.
5. The method according to claim 3, characterized in that: The outputting the prediction result comprises: Converting the prediction result into natural language text; The natural language text is output.
6. The method according to claim 5, characterized in that The converting the prediction result into natural language text comprises: Filling the prediction result into a preset template to obtain a natural language text; or The prediction result is input into a pre-established text conversion model, and a natural language text is obtained according to the output of the text conversion model.
7. A medical knowledge graph establishment device, characterized in that: The device comprises: The data collection module is used to obtain a large amount of doctor-patient related data and process each doctor-patient related data into patient data and doctor data; An entity extraction module, used to extract named entities from the patient data and the doctor data respectively to obtain patient entities and doctor entities; A vector conversion module, used to determine the patient embedding vector and the doctor embedding vector corresponding to each entity by using a pre-established patient vector conversion model and a pre-established doctor vector conversion model respectively; the patient vector conversion model and the pre-established doctor vector conversion model are both neural network models; A model building module, used to build the patient vector conversion model and the doctor vector conversion model; the model building module includes: a training data collection unit, used to collect multiple segments of doctor-patient related data, and use each segment of doctor-patient related data as a piece of training data; an entity extraction unit, used to perform named entity extraction on each piece of training data to obtain patient entity samples and doctor entity samples; a training unit, used to train the patient vector conversion model using the patient entity samples, and to train the doctor vector conversion model using the doctor entity samples; A graph generation module, used to generate a medical knowledge graph according to the patient embedding vector and the doctor embedding vector corresponding to each entity, and mark the entity category to which each entity belongs in the medical knowledge graph; A dimensionality reduction processing module, used for performing dimensionality reduction processing on the patient embedding vector and the doctor embedding vector corresponding to each entity; The view generation module is used to generate a visual medical knowledge graph based on the embedded vector after dimensionality reduction; A graph query module, used to search for similar patient entities in the medical knowledge graph according to the embedding vector corresponding to the user entity; Determining similar doctor entities according to the doctor embedding vectors corresponding to the similar patient entities; determining similar doctor entities according to the doctor embedding vectors corresponding to the similar patient entities comprises: Find the doctor entity pointed to by the doctor embedding vector corresponding to the similar patient entity; Calculate the distance between each doctor entity and the pointed doctor entity; The doctor entities whose distance is less than or equal to the set threshold are regarded as similar doctor entities; or, Inputting the doctor embedding vector corresponding to the similar patient entity into a pre-established prediction model, and obtaining a similar doctor entity according to the output of the prediction model; Generate a prediction result according to the similar doctor entity; generating the prediction result according to the similar doctor entity includes: if there are multiple similar doctor entities, respectively calculating the possibility of each similar doctor entity; generating a prediction result according to the similar doctor entities in descending order of possibility; The prediction result is output.
8. The device according to claim 7, characterized in that The device comprises: A correlation calculation module, used to calculate the correlation between different entities; A recording module is used to record the correlation between the different entities in the medical knowledge graph.
9. A medical knowledge graph query device, characterized in that: The device comprises: A receiving module, used for receiving user input information; A user entity extraction module, used to extract named entities from the input information to obtain user entities; A vector calculation module, used to determine the embedding vector corresponding to the user entity; An entity search module, used to search for similar patient entities in a pre-established medical knowledge graph according to the embedding vector corresponding to the user entity; the medical knowledge graph is generated based on the device according to any one of claims 7-8; A doctor entity determination module is used to determine similar doctor entities according to the doctor embedding vectors corresponding to the similar patient entities; the doctor entity determination module includes: A search unit, used to search for the doctor entity pointed to by the doctor embedding vector corresponding to the similar patient entity; a second distance calculation unit, used to calculate the distance between each doctor entity and the pointed doctor entity; a second selection unit, used to take the doctor entity whose distance is less than or equal to a set threshold as a similar doctor entity; or the doctor entity determination module, specifically used to input the doctor embedding vector corresponding to the similar patient entity into a pre-established prediction model, and obtain a similar doctor entity according to the output of the prediction model; A prediction result determination module, used to generate a prediction result according to the similar doctor entity; the prediction result determination module includes: a possibility calculation unit, used to calculate the possibility of each similar doctor entity respectively when there are multiple similar doctor entities; a prediction result generation unit, used to generate a prediction result according to the similar doctor entities with the possibility from high to low; An output module is used to output the prediction result.
10. The device according to claim 9, characterized in that The entity search module includes: A vector acquisition unit, used to acquire a patient embedding vector corresponding to each patient entity in the medical knowledge graph; A first distance calculation unit, used to respectively calculate the distance between the patient embedding vector corresponding to each patient entity and the embedding vector corresponding to the user entity; The first selection unit is used to select the patient entity with the closest distance as the similar patient entity.
11. The device according to claim 10, characterized in that The output module comprises: A text conversion unit, used for converting the prediction result into a natural language text; A text output unit is used to output the natural language text.
12. The device according to claim 11, characterized in that The text conversion unit comprises: A template conversion unit, used to fill the prediction result into a preset template to obtain a natural language text; or The model conversion unit is used to input the prediction result into a pre-established text conversion model and obtain natural language text according to the output of the text conversion model.
13. A computer device, characterized in that: include: One or more processors, memory; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the method according to any one of claims 1 to 6.
14. A readable storage medium having instructions stored thereon, wherein the instructions are executed to implement the method according to any one of claims 1 to 6.
