Gynecological chemotherapy home adverse reaction early warning method based on mapping knowledge domain
By constructing a temporal knowledge graph containing absolute time and relative chemotherapy time, and utilizing path reasoning networks and evidence chain template constraints, the problem of early warning for high-risk time windows during chemotherapy was solved, improving the accuracy and interpretability of the early warning.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- AFFILIATED HOSPITAL OF JIANGNAN UNIV
- Filing Date
- 2026-02-05
- Publication Date
- 2026-05-15
AI Technical Summary
Existing technologies struggle to characterize high-risk time windows based on chemotherapy cycle markers and relative days after administration. Noise in home monitoring data leads to false alarms, and warning results lack interpretable evidence, making it difficult to support patient management and clinical decision-making.
We construct a temporal knowledge graph containing absolute time and relative chemotherapy time, generate entity and relation embeddings through the temporal knowledge graph embedding model, use a path reasoning network for multi-round iterative propagation, extract the evidence chain by combining evidence chain template constraints, and output medically readable adverse reaction warning results.
It achieves accurate early warning of high-risk time windows within specific chemotherapy cycles, reduces false alarms due to noise, and improves the interpretability and feasibility of early warning.
Smart Images

Figure CN122050826A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical information technology, and in particular to a method for early warning of adverse reactions to gynecological chemotherapy at home based on knowledge graphs. Background Technology
[0002] Patients with gynecological malignancies often experience adverse reactions after chemotherapy, such as bone marrow suppression, nausea and vomiting, fever, and diarrhea. The occurrence and severity of these adverse reactions usually follow a clear temporal pattern, such as being related to the day after administration and the course of treatment. With the development of internet-based healthcare and home-based health management, chemotherapy regimens, medication records, and test results from hospital information systems, along with patient self-reported symptoms, vital signs such as temperature and heart rate, are gradually being digitally collected and monitored over the long term. This provides a data foundation for risk assessment and early warning of adverse reactions at home.
[0003] Existing technologies for home-based adverse reaction early warning mainly include the following categories: alarm methods based on guidelines and rule thresholds, such as threshold judgments for indicators like body temperature and white blood cell count based on adverse reaction grading standards; prediction methods based on statistical learning or machine learning, such as using regression models, tree models, or sequence models to predict the probability of adverse reactions; and data fusion and reasoning methods based on knowledge graphs, which conduct risk association analysis by constructing a network of relationships between entities such as patients, medications, symptoms, and test indicators. Some studies also introduce temporal information for sequence modeling or temporal knowledge graph representation learning to characterize the relationship between medical events over time.
[0004] However, the existing technologies mentioned above still have shortcomings, mainly in the following aspects: First, many methods mainly model based on absolute time or general sequence order, failing to establish specific expressions for time windows around chemotherapy cycle markers and relative days after drug administration, making it difficult to accurately learn high-risk windows within a specific treatment course. Second, home monitoring data is noisy and collected discontinuously; some methods only impose time constraints during the result screening stage, failing to suppress the spread of information outside the time window during the inference process, which can easily lead to false alarms or insufficient stability against delayed adverse reactions. Third, existing early warning results are mostly output in the form of scores or labels, lacking interpretability and a lack of reviewable, medically readable, and actionable evidence chains, making it difficult to support patient home management and clinical decision-making.
[0005] Therefore, a home-based early warning method for adverse reactions to gynecological chemotherapy that can overcome the shortcomings of the existing technology is a problem that needs to be solved by those skilled in the art. Summary of the Invention
[0006] One objective of this invention is to propose a knowledge graph-based method for early warning of adverse reactions to gynecological chemotherapy at home. Addressing the problems of existing technologies, such as difficulty in characterizing high-risk time windows based on chemotherapy cycle identifiers and relative days after administration, noise in home monitoring data leading to false alarms, and a lack of interpretable evidence for early warning results, the following technical solution is proposed: Acquire patient chemotherapy-related data and home monitoring data; construct a temporal knowledge graph containing absolute and relative chemotherapy times, where the relative chemotherapy time is composed of the chemotherapy cycle identifier and relative days; input the temporal knowledge graph into a temporal knowledge graph embedding model to generate entity and relation embeddings, and allow the absolute time embedding and the relative chemotherapy time embedding to jointly participate in relational fact scoring; obtain a target time window determined by the target chemotherapy cycle identifier and the target relative day range; input the embedding vector and the target time window into a path reasoning network for multi-round iterative propagation; during the propagation stage, perform gating weighting on edge messages based on the time window matching coefficient to obtain a risk score for adverse reaction classification; then, based on the risk score, use bundle search and apply evidence chain template constraints to extract the evidence chain and output the early warning result. This invention has the technical effect of enabling more accurate home adverse reaction warnings for high-risk time windows within specific chemotherapy cycles, reducing false alarms introduced by noise paths outside the time window, and outputting a medically readable chain of evidence to improve interpretability and usability.
[0007] This invention provides a knowledge graph-based method for early warning of adverse reactions to gynecological chemotherapy at home, comprising:
[0008] S1. Obtain patient chemotherapy-related data and home monitoring data, and construct a time-series knowledge graph, including entity nodes and relational facts with time attributes. The time attributes include absolute time and relative chemotherapy time. The relative chemotherapy time consists of a chemotherapy cycle identifier and a relative number of days. S2. Input the time-series knowledge graph into the time-series knowledge graph embedding model to generate entity node embedding vectors and relational embedding vectors. For each relational fact, generate a first time embedding from absolute time and a second time embedding from chemotherapy cycle identifier and relative number of days. Combine the first and second time embeddings in the scoring calculation of the relational fact. S3. Obtain the target time window, determined by the target chemotherapy cycle identifier and the target relative number of days range. Then, combine the embedding vectors and the target time window... The input path reasoning network with a target time window undergoes multiple rounds of iterative propagation. In each round of propagation, a time window matching coefficient is calculated based on the relative chemotherapy time corresponding to the relational facts and the target time window. The time window matching coefficient is then used to perform gating weighting on the propagated information to obtain the risk score corresponding to the adverse reaction grading node and the preceding information used to characterize the relational fact sequence adopted for propagation. S4: Based on the risk score and preceding information, a bundle search is used to extract the evidence chain, and an evidence chain template constraint is applied during the path expansion process. The evidence chain template constraint limits the node type sequence of the candidate path to include chemotherapy regimen nodes, chemotherapy cycle nodes, evidence nodes, and adverse reaction grading nodes. S5: Adverse reaction warning results are generated and output based on the risk score and evidence chain.
[0009] Optionally, S1 includes:
[0010] Acquire chemotherapy-related data and home monitoring data of gynecological chemotherapy patients, and associate each data record in the chemotherapy-related data and home monitoring data with patient identification and collection time, and use the collection time as absolute time;
[0011] The chemotherapy-related data and the home monitoring data are standardized in terms of terminology. The terminology standardization includes mapping drug names, symptom names, test indicator names and vital sign names to standard terms in a preset terminology set, and converting the units of measurement to preset units of measurement.
[0012] Entity alignment is performed on the data that has completed terminology standardization. The entity alignment includes merging data records from different data sources that represent the same object into the same entity node. The entity node includes chemotherapy regimen node, administration event node, chemotherapy cycle node, symptom node, vital sign node, and test indicator node.
[0013] A temporal knowledge graph is constructed based on the data with completed entity alignment. The temporal knowledge graph connects the entity nodes through relational edges, which include relational edges representing the relationship between chemotherapy regimens and administration events, the relationship between administration events and chemotherapy cycles, the relationship between patients and symptoms, the relationship between patients and vital signs, and the relationship between patients and laboratory indicators.
[0014] Set a time attribute for the relationship edge. The time attribute includes absolute time and relative chemotherapy time. The relative chemotherapy time consists of a chemotherapy cycle identifier and a relative number of days. The relative number of days is calculated based on the absolute time and the absolute time corresponding to the drug administration event.
[0015] Output the aforementioned time-series knowledge graph.
[0016] Optionally, S2 includes:
[0017] Extract relational facts with time attributes from the temporal knowledge graph, and determine the head entity node, tail entity node, relation edge, absolute time, chemotherapy cycle identifier, and relative number of days for each relational fact;
[0018] The head entity node, the tail entity node, and the relation edge are respectively input into the entity embedding layer and the relation embedding layer of the temporal knowledge graph embedding model to generate the entity node embedding vector and the relation edge embedding vector.
[0019] The absolute time is input into the first time embedding layer of the time-series knowledge graph embedding model to generate the first time embedding, and the chemotherapy cycle identifier and the relative number of days are input into the second time embedding layer of the time-series knowledge graph embedding model to generate the second time embedding.
[0020] The entity node embedding vector, the relation edge embedding vector, the first time embedding and the second time embedding are input into the scoring calculation module to obtain the relation fact score for each relation fact;
[0021] The parameters of the temporal knowledge graph embedding model are updated based on the relational fact scores, so that the relational fact scores of real relational facts are higher than the relational fact scores of preset negative sample relational facts.
[0022] Output the entity node embedding vector, the relation edge embedding vector, and the time embedding corresponding to the relation fact, wherein the time embedding includes the first time embedding and the second time embedding.
[0023] Optionally, S3 includes:
[0024] Obtain the target time window for patients to be warned, wherein the target time window is determined by the target chemotherapy cycle identifier and the target relative number of days range;
[0025] From the temporal knowledge graph, identify the chemotherapy regimen nodes, drug administration event nodes, chemotherapy cycle nodes, symptom nodes, vital sign nodes, and test indicator nodes associated with the patient to be warned, and extract the relational edges connecting the nodes to form a subgraph to be reasoned.
[0026] The entity node embedding vector, relation edge embedding vector, and time embedding are mapped to the subgraph to be inferred, and the subgraph to be inferred and the target time window are input into the path inference network to perform multi-round iterative propagation.
[0027] In each round of iterative propagation, for each relation edge in the subgraph to be inferred, the relative chemotherapy time corresponding to the relation edge is obtained and matched with the target relative number of days range to obtain a time window matching coefficient. When the relative chemotherapy time falls into the target relative number of days range, the time window matching coefficient is set to a first preset value. When the relative chemotherapy time does not fall into the target relative number of days range, the time window matching coefficient is determined based on the distance between the relative chemotherapy time and the target relative number of days range and is made less than the first preset value.
[0028] The propagation information of the relation edge is gated and weighted using the time window matching coefficient, and the node representation of each entity node in the subgraph to be inferred is updated.
[0029] After completing the multi-round iterative propagation, the risk score corresponding to the at least one adverse reaction classification node is calculated based on the node representation corresponding to the at least one adverse reaction classification node, and the relational edge sequence used to generate the risk score is recorded as predecessor information during the calculation of the risk score.
[0030] Output the risk score and the precursor information.
[0031] Optionally, S4 includes:
[0032] The risk score and precursor information are input into the evidence chain extraction module. Based on the precursor information, the starting node and target node of the candidate path corresponding to the risk score are determined. The starting node is a chemotherapy regimen node or a chemotherapy cycle node, and the target node is an adverse reaction grading node or a treatment recommendation node.
[0033] The candidate paths are expanded using a beam search to generate a set of path sequences. During the path expansion process, an evidence chain template constraint is applied. The evidence chain template constraint is used to limit the node type sequence of each candidate path to include at least the following nodes in sequence: chemotherapy regimen node, chemotherapy cycle node, evidence node, adverse reaction grading node, and treatment recommendation node. The evidence node includes symptom node, vital sign node, and test indicator node.
[0034] Candidate paths that satisfy the evidence chain template constraints are scored based on the risk score and the propagation contribution of the relation edges contained in the candidate paths, and the candidate paths are ranked according to the path scores.
[0035] The top-ranked candidate path in the output ranking results is used as the evidence chain.
[0036] Optionally, S5 includes:
[0037] Input the chain of evidence and risk score into the early warning output module;
[0038] Based on the evidence chain, determine the adverse reaction name and adverse reaction grade corresponding to the adverse reaction grade node in the evidence chain, and extract the target time window corresponding to the chemotherapy cycle node from the evidence chain.
[0039] The risk score is compared with a preset warning threshold. When the risk score is greater than or equal to the warning threshold, an adverse reaction warning result is generated. When the risk score is less than the warning threshold, an adverse reaction monitoring result is generated.
[0040] The adverse reaction early warning results include the adverse reaction name, adverse reaction grade, target time window, risk score, and evidence chain; the adverse reaction monitoring results include the adverse reaction name, target time window, risk score, and evidence chain.
[0041] Output the adverse reaction early warning result or the adverse reaction monitoring result.
[0042] Optionally, the negative sample relationship facts include temporal negative sample relationship facts, which are relationship facts obtained by replacing the absolute time and / or replacing the chemotherapy cycle identifier and relative number of days while keeping the head entity node, tail entity node and relationship edge unchanged.
[0043] Optionally, after the time window matching coefficient is determined based on the range of relative chemotherapy time and target relative days, it is further multiplied by the data confidence coefficient corresponding to the relational fact to obtain the final gating coefficient used for gating weighting.
[0044] Optionally, the gating weighting is performed during the edge message calculation stage, specifically: for each relation edge, the edge message is first calculated based on the relation edge embedding vector and the time embedding, and then the edge message is multiplied by the time window matching coefficient and used to participate in the node representation update.
[0045] Optionally, the evidence chain template constraint is represented by a finite state machine or regular syntax rules and is used to limit the set of node types that the next hop is allowed to expand when the path is expanded.
[0046] The beneficial effects of this invention are:
[0047] 1. By simultaneously introducing absolute time embedding and relative chemotherapy time embedding composed of chemotherapy cycle identifiers and relative days during the time-series knowledge graph embedding stage, and having both participate in the relationship fact scoring, the model can learn the risk distribution pattern of "which chemotherapy cycle and which day after administration", thereby improving the accuracy and advance warning of adverse reactions within a specific high-risk time window.
[0048] 2. By calculating the time window matching coefficient based on the relative chemotherapy time and the target time window during the multi-round iterative propagation process of the path reasoning network, and by gating and weighting the edge messages, the information within the time window is strengthened and the noise information outside the time window is suppressed, thereby reducing false alarms caused by discontinuity and noise in home monitoring data, and improving the reasoning stability for adverse reactions with time lag and evolutionary characteristics.
[0049] 3. By applying evidence chain template constraints when extracting evidence chains through bundle search, the node type sequence of candidate paths is limited to include chemotherapy regimen nodes, chemotherapy cycle nodes, evidence nodes, and adverse reaction grading nodes. Furthermore, treatment suggestion nodes can be associated, so that the early warning results can simultaneously output reviewable and medically readable evidence chains, thereby improving the interpretability and enforceability of the early warning conclusions. Attached Figure Description
[0050] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0051] Figure 1 This is a flowchart of a home-based early warning method for adverse reactions to gynecological chemotherapy based on knowledge graphs, as proposed in this invention. Detailed Implementation
[0052] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0053] refer to Figure 1 A knowledge graph-based method for early warning of adverse reactions to gynecological chemotherapy at home, including:
[0054] S1. Obtain patient chemotherapy-related data and home monitoring data, and construct a time-series knowledge graph, including entity nodes and relational facts with time attributes. The time attributes include absolute time and relative chemotherapy time. The relative chemotherapy time consists of a chemotherapy cycle identifier and a relative number of days. S2. Input the time-series knowledge graph into the time-series knowledge graph embedding model to generate entity node embedding vectors and relational embedding vectors. For each relational fact, generate a first time embedding from absolute time and a second time embedding from chemotherapy cycle identifier and relative number of days. Combine the first and second time embeddings in the scoring calculation of the relational fact. S3. Obtain the target time window, determined by the target chemotherapy cycle identifier and the target relative number of days range. Then, combine the embedding vectors and the target time window... The input path reasoning network with a target time window undergoes multiple rounds of iterative propagation. In each round of propagation, a time window matching coefficient is calculated based on the relative chemotherapy time corresponding to the relational facts and the target time window. The time window matching coefficient is then used to perform gating weighting on the propagated information to obtain the risk score corresponding to the adverse reaction grading node and the preceding information used to characterize the relational fact sequence adopted for propagation. S4: Based on the risk score and preceding information, a bundle search is used to extract the evidence chain, and an evidence chain template constraint is applied during the path expansion process. The evidence chain template constraint limits the node type sequence of the candidate path to include chemotherapy regimen nodes, chemotherapy cycle nodes, evidence nodes, and adverse reaction grading nodes. S5: Adverse reaction warning results are generated and output based on the risk score and evidence chain.
[0055] In this specific embodiment, S1 includes:
[0056] The system retrieves chemotherapy-related data from the hospital's information system and home monitoring data from the patient's home. The chemotherapy-related data includes chemotherapy regimen records, medication administration records, and chemotherapy cycle records. The home monitoring data includes patient-reported symptom records, vital sign collection records, and home laboratory test results records. Each data record includes a patient identifier. The data collection time is uniformly converted to a second-level timestamp of Coordinated Universal Time and recorded as absolute time. ,in A unique patient identifier in string format. An absolute timestamp in integer form used for time alignment across data sources;
[0057] The system performs terminology standardization on the chemotherapy-related data and the home monitoring data. A set of standard terms is pre-fixed in the system and a unique term code is assigned to each standard term. The set of standard terms includes a set of standard terms for drugs, a set of standard terms for symptoms, a set of standard terms for test indicators, and a set of standard terms for vital signs. Each set consists of a three-element structure of "standard name - list of synonyms - term code". The term mapping adopts a deterministic dictionary matching process. First, the original name is normalized by case, full-width and half-width characters, and whitespace characters are removed to obtain a normalized string. Then, the normalized string is precisely matched in the corresponding set to obtain the term code, and the term code is used as the semantic identifier for subsequent mapping.
[0058] The system standardizes the units of measurement and implements conversion tables of "original unit-target unit-conversion factor" in advance. Each record of vital signs and test indicators with numerical values is converted to the target unit according to the conversion table and then stored. This ensures that the same test indicator or the same vital sign has consistent unit semantics under different sources.
[0059] The system performs entity alignment on the data that has undergone terminology standardization and constructs a set of entity nodes. The construction rule is: for each A unique patient node is constructed. A chemotherapy regimen node is constructed for each chemotherapy regimen record, and the internal code of the regimen is used as the node primary key. A dosing event node is constructed for each dosing execution record, and the "patient node primary key + dosing execution serial number" is used as the node primary key. A chemotherapy cycle node is constructed for chemotherapy cycle records, and the "patient node primary key + cycle number" is used as the node primary key. At the same time, a globally unique modeling method based on terminology coding is adopted for symptom nodes, vital sign nodes, and test indicator nodes, so that records from different patients and different data sources but with the same terminology coding point to the same semantic node.
[0060] After constructing the node set, the system builds a set of relational facts with time attributes based on the business semantic relationships between nodes. The types of relational edges are fixed as follows: edges representing the relationship between chemotherapy regimen and administration event, edges representing the relationship between administration event and chemotherapy cycle, edges representing the relationship between patient and symptoms, edges representing the relationship between patient and vital signs, and edges representing the relationship between patient and laboratory indicators. Each relational fact is assigned a time attribute, which includes absolute time. Relative chemotherapy time is indicated by the chemotherapy cycle. Relative number of days Composition, in which The cycle number corresponding to the chemotherapy cycle node is a positive integer. The time is calculated from the absolute time corresponding to the relational fact and the baseline dosing time within the chemotherapy cycle, where the baseline dosing time is denoted as... And defined as the same With the same The earliest absolute timestamp of all drug administration event nodes, wherein the relative number of days is calculated using a deterministic rule of rounding down to the nearest day:
[0061] ;
[0062] in It is a relative number of days and is an integer. This is the absolute timestamp corresponding to the fact of the relationship. This serves as the baseline dosing timestamp for the same chemotherapy cycle. The number of seconds per day and the value is To use a floor operator, so that relational facts occurring on the day of administration within the same chemotherapy cycle satisfy the following conditions: And after administration Tian Satisfaction ;
[0063] The system writes the aforementioned entity nodes and their temporal relationships into a graph database using an attribute graph structure. Node attributes must at least include node type and terminology encoding, and edge attributes must at least include... and Output the time-series knowledge graph.
[0064] In this specific embodiment, S2 includes:
[0065] The system extracts a set of relational facts with time attributes from a time-series knowledge graph. Each relational fact is recorded as ,in For the head entity node identifier, This serves as an identifier for the relationship edge type. For the tail entity node identifier, This is the absolute timestamp corresponding to the fact of the relationship. It serves as an identifier for chemotherapy cycles and is consistent with the cycle number of the chemotherapy cycle node. It is a relative number of days and is consistent with the relative number of days;
[0066] The system constructs a time-series knowledge graph embedding model, which consists of an entity embedding layer, a relation embedding layer, a first-time embedding layer, a second-time embedding layer, and a scoring calculation module. The entity embedding layer contains an entity embedding matrix. ,in This represents the total number of entity nodes in the time-series knowledge graph, with a one-to-one correspondence between each node and the node dictionary. The embedding dimension has a value of 128. The Row lookup table to obtain head entity embedding vector And the first Row lookup table to obtain tail entity embedding vector ;
[0067] The relation embedding layer contains a relation embedding matrix. ,in This represents the total number of relation edge types, and there is a one-to-one correspondence between them and the relation dictionary. The Row lookup table to obtain relation embedding vector ;
[0068] The first-time embedding layer is used to embed absolute time. Discretize the time bucket index by natural day and embed the matrix in absolute time. The lookup table provides the first-time embedded result. ,in The system sets the total number of absolute time buckets to 1826, covering a continuous time span of 1826 days. The system then fixes the start date of each time bucket at midnight on January 1, 2020. The time bucket index is converted to a day number starting from that zero point.
[0069] The second time embedding layer is used to identify chemotherapy cycles. Relative number of days Mapped to chemotherapy cycle embedding vectors respectively Embedded vectors with relative days The second time embedding is obtained by adding elements one by one. The chemotherapy cycle embedding lookup table is derived from the chemotherapy cycle embedding matrix. and It covers cycle numbers 1 to 12, and the relative day embedding lookup table is derived from the relative day embedding matrix. and And covering relative days from 0 to 30, when When Truncate the value to 30 before looking up the table to ensure the index is fixed and reproducible;
[0070] The scoring module calculates a score for each relational fact. The relationship fact score uses a translational scoring method and embeds it in the first instance. With second time embedding Joint participation, specifically:
[0071] ;
[0072] in Score the relational fact of this relational fact. For a norm 2 operator, For the head entity embedding vector, For relation embedding vectors, For tail entity embedding vectors, For absolute time The first-time embedding generated As a marker of chemotherapy cycle Relative number of days The generated second-time embedding;
[0073] The system uses relational fact scores to evaluate model parameters. During training, a set of negative sample relation facts is constructed for each real-world relation fact. These negative sample relation facts include entity negative samples and time negative samples. Entity negative samples are maintained... Unchanged and tail entity Replace with the same type of entity node to generate 5 entity negative samples for each real relationship fact, and the time negative samples are maintained. Unchanged and will Replace with other absolute time bucket indexes unrelated to the patient and simultaneously... The results were obtained by replacing the patient's other chemotherapy cycle identifiers with the relative number of days, and generating two time negative samples for each true relationship fact;
[0074] The system employs an interval ranking loss to ensure that the scores of true relation facts are higher than those of negative sample relation facts, with an interval of 1.0. It uses the Adam optimizer to update parameters with a learning rate of 0.001, a training batch size of 1024, and 50 training epochs. After each parameter update, [the system performs a specific parameter adjustment]. , Perform L2 normalization to stabilize the training;
[0075] After training is complete, the system outputs entity node embedding vectors, relation edge embedding vectors, and temporal embeddings corresponding to each relation fact. The temporal embeddings include a first temporal embedding. With second time embedding And used in steps The path reasoning network input.
[0076] In this specific embodiment, S3 includes:
[0077] The system receives patient identification for alert purposes. And determine the target time window The target time window Identified by the target chemotherapy cycle Relative number of days to the target Confirmed, among which It is a positive integer and is consistent with the cycle number of the chemotherapy cycle node. and are integers and satisfy And it is consistent with the definition of relative days in step S1;
[0078] The system extracts data from the time-series knowledge graph and... Related subgraphs to be inferred The subgraph to be reasoned The set of nodes contains this The corresponding patient node, symptom nodes directly connected to the patient node via relation edges, vital sign nodes and laboratory indicator nodes, medication event nodes associated with the patient node, chemotherapy cycle nodes associated with the medication event nodes, chemotherapy regimen nodes associated with the chemotherapy cycle nodes, and adverse reaction grading nodes, constitute the subgraph to be inferred. The set of edges contains all the relational facts between the aforementioned nodes, and each relational fact carries... Time attribute;
[0079] The system embeds entity nodes into vectors and maps them to subgraphs to be inferred. The initial node representation of each node is used to map the relation edge embedding vector and the first and second time embeddings to the subgraph to be reasoned. The edge features of each relation fact, where nodes represent dimensions. The value is 128, and both the first and second time-based embeddings are... Vectors on;
[0080] The system constructs a path reasoning network and infers the subgraph to be reasoned. The path reasoning network, which performs multiple rounds of iterative propagation, consists of an edge message calculation module, a gating weighting module, a node aggregation and update module, and a risk scoring head, and the number of iteration rounds is [not specified]. The value is 3, and the edge message calculation module calculates each relation fact. Based on the source node and current node representations of this relational fact, the relational edge embedding vector, the first-time embedding, and the second-time embedding, an edge message vector is generated, and the dimension of the edge message vector is [value missing]. The gated weighting module applies each relation fact Calculate the time window matching coefficient and the edge message vector The gated edge message vector is obtained by multiplication. The node aggregation and update module sums the gated edge message vectors of all incoming edges of each node to obtain an aggregate vector, which is then concatenated with the node representation of the previous round. This aggregate vector is then input into a fully connected network and activated by the ReLU function to obtain the node representation of the next round. The weight matrix of the fully connected network is set to... And the bias vector takes the value of And serve as trainable parameters for the path reasoning network;
[0081] The time window matching coefficient From relational facts Corresponding relative chemotherapy time and target time window The method for determining and using this method to suppress the propagation of information outside the target time window is as follows:
[0082] ;
[0083] in For relational facts The time window matching coefficient and its value range is Subgraph to be inferred Relational fact index in the middle, For relational facts The chemotherapy cycle identifier has a positive integer value. This is used as an identifier for the target chemotherapy cycle, and its value is a positive integer. For relational facts The relative number of days and the value is an integer. The lower bound of the target relative number of days is an integer. The upper bound of the target relative number of days is an integer. For logical AND operator, It is an exponential function. The attenuation coefficient is a value that is [value missing]. For relational facts Relative chemotherapy time and target time window The distance between them is calculated as the "chemotherapy cycle difference" according to a defined rule. Multiply by the periodic scale constant In addition to the relative number of days to the closed interval The minimum daily distance, where the periodic scale constant is... The value is 31 and is used to convert the difference in chemotherapy cycles into a daily distance;
[0084] After completion After rounds of iterative propagation, the system treats the inference subgraph. The final node of each adverse reaction grading node represents the risk score obtained from the input risk scoring head, which is composed of a weight vector. With bias scalar After constructing and performing a linear mapping on the final node representation, the result is output via the Sigmoid function. Risk score within the range and the stated and These are the trainable parameters for the path reasoning network;
[0085] The system records precursor information during propagation to support the evidence chain extraction in subsequent step S4. The recording method involves saving the identifier of the incoming edge with the largest contribution value in the incoming edge set and the corresponding source node identifier for each node in each round of propagation. The contribution value is defined as the L2 norm of the incoming edge-gated message vector and its relation to the incoming edge's... Together, they decide that, after the propagation ends, they can trace back from the adverse reaction classification node along the predecessor pointer round by round to obtain the sequence of relational facts used to generate the risk score and output the risk score and the predecessor information.
[0086] In this specific embodiment, S4 includes:
[0087] The system will set up risk scores With Precursor Information Input evidence chain extraction module, the It consists of several pairs of tuples, and each pair of tuples is denoted as . ,in As a marker for adverse reaction grading, To be consistent with the above The corresponding risk score and its range are: The The information is predecessor information and includes at least a predecessor edge pointer and an edge contribution value used for backtracking, where the edge contribution value is denoted as... And indicate the fact of relationship During the propagation process in step S3, the contribution strength of the target node is updated.
[0088] The system is based on risk scoring right Sort in descending order and select the top rank Each adverse reaction grading node is used as an object for evidence chain extraction. For each extracted object, the system is based on... From the adverse reaction classification node A precursor backbone chain is obtained by backtracking forward, and the starting and target nodes of candidate paths are determined accordingly, wherein the precursor backbone chain contains chemotherapy regimen nodes. When The starting node is determined when the precursor scaffold chain does not contain a chemotherapy regimen node. The distance in the pre-drive skeleton chain is then... The furthest chemotherapy cycle node Once identified as the starting node, the system will classify the adverse reaction nodes. The node was identified as the first target node and further queried in the time-series knowledge graph for its relationship with the target node. The nodes of the disposal suggestion are connected by the "corresponding disposal suggestion" relationship edge. When the suggested processing node is found When The second target node was determined, and the target node of the candidate path was determined as... When the suggested processing node is not found The target node of the candidate path is determined as ;
[0089] The system performs a beam search within the subgraph to be inferred, using the starting node as the root, to generate a set of candidate paths, with a beam width of [missing information]. The value is 10 and the maximum number of extended hops. The value is 6, and the expansion of each partial path adopts a deterministic "one-step-at-a-time edge contribution value". Select the relational facts to be expanded in descending order, and after each round of expansion, retain only the ones with the highest path scores. Some paths are selected to proceed to the next round of expansion, and the system applies acyclic constraints to each candidate path to ensure that there are no duplicate nodes in the same candidate path;
[0090] During path expansion, the system applies evidence chain template constraints to eliminate candidate paths that do not conform to the medically readable structure. The evidence chain template constraints are fixed in the evidence chain extraction module in the form of a finite state machine and limit the set of expandable next-hop node types through node type transition rules. The node types include chemotherapy regimen node types, administration event node types, chemotherapy cycle node types, patient node types, evidence node types, adverse reaction grading node types, and treatment suggestion node types. The evidence node types consist of symptom node types, vital sign node types, and test indicator node types. The finite state machine requires that the candidate path's node type sequence must include the chemotherapy regimen node type and the chemotherapy cycle node type in sequence, followed by at least one evidence node type and then the adverse reaction grading node type. When the target node of the candidate path is a treatment suggestion node, it also requires that the treatment suggestion node type appear after the adverse reaction grading node type. At the same time, the finite state machine allows the administration event node type to appear only between the chemotherapy regimen node type and the chemotherapy cycle node type, and allows the patient node type to appear only between the chemotherapy cycle node type and the evidence node type, so that the candidate path satisfies both the business data connection structure and the evidence chain readable structure.
[0091] The system analyzes each candidate path that satisfies the evidence chain template constraints. Calculate path score Based on this ranking, at least one top-ranked candidate path is output as the evidence chain, and the path score is determined. Determine as follows: ;
[0092] in Candidate paths Path scoring, The risk score fusion coefficient has a value of [value]. For the adverse reaction classification nodes corresponding to the candidate paths Risk score, Candidate paths The set of relational facts contained therein Let be the cardinality of the set of relational facts. For the index of relational facts in the set of relational facts, For the stated relational facts In the preceding information The edge contribution value recorded in the record and when the relationship fact Not appeared China Times Set it to 0 to ensure the score can be calculated;
[0093] The system represents the output evidence chain as a sequence of nodes and relational facts arranged in path order, and attaches a time attribute to each relational fact. And the numerical and unit attributes of the data records corresponding to the evidence nodes.
[0094] In this specific embodiment, S5 includes:
[0095] The system will collect the chain of evidence. With risk score set The input warning output module establishes a one-to-one correspondence. Each chain of evidence in the chain is denoted as It consists of a sequence of nodes arranged in order and a sequence of relational facts. Each risk score in the data is denoted as And the range of values is At the same time, the system receives the identifiers of patients awaiting warning. is used as the primary key of the output result, where A unique patient identifier in string form;
[0096] The system targets each chain of evidence. Analysis of adverse reaction grading nodes And from this adverse reaction grading node Read the adverse reaction name from the node attributes Adverse reaction grading ,in It is a standard terminology string and is consistent with the terminology standardization result of step S1. These are integer grading values used to characterize the severity of adverse reactions;
[0097] The system from the chain of evidence Mid-position chemotherapy cycle node And read its cycle number as the identifier of the target chemotherapy cycle. Simultaneously read the chain of evidence Lower bound of the number of days carrying the target Upper bound of the number of days relative to the target And based on this, the target time window is determined. ,in It is a positive integer and is consistent with the cycle number of the chemotherapy cycle node in step S1. and are integers and satisfy And the relative number of days in step S1 The definition is consistent, the and When the evidence chain is output in step S4, it is written as evidence chain metadata to ensure traceability and independence from external states;
[0098] The system will assign the risk score Compared with the preset warning threshold The comparison is used to determine the output type. It is a real number and its value is fixed at 0.70. The system generates an adverse reaction warning result when The system generates adverse reaction monitoring results in real time;
[0099] For adverse reaction warning results, the system generates a list containing fields. Structured output and the chain of evidence It is also presented in a readable text format of "node type - node name - time attribute", in which the symptom nodes, vital sign nodes and test indicator nodes corresponding to the evidence nodes all carry their original observation values, standardized units and corresponding time attributes. To support manual review, among which It is an absolute timestamp and is consistent with step S1. This serves as a marker for the chemotherapy cycle and is consistent with step S1. The number of days is relative and consistent with step S1;
[0100] For adverse reaction monitoring results, the system generates data containing fields. Structured output and preservation of the chain of evidence The same expansion format to support continuous tracking;
[0101] The system writes the generated warning or monitoring results into the results database and pushes them to the patient and healthcare staff via a message queue. The pushed content must strictly include the name of the adverse reaction. Target time window Risk Score With the chain of evidence .
[0102] In this specific embodiment, during the training phase of the temporal knowledge graph embedding model, the negative sample relation facts are set to simultaneously include entity negative sample relation facts and temporal negative sample relation facts. The temporal negative sample relation facts are used to perturb the temporal attributes while keeping the head entity node, tail entity node and relation edge unchanged, so as to destroy the real temporal correspondence and thus widen the score interval between the real relation facts and the negative sample relation facts.
[0103] The system examines each truly existing relational fact. Constructing a time negative sample set ,in For the head entity node identifier, This serves as an identifier for the relationship edge type. For the tail entity node identifier, It is an absolute time bucket index that is consistent with the first time embedding layer in step S2 and satisfies The chemotherapy cycle identifier is consistent with step S1 and meets the following requirements. The number of days is relative and consistent with step S1 and satisfies the following conditions. The absolute total number of time buckets, The upper limit of coverage for chemotherapy cycle markers. This represents the upper limit of coverage for a relative number of days;
[0104] The set of time-negative samples generates two time-negative sample relationship facts at a time through deterministic rules and writes them as follows:
[0105] ;
[0106] in For relational facts The corresponding time negative sample set, The absolute time bucket index after replacement of the first time negative sample and by calculate, The absolute time perturbation step size is 7. To ensure that the index falls within the modulo operator The second negative time sample simultaneously replaces the absolute time and the relative chemotherapy time to satisfy the constraint of "replacing the absolute time and / or replacing the chemotherapy cycle identifier and the relative number of days".
[0107] in:
[0108] The relative number of days perturbation step size is set to a value of The replacement chemotherapy cycle identifier and its value range is: The relative number of days after replacement and the range of values is: ;
[0109] The system generates Then, a consistency check is performed on each time-negative sample relation fact to avoid duplication with the actual relation facts. The check method is to compare the candidate time-negative sample relation facts with the set of actual relation facts. Perform a hash set membership test when the candidate time negative sample relationship already exists. The corresponding perturbation step size is incremented by integers. and And based on this, the replacement was recalculated. and Until the generated time negative sample relationship does not belong to the fact. The negative sample set is then incorporated into the negative sample set and used for training the interval sorting loss in step S2, thereby causing the model to output a lower relational fact score for temporally mismatched relational facts.
[0110] In this specific implementation, for the gated weighting process, the system calculates the relative chemotherapy time and the target time window. Each relation fact is calculated Corresponding time window matching coefficient Then, further introduce the facts related to the aforementioned relationship. The bound data confidence coefficient To obtain the final gating coefficients used for gating weighting. ,in Subgraph to be inferred Relational fact index in the middle, The time window matching coefficient has a value range of 1. And it is calculated by deterministic rules. The confidence coefficient is the data and its value range is [value range missing]. And when constructing the time-series knowledge graph in step S1, the relational facts are written in. edge attributes, The final gating coefficient has a value range of 1. And it is used to perform gating and weighting on edge messages;
[0111] The data confidence coefficient The reliability of the data source is determined by four factors: data source reliability, field completeness, numerical reasonableness, and time consistency, according to fixed rules. Data source reliability is determined by relational facts. The source type of the corresponding original data record is determined and fixed, taking four categories: in-hospital medical order and medication system, in-hospital laboratory system, calibrated home devices, and patient self-reporting, and each is assigned a value. The field completeness is determined by whether the original data record simultaneously possesses patient identification, collection time, standard terminology code, numerical or grading result, and unit of measurement. If all three are present, the value is 1.00; otherwise, the value is 0.50. The numerical reasonableness is verified according to a preset reasonable range table. The reasonable range table fixes a set of minimum and maximum allowable values for each vital sign standard terminology code and test indicator standard terminology code, requiring the observed value to fall within the closed interval. If the observed value falls within the interval, the value is 1.00; otherwise, the value is 0.20. For discrete values corresponding to symptom nodes and adverse reaction grading nodes, the value is verified according to whether its grading value belongs to a preset grading set. If the verification passes, the value is 1.00; otherwise, the value is 0.20. The time consistency is determined by the difference between the collection time and the storage time of the original data record. If the time difference is not greater than 600 seconds, the value is 1.00; otherwise, the value is 0.80.
[0112] The system multiplies the above four parts and truncates the product to... get and relational facts They are written together into the temporal knowledge graph, so that they can be directly read during inference in step S3. And without having to access the original data again;
[0113] The final gating coefficient is determined by the following formula and used for gating weighting during the side message calculation phase:
[0114] ;
[0115] in For the final gating coefficient, The time window matching coefficient, The system assigns a confidence coefficient to each relational fact. First calculate the edge message vector, then combine the edge message vector with... After multiplication, the participating nodes are updated, thereby further suppressing the propagation contribution of low-reliability home noise data to risk scores and improving the stability of early warning based on time window matching.
[0116] In this specific implementation, for the multi-round iterative propagation in step S3, the gating weighting is performed during the edge message calculation stage and is completed before the execution node aggregation update;
[0117] The system in the Round propagation from the subgraph to be inferred Traverse each directed relation fact ,in The propagation round index has a value range of 1. For relational fact indexing, For the source entity node identifier, Identify the target entity node. Identifier for the relationship edge type;
[0118] The system starts from steps Read the source entity node in the output at the 1st Wheel node representation Relationship edge embedding vector The first-time embedding corresponding to this relational fact With second time embedding ,in For the embedded dimension and the value is Let be the current state vector of the source entity node. Generated by absolute time, Generated by a combination of chemotherapy cycle identifier and relative days;
[0119] The system generates edge message vectors according to the edge message calculation module and introduces a time window matching coefficient to gate the edge message vectors at this stage, specifically:
[0120] ;
[0121] in For ungated edge message vectors, This is the gated edge message vector. For the facts of this relationship The corresponding time window matching coefficient is determined by the "relative chemotherapy time and target time window" in step S3. The matching rule is determined. The weight matrix is the linear transformation matrix of the edge messages. Let be the bias vector of the linear transformation of the edge message. For vector concatenation operators, The activation function for the rectified linear unit;
[0122] The system will assign each target entity node All incoming edge gating back edge message vectors The aggregation vector is obtained by summing and then input into the node aggregation update module to update the target entity node at the [number]th [time]. The node representation of the round enables the propagation process of first calculating the edge message based on the relation edge embedding vector and the time embedding, and then multiplicatively gating the edge message based on the time window matching coefficient before participating in the node representation update.
[0123] In this specific implementation, the evidence chain template constraint adopts regular syntax rules and is compiled into a finite state machine to limit the set of node types that the next hop is allowed to be expanded when the bundle search path is expanded;
[0124] The system establishes a set of node types within the evidence chain extraction module:
[0125] ;
[0126] in Indicates the node type of the chemotherapy regimen. Indicates the type of drug administration event node. Indicates the type of chemotherapy cycle node. Indicates the patient node type, This indicates the type of evidence node, which is obtained by combining the symptom node type, vital sign node type, and test indicator node type. Indicates the type of adverse reaction grading node. Indicates the type of node for handling recommendations;
[0127] The system writes the evidence chain template constraint as a regular expression syntax rule for the node type sequence:
[0128] ;
[0129] in Symbolic links represent evidence chain template constraints, while symbolic connections represent the order constraints of node types. This indicates that the node type within the parentheses is repeated zero or more times. This indicates that the node type within the parentheses appears zero or one time. Indicates that the node type within the parentheses appears once or more;
[0130] The system will use the regular expression syntax rules Compile into a deterministic finite state machine (FSM), the FSM containing a set of states. The set of state transition rules is stored in a hash table as a ternary mapping of "current state next hop node type next state", where Indicates the initial state and the next hop is only allowed This indicates that a chemotherapy regimen node type has been matched and the next hop is allowed. or And in the match Staying at And in the match Time transfer to This indicates that a chemotherapy cycle node type has been matched and the next hop is allowed. or And in the match Time transfer to And in the match Direct transfer to This indicates that a patient node type has been matched and the next hop is only allowed. And transferred to This indicates that at least one evidence node type has been matched and the next hop is allowed to continue matching. or match And in the match Staying at And in the match Time transfer to This indicates that an adverse reaction classification node type has been matched and the next hop is allowed to match. And in the match Time transfer to This indicates that a matching disposal suggestion node type has been found and the status is terminated;
[0131] During the beam search path expansion process, the system maintains a current state variable and a node type sequence cache for each partial path. The initial value of the current state variable is determined by the type of the starting node of the candidate path. When the starting node is a chemotherapy regimen node, the current state is set to [value missing]. And it is considered as having been consumed once. When the starting node is a chemotherapy cycle node, the current state is set to [state]. And it is considered as having been consumed once. In this case, the "chemotherapy regimen node type" is written into the path metadata as a fixed prerequisite that must be met but is known from outside the starting node to ensure consistency with the evidence chain template constraint.
[0132] Each time a candidate node for the next hop is expanded from the end node of the current path, the system first reads the node type of the candidate node and queries the transition mapping of the FSM to see if there is a valid transition for "current state - candidate node type". If there is a valid transition, the candidate node is added to the expandable set and the next state is written to the expanded new path object. If there is no valid transition, the candidate node is pruned directly to achieve real-time limitation on the "set of node types that are allowed to be expanded in the next hop".
[0133] When the expanded path object reaches the target node and its current state is or When the path object is marked as a candidate path that satisfies the evidence chain template constraint, it participates in subsequent path scoring and ranking. Otherwise, the system continues to expand and continuously applies the FSM constraint before the maximum number of expansion hops is exhausted to ensure that the output evidence chain must structurally include a chemotherapy regimen node, a chemotherapy cycle node, at least one evidence node, and an adverse reaction grading node. When a treatment suggestion node exists, it is included at the end of the evidence chain.
[0134] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
[0135] This invention addresses the technical problem of "time-series knowledge graph reasoning and early warning for chemotherapy cycles and time windows, and outputting interpretable evidence chains." It combines time-series knowledge graph embedding with path reasoning networks and evidence chain extraction: First, it structures and associates multi-source home and hospital data, such as chemotherapy regimens, administration events, chemotherapy cycles, symptoms, vital signs, and laboratory indicators, with time-attributed relational facts within the time-series knowledge graph. Second, it obtains vectorized representations of entities and relationships through a time-series knowledge graph embedding model, enabling subsequent reasoning to integrate multiple types of evidence within a unified semantic space. Third, given a target time window, it uses a path reasoning network for multi-round iterative propagation to obtain a risk score for adverse reaction classification, and records the relational fact sequence used in the reasoning as precursor information. Finally, it extracts evidence chains based on the risk score and precursor information and outputs early warning results, thereby achieving more timely and accurate home-based early warnings for adverse reactions within high-risk time windows of specific chemotherapy cycles, and providing evidence chain explanations corresponding to the early warning conclusions to improve usability.
[0136] This invention makes structural improvements to address the time regularity of chemotherapy cycles and the noise characteristics of home-based data: First, in the embedding stage, a dual-time coordinate model is adopted, introducing relative chemotherapy time composed of chemotherapy cycle identifiers and relative days in addition to absolute time, and allowing both types of time embeddings to participate in the scoring of relational facts, enabling the model to naturally learn the windowed risk distribution of "which cycle and which day after administration"; Second, in the message passing stage of the path reasoning network, a time window matching coefficient is introduced and edge messages are gated and weighted, which strengthens evidence within the time window and suppresses noisy paths outside the time window during the reasoning process, reduces false alarms, and improves the stable identification of delayed responses; Third, in the evidence chain extraction stage, an evidence chain template constraint is applied, limiting the node type sequence of candidate paths to a medically readable structure, thereby stably outputting an auditable and executable interpretation chain, further supporting the clinical and home applications of early warning conclusions.
Claims
1. A knowledge graph-based method for early warning of adverse reactions to gynecological chemotherapy at home, comprising: S1. Acquire patients' chemotherapy-related data and home monitoring data, and construct a temporal knowledge graph, including entity nodes and relational facts with time attributes. The time attributes include absolute time and relative chemotherapy time. The relative chemotherapy time consists of the chemotherapy cycle identifier and the relative number of days. S2. Input the temporal knowledge graph into the temporal knowledge graph embedding model to generate entity node embedding vectors and relational embedding vectors. For each relational fact, generate a first time embedding from the absolute time and a second time embedding from the chemotherapy cycle identifier and the relative number of days. The first time embedding and the second time embedding are used together to participate in the scoring calculation of the relational fact. S3. Obtain the target time window, which is determined by the target chemotherapy cycle identifier and the target relative number of days range. Input the embedding vector and the target time window into the path reasoning network for multiple rounds of iterative propagation. In each round of propagation, calculate the time window matching coefficient based on the relative chemotherapy time corresponding to the relational fact and the target time window. Use the time window matching coefficient to perform gating weighting on the propagated information to obtain the risk score corresponding to the adverse reaction grading node and the precursor information used to characterize the relational fact sequence used for propagation. S4. Based on the risk score and precursor information, a bundle search is used to extract the evidence chain, and an evidence chain template constraint is applied during the path expansion process. The evidence chain template constraint limits the node type sequence of the candidate path to include chemotherapy regimen nodes, chemotherapy cycle nodes, evidence nodes, and adverse reaction grading nodes. S5. Based on the risk score and evidence chain, an adverse reaction warning result is generated and output.
2. The method for early warning of adverse reactions to gynecological chemotherapy at home based on knowledge graphs according to claim 1, S1 includes: Acquire chemotherapy-related data and home monitoring data of gynecological chemotherapy patients, and associate each data record in the chemotherapy-related data and home monitoring data with patient identification and collection time, and use the collection time as absolute time; The chemotherapy-related data and the home monitoring data are standardized in terms of terminology. The terminology standardization includes mapping drug names, symptom names, test indicator names and vital sign names to standard terms in a preset terminology set, and converting the units of measurement to preset units of measurement. Entity alignment is performed on the data that has completed terminology standardization. The entity alignment includes merging data records from different data sources that represent the same object into the same entity node. The entity node includes chemotherapy regimen node, administration event node, chemotherapy cycle node, symptom node, vital sign node, and test indicator node. A temporal knowledge graph is constructed based on the data with completed entity alignment. The temporal knowledge graph connects the entity nodes through relational edges, which include relational edges representing the relationship between chemotherapy regimens and administration events, the relationship between administration events and chemotherapy cycles, the relationship between patients and symptoms, the relationship between patients and vital signs, and the relationship between patients and laboratory indicators. Set a time attribute for the relationship edge. The time attribute includes absolute time and relative chemotherapy time. The relative chemotherapy time consists of a chemotherapy cycle identifier and a relative number of days. The relative number of days is calculated based on the absolute time and the absolute time corresponding to the drug administration event. Output the aforementioned time-series knowledge graph.
3. The method for early warning of adverse reactions to gynecological chemotherapy at home based on knowledge graphs according to claim 1, S2 includes: Extract relational facts with time attributes from the temporal knowledge graph, and determine the head entity node, tail entity node, relation edge, absolute time, chemotherapy cycle identifier, and relative number of days for each relational fact; The head entity node, the tail entity node, and the relation edge are respectively input into the entity embedding layer and the relation embedding layer of the temporal knowledge graph embedding model to generate the entity node embedding vector and the relation edge embedding vector. The absolute time is input into the first time embedding layer of the time-series knowledge graph embedding model to generate the first time embedding, and the chemotherapy cycle identifier and the relative number of days are input into the second time embedding layer of the time-series knowledge graph embedding model to generate the second time embedding. The entity node embedding vector, the relation edge embedding vector, the first time embedding and the second time embedding are input into the scoring calculation module to obtain the relation fact score for each relation fact; The parameters of the temporal knowledge graph embedding model are updated based on the relational fact scores, so that the relational fact scores of real relational facts are higher than the relational fact scores of preset negative sample relational facts. Output the entity node embedding vector, the relation edge embedding vector, and the time embedding corresponding to the relation fact, wherein the time embedding includes the first time embedding and the second time embedding.
4. The method for early warning of adverse reactions to gynecological chemotherapy at home based on knowledge graphs according to claim 1, S3 includes: Obtain the target time window for patients to be warned, wherein the target time window is determined by the target chemotherapy cycle identifier and the target relative number of days range; From the temporal knowledge graph, identify the chemotherapy regimen nodes, drug administration event nodes, chemotherapy cycle nodes, symptom nodes, vital sign nodes, and test indicator nodes associated with the patient to be warned, and extract the relational edges connecting the nodes to form a subgraph to be reasoned. The entity node embedding vector, relation edge embedding vector, and time embedding are mapped to the subgraph to be inferred, and the subgraph to be inferred and the target time window are input into the path inference network to perform multi-round iterative propagation. In each round of iterative propagation, for each relation edge in the subgraph to be inferred, the relative chemotherapy time corresponding to the relation edge is obtained and matched with the target relative number of days range to obtain a time window matching coefficient. When the relative chemotherapy time falls into the target relative number of days range, the time window matching coefficient is set to a first preset value. When the relative chemotherapy time does not fall into the target relative number of days range, the time window matching coefficient is determined based on the distance between the relative chemotherapy time and the target relative number of days range and is made less than the first preset value. The propagation information of the relation edge is gated and weighted using the time window matching coefficient, and the node representation of each entity node in the subgraph to be inferred is updated. After completing the multi-round iterative propagation, the risk score corresponding to the at least one adverse reaction classification node is calculated based on the node representation corresponding to the at least one adverse reaction classification node, and the relational edge sequence used to generate the risk score is recorded as predecessor information during the calculation of the risk score. Output the risk score and the precursor information.
5. A knowledge graph-based method for early warning of adverse reactions to gynecological chemotherapy at home, as described in claim 1, wherein S4 includes: The risk score and precursor information are input into the evidence chain extraction module. Based on the precursor information, the starting node and target node of the candidate path corresponding to the risk score are determined. The starting node is a chemotherapy regimen node or a chemotherapy cycle node, and the target node is an adverse reaction grading node or a treatment recommendation node. The candidate paths are expanded using a beam search to generate a set of path sequences. During the path expansion process, an evidence chain template constraint is applied. The evidence chain template constraint is used to limit the node type sequence of each candidate path to include at least the following nodes in sequence: chemotherapy regimen node, chemotherapy cycle node, evidence node, adverse reaction grading node, and treatment recommendation node. The evidence node includes symptom node, vital sign node, and test indicator node. Candidate paths that satisfy the evidence chain template constraints are scored based on the risk score and the propagation contribution of the relation edges contained in the candidate paths, and the candidate paths are ranked according to the path scores. The top-ranked candidate path in the output ranking results is used as the evidence chain.
6. The method for early warning of adverse reactions to gynecological chemotherapy at home based on knowledge graphs according to claim 1, S5 includes: Input the chain of evidence and risk score into the early warning output module; Based on the evidence chain, determine the adverse reaction name and adverse reaction grade corresponding to the adverse reaction grade node in the evidence chain, and extract the target time window corresponding to the chemotherapy cycle node from the evidence chain. The risk score is compared with a preset warning threshold. When the risk score is greater than or equal to the warning threshold, an adverse reaction warning result is generated. When the risk score is less than the warning threshold, an adverse reaction monitoring result is generated. The adverse reaction early warning results include the adverse reaction name, adverse reaction grade, target time window, risk score, and evidence chain; the adverse reaction monitoring results include the adverse reaction name, target time window, risk score, and evidence chain. Output the adverse reaction early warning result or the adverse reaction monitoring result.
7. A knowledge graph-based method for early warning of adverse reactions to gynecological chemotherapy at home, as described in claim 3, is characterized in that... The negative sample relation facts include time negative sample relation facts, which are relation facts obtained by replacing the absolute time and / or replacing the chemotherapy cycle identifier and relative number of days while keeping the head entity node, tail entity node and relation edge unchanged.
8. A method for early warning of adverse reactions to gynecological chemotherapy at home based on knowledge graphs according to claim 4, characterized in that, After the time window matching coefficient is determined based on the relative chemotherapy time and the target relative number of days range, it is further multiplied by the data confidence coefficient corresponding to the relationship fact to obtain the final gating coefficient used for gating weighting.
9. A knowledge graph-based method for early warning of adverse reactions to gynecological chemotherapy at home, as described in claim 4, is characterized in that... The gating weighting is performed during the edge message calculation stage. Specifically, for each relation edge, the edge message is first calculated based on the relation edge embedding vector and the time embedding. Then, the edge message is multiplied by the time window matching coefficient and used to participate in the node representation update.
10. A knowledge graph-based method for early warning of adverse reactions to gynecological chemotherapy at home, as described in claim 5, is characterized in that... The evidence chain template constraint is represented by a finite state machine or regular syntax rules and is used to limit the set of node types that the next hop is allowed to expand when the path is expanded.