Hospital intelligent inquiry log analysis method and system
By constructing a medical intent classification tree and using diagnostic feedback signals to correct errors, the problem of difficulty in capturing the association of medical terms in existing technologies has been solved, enabling adaptive consultation log analysis and improving the accuracy and processing efficiency of triage results.
Patent Information
- Application Number
- CN202610333263.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-18
- Publication Date
- 2026-04-17
AI Technical Summary
Existing technologies rely on manually written query statements for keyword retrieval, which cannot capture the implicit hierarchical relationships and semantic connections between medical terms. This results in fragmented triage results and low processing efficiency. Furthermore, fixed query rules cannot be automatically adjusted and iterated based on actual diagnosis and treatment, making it difficult to guarantee the continuous accuracy and scientific validity of triage results.
By generating numerical values for medical concept depth, extracting a set of symptom keywords using word frequency and inverse document frequency, constructing a medical intent classification tree by combining the hierarchical structure of medical concepts and semantic consistency scores, identifying erroneous decision nodes using diagnosis and treatment correction feedback signals and establishing virtual error correction association links, and dynamically reconstructing the classification tree to improve the accuracy of intent recognition.
It implements an adaptive classification logic based on medical knowledge system, accurately locates and corrects erroneous decision-making paths, and improves the interpretability of intent recognition and the robustness of long-term operation in the consultation scenario.
Smart Images

