A method and device for predicting the risk of postoperative recurrence of liver cancer based on knowledge graph

By constructing a knowledge graph and using XLNet and XGB algorithms, the problem of inability to effectively link data elements in the existing technology is solved, and the reliability and comprehensiveness of the risk of recurrence after liver cancer is improved, and the generated prediction results are more accurate.

CN114822852BActive Publication Date: 2024-11-08DIGITAL HEALTH CHINA TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210552510.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-20
Publication Date
2024-11-08
Estimated Expiration
2042-05-20

AI Technical Summary

Technical Problem

When predicting the risk of postoperative recurrence in patients with liver cancer, the prior art cannot effectively link the relationship between data elements, resulting in the prediction model being unable to cover comprehensive possible recurrence factors and lacking the application of medical knowledge and data prior information.

Method used

Using a knowledge graph-based method, a knowledge graph containing factors related to liver cancer recurrence, liver cancer indicators and patient data was constructed, and entities and relationships were trained using XLNet model, combined with XGB algorithm for prediction, and using MSE as a loss function to generate liver cancer surgery. predicted value of risk of recurrence.

Benefits of technology

It improves the reliability and comprehensiveness of risk prediction, and the generated prediction results are closer to reality, enhancing the ability to predict the risk of postoperative recurrence in patients with liver cancer.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114822852B_ABST
    Figure CN114822852B_ABST
Patent Text Reader

Abstract

The present application proposes a prediction method and device for the risk of postoperative recurrence of liver cancer based on a knowledge graph, which belongs to the field of medical data prediction, wherein the method includes: preprocessing patient data to obtain preprocessed data; constructing a knowledge graph containing factors related to liver cancer recurrence, liver cancer indicators and patient data for the preprocessed data; using the XLNet training model to train the entities and relationships in the knowledge graph to obtain the representation vectors of patient entities and relationships; using the XGB algorithm to predict based on the representation vectors of the patient entities and relationships, and using MSE as the loss function, and taking the corresponding prediction value with the minimum loss function as the prediction value of the risk of postoperative recurrence of liver cancer. The system includes: a data preprocessing module, a knowledge graph construction module, a knowledge representation training module and a postoperative recurrence risk prediction module. The present application improves the reliability of risk prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of medical data prediction, and specifically relates to a method and device for predicting the risk of postoperative recurrence of liver cancer based on a knowledge graph. Background Art

[0002] Hepatocellular carcinoma (HCC) is one of the most common malignant tumors worldwide, ranking seventh in the incidence of various malignant tumors, with approximately 841,000 new cases and 782,000 deaths each year. In my country, the incidence and mortality of liver cancer rank fourth and second respectively. Currently, liver resection is one of the most commonly used treatments, but the recurrence rate within 5 years after surgery is as high as 40% to 70%, which seriously threatens the long-term survival of patients. Therefore, it is very important to predict the risk of recurrence after liver cancer resection, identify liver cancer patients with high risk of recurrence as early as possible, and implement intervention and treatment as soon as possible, which will reduce the probability of liver cancer recurrence and greatly improve the postoperative prognosis of liver cancer patients.

[0003] In the existing technical solution, the expression level of each gene is predicted by a kit, and then the importance of each gene is obtained by random forest training, and then the weight of the gene in the risk score is determined. The random forest algorithm is to build a forest in a random way. The forest is composed of many decision trees. There is no correlation between each decision tree in the random forest. After obtaining the forest, a new sample is input, and each decision tree in the forest judges and classifies it respectively. The most selected category is the type of the predicted sample.

[0004] In summary, the existing technical solutions do not link the data elements in the determination of weights and the selection of each gene. Each element is independent, and the resulting prediction model cannot cover a more comprehensive range of possible recurrence factors.

[0005] It turns out that graphs are a useful data structure for studying shapes and relationships between graphical data elements. If a programming problem is represented by vertices and edges, the problem can be drawn as a graph and a graph algorithm (such as breadth-first search or depth-first search) can be used to find a solution.

[0006] According to the research on existing technologies, the postoperative prognosis models of liver cancer are mostly modeled through machine learning or deep learning, but these methods cannot link the relationship between data elements. If medical knowledge and data prior information are added, and a deep learning model is established through node classification or link prediction, the resulting risk prediction model will be more comprehensive and reliable. Summary of the invention

[0007] In response to the above technical deficiencies, this application proposes a method and device for predicting the risk of postoperative recurrence of liver cancer based on a knowledge graph. By constructing a knowledge graph and performing node classification or link prediction, a risk prediction model for postoperative recurrence of liver cancer patients is obtained.

[0008] In the first aspect, the present application proposes a method for predicting the risk of postoperative recurrence of liver cancer based on a knowledge graph, comprising the following steps:

