An intelligent care plan response method and system
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHONGSHAN HOSPITAL FUDAN UNIV
- Filing Date
- 2023-08-14
- Publication Date
- 2026-06-09
Smart Images

Figure CN116992002B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent device technology, and more particularly to the field of intelligent rehabilitation response devices. Background Technology
[0002] Nursing care plays a vital role in patient recovery. It is a professional medical service that provides comprehensive and personalized care by fully assessing and managing the patient's physical and psychological state to promote recovery and health. This is especially true for postoperative patients, where discharge care is crucial for their rehabilitation. Postoperative nursing care includes monitoring the patient's physical condition, assisting with rehabilitation exercises, and guiding them on appropriate diet and lifestyle. Patients require long-term recovery and treatment after discharge, and the quality of discharge care directly impacts their recovery outcome. Discharge care is a critical part of the postoperative period; appropriate discharge care can effectively promote patient recovery and improve their quality of life.
[0003] Traditional, diversified health education methods can only meet part of patients' needs, lacking specificity, timeliness, and interactivity. On the one hand, patients have limited access to and understanding of health knowledge, making it extremely difficult to find relevant information from a large amount of static data, significantly impacting their self-monitoring and home-based health management. On the other hand, online searches for medical and health information are often unreliable and contain many pitfalls, raising questions about their authenticity and authority. Patients, relying on their own knowledge, struggle to effectively discern the validity and practicality of medical information. Currently, post-discharge self-care for patients remains largely a matter of "self-management," which is detrimental to their recovery. Summary of the Invention
[0004] To address the problems existing in the prior art, this invention provides an intelligent nursing solution response method. By analyzing multi-dimensional information such as user questions, dialogue history, and medical records, it can quickly provide accurate answers and offer comprehensive and personalized intelligent nursing solutions to help patients better manage and control their diseases and improve their quality of life after discharge.
[0005] To achieve the above objectives, the present invention provides an intelligent nursing response method, comprising the following steps:
[0006] S1, construct a patient pathology information knowledge base, a general nursing knowledge base, a nursing domain synonym knowledge base, and an attribute knowledge base;
[0007] The patient pathology information knowledge base should include at least the patient's medical records, age, medical history, and medication information;
[0008] S2, Obtain the question: Query the complete set of candidate query graphs for the question in the general nursing knowledge base constructed in step S1;
[0009] The query is performed in stages, generating the main path query graph and then sequentially implementing entity semantic restrictions, type restrictions, time restrictions, order restrictions, attribute relationship restrictions, and association relationship construction.
[0010] The attribute relationship restriction includes: extracting the attribute set from the sequence restriction candidate query graph set obtained after the sequence restriction, querying personalized information related to the attribute set in the patient pathology information knowledge base, querying query graphs related to the personalized information in the general nursing knowledge base to obtain a personalized information query graph, using the personalized information query graph to filter the sequence restriction candidate query graph set, removing the parts in the sequence restriction candidate query graph set that conflict with the personalized information query graph, and then merging them with the personalized information query graph to obtain the attribute relationship restriction query graph set;
[0011] The aforementioned relationship construction includes: extracting the answer entity from the attribute relationship restriction query graph set, querying the entity node query graph that has a relationship with the answer entity in the general nursing knowledge base, merging it with the attribute relationship restriction query graph set, and obtaining the complete set of candidate query graphs;
[0012] S3, preprocess the questions obtained in step S2. Preprocessing includes using the nursing domain synonym knowledge base constructed in step S1 to perform synonym replacement to obtain standardized questions, and obtaining the grammatical parsing graph G of the questions. gram and semantic component G i And will standardize the question and the semantic component G of the question. i Encode as a feature vector;
[0013] S4. A window-based deep neural network model is used to identify the standardized questions obtained in step S3 and perform named entity recognition of nursing information to obtain an entity set.
[0014] In the window-based deep neural network model, the nursing domain loss function shown in formula (Ⅰ) is used for calculation:
[0015]
[0016] Where n is the sample size; m is the label category; and η is the activation function, which is the model's activation of sample x. (i) The predicted probability distribution; j, k, and l are the node indices of the window layer, hidden layer, and output layer, respectively; and These are the model parameters, representing the weights from the input layer to the hidden layer and from the hidden layer to the output layer, respectively; h is the number of hidden layer nodes; c is the window size; d is the dimension of the word vectors; W is the parameters of the first layer of the network; V is the parameters of the hidden layer; C is the regularization term for nursing information entity recognition.
[0017] S5, link the entity set identified in step S4 with the complete set of candidate query graphs constructed in step S2 to obtain the first query set; extract the answer from the first query set as the answer entity, link the answer entity with the complete set of candidate query graphs constructed in step S2 to obtain the final query set;
[0018] S6, calculate the overall association score between the standardized question and the final query set obtained in step S5, select the answer with the highest score as the best query graph, and transform the best query graph into the answer statement;
[0019] S7. Match and reason with the answer statement obtained in step S6 and the patient's pathology information knowledge base to obtain the nursing measures corresponding to the answer statement and output the answer.
[0020] Preferably, in step S2, a parallel depth-first search algorithm is used in the phased query process to improve query efficiency.
[0021] Preferably, in step S2, the parallel depth-first search algorithm includes the following steps:
[0022] The search space is divided into several subspaces, each of which can be searched by an independent computing unit; multiple computing units are launched simultaneously to perform parallel searches when searching the query graph; the computing units communicate and synchronize during the search process to avoid redundant calculations; and the search results from each computing unit are merged.
[0023] Preferably, the phased query in step S2 includes the following steps:
[0024] S21. Through dependency parsing, extract "entity", "predicate", "type", "time" and "order" from standardized statements and link them to the general nursing knowledge base. All linking results are a complete set of candidate query graphs.
[0025] S22, filter the parts where the "entity" and "predicate" of the standardized questions in the candidate query graph set are connected to obtain the main path;
[0026] S23, Add entity semantic restrictions to the main path, query all entity-related query graphs in the main path from the general nursing knowledge base constructed in step S1 and link them to the main path to obtain a set of entity restriction query graphs;
[0027] S24, add type restrictions to the entity-restricted query graph set, select predicates that are directly connected to the answers in the entity-restricted query graph set for implicit type inference, and filter the inferred implicit type-related query graphs according to the "type" of the standardized question before merging them with the entity-restricted query graph set to obtain the type-restricted query graph set;
[0028] S25, add time restrictions to the type-restricted query graph set, filter the type-restricted query graph set according to the "time" of the standardized question, and remove the query graphs within the "time" that do not conform to the standardized question to obtain the time-restricted query graph set;
[0029] S26. Add order restrictions to the time-restricted query graph set. Filter the time-restricted query graph set according to the "order" of the standardized questions, and propose query graphs that do not conform to the "order" of the standardized questions, thus obtaining the order-restricted query graph set.
[0030] Preferably, in step S4, the regularization term C for nursing information entity recognition in formula (I) is obtained according to the following method:
[0031] (1) Use the NCBIDisease Corpus dataset labeled with disease names to train the model, calculate the difference between the general loss function calculation formula (II) and the actual result, and obtain the initial value C' of C;
[0032]
[0033] (2) The patient pathology information knowledge base constructed in step S1 is cross-validated using formula (Ⅲ) with the initial value C' added to C. C' is then corrected based on the validation results to obtain the value of C.
[0034]
[0035] The present invention also provides an intelligent nursing plan response system for discharged patients, including a question receiving module, a question response module, and a nursing plan output module; the question response module includes a computer-readable storage medium that can implement the methods described in the above technical solutions.
[0036] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0037] 1. This invention provides an intelligent response method and system that can generate nursing plans based on the patient's personalized pathological condition. The method adopts a phased approach to querying during the candidate query image generation stage and uses the patient's pathological data information to filter the candidate query images in order to obtain a nursing plan that is more in line with the patient's condition and actual needs, thereby improving the accuracy of the nursing plan response.
[0038] 2. In the process of neural network semantic matching, this invention optimizes the loss function of nursing information named entities, introduces a regularization term C for nursing information entity recognition in the nursing domain, corrects the gap between the predicted results and the actual results, and improves the accuracy of nursing domain entity recognition.
[0039] 3. In some preferred embodiments of the present invention, the candidate query graph is generated using a parallel depth-first approach, which significantly improves the generation rate of the candidate query graph and increases the speed of response to nursing plans. Attached Figure Description
[0040] Figure 1 This is a flowchart illustrating the intelligent nursing solution response method described in this invention. Detailed Implementation
[0041] The technical solution of the present invention will now be described with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them; and the structures shown in the accompanying drawings are merely illustrative and do not represent physical objects. It should be noted that all other embodiments obtained by those skilled in the art based on these embodiments of the present invention are within the scope of protection of the present invention.
[0042] This invention employs a lightweight and efficient neural network model to address automated question-answering tasks with complex semantics, improving the semantic similarity calculation between questions and complex query graphs. The model is based on encoding both the question and predicate sequences, representing them as semantic vectors within the same semantic space. Unlike previous methods, this invention combines the encoded vectors of each semantic component to form a semantic vector representation of the entire query graph. An ensemble approach is used to improve existing entity linking tools, enriching the candidate entities obtained from the question and further enhancing the overall task performance. Simultaneously, to compensate for the information asymmetry between the question and its semantic components, this invention uses dependency parsing to find local signals related to specific predicate sequences within the question, supplementing the literal information of the question and enabling the model to better align the question with different semantic components. Therefore, this invention provides an effective technical solution for automated question-answering tasks in the nursing field.
[0043] This invention relates to a method for constructing candidate query graphs for questions based on a pattern graph approach, and improves upon type and temporal semantic constraints. The method employs a multi-stage generation approach, improving the semantic expression and query graph complexity of the question-answering system by utilizing the pattern graph approach to construct the query graph. Furthermore, this invention proposes a lightweight neural network model for calculating the semantic matching degree between questions and query graphs. This is the first attempt in knowledge base question-answering research to learn the continuous semantic representation of a complex query graph as a whole, thereby improving the accuracy and efficiency of the question-answering system.
[0044] Furthermore, this invention improves the representation learning of questions by introducing dependency grammar paths as a supplement to the literal sequence information of the question. By associating dependency grammar paths with questions, the relationship between questions and specific semantic components can be better reflected, improving the accuracy of the question-answering system's understanding and expression of the question's intent.
[0045] Furthermore, this invention expands upon the results of existing entity linking tools through an integration method, improving the recall rate of candidate query graphs while maintaining the accuracy of entity linking without significantly impacting it. By integrating the results of existing entity linking tools, entity information in the knowledge base can be captured more comprehensively, generating candidate query graphs with richer semantics, thereby improving the recall capability and query graph quality of the question-answering system.
[0046] In summary, the main innovations of this invention include constructing candidate query graphs for questions using a multi-stage generation method, improving type and temporal semantic constraints, proposing a neural network model for learning the continuous semantic representation of complex query graphs as a whole, introducing dependency syntax paths to improve question representation, and expanding entity linking results through an ensemble method. These innovations can improve the semantic expressive power, query graph complexity, and recall rate of question-answering systems, and enhance the accuracy and efficiency of the system, bringing new breakthroughs and progress to the research and application of knowledge base question answering.
[0047] For each user-submitted question, the system first employs dependency parsing to extract local signals related to specific predicate sequences, supplementing the literal information of the question and encoding it into a semantic vector representation. Then, existing entity linking tools are used, and improved through an ensemble approach, to enrich the candidate entities obtained from the question, enabling better matching of the answer. Next, a neural network model encodes the question and predicate sequences in the complex query graph, representing them as semantic vectors within the same semantic space. The model combines the encoded vectors of each semantic component to form a semantic vector representation of the entire query graph. Finally, by calculating the semantic similarity between the question vector and candidate entities, and matching entities and relations in the query graph, the best answer is selected from the candidate entities. Experiments show that the system demonstrates strong competitiveness and accuracy on multiple automatic question-answering datasets.
[0048] Specifically, the present invention provides an intelligent nursing response method, comprising the following steps:
[0049] This invention provides an intelligent nursing response method, comprising the following steps:
[0050] S1. Construct a patient pathology information knowledge base, a general nursing knowledge base, a nursing domain synonym knowledge base, and an attribute knowledge base; the patient pathology information knowledge base shall include at least the patient's medical record information, age, medical history, and medication information.
[0051] S2, Obtain the question: Query the complete set of candidate query graphs for the question in the general nursing knowledge base constructed in step S1;
[0052] The query adopts a phased approach, generating a main path query graph and then sequentially performing entity semantic restrictions, type restrictions, time restrictions, order restrictions, attribute relationship restrictions, and association relationship construction; preferably, it includes the following steps:
[0053] 1) Generate a complete set of candidate query graphs based on a phased approach.
[0054] In this invention, generating all candidate query graphs (generating a complete set of candidate query graphs) in a phased manner means dividing the query graph generation process into multiple stages. Each stage generates a query graph based on specific semantic information, and the generated results are then filtered and adjusted in the next stage until a final set of candidate query graphs that satisfies all semantic constraints is obtained. This method makes the generated candidate query graphs more accurate and efficient, and can better adapt to different semantic constraints.
[0055] In the phased generation of candidate query graphs, this invention optimizes the candidate generation strategy, primarily utilizing implicit constraints on answer types within the query graph and special designs in the knowledge base used to maintain facts related to time periods. Four different semantic constraints are considered: entity, type, time, and order constraints. For example, in questions with complex semantics, entity constraints describe the connection between the answer and a known entity, while order constraints describe the sequence number of the answer ordered in a certain way.
[0056] (1) Related node links
[0057] This step searches for words or phrases in the question that represent relevant entities, types, times, or sequences, and links them to a knowledge base.
[0058] In this invention, the term "entity" refers to words or phrases related to specific entities in the knowledge base. When identifying entities, we can determine their nature based on the semantics of the words, the context, and domain knowledge of the question. For example, names of people, places, and organizations in a question typically represent entities.
[0059] In this invention, "type" refers to the category or classification-related words or phrases of an entity. When identifying types, we can rely on classification systems or hierarchical relationships in a knowledge base. For example, occupation, species, brand, etc., in a question typically indicate the type of an entity.
[0060] In this invention, "time" refers to words or phrases related to time, which can represent specific dates, time periods, or chronological sequences. When identifying time, we can determine it based on the semantics of the words, the context, and the way time is expressed. For example, years, dates, and time words in questions typically represent time.
[0061] In this invention, "order" refers to words or phrases related to the sequence, order, or sequential relationship between entities or events. When identifying order, we can rely on the semantics of words, context, and words indicating the order. For example, words like "first," "last," "before," and "after" in questions typically indicate a sequential relationship.
[0062] In this invention, a "candidate query graph" is a data structure generated during question comprehension and query generation to represent the query semantics and semantic constraints related to the question. It is constructed based on the semantic requirements of the question and the query graph generation strategy, aiming to capture the semantic information of the question and support subsequent answer generation and entity linking.
[0063] Relevant nodes, serving as leaf nodes in the candidate query graph (a candidate query graph is a data structure generated during question comprehension and query generation to represent query semantics and semantic constraints related to the question. It is constructed based on the semantic requirements of the question and the query graph generation strategy, aiming to capture the semantic information of the question and support subsequent answer generation and entity linking), are the starting point for different categories of semantic constraints. Possible <phrase, leaf node> pairs are listed, with the same phrase potentially corresponding to multiple candidate leaf nodes. Leaf nodes of different semantic constraint categories (entity, type, time, order) have their own linking methods. For entity linking, the existing linking tool S-MART (Scalable Matching and Reasoning Tool) is used. It uses a rule-based and similarity-based approach to match entities in the question and link them to entities in the knowledge base. S-MART also supports various types of entity matching and attribute matching and can handle various question formats, including natural language text and structured queries). S-MART is used to score all possible <phrase, entity> pairs, and at most the top ten results are retained. For type-based links, considering the limited number of different types in the knowledge base, all phrases with a length not exceeding 5 in the question are enumerated, and the cosine similarity between different phrases and types is calculated based on pre-trained word vectors. At most, the top twenty results are retained. For time-based links, all time-related words appearing in the sentence are identified using regular expressions. For sequence-based links, a predefined list of superlative adjectives (e.g., "earliest," "first," etc., superlatives describing objective facts) is used, and superlative words or ordinal numbers, such as "second," are matched in the question. The corresponding leaf node represents the sequence value; if an ordinal number is matched, the sequence value is the number corresponding to the ordinal number; otherwise, it is 1. <"earliest," 1> represents a unique sequence link generated.
[0064] (2) Generate main path
[0065] Generating the main path in a question-answering system refers to connecting an answer node to a specific entity node (the source of which is the knowledge base. In the knowledge base, entity nodes represent concrete things, objects, or concepts in the real world, such as people, places, and events. The knowledge base is a structured data storage system containing a large amount of entity information and the relationships between them. Entity nodes are represented by unique identifiers and can be connected to other entity nodes in the knowledge base. Generating the main path involves enumerating all entity nodes connected to the answer node and exploring their relationships in the knowledge base. These entity nodes can serve as intermediate nodes in the path, connecting to other entity nodes through predicates to form the main path. By traversing the connection relationships of entity nodes in the knowledge base, entity nodes related to the answer node can be obtained, and candidate main paths can be further generated.) The main path forms the basis of a query graph and represents the most essential semantics of the question. The process of generating the main path involves enumerating all linked entities and their corresponding valid predicate sequences in the knowledge base. (A "valid predicate sequence" refers to a valid predicate connection path existing in the knowledge base. Generating the main path requires a series of predicate connections from the answer node to an entity node. A valid predicate sequence is a sequence of predicates that exist and are valid connections in the knowledge base. Specifically, a valid predicate sequence consists of predicates of length 1 or 2. A predicate of length 1 represents a direct connection between the answer node and an entity node. A predicate sequence of length 2 essentially describes the association between two entities in a multi-way relation. These predicate sequences exist in the knowledge base and can be used to construct the main path of the query graph. During the main path generation process, all linked entity nodes are enumerated, and valid predicate sequences connected to the answer node are searched. These valid predicate sequences form the components of the main path, representing the most important semantics of the question. By generating different valid predicate sequences, a series of candidate main paths can be generated to represent different semantic relationships and possible interpretations of the query graph.) This process generates a series of candidate main paths. The predicate sequence has a length of 1 or 2, the latter essentially describing the association between two entities in a multi-way relation. The main path forms the basis of a query graph, representing the most essential semantics of the question.
[0066] In this invention, the main path in the query graph generation method is defined as the foundation of a query graph, representing the most important semantics of the question. Since almost all factual questions are related to at least one entity in the question, the main path is defined as a path starting from the answer and connected to an entity node through a predicate sequence, equivalent to a query graph for a simple question. This invention generates a series of candidate main paths by enumerating all linked entities and their legally connected predicate sequences in the knowledge base. The length of the predicate sequence is 1 or 2, the latter essentially describing the association between two entities in a multi-variable relation. Taking the question "What is the earliest I can take a shower after being discharged from the hospital?" as an example, when analyzing the question "What is the earliest I can take a shower after being discharged from the hospital?" and generating the main path, it is first necessary to determine the answer node and intermediate nodes. In this example, the answer node A represents the shower time, and the intermediate node v1 represents the discharge time. Both the answer node A and the intermediate node v1 are variable nodes. The following is the analysis process for generating the main path:
[0067] ① Determine the answer node: Based on the keyword "take a bath" in the question, we determine that answer node A represents the time of taking a bath.
[0068] ② Determine the intermediate node: Based on the keyword "after discharge" in the question, we determine that the intermediate node v1 represents the discharge time.
[0069] ③ Enumerate valid predicate sequences: We search the knowledge base for valid predicate sequences connected to the answer node A and the intermediate node v1. Based on the semantics of the problem, we can consider the following valid predicate sequences:
[0070] -A is a time predicate between v1, such as "after" or "after". This can be used to express the time relationship after discharge from the hospital.
[0071] -A is a time predicate between a point in time and a specific time point, such as "at" or "at". This can be used to indicate a specific time for taking a bath.
[0072] ④ Generate the main path: By combining valid predicate sequences, we can generate the main path. For example, a possible main path could be: answer node A is connected to a certain time node through the "at" predicate, and this time node is connected to the intermediate node v1 through the "after" predicate.
[0073] The above analysis yields the main path, representing the temporal relationship between bathing time and discharge time. This main path forms the basis of the query graph, representing the core semantics of the question. In practical applications, multiple candidate main paths can be obtained by generating different valid predicate sequences to more comprehensively express the semantics of the question and its possible answers.
[0074] For more complex semantic constraints, this method represents in the query graph a sequence of predicates starting from a variable node on the main path (a variable node is a node type in the query graph used to represent unknown values to be filled or concepts that need to be inferred based on the question. In question-answering systems, variable nodes are typically used to represent information that needs to be answered in the question, such as the value of the answer or other attributes that need to be queried. By parsing the question, the entities, attributes, or relationships that need to be answered are identified and then represented as variable nodes) pointing to specific leaf nodes (the entities, attributes, or relationships that need to be answered are identified based on the semantics and requirements of the question and represented as specific leaf nodes. These leaf nodes can be named according to the semantics of the question for subsequent inference and connection in the query graph).
[0075] (3) Add additional entity semantic constraints
[0076] This step aims to generate a query graph with a complex structure by expanding the semantic constraints related to entities on the main path. First, a simple pattern graph consisting only of a skeleton is sought using subject-object pairs (a subject-object pair is a linguistic concept used to describe the relationship between the subject and object in a sentence. The subject is the core component of the sentence, usually representing the entity performing the action or the subject making the action. The object is the receiver or object affected by the action in the subject-verb structure. Subject-object pairs are terms describing the relationship between the subject and object in a sentence; they together constitute the basic elements of the action or relationship in the sentence).
[0077] The following are the steps to complete the search using subject-object pairs:
[0078] First, identify the subject and object in the question. The subject is usually the entity that performs the action or the person who initiates the action, while the object is the recipient or the object affected by the action.
[0079] ii. Based on the identification results of the subject and object, find the entity nodes related to the subject and object in the query graph and use them as candidate start and end points.
[0080] iii. For each subject-object pair, generate a simple pattern graph consisting of a single predicate pointing from the subject node to the object node. This simple pattern graph contains only the skeleton structure and has no other semantic restrictions.
[0081] iv. Based on the simple pattern diagram, gradually add constraints that fit the relation triples. By identifying the constraints in the problem, such as time, type, and order, connect the corresponding constraints to the existing candidate main paths.
[0082] v. By recursively connecting new constraints to existing candidate main paths, a pattern diagram with a complex structure can be generated, which includes semantic constraints related to subject-object pairs.
[0083] Through the above steps, the semantic representation of the query graph can be expanded using subject-object pairs, generating a more complex pattern graph and enriching the structural and semantic information of the query graph to more accurately express the semantics of the question.
[0084] The generation of constrained pattern graphs starts with a simple pattern graph and gradually adds constraints that fit relation triples (a relation triple is a basic data structure in a knowledge base used to represent relationships between entities. It consists of three elements: a head entity, a relation, and a tail entity. A relation triple describes the association between the head and tail entities, specifically illustrating their semantic connection. Relation triples can be collected and constructed using the aforementioned knowledge base, corpus, and related data sources). New constraints are then recursively connected to existing candidates (existing candidates refer to pattern graphs already generated during the generation process, which contain nodes and edges and have a certain semantic representation) to generate pattern graphs with complex structures. The specific operations are as follows:
[0085] i. Start with a simple pattern graph, which may contain only a small number of nodes and edges.
[0086] ii. Traverse the set of relation triples recursively or iteratively, and examine each relation triple one by one.
[0087] iii. For each relation triple, examine the constraints, such as specific entity, type, time, or order requirements.
[0088] iv. If nodes and edges that satisfy the constraints already exist in the current pattern graph, add the constraints to the pattern graph to expand the semantic representation and complexity of the pattern graph.
[0089] v. By gradually adding constraints, new constraints can be combined with existing constraints in an iterative manner to generate more complex pattern diagrams.
[0090] To avoid generating a large number of meaningless paths, the length of predicate paths is limited to a maximum of 3. During candidate generation, a depth-first search approach is used to generate query graphs from simple to complex. For each query graph in the search space, different variable nodes and entity nodes are connected by a single predicate to construct query graphs with varying degrees of complexity. Compared to template-based candidate generation methods, the depth-first search method has higher coverage and can improve candidate generation speed by pruning query graphs that cannot generate answers.
[0091] (4) Add type restrictions
[0092] The purpose of this step is to incorporate semantic information related to the answer node into the type constraints. IsA predicates are used to connect specific related type nodes to the answer node. IsA predicates are a fundamental semantic relation in the knowledge base, used to represent the relationship between an entity and its type. For example, IsA predicates can be used to associate an entity with its category (such as "physiological," "psychological," "functional," etc.). Through IsA relations, entities in the knowledge base can be organized into a hierarchical structure, making the relationships between them clearer and more ordered. Unlike previous methods, this approach uses predicates directly connected to the answer node to infer its implicit type and filters based on type inclusion relationships to prevent semantic deviation and improve the generation speed of the candidate graph. Specifically, Freebase type hierarchy relations built through relaxed type inclusion are used to define the associations between types. If a related type does not contain any implicit types ("implicit types" refer to types associated with the answer node; they may not have direct type labels, but can be inferred through the IsA predicate and type hierarchy relationships. Specifically, the implicit type of the answer node is inferred by connecting specific related type nodes to the answer node through the IsA predicate) or is not contained by any implicit types, it is considered an irrelevant type and is not used for candidate generation. This ensures that the generated candidate graph has a certain semantic relevance to the answer node and improves the quality and speed of the candidate graph. For example, suppose there is an answer node that is a specific entity, such as "entecavir tablets," which may not have a direct type label. Through the IsA predicate, we can find type nodes related to "entecavir tablets," such as "oral medication," "antiviral," and "inhibitory drugs." These type nodes can be considered implicit types of the answer node because they are associated with the answer node, but are not necessarily directly labeled on the answer node.
[0093] (5) Add generation time and order restrictions
[0094] After adding type constraints in step (4), the types of all variable nodes on the main path can be determined, including explicit type constraints and implicit types. At this point, enumerate the specific predicates belonging to these types to complete the addition of time and order constraints.
[0095] "Specific predicates" refer to specific sequences of predicates used to represent time and order constraints. These sequences of predicates consist of two predicates of length and are used to add time and order constraints.
[0096] ① Time-bound predicates: Time constraints can be represented by a sequence of two predicates. The first predicate points to a time-related entity node, such as a specific date or time period. The second predicate is a dummy predicate used to indicate the direction of comparison with a specific time. This dummy predicate is determined by the preposition preceding the time in the question, such as "before" or "after".
[0097] ② Sequence-restricted predicates: Sequence restrictions can also be represented by a predicate sequence of length 2.
[0098] The first predicate points to an integer, floating-point number, or time-related entity node, indicating the basis for sorting.
[0099] The second predicate indicates descending order and is used to indicate the order of sorting.
[0100] The source of specific predicates is predicate information in the knowledge base. During query graph generation, predicates belonging to specific types are enumerated as needed to meet time and order constraints. For time constraints, time-related predicates such as "start time" and "end time" can be used. For order constraints, sorting-related predicates such as "rank" and "order number" can be used.
[0101] ③ By using specific predicates and integrating them with patient data, more precise time and sequence constraints can be described in query statements. This ensures that the relevant times in the question are limited to a time period, rather than simply being equivalent to a start or end point. The definitions and sources of specific predicates are predefined in the knowledge base and can be set and expanded according to specific domain and application needs.
[0102] For example, time constraints can be represented by a two-predicate sequence, where the first predicate points to time, and the second predicate is a dummy predicate indicating the direction of comparison with a specific time, determined by the preposition preceding the time in the question. Similarly, order constraints can also be represented by a two-predicate sequence, where the first predicate points to an integer, floating-point number, or time, and the second predicate indicates descending order. For time constraints, paired time predicates are used to describe more precise time constraints; these predicates describe facts related to time periods. Pairs of predicates are formed in the knowledge base through simple name matching, ensuring that the relevant times in the question are constrained to a time period, rather than simply being equivalent to a start or end time. For example, in the previous question "after discharge," the start time predicate is used for connection in the graph, but when generating the query, both the start and end predicates are used (by interfacing with patient data to retrieve the patient's discharge time up to the current day), thus ensuring that the relevant times in the question are constrained to a time period, rather than simply being equivalent. Compared to existing systems, this step uses fewer manual rules for candidate graph generation and improves upon type and time constraints, accelerating the generation process while providing more accurate semantic constraints.
[0103] In the process of generating a phased candidate query graph, this invention optimizes the candidate generation strategy. In addition to utilizing the implicit restrictions on answer types in the query graph, it also introduces semantic relationships from the knowledge base and utilizes other semantic relationships in the knowledge base, such as attribute relationships and association relationships, to further optimize the candidate query graph generation process.
[0104] In the nursing knowledge base, besides IsA relationships, other semantic relationships exist, such as attribute relationships and association relationships. These relationships can further guide the generation process of candidate query graphs, enhancing the semantic expressiveness of the query graphs. The following is a detailed description of the processing procedure:
[0105] ④ Utilizing Attribute Relationships: Attribute relationships describe specific attributes or characteristics of an entity. During the generation of the candidate query graph, attribute relationships can be used to limit or filter candidate nodes. For example, for a given entity node, attribute relationships can be used to find attribute nodes related to that entity and these can be used as leaf nodes in the candidate query graph. This further constrains the semantics of the query graph and improves the quality of the candidate graph.
[0106] Suppose the task of generating a candidate query graph is to answer the question: "What is patient A's body temperature?" Find attribute relationships related to the patient in the knowledge base, such as the "body temperature" attribute. Using this attribute relationship, filter out attribute nodes related to patient A's body temperature and treat them as leaf nodes in the candidate query graph. This attribute node, represented as "body temperature," is connected to the patient A entity node to form a candidate query graph. In the query graph, this attribute node serves as a leaf node, representing the body temperature information of interest in the question.
[0107] By utilizing attribute relationships to restrict candidate nodes, the quality of the candidate graph can be improved by ensuring that the generated query graph is consistent with the semantic requirements of the question. In the nursing field, attribute relationships can involve specific attributes of patients, such as physiological parameters, medical history, and diagnostic results. By utilizing these attribute relationships, more accurate and targeted candidate query graphs can be generated, providing answer candidates related to specific patient attributes.
[0108] ⑤ Utilization of Associations: Associations describe the relationships or connections between entities. During the generation of the candidate query graph, associations can be used to introduce more relevant entity nodes. By traversing these associations, other entity nodes related to the answer node can be discovered and added to the candidate query graph. This enriches the semantic content of the query graph and provides more comprehensive answer candidates.
[0109] In the nursing field, relationships can be used to describe the associations or connections between entities, such as the association between a patient and a disease. Here's an example illustrating how relationships can be used to introduce more related entity nodes:
[0110] Suppose the task of generating a candidate query graph is to answer the question: "What diseases does patient A suffer from?" In the knowledge base, we find the entity node of patient A and then find the disease nodes related to patient A through association relationships. By traversing the association relationships, we can discover the disease nodes associated with patient A and add them to the candidate query graph. The candidate query graph will then contain relevant disease nodes suffered by patient A, thus providing a more comprehensive range of answer candidates.
[0111] By leveraging relationships to introduce more relevant entity nodes, the semantic content of the query graph is enriched, allowing it to encompass more information related to the question. In the nursing field, relationships can involve connections to a patient's medical history, medication history, surgical records, and more. By traversing and utilizing these relationships, a more relevant and comprehensive candidate query graph can be generated, providing patient-related answer candidates.
[0112] In the candidate generation process, a depth-first search approach is used to generate the query graph from simple to complex. This invention also employs a parallel depth-first search algorithm. Parallel depth-first search explores different query paths simultaneously. This allows multiple computing units to search the candidate query graph in parallel, accelerating the search speed.
[0113] The following is an explanation of the parallel search process:
[0114] (1) Divide the search space: Divide the entire search space into multiple subspaces, each containing a subset of possible query paths. The partitioning can be based on different strategies, such as uniform partitioning or adaptive partitioning. Each subspace can be searched by an independent computational unit.
[0115] (2) Parallel Search: The partitioned subspace is assigned to different computing units, and multiple computing units are started simultaneously to perform parallel search. Each computing unit independently executes the search algorithm, explores its assigned subspace, and generates a candidate query graph.
[0116] (3) Communication and Synchronization: During parallel search, different computing units may explore query paths with overlapping parts. To avoid duplicate calculations and redundant results, communication and synchronization operations are required. Computing units can exchange information and share visited paths or results through message passing or shared memory to avoid duplication of work.
[0117] (4) Result Merging: After all computing units have completed their search tasks, the candidate query graphs they generated need to be merged. The merging method can be designed according to specific circumstances, such as merging for deduplication or merging for sorting. Finally, the generated candidate query graphs can be used for further semantic matching and answer generation.
[0118] The pseudocode is described as follows:
[0119]
[0120]
[0121] In the pseudocode for the parallelized depth-first search described above, parallel loops are used to explore each neighbor node simultaneously, thus achieving parallel computation. Each parallel subtask is independent, and conflicts between different search paths are avoided by creating new path replicas. When the search reaches a leaf node, the current path is added to the candidate query graph list. No backtracking is required because each search path is independent and there is no shared state. Through parallel computation, multiple search paths can be explored simultaneously, thereby greatly accelerating the generation speed of the candidate query graph.
[0122] By parallelizing the depth-first search algorithm, multiple computing units can be used to search different query paths simultaneously, making full use of computing resources and accelerating the generation of candidate query graphs. Parallel search can explore more paths and provide more candidate results in a shorter time, thereby improving the efficiency and performance of the system.
[0123] S3, preprocess the questions obtained in step S2. Preprocessing includes using the nursing domain synonym knowledge base constructed in step S1 to perform synonym replacement to obtain standardized questions, and obtaining the grammatical parsing graph G of the questions. gram and semantic component G i And will standardize the question and the semantic component G of the question. i Encode as a feature vector; where the semantic components (including constraint semantic components and intent semantic components) are the paths where each leaf node is located;
[0124] Encoding the preprocessed questions and semantic components into feature vectors converts natural language text into a numerical form that computers can process, enabling further application in various algorithms and facilitating subsequent semantic similarity calculations. (Semantic similarity refers to the degree of similarity between two sentences, words, or phrases in meaning. Semantic similarity is a crucial concept in natural language processing, playing a vital role in many tasks such as question-answering systems, text classification, and information retrieval.)
[0125] i. Semantic component encoding method
[0126] For the predicate sequence of semantic components First, through the word vector matrix Transform the original sequence into word vectors Where |V w | represents the number of words in the natural language, and d represents the dimension of the word vector. Then, the semantic vector of the entire name sequence is calculated using a word averaging method, i.e. For predicate numbering sequence Treat the entire sequence as a whole, and based on the sequence-level vector matrix Directly convert to semantic vector representation, where |V p| represents the number of distinct number sequences in the training data. The reason for treating the number sequence as a whole, rather than using the vector average of the numbers or a recurrent neural layer to represent the semantics, is threefold: 1) Based on the candidate graph generation method, the length of the predicate number sequence for each semantic component does not exceed 3; 2) Typically, shuffling and rearranging a single predicate sequence results in an invalid sequence that will not appear in other query graphs; 3) The number of distinct predicate sequences is approximately equal to the number of distinct predicates in the knowledge base, without causing exponential growth. Adding the vectors of the name sequence and the number sequence positionally yields the vector representation of a single predicate sequence, p = p (w) +p (id) .
[0127] Meanwhile, in semantic component encoding, when calculating the semantic vector of the entire noun sequence using word averaging, TF-IDF weighting is applied. The weighting process is explained below.
[0128] i. Term Frequency Statistics: Based on the constructed nursing knowledge base corpus, the term frequency (TF) of each word in each document of the corpus is calculated, which is the number of times the word appears in the document. By statistically analyzing the term frequency of each word, we can understand the importance of each word in the document.
[0129] ii. Inverse Document Frequency (IDF) Calculation: Calculate the Inverse Document Frequency (IDF) for each word. IDF represents the rarity of a word within the entire corpus, thus measuring its distinctiveness and importance. It is calculated by dividing the total number of documents in the corpus by the number of documents containing the word, and then taking the logarithm. IDF can help identify words that are relatively rare but important within the entire corpus.
[0130] iii. TF-IDF Calculation: The TF-IDF value for each word is calculated by combining term frequency and inverse document frequency. The TF-IDF value equals the term frequency multiplied by the inverse document frequency. This value measures the importance and distinctiveness of a word within a document. Words with high TF-IDF values are relatively more meaningful and important.
[0131] iv. Weighted Processing: Based on the calculated TF-IDF values, assign corresponding weights to each word. These weights can be used as components of the feature vector to represent the importance and semantic information of the word in the name sequence. The weights can be used as coefficients in the word vectors and multiplied by the word vectors to obtain the weighted word vector representation.
[0132] By using TF-IDF weighting, words with higher importance and discriminative power can be highlighted, thus better capturing the semantic information of name sequences in the nursing knowledge base. This weighting method improves the expressive power of feature vectors, enabling computers to more accurately understand and process nursing knowledge in subsequent tasks such as semantic similarity calculation.
[0133] ii. Encoding of questions
[0134] Encoding questions requires consideration of both global and local levels, aiming to capture semantic information related to a specific semantic component p within the question. For encoding the global semantics of the question, the input information is the sequence of question words. The word sequence is vectorized using the same word vector matrix Ew, resulting in... The input is passed through a bidirectional GRU layer (a bidirectional GRU layer is a structure of a recurrent neural network (RNN) that uses bidirectional gated recurrent units (GRUs). GRUs are an improved RNN unit with stronger modeling capabilities and better gradient propagation characteristics. In a bidirectional GRU layer, the input sequence is simultaneously fed into GRU units in two directions, namely forward and backward. The forward GRU unit computes the output step by step according to the order of the input sequence, while the backward GRU unit computes in reverse order of the input sequence. In this way, the bidirectional GRU layer can consider the contextual information of the current position at the same time, thereby capturing more comprehensive sequence information), and the last hidden state of the forward and backward sequences is concatenated to form the semantic vector of the entire word sequence.
[0135]
[0136] To represent the local semantics of a question, the core lies in extracting information corresponding to specific semantic components. In the model, dependency parsing is used to find the dependencies between the answer and entities in the semantic components. Another bidirectional GRU layer with different parameters is used to encode the dependency paths and generate vector representations. This includes grammatical features as well as features directly related to the semantic component p. Finally, the sentence vectors at both granularities are added positionally to obtain the vector representation of the entire question corresponding to the specific semantic component.
[0137] iii. Semantic merging
[0138] Given a query graph G = {p} with N semantic components (1) ,…,p (n)Each semantic component has been projected onto different vectors in the same continuous semantic space, reflecting different aspects of hidden features. Inspired by the application of convolutional neural networks to two-dimensional image processing, the overall feature representation of an image depends on the existence of certain local regions whose patterns match the corresponding hidden features, while ignoring the relative positions of these local regions. Considering that multiple semantic components within a complex query graph are parallel and have no order among them, the model performs max pooling on the vector representations of semantic components (Max Pooling is a commonly used pooling operation used to extract the maximum value from a set of vectors. In semantic representation, max pooling is used to obtain the combined semantic representation of the entire query graph. Specifically, in the query graph, each node is represented as a vector, representing the semantic information of the node. The max pooling operation selects the maximum value from the vectors of all nodes for each dimension (feature), forming a new vector as the combined semantic representation). Correspondingly, for the question semantic representation corresponding to each semantic component, the same max pooling operation is performed, merging multiple semantic vectors into the overall representation of the question. Finally, cosine similarity is used to calculate the semantic similarity between the question and the entire query graph:
[0139]
[0140] Based on the above framework, the semantic similarity model can make the question comparable to individual semantic components as much as possible, while capturing complementary semantic features between different parts of the query graph.
[0141] S4. A window-based deep neural network model is used to identify the standardized questions obtained in step S3 and perform named entity recognition for nursing information to obtain an entity set.
[0142] In this invention, nursing information includes medical orders, nursing orders, and medical records. Entity samples are labeled for five defined nursing information domains to achieve named entity recognition within the domain. The entity recognition result is an entity set E = (e1, e2, e3, ..., en), where n is the number of entities and ei is an entity. Named entity recognition employs a window-based deep neural network model. The loss function (a loss function is used to measure the difference between the model's prediction and the actual result. The goal of the deep neural network model is to minimize the loss function, making the model's prediction as close to the actual result as possible) is used.
[0143] In the window-based deep neural network model, this invention uses the nursing domain loss function shown in formula (Ⅰ) for calculation:
[0144]
[0145] Where n is the sample size; m is the label category; and η is the activation function, which is the model's activation of sample x. (i) The predicted probability distribution; j, k, and l are the node indices of the window layer, hidden layer, and output layer, respectively; and These are the model parameters, representing the weights from the input layer to the hidden layer and from the hidden layer to the output layer, respectively. By penalizing the sum of the squares of these weights, we can prevent the model from over-relying on certain features, thereby improving the model's generalization ability; h is the number of hidden layer nodes; c is the window size; d is the dimension of the word vectors; W is the parameters of the first layer network; V is the parameters of the hidden layer; C is the regularization term for nursing information entity recognition.
[0146] In this model, the regularization term C for entity recognition in nursing information is a constant that adjusts the convergence speed of the loss function. In the entity recognition stage, the constant C is a hyperparameter in the loss function, commonly referred to as the regularization term. It is used to balance two objectives: minimizing the negative log-likelihood loss and reducing model complexity. To obtain this empirical parameter, this paper first uses the publicly available biomedical disease entity recognition dataset NCBI Disease Corpus (a biomedical disease entity recognition dataset containing disease name annotations) to train the model and obtain initial values. Then, cross-validation was performed using nursing-related test datasets obtained from the project's practical experience to adjust the parameters and obtain a parameter C that yields better results.
[0147] In addition to minimizing the negative log-likelihood, the loss function also includes L2 regularization terms for W and V, where W is the parameter of the first layer (the parameter of the first layer is usually determined by the input data; that is, the parameter of the first layer is jointly determined by the input data and the model structure). In a neural network, the first layer is usually the input layer, and its parameters mainly include the dimension of the input data and the input weights of the model. The first layer of a neural network is usually called the input layer, and the parameters of this layer include the dimension of the input data and the input weights of the model. In this invention, the dimension of the input data refers to the number of features in the text, i.e., how many meaningful information units, such as words and letters, are contained in the text. The dimension of the text determines how many neurons the input layer of the neural network needs to receive and process this information. In this invention, the input weights refer to the fact that in a neural network, each neuron is connected to all neurons in the previous layer, and each connection has a weight. For neurons in the input layer, the input weights are the weight matrix used to map the input data to the hidden layer. This means that the input data is processed through the product of the weights and the activation function. The processing transforms textual information into a representation that the neural network can understand and process. This representation is then passed to other layers of the neural network for further processing and classification. The dimensionality of the input data depends on the number of features, while the input weights are weight matrices used to map the input data to the hidden layers. Additionally, the first layer may include bias terms to adjust the model's offset, further improving its performance. --V represents the parameters of the hidden layers (in neural networks, the parameters of hidden layers typically include weight matrices and bias terms. These parameters are used to map the input data to the hidden layers, thereby achieving...). (Feature extraction and nonlinear transformation). The reason is that the parameters of the softmax function are redundant, meaning the minimum point is not unique. To make the solution unique, this regularization term is added. On the other hand, from a probabilistic perspective, L2 regularization is equivalent to adding a Gaussian prior to the parameters, controlling the variance of the parameters, and penalizing excessively large parameters, which helps improve the generalization ability of the model. The penalty factor λ adjusts the weight of the regularization term; the larger the value, the greater the penalty for large parameters. Hereafter, λ is simply taken as c. It should be noted that the regularization term does not include bias parameters b1 and b2. The formula provided by this invention can improve the accuracy of entity recognition in the nursing field.
[0148] In this invention, the regularization term C for nursing information entity recognition in formula (I) is obtained according to the following method:
[0149] (1) Use the NCBIDisease Corpus dataset labeled with disease names to train the model, calculate the difference between the general loss function calculation formula (II) and the actual result, and obtain the initial value C' of C;
[0150]
[0151] (2) The patient pathology information knowledge base constructed in step S1 is cross-validated using formula (Ⅲ) with the initial value C' added to C. C' is then corrected based on the validation results to obtain the value of C.
[0152]
[0153] During semantic merging, vector normalization is performed on the semantic representations of the question and query graph separately. This ensures that the question and query graph have similar scales in semantic representation, facilitating subsequent similarity calculations or other semantically related operations. The semantic representations of the question and query graph are normalized using formulas. Perform vector normalization (MinValue and MaxValue are the minimum and maximum values, respectively).
[0154] The semantic representation of a question can be represented as a feature vector, which is then normalized. Normalization ensures that the semantic representation of the question has a consistent range of values across all dimensions, preventing features with large values in certain dimensions from having an excessive impact on the overall similarity calculation.
[0155] For the semantic representation of the query graph, the feature vector of each node can be normalized. This ensures that the semantic representation of different nodes has a consistent range of values across all dimensions, facilitating similarity calculations or other semantically related operations between nodes.
[0156] S5, Link the entity set identified in step S4 with the complete set of candidate query graphs constructed in step S2 to obtain the final query set;
[0157] Step S5 expands the existing entity linking results based on an integrated approach. The goal of entity linking is to match specific words or phrases in the text with entities in the knowledge base to obtain more information about these entities. The linking probability can be calculated based on various factors, including the context of the words in the text, the frequency of the entities in the knowledge base, and the semantic similarity between the entities and words.
[0158] This approach leverages an ensemble method to expand entity linking results, addressing the issue of generated results prioritizing high accuracy at the expense of recall. The goal is to achieve a better balance between accuracy and recall in the entity linking step. (The ensemble method involves combining the results of multiple entity linking tools to obtain more comprehensive and accurate results. By combining the outputs of multiple tools, the limitations of each tool can be mitigated, achieving a balance between accuracy and recall.) Expanding entity linking further enhances the overall performance of the question-answering system and serves as a valuable complement to semantic matching models. First, a large <phrase, entity> mapping table is established using the existing nursing knowledge base. Then, each <phrase, entity> pair is associated with a set of statistical features, including the entity's link probability (the probability of associating a specific word or phrase with an entity in a knowledge base in natural language processing or information retrieval tasks. This probability can be expressed as the degree of association or relevance between an entity and a given word or phrase), word-level Jaccard similarity (Jaccard similarity is a metric used to measure the similarity between two sets. It measures the ratio of the intersection elements to the union elements of two sets), triplet-level Jaccard similarity, and the entity's popularity in the knowledge base. Finally, a two-layer fully connected linear regression model is used, with all phrase-entity pairs appearing in the S-MART link results as training data to fit the S-MART link score for each pair. After the model is trained, a virtual link score is calculated for each pair of entries in the phrase-entity correspondence table. For each question, select the K entries that are not in the existing S-MART results and whose scores rank in the top K, as an expansion of the entity linking results. The threshold K (threshold K is a hyperparameter in machine learning or statistical models used to control the model's decision boundary or classification threshold. It is a pre-set value used to determine whether the continuous values or probabilities of the model's output reach or exceed the threshold, thus making binary or multi-class classification decisions) is the model hyperparameter (model hyperparameters are parameters that need to be manually set in machine learning or statistical models to control the model's behavior and performance. These parameters are usually set before model training and remain unchanged during training).
[0159] The goal of entity linking is to match specific words or phrases in text with entities in a knowledge base in order to obtain more information about those entities. Link probabilities can be calculated based on various factors, including the context of the word in the text, the frequency of the entity's occurrence in the knowledge base, and the semantic similarity between the entity and the word.
[0160] Considering contextual information when expanding entity links can help improve the accuracy and recall of entity links. Other semantic information about the question, the question's context, and the association between the question and candidate entities can be used to assist in entity linking decisions, resulting in more accurate linking results.
[0161] This invention uses a Long Short-Term Memory (LSTM) network model for context modeling. The model construction steps are as follows:
[0162] (1) Data Preprocessing: First, the nursing-related problem data needs to be preprocessed. This includes steps such as text cleaning, word segmentation, and vocabulary construction. The problem text is converted into a numerical form that the model can process.
[0163] (2) Constructing a word embedding layer: In order to represent the text as a vector, word embedding technology is used to map words to a continuous low-dimensional vector space. A word embedding layer is constructed to represent each word as a vector.
[0164] (3) Constructing the LSTM model: LSTM is a recurrent neural network model suitable for sequential data, capable of capturing long-term dependencies. The following steps can be followed when constructing an LSTM model:
[0165] i. Define the input layer: The preprocessed text data is used as the input sequence. Each word can be represented as a vector, and they are arranged in order to form the input sequence.
[0166] ii. Define the LSTM layer: An LSTM layer consists of a series of LSTM units, each containing an input gate, a forget gate, an output gate, and a memory unit. An appropriate number of LSTM layers and hidden units can be chosen to suit the complexity of the model and the task requirements.
[0167] iii. Define the output layer: After the LSTM layer, a fully connected layer or output layer can be added for prediction or classification tasks. The configuration of the output layer depends on the specific problem.
[0168] iv. Compiling the model: Compile the LSTM model using the cross-entropy loss function and the SGD optimizer.
[0169] (4) Model Training: The preprocessed problem data is input into the LSTM model for training. The model weights are updated using the backpropagation algorithm and optimizer, enabling the model to gradually learn the patterns and correlations in the problem data.
[0170] (5) Model evaluation: The model is evaluated using a reserved test set, and the model’s performance indicators on nursing-related issues are calculated, such as accuracy, recall, F1 score, etc.
[0171] By constructing LSTM models, their memory units and gating mechanisms can be used to model long-term dependencies and capture contextual information within a sequence of questions. This helps improve the understanding and answering capabilities of nursing questions.
[0172] S6, calculate the overall association score between the standardized question and the final query set obtained in step S5, select the answer with the highest score as the best query graph, and transform the best query graph into the answer statement;
[0173] To predict the optimal query graph from a set of candidates, S(q,G) represents the overall association score between the question q and the query graph G. The semantic matching model in the previous section focused on predicate path-level similarity, while the overall association score involves more dimensions of features, such as the confidence of entity links and the structural features of the query graph itself. Therefore, S(q,G) is obtained by weighted summation of features at the entity link, semantic matching, and query structure levels. The entity link feature is the sum of link scores and the source of each link (S-MART or link extension); the semantic matching feature is the semantic similarity S between the question and the entire query graph in S3. rm (q,G); the query graph structure features include the number of different category constraints, the main path length, and the number of final answers output. We use the maximum margin loss function for model training to maximize the score difference between the better query graph G+ and the worse query graph G-:
[0174] loss = max{0,λ-S(q,G)} + )+S(q,G + )}
[0175] Since this question-answering dataset only contains correct answers and does not label query graphs, positive and negative samples are distinguished based on the F1 score corresponding to the answer generated by the query graph. For each query graph with an F1 score higher than a certain threshold (set to 0.1), it is regarded as a positive sample G+, and up to 20 query graphs with lower F1 scores are randomly selected from the candidate set as G- to form different sample pairs.
[0176] Transforming the optimal query graph into an answer statement involves extracting the specified knowledge from the constructed nursing knowledge base and converting it into a logical formula. After extracting relevant information from the knowledge graph, this information is then transformed into logical formulas. Here, the triples in the knowledge graph will be encoded.
[0177] First, convert all entities in the information into logical variables. For example, primary liver cancer, post-surgery, two weeks, and medication are encoded as b1, o1, t1, and d1, respectively. Then, convert the predicate into conjunctions, resulting in encodings such as →, ∨, or ∧.
[0178] Through these two steps, the subgraphs in the knowledge graph are transformed into a set of formulas. This set of formulas encompasses all the content in the subgraphs. After this encoding transformation, the logical reasoning module can then use it. Formula S:
[0179] S={b1∧o1∧t1→d1}
[0180] Information is extracted and diseases are stored in variables b1, b2, ..., bn. Symptoms are stored in variables a1, a2, ..., an. This method ultimately transforms the subgraphs in the knowledge graph into logical variables. Furthermore, relationships such as correlation, union, intersection, and non-correspondence exist among the variables.
[0181] S7. Match and reason with the answer statement obtained in step S6 and the patient's pathology information knowledge base to obtain the nursing measures corresponding to the answer statement and output the answer.
[0182] This involves matching and reasoning with existing knowledge graphs to provide more accurate answers. This includes, but is not limited to, ontology-based knowledge representation, rule-based reasoning, statistical natural language processing, and filtering of answer sets.
[0183] The set of formulas derived from the patient's questions, historical dialogues, and information from multiple patient data sources represents a collection of all possible outcomes. The reasoning module's role is to infer and remove nursing knowledge from this set that does not meet the given conditions. For example, the set of formulas derived from the patient's nursing questions is as follows:
[0184] f1=(b1→a2∨a3∨a4∨a7)∧(b2→a5∧a6∨a7∨a8)∧(b3→a7∨a8∨ a9)∧(b1∧t1→a1)∧(b6∧u1→a6∨a8∨a9)∧(b1→a7)∧(b2→a7) ∧(b2→a8)∧(b3→a7)∧(b3→a8)∧(b4→b3)∧(b5→b3)∧(b6∧u1→a8)∧(b1→c1)∧(b1∧t1→c2)∧(b2→c3)∧(b4→c4)∧(b5→c5)
[0185] By expressing the information from the user's care assessment as a formula, we obtained information that the user had no risk of pressure ulcers and no risk of falls. Therefore, we can conclude that...
[0186] f2 is chosen as disjunction because, during the platform's response, the "contribution" of each nursing risk factor is calculated based on the knowledge base, representing the probability of a potential risk. From a logical reasoning perspective, if conjunction is chosen, then the satisfiability judgment of (b1→a2∨a3∨a4∨a7)∧f2 must be false.
[0187] The logical formula f in the R&D program continues the combination of logical variables. Different variables are combined in AND, OR, and NOT forms, and finally assigned to the variable f to form a logical equation. In the inference module, the intersection of formula f and the pre-set nursing intervention b in the database is used to verify whether the disease meets the requirements. This is done using the SMT solver z3. The z3 solver is created using the `solver` method and can generate an answer. Constraints, i.e., the logical equation f, are added using the `add` method. The `check` method calculates whether a solution exists after the constraints are added. If a solution exists, `sat` is displayed. At this point, the program adds nursing intervention b to the nursing intervention candidate set, completing the inference module's operation of filtering nursing interventions and generating the nursing intervention.
[0188] To test the performance of the intelligent nursing solution response method described in this invention in simple semantic scenarios, open-domain question answering experiments were conducted using the ComplexQuestions dataset (downloaded from https: / / github.com / syxu828 / QuestionAnsweringOverFB). The primary purpose of this dataset is to conduct supplementary experiments to verify the performance of models capable of answering complex questions in simple semantic scenarios. By using this dataset, the performance of the method described in this invention in handling questions of varying difficulty levels was evaluated, and the capabilities of the question answering system were further improved.
[0189] The average F1 score is a commonly used evaluation metric to measure the accuracy and completeness of a question-answering system's responses. It combines precision and recall to comprehensively assess the system's performance.
[0190] In question-answering systems, precision refers to the percentage of correct answers provided by the system, while recall refers to the percentage of correct answers the system can find out of all correct answers. The F1 score is the harmonic mean of precision and recall, focusing more on the system's performance while maintaining high precision and high recall simultaneously.
[0191] The steps to calculate the average F1 score are as follows: First, calculate the F1 score between the system's answer and the standard answer for each test question. Then, average the F1 scores for all questions. A higher average F1 score indicates better accuracy and completeness in the system's answer to the questions.
[0192] For experimental comparison, the average F1 score was used as the primary evaluation metric in end-to-end testing on the CompQ dataset, ignoring case sensitivity during F1 score calculation. This quantifies the overall performance of the system on the CompQ dataset. The relative performance of the method described in this invention is verified by comparing the average F1 scores of different methods or models. The calculation results are shown in Table 1. On the CompQ dataset, the method of this invention outperforms other existing methods, improving the average F1 score by 1.8.
[0193] Table 1
[0194]
[0195]
[0196] Experimental results show that the method described in this invention demonstrates superior performance on complex question datasets and remains competitive on simple question datasets. Further comparative experiments show that learning the overall continuous feature representation of the query graph helps improve the performance of the question-answering system.
[0197] The present invention also provides an intelligent nursing plan response system for discharged patients, including a question receiving module, a question response module, and a nursing plan output module; the question response module includes a computer-readable storage medium that can implement the methods described in the above technical solutions.
[0198] In some preferred embodiments of the present invention, the system further includes a user feedback module, which optimizes the calculation formula parameters and thresholds of the intelligent nursing plan response method of the present invention based on the user's satisfaction with the nursing plan, accuracy and other ratings, so as to improve the accuracy of the output answer.
[0199] In some specific embodiments, the system described in this invention can achieve the following functions:
[0200] (1) Data collection and processing: Collect nursing-related data from multiple data sources, such as patient health status, medical records, and drug treatment records, and process and clean these data to improve the quality and accuracy of the data.
[0201] (2) Dialogue history: Records the dialogue history between the user and the platform, including the user's questions and the platform's answers, in order to facilitate subsequent dialogue reasoning and analysis.
[0202] (3) Multi-source fusion: Using relevant algorithms to fuse data from multiple information sources to obtain comprehensive analysis results. For example, data such as patient health status, medical records, and drug treatment records can be fused together to analyze the patient's disease condition and treatment plan.
[0203] (4) Dialogue reasoning and analysis: By analyzing user questions and dialogue history, dialogue reasoning and analysis are performed to understand the user's intentions and provide corresponding answers and suggestions.
[0204] (5) Intelligent response: Based on the results of dialogue reasoning and analysis, provide intelligent responses, such as answering patients' health questions, developing nursing plans, and providing medication dosage suggestions.
[0205] (6) Human-computer interaction interface: Design a user-friendly interactive interface to facilitate users to interact with the platform and provide relevant nursing knowledge and resources.
[0206] This platform adopts a C / B+S deployment model. The server consists of an intelligent voice server and a specialized knowledge server. The B-end is usually combined with an Internet hospital, or it can be combined with the hospital's Internet portal. The C-end usually refers to a smart terminal, which is an independent device that connects to the platform server via the Internet.
[0207] The system usage steps provided by this invention include:
[0208] (1) User Login: Users need to log in before using the platform. They can log in using various methods such as entering their username and password, scanning a QR code, or using their voiceprint.
[0209] (2) Ask questions: Users can ask questions to the platform in the form of text or voice, such as "I have finished breakfast now, what rehabilitation things do I need to do?"
[0210] (3) Multi-source information integration: The platform obtains relevant information from multiple information sources based on the questions raised by users, including disease diagnosis, nursing plans, etc.
[0211] (4) Dialogue history analysis: The platform will analyze the user's previous dialogue history and provide more personalized care suggestions based on the user's condition and health status.
[0212] (5) Logical reasoning and knowledge graph: The platform will perform logical reasoning, matching and reasoning with the user's questions and answers with the existing knowledge graph to provide more accurate answers.
[0213] (6) Response: The platform will provide a corresponding response based on the above steps, such as "You need to take entecavir tablets on an empty stomach. Have you taken them yet?" The patient replies, "I haven't taken the medicine yet." The platform responds, "If you have not taken the medicine yet, the medicine should be taken at least two hours after a meal. We will remind you to take the medicine two hours later."
[0214] (7) User feedback: Users can provide feedback on the answers provided by the platform, such as "This suggestion is very useful, and I will try to implement it."
[0215] (8) Through the above steps, users can easily obtain personalized care advice and ask questions to the platform at any time to get timely help.
[0216] Application Scenario 1: When the inquiry is made to a discharged patient with a catheter, the system will determine whether showering is permissible based on the patient's background information and medical records. The system may reply that the patient currently has an intubated catheter, prohibiting showering and bathing, and provide suggestions for sponge bathing to maintain personal hygiene.
[0217] Application Scenario 2: When the inquiry is made by a patient who has undergone open abdominal surgery and is being discharged from the hospital, the system will determine when it is safe to shower based on the patient's background information and medical records. The system may answer that showering is allowed three days after suture removal and prompt the patient to confirm whether the sutures have been removed, as the system cannot find the suture removal record at the hospital.
[0218] By providing personalized answers based on the patient's specific condition and medical records, this technical solution can more accurately respond to the nursing needs of different patients, provide targeted nursing advice and guidance, and improve the effectiveness and user satisfaction of the nursing question-and-answer system.
[0219] The above application scenarios are merely examples. The methods and systems described in this invention can also be applied to intelligent nursing solutions for other nursing problems.
[0220] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for responding to an intelligent nursing care plan, characterized in that, Includes the following steps: S1, construct a patient pathology information knowledge base, a general nursing knowledge base, a nursing domain synonym knowledge base, and an attribute knowledge base; The patient pathology information knowledge base should include at least the patient's medical records, age, medical history, and medication information; S2, Obtain the question: Query the complete set of candidate query graphs for the question in the general nursing knowledge base constructed in step S1; The query is performed in stages, generating the main path query graph and then sequentially implementing entity semantic restrictions, type restrictions, time restrictions, order restrictions, attribute relationship restrictions, and association relationship construction. The attribute relationship restriction includes: extracting the attribute set from the sequence restriction candidate query graph set obtained after the sequence restriction, querying personalized information related to the attribute set in the patient pathology information knowledge base, querying query graphs related to the personalized information in the general nursing knowledge base to obtain a personalized information query graph, using the personalized information query graph to filter the sequence restriction candidate query graph set, removing the parts in the sequence restriction candidate query graph set that conflict with the personalized information query graph, and then merging them with the personalized information query graph to obtain the attribute relationship restriction query graph set; The aforementioned relationship construction includes: extracting the answer entity from the attribute relationship restriction query graph set, querying the entity node query graph that has a relationship with the answer entity in the general nursing knowledge base, merging it with the attribute relationship restriction query graph set, and obtaining the complete set of candidate query graphs; S3, preprocess the questions obtained in step S2. The preprocessing includes using the nursing domain synonym knowledge base constructed in step S1 to perform synonym replacement to obtain standardized questions, obtaining the grammar parsing graph Ggram and semantic component Gi of the questions, and encoding the standardized questions and the semantic component Gi of the questions into feature vectors. S4. A window-based deep neural network model is used to identify the standardized questions obtained in step S3 and perform named entity recognition of nursing information to obtain an entity set. In the window-based deep neural network model, the nursing domain loss function shown in formula (Ⅰ) is used for calculation: , Where n is the sample size; m is the label category; η is the activation function, which is the probability distribution of the model's prediction for sample x(i); j, k, and l are the node indices of the window layer, hidden layer, and output layer, respectively. and These are the model parameters, representing the weights from the input layer to the hidden layer and from the hidden layer to the output layer, respectively; h is the number of hidden layer nodes; c is the window size; d is the dimension of the word vectors; W is the parameter of the first layer network; V is the parameter of the hidden layer; C is the regularization term for nursing information entity recognition; S5, link the entity set identified in step S4 with the complete set of candidate query graphs constructed in step S2 to obtain the first query set; extract the answer from the first query set as the answer entity, link the answer entity with the complete set of candidate query graphs constructed in step S2 to obtain the final query set; S6, calculate the overall association score between the standardized question and the final query set obtained in step S5, select the answer with the highest score as the best query graph, and transform the best query graph into the answer statement; S7. Match and reason with the answer statement obtained in step S6 and the patient's pathology information knowledge base to obtain the nursing measures corresponding to the answer statement and output the answer.
2. The intelligent nursing solution response method according to claim 1, characterized in that, In step S2, a parallel depth-first search algorithm is used in the phased query process to improve query efficiency.
3. The intelligent nursing solution response method according to claim 2, characterized in that, In step S2, the parallel depth-first search algorithm includes the following steps: The search space is divided into several subspaces, each of which is searched by an independent computing unit; multiple computing units are launched simultaneously to perform parallel searches when searching the query graph; the computing units communicate and synchronize during the search process to avoid redundant calculations; and the search results from each computing unit are merged.
4. The intelligent nursing plan response method according to any one of claims 1-3, characterized in that, The phased query described in step S2 includes the following steps: S21, through dependency parsing, extract entities, predicates, types, times and sequences from standardized statements and link them to a general nursing knowledge base. All linking results are a complete set of candidate query graphs. S22, filter the parts of standardized questions in the candidate query graph set where the entities and predicates are connected to obtain the main path; S23, Add entity semantic restrictions to the main path, query all entity-related query graphs in the main path from the general nursing knowledge base constructed in step S1 and link them to the main path to obtain a set of entity restriction query graphs; S24, add type restrictions to the entity-restricted query graph set, select predicates that are directly connected to the answers in the entity-restricted query graph set for implicit type inference, and filter the inferred implicit type-related query graphs according to the type of standardized questions before merging them with the entity-restricted query graph set to obtain the type-restricted query graph set; S25, add time restrictions to the type-restricted query graph set, filter the type-restricted query graph set according to the "time" of the standardized question, and remove the query graphs within the "time" that do not conform to the standardized question to obtain the time-restricted query graph set; S26. Add order restrictions to the time-restricted query graph set, filter the time-restricted query graph set according to the order of the standardized questions, and propose query graphs that do not conform to the order of the standardized questions, thus obtaining the order-restricted query graph set.
5. The intelligent nursing solution response method according to claim 1, characterized in that, In step S4, the regularization term C for nursing information entity recognition in formula (I) is obtained as follows: (1) Use the NCBI Disease Corpus dataset labeled with disease names to train the model, calculate the difference between the general loss function calculation formula (II) and the actual result, and obtain the initial value C' of C; , (2) The patient pathology information knowledge base constructed in step S1 is cross-validated using formula (Ⅲ) with the initial value C' added to C. C' is then corrected based on the validation results to obtain the value of C. 。 6. An intelligent nursing response system, characterized in that, It includes a question receiving module, a question response module, and a nursing plan output module; The question-and-response module includes a computer-readable storage medium that implements a computer program capable of implementing the method of any one of claims 1-5.