Figure CN121885222A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data classification technology, and in particular to a method and system for analyzing intelligent hospital consultation logs. Background Technology
[0002] Data classification technology refers to the technical field involving the use of computer logic to extract features, measure similarity, and cluster unstructured text data. Its core lies in transforming chaotic information flows into ordered sets of categories through preset indexing rules or matching logic. Traditionally, the analysis method for hospital intelligent consultation logs involves system administrators connecting to the hospital information system's backend server using database management tools, writing standard structured queries to retrieve consultation record rows containing specific keywords, exporting the search results as a comma-separated value format local file, then using spreadsheet software's filtering function to sort the department field in the logs, and manually reading each line to count the types of diseases complained of by patients or the frequency of consultations.
[0003] Existing technologies rely on manually written query statements for keyword retrieval, which can only achieve surface-level matching based on literal meaning. They cannot capture the implicit hierarchical relationships and semantic connections between medical terms, resulting in fragmented triage results that lack logical medical classification. The statistical method of relying on manual line-by-line reading combined with spreadsheet filtering is extremely inefficient when dealing with massive amounts of consultation logs. Fixed static query rules cannot be automatically fed back and iterated based on actual diagnosis and treatment, causing the classification logic to lag behind clinical practice in the long term, making it difficult to guarantee the continuous accuracy and scientific nature of triage results. Summary of the Invention
[0004] To achieve the above objectives, the present invention adopts the following technical solution: a hospital intelligent consultation log analysis method, comprising the following steps:
[0005] S1: Generate a medical concept depth value by statistically analyzing the hierarchical structure data of medical concepts, extract a set of symptom keywords from the log using word frequency and inverse document frequency, and retrieve the medical concept depth value of the symptom keyword set;
[0006] S2: Calculate the statistical information gain value of the symptom keyword set, generate a semantic consistency score based on the difference between the medical concept depth value and the common ancestor depth value, combine the statistical information gain value and the semantic consistency score to generate a split decision index, and construct a medical intent classification tree;
[0007] S3: Input logs into the medical intent classification tree to generate a consultation intent category identifier, identify the erroneous decision node identifier based on the diagnosis and treatment correction feedback signal and update the misclassification penalty value, and connect the erroneous decision node identifier with the correct intent node identifier to generate a virtual error correction association link;
[0008] S4: Calculate the ratio of the number of node visits to the medical intent classification tree to the misclassification penalty value, generate the path confidence coefficient, and merge the nodes. When the guiding weight value of the virtual error correction association link exceeds the limit, establish a physical branch and generate an adaptively reconstructed medical intent classification tree.
[0009] As a further aspect of the present invention, step S1 specifically includes:
[0010] S11: Obtain a medical knowledge graph or hierarchical coding table containing multi-level classification relationships, traverse the topological path from the root node to each end entity node, calculate the hierarchical distance of each entity node in the topological structure, assign a unique hierarchical position parameter to each entity node, and generate the medical concept depth value.
[0011] S12: Perform word segmentation and stop word filtering on the input consultation log, calculate the frequency of each word in the current log and the inverse document frequency in the historical corpus, obtain the feature weight value through product operation, filter out words with weight values exceeding the preset significance threshold, and generate the symptom keyword set.
[0012] S13: Traverse each keyword in the set of symptom keywords, perform semantic fuzzy matching in the medical knowledge graph to locate the corresponding entity node, read the hierarchical position parameters assigned to the entity node, and retrieve the medical concept depth value corresponding to each keyword.
[0013] As a further aspect of the present invention, step S2 specifically includes:
[0014] S21: Calculate the intent distribution probability of the log samples contained in the current node to be split, calculate the Shannon entropy of the sample set, and calculate the conditional entropy of each candidate keyword after it divides the sample set. Calculate the statistical information gain value by calculating the difference between the Shannon entropy and the conditional entropy.
[0015] S22: Identify the path parent features of the current node to be split and the medical entity nodes corresponding to the candidate keywords. Backtrack in the medical concept hierarchy to find the nearest common ancestor node of the two, obtain the hierarchy depth of the common ancestor node, and calculate the structured semantic distance by combining the respective medical concept depth values to generate the semantic consistency score.
[0016] S23: Normalize the statistical information gain value and the semantic consistency score respectively, and use a preset adjustment factor to perform weighted fusion or multiplication operation on the two to quantitatively evaluate the comprehensive distinguishing ability of candidate keywords at the data statistics and medical semantic level, and generate the split decision index.
[0017] S24: Sort candidate keywords in descending order according to the split decision index, select the optimal keyword as the split feature of the current node, recursively execute the sample subset partitioning process until the preset tree depth limit or node purity requirement is met, and construct the medical intent classification tree.
[0018] As a further aspect of the present invention, step S3 specifically includes:
[0019] S31: The consultation log to be analyzed is used as an input vector and imported into the root node of the medical intent classification tree. The log features are matched and descended along the branch path of the tree until the terminal leaf node is reached. The intent label mapped by the leaf node is output to generate the consultation intent category identifier.
[0020] S32: Receive the diagnosis and treatment correction feedback signal from professional physician review or subsequent diagnosis and treatment process, compare the diagnosis intention category identifier output by the system with the actual diagnosis and treatment intention, if the two are inconsistent, backtrack the decision path of the classification tree to locate the last effective feature node that caused the deviation, and identify the erroneous decision node identifier.
[0021] S33: Read the historical cumulative error count corresponding to the error decision node identifier, increase the corresponding penalty weight according to the severity level of the current misclassification, and update the misclassification penalty value associated with the node using the accumulated weight value;
[0022] S34: Establish a non-tree-structured logical mapping relationship between the erroneous decision node identifier and the correct intent node representing the true treatment intention, initialize the guidance weight value of the mapping relationship, and generate the virtual error correction association link used to guide subsequent path optimization.
[0023] As a further aspect of the present invention, step S4 specifically includes:
[0024] S41: Count the total number of times each node in the medical intent classification tree is traversed within the specified time window to obtain the node access count, read the misclassification penalty value currently stored in each node, use the ratio function to evaluate the reliability of the node as a decision basis, and generate the path confidence coefficient.
[0025] S42: Traverse the terminal branches in the tree structure, filter out low-confidence nodes whose path confidence coefficient is lower than the preset pruning threshold, merge them with their parent nodes, remove invalid branch structures and reallocate sample statistics data to merge nodes;
[0026] S43: Monitor the triggering frequency of the virtual error correction association link in real time. Whenever a new feedback signal verifies the validity of the link, accumulate its weight parameter. Determine whether the accumulated weight parameter exceeds the preset structural reconstruction threshold. If it does, determine that the guiding weight value exceeds the limit and issue a physical branch establishment command.
[0027] S44: In response to the instruction to establish a physical branch, at the location of the erroneous decision node, a new entity splitting edge is added based on the direction of the virtual error correction association link. The correct intent node is attached as a new child node, and historical related samples are migrated to the new branch to generate the adaptive reconstruction medical intent classification tree.
[0028] As a further aspect of the present invention, the process of generating the semantic consistency score is specifically as follows:
[0029] Obtain the first depth parameter corresponding to the candidate keyword, the second depth parameter corresponding to the current path feature, and the common ancestor depth value corresponding to the nearest common ancestor node of the two;
[0030] The semantic consistency score is calculated according to the following formula:
[0031] ;
[0032] in, This represents the semantic consistency score. This represents the depth value of the common ancestor. The numerical value representing the medical concept depth of the candidate keywords. The numerical value representing the depth of the medical concept, which indicates the characteristics of the current path. Represents the semantic distance decay coefficient. This represents an exponential function.
[0033] As a further aspect of the present invention, the process of generating the splitting decision index specifically includes:
[0034] Obtain the preset data-driven weighting coefficients and knowledge-driven weighting coefficients;
[0035] The first component is obtained by multiplying the preset data-driven weight coefficient with the normalized statistical information gain value, and the second component is obtained by multiplying the preset knowledge-driven weight coefficient with the semantic consistency score.
[0036] The linear sum of the first component and the second component is calculated to generate the splitting decision index, so as to ensure that the splitting feature is both statistically significant and conforms to the hierarchical logic of the medical knowledge system.
[0037] As a further aspect of the present invention, the calculation process of the path confidence coefficient is as follows:
[0038] Obtain the number of node visits and the misclassification penalty value of the decision node within a historical time period;
[0039] The confidence coefficient of the path is calculated according to the following formula:
[0040] ;
[0041] in, This represents the confidence coefficient of the stated path. This represents the number of visits to the node. This represents the value of the misclassification penalty. Represents the error penalty sensitivity factor. This represents a smoothing constant used to prevent the denominator from being zero.
[0042] As a further aspect of the present invention, the specific execution process for establishing the physical branch includes:
[0043] Lock the target intent category pointed to by the virtual error correction association link, and add a leaf node with the target intent category as the output result under the classification tree node corresponding to the error decision node identifier;
[0044] An entity connection edge is constructed between the error decision node identifier and the newly added leaf node, and the historical log samples that triggered the virtual error correction association link are redistributed to the leaf node. The sample distribution statistics table of the parent node is updated to complete the solidification of the physical structure.
[0045] A hospital intelligent consultation log analysis system, the system being used to implement the aforementioned hospital intelligent consultation log analysis method, the system comprising:
[0046] The medical concept parsing and extraction submodule is used to statistically analyze the hierarchical structure data depth of medical concepts to generate the medical concept depth value, extract the symptom keyword set from the log using word frequency inverse document frequency, and retrieve the medical concept depth value of the symptom keyword set;
[0047] The intent classification tree construction submodule is used to calculate the statistical information gain value of the symptom keyword set, generate a semantic consistency score based on the difference between the medical concept depth value and the common ancestor depth value, and generate a split decision index by combining the statistical information gain value and the semantic consistency score to construct the medical intent classification tree;
[0048] The diagnosis and treatment feedback error correction submodule is used to input logs into the medical intent classification tree to generate the consultation intent category identifier, identify the erroneous decision node identifier based on the diagnosis and treatment correction feedback signal and update the misclassification penalty value, and connect the erroneous decision node identifier with the correct intent node identifier to generate a virtual error correction association link;
[0049] The adaptive structure reconstruction submodule is used to calculate the ratio of the number of node visits to the misclassification penalty value in the medical intent classification tree, generate the path confidence coefficient, and merge the nodes. When the guiding weight value of the virtual error correction association link exceeds the limit, a physical branch is established to generate the adaptively reconstructed medical intent classification tree.
[0050] Compared with the prior art, the advantages and positive effects of the present invention are as follows:
[0051] In this invention, by introducing a hierarchical structure of medical concepts and calculating depth values, the planar keyword statistics are upgraded to a three-dimensional feature analysis with semantic depth. A classification tree is constructed by combining statistical gain and semantic consistency scores to ensure that intent segmentation follows the medical knowledge system. A reverse penalty and virtual link mechanism is constructed using diagnosis and treatment correction feedback signals to accurately locate and repair erroneous decision paths. Based on path confidence, node fusion and branch reconstruction are dynamically executed to achieve adaptive evolution of classification logic, thereby improving the medical interpretability and long-term robustness of intent recognition in complex consultation scenarios. Attached Figure Description
[0052] Figure 1 This is the main flowchart of a hospital intelligent consultation log analysis method according to the present invention;
[0053] Figure 2 This is a flowchart of the symptom keyword extraction and deep retrieval process of the present invention;
[0054] Figure 3 This is a flowchart illustrating the construction of the medical intent classification tree for this invention.
[0055] Figure 4 A flowchart for establishing the consultation intent generation and error correction link in this invention;
[0056] Figure 5 This is a flowchart illustrating the adaptive reconstruction of the medical intent classification tree for this invention. Detailed Implementation
[0057] To make the objectives, technical solutions, and advantages of this invention clearer, the software-based technical solution is described in detail below with reference to system architecture diagrams and embodiments. It should be understood that the specific embodiments described herein are only for explaining the technical solutions of this invention and do not constitute a limitation on the scope of protection.
[0058] In the description of this invention, the system architecture relationships or data processing flows indicated by terms such as "layer," "module," "interface," "data flow," "client," and "server" are all defined based on the architecture diagram or flowchart corresponding to the embodiments. This way of describing is only used to clearly illustrate the logical relationships between the elements in the technical solution, and not to limit the physical deployment form. The term "multiple" includes two or more technical units, including but not limited to multiple data nodes, processing threads, service instances, or functional components and other scalable elements. The specific number is determined according to the actual business scenario and needs to be specifically specified.
[0059] Please see Figure 1 and Figure 2 This invention provides a technical solution: a method for analyzing intelligent consultation logs in hospitals, comprising the following steps:
[0060] S1: Generate medical concept depth values by statistically analyzing the hierarchical structure of medical concepts, extract symptom keyword sets from logs using word frequency and inverse document frequency, and retrieve medical concept depth values for the symptom keyword sets.
[0061] The steps in S1 specifically include:
[0062] S11: Obtain a medical knowledge graph or hierarchical coding table containing multi-level classification relationships, traverse the topological path from the root node to each terminal entity node, calculate the hierarchical distance of each entity node in the topological structure, assign a unique hierarchical position parameter to each entity node, and generate a medical concept depth value.
[0063] S12: Perform word segmentation and stop word filtering on the input consultation logs, calculate the frequency of each word in the current log and the inverse document frequency in the historical corpus, obtain the feature weight value through multiplication, filter out words with weight values exceeding the preset significance threshold, and generate a set of symptom keywords.
[0064] S13: Traverse each keyword in the symptom keyword set, perform semantic fuzzy matching in the medical knowledge graph to locate the corresponding entity node, read the hierarchical position parameters assigned to the entity node, and retrieve the medical concept depth value corresponding to each keyword.
[0065] First, SNOMEDCT is selected as the data source for constructing the basic medical knowledge graph, building a directed acyclic graph structure including clinical findings, body structure, and etiology dimensions. The system performs hierarchical depth quantization of the medical knowledge graph, initializing the root node SCTID:138875005 to a depth of 0. A breadth-first search algorithm is used to traverse the graph, marking the depth of the first-level child node directly connected to the root node as 1, the depth of the next-level node connected to it as 2, and so on. During the traversal, if a node has multiple paths to the root node, the system compares the lengths of each path, selects the shortest path length as the final medical concept depth value for that node, and writes this value into the node attribute table. For example, for entity node SCTID:22253000, the system calculates its topological hierarchical distance to the root node as 3, and assigns a hierarchical position parameter of 3. For the more specific entity SCTID:56018004, which is located below the pain node, its medical concept depth value is calculated to be 4.
[0066] After completing the basic data preparation, the system receives hospital intelligent consultation logs to be processed. Taking a log entry with the content "The patient reported severe chest pain, accompanied by a persistent dry cough, which worsened at night" as an example, the system calls the word segmentation component to preprocess the text, removing stop words without medical indication such as "reported," "accompanied," and "," retaining the entries for "chest," "severe," "pain," "persistent," "dry cough," and "night." Next, the feature weight is calculated using the inverse document frequency (IVF) algorithm. The historical corpus is assumed to contain 100,000 past consultation records. For the entry "chest pain," it appears once in the current log, with a total word count of 10, so the word frequency is 0.1. If there are 5,000 records containing "chest pain" in the corpus, the IVF is calculated as the logarithm of 100,000 divided by 5,000, which is approximately 1.301. The product of these two values yields a feature weight of 0.1301. The system presets a significance threshold of 0.08, which is obtained through receiver operating characteristic (ROC) curve analysis of historical labeled data, selecting the weight corresponding to the point with the largest F1 score as the threshold. Since 0.1301 is greater than 0.08, the system includes chest pain in the symptom keyword set. Similarly, dry cough is calculated with a weight of 0.115 and is also included in the set; while nighttime has a weight of 0.03, which is below the threshold and is therefore removed.
[0067] Subsequently, the system performs a depth-value search on the selected set of symptom keywords (including chest pain and dry cough). The system iterates through each element in the set, locating the corresponding entity node ID in the medical knowledge graph using an inverted index. For the keyword "chest pain," it locates entity SCTID:56018004 and reads its pre-calculated and stored medical concept depth value of 4; for the keyword "dry cough," it locates entity SCTID:284523002 and reads its medical concept depth value of 5. The system binds these values to the corresponding keywords, generating feature vectors with depth attributes for subsequent decision tree construction.
[0068] The aforementioned SNOMEDCT refers to the medical system nomenclature clinical terminology, a comprehensive, multilingual clinical healthcare terminology set used for inputting, retrieving, and analyzing clinical data in electronic health records.
[0069] The term frequency inverse document frequency (IF) mentioned above refers to a commonly used weighting technique in information retrieval and text mining, used to assess the importance of a word to a document in a document set or corpus.
[0070] Table 1. Mapping Table of Depth Parameters for Medical Entity Nodes
[0071]
[0072] Please see Figure 1 and Figure 3 S2: Calculate the statistical information gain value of the symptom keyword set, generate a semantic consistency score based on the difference between the medical concept depth value and the common ancestor depth value, combine the statistical information gain value and the semantic consistency score to generate a split decision index, and construct a medical intent classification tree;
[0073] The steps in S2 specifically include:
[0074] S21: Calculate the intent distribution probability of the log samples contained in the current node to be split, calculate the Shannon entropy of the sample set, and calculate the conditional entropy of each candidate keyword after it splits the sample set. Calculate the statistical information gain value by calculating the difference between the Shannon entropy and the conditional entropy.
[0075] S22: Identify the path parent features of the current node to be split and the medical entity nodes corresponding to the candidate keywords. Backtrack in the medical concept hierarchy to find the nearest common ancestor node of the two, obtain the hierarchy depth of the common ancestor node, and calculate the structured semantic distance by combining the respective medical concept depth values to generate a semantic consistency score.
[0076] S23: Normalize the statistical information gain value and semantic consistency score respectively, and use the preset adjustment factor to perform weighted fusion or multiplication operation on the two to quantitatively evaluate the comprehensive distinguishing ability of candidate keywords at the data statistics and medical semantic level, and generate split decision index.
[0077] S24: Sort candidate keywords in descending order of split decision index, select the best keyword as the split feature of the current node, recursively execute the sample subset partitioning process until the preset tree depth limit or node purity requirement is met, and construct a medical intent classification tree.
[0078] The specific process for generating semantic consistency scores is as follows:
[0079] Obtain the first depth parameter corresponding to the candidate keyword, the second depth parameter corresponding to the current path feature, and the common ancestor depth value corresponding to the nearest common ancestor node of the two;
[0080] The semantic consistency score is calculated using the following formula:
[0081] ;
[0082] in, Represents semantic consistency score, Represents the depth value of the common ancestor. The numerical value representing the medical concept depth of candidate keywords. The numerical value representing the medical concept depth characteristic of the current path. Represents the semantic distance decay coefficient. Represents an exponential function;
[0083] The process of generating split decision indicators specifically includes:
[0084] Obtain the preset data-driven weighting coefficients and knowledge-driven weighting coefficients;
[0085] The first component is obtained by multiplying the preset data-driven weight coefficient with the normalized statistical information gain value, and the second component is obtained by multiplying the preset knowledge-driven weight coefficient with the semantic consistency score.
[0086] The linear sum of the first and second components is calculated to generate a splitting decision index, ensuring that the splitting features are both statistically significant and conform to the hierarchical logic of the medical knowledge system.
[0087] In constructing the medical intent classification tree, the system first locates the current node to be split. Taking a current node containing 500 consultation log samples as an example, 300 samples belong to respiratory system disease intent, and 200 samples belong to cardiovascular system disease intent. The system first calculates the Shannon entropy of the current sample set. According to the Shannon entropy calculation formula, substituting the proportions of each type of sample into the calculation, the entropy of the current set is approximately 0.971. Next, the system evaluates the ability of the candidate keyword "dry cough" as a splitting feature. Based on the presence or absence of dry cough, the samples are divided into two subsets: a subset containing dry cough (280 samples, 260 of which are respiratory system and 20 are cardiovascular system), and a subset not containing dry cough (220 samples, 40 of which are respiratory system and 180 are cardiovascular system). The entropy of these two subsets is calculated separately, and then weighted and summed to obtain the conditional entropy. The calculated statistical information gain is 0.45.
[0088] Simultaneously, the system needs to calculate a semantic consistency score to constrain the bias of purely data-driven approaches. The system identifies the path parent feature of the current node to be split as "clinical discovery," with a corresponding medical concept depth of 1. The candidate keyword is "dry cough," with a medical concept depth of 4. The system traces back the lineage of both in the knowledge graph, finding the nearest common ancestor node as "clinical discovery" itself, with a common ancestor depth of 1. In this step, the semantic consistency score formula is introduced:
[0089] in, The semantic consistency score is used to quantify the closeness between candidate features and the current decision path in the medical knowledge system. The numerical value representing the medical concept depth of candidate keywords; A numerical value representing the depth of medical concepts that characterizes the current path. Represents the depth value of the common ancestor; This represents the semantic distance decay coefficient, used to control the degree of influence of semantic distance on the score; This represents an exponential function with the natural constant e as its base. This represents the absolute value operator.
[0090] Set the semantic distance decay coefficient to 0.5. Substitute the values into the calculation: the absolute value of the difference between the candidate keyword depth value 4 and the common ancestor depth value 1 is 3; the absolute value of the difference between the current path feature depth value 1 and the common ancestor depth value 1 is 0; their sum is 3. Calculate the exponential function. The semantic consistency score was approximately 0.223.
[0091] Next, a splitting decision index is generated. Preset data-driven weight coefficients of 0.6 and knowledge-driven weight coefficients of 0.4 are obtained. These two coefficients are set based on a dual-driven strategy of data and knowledge. First, the statistical information gain value of 0.45 is normalized. Assuming the maximum gain in the current candidate set is 0.6 and the minimum is 0.05, the normalized value is 0.727. Multiplying the data-driven weight coefficient by the normalized statistical information gain value yields the first component, 0.436; multiplying the knowledge-driven weight coefficient by the semantic consistency score yields the second component, 0.089. The linear sum of the first and second components is calculated, generating a splitting decision index of 0.525. The system repeats the above calculation for all candidate keywords, and the results are shown in Table 2. Finally, the system sorts the splitting decision index from high to low, selects the optimal keyword as the splitting feature of the current node, and recursively executes the sample subset partitioning process until the preset tree depth limit or node purity requirement is met, constructing a medical intent classification tree.
[0092] The Shannon entropy mentioned above is an indicator used in information theory to measure the uncertainty of information. The larger the value, the higher the uncertainty of the information and the lower the purity of the sample set.
[0093] Table 2 Calculation Table of Candidate Keyword Splitting Decision Indicators
[0094]
[0095] Please see Figure 1 and Figure 4 S3: Input logs into the medical intent classification tree to generate consultation intent category identifiers, identify erroneous decision node identifiers based on diagnosis and treatment correction feedback signals and update misclassification penalty values, and connect erroneous decision node identifiers with correct intent node identifiers to generate virtual error correction association links;
[0096] The steps in S3 specifically include:
[0097] S31: Input the consultation log to be analyzed as the input vector into the root node of the medical intent classification tree, match it down the tree branch path according to the log features until the terminal leaf node is reached, output the intent label mapped by the leaf node, and generate the consultation intent category identifier.
[0098] S32: Receive treatment correction feedback signals from professional physician review or subsequent treatment process, compare the consultation intent category identifier output by the system with the actual treatment intent, and if the two are inconsistent, backtrack the decision path of the classification tree to locate the last effective feature node that caused the deviation and identify the erroneous decision node identifier.
[0099] S33: Read the historical cumulative error count corresponding to the erroneous decision node identifier, increase the corresponding penalty weight according to the severity level of the current misclassification, and update the misclassification penalty value associated with the node using the accumulated weight value;
[0100] S34: Establish a non-tree-structured logical mapping relationship between the erroneous decision node identifier and the correct intent node representing the true treatment intention, initialize the guiding weight value of the mapping relationship, and generate a virtual error correction association link to guide subsequent path optimization.
[0101] During the consultation intent prediction and error correction phase, the system receives a new patient log entry: "Suppressive pain behind the sternum, relieved by nitroglycerin." The system converts this log entry into a vector and inputs it to the root node of the constructed medical intent classification tree. The feature matching engine reads the keywords "suppressive," "pain," and "nitroglycerin" from the log entry. At the root node, based on the rules generated by S2, it determines if the chest pain branch is matched and proceeds to the next level node; at the second level node, it checks if gastrointestinal symptoms are included, which is determined as no; at the third level node, it checks if the relieving factor "nitroglycerin" is included, which is determined as yes. The final path leads to a leaf node ID: Node_1024, which maps to the intent category identifier of angina. The system outputs this identifier as the preliminary consultation result.
[0102] Subsequently, the result is pushed to the physician's workstation. If, during actual diagnosis, the physician discovers that the patient actually has reflux esophagitis and corrects the diagnosis in the system, the system captures this diagnostic correction feedback signal and immediately initiates a backtracking mechanism. The system traces backward along the tree structure, examining the decision path of Node_1024. The system identifies that in the judgment of the secondary node "whether it contains gastrointestinal symptoms," the log did not explicitly mention acid reflux and heartburn, leading to a misjudgment into the cardiology branch. Therefore, this secondary node is marked as an erroneous decision node, Node_55.
[0103] The system reads the currently stored misclassification penalty value of Node_55, with an initial value of 0. Based on a preset severity level table, cross-system misclassification (misclassification of cardiovascular system as digestive system) is classified as high severity, corresponding to a single penalty weight of 5.0. The system updates the misclassification penalty value of Node_55 using the accumulated weight value, resulting in an updated value of 5.0. This value will be used for subsequent path confidence assessment. Simultaneously, the system establishes a non-tree-structured logical mapping relationship between Node_55 and the correct intent node representing reflux esophagitis, initializing the guiding weight of this mapping relationship to 1.0, and generating virtual error-correcting association links to guide subsequent path optimization.
[0104] The aforementioned virtual error correction association link refers to a logical pointer stored on the classification tree node, used to record the mapping relationship and weight from the error node to the correct intent category without changing the physical structure of the tree.
[0105] Please see Figure 1 and Figure 5 S4: Calculate the ratio of the number of node visits to the misclassification penalty value in the medical intent classification tree, generate the path confidence coefficient and merge the nodes. When the guiding weight value of the virtual error correction association link exceeds the limit, establish a physical branch and generate an adaptively reconstructed medical intent classification tree.
[0106] The steps in S4 specifically include:
[0107] S41: Count the total number of times each node in the medical intent classification tree is traversed within a specified time window to obtain the node access count, read the currently stored misclassification penalty value of each node, use the ratio function to evaluate the reliability of the node as a decision basis, and generate the path confidence coefficient.
[0108] S42: Traverse the terminal branches in the tree structure, filter low-confidence nodes whose path confidence coefficient is lower than the preset pruning threshold, merge them with their parent nodes, remove invalid branch structures and reallocate sample statistics data to merge nodes;
[0109] S43: Real-time monitoring of the triggering frequency of virtual error correction association links. Whenever a new feedback signal verifies the validity of the link, its weight parameter is accumulated. It is determined whether the accumulated weight parameter exceeds the preset structural reconstruction threshold. If it does, it is determined that the guiding weight value exceeds the limit and a physical branch establishment instruction is issued.
[0110] S44: In response to the command to establish a physical branch, add an entity splitting edge at the location of the erroneous decision node based on the direction of the virtual error correction association link, attach the correct intent node as a new child node, and migrate historical related samples to the new branch to generate an adaptive reconstruction of the medical intent classification tree.
[0111] The specific calculation process for the path confidence coefficient is as follows:
[0112] Obtain the number of node visits and misclassification penalty values for decision nodes within a historical time period;
[0113] Calculate the path confidence coefficient using the following formula:
[0114] ;
[0115] in, Represents the path confidence coefficient. Represents the number of visits to the node. This represents the penalty value for misclassification. Represents the error penalty sensitivity factor. This represents a smoothing constant used to prevent the denominator from being zero;
[0116] The specific execution process for establishing a physical branch includes:
[0117] Lock the target intent category pointed to by the virtual error correction association link, and add a leaf node with the target intent category as the output result under the classification tree node corresponding to the error decision node identifier;
[0118] Entity connection edges are constructed between the erroneous decision node identifier and the newly added leaf node, and historical log samples that trigger virtual error correction association links are redistributed to the leaf nodes. The sample distribution statistics table of the parent node is updated to complete the solidification of the physical structure.
[0119] The system periodically performs an adaptive reconstruction task. First, it calculates the path confidence coefficient for each node in the medical intent classification tree to assess the reliability of the existing structure. The system traverses each non-leaf node in the tree, counting the total number of times that node has been traversed in the past 30 days. Here, the formula for calculating the path confidence coefficient is introduced:
[0120] in, The path confidence coefficient ranges from 0 to 1. The lower the value, the higher the risk of that node becoming a decision branch. The number of visits to the representative node reflects the breadth of coverage of this decision rule; The value representing the misclassification penalty reflects the degree to which this node has historically caused misclassification. This represents the error penalty sensitivity factor, used to adjust tolerance for errors; This represents a smoothing constant used to prevent the denominator from being zero.
[0121] Taking Node_55 as an example, assuming this node was visited 200 times in the past 30 days, the accumulated misclassification penalty value during this period is 50.0. The error penalty sensitivity factor is set to 2.0, and the smoothing constant is 0.001. Substituting into the formula, the denominator is 200 plus 2.0 multiplied by 50.0 plus 0.001, resulting in 300.001. The path confidence coefficient is 200 divided by 300.001, resulting in approximately 0.666. The system traverses the terminal branches, setting the pruning threshold to 0.4. If the coefficient of a terminal node is lower than 0.4, a node merging operation is performed. Node_55's coefficient is 0.666, higher than the pruning threshold, therefore it is retained.
[0122] Next, the system monitors the triggering frequency of virtual error-correction links in real time. For the virtual link pointing to reflux esophagitis from Node_55, the guiding weight of the link increases by 1 whenever a new sample passes through Node_55 and is ultimately corrected to reflux esophagitis by a doctor. The structural reconstruction threshold is set to 20. Assuming that after a period of operation, the guiding weight of the link accumulates to 25, exceeding the structural reconstruction threshold, the system determines that the guiding weight value has exceeded the limit and issues a command to establish a physical branch. In response to this command, the system locks the target intent pointed to by the virtual link as reflux esophagitis, adds an entity split edge under Node_55, attaches the correct intent node as a new child node, and migrates the historical log samples that triggered the virtual link from the old leaf node to this new leaf node. Subsequently, the system updates the sample distribution statistics table of Node_55, completes the physical solidification of the tree structure, and generates an adaptively reconstructed medical intent classification tree.
[0123] The aforementioned error penalty sensitivity factor refers to a parameter used in the confidence calculation model to adjust the degree of influence of the misclassification penalty value on the final confidence score. The larger the value, the lower the system's tolerance for errors.
[0124] A hospital intelligent consultation log analysis system, used to execute the aforementioned hospital intelligent consultation log analysis method, the system comprising:
[0125] The medical concept parsing and extraction submodule is used to statistically analyze the hierarchical structure of medical concepts to generate a numerical value for the depth of medical concepts, extract a set of symptom keywords from logs using word frequency and inverse document frequency, and retrieve the numerical value of the medical concept depth of the symptom keyword set.
[0126] The intent classification tree construction submodule is used to calculate the statistical information gain value of the symptom keyword set, generate a semantic consistency score based on the difference between the medical concept depth value and the common ancestor depth value, and generate a split decision index by combining the statistical information gain value and the semantic consistency score to construct a medical intent classification tree.
[0127] The diagnosis and treatment feedback error correction submodule is used to input logs into the medical intent classification tree to generate a consultation intent category identifier, identify the erroneous decision node identifier based on the diagnosis and treatment correction feedback signal and update the misclassification penalty value, and connect the erroneous decision node identifier with the correct intent node identifier to generate a virtual error correction association link;
[0128] The adaptive structure reconstruction submodule is used to calculate the ratio of the number of node visits to the misclassification penalty value in the medical intent classification tree, generate the path confidence coefficient, and merge nodes. When the guiding weight value of the virtual error correction association link exceeds the limit, a physical branch is established to generate an adaptively reconstructed medical intent classification tree.
[0129] The above embodiments illustrate preferred embodiments of the present invention. Any equivalent adjustments to the technical solution based on software engineering methods are within the scope of protection, including but not limited to: implementing algorithm logic using different programming languages, refactoring functional modules into services, adjusting data interaction protocols, and optimizing resource scheduling strategies. Any implementation scheme derived from reasonable modifications to the data processing flow, service call chain, or system architecture layer without departing from the core technology of the present invention should be considered within the protection scope defined by the technical solution of the present invention.
Claims
1. A method for analyzing intelligent medical consultation logs in hospitals, characterized in that, Includes the following steps: S1: Generate a medical concept depth value by statistically analyzing the hierarchical structure data of medical concepts, extract a set of symptom keywords from the log using word frequency inverse document frequency, and retrieve the medical concept depth value of the symptom keyword set; S2: Calculate the statistical information gain value of the symptom keyword set, generate a semantic consistency score based on the difference between the medical concept depth value and the common ancestor depth value, combine the statistical information gain value and the semantic consistency score to generate a split decision index, and construct a medical intent classification tree; S3: Input logs into the medical intent classification tree to generate a consultation intent category identifier, identify the erroneous decision node identifier based on the diagnosis and treatment correction feedback signal and update the misclassification penalty value, and connect the erroneous decision node identifier with the correct intent node identifier to generate a virtual error correction association link; S4: Calculate the ratio of the number of node visits to the medical intent classification tree to the misclassification penalty value, generate the path confidence coefficient, and merge the nodes. When the guiding weight value of the virtual error correction association link exceeds the limit, establish a physical branch and generate an adaptively reconstructed medical intent classification tree.
2. The hospital intelligent consultation log analysis method according to claim 1, characterized in that, The steps in S1 specifically include: S11: Obtain a medical knowledge graph or hierarchical coding table containing multi-level classification relationships, traverse the topological path from the root node to each end entity node, calculate the hierarchical distance of each entity node in the topological structure, assign a unique hierarchical position parameter to each entity node, and generate the medical concept depth value. S12: Perform word segmentation and stop word filtering on the input consultation log, calculate the frequency of each word in the current log and the inverse document frequency in the historical corpus, obtain the feature weight value through product operation, filter out words with weight values exceeding the preset significance threshold, and generate the symptom keyword set. S13: Traverse each keyword in the set of symptom keywords, perform semantic fuzzy matching in the medical knowledge graph to locate the corresponding entity node, read the hierarchical position parameters assigned to the entity node, and retrieve the medical concept depth value corresponding to each keyword.
3. The hospital intelligent consultation log analysis method according to claim 2, characterized in that, The steps in S2 specifically include: S21: Calculate the intent distribution probability of the log samples contained in the current node to be split, calculate the Shannon entropy of the sample set, and calculate the conditional entropy of each candidate keyword after it divides the sample set. Calculate the statistical information gain value by calculating the difference between the Shannon entropy and the conditional entropy. S22: Identify the path parent features of the current node to be split and the medical entity nodes corresponding to the candidate keywords. Backtrack in the medical concept hierarchy to find the nearest common ancestor node of the two, obtain the hierarchy depth of the common ancestor node, and calculate the structured semantic distance by combining the respective medical concept depth values to generate the semantic consistency score. S23: Normalize the statistical information gain value and the semantic consistency score respectively, and use a preset adjustment factor to perform weighted fusion or multiplication operation on the two to quantitatively evaluate the comprehensive distinguishing ability of candidate keywords at the data statistics and medical semantic level, and generate the split decision index. S24: Sort candidate keywords in descending order according to the split decision index, select the optimal keyword as the split feature of the current node, recursively execute the sample subset partitioning process until the preset tree depth limit or node purity requirement is met, and construct the medical intent classification tree.
4. The hospital intelligent consultation log analysis method according to claim 3, characterized in that, The steps in S3 specifically include: S31: The consultation log to be analyzed is used as an input vector and imported into the root node of the medical intent classification tree. The log features are matched and descended along the branch path of the tree until the terminal leaf node is reached. The intent label mapped by the leaf node is output to generate the consultation intent category identifier. S32: Receive the diagnosis and treatment correction feedback signal from professional physician review or subsequent diagnosis and treatment process, compare the diagnosis intention category identifier output by the system with the actual diagnosis and treatment intention, if the two are inconsistent, backtrack the decision path of the classification tree to locate the last effective feature node that caused the deviation, and identify the erroneous decision node identifier. S33: Read the historical cumulative error count corresponding to the error decision node identifier, increase the corresponding penalty weight according to the severity level of the current misclassification, and update the misclassification penalty value associated with the node using the accumulated weight value; S34: Establish a non-tree-structured logical mapping relationship between the erroneous decision node identifier and the correct intent node representing the true treatment intention, initialize the guidance weight value of the mapping relationship, and generate the virtual error correction association link used to guide subsequent path optimization.
5. The hospital intelligent consultation log analysis method according to claim 4, characterized in that, The steps in S4 specifically include: S41: Count the total number of times each node in the medical intent classification tree is traversed within the specified time window to obtain the node access count, read the misclassification penalty value currently stored in each node, use the ratio function to evaluate the reliability of the node as a decision basis, and generate the path confidence coefficient. S42: Traverse the terminal branches in the tree structure, filter out low-confidence nodes whose path confidence coefficient is lower than the preset pruning threshold, merge them with their parent nodes, remove invalid branch structures and reallocate sample statistics data to merge nodes; S43: Monitor the triggering frequency of the virtual error correction association link in real time. Whenever a new feedback signal verifies the validity of the link, accumulate its weight parameter. Determine whether the accumulated weight parameter exceeds the preset structural reconstruction threshold. If it does, determine that the guiding weight value exceeds the limit and issue a physical branch establishment command. S44: In response to the instruction to establish a physical branch, at the location of the erroneous decision node, a new entity splitting edge is added based on the direction of the virtual error correction association link. The correct intent node is attached as a new child node, and historical related samples are migrated to the new branch to generate the adaptive reconstruction medical intent classification tree.
6. The hospital intelligent consultation log analysis method according to claim 5, characterized in that, The specific process for generating the semantic consistency score is as follows: Obtain the first depth parameter corresponding to the candidate keyword, the second depth parameter corresponding to the current path feature, and the common ancestor depth value corresponding to the nearest common ancestor node of the two; The semantic consistency score is calculated according to the following formula: ; in, This represents the semantic consistency score. This represents the depth value of the common ancestor. The numerical value representing the medical concept depth of the candidate keywords. The numerical value representing the depth of the medical concept, which indicates the characteristics of the current path. Represents the semantic distance decay coefficient. This represents an exponential function.
7. The hospital intelligent consultation log analysis method according to claim 6, characterized in that, The process of generating the split decision index specifically includes: Obtain the preset data-driven weighting coefficients and knowledge-driven weighting coefficients; The first component is obtained by multiplying the preset data-driven weight coefficient with the normalized statistical information gain value, and the second component is obtained by multiplying the preset knowledge-driven weight coefficient with the semantic consistency score. The linear sum of the first component and the second component is calculated to generate the splitting decision index, so as to ensure that the splitting feature is both statistically significant and conforms to the hierarchical logic of the medical knowledge system.
8. The hospital intelligent consultation log analysis method according to claim 7, characterized in that, The calculation process for the path confidence coefficient is as follows: Obtain the number of node visits and the misclassification penalty value of the decision node within a historical time period; The path confidence coefficient is calculated using the following formula: ; in, This represents the confidence coefficient of the stated path. This represents the number of visits to the node. This represents the value of the misclassification penalty. Represents the error penalty sensitivity factor. This represents a smoothing constant used to prevent the denominator from being zero.
9. The hospital intelligent consultation log analysis method according to claim 8, characterized in that, The specific execution process for establishing a physical branch includes: Lock the target intent category pointed to by the virtual error correction association link, and add a leaf node with the target intent category as the output result under the classification tree node corresponding to the error decision node identifier; An entity connection edge is constructed between the error decision node identifier and the newly added leaf node, and the historical log samples that triggered the virtual error correction association link are redistributed to the leaf node. The sample distribution statistics table of the parent node is updated to complete the solidification of the physical structure.
10. A hospital intelligent consultation log analysis system, characterized in that, The system is used to implement the hospital intelligent consultation log analysis method according to any one of claims 1-9, and the system includes: The medical concept parsing and extraction submodule is used to statistically analyze the hierarchical structure data depth of medical concepts to generate the medical concept depth value, extract the symptom keyword set from the log using word frequency inverse document frequency, and retrieve the medical concept depth value of the symptom keyword set; The intent classification tree construction submodule is used to calculate the statistical information gain value of the symptom keyword set, generate a semantic consistency score based on the difference between the medical concept depth value and the common ancestor depth value, and generate a split decision index by combining the statistical information gain value and the semantic consistency score to construct the medical intent classification tree; The diagnosis and treatment feedback error correction submodule is used to input logs into the medical intent classification tree to generate the consultation intent category identifier, identify the erroneous decision node identifier based on the diagnosis and treatment correction feedback signal and update the misclassification penalty value, and connect the erroneous decision node identifier with the correct intent node identifier to generate a virtual error correction association link; The adaptive structure reconstruction submodule is used to calculate the ratio of the number of node visits to the misclassification penalty value in the medical intent classification tree, generate the path confidence coefficient, and merge the nodes. When the guiding weight value of the virtual error correction association link exceeds the limit, a physical branch is established to generate the adaptively reconstructed medical intent classification tree.
Citation Information
Cited By
A multi-source heterogeneous data fusion processing method and system of an industrial internet platform
CN122196185A
A multi-source heterogeneous data fusion processing method and system of an industrial internet platform
CN122196185B