[0009] Preprocessing the patient data to obtain preprocessed data;

[0010] For the pre-processed data, construct a knowledge graph including liver cancer recurrence-related influencing factors, liver cancer indicators and patient data;

[0011] The XLNet training model is used to train the entities and relationships in the knowledge graph to obtain representation vectors of patient entities and relationships;

[0012] According to the representation vectors of the patient entities and relationships, the XGB algorithm is used for prediction, and MSE is used as the loss function. The corresponding prediction value with the smallest loss function is used as the prediction value of the risk of recurrence after liver cancer surgery.

[0013] The preprocessing of the patient data to obtain the preprocessed data includes: screening and filtering the data containing relevant parameters in the electronic medical records of liver cancer patients, and removing special symbols.

[0014] The patient data refers to electronic medical record data, including factors related to liver cancer recurrence and pathological information corresponding to liver cancer indicators.

[0015] The influencing factors and liver cancer indicators related to liver cancer recurrence include: patient age, gender, neutrophil-lymphocyte ratio, alanine aminotransferase, aspartate aminotransferase, alpha-fetoprotein, hepatitis B virus deoxyribonucleic acid quantification, albumin, hepatitis B virus surface antigen, operation time, intraoperative blood loss, intraoperative blood transfusion, postoperative antiviral treatment, anatomical liver resection, liver cirrhosis, tumor diameter, tumor number, tumor capsule, hepatitis status, portal vein tumor thrombus, tumor resection margin, tumor differentiation degree, focal necrosis, Barcelona Clinical Liver Cancer staging, TNM staging, imaging-related examinations and postoperative recurrence time.

[0016] The knowledge graph is represented by a property graph, that is, a graph structure representation model implemented by the graph database Neo4J.

[0017] The graph structure representation model includes: liver cancer is connected to N parameters through relationships; the N parameters are respectively connected to M features through different mappings; and the M features are respectively connected to P pathologies through relationships.

[0018] The construction of a knowledge graph including factors related to liver cancer recurrence, liver cancer indicators and patient data comprises the following steps:

[0019] The preprocessed data is trained with the SpERT model to obtain a representation vector of the relationship between liver cancer and the corresponding liver cancer indicators, and the trained SpERT model is used to extract entities, relationships, and attributes of liver cancer and the corresponding liver cancer indicators to obtain extraction results;

[0020] The extracted results are discretized, the units of the same fields are normalized, and the entities are standardized to obtain the standardized results;

[0021] The standardized results are mapped to the influencing factors related to liver cancer recurrence, and the mapped results are also used as entities to obtain the final triplet, which serves as a knowledge graph including the influencing factors related to liver cancer recurrence, liver cancer indicators and patient data.

[0022] The trained SpERT model is used to extract entities, relationships, and attributes of liver cancer and corresponding liver cancer indicators to obtain extraction results, which include the following steps:

[0023] Classify entities;

[0024] Filter the classified entities;

[0025] Classify the filtered entities and the relationships between them.

[0026] The entity classification includes: defining a fusion function to fuse the embedded vectors, and using a softmax classifier for classification.

[0027] The filtering of the classified entities refers to filtering entities whose entity type is None and whose length exceeds a threshold.

[0028] The classification of the relationships between filtered entities includes: obtaining a semantic embedding c(S1, S2) between two adjacent entities through a pre-trained language representation model and maximum pooling; processing the order of S1 and S2 through two unit vectors; passing the processed results through a single-layer classifier; and obtaining the extraction results of entities, relationships and attributes by using the sum of cross entropy and binary cross entropy as the loss function for relationship classification and entity classification.

[0029] The data discretization means: according to the discretization standard, the corresponding numerical data is discretized into data of the discretization standard.

[0030] The normalization of the same field units means unifying the data of the same field but different units into the same unit.

[0031] The standardization of the entities means unifying entities with different names but the same meaning into one standard name.

[0032] The XLNet training model is used to train the entities and relationships in the knowledge graph to obtain representation vectors of patient entities and relationships, including: establishing a likelihood function based on an autoregressive language model; when the model has only one layer, a query flow formula is used, and when the model has multiple layers, a content flow formula is used.

[0033] The loss function Defined as:

[0034]

[0035] Among them, i is each sample number, n is the total number of samples in each batch, and y i is the true value of postoperative recurrence time, It is the prediction value of postoperative recurrence time.

[0036] In the second aspect, the present application proposes a prediction device for the risk of postoperative recurrence of liver cancer based on a knowledge graph, comprising: a data preprocessing module, a knowledge graph construction module, a knowledge representation training module, and a postoperative recurrence risk prediction module;

