An in-hospital ischemic stroke dynamic early warning method based on natural language processing anchoring and multi-center electronic medical record modeling
Patent Information
- Application Number
- CN202610868760.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-16
- Publication Date
- 2026-10-27
AI Technical Summary
[0008]发明目的:本发明的目的是提供一种基于自然语言处理锚定和多中心电子病历建模的院内缺血性卒中动态预警方法,解决现有技术中结构化起病时间缺失、静态分类不适用于连续监测、跨中心推广能力有限以及风险提示缺乏解释证据的问题
[0026]有益效果:与现有技术相比,本发明具有如下显著优点:第一,通过自然语言处理重建卒中起病时刻,提高了动态标签的时间真实性;第二,通过多时距窗口和盲区设计,使模型面向真正可干预的起病前状态学习;第三,通过多中心冻结迁移验证,提高了技术方案的推广可信度;第四,通过多层次解释输出增强了预警系统的临床可用性和审查性。
Smart Images

Figure CN122991652A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical artificial intelligence technology, specifically to a dynamic early warning method for in-hospital ischemic stroke based on natural language processing anchoring and multi-center electronic medical record modeling. Background Technology
[0002] In-hospital ischemic stroke is a typical time-sensitive clinical emergency. Once a patient develops neurological deficits, the ability to complete bedside review, stroke team response, imaging examinations, and subsequent interventions within a short period of time often directly affects the opportunity for reperfusion therapy and long-term neurological outcomes.
[0003] Unlike community-based ischemic stroke, in-hospital ischemic stroke often occurs in hospitalized patients who are post-operative, under sedation, in intensive care, have multiple coexisting conditions, or are experiencing hemodynamic fluctuations. These patients often have complex underlying medical conditions and require extensive monitoring, making it easy for early neurological abnormalities to be masked by other changes in their condition.
[0004] The existing in-hospital stroke identification process mostly relies on medical staff to respond passively after obvious neurological deficits appear, lacking a dynamic early warning mechanism for the physiological fluctuation stage before the onset of the disease, making it difficult to give the clinical team enough lead time.
[0005] In recent years, machine learning methods based on electronic medical records have been increasingly used for patient deterioration identification and stroke-related prediction. Existing research shows that both structured variables and unstructured clinical texts contain stroke risk-related signals, but many solutions still remain at the static binary classification level and cannot be directly adapted to inpatient continuous monitoring scenarios.
[0006] A key challenge in real-world electronic medical records is the lack of highly reliable structured records of stroke onset. Diagnosis time, imaging time, and medical order entry time often lag behind the earliest symptom onset time. Directly using these as the origin of the label time can easily lead to label offset and forward bias.
[0007] Furthermore, the lack of clinically interpretable evidence in black-box risk models limits the trust and implementation of early warning results by hospital teams. When single-center models are extended to other institutions, they are also affected by differences in documentation practices, measurement density, patient composition, and medical procedures, leading to decreased transferability. Summary of the Invention
[0008] Purpose of the invention: The purpose of this invention is to provide a dynamic early warning method for in-hospital ischemic stroke based on natural language processing anchoring and multi-center electronic medical record modeling, which solves the problems of missing structured onset time, static classification not being suitable for continuous monitoring, limited cross-center extension capability, and lack of interpretive evidence for risk warnings in the existing technology.
[0009] Technical Solution: The present invention provides a dynamic early warning method for in-hospital ischemic stroke based on natural language processing anchoring and multi-center electronic medical record modeling, comprising the following steps:
[0010] Step S1: Collect structured electronic medical record data, continuous vital signs data and unstructured clinical text of hospitalized patients, and define a uniform analysis cutoff time for each candidate sample;
[0011] Step S2: Stroke time anchoring is performed on unstructured clinical texts, and the stroke anchor time of the patient's clinical records is obtained through a hierarchical natural language processing strategy.
[0012] Step S3: Using the actual onset time of stroke as the zero point, construct dynamic early warning labels around 4 hours, 5 hours and 6 hours before the onset of stroke, and set event blind zones and transition buffers to eliminate fuzzy samples.
[0013] Step S4: Under the constraint of not being later than the analysis deadline, extract demographic features, comorbidity features, laboratory features, vital sign statistics, and hemodynamic derivative features to form an early warning input vector;
[0014] Step S5: Perform missing value imputation, robust scaling and class imbalance processing on the early warning input vector, train multiple tree models as early warning models, and use patient-level cross-validation to determine the optimal model and its classification threshold;
[0015] Step S6: After freezing the trained optimal model, preprocessor and classification threshold, apply it to the patient to be tested and output the dynamic early warning risk of in-hospital ischemic stroke.
[0016] Step S7: Use the SHAP method to perform group-level, feature-level, and patient-level interpretations of the early warning results to generate clinically verifiable explanatory evidence.
[0017] Furthermore, in step S2, the stroke onset time anchoring adopts a hierarchical natural language processing strategy as follows: explicit onset time identification, used to extract absolute time expressions from the text; relative time expression parsing, used to combine the recorded time metadata to convert relative time phrases into absolute times; and recorded time backtracking, used to use the recorded generation time as a conservative proxy time upper bound when there is a clear description of acute stroke but lacks a precise time.
[0018] Furthermore, in step S2, text event filtering is further performed to exclude past stroke history, stroke exclusion diagnosis, neurological abnormalities unrelated to the current hospitalization event, and vague historical event descriptions, in order to reduce time anchoring bias.
[0019] Furthermore, in step S3, the warning windows are set to 4 hours, 5 hours, and 6 hours before the onset of illness; the event blind zone is set to 15 minutes before the onset of illness, and the transition buffer is set to 15 minutes; the positive sample time interval is defined as starting from the time before the onset of illness minus the warning window and then minus the transition buffer, and ending from the time before the onset of illness minus the event blind zone; the negative sample time interval is defined as starting from 480 minutes before the onset of illness and ending from the time before the onset of illness minus the warning window and then minus the transition buffer; the elimination interval includes the interval from the time before the onset of illness minus the warning window and then minus the transition buffer to the interval from the time before the onset of illness minus the warning window and then plus the transition buffer, as well as the interval from the event blind zone to the time of onset of illness.
[0020] Furthermore, in step S4, features are extracted, including: age, gender, hypertension, diabetes, hyperlipidemia, ischemic heart disease, chronic kidney disease, creatinine, glucose, hematocrit, potassium, sodium, heart rate, respiratory rate, systolic blood pressure, diastolic blood pressure, and blood oxygen saturation; and the mean, maximum, and minimum values of heart rate, respiratory rate, systolic blood pressure, diastolic blood pressure, and blood oxygen saturation are extracted within the observation window 6 hours before the analysis cutoff time.
[0021] Furthermore, in step S4, hemodynamic-derived features are further constructed, including: mean pulse pressure, obtained by subtracting the mean diastolic pressure from the mean systolic pressure; mean arterial pressure, obtained by adding twice the mean diastolic pressure to the mean systolic pressure and then dividing by 3; and shock index, obtained by dividing the mean heart rate by the mean systolic pressure.
[0022] Furthermore, in step S5, missing values are filled for continuous variables using the K-nearest neighbor imputation method based on K=5; a robust scaling method is used to standardize continuous features, i.e., each value is subtracted from the median of the feature and then divided by the interquartile range; the SMOTE method is used to oversample within the training fold after patient-level segmentation to alleviate class imbalance; the candidate model is trained through patient-level five-fold cross-validation, and the optimal classification threshold is determined using the Youden index, i.e., the sum of sensitivity and specificity minus one.
[0023] Furthermore, the various tree models include at least three models: LightGBM, XGBoost, and Random Forest.
[0024] Furthermore, in step S6, the preprocessor, derived feature rules, model parameters, and classification thresholds trained on the internal development dataset are all frozen and directly transferred to the external validation dataset without performing retraining, reweighting, or recalibration.
[0025] Furthermore, in step S7, the following three types of interpretation results are output: population-level feature importance ranking, risk change dependency graph of key physiological variables, and waterfall plot decomposition results of early warning triggering for individual patients.
[0026] Beneficial effects: Compared with the prior art, the present invention has the following significant advantages: First, by reconstructing the stroke onset time through natural language processing, the temporal accuracy of dynamic labels is improved; Second, by designing multiple time interval windows and blind zones, the model is oriented towards learning the truly interventionable pre-stroke state; Third, by conducting multi-center frozen transfer validation, the credibility of the technical solution is improved; Fourth, by conducting multi-level interpretation output, the clinical usability and reviewability of the early warning system are enhanced. Attached Figure Description
[0027] Figure 1 Overall framework diagram of the invention;
[0028] Figure 2 The internal development queue of this invention includes 4-hour, 5-hour, and 6-hour early warning ROC combination diagrams;
[0029] Figure 3 The external verification queue of this invention provides ROC combination diagrams for 4-hour, 5-hour, and 6-hour early warnings;
[0030] Figure 4 The SHAP summary chart combination of the 4-hour, 5-hour, and 6-hour early warning models of the present invention;
[0031] Figure 5 This invention provides a SHAP dependency combination diagram of key physiological variables in a 6-hour early warning model;
[0032] Figure 6 The SHAP waterfall plot of high-risk patients over 6 hours in this invention. Detailed Implementation
[0033] The technical solution of the present invention will be further described below with reference to the accompanying drawings.
[0034] like Figure 1 As shown, this embodiment of the invention provides a dynamic early warning method for in-hospital ischemic stroke based on natural language processing anchoring and multi-center electronic medical record modeling, including the following steps:
[0035] S1: Collect structured electronic medical record data, continuous vital signs data and unstructured clinical text of hospitalized patients, and define the analysis cutoff time CUTOFF_TIME for each candidate sample;
[0036] S2: Stroke onset time anchoring is performed on the unstructured clinical text to obtain the actual stroke onset time (Actual_Stroke_Time) of the target patient. Stroke onset time anchoring employs a hierarchical natural language processing strategy, which includes explicit onset time identification, relative time expression parsing, and record time backtracking. Explicit onset time identification is used to extract absolute time expressions such as "symptoms started at 06:30" and "last known well at 14:10". Relative time expression parsing is used to convert time phrases such as "2 hours ago" and "this morning" into absolute times by combining them with record time metadata. Record time backtracking is used to use the record generation time as a conservative proxy time upper bound when there is a clear description of acute stroke but a lack of precise time.
[0037] Further text event filtering is performed to exclude past stroke history, stroke exclusion diagnoses, neurological abnormalities unrelated to the current hospitalization event, and vague historical event descriptions, in order to reduce time anchoring bias.
[0038] S3: Construct dynamic early warning labels for 4, 5 and 6 hours before the onset of illness based on Actual_Stroke_Time, and remove fuzzy samples in the event blind zone and transition buffer;
[0039] Set the early warning window set Minutes, blind spot of events Minutes, Transition Buffer Minutes, the positive sample time interval is defined as The negative sample time interval is defined as The elimination interval is defined as .
[0040] The parameters are defined as follows: Actual_Stroke_Time represents the anchor time of the stroke record extracted from clinical text and verified by rules or manual review. It is used as the zero point for time alignment and is not directly equivalent to the unobservable actual physiological onset time; t represents the time position of the current analysis window relative to this anchor point, in minutes. Indicates the point before the anchor point; The warning interval is indicated by 240, 300, and 360 minutes, which correspond to the tasks 4 hours, 5 hours, and 6 hours before the anchor point, respectively. This indicates the event blind zone, used to remove samples within 15 minutes of the nearest stroke anchor point to prevent the model from using information from recent events. This represents the transition buffer, used to remove ambiguous transitional samples within 15 minutes of the positive and negative sample boundaries. This indicates an earlier reference window used to construct negative samples, but does not indicate that the patient is in a clinically confirmed state of complete normal physiological function. The warning window before the stroke anchor point is used to build positive samples; the exclusion interval represents the time period of samples that do not participate in training and validation.
[0041] S4: Extract demographic features, comorbidity features, laboratory features, vital sign statistics, and hemodynamic derivative features under the constraint of no later than the stated CUTOFF_TIME to form an early warning input vector; extract age, sex, hypertension, diabetes, hyperlipidemia, ischemic heart disease, chronic kidney disease, creatinine, glucose, hematocrit, potassium, sodium, heart rate, respiratory rate, systolic blood pressure, diastolic blood pressure, and blood oxygen saturation, and extract the mean, maximum, and minimum values of vital signs within the observation window 6 hours before the analysis cutoff time; further construct hemodynamic derivative features, including at least: ; ; .
[0042] The parameters are defined as follows: CUTOFF_TIME represents the latest time point at which the data can be used for the current sample, that is, the clinical information that the model can obtain before this time point. Feature extraction cannot use data after this time point. The mean pulse pressure is obtained by subtracting the mean diastolic pressure from the mean systolic pressure within the observation window, and is used to reflect the arterial pulsation pressure load. This represents the mean systolic blood pressure within the observation window, reflecting the average pressure level exerted on the arterial system during cardiac systole. This represents the mean diastolic pressure within the observation window, reflecting the baseline pressure level maintained by peripheral blood vessels during cardiac diastole. Mean arterial pressure is used to approximate the perfusion pressure of organs throughout the body. It represents the mean heart rate within the observation window, reflecting the frequency of heartbeats per unit time; The shock index is calculated by dividing the mean heart rate by the mean systolic blood pressure and is used to reflect the degree of circulatory stress and hemodynamic instability.
[0043] 2. S5: Perform missing value imputation, robust scaling, and class imbalance processing on the warning input vector, train LightGBM, XGBoost, and Random Forest warning models respectively, and use patient-level cross-validation to determine the model and threshold; for continuous variables, use... K-nearest neighbor interpolation, and a robust scaling formula. Continuous features are standardized; SMOTE is used for oversampling within the training fold after patient-level partitioning, and candidate models are trained using patient-level five-fold cross-validation, with the Youden index used. Determine the optimal classification threshold.
[0044] 3. The parameters are defined as follows: This indicates the 5 nearest samples used for imputation of missing values; x represents the original value of a specific continuous clinical feature. This represents the median of the feature in the training set or training compromise. This represents the interquartile range of the feature in the training set or training compromise. This represents the standardized feature values after robust scaling; SMOTE represents the synthetic minority oversampling method, used only to generate minority class samples within the training fold to alleviate class imbalance. Indicates the candidate classification threshold; This represents the sensitivity at the threshold τ, i.e., the proportion of real warning samples that are correctly identified. Indicates threshold The specificity under the given conditions, that is, the proportion of the real reference sample that is correctly identified; This represents the Youden index, used to combine sensitivity and specificity to select the optimal classification threshold.
[0045] S6: After freezing the optimal model, preprocessor, and thresholds, apply them to the patients to be tested to output a dynamic early warning risk of in-hospital ischemic stroke; freeze all preprocessors, derived feature rules, model parameters, and classification thresholds obtained from training on the internal development dataset, and directly transfer them to the external validation dataset without performing retraining, reweighting, or recalibration.
[0046] S7: Utilize SHAP to perform population-level, feature-level, and patient-level interpretation of alert results, generating clinically verifiable explanatory evidence. Output the following three types of explanatory results: population-level feature importance ranking, risk change relationships of key physiological variables, and waterfall plot decomposition results of alert triggering in individual patients.
[0047] Example 1: Preparation of Multi-center Inpatient Electronic Medical Record Data. The internal development dataset was MIMIC-III, and the external validation dataset was MC-MED. Both contain structured electronic medical record information of inpatients and varying degrees of continuous monitoring information. To ensure the temporal consistency of the early warning task, an analysis cutoff time CUTOFF_TIME = Wave_Start was defined for each candidate sample.
[0048] Example 2: Natural Language Processing for Onset Time Anchoring. For candidate stroke cases, medical records, consultation records, nursing records, and relevant free text are retrieved to identify time expressions related to the onset of stroke symptoms, last normal time, and changes in neurological function. If the text contains explicit times such as "onset at 06:30" or "last known well at 14:10," these are directly extracted. If the text only records relative expressions such as "2 hours ago" or "hemiplegia appeared this morning," they are parsed into absolute times based on the recorded time. If there is a clear description of acute stroke but lacks a specific time, the record generation time is used as a conservative upper bound for the proxy.
[0049] Example 3: Validation of Onset Time Anchoring. A gold standard subset of 100 candidate cases was randomly selected. Two neurologists independently reviewed the subset and provided the onset time. Disagreements were discussed and a consensus was reached. The automatically anchored results were compared with the manually defined gold standard. The accuracy rate within the tolerance reached The mean absolute error was 6.8 min, and the median absolute error was... This demonstrates that the present invention has high reliability in the time anchoring process.
[0050] Example 4: Dynamic Tag Generation. Let the difference between the sample time and the onset time be... Define the warning window Minutes. To avoid information leakage caused by events being too close to each other, an event blind zone is set. Minutes; to reduce confusion between the boundaries of the stable period and the warning period, a transition buffer is set. Minutes. The positive sample interval is defined as... The negative sample interval is defined as The elimination interval is defined as .
[0051] The parameters are defined as follows: The time difference between the sample window and the stroke time anchor point is expressed in minutes; Wave start indicates the start time of the current analysis waveform window; Actual stroke time indicates the stroke record anchor point time extracted and confirmed from clinical text, used as the zero point of time, and is not directly equivalent to the unobservable real physiological onset time; Divide by 60 to convert the second-level time difference into minutes. This indicates the warning interval, with values of 240, 300, and 360 minutes, corresponding to warning tasks 4 hours, 5 hours, and 6 hours before the anchor point, respectively. This represents the event blind zone, with a value of 15 minutes. It is used to remove samples that are close to the stroke anchor point to prevent the model from using information from too recent events and causing information leakage. This represents the transition buffer, with a value of 15 minutes, used to remove ambiguous samples near the boundary between the stable period and the warning period, reducing label confounding. Positive sample interval. Indicates the early warning window before the stroke anchor point; negative sample interval The reference window represents the distance from the stroke anchor point; the exclusion interval represents the time period during which the model is not used for training and validation.
[0052] Example 5: Structured Feature Extraction. Demographic variables included age and sex; comorbidity variables included hypertension, diabetes, hyperlipidemia, ischemic heart disease, and chronic kidney disease; laboratory variables included creatinine, glucose, hematocrit, potassium, and sodium; vital signs were extracted within the 6-hour observation window prior to CUTOFF_TIME, including the mean, maximum, and minimum values of heart rate, respiratory rate, systolic blood pressure, diastolic blood pressure, and blood oxygen saturation.
[0053] Based on the aforementioned vital signs, further hemodynamic derivative characteristics are constructed: , , Through these derived features, the present invention not only uses raw monitoring values, but also encodes pulse pressure load, organ perfusion level, and circulatory instability.
[0054] The parameters are defined as follows: CUTOFF_TIME represents the latest time point at which clinical data can be used for the current sample. This is used to ensure that the model only uses data generated before the warning time and avoids using future information. The mean pulse pressure is obtained by subtracting the mean diastolic pressure from the mean systolic pressure within the observation window, and is used to reflect the arterial pulsation pressure load. This represents the mean systolic blood pressure within the observation window, reflecting the arterial pressure level during cardiac systole; This represents the mean diastolic pressure within the observation window, reflecting the baseline pressure level maintained by peripheral blood vessels during cardiac diastole. Mean arterial pressure is used to approximate the perfusion pressure of organs throughout the body. The mean heart rate within the observation window reflects the frequency of heartbeats per unit time; SI stands for shock index, which is obtained by dividing the mean heart rate by the mean systolic blood pressure and is used to reflect the degree of circulatory stress and hemodynamic instability.
[0055] Example 6: Preprocessing and Training. For continuous variables, the following methods are used: K-nearest neighbor interpolation, applying a robust scaling formula to the interpolated continuous variables. Standardization was implemented. Model training was conducted within a patient-level five-fold cross-validation framework to ensure that all windows for the same patient fell into the same data fold. SMOTE was used for oversampling within the training fold to mitigate the imbalance between the number of warning and stable samples.
[0056] Example 7: Model Construction. Dynamic early warning models with three time intervals of 4 hours, 5 hours, and 6 hours were built using LightGBM, XGBoost, and Random Forest, respectively. For each model, the Youden exponent was maximized within the training fold. Choose a classification threshold and fix the use of that threshold to evaluate performance in the validation trade-off.
[0057] Example 8: Internal Development Performance. Representative results of the Random Forest model over 6 hours in the internal development queue; Accuracy value within... Recall value at Precision value at F1 value at The 6-hour XGBoost model also achieved high performance, indicating that a longer window before the onset of disease can provide a more stable physiological basis for dynamic early warning.
[0058] Example 9: External Validation Performance. The full-processor, feature generation rules, model parameters, and thresholds trained on the internal dataset were frozen and directly applied to the MC-MED external validation queue. Under zero hyperparameter tuning conditions, the representative result of XGBoost over 6 hours was an Accuracy value of [value missing]. Recall value at Precision value at F1 value at This demonstrates that the present invention still has good transferability in cross-center scenarios.
[0059] Example 10: Explanatory Output. The trained tree model is decomposed using SHAP to output the model. The population-level SHAP summary plot shows that variables such as potassium, hematocrit, respiratory rate, age, glucose, pulse pressure, diastolic blood pressure, and shock index are the main driving factors; the key variable dependency plot shows the non-linear relationship between variable intervals and warning risk; the patient-level waterfall plot can break down the warning sources of individual high-risk samples item by item, thereby enhancing clinical reviewability.
[0060] Table 1. Basic Statistical Information of Internal and External Queues
[0061] Table 2. Validation results of NLP onset time anchoring
[0062] Table 3 Rules for Defining Dynamic Tab Windows
[0063] Table 4 Structured Early Warning Variables and Extraction Rules
[0064] Table 5 Performance of Dynamic Early Warning in Internal Development Queues
[0065] Table 6 Performance of Dynamic Early Warning for External Validation Queues
[0066] Table 7. Importance of representative key features from various models over a 6-hour period.
[0067] Figure 2 shows the subject operating characteristic curves and the comparison results of the discrimination ability of the dynamic early warning model constructed by the present invention for different early warning time intervals in the internal development cohort.
[0068] Figure 3 shows the migration verification results of the frozen early warning model of the present invention in the external verification queue, as well as the changes in the model's discrimination performance under different early warning time intervals.
[0069] Figure 4 shows the overall contribution direction, contribution size, and relative importance ranking of each structured electronic medical record feature to the model output under different warning time intervals.
[0070] Figure 5 shows the nonlinear influence of key physiological variables such as shock index, mean arterial pressure, pulse pressure, and mean heart rate on stroke warning risk output within different value ranges.
[0071] Figure 6 illustrates the stepwise contribution process of each key feature to the model prediction results and the risk accumulation mechanism when considering a representative high-risk individual sample.
Claims
1. A dynamic early warning method for in-hospital ischemic stroke based on natural language processing anchoring and multi-center electronic medical record modeling, characterized in that, Includes the following steps: Step S1: Collect structured electronic medical record data, continuous vital signs data and unstructured clinical text of hospitalized patients, and define a uniform analysis cutoff time for each candidate sample; Step S2: Anchor the stroke onset time in unstructured clinical text and obtain the actual stroke onset time of the patient through a hierarchical natural language processing strategy; Step S3: Using the actual onset time of stroke as the zero point, construct dynamic early warning labels around 4 hours, 5 hours and 6 hours before the onset of stroke, and set event blind zones and transition buffers to eliminate fuzzy samples. Step S4: Under the constraint of not being later than the analysis deadline, extract demographic features, comorbidity features, laboratory features, vital sign statistics, and hemodynamic derivative features to form an early warning input vector; Step S5: Perform missing value imputation, robust scaling and class imbalance processing on the early warning input vector, train multiple tree models as early warning models, and use patient-level cross-validation to determine the optimal model and its classification threshold; Step S6: After freezing the trained optimal model, preprocessor and classification threshold, apply it to the patient to be tested and output the dynamic early warning risk of in-hospital ischemic stroke. Step S7: Use the SHAP method to perform group-level, feature-level, and patient-level interpretations of the early warning results to generate clinically verifiable explanatory evidence.
2. The method for dynamic early warning of in-hospital ischemic stroke based on natural language processing anchoring and multi-center electronic medical record modeling as described in claim 1, characterized in that, In step S2, the stroke onset time anchoring adopts a hierarchical natural language processing strategy as follows: explicit onset time identification, used to extract absolute time expressions from the text; relative time expression parsing, used to combine the recorded time metadata to convert relative time phrases into absolute time; and recorded time backtracking, used to use the recorded generation time as a conservative proxy time upper bound when there is a clear description of acute stroke but lacks a precise time.
3. The method for dynamic early warning of in-hospital ischemic stroke based on natural language processing anchoring and multi-center electronic medical record modeling as described in claim 1, characterized in that, In step S2, text event filtering is further performed to exclude past stroke history, stroke exclusion diagnosis, neurological abnormalities unrelated to the current hospitalization event, and vague historical event descriptions, in order to reduce time anchoring bias.
4. The method for dynamic early warning of in-hospital ischemic stroke based on natural language processing anchoring and multi-center electronic medical record modeling as described in claim 1, characterized in that, In step S3, the warning windows are set to 4 hours, 5 hours, and 6 hours before the onset of illness; the event blind zone is set to 15 minutes before the onset of illness, and the transition buffer is set to 15 minutes; the positive sample time interval is defined as starting from the time before the onset of illness minus the warning window and then minus the transition buffer, and ending from the time before the onset of illness minus the event blind zone; the negative sample time interval is defined as starting from 480 minutes before the onset of illness and ending from the time before the onset of illness minus the warning window and then minus the transition buffer; the elimination interval includes the interval from the time before the onset of illness minus the warning window and then minus the transition buffer to the interval from the time before the onset of illness minus the warning window and then plus the transition buffer, as well as the interval from the event blind zone to the time of onset of illness.
5. The method for dynamic early warning of in-hospital ischemic stroke based on natural language processing anchoring and multi-center electronic medical record modeling as described in claim 1, characterized in that, In step S4, features are extracted, including: age, gender, hypertension, diabetes, hyperlipidemia, ischemic heart disease, chronic kidney disease, creatinine, glucose, hematocrit, potassium, sodium, heart rate, respiratory rate, systolic blood pressure, diastolic blood pressure, and blood oxygen saturation; and the mean, maximum, and minimum values of heart rate, respiratory rate, systolic blood pressure, diastolic blood pressure, and blood oxygen saturation are extracted within the observation window 6 hours before the analysis cutoff time.
6. The method for dynamic early warning of in-hospital ischemic stroke based on natural language processing anchoring and multi-center electronic medical record modeling as described in claim 1, characterized in that, In step S4, hemodynamic derivative features are further constructed, including: mean pulse pressure, which is obtained by subtracting the mean diastolic pressure from the mean systolic pressure; mean arterial pressure, which is obtained by adding twice the mean diastolic pressure to the mean systolic pressure and then dividing by 3; and shock index, which is obtained by dividing the mean heart rate by the mean systolic pressure.
7. The method for dynamic early warning of in-hospital ischemic stroke based on natural language processing anchoring and multi-center electronic medical record modeling as described in claim 1, characterized in that, In step S5, missing values are filled for continuous variables using the K-nearest neighbor imputation method based on K=5; a robust scaling method is used to standardize continuous features, i.e., each value is subtracted from the median of the feature and then divided by the interquartile range; the SMOTE method is used to oversample within the training fold after patient-level segmentation to alleviate class imbalance; the candidate model is trained through patient-level five-fold cross-validation, and the optimal classification threshold is determined using the Youden index, i.e., the sum of sensitivity and specificity minus one.
8. The method for dynamic early warning of in-hospital ischemic stroke based on natural language processing anchoring and multi-center electronic medical record modeling as described in claim 1, characterized in that, The various tree models include at least three models: LightGBM, XGBoost, and RandomForest.
9. The method for dynamic early warning of in-hospital ischemic stroke based on natural language processing anchoring and multi-center electronic medical record modeling as described in claim 1, characterized in that, In step S6, the preprocessor, derived feature rules, model parameters and classification thresholds trained on the internal development dataset are all frozen and directly transferred to the external validation dataset without retraining, reweighting or recalibrating.
10. The method for dynamic early warning of in-hospital ischemic stroke based on natural language processing anchoring and multi-center electronic medical record modeling according to claim 1, characterized in that, In step S7, the following three types of interpretation results are output: population-level feature importance ranking, risk change dependency graph of key physiological variables, and waterfall plot decomposition results of early warning triggering for individual patients.