Multi-drug-resistant bacterium knowledge question-answering method and system based on medical knowledge graph
Through the multidrug-resistant bacteria knowledge question-and-answer method based on medical knowledge graph and large language learning model, the problem of integrating and updating multidrug-resistant bacteria treatment information is solved, and the structured integration and synchronous update of information is realized, providing convenience for medical professionals. The query service improves the accuracy of treatment decisions.
Patent Information
- Application Number
- CN202411027102.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-07-30
AI Technical Summary
Treatment of multidrug-resistant bacterial infections has become difficult, with dispersed medical information and lack of integration and sharing mechanisms, making it difficult for medical professionals to obtain comprehensive and up-to-date treatment information.
The multi-drug-resistant bacteria knowledge question-and-answer knowledge method based on medical knowledge graphs is adopted, and combined with the large language learning model, the multi-drug-resistant bacteria knowledge graph and database are constructed to realize the structured integration and synchronous update of information, and provide natural language interaction query services.
Provide comprehensive and systematic decision-making support to clinical medical staff, reduce the cognitive burden on knowledge mastery and application, and assist in making accurate prevention, diagnosis and treatment choices.
Smart Images

Figure CN118964565A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of medical health technology, and in particular to a multi-drug resistant bacteria knowledge question and answer method and system based on a medical knowledge graph. Background Art
[0002] Multidrug-resistant organisms (MDRO) infections have become a major challenge facing global public health. Due to the rapid spread of resistant strains and the irrational use of antibiotics, the treatment of multidrug-resistant infections has become increasingly difficult. At present, medical professionals need to rely on the latest research results and clinical experience to develop effective treatment plans, which places high demands on the professional knowledge and information acquisition capabilities of medical personnel. However, medical information is scattered in different medical institutions and systems, and there is a lack of effective integration and sharing mechanisms, making it difficult for medical professionals to obtain comprehensive and up-to-date treatment information. In addition, medical knowledge is updated rapidly, but clinicians and researchers have limited ways to obtain new knowledge under traditional methods, and it is difficult to keep up with the latest research results in a timely manner. Therefore, clinical medical staff are limited by their ability to diagnose bacterial infections, their knowledge level, and their empirical medication level, and cannot make effective clinical decisions and promote actual clinical practice.
[0003] With the rapid development of cutting-edge technologies such as 5G communications, the Internet of Things, and artificial intelligence, it has become possible to build an intelligent question-and-answer system for disease knowledge based on existing medical knowledge information. However, existing technologies still face the problem of lack of the latest treatment knowledge for multidrug-resistant bacteria. Summary of the invention
[0004] In order to solve the above technical problems, the purpose of the present invention is to provide a multidrug-resistant bacteria knowledge question and answer method and system based on medical knowledge graph, which can combine medical knowledge graph technology with large language learning model to provide a more efficient and accurate multidrug-resistant bacteria prevention and control plan.
[0005] The first technical solution adopted by the present invention is: a multi-drug resistant bacteria knowledge question and answer method based on a medical knowledge graph, comprising the following steps:
[0006] Constructing original multidrug-resistant bacteria data files;
[0007] Based on the multidrug-resistant bacteria relationship extraction model, knowledge relationships are extracted from the original multidrug-resistant bacteria data document to obtain a multidrug-resistant bacteria knowledge graph;
[0008] Constructing a general large language learning model, taking the multidrug-resistant bacteria knowledge graph and structured text information as input, and generating a local multidrug-resistant bacteria knowledge document;
[0009] The general large language learning model is trained based on the multidrug-resistant bacteria knowledge graph to obtain a multidrug-resistant bacteria large language learning model;
[0010] Building a local multidrug-resistant bacteria database based on the local multidrug-resistant bacteria knowledge document;
[0011] Searching the local multi-drug resistant bacteria database based on the user query information to obtain knowledge information;
[0012] First prompt information is constructed based on the knowledge information and user query information, and the first prompt information is input into the multi-drug resistant bacteria large language learning model to output answer information.
[0013] Furthermore, the multi-drug resistant bacteria relationship extraction model includes an input layer, an input representation layer, a named entity recognition layer, a classifier layer and an output layer.
[0014] Furthermore, the step of extracting knowledge relationships from the original multidrug-resistant bacteria data document based on the multidrug-resistant bacteria relationship extraction model to obtain a multidrug-resistant bacteria knowledge graph specifically includes:
[0015] Performing text preprocessing on the original multi-drug resistant bacteria data document to obtain the structured text information and unstructured text information;
[0016] Inputting the unstructured text information into an input representation layer for semantic enrichment to obtain a dynamic word vector;
[0017] Inputting the dynamic word vector into a named entity recognition layer for entity recognition to obtain a recognized entity;
[0018] The identified entities are input into the classifier layer, and the relationship between the identified entities is predicted based on the context information of the identified entities to obtain the triple relationship pairs of multi-drug resistant bacteria;
[0019] A knowledge graph of multidrug-resistant bacteria is constructed based on the triple relationship pairs of multidrug-resistant bacteria.
[0020] Furthermore, the step of constructing a universal large language learning model, taking the multidrug-resistant bacteria knowledge graph and structured text information as input, and generating a local multidrug-resistant bacteria knowledge document specifically includes:
[0021] Prompt presets are performed on the multi-drug resistant bacteria knowledge graph and the structured text information respectively to obtain second prompt information;
[0022] The second prompt information is generated into text based on the general large language learning model to obtain the local multidrug-resistant bacteria knowledge document.
[0023] Furthermore, the step of training the universal large language learning model based on the multidrug-resistant bacteria knowledge graph to obtain the multidrug-resistant bacteria large language learning model specifically includes:
[0024] Presetting prompts for the triple relationship pairs of the multi-drug resistant bacteria knowledge graph to obtain third prompt information;
[0025] Generating text for the third prompt information based on a universal large language learning model to obtain a multi-drug resistant bacteria question and answer data pair;
[0026] The multidrug-resistant bacteria question-answer data pairs are used as training data to fine-tune the general large language learning model to obtain a multidrug-resistant bacteria large language learning model.
[0027] Furthermore, the step of constructing a local multidrug-resistant bacteria database based on the local multidrug-resistant bacteria knowledge document specifically includes:
[0028] Extracting content from the local multidrug-resistant bacteria knowledge document to obtain multidrug-resistant bacteria text content;
[0029] Performing text segmentation on the multidrug-resistant bacteria text content to obtain multidrug-resistant bacteria text sentences;
[0030] Constructing a query document based on the multidrug-resistant bacteria text sentence;
[0031] Performing text conversion on the query document based on a vector model to obtain a text vector;
[0032] Creating an index based on the text vector to obtain a text index;
[0033] The text vector and the text index are stored in a local database to obtain a local multi-drug resistant bacteria database.
[0034] Furthermore, the step of searching the local multi-drug resistant bacteria database based on the user query information to obtain knowledge information specifically includes:
[0035] Based on the vector model, the user query information is vectorized to obtain the question query vector;
[0036] Based on the question query vector, relevant text indexes are searched in the local multi-drug resistant bacteria database to obtain knowledge information.
[0037] The second technical solution adopted by the present invention is: a multi-drug resistant bacteria knowledge question and answer system based on medical knowledge graph, comprising:
[0038] The original data collection module is used to construct the original multi-drug resistant bacteria data document;
[0039] A multidrug-resistant bacteria relationship extraction module is used to extract knowledge relationships from the original multidrug-resistant bacteria data document to obtain a multidrug-resistant bacteria knowledge graph;
[0040] A general large language learning model, taking the multidrug-resistant bacteria knowledge graph and structured text information as input, generates a local multidrug-resistant bacteria knowledge document;
[0041] A model training module, which trains the general large language learning model based on the multidrug-resistant bacteria knowledge graph to obtain a multidrug-resistant bacteria large language learning model;
[0042] A local database construction module, which constructs a local multidrug-resistant bacteria database based on the local multidrug-resistant bacteria knowledge document;
[0043] A search module, searching the local multi-drug resistant bacteria database based on user query information to obtain knowledge information;
[0044] The answer output module constructs first prompt information based on the knowledge information and user query information, inputs the first prompt information into the multi-drug resistant bacteria large language learning model, and outputs answer information.
[0045] The beneficial effects of the method and system of the present invention are as follows: the method of the present invention constructs a medical map of multidrug-resistant bacteria to structure and integrate discrete medical information, form an interoperable and shared knowledge network, and provide comprehensive and systematic decision-making support for clinical medical staff; constructs a local multidrug-resistant bacteria knowledge base document based on the medical map of multidrug-resistant bacteria, realizes the synchronous updating of medical knowledge information, and keeps it consistent with the latest research results and clinical data; combines the advantages of medical knowledge map and large language learning model, so that medical staff can use natural language to interact with the system, and conveniently query key information such as the causes of multidrug-resistant bacteria, susceptible populations, treatment plans and their theoretical basis, thereby reducing the cognitive burden of medical staff in knowledge mastery and application, and assisting medical staff in making more accurate and effective clinical treatment choices in the prevention, diagnosis and treatment of multidrug-resistant bacteria. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 It is a flowchart of the steps of a multi-drug resistant bacteria knowledge question and answer method based on a medical knowledge graph of the present invention;
[0047] Figure 2 It is a structural block diagram of a multi-drug resistant bacteria knowledge question and answer system based on a medical knowledge graph of the present invention;
[0048] Figure 3 This is a schematic flow chart of a multi-drug resistant bacteria knowledge question and answer method based on medical knowledge graph of the present invention.
[0049] Figure 4 This is a flowchart of constructing a local multidrug-resistant bacteria knowledge document of a multidrug-resistant bacteria knowledge question-answering method based on a medical knowledge graph of the present invention.
[0050] Figure 5 It is a schematic diagram of the structure of a multi-drug-resistant bacteria relationship extraction model of a multi-drug-resistant bacteria knowledge question-answering method based on a medical knowledge graph of the present invention;
[0051] Figure 6 It is a schematic diagram of the structure of a general large language learning model of a multi-drug resistant bacteria knowledge question-answering method based on a medical knowledge graph of the present invention;
[0052] Figure 7 It is a general large language learning model training flow chart of a multi-drug resistant bacteria knowledge question-answering method based on a medical knowledge graph of the present invention;
[0053] Figure 8 It is a flow chart for constructing a local multidrug-resistant bacteria database of a multidrug-resistant bacteria knowledge question-answering method based on a medical knowledge graph of the present invention. DETAILED DESCRIPTION
[0054] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. The step numbers in the following embodiments are only provided for the convenience of explanation and description, and the order between the steps is not limited in any way. The execution order of each step in the embodiment can be adaptively adjusted according to the understanding of those skilled in the art.
[0055] Reference Figure 1 and Figure 3 The present invention provides a multi-drug resistant bacteria knowledge question-answering method based on a medical knowledge graph, the method comprising the following steps:
[0056] S1. Construct the original multi-drug resistant bacteria data file;
[0057] Specifically, the original multidrug-resistant bacteria data documents include but are not limited to clinical guidelines, academic papers, case reports, etc. These documents may exist in a variety of file formats, such as doc, pdf, txt, etc., and they are the cornerstone of building a multidrug-resistant bacteria knowledge graph.
[0058] S2. Extracting knowledge relationships from the original multidrug-resistant bacteria data document based on a multidrug-resistant bacteria relationship extraction model to obtain a multidrug-resistant bacteria knowledge graph;
[0059] Specifically, refer to Figure 5 The multi-drug resistant bacteria relationship extraction model includes an input layer, an input representation layer, a named entity recognition layer, a classifier layer and an output layer.
[0060] The input layer is the starting point of the entire multi-drug resistant bacteria relationship extraction model, and is responsible for receiving the text data to be processed. In the multi-drug resistant bacteria relationship extraction model, these text data include medical literature, clinical reports, medical records, etc., and the text data contains information about multi-drug resistant bacteria.
[0061] S2.1. Performing text preprocessing on the original multi-drug resistant bacteria data document to obtain the structured text information and unstructured text information;
[0062] Specifically, refer to Figure 4 , using OCR technology and NLP text extraction algorithm, extract text information from the structured data and unstructured data in the original multi-drug resistant bacteria data document to obtain structured text information and unstructured text information. In the process of extracting text information, the original multi-drug resistant bacteria data document is also pre-processed, including steps such as removing noise, unifying the format and correcting the language of the original multi-drug resistant bacteria data document to improve data quality.
[0063] S2.2, inputting the unstructured text information into the input representation layer for semantic enrichment to obtain a dynamic word vector;
[0064] Specifically, the input representation layer is mainly used to process the input multidrug-resistant bacteria text. The input representation layer of the specific embodiment of the present invention adopts the BERT model. The BERT model can generate dynamic word vectors to understand the complex context in the multidrug-resistant bacteria text, and obtain the deep semantic information of the multidrug-resistant bacteria text to solve the polysemy problem. For the professional vocabulary in the medical field in the multidrug-resistant bacteria text, the BERT model can obtain richer semantic representations and enhance the ability of the multidrug-resistant bacteria relationship extraction model to capture the characteristics of the multidrug-resistant bacteria text. The BERT model uses NLP word segmentation technology to add "[CLS]" classification marks and "[SEP]" segmentation marks at the beginning and end of the text information sequence X, respectively. The text information sequence X with a fixed length of n is expressed as follows:
[0065] X=(x1,x2,…,x n )
[0066] x1=CLS
[0067] x n =SEP
[0068] Among them, x n Represents the nth text entered.
[0069] The BERT model outputs a fixed-length text information sequence vector, which is expressed as follows:
[0070] V e =BERT(x1,x2,…,xn)=(e1,e2,…,e n )
[0071] Among them, V e Represents the text sequence vector output by the BERT model; e nThe mapping value corresponding to the nth text input.
[0072] When the length of the input text information sequence does not reach the fixed length of the BERT model, the output of the BERT model will be filled with blanks.
[0073] S2.3, inputting the dynamic word vector into the named entity recognition layer for entity recognition to obtain a recognized entity;
[0074] Specifically, the named entity recognition layer is mainly responsible for identifying medical entities with specific meanings from the input dynamic word vector, such as MDRO names, treatment names, susceptible populations, etc. The named entity recognition layer adopts the idea of global pointers. Assuming that the input sequence X of length n has only one multidrug-resistant bacteria entity to be identified, and each multidrug-resistant bacteria entity to be identified is a subsequence of sequence X, and can be nested with each other (that is, the entity parts overlap). In this case, the input sequence X of length n has different candidate entity fragments, thereby converting the multidrug-resistant bacteria entity recognition problem into A multi-label classification problem of selecting k multidrug-resistant bacteria entities from different candidate entity fragments.
[0075] Furthermore, if the input sequence X has m types of multidrug-resistant bacteria entities that need to be identified, a classification header can be created separately for each type of multidrug-resistant bacteria entity.
[0076] The above process can be modeled as a dynamic word vector V e Perform linear transformation to obtain the sequence head vector and sequence tail vector, which are expressed as follows:
[0077] p i,α =w p,α e i +b p,α
[0078] q i,α =w q,α e i +b q,α
[0079] P=(p 1,α ,p 2,α ,…,p n,α )
[0080] Q=(q 1,α ,q 2,α ,…,q n,α )
[0081] α∈{1,2,…,m}
[0082] Among them, p i,αrepresents the probability that the i-th position of the sequence is the header vector of the α-th entity; q i,α represents the tail vector probability that the i-th position of the sequence is the α-th type entity; e i Indicates the mapping value corresponding to the i-th text input; w p,α represents the weight parameter of the αth entity in the sequence header vector; w q,α represents the weight parameter of the αth entity in the tail vector of the sequence; b p,α represents the bias parameter of the αth entity in the sequence header vector; b q,α represents the bias parameter of the αth entity in the tail vector of the sequence; α represents the αth multidrug-resistant bacteria entity; m represents the number of entity types; P represents the sequence header vector; Q represents the sequence tail vector.
[0083] Based on the first and last vectors, we can define the continuous segment X [i:j] The entity category is a fractional value of α, which is expressed as follows:
[0084]
[0085] i∈{1,2,…,n}
[0086] j∈{1,2,…,n}
[0087] Among them, s α (i, j) represents the score value of the entity category of the continuous segment from i to j.
[0088] In order to enhance the recognition effect of multi-drug resistant bacteria entities, the model also uses position encoding on the basis of the original linear transformation to enhance the information that can be obtained at each position, that is, adding the transformation matrix R to the sequence head vector and the sequence tail vector i ,get:
[0089]
[0090]
[0091] Among them, R j-i Represents the transformation matrix from position i to j; R j represents the change matrix of the j-position offset; q j,α It represents the tail vector probability that the j-th position of the sequence is the α-th type entity.
[0092] So for each score value s α (i,j) can explicitly contain relative information about other positions. α (i,j) can be calculated in parallel, and ideally can achieve a time complexity close to O(1).
[0093] S2.4, inputting the identified entities into the classifier layer, and predicting the relationship between the identified entities in combination with the context information of the identified entities, to obtain the triple relationship pairs of multi-drug resistant bacteria;
[0094] Specifically, the classifier layer is the decision-making part of the relationship extraction model, which predicts the relationship between multi-drug resistant bacteria entities based on the identified entities and their contextual information. In the specific embodiment of the present invention, a convolutional neural network is used to classify and predict entity relationships. Considering the score value s obtained in step S2.3 α (i,j) is a The classification problem of candidate entities may cause serious class imbalance. In order to better achieve the multi-drug resistant bacteria entity recognition and classification effect, the specific embodiment of the present invention uses the generalized form of "softmax+cross entropy", and its loss function is defined as follows:
[0095]
[0096] Ω={(i,j)|1≤i≤j≤n}
[0097] U α ={(i,j)|type(X [ i :j] )∈α}
[0098] V α =Ω-U α
[0099] Where (i, j) represents the candidate entity segment X [i:j] ; U α Represents the positive sample label, which is the head and tail set of all entity categories α in the sample; V α Represents the negative sample label, which is the head and tail set of all entity categories in the sample that are not α; Ω represents the entire sample set.
[0100] The above loss function does not have the phenomenon of class imbalance, because it does not turn multi-label classification into multiple binary classification problems, but turns it into a pairwise comparison of the target category score and the non-target category score, and uses the exponential and function to find the logarithmic form, automatically balancing the weight of each item.
[0101] After entities and relations are identified, the model generates a series of triple-relation pairs (s i ,e i1 ,o i ,e i2 ,r i ), where s i represents the subject of the triple, e i1 The entity type representing the subject, oi represents the object of the triple, e i2 The entity type representing the object, r i Represents the relationship between entities.
[0102] S2.5. Construct a knowledge graph of multidrug-resistant bacteria based on the triple relationship pairs of multidrug-resistant bacteria.
[0103] S3, constructing a general large language learning model, taking the multidrug-resistant bacteria knowledge graph and structured text information as input, and generating a local multidrug-resistant bacteria knowledge document;
[0104] Specifically, refer to Figure 4 First, through the multidrug-resistant bacteria relationship extraction model, the structured multidrug-resistant bacteria triple relationship pairs are extracted from the unstructured multidrug-resistant bacteria text, and then the local multidrug-resistant bacteria knowledge document is efficiently generated by building a universal large language learning model. The whole process can be realized intelligently and automatically. The structured text information is the high-quality multidrug-resistant bacteria triple relationship pairs manually annotated by clinical medical staff.
[0105] S3.1. Presetting prompts for the multidrug-resistant bacteria knowledge graph and the structured text information respectively to obtain second prompt information;
[0106] Specifically, the second prompt information is "Assuming that you are a professional medical staff, according to the input multi-drug resistant bacteria triple relationship pair (s i ,e i1 ,o i ,e i2 ,r i ), where s i represents the subject of the triple, e i1 The entity type representing the subject, o i represents the object of the triple, e i2 The entity type representing the object, r i Indicates the relationship between entities. Generate a paragraph to describe the triple relationship professionally. Abbreviations are not allowed. ”
[0107] S3.2. Generate text for the second prompt information based on the general large language learning model to obtain a local multidrug-resistant bacteria knowledge document.
[0108] Specifically, refer to Figure 6 The general large language learning model of the specific embodiment of the present invention is based on the Transformer architecture. The general large language learning model integrates the self-attention mechanism and the feedforward neural network to achieve deep language understanding.
[0109] When text data is input into the model, it is first fed into the word embedding layer, which is a large-scale embedding matrix with dimensions (130528, 4096). This layer is responsible for converting each word in the vocabulary into its 4096-dimensional numerical representation, providing the model with a raw, parseable form of text. The input data then flows through a list of 28 identical GLMBlock modules, which are responsible for further processing and transformation of the word embedding output. Each GLMBlock contains an input layer normalization (Input LayerNorm), a self-attention module (SelfAttention), a post-attention normalization module (Post-Attention LayerNorm) and a feed-forward network (Feed-ForwardNetwork), where;
[0110] The input layer normalization is used to normalize the input data at the beginning of each processing layer, which helps to maintain the stability of model training and accelerate the convergence speed.
[0111] The self-attention module is the core feature of the Transformer architecture. The self-attention mechanism enables the model to consider all other words in the text sequence when processing any word. The self-attention module contains rotation embedding (Rotary Embedding); query, key, value (Query, Key, Value); dense connection layer (Dense); where:
[0112] The rotation embedding is an innovative position encoding method that effectively encodes position information into the self-attention mechanism.
[0113] The query, key, and value elements are derived from the input vector through linear transformations and are used to calculate attention weights and integrate information from other words.
[0114] The densely connected layer further processes the output of the self-attention mechanism to form the final self-attention result.
[0115] The post-self-attention layer normalization module means that after the self-attention processing, the data is again normalized to prepare for entering the next layer.
[0116] The feedforward network is located after the self-attention mechanism and contains a gated linear unit (GLU) for further processing and feature extraction of the data.
[0117] After continuous processing of all GLMBlock layers, the output of the general large language learning model will be normalized by the final layer (Final LayerNorm). This step ensures the overall stability of the output of the general large language learning model. After that, the data is sent to the general large language learning model head (LM Head), which is a linear transformation layer responsible for converting the output of the model into the probability distribution of the next word. Finally, the general large language learning model selects the word with the highest probability as the next output in the sequence based on this probability distribution, thereby realizing the generation of text and obtaining a local multidrug-resistant bacteria knowledge document.
[0118] S4. Training the general large language learning model based on the multidrug-resistant bacteria knowledge graph to obtain a multidrug-resistant bacteria large language learning model;
[0119] S.4.1. Preset the prompt for the triple relationship pair of the multi-drug resistant bacteria knowledge graph to obtain the third prompt information
[0120] Specifically, refer to Figure 7 The specific embodiment of the present invention uses the constructed multidrug-resistant bacteria knowledge graph to collaboratively train and generate a multidrug-resistant bacteria large language learning model. The core is to convert the triple relationship pairs in the multidrug-resistant bacteria knowledge graph into multidrug-resistant bacteria question-answer data pairs. The third prompt information is "Assuming that you are a professional medical staff, according to the input multidrug-resistant bacteria triple relationship pair (s i ,e i1 ,o i ,e i2 ,r i ), where s i represents the subject of the triple, e i1 The entity type representing the subject, o i represents the object of the triple, e i2 The entity type representing the object, r i Indicates the relationship between entities. Generate 5 question-answer pairs for the triple. The question and answer must be closely related to the triple. Expansion is prohibited. "
[0121] S4.2. Generating text for the third prompt information based on a universal large language learning model to obtain a multidrug-resistant bacteria question-answer data pair;
[0122] Specifically, the universal large language learning model can convert the triple relationship pairs into multi-drug resistant bacteria question and answer data pairs according to the third prompt information.
[0123] S4.3. Use the multidrug-resistant bacteria question-answer data pairs as training data to fine-tune the general large language learning model to obtain a multidrug-resistant bacteria large language learning model.
[0124] Specifically, the multidrug-resistant bacteria question-answer data pairs will be used as part of the training data to help the general large language learning model learn how to answer questions related to multidrug-resistant bacteria. The general large language learning model has been pre-trained on a wide range of text data and has the basic ability of language understanding and generation. Then the general large language learning model is fine-tuned using the generated multidrug-resistant bacteria question-answer data pairs and possible other related medical data. The fine-tuning process involves further training the model on specific tasks to make it more suitable for the medical field related to multidrug-resistant bacteria. After fine-tuning, the general large language learning model is transformed into a large language learning model specifically for multidrug-resistant bacteria. The multidrug-resistant bacteria large language learning model can more accurately understand and generate information related to multidrug-resistant bacteria. On the basis of fine-tuning, further training is required to optimize the performance of the model. This includes adjusting the model's hyperparameters, improving the training strategy, etc. After the optimization is completed, the multidrug-resistant bacteria large language learning model is deployed to the entire system to provide multidrug-resistant bacteria related question-answering services. In general, the training process of the multidrug-resistant bacteria large language learning model is a systematic process involving multiple steps such as data preparation, model selection, fine-tuning, training, evaluation and optimization, and can be trained in a dynamic cycle. Through this process, the system can train a model that can accurately understand and answer questions related to multidrug-resistant bacteria, providing high-quality consulting services for medical professionals and patients.
[0125] S5. Building a local multidrug-resistant bacteria database based on the local multidrug-resistant bacteria knowledge document;
[0126] S5.1. Extracting the content of the local multidrug-resistant bacteria knowledge document to obtain the multidrug-resistant bacteria text content;
[0127] Specifically, refer to Figure 8 , extracting MDRB text-related content from local MDRB knowledge documents in various file formats.
[0128] S5.2, segmenting the multidrug-resistant bacteria text content to obtain multidrug-resistant bacteria text sentences;
[0129] Specifically, the extracted multidrug-resistant bacteria text content is broken down into smaller units, such as a sentence or paragraph, through text segmentation technology. This step helps to organize the multidrug-resistant bacteria knowledge information into a format that is easy to process and retrieve.
[0130] S5.3, constructing a query document based on the multidrug-resistant bacteria text sentence;
[0131] Specifically, the segmented multi-drug resistant bacteria text sentences are further constructed into query documents, which will be used in the retrieval process of the question answering system. Constructing query documents includes annotating keywords, concepts, and entities.
[0132] S5.4, performing text conversion on the query document based on a vector model to obtain a text vector;
[0133] Specifically, converting the query document into a text vector can capture the semantic information of the text. The selection of the vectorization model is crucial for subsequent retrieval and analysis. In this step, the specific embodiment of the present invention selects a suitable vectorization model M3E to convert the text into a high-quality vector representation.
[0134] S5.5. Create an index based on the text vector to obtain a text index;
[0135] Specifically, the generated text vectors are used to create indexes, which helps to optimize the response time of querying MDRO-related knowledge information and improve retrieval efficiency.
[0136] S5.6. Store the text vector and the text index in a local database to obtain a local multi-drug resistant bacteria database.
[0137] Specifically, a suitable database storage solution is selected to store the vectorized text and index. The specific embodiment of the present invention uses vector databases Qdrant and Qdrant specifically for storing and retrieving vector data. Such vector databases are suitable for many applications, such as similarity search, recommendation system, natural language processing, etc. The data in the database is represented in vector form. After the local multidrug-resistant bacteria database is built, if the local multidrug-resistant bacteria knowledge document is to be updated, the local multidrug-resistant bacteria database can be synchronized.
[0138] S6. Searching the local multi-drug resistant bacteria database based on the user query information to obtain knowledge information;
[0139] S6.1. Textually vectorize the user query information based on the vector model to obtain a question query vector;
[0140] Specifically, the vectorization model in step S5.4 is used to convert the query information input by the user into a question query vector.
[0141] S6.2. Search for relevant text indexes in the local multi-drug resistant bacteria database based on the question query vector to obtain knowledge information.
[0142] Specifically, the relevant multidrug-resistant bacteria medical knowledge is searched in the local multidrug-resistant bacteria database according to the question query vector. The search method is to search the index and return the top K most relevant knowledge information. The expression is as follows:
[0143] Context = concat[q1,q2,…,q k ]
[0144] Among them, Context represents knowledge information; q k Represents the kth piece of knowledge information.
[0145] S7. Construct first prompt information based on the knowledge information and the user query information, input the first prompt information into the multidrug-resistant bacteria large language learning model, and output answer information.
[0146] Specifically, the first prompt information is "The known knowledge information is Context. Based on the above knowledge information, answer the user's question concisely and professionally. If you cannot get the answer from it, please say "The question cannot be answered based on the knowledge base information" or "Not enough relevant information is provided." It is not allowed to add fabricated elements to the answer. When the answer involves literature, cite and annotate it according to the format of the literature. Please use Chinese for the answer. The question is a query vector Query"; then the first prompt information is input into the multidrug-resistant bacteria large language learning model, and the multidrug-resistant bacteria large language learning model generates a comprehensive and systematic answer based on the multidrug-resistant bacteria knowledge graph and the information in the local multidrug-resistant bacteria database.
[0147] Finally, in a specific embodiment of the present invention, the system will continue to collect new multidrug-resistant bacteria medical data and feedback from clinical medical staff, and continuously optimize its performance and knowledge base through iterative training.
[0148] Reference Figure 2 The present invention provides a multi-drug resistant bacteria knowledge question-answering system based on medical knowledge graph, comprising:
[0149] The original data collection module is used to construct the original multi-drug resistant bacteria data document;
[0150] A multidrug-resistant bacteria relationship extraction module is used to extract knowledge relationships from the original multidrug-resistant bacteria data document to obtain a multidrug-resistant bacteria knowledge graph;
[0151] A general large language learning model, taking the multidrug-resistant bacteria knowledge graph and structured text information as input, generates a local multidrug-resistant bacteria knowledge document;
[0152] A model training module, which trains the general large language learning model based on the multidrug-resistant bacteria knowledge graph to obtain a multidrug-resistant bacteria large language learning model;
[0153] A local database construction module, which constructs a local multidrug-resistant bacteria database based on the local multidrug-resistant bacteria knowledge document;
[0154] A search module, searching the local multi-drug resistant bacteria database based on user query information to obtain knowledge information;
[0155] The answer output module constructs first prompt information based on the knowledge information and user query information, inputs the first prompt information into the multi-drug resistant bacteria large language learning model, and outputs answer information.
[0156] The contents of the above method embodiments are all applicable to the present system embodiments. The functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0157] The above is a specific description of the preferred implementation of the present invention, but the invention is not limited to the embodiments. Those skilled in the art may make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of this application.
Claims
1. A multi-drug resistant bacteria knowledge question-answering method based on medical knowledge graph, characterized in that: The following steps are involved: Constructing original multidrug-resistant bacteria data files; Based on the multidrug-resistant bacteria relationship extraction model, knowledge relationships are extracted from the original multidrug-resistant bacteria data document to obtain a multidrug-resistant bacteria knowledge graph; Constructing a general large language learning model, taking the multidrug-resistant bacteria knowledge graph and structured text information as input, and generating a local multidrug-resistant bacteria knowledge document; The general large language learning model is trained based on the multidrug-resistant bacteria knowledge graph to obtain a multidrug-resistant bacteria large language learning model; Building a local multidrug-resistant bacteria database based on the local multidrug-resistant bacteria knowledge document; Searching the local multi-drug resistant bacteria database based on the user query information to obtain knowledge information; First prompt information is constructed based on the knowledge information and user query information, and the first prompt information is input into the multi-drug resistant bacteria large language learning model to output answer information.
2. According to claim 1, a multi-drug resistant bacteria knowledge question-answering method based on medical knowledge graph is characterized in that: The multi-drug resistant bacteria relationship extraction model includes an input layer, an input representation layer, a named entity recognition layer, a classifier layer and an output layer.
3. According to claim 2, a multi-drug resistant bacteria knowledge question and answer method based on medical knowledge graph is characterized in that: The step of extracting knowledge relationships from the original multidrug-resistant bacteria data document based on the multidrug-resistant bacteria relationship extraction model to obtain a multidrug-resistant bacteria knowledge graph specifically includes: Performing text preprocessing on the original multi-drug resistant bacteria data document to obtain the structured text information and unstructured text information; Inputting the unstructured text information into an input representation layer for semantic enrichment to obtain a dynamic word vector; Inputting the dynamic word vector into a named entity recognition layer for entity recognition to obtain a recognized entity; The identified entities are input into the classifier layer, and the relationship between the identified entities is predicted based on the context information of the identified entities to obtain the triple relationship pairs of multi-drug resistant bacteria; A knowledge graph of multidrug-resistant bacteria is constructed based on the triple relationship pairs of multidrug-resistant bacteria.
4. According to claim 1, a multi-drug resistant bacteria knowledge question-answering method based on medical knowledge graph is characterized in that: The step of constructing a universal large language learning model, taking the multidrug-resistant bacteria knowledge graph and structured text information as input, and generating a local multidrug-resistant bacteria knowledge document specifically includes: Prompt presets are performed on the multi-drug resistant bacteria knowledge graph and the structured text information respectively to obtain second prompt information; The second prompt information is generated into text based on the general large language learning model to obtain the local multidrug-resistant bacteria knowledge document.
5. According to claim 1, a multi-drug resistant bacteria knowledge question-answering method based on medical knowledge graph is characterized in that: The step of training the universal large language learning model based on the multidrug-resistant bacteria knowledge graph to obtain the multidrug-resistant bacteria large language learning model specifically includes: Presetting prompts for the triple relationship pairs of the multi-drug resistant bacteria knowledge graph to obtain third prompt information; Generating text for the third prompt information based on a universal large language learning model to obtain a multi-drug resistant bacteria question and answer data pair; The multidrug-resistant bacteria question-answer data pairs are used as training data to fine-tune the general large language learning model to obtain a multidrug-resistant bacteria large language learning model.
6. According to claim 1, a multi-drug resistant bacteria knowledge question-answering method based on medical knowledge graph is characterized in that: The step of constructing a local multi-drug resistant bacteria database based on the local multi-drug resistant bacteria knowledge document specifically includes: Extracting content from the local multidrug-resistant bacteria knowledge document to obtain multidrug-resistant bacteria text content; Performing text segmentation on the multidrug-resistant bacteria text content to obtain multidrug-resistant bacteria text sentences; Constructing a query document based on the multidrug-resistant bacteria text sentence; Performing text conversion on the query document based on a vector model to obtain a text vector; Creating an index based on the text vector to obtain a text index; The text vector and the text index are stored in a local database to obtain a local multi-drug resistant bacteria database.
7. According to claim 1, a multi-drug resistant bacteria knowledge question and answer method based on medical knowledge graph is characterized in that: The step of searching the local multi-drug resistant bacteria database based on the user query information to obtain knowledge information specifically includes: Based on the vector model, the user query information is vectorized to obtain the question query vector; Based on the question query vector, relevant text indexes are searched in the local multi-drug resistant bacteria database to obtain knowledge information.
8. A multi-drug resistant bacteria knowledge question-answering system based on medical knowledge graph, characterized in that: include: The original data collection module is used to construct the original multi-drug resistant bacteria data document; A multidrug-resistant bacteria relationship extraction module is used to extract knowledge relationships from the original multidrug-resistant bacteria data document to obtain a multidrug-resistant bacteria knowledge graph; A general large language learning model, taking the multidrug-resistant bacteria knowledge graph and structured text information as input, generates a local multidrug-resistant bacteria knowledge document; A model training module, which trains the general large language learning model based on the multidrug-resistant bacteria knowledge graph to obtain a multidrug-resistant bacteria large language learning model; A local database construction module, which constructs a local multidrug-resistant bacteria database based on the local multidrug-resistant bacteria knowledge document; A search module, searching the local multi-drug resistant bacteria database based on user query information to obtain knowledge information; The answer output module constructs first prompt information based on the knowledge information and user query information, inputs the first prompt information into the multi-drug resistant bacteria large language learning model, and outputs answer information.
Citation Information
Patent Citations
Knowledge graph generation type question answering method and system based on large language model
CN117033608A
College scientific research management question and answer system combining knowledge graph and large language model
CN117609436A
Knowledge graph-based medical question answering method and apparatus, device and medium
WO2023029512A1
Cited By
Data preprocessing method and device based on AI large model
CN119645989A