[0037] The data preprocessing module, the knowledge graph construction module, the knowledge representation training module and the postoperative recurrence risk prediction module are connected in sequence;

[0038] The data preprocessing module is used to preprocess the patient data to obtain preprocessed data;

[0039] The knowledge graph construction module is used to construct a knowledge graph including liver cancer recurrence-related influencing factors, liver cancer indicators and patient data for the preprocessed data;

[0040] The knowledge representation training module is used to train entities and relationships in the knowledge graph using the XLNet training model to obtain representation vectors of patient entities and relationships;

[0041] The postoperative recurrence risk prediction module is used to make predictions based on the representation vectors of the patient entities and relationships using the XGB algorithm, and using MSE as the loss function, and taking the corresponding prediction value with the minimum loss function as the prediction value of the postoperative recurrence risk of liver cancer.

[0042] The knowledge graph construction module includes: an extraction unit, a standardization unit, and a mapping unit;

[0043] The extraction unit, the standardization unit, and the mapping unit are connected in sequence;

[0044] The extraction unit is used to perform SpERT model training on the preprocessed data to obtain a representation vector of the relationship between liver cancer and the corresponding liver cancer indicator, and use the trained SpERT model to extract entities, relationships and attributes of liver cancer and the corresponding liver cancer indicator to obtain an extraction result;

[0045] The standardization unit is used to discretize the data, normalize the same field units, and standardize the entities of the extracted results to obtain standardized results;

[0046] The mapping unit is used to map the standardized results with the influencing factors related to liver cancer recurrence, and use the mapped results as entities to obtain the final triplet, which serves as a knowledge graph containing influencing factors related to liver cancer recurrence, liver cancer indicators and patient data.

[0047] The extraction unit includes: an entity classification subunit, a filtering subunit, and a relationship classification subunit;

[0048] The entity classification subunit, the filtering subunit, and the relationship classification subunit are connected in sequence;

[0049] The entity classification subunit is used to classify entities;

[0050] The filtering subunit is used to filter the classified entities;

[0051] The relationship classification subunit is used to classify the relationships between filtered entities.

[0052] In a third aspect, the present application provides a computer device, the computer device comprising:

[0053] In a fourth aspect, a processor is used to implement the steps of the method when executing a computer program stored in a memory.

[0054] The present application proposes a computer-readable storage medium on which computer instructions are stored. When the computer instructions are executed by a processor, the steps of the method are implemented.

[0055] Beneficial technical effects:

[0056] This application proposes a prediction method and device for the risk of postoperative recurrence of liver cancer based on knowledge graph. Compared with the traditional independent training model, this application uses medical knowledge as prior information, constructs a knowledge graph related to liver cancer, and uses the XLNet model to train the data to obtain patient entity and relationship representations. This training model does not rely on incomplete data and is a generalized AR language model. The prediction results obtained are more comprehensive and closer to reality, which improves the reliability of risk prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 A flow chart of a method for predicting the risk of postoperative recurrence of liver cancer based on a knowledge graph according to an embodiment of the present application;

[0058] Figure 2 A flow chart for constructing a knowledge graph for an embodiment of the present application;

[0059] Figure 3 This is a flow chart of entity relationship and attribute extraction using the SpERT model in an embodiment of the present application;

[0060] Figure 4 This is a principle block diagram of a device for predicting the risk of postoperative recurrence of liver cancer based on a knowledge graph in an embodiment of the present application;

[0061] Figure 5 This is a block diagram of the internal structure principle of the knowledge graph construction module of the embodiment of the present application;

[0062] Figure 6 This is a block diagram of the internal structure principle of the extraction unit of the embodiment of the present application;

[0063] Figure 7 A schematic diagram of a knowledge graph attribute graph according to an embodiment of the present application;

[0064] Figure 8 This is a schematic diagram of a knowledge graph attribute graph embodiment of the present application. DETAILED DESCRIPTION

[0065] The present application is further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of the present application.

[0066] In the prior art, the scheme for predicting the risk of recurrence after liver cancer surgery is to use a kit to predict the risk of recurrence after liver cancer resection in patients and obtain the expression level of each gene.

[0067] Among them, the method used for resection surgery is R0 resection. Detection reagents include reagents for detecting the expression level of each gene using RT-PCR (Reverse Transcription-Polymerase Chain Reaction, a technology that combines reverse transcription of RNA and polymerase chain amplification of cDNA), gene expression series analysis, expression sequence tags, gene chips or transcriptome sequencing methods. Preferably, RT-PCR is used to detect the gene expression level, and the kit includes: an mRNA extraction reagent for extracting total mRNA in the sample; a reverse transcription reagent for reverse transcribing mRNA into cDNA; and primer pairs for quantitative amplification of each gene.

