Intelligent triage method and system based on pre-diagnosis text clustering and pattern recognition
By generating pseudo-labels through unsupervised clustering and combining them with a pre-trained language model and XGBoost classifier, the problems of low efficiency in traditional manual triage and high cost in intelligent triage are solved, achieving efficient and accurate real-time triage.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CENT SOUTH UNIV
- Filing Date
- 2026-02-27
- Publication Date
- 2026-05-01
AI Technical Summary
In existing technologies, traditional manual triage is inefficient and costly, while intelligent triage methods rely on expensive manually labeled data and cannot adapt to new symptoms in real time. Furthermore, unsupervised clustering cannot be directly used for real-time triage.
We employ an unsupervised clustering and pattern recognition method based on pre-consultation text. We generate pseudo-labels from massive amounts of unlabeled text using an unsupervised clustering algorithm. Combined with a pre-trained language model and an XGBoost classifier, we construct an intelligent triage model to achieve automatic department mapping.
It reduces model training costs, improves triage accuracy and response speed, has the ability to dynamically discover new symptom patterns, adapts to disease changes, and meets the needs of real-time triage.
Smart Images

Figure CN121747878B_ABST
Abstract
Description
Intelligent triage method and system based on pre-diagnosis text clustering and pattern recognition Technical Field
[0001] This application belongs to the interdisciplinary field of medical information technology and artificial intelligence, specifically involving an intelligent triage method based on natural language processing (NLP), text clustering and pattern recognition, which is particularly suitable for the pre-diagnosis stage of hospitals or online medical platforms. Background Technology
[0002] In the current healthcare system, outpatient triage is a crucial link connecting patients with medical services, and its accuracy and efficiency directly impact the service quality of medical institutions and the patient's healthcare experience. Having an advanced "intelligent triage system" has become a necessity, as indispensable as in-hospital examination and consultation systems.
[0003] Currently, hospital triage and patient guidance primarily rely on manual processes. When patients enter the hospital or use online consultation platforms, they first need to verbally or in writing describe their symptoms to the triage nurse or customer service staff. The staff then use their personal experience and medical knowledge to determine which department the patient should go to.
[0004] This traditional triage method has the following problems:
[0005] (1) High subjectivity and low efficiency: The triage results are highly dependent on the experience level of the triage staff, and different staff may have different judgments on the same symptoms. During peak hours, manual processing of a large number of patient descriptions is slow, prone to errors, and results in long waiting times for patients.
[0006] (2) High labor costs: It requires a dedicated triage team, which occupies valuable medical human resources.
[0007] (3) High dependence on patient descriptions: Patients (especially those without a medical background) often describe their own condition in a colloquial, non-standard, and fragmented manner, requiring triage staff to repeatedly ask follow-up questions to obtain key information.
[0008] To address the aforementioned problems, some explorations have been conducted in this field, which can be mainly categorized into three types:
[0009] 1. Keyword- or rule-based systems: This is the earliest and simplest attempt at intelligent triage. The system pre-defines a "symptom-department" mapping rule base (e.g., matching "chest tightness" or "palpitations" recommends cardiology). For example, based on disease diagnosis classifications and a knowledge base, patients are accurately matched with departments and doctors, achieving intelligent triage.
[0010] Disadvantages and limitations: This method has rigid rules and incomplete coverage. Medical symptoms are extremely complex, with cases of "same symptoms but different diseases" (e.g., "toothache" could be a dental problem or a cardiology case of radiating pain from a myocardial infarction) and "same disease but different symptoms." Simple keyword matching cannot handle complex semantics, context, and atypical expressions, resulting in very low triage accuracy.
[0011] 2. Classification systems based on supervised learning (pattern recognition): This is currently the mainstream approach in AI-based medical triage research. This method treats the triage problem as a text classification task, which falls under the category of pattern recognition.
[0012] Technical Approach: Support Vector Machines (SVM), Random Forests, or more advanced deep learning models (such as Convolutional Neural Networks (CNN), Long Short-Term Memory Networks (LSTM), or BERT pre-trained language models) are used to learn the mapping relationship between "patient complaint text" and "target department labels." For example, some studies have integrated Principal Component Analysis (PCA) and Random Forest algorithms to design triage algorithms and introduced differential privacy and homomorphic encryption techniques to construct a double-encrypted hospital emergency triage model. Other studies have used the BERT-base-Chinese pre-trained language model as a foundation, concatenating text and structured data according to "label + content," performing encoding processing, fine-tuning the model based on classification task requirements, and comparing its recognition capabilities with those of lightweight generative large language models.
[0013] Current Application: Researchers collect hundreds of thousands of patient complaints and ask medical experts to manually label each data point with the correct department (e.g., "Respiratory Medicine," "Gastroenterology"). Then, this labeled data is used to "feed" and train the classification model.
[0014] Disadvantages and shortcomings:
[0015] (1) Bottleneck of data annotation: This is the most fatal flaw of this method. It relies heavily on massive, high-quality datasets manually annotated by experts. This process is extremely costly, time-consuming, and difficult to obtain.
[0016] (2) Model rigidity and “closed set problem”: The model can only recognize patterns that already exist in the training data. It cannot discover new or rare symptom combinations, nor can it cope with newly emerging diseases (such as new influenza variants). Once the hospital department settings are adjusted, the model needs to be re-labeled and retrained.
[0017] (3) Poor interpretability: In particular, deep learning models have a decision-making process that is like a "black box", making it difficult to explain to doctors and patients why they are referred to a specific department.
[0018] 3. Analysis systems based on unsupervised learning (clustering algorithms): In order to circumvent the problem of "data labeling", some studies have tried to use unsupervised clustering algorithms to analyze pre-diagnosis texts.
[0019] Technical Approach: Clustering algorithms (such as K-Means, DBSCAN, hierarchical clustering, KC-LLDA, etc.) do not require pre-labeling. They automatically analyze text features (such as TF-IDF or word vectors) and group semantically similar texts (i.e., texts with similar symptom descriptions) together to form different "clusters." For example, research has proposed the Knowledge Constraint Labeled Latent Dirichlet Allocation (KC-LLDA) method, which combines domain-specific knowledge constraints with LDA. Comparison of KC-LLDA with other existing similar topic extraction methods shows that the proposed method is more suitable for clustering modeling in the context of medical texts. By grouping similar text documents into the same category, text clustering technology can help healthcare practitioners and researchers better understand, manage, and utilize this information. Other research has developed a C-means algorithm based on cloud edge computing systems to aggregate medical data from different hospitals. Still other research has proposed a hybrid optimization technique based on K-means to effectively assist doctors in aggregating cardiology-related medical data and finding the optimal solution.
[0020] Current Applications: In existing technologies, clustering algorithms are mainly used to assist in analysis and knowledge discovery, such as automatically identifying different subtypes of diabetes from massive electronic medical records, or analyzing the clustering of flu symptoms in a certain season.
[0021] Disadvantages and shortcomings:
[0022] (1) The problem of interpreting clustering results: Clustering algorithms can only "cluster", not "name". They can only tell us that "texts A, B, and C belong to cluster 1" and "texts D, E, and F belong to cluster 2", but they do not know that "cluster 1" represents "respiratory infection" and "cluster 2" represents "acute gastroenteritis". In the existing technology, medical experts still need to conduct a lot of manual review and summarization after the clustering is completed in order to understand the medical meaning of each cluster, which goes against the original intention of automation.
[0023] (2) Cannot be directly used for triage: Traditional clustering applications are not an end-to-end triage system. It cannot assign a new patient to the correct department in real time when it receives a new patient's chief complaint. It is more of a "post-event" analysis tool than a "pre-event" prediction tool.
[0024] (3) Sensitive to data quality and parameters: The clustering effect is highly dependent on the quality of global semantic representation vectorization, and algorithms such as K-Means require the number of clusters K to be specified in advance, which is difficult to determine in medical scenarios with a large number of departments and complex symptoms.
[0025] Summary of the shortcomings of the background technologies: In summary, among the existing technologies, rule-based methods are too simple; supervised pattern recognition methods (such as BERT classification) are effective but are hampered by expensive data annotation; and unsupervised clustering methods are difficult to interpret clustering results and cannot be directly applied to real-time triage.
[0026] Therefore, there is an urgent need in this field for a new technical solution that can avoid the cost of large-scale manual annotation, automatically discover symptom patterns from massive amounts of unannotated text like clustering, and build an intelligent model that can be directly used for real-time triage, just like a pattern recognition classifier. Summary of the Invention
[0027] The purpose of this application is to provide an intelligent triage method and system based on pre-diagnosis text clustering and pattern recognition, which solves the problems of low efficiency of traditional manual triage, high cost, poor flexibility, and inability to be applied in real time of existing intelligent triage methods.
[0028] The technical solution provided in this application is as follows:
[0029] Firstly, this application provides an intelligent triage method based on pre-diagnosis text clustering and pattern recognition, including an offline training phase and a real-time triage phase, the specific steps of which are as follows:
[0030] S1, Offline Training Phase:
[0031] S11. Acquisition and preprocessing of pre-consultation text data: Acquire massive amounts of historical patient pre-consultation texts, perform data cleaning, and expand the vocabulary of the pre-trained language model.
[0032] S12. Text Feature Vectorization: A pre-trained language model is used to extract features from each pre-diagnosis text after data cleaning, and the global semantic representation vector corresponding to each text is output to form a feature matrix.
[0033] S13. Unsupervised text clustering: Using the feature matrix as input, the global semantic representation vectors with similar semantics are aggregated through an unsupervised clustering algorithm, and the clustering results are output.
[0034] S14. Cluster-Department Mapping and Pseudo-Label Generation: A structured "department-symptom" medical knowledge base is pre-constructed; for each cluster in the classification results, feature keywords are extracted, the matching degree between the feature keywords and the symptom sets of each department in the medical knowledge base is calculated, the department with the highest matching degree is used as the mapping label of the cluster, and the mapping label is assigned to all global semantic representation vectors within the cluster to generate a pseudo-label dataset;
[0035] S15. Intelligent triage model construction: Using the pseudo-label dataset as training data, an intelligent triage model based on pattern recognition is trained.
[0036] Real-time triage stage:
[0037] S21. Real-time preprocessing: Cleaning the chief complaint text entered by new patients;
[0038] S22. Real-time text feature vectorization: Using the same pre-trained language model as the offline training stage, the pre-processed main text is converted into the corresponding global semantic representation vector;
[0039] S23. Real-time triage prediction: Input the global semantic representation vector obtained in S22 into the intelligent triage model built in the offline training stage, output the predicted probability of each department, and recommend the department with the highest probability.
[0040] In one possible implementation, in S11, the expanded vocabulary of the pre-trained language model includes:
[0041] Construct a semantic association graph and calculate term association weights; embed a medical professional dictionary, a medical term synonym network, and term association weights into the word vector space of a pre-trained language model, so that the global semantic representation vector generated by the subsequent pre-trained language model simultaneously integrates textual semantic features and medical term association features. The medical term association features include symptom-complication association features and cross-departmental symptom association features.
[0042] In one possible implementation, a semantic association graph is constructed for symptom terms, complication terms, and department-specific terms.
[0043] In one possible implementation, in S12, the pre-trained language model is the BERT-wwm-ext model, which is a full-word masking model, and the global semantic representation vector is the final hidden layer output vector corresponding to the classification label of the pre-diagnosis text, with a dimension of 768.
[0044] In one possible implementation, in S13, the unsupervised clustering algorithm is an agglomerative hierarchical clustering algorithm, which uses cosine distance as the distance metric between vectors and employs the Ward linking method to perform iterative merging of clusters. The clustering result is a tree diagram that displays the hierarchical merging relationship of global semantic representation vectors.
[0045] In one possible implementation, in S14, the feature keywords are extracted by calculating the TF-IDF value of the pre-diagnosis text corresponding to the global semantic representation vector within the cluster, and the T words with the highest scores are selected as feature keywords, where T is a positive integer and is taken as an empirical value; the matching degree is calculated by the Jaccard similarity algorithm.
[0046] In one possible implementation, the matching degree adopts a two-stage similarity matching mechanism: the first stage calculates the Jaccard similarity between the feature keywords and the symptom sets of each department in the medical knowledge base, and selects the top M candidate departments; the second stage calculates the final matching degree through a weighted model, which is: matching degree = Jaccard similarity × α + disease incidence probability × β + complication association risk × γ, where M is a preset number, and α, β and γ are the weights of Jaccard similarity, disease incidence probability and complication association risk, respectively.
[0047] In one possible implementation, in S15, the intelligent triage model is an XGBoost classifier, the input features of the training data are the global semantic representation vector generated in S12, and the labels are the department mapping labels generated in S14.
[0048] In one possible implementation, the intelligent triage model is an XGBoost classifier enhanced with dual attention weights. The dual attention weights include textual semantic attention weights and departmental association attention weights. The textual semantic attention weights are determined by calculating the TF-IDF value of the pre-consultation text corresponding to the global semantic representation vector of symptom terms within the cluster. The departmental association attention weights are set based on the departmental triage priority. The textual semantic attention weights are used to strengthen the influence of key symptom terms on the triage results, and the emergency department has a higher priority weight than general departments in the departmental association attention weights. Using the pseudo-label dataset as training data, a pattern recognition-based intelligent triage model is trained, including: element-wise multiplying the global semantic representation vector generated by the pre-trained language model with the dual attention weights to obtain fused attention features; using the fused attention features as input features and the departmental pseudo-labels as labels, constructing a training dataset for the XGBoost classifier.
[0049] In one possible implementation, the offline training phase further includes: S16, model iteration and update.
[0050] In one possible implementation, the model iteration and update includes: periodically incorporating newly added unlabeled pre-diagnosis text into the data source, repeating steps S11-S15, to achieve a full update of the intelligent triage model.
[0051] In one possible implementation, the model iteration and update includes: during periodic (e.g., quarterly) iterations, newly added unlabeled text is input into the historical cluster centers, the cosine distance between the global semantic representation vector and each cluster center is calculated, if the distance is less than a preset distance threshold, it is directly assigned to the corresponding cluster and the TF-IDF value of the pre-diagnosis text corresponding to the global semantic representation vector within the cluster is updated, if the distance is greater than the preset threshold, it is included in the full re-clustering; when the intelligent triage model is updated, only the feature matrix corresponding to the newly added pseudo-label data is loaded, the decision tree node parameters of the intelligent triage model are fine-tuned, and the parameters with weights higher than the preset weight threshold in the historical intelligent triage model are retained.
[0052] In one possible implementation, the real-time triage stage further includes: if an abnormal symptom warning condition is triggered, a secondary triage mechanism is initiated to generate a list of recommended alternative departments and an explanation of the triage basis. The abnormal symptom warning condition includes the intelligent triage model outputting a maximum probability lower than a preset confidence threshold, the pre-diagnosis text containing high-risk symptom terms, or the detection of rare symptom combinations.
[0053] Secondly, this application provides an intelligent triage system based on pre-diagnosis text clustering and pattern recognition, including: a memory and a processor;
[0054] The memory is used to store computer programs;
[0055] The processor is used to invoke the computer program to execute the method described above.
[0056] Thirdly, this application provides a computer-readable storage medium storing a computer program that, when run on an electronic device, causes the electronic device to perform the method described above.
[0057] Fourthly, this application provides a computer program product, including a computer program that, when run on an electronic device, causes the electronic device to perform the method described above.
[0058] The specific implementation methods of the second to fourth aspects of this application can refer to the implementation methods of the first aspect, and will not be elaborated here.
[0059] Beneficial effects:
[0060] Compared with existing technologies (1) supervised pattern recognition methods that rely on expensive manual annotation and (2) unsupervised clustering analysis methods that are difficult to interpret and cannot be directly used for real-time triage, this application (an intelligent triage method based on pre-diagnosis text clustering and pattern recognition) has the following significant advantages:
[0061] 1. Significantly reduces model training costs and solves the data annotation bottleneck. Existing supervised models (such as BERT classification) rely on massive datasets manually annotated by medical experts, which is extremely costly and time-consuming. This application automatically generates high-quality "pseudo-labels" from massive amounts of unannotated historical text through steps S13 (unsupervised text clustering) and S14 (cluster-department mapping and pseudo-label generation). This replaces massive dynamic manual annotation work with extremely low cost (only requiring the construction of a knowledge base once), solving the biggest cost bottleneck for AI model deployment in this field.
[0062] 2. This application achieves the engineering application of unsupervised clustering, filling a technological gap. Existing clustering algorithms (such as K-Means) are typically only used for post-analysis and cannot be used for real-time prediction. This application cleverly combines the training phase of "unsupervised clustering" with the application phase of "supervised classification" through step S15 (intelligent triage model construction). Instead of using clustering algorithms to predict new patients, this application uses the data generated by clustering algorithms to train a high-efficiency classifier (XGBoost), thereby transforming the "knowledge discovery" capability of clustering algorithms into the engineering application capability of "real-time triage."
[0063] 3. High triage accuracy and strong semantic understanding. In step S12, this application uses a pre-trained language model, such as BERT-wwm-ext, to vectorize the text. Compared with keyword matching or TF-IDF methods in existing technologies, BERT can deeply understand the context of the patient's complaint, synonyms (such as "feeling unwell"), and ambiguities (such as "toothache" potentially being associated with cardiology). This deep semantic understanding, combined with the refined symptom patterns mined by clustering in step S13, enables the intelligent triage model in step S15 to achieve accuracy and robustness far exceeding existing technologies.
[0064] 4. Possesses dynamic discovery and adaptive capabilities. Existing rule-based or supervised models are "static" and cannot cope with emerging disease patterns (such as novel influenza). This application's S13 (unsupervised text clustering) is unsupervised, enabling it to automatically discover non-obvious symptom combination patterns from new data. Combined with the S16 (model iteration) mechanism, this application can periodically and automatically re-cluster, re-map, and re-train, dynamically adapting to changes in the disease spectrum and maintaining the model's timeliness.
[0065] 5. Real-time triage offers fast response times, meeting the needs of clinical applications. This application places the most computationally intensive S12 (text feature vectorization) and S13 (unsupervised text clustering) in the offline training phase. In the real-time triage application of S15, a new patient's request only requires one "BERT single-sentence vectorization" and one "XGBoost prediction". The XGBoost classifier is known for its extremely fast inference speed, therefore, the online response time of this application is extremely short (milliseconds), fully meeting the practical application requirements of high concurrency and low latency in hospital outpatient or online consultation systems. Attached Figure Description
[0066] Figure 1: Flowchart of the "offline training" stage of the intelligent triage method of this application. This figure shows the complete steps of model training on the backend server in this application. The process starts with obtaining a massive amount of unlabeled pre-diagnosis text, and goes through S11~S15 to produce the intelligent triage model.
[0067] Figure 2: Flowchart of the "real-time triage" stage of the intelligent triage method of this application. This figure shows the real-time process of processing a single new patient request when this application is deployed in a practical application (such as a hospital registration APP or mini-program). The process starts with the patient entering the chief complaint text, goes through S21~S23 for rapid prediction, and finally recommends a department to the patient. Detailed Implementation
[0068] To enable those skilled in the art to better understand the present application, the technical solution of the present application will be further described in detail below with reference to the embodiments and accompanying drawings.
[0069] This application aims to overcome the shortcomings of existing technologies, such as the high subjectivity and low efficiency of traditional manual triage, the reliance on large-scale and expensive manually labeled data, model rigidity, and inability to uncover potential symptom patterns in existing supervised learning (pattern recognition) intelligent triage methods, and the difficulty in directly applying unsupervised learning (clustering) models to real-time triage and interpretation. It provides an intelligent triage method based on pre-diagnosis text clustering and pattern recognition.
[0070] The core technical solution of this application is to adopt a combined "unsupervised and semi-supervised" technical approach. First, an unsupervised clustering algorithm is used to automatically mine "symptom-group" patterns from massive amounts of unlabeled historical pre-consultation text data. Then, through an efficient mapping method (manual or automatic), these "groups" are assigned real departmental meanings, thereby generating massive amounts of "pseudo-label" data at low cost. Finally, using this pseudo-label data, an efficient and accurate supervised pattern recognition (classification) model is trained for real-time intelligent triage of new patients.
[0071] Example 1:
[0072] This application provides an intelligent triage method based on pre-diagnosis text clustering and pattern recognition, including an offline training stage and a real-time triage stage. The specific steps are as follows:
[0073] S1, Offline Training Phase:
[0074] S11. Acquisition and preprocessing of pre-consultation text data: Acquire a large amount of historical patient pre-consultation text (as samples), perform data cleaning, and expand the vocabulary of the pre-trained language model.
[0075] For example, data sources can be obtained by acquiring a large amount of historical patient pre-consultation texts (patient complaints) from hospital information systems (HIS), electronic medical record (EMR) systems, or online medical consultation platforms.
[0076] For example, data preprocessing includes data cleaning and vocabulary expansion. First, noisy data irrelevant to the description of the illness (such as "hello" and "thank you"), special symbols, HTML tags, etc., are removed. Data preprocessing may also include adding a medical dictionary (containing diseases, symptoms, drugs, body parts, etc.) to the vocabulary of the subsequently pre-trained language model to ensure that the word segmenter of the pre-trained language model can correctly process medical terminology. Further, it may include constructing a semantic association graph for symptom terms, complication terms, and department-specific terms; calculating term association weights; and embedding the medical dictionary, medical terminology synonym network, and term association weights into the word vector space of the pre-trained language model, so that the global semantic representation vector generated by the subsequently pre-trained language model simultaneously integrates textual semantic features and medical terminology association features. These medical terminology association features include symptom-complication association features and cross-departmental symptom association features.
[0077] S12. Text Feature Vectorization: A pre-trained language model is used to extract features from each pre-diagnosis text after data cleaning, and the global semantic representation vector corresponding to each text is output to form a feature matrix.
[0078] This step uses a pre-trained language model for text feature extraction. The pre-trained language model can be the BERT-wwm-ext (Chinese full-word mask) model. For example, each pre-consultation text preprocessed in S11 is input into a BERT-wwm-ext model loaded with a medical dictionary, and the final hidden layer output vector corresponding to the classification label ([CLS] label) of each text is extracted. This vector is a 768-dimensional dense vector, considered as the global semantic representation vector of the pre-consultation text. The output of this process is... The feature matrix of , where This is the total number of pre-consultation texts.
[0079] The [CLS] tag is a special tag in the pre-trained language model, serving as a "global semantic aggregation carrier" for the text. When vectorizing the pre-consultation text (e.g., converting the patient's complaint pre-trained language model "recent chest tightness, occasional palpitations" into a 768-dimensional vector), the BERT pre-trained language model automatically adds the [CLS] tag at the beginning of the text. During model processing, it aggregates all semantic information of the entire text (including symptom keywords, contextual relationships, and the meaning of medical terms) into the hidden layer output vector corresponding to the [CLS] tag. This hidden layer output vector, carrying global semantics, ultimately serves as the core feature vector of the pre-consultation text, used for subsequent clustering analysis and triage model training / pre-trained language model prediction.
[0080] S13. Unsupervised text clustering: Using the feature matrix as input, the global semantic representation vectors with similar semantics are aggregated through an unsupervised clustering algorithm, and the clustering results are output.
[0081] In some embodiments, the generated in S12 Using the feature matrix as input, an unsupervised clustering algorithm is applied, and agglomerative hierarchical clustering is used to automatically aggregate global semantic representation vectors that are semantically similar (i.e., have similar symptom descriptions).
[0082] The clustering process includes:
[0083] (1) Initialization: Each of the global semantic representation vectors is considered an independent cluster.
[0084] (2) Distance metric: Cosine distance (i.e., ...) is used. This is used to measure the distance between any two vectors (or clusters).
[0085] (3) Iterative merging: Calculate the distance between all pairs of clusters, find the two closest clusters, merge them into a new cluster, and repeat this step.
[0086] (4) Linking method: When calculating the distance between a new cluster and other clusters, Ward's Linkage is used. This method tends to merge clusters that minimize the increase in variance within the cluster, which helps to generate clusters with compact structures.
[0087] Ultimately, the output of the hierarchical clustering process is a dendrogram, which shows all global semantic representation vectors from... The entire process of merging independent clusters layer by layer into a single root cluster.
[0088] S14. Cluster-Department Mapping and Pseudo-Label Generation: A structured "department-symptom" medical knowledge base is pre-constructed; for each cluster in the classification results, feature keywords are extracted, and the matching degree between the feature keywords and the symptom sets of each department in the medical knowledge base is calculated. The department with the highest matching degree is used as the mapping label of the cluster, and the mapping label is assigned to all global semantic representation vectors within the cluster to generate a pseudo-label dataset.
[0089] This step addresses the issue that unsupervised clustering results cannot be directly applied to triage. In some embodiments, this step may include:
[0090] (1) Extraction of clusters: Based on the actual number of departments in the hospital, set an expected number of clusters K (e.g., K=50) to determine the total number of clusters that need to be split from the dendrogram; perform dendrogram cutting: find the cutting line corresponding to K clusters on the vertical axis of the dendrogram (representing the merging distance between clusters), and cut the dendrogram horizontally along the cutting line; each independent branch below the dendrogram after cutting is a semantically similar cluster, and each cluster contains several global semantic representation vectors.
[0091] (2) Construction of medical knowledge base: A structured "department-symptom" medical knowledge base is constructed in advance. For example, the knowledge base is in the form of: {"department name": ["symptom word 1", "symptom word 2", ], ...}, for example: {"cardiology": ["chest tightness", "palpitation", ], "respiratory medicine": ["cough", "fever", ]}.
[0092] (3) Cluster feature keyword extraction: First, traverse each of the K clusters (e.g., "cluster_i"), calculate the TF-IDF (term frequency-inverse document frequency) value of the pre-diagnosis text corresponding to all global semantic representation vectors in the cluster (where TF is the frequency of the word in the pre-diagnosis text corresponding to the cluster, and IDF is the frequency of the word in the pre-diagnosis text corresponding to all K clusters), and then automatically extract the T (e.g., T=10) TF-IDF feature keywords with the highest scores in each cluster.
[0093] (4) Automatic mapping: The set of feature keywords of "cluster_i" is compared with the set of "department symptoms" in the medical knowledge base, and the Jaccard similarity is calculated. The Jaccard similarity... Used to measure the similarity between two sets.
[0094] In some embodiments, the department with the highest Jaccard similarity score can be selected as the automatic mapping label for "cluster_i" for department assignment.
[0095] Furthermore, in some embodiments, a two-stage similarity matching mechanism can be adopted: the first stage calculates the Jaccard similarity between the feature keywords and the symptom sets of each department in the medical knowledge base, and filters the top M candidate departments; the second stage calculates the final matching degree through a weighted model, wherein the weighted model is: matching degree = Jaccard similarity × α + disease incidence probability × β + complication association risk × γ, where M is a preset number, α, β, and γ are the weights of Jaccard similarity, disease incidence probability, and complication association risk, respectively, and α, β, and γ are all positive numbers greater than 0 and less than 1, and α + β + γ = 1. The parameters are selected based on experience; in some embodiments, M = 3, α = 0.6, β = 0.2, γ = 0.2, the disease incidence probability is obtained based on historical hospital treatment data, and the complication association risk is set based on clinical treatment guidelines.
[0096] (5) Pseudo-label dataset generation: All global semantic representation vectors within "cluster_i" (e.g., this cluster has 5000 global semantic representation vectors) are labeled with the department names assigned in the automatic mapping step. The cluster feature keyword extraction and automatic mapping steps are repeated for all K clusters to finally obtain... Training data with "pseudo-labels" (data format: global semantic representation vector in S12 + department labels in S14 auto-mapping).
[0097] S15: Intelligent triage model construction: Using the pseudo-label dataset as training data, an intelligent triage (pattern recognition) model based on pattern recognition is trained.
[0098] (1) Model training: Using the “pseudo-label” dataset generated by S14 (features: BERT vectors; Tags: (The department pseudo-labels). Then, an XGBoost (Extreme Gradient Boosting) classifier is trained. This model is the final "intelligent triage model" of this application.
[0099] In some embodiments, the intelligent triage model is an XGBoost classifier enhanced with dual attention weights. The dual attention weights include textual semantic attention weights and departmental association attention weights. The textual semantic attention weights are determined by calculating the TF-IDF value of the pre-consultation text corresponding to the global semantic representation vector of symptom terms within the cluster. The departmental association attention weights are set based on the departmental triage priority. The textual semantic attention weights are used to strengthen the influence of key symptom terms on the triage results. The emergency department has a higher priority weight than ordinary departments in the departmental association attention weights. The intelligent triage model based on pattern recognition is trained using the pseudo-label dataset as training data, including: multiplying the global semantic representation vector generated by the pre-trained language model with the dual attention weights element-wise to obtain fused attention features; and constructing a training dataset for the XGBoost classifier using the fused attention features as input features and the departmental pseudo-labels as labels.
[0100] In some embodiments, the offline training phase further includes: S16, model iteration and update.
[0101] This step may include:
[0102] (1) Regular re-clustering: Regularly (e.g., quarterly) incorporate newly accumulated unlabeled text into the data source, re-perform clustering and mapping to discover new symptom patterns.
[0103] (2) Model update: The XGBoost classifier of S15 is updated using the newly generated pseudo-label data.
[0104] In some embodiments, the model iteration and update includes: periodically incorporating newly added unlabeled pre-diagnosis text into the data source, repeating steps S11-S15, and realizing a full update of the intelligent triage model.
[0105] In some embodiments, the model iteration and update includes: during periodic (e.g., quarterly) iterations, adding new unlabeled text is input into the historical cluster centers, calculating the cosine distance between the global semantic representation vector and the centers of each cluster, and if the distance is less than a preset distance threshold (e.g., 0.5), it is directly assigned to the corresponding cluster and the TF-IDF value of the pre-diagnosis text corresponding to the global semantic representation vector within the cluster is updated; if the distance is greater than the preset threshold, it is included in the full re-clustering; when the intelligent triage model is updated, only the feature matrix corresponding to the newly added pseudo-label data is loaded, the decision tree node parameters of the intelligent triage model are fine-tuned, and the parameters with weights higher than a preset weight threshold (e.g., 0.8) in the historical intelligent triage model are retained.
[0106] Real-time triage phase (model application):
[0107] S21. Real-time preprocessing: Cleaning the chief complaint text entered by new patients;
[0108] S22. Real-time text feature vectorization: Using the same pre-trained language model as the offline training stage, the pre-processed main text is converted into the corresponding global semantic representation vector;
[0109] S23. Real-time triage prediction: Input the global semantic representation vector obtained in S22 into the intelligent triage model built in the offline training stage, output the predicted probability of each department, and recommend the department with the highest probability.
[0110] For example, when a new patient inputs their chief complaint, the system calls the BERT-wwm-ext model in S12 in real time to convert the text into a 768-dimensional vector, and then inputs this vector into the XGBoost classifier trained in S15. Finally, the XGBoost classifier outputs the probability of the patient belonging to each department in real time, and the system selects the department with the highest probability to recommend to the patient.
[0111] In one possible implementation, the real-time triage stage further includes: if an abnormal symptom warning condition is triggered, a secondary triage mechanism is initiated to generate a list of recommended alternative departments and an explanation of the triage basis. The abnormal symptom warning condition includes the intelligent triage model outputting a maximum probability lower than a preset confidence threshold, the pre-diagnosis text containing high-risk symptom terms, or the detection of rare symptom combinations.
[0112] For example, the preset confidence threshold can be set to 85%, and high-risk symptom terms include "severe pain", "difficulty breathing" and "confusion". Rare symptom combinations are defined as combinations of three or more symptoms that are not routinely associated. The alternative department recommendation list generated by the secondary triage mechanism is sorted based on the urgency and complexity of the symptoms, and the triage basis description includes the medical correlation logic between symptoms and departments and the risk priority description.
[0113] It should be noted that the most computationally intensive steps in the entire process—global semantic representation vectorization, hierarchical clustering, automatic mapping, and XGBoost training—are all performed offline. Meanwhile, real-time triage (single-text BERT vectorization + XGBoost prediction) is extremely fast, fully meeting the needs of practical applications.
[0114] Application Case Analysis:
[0115] Pre-consultation text data acquisition and preprocessing: First, 1 million anonymous historical patient pre-consultation texts accumulated from 2020 to 2024 were obtained from the information system (HIS) and electronic medical record (EMR) system of a tertiary hospital as the data source. Subsequently, these texts underwent standardized data cleaning, removing irrelevant words such as "hello" and "thank you," special symbols, and filtering out abnormal entries that were too short or too long. A key preprocessing operation was preparing a medical professional dictionary containing 50,000 entries (covering diseases, symptoms, anatomical locations, etc.), and adding this dictionary to the vocabulary of the BERT-wwm-ext model to be used in S12 to enhance its ability to recognize professional terms such as "myocardial infarction" and "appendicitis."
[0116] Text Feature Vectorization: Text feature extraction is performed using the BERT-WWM-EXT-Chinese pre-trained language model. This offline computation is executed on a server equipped with an NVIDIA A100 GPU. The system inputs one million texts processed by S11 into a BERT model loaded with a medical dictionary, and extracts the final hidden layer output vector corresponding to the [CLS] tag for each text. The output of this process is a... A feature matrix of dimension , where each row represents a 768-dimensional vector of the main text containing deep semantic information.
[0117] Unsupervised text clustering: This step will generate text clustering from S12. The feature matrix is used as input, and an agglomerative hierarchical clustering algorithm is employed. During the clustering process, the algorithm uses cosine distance as the distance metric between vectors and employs the Ward linking method to perform iterative merging of clusters. The Ward method tends to merge clusters that minimize the increase in variance within each cluster, which helps generate structurally compact and meaningful symptom groups. The final output of this step is a complete dendrogram that shows the complete hierarchical relationship of 1 million texts merged layer by layer from independent samples.
[0118] Clustering-Department Mapping and Pseudo-Label Generation: This step is the core of achieving automatic triage. First, a "Department-Symptom" medical knowledge base is pre-built. This knowledge base references the actual department settings of the hospital and contains K=52 departments (such as "Cardiology," "Respiratory Medicine," etc.). Under each department entry, medical experts input approximately 100 core symptom keywords. Then, setting the expected number of clusters K=52, the tree diagram generated in S13 is "cut" to obtain 52 discrete clusters. The system automatically traverses these 52 clusters. For each cluster (e.g., "cluster_i"), by calculating the TF-IDF (Term Frequency-Inverse Cluster Frequency) value, its Top 10 feature keywords are automatically extracted. For example, the keywords for "cluster_3" are found to be "cough, fever, runny nose...". Next, the Jaccard similarity algorithm is used to calculate the similarity between the keyword set of "cluster_3" and the symptom sets of 52 departments in the knowledge base. If the similarity with "respiratory medicine" is found to be the highest (e.g., 0.82), then "respiratory medicine" is used as the label for "cluster_3". Assuming that "cluster_3" contains 80,000 texts, all 80,000 texts (the vector in S12) are assigned the pseudo-label "respiratory medicine". This process is repeated for all 52 clusters, ultimately resulting in 1 million training data points with pseudo-labels.
[0119] Intelligent triage model construction and application: This step uses a dataset of 1 million pseudo-labels generated by S14 ( Using the features and pseudo-labels, an XGBoost classifier is trained. This classifier (objective = 'multi:softmax', num_class = 52) is the final intelligent triage model of this application. In the real-time triage application, when a new patient inputs their chief complaint (e.g., "I have been experiencing chest tightness and occasional palpitations for the past week"), the system calls the BERT model of S12 in real time to convert it into a 768-dimensional vector, and then inputs this vector into the trained XGBoost classifier. The XGBoost model outputs the prediction results in real time (e.g., {"Cardiology": 96.5%, "Respiratory Medicine": 2.1%, ...}), and the system recommends "Cardiology" to the patient with the highest probability.
[0120] Model Iteration and Update: To ensure the timeliness of the model, processes S11 to S15 of this application are deployed as automated scripts, scheduled to run once per quarter. This script automatically retrieves newly added unlabeled chief complaint texts from the previous quarter, merges them with historical data, and re-executes the entire offline training process to fully update the XGBoost model, ensuring that the model can dynamically adapt to the latest disease patterns.
[0121] Comparative test example:
[0122] To verify the beneficial effects of this application, the following comparative experiment was designed. First, 10,000 new pre-consultation texts were prepared (not included in the 1 million data points in S11), and these 10,000 texts were manually triaged by three physicians at the associate chief physician level or above to determine the "gold standard" department label, which served as the test set. The evaluation metric was Top-1 accuracy (i.e., the proportion of the first department recommended by the model that matches the "gold standard"). Control group 1 (rule-based method) constructed a medical triage rule base containing 500 keywords. Control group 2 (standard supervised learning method), due to the high cost of manually labeling 1 million data points, instead used only a portion of the 10,000 labeled test set data points (e.g., an additional 10,000 manually labeled data points) to fine-tune a BERT-wwm-ext classification model. This application uses the XGBoost model trained through the S11 to S15 process (using 1 million unlabeled data points) in Example 1.
[0123] The experimental results (data examples) are shown in Table 1.
[0124] Table 1. Test Results
[0125]
[0126] Experimental conclusion:
[0127] Experimental results show that the accuracy of this application (95.5%) is significantly higher than that of control group 1 (rule-based method, 61.3%), demonstrating that semantic understanding based on deep learning and pattern recognition is far superior to keyword matching. Simultaneously, the accuracy of this application (95.5%) is also significantly higher than that of control group 2 (standard supervised learning, 88.2%), proving that the proposed "unsupervised clustering + automatic mapping" scheme can more effectively utilize massive amounts of unlabeled data (1 million records), far exceeding the performance of standard supervised learning methods that rely on only a small amount (10,000 records) of expensive manually labeled data. In summary, this application achieves the highest accuracy with almost zero manual annotation cost (only requiring the construction of a knowledge base once), validating its significant beneficial effects and practical application value.
[0128] Example 2:
[0129] This embodiment provides an intelligent triage system based on pre-diagnosis text clustering and pattern recognition, including: a memory and a processor;
[0130] The memory is used to store computer programs;
[0131] The processor is configured to invoke the computer program to execute the method as described in Embodiment 1.
[0132] Example 3:
[0133] This embodiment provides a computer-readable storage medium storing a computer program. When the computer program is run on an electronic device, it causes the electronic device to perform the method described in Embodiment 1.
[0134] Example 4:
[0135] This embodiment provides a computer program product, including a computer program that, when run on an electronic device, causes the electronic device to perform the method described in Embodiment 1.
[0136] The specific implementation of the system, electronic device, computer-readable storage medium, and computer program product provided in this application can be referred to the specific embodiments of the above methods, and will not be repeated here.
[0137] Obviously, those skilled in the art should understand that the various units or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device, or fabricating them separately as individual integrated circuit modules, or fabricating multiple modules or steps into a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.
[0138] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. An intelligent triage method based on pre-diagnosis text clustering and pattern recognition, characterized in that, The process includes an offline training phase and a real-time triage phase. The specific steps are as follows: S1. Offline training phase: S11. Pre-diagnosis text data acquisition and preprocessing: Acquire massive amounts of historical patient pre-diagnosis texts, perform data cleaning, and expand the vocabulary of the pre-trained language model; S12. Text feature vectorization: Use the pre-trained language model to extract features from each pre-diagnosis text after data cleaning, output the global semantic representation vector corresponding to each text, and form a feature matrix; S13. Unsupervised text clustering: Using the feature matrix as input, an unsupervised clustering algorithm is used to aggregate semantically similar global semantic representation vectors, and the clustering result is output. S14. Cluster-department mapping and pseudo-label generation: A structured "department-symptom" medical knowledge base is pre-constructed; for each cluster in the classification result, feature keywords are extracted, and the matching degree between the feature keywords and the symptom sets of each department in the medical knowledge base is calculated. The department with the highest matching degree is used as the mapping label for that cluster, and the mapping label is assigned to all global semantic representation vectors within that cluster, generating a pseudo-label dataset. S15. Intelligent triage model construction: Using the pseudo-label dataset as training data, a pattern recognition-based intelligent triage model is trained; Real-time triage stage: S21, Real-time preprocessing: Cleaning the chief complaint text input by new patients; S22, Real-time text feature vectorization: Using the same pre-trained language model as the offline training stage, the pre-processed chief complaint text is converted into the corresponding global semantic representation vector; S23, Real-time triage prediction: The global semantic representation vector obtained in S22 is input into the intelligent triage model constructed in the offline training stage, and the predicted probability of each department is output, recommending the department with the highest probability.
2. The intelligent triage method according to claim 1, characterized in that, In S11, expanding the vocabulary of the pre-trained language model includes: constructing a semantic association graph and calculating term association weights; embedding a medical professional dictionary, a medical term synonym network, and term association weights into the word vector space of the pre-trained language model, so that the global semantic representation vector generated by the subsequent pre-trained language model simultaneously integrates text semantic features and medical term association features, wherein the medical term association features include symptom-complication association features and cross-department symptom association features.
3. The intelligent triage method according to claim 1, characterized in that, In S13, the unsupervised clustering algorithm is an agglomerative hierarchical clustering algorithm. It uses cosine distance as the distance metric between vectors and employs the Ward linking method to perform iterative merging of clusters. The clustering result is a tree diagram that displays the hierarchical merging relationship of global semantic representation vectors.
4. The intelligent triage method according to claim 1, characterized in that, In S14, the feature keywords are extracted by calculating the TF-IDF value of the pre-diagnosis text corresponding to the global semantic representation vector within the cluster, and the T words with the highest scores are selected as feature keywords, where T is a positive integer and is taken as an empirical value; the matching degree is calculated by the Jaccard similarity algorithm.
5. The intelligent triage method according to claim 4, characterized in that, The matching degree adopts a two-stage similarity matching mechanism: the first stage calculates the Jaccard similarity between the feature keywords and the symptom sets of each department in the medical knowledge base, and selects the top M candidate departments; the second stage calculates the final matching degree through a weighted model, which is: matching degree = Jaccard similarity × α + disease incidence probability × β + complication association risk × γ, where M is a preset number, and α, β and γ are the weights of Jaccard similarity, disease incidence probability and complication association risk, respectively.
6. The intelligent triage method according to claim 1, characterized in that, The intelligent triage model is an XGBoost classifier that integrates dual attention weights. The dual attention weights include text semantic attention weights and department-related attention weights. The text semantic attention weights are determined by calculating the TF-IDF value of the pre-consultation text corresponding to the global semantic representation vector of symptom terms within the cluster. The department-related attention weights are set based on the department triage priority. Using the pseudo-label dataset as training data, a pattern recognition-based intelligent triage model is trained, including: element-wise multiplication of the global semantic representation vector generated by the pre-trained language model with the dual attention weights to obtain fused attention features; We constructed a training dataset for the XGBoost classifier using fused attention features as input features and department pseudo-labels as labels.
7. The intelligent triage method according to claim 1, characterized in that, The offline training phase also includes: S16, model iteration and update, including: during periodic iteration, newly added unlabeled text is input into the historical cluster centers, the cosine distance between the global semantic representation vector and the center of each cluster is calculated, if the distance is less than a preset distance threshold, it is directly assigned to the corresponding cluster and the extracted feature keywords of the cluster are updated, if the distance is greater than the preset threshold, full re-clustering is performed; when the intelligent triage model is updated, only the feature matrix corresponding to the newly added pseudo-label data is loaded, the decision tree node parameters of the intelligent triage model are fine-tuned, and the parameters with weights higher than the preset weight threshold in the historical intelligent triage model are retained.
8. An intelligent triage system based on pre-diagnosis text clustering and pattern recognition, characterized in that, include: Memory and processor; The memory is used to store computer programs; The processor is configured to invoke the computer program to perform the method as described in any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed on an electronic device, causes the electronic device to perform the method as described in any one of claims 1 to 7.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is run on an electronic device, it causes the electronic device to perform the method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Sensor data association method, device and equipment and storage medium
CN112465065A
Patient integrated triage system and method based on medical interconnection platform
CN117594206A