[0068] Finally, the importance of each gene was obtained after random forest training, and a total of 12 genes were included in the gene expression model.

[0069] The risk score is used to evaluate the risk of recurrence after liver cancer resection:

[0070] In the formula, Coef i is the weight coefficient of each gene, x i is the expression level of each gene, and n is the number of genes (n=12). The larger the risk score value, the higher the risk of recurrence.

[0071] As can be seen from the above, in the existing technical solutions, the random forest algorithm is used to train the importance of each gene to determine the weight of the gene in the risk score. The random forest algorithm builds a forest in a random way. The forest is composed of many decision trees. There is no correlation between each decision tree in the random forest. After obtaining the forest, a new sample is input, and each decision tree in the forest judges and classifies it respectively. The most selected category is the type of the predicted sample.

[0072] In summary, the existing technical solutions do not link the data elements in the determination of weights and the selection of each gene. Each element is independent, and the resulting prediction model cannot cover a more comprehensive range of possible recurrence factors. However, this application proposes to construct a knowledge graph and perform node classification or link prediction to obtain a risk prediction model for postoperative recurrence of liver cancer patients.

[0073] Based on the above technical problems, the present application proposes a method and device for predicting the risk of postoperative recurrence of liver cancer based on a knowledge graph. By constructing a knowledge graph and performing node classification or link prediction, a risk prediction model for postoperative recurrence of liver cancer patients is obtained.

[0074] In the first aspect, this application proposes a method for predicting the risk of postoperative recurrence of liver cancer based on a knowledge graph, such as Figure 1 As shown, the following steps are included:

[0075] Step S1: preprocessing the patient data to obtain preprocessed data;

[0076] The preprocessing of the patient data to obtain the preprocessed data includes: screening and filtering the data containing relevant parameters in the electronic medical records of liver cancer patients, and removing special symbols.

[0077] The patient data refers to electronic medical record data, including factors related to liver cancer recurrence and pathological information corresponding to liver cancer indicators.

[0078] Step S2: constructing a knowledge graph including liver cancer recurrence-related influencing factors, liver cancer indicators and patient data for the preprocessed data;

[0079] The fields of liver cancer recurrence-related influencing factors and liver cancer indicators are as follows:

[0080] Patients' age, gender (more males), neutrophil-lymphocyte ratio (NLR), alanine aminotransferase (ALT), aspartate aminotransferase (AST), alpha-fetoprotein (AFP), HBV-DNA quantification (HBV-DNA, deoxyribonucleic acid of hepatitis B virus), ALB (albumin), HBsAg (hepatitis B virus surface antigen), operation time, intraoperative blood loss, intraoperative blood transfusion, postoperative antiviral treatment, anatomical liver resection, cirrhosis, tumor diameter, tumor number, tumor capsule, hepatitis status, portal vein tumor thrombus, tumor resection margin, tumor differentiation degree, focal necrosis, BCLC (Barcelona Clinic Liver Cancer) staging, TNM staging (including: T staging, N staging, M staging), imaging-related examinations and postoperative recurrence time.

[0081] Extract entity alignment, clean and integrate data, combine medical knowledge, and construct a knowledge graph containing factors related to liver cancer recurrence, liver cancer indicators and patient data. This step belongs to the existing technology and will not be repeated in this application.

[0082] The knowledge graph is represented by a property graph, that is, a graph structure representation model implemented by the graph database Neo4J, such as Figure 7 As shown, the graph structure representation model includes: liver cancer is connected to N parameters through relationships; the N parameters are respectively connected to M features through different mappings; and the M features are respectively connected to P pathologies through relationships. Figure 7 The parameters in the table refer to the factors related to liver cancer recurrence, such as the number of tumors, liver cirrhosis, tumor diameter, and tumor differentiation degree. Figure 8 As shown, Figure 7 The features in the figure refer to nodes with a large number of tumors, liver cirrhosis, large tumor diameter, and high tumor differentiation. Such nodes are extracted mainly through the SpERT model to extract the electronic medical record data of patients, and the extracted data is standardized to form the nodes and patient nodes in the above figure and the relationship between the two is saved as triplets.

[0083] Step S3: using the XLNet training model (XLNet is a generalized autoregressive pre-training model for language understanding, using Transformer-XL as a basic module) to train the entities and relationships in the knowledge graph to obtain representation vectors of patient entities and relationships;

[0084] Step S4: According to the representation vectors of the patient entities and relationships, the XGB algorithm is used for prediction, and MSE is used as the loss function. The corresponding prediction value with the minimum loss function is used as the prediction value of the risk of postoperative recurrence of liver cancer.

[0085] The construction includes a knowledge graph of factors related to liver cancer recurrence, liver cancer indicators and patient data, such as Figure 2 As shown, the following steps are included:

[0086] Step S2.1: training the preprocessed data with a SpERT model (Span-based Joint Entity and Relation Extraction with Transformer Pre-training) to obtain a representation vector of the relationship between liver cancer and the corresponding liver cancer index, and extracting entities, relations, and attributes of liver cancer and the corresponding liver cancer index using the trained SpERT model to obtain extraction results;

[0087] This application uses the SpERT model to extract entities, relationships and attributes of liver cancer and corresponding liver cancer indicators: including the extraction of all nodes and relationships, not limited to liver cancer, relationships, parameter extraction, as well as features and pathology; and uses the XLNet training model to use the graph structure to represent all the information of the model for prediction.

[0088] The trained SpERT model is used to extract entities, relationships and attributes of liver cancer and corresponding liver cancer indicators to obtain extraction results, such as Figure 3 As shown, input triple data, train entities and relations, and obtain representation vectors, including the following steps:

[0089] Step S2.1.1: classify the entity;

[0090] Step S2.1.2: Filter the classified entities;

[0091] Step S2.1.3: Classify the filtered entities and the relationships between them.

[0092] Define a fusion function e(s) to fuse the embedded vectors:

[0093] e(s)=f(e i , e i+1 , ..., e i+k ) Formula 2

[0094] Assume s:=(e i ,e i+1 ,…,e i+k) represents the span space. Assume that E is a set of predefined entity categories. The span classifier maps span s to a class in E∪{none}, where none represents a span that does not constitute an entity.

[0095] For a possible entity span (i,e i+1 ,...,e i+k )(That is, (e i ,e i+1 ,…,e i+k ) is a subscript, select a continuous text in the text), and its vector is represented by f(e i ,e i+1 ,…,e i+k ), where f uses the maximum pooling. As a result, the model obtains the vector representation of the entity token

[0096] ert / width embedding:

[0097]

[0098]

[0099] Among them, w k+1 Represents the length embedding of span (entity), the purpose is to integrate the length information of span into the feature vector of span, because a span that is too long cannot represent an entity; c is the CLS vector in Bert embedding, that is, the sentence vector of this sentence.

[0100] The width embedding is the embedding matrix learned during training. That is, the width of an entity is k+1, which means that the entity contains k+1 tokens. Then the width embedding of the entity is w k+1 It will be represented as a vector representation with a width of k+1 obtained by indexing in the width matrix with a subscript of k+1. Concatenate the width representation with the vector representation of the entity token;

[0101] c refers to the word vector represented by the special tag CLS, which is an unpooled vector.

[0102] Connecting these three parts, we get the final vector representation:

[0103] Use the softmax classifier to classify span:

[0104] y S =softmax(W S ·x S +b S ) Formula 5

[0105] Filter entities whose entity type is None and whose length is too long. S represents the weight matrix, b S represents the training bias term, x S represents the final vector, y S Represents the output layer.

[0106] Between two adjacent entities, a semantic embedding c(S1, S2) is obtained through Bert (pre-trained language representation model) and maximum pooling. The relationship between them is asymmetric, so the order of S1 and S2 needs to be considered. To process:

[0107]

[0108]

[0109] Among them, the role of maximum pooling is to extract several eigenvalues ​​from a certain filter, and only obtain the largest pooling layer as the retained value, and all other eigenvalues ​​are discarded; the main function is to retain the main features while reducing parameters and calculations, preventing overfitting, and improving the generalization ability of the model. In the model of the present application method, CLS is not selected as the text feature, but the maximum pooling is performed on the text between the two entities to obtain the vector representation c(s1, s2) of the text feature.

[0110] Both pass through a single-layer classifier σ (sigmoid function):

[0111]

[0112] Define a critical value α and compare the values ​​of y and α to determine whether x is an entity relationship triple. Among them, σ represents the sigmoid activation function, W r represents the weight matrix, represents two unit vectors, b r Represents the training bias term.

[0113] The sum of the loss of relation classification and entity classification is the loss function of the entire model

[0114]

[0115] in, is the cross entropy, is the binary cross entropy.

[0116] Step S2.2: discretize the data, normalize the units of the same fields, and standardize the entities of the extracted results to obtain the standardized results;

[0117] The extraction results include: patient age, neutrophil lymphocyte ratio (NLR), alanine aminotransferase (ALT), aspartate aminotransferase (AST), alpha-fetoprotein (AFP), HBV-DNA quantification, ALB, HBsAg, intraoperative blood loss, intraoperative blood transfusion, tumor diameter, and tumor number. Data discretization, normalization of the same field units, and standardization of entities are performed on these data to obtain standardized results. The discretization standards are provided by medicine and are roughly divided into high (large), normal, low (small), and other specific clinical standards.

[0118] The data discretization means: according to the discretization standard, the corresponding numerical data is discretized into data of the discretization standard;

[0119] The normalization of the same field unit means: unifying the data of the same field with different units into the same unit;

[0120] The standardization of the entities means unifying entities with different names but the same meaning into one standard name.

[0121] Step S2.3: Map the standardized results with the influencing factors related to liver cancer recurrence, and use the mapped results as entities to obtain the final triplet, which serves as a knowledge graph containing the influencing factors related to liver cancer recurrence, liver cancer indicators and patient data.

[0122] In step S3, the XLNet training model is used to train the entities and relationships in the knowledge graph to obtain the representation vectors of patient entities and relationships. The detailed steps are described as follows:

[0123] The XLNet training model is used to train the entities and relationships in the knowledge graph to obtain the representation vectors of the patient entities and relationships. The XLNet training model uses a new method to achieve bidirectional encoding based on the autoregressive language model (AR), which is a model training method that uses context words to predict the next word. Input triple data, train the nodes and relationships, save the optimal model, and obtain the representation vector.

[0124] Permutation Language Modeling is the core idea of ​​XLNet. For a sequence x of length T, there are T! permutations, where T! refers to the factorial of T. If x1, x2, x3, x4 are rearranged into x2, x1, x4, x3, and AR is used as the objective function, the optimized likelihood is:

[0125] p(x)=P(x3|x2,x1,x4)×P(x4|x2,x l )×P(x1|x2)×P(x2) Formula 10

[0126] Because the model parameters are shared for different permutations, the model can eventually learn how to aggregate information from all positions. Then add position information, such as p(x4|x2, x1, 4), so that the model knows which position token is currently being predicted. Remove the position embedding and use Two-Stream Self-Attention.

[0127] Query stream (query stream formula): You can only see the current position information, but not the encoding of the current token:

[0128]

[0129] in, represents the query flow hidden state, the superscript m represents the number of hidden layers, Attn(Q=) represents the attention mechanism function, The query stream cannot access Z t (Z t is the content of the predicted word position), so K and V are The KV of the content stream is

[0130] Content stream: Traditional self-attention, encoding the current token:

[0131]

[0132] in, Represents the content flow hidden state.

[0133] Among them, h contains content information, which serves as K and V. When the model has only one layer, only the Query stream is used. If more layers are added, in order to obtain h of a higher layer, the Content stream is required.

[0134] According to the encoding results, the representation vectors of patient entities and relationships are obtained.

[0135] In step S4, the XGB model is used to make predictions based on the representation vectors of the patient entities and relationships, and MSE is used as the loss function. The corresponding prediction value with the minimum loss function is used as the prediction value of the risk of postoperative recurrence of liver cancer, which is described in detail as follows:

[0136] The loss function Defined as:

[0137]

[0138] The loss function is the mean square error (MSE) formula, where i is the number of each sample, n is the total number of samples in each batch, and y i is the true value of postoperative recurrence time, is the predicted value of postoperative recurrence time. This embodiment uses the XGB algorithm (eXtremeGradient Boosting, extreme gradient boosting algorithm) to predict the postoperative recurrence time

[0139] In the second aspect, the present application proposes a prediction device for the risk of postoperative recurrence of liver cancer based on a knowledge graph, such as Figure 4 As shown, it includes: a data preprocessing module, a knowledge graph construction module, a knowledge representation training module and a post-operative recurrence risk prediction module;

[0140] The data preprocessing module, the knowledge graph construction module, the knowledge representation training module and the postoperative recurrence risk prediction module are connected in sequence;

[0141] The data preprocessing module is used to preprocess the patient data to obtain preprocessed data;

[0142] The knowledge graph construction module is used to construct a knowledge graph including liver cancer recurrence-related influencing factors, liver cancer indicators and patient data for the preprocessed data;

[0143] The knowledge representation training module is used to train entities and relationships in the knowledge graph using the XLNet training model to obtain representation vectors of patient entities and relationships;

[0144] The postoperative recurrence risk prediction module is used to make predictions based on the representation vectors of the patient entities and relationships using the XGB algorithm, and using MSE as the loss function, and taking the corresponding prediction value with the minimum loss function as the prediction value of the postoperative recurrence risk of liver cancer.

[0145] The knowledge graph building module, such as Figure 5 As shown, it includes: an extraction unit, a standardization unit, and a mapping unit;

[0146] The extraction unit, the standardization unit, and the mapping unit are connected in sequence;

[0147] The extraction unit is used to perform SpERT model training on the preprocessed data to obtain a representation vector of the relationship between liver cancer and the corresponding liver cancer indicator, and use the trained SpERT model to extract entities, relationships and attributes of liver cancer and the corresponding liver cancer indicator to obtain an extraction result;

[0148] The standardization unit is used to discretize the data, normalize the same field units, and standardize the entities of the extracted results to obtain standardized results;

[0149] The mapping unit is used to map the standardized results with the influencing factors related to liver cancer recurrence, and use the mapped results as entities to obtain the final triplet, which serves as a knowledge graph containing influencing factors related to liver cancer recurrence, liver cancer indicators and patient data.

[0150] The extraction unit, such as Figure 6 As shown, it includes: an entity classification subunit, a filtering subunit, and a relationship classification subunit;

[0151] The entity classification subunit, the filtering subunit, and the relationship classification subunit are connected in sequence;

[0152] The entity classification subunit is used to classify entities;

[0153] The filtering subunit is used to filter the classified entities;

[0154] The relationship classification subunit is used to classify the relationships between filtered entities.

[0155] In a third aspect, the present application provides a computer device, the computer device comprising:

[0156] In a fourth aspect, a processor is used to implement the steps of the method when executing a computer program stored in a memory.

[0157] The applicant of the present invention has made a detailed explanation and description of the implementation examples of the present invention in conjunction with the drawings in the specification. However, those skilled in the art should understand that the above implementation examples are only preferred implementation schemes of the present invention, and the detailed description is only to help readers better understand the spirit of the present invention, but not to limit the scope of protection of the present invention. On the contrary, any improvements or modifications based on the inventive spirit of the present invention should fall within the scope of protection of the present invention.

Claims

1. A method for predicting the risk of postoperative recurrence of liver cancer based on knowledge graph, characterized in that: The steps include: Preprocessing the patient data to obtain preprocessed data; For the pre-processed data, a knowledge graph including factors related to liver cancer recurrence, liver cancer indicators and patient data is constructed, including: The preprocessed data is trained with a SpERT model to obtain a representation vector of the relationship between liver cancer and the corresponding liver cancer index, and the trained SpERT model is used to extract entities, relationships and attributes of liver cancer and the corresponding liver cancer index to obtain extraction results, wherein the entities are classified, and the entity classification includes: defining a fusion function to fuse the embedded vectors, and using a softmax classifier for classification; filtering the classified entities, and filtering the classified entities refers to filtering entities whose entity type is None and whose length exceeds a threshold; classifying the relationship between the filtered entities and the entities, including: between two adjacent entities, obtaining a semantic embedding c(S1, S2) through a pre-trained language representation model and maximum pooling; processing the order of S1 and S2 through two unit vectors; passing the processed results through a single-layer classifier; and obtaining the extraction results of entities, relationships and attributes by using the sum of cross entropy and binary cross entropy as the loss function for relationship classification and entity classification; The extracted results are discretized, the units of the same fields are normalized, and the entities are standardized to obtain the standardized results; The standardized results are mapped with the influencing factors related to liver cancer recurrence, and the mapped results are also used as entities to obtain the final triplet, which is used as a knowledge graph including the influencing factors related to liver cancer recurrence, liver cancer indicators and patient data; The entities and relations in the knowledge graph are trained using the XLNet training model to obtain representation vectors of patient entities and relations, including: establishing a likelihood function based on an autoregressive language model; using a query flow formula when the model has only one layer, and using a content flow formula when the model has multiple layers; According to the representation vectors of the patient entities and relationships, the XGB algorithm is used for prediction, and MSE is used as the loss function. The corresponding prediction value with the minimum loss function is used as the prediction value of the risk of postoperative recurrence of liver cancer. Defined as: Among them, i is the number of each sample, n is the total number of samples in each batch, is the true value of postoperative recurrence time, It is the prediction value of postoperative recurrence time.

2. The method for predicting the risk of postoperative recurrence of liver cancer based on knowledge graph according to claim 1, characterized in that: The preprocessing of the patient data to obtain the preprocessed data includes: screening and filtering the data containing relevant parameters in the electronic medical records of liver cancer patients, and removing special symbols.

3. The method for predicting the risk of postoperative recurrence of liver cancer based on knowledge graph according to claim 2, characterized in that: The patient data refers to electronic medical record data, including factors related to liver cancer recurrence and pathological information corresponding to liver cancer indicators.

4. The method for predicting the risk of postoperative recurrence of liver cancer based on knowledge graph according to claim 1, characterized in that: The liver cancer recurrence-related influencing factors and liver cancer indicators include: patient age, gender, neutrophil-lymphocyte ratio, alanine aminotransferase, aspartate aminotransferase, alpha-fetoprotein, hepatitis B virus deoxyribonucleic acid quantification, albumin, hepatitis B virus surface antigen, operation time, intraoperative blood loss, intraoperative blood transfusion, postoperative antiviral treatment, anatomical liver resection, cirrhosis, tumor diameter, tumor number, tumor capsule, hepatitis status, portal vein cancer thrombus, tumor resection margin, tumor differentiation degree, focal necrosis, Barcelona Clinic Liver Cancer staging, TNM staging, imaging-related examinations and postoperative recurrence time.

5. The method for predicting the risk of postoperative recurrence of liver cancer based on knowledge graph according to claim 1, characterized in that: The knowledge graph is represented by a property graph, that is, a graph structure representation model implemented by the graph database Neo4J.

6. The method for predicting the risk of postoperative recurrence of liver cancer based on knowledge graph according to claim 5, characterized in that: The graph structure representation model includes: liver cancer is connected to N parameters through relationships; the N parameters are respectively connected to M features through different mappings; and the M features are respectively connected to P pathologies through relationships.

7. The method for predicting the risk of postoperative recurrence of liver cancer based on knowledge graph according to claim 6, characterized in that: The data discretization means: according to the discretization standard, the corresponding numerical data is discretized into data of the discretization standard.

8. The method for predicting the risk of postoperative recurrence of liver cancer based on knowledge graph according to claim 7, characterized in that: The normalization of the same field units means unifying the data of the same field but different units into the same unit.

9. The method for predicting the risk of postoperative recurrence of liver cancer based on knowledge graph according to claim 8, characterized in that: The standardization of the entities means unifying entities with different names but the same meaning into one standard name.

10. A prediction device for the risk of postoperative recurrence of liver cancer based on a knowledge graph, comprising: Data preprocessing module, knowledge graph construction module, knowledge representation training module, and post-operative recurrence risk prediction module; The data preprocessing module, the knowledge graph construction module, the knowledge representation training module and the postoperative recurrence risk prediction module are connected in sequence; The data preprocessing module is used to preprocess the patient data to obtain preprocessed data; The knowledge graph construction module is used to construct a knowledge graph containing liver cancer recurrence-related influencing factors, liver cancer indicators and patient data for the preprocessed data, and the knowledge graph construction module includes: an extraction unit, a standardization unit, and a mapping unit; The extraction unit, the standardization unit, and the mapping unit are connected in sequence; The extraction unit is used to train the SpERT model on the preprocessed data, obtain the representation vector of the relationship between liver cancer and the corresponding liver cancer index, and use the trained SpERT model to extract entities, relationships and attributes of liver cancer and the corresponding liver cancer index to obtain extraction results; the extraction unit includes: an entity classification subunit, a filtering subunit, and a relationship classification subunit; the entity classification subunit, the filtering subunit, and the relationship classification subunit are connected in sequence; the entity classification subunit is used to classify entities, and the entity classification includes: defining a fusion function to fuse the embedded vectors, using a softmax classifier to classify row classification; the filtering subunit is used to filter the classified entities, and the filtering of the classified entities refers to filtering entities whose entity type is None and whose length exceeds a threshold; the relationship classification subunit is used to classify the relationships between the filtered entities, including: between two adjacent entities, a semantic embedding c(S1, S2) is obtained through a pre-trained language representation model and maximum pooling; the order of S1 and S2 is processed through two unit vectors; the processed results are passed through a single-layer classifier; the sum of the cross entropy and the binary cross entropy is used as the loss function for relationship classification and entity classification, and the extraction results of entities, relationships and attributes are obtained; The standardization unit is used to discretize the data, normalize the same field units, and standardize the entities of the extracted results to obtain standardized results; The mapping unit is used to map the standardized results with the influencing factors related to liver cancer recurrence, and use the mapped results as entities to obtain a final triplet, which is used as a knowledge graph including the influencing factors related to liver cancer recurrence, liver cancer indicators and patient data; The knowledge representation training module is used to train entities and relationships in the knowledge graph using the XLNet training model to obtain representation vectors of patient entities and relationships, including: establishing a likelihood function based on an autoregressive language model; using a query flow formula when the model has only one layer, and using a content flow formula when the model has multiple layers; The postoperative recurrence risk prediction module is used to predict the patient entity and relationship representation vector using the XGB algorithm, and use MSE as the loss function, and take the corresponding prediction value with the minimum loss function as the prediction value of the postoperative recurrence risk of liver cancer. The loss function Defined as: Among them, i is the number of each sample, n is the total number of samples in each batch, is the true value of postoperative recurrence time, It is the prediction value of postoperative recurrence time.

11. A computer device, comprising: A processor, wherein the processor is configured to implement the steps of the method according to any one of claims 1 to 9 when executing a computer program stored in a memory.

12. A computer-readable storage medium having computer instructions stored thereon, characterized in that: When the computer instructions are executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.