Symptom sign and syndrome semantic alignment method and system
By combining a symptom and sign extraction classification model with a sentence vector model, and utilizing cosine similarity matching and a vector index database, the semantic alignment problem from symptoms and signs to standard syndromes is solved. This achieves efficient and reliable mapping from symptoms and signs to syndromes, reduces the cost of manual annotation and rule maintenance, and meets the needs of complex linguistic phenomena and large-scale applications.
Patent Information
- Application Number
- CN202511427737.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-30
- Publication Date
- 2026-02-17
AI Technical Summary
Existing technologies are inefficient and costly in accurately linking physicians’ freely written descriptions of symptoms and signs to standard syndromes. They also struggle to cover complex linguistic phenomena such as synonyms, inversions, and omissions, resulting in high maintenance and update costs. Furthermore, supervised learning methods are heavily reliant on gold standard data, making it difficult to obtain sufficient high-quality labeled data in specific TCM fields, thus becoming a bottleneck for implementation.
A symptom and sign extraction classification model is used to generate coarse-grained categories. Sentence vector model is combined to encode syndrome names and definitions. Cosine similarity matching is used, and retrieval is performed in a vector index database. Negation recognition and condition range recognition are introduced to reduce the dependence on manual annotation. The approximate nearest neighbor retrieval structure supports rapid expansion and iteration.
It significantly improves the semantic alignment capability from symptoms and signs to standard syndromes, reduces the risk of mismatch, reduces the workload of manual annotation and rule maintenance, improves the stability and reliability of results, and facilitates large-scale application and rapid iteration.
Smart Images

Figure CN121542866A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent medical technology, and in particular to a method and system for semantic alignment of symptoms, signs and syndromes. Background Technology
[0002] Traditional Chinese medicine (TCM) emphasizes syndrome differentiation and treatment, with syndrome elements as the core. The theory of syndrome element differentiation breaks down complex syndromes into repeatable and verifiable syndrome elements. Syndromes serve as the crucial bridge connecting the original clinical manifestations with the final syndrome element diagnosis, and each syndrome is given a standardized name and connotation. Facing real medical records, how to accurately correlate physicians' freely written descriptions of symptoms and signs with standard syndromes is a fundamental issue for the objectification and standardization of syndrome element differentiation.
[0003] There are three main implementation paths. The first is manual mapping, where personnel with domain knowledge read through medical records one by one according to predetermined rules, matching symptom and sign fragments with a list of standard syndromes and entering the data into a database. The second is automatic matching based on keywords and rules, first constructing a syndrome terminology and logical rules, then retrieving keywords from the text through string matching and determining the corresponding syndrome according to the rules. The third is a classification or sequence labeling model based on supervised learning, relying on large-scale, high-quality paired datasets to learn the mapping rules from text to syndrome labels.
[0004] The aforementioned approaches share common shortcomings in large-scale applications. Manual mapping is inefficient and costly, and differing interpretations among annotators can easily lead to inconsistent labeling of the same text, hindering scalability. Keyword and rule-based methods lack semantic understanding, failing to cover complex linguistic phenomena such as synonyms, inversions, and ellipsis, and incurring high maintenance and update costs. Supervised learning methods heavily rely on gold-standard data, often struggling to obtain sufficient high-quality annotated corpora in specific TCM fields, becoming a bottleneck for implementation.
[0005] In summary, when dealing with large-scale clinical texts, there is an urgent need to improve the semantic alignment between symptoms and signs and standard syndromes, while ensuring consistency and efficiency. This would reduce reliance on manual annotation, lower the risk of mismatches and omissions, and adapt to the long-tail expressions and semantic ambiguities encountered in actual practice. This need is particularly prominent in the process of accurately associating free text with standard syndromes. Summary of the Invention
[0006] To overcome the shortcomings of existing technologies, the technical problem to be solved by this invention is to propose a method and system for aligning symptom signs with syndrome semantics, employing the following technical solution: A method for semantic alignment of symptoms and signs with syndromes includes the following steps: S1: Based on the benchmark annotation model, generate pre-annotated corpus containing symptom and sign fragments and coarse-grained categories from unannotated medical record texts. Perform consistency and format verification on the above pre-annotated corpus and use it to train the symptom and sign extraction and classification model to obtain the deployment extraction model. S2: Encode the syndrome name and syndrome definition using the sentence vector model, and establish a syndrome vector knowledge base and vector index database; S3: Receive the original medical record text, call the above-deployed extraction model to extract symptom and sign fragments, and output the corresponding coarse-grained categories; encode the above symptom and sign fragments into query vectors, calculate the similarity within the set of candidate syndromes corresponding to the above coarse-grained categories, and output the target syndrome with the highest similarity as the mapping result.
[0007] As a further improvement, the similarity in step S3 is cosine similarity, determined by the following formula: ; The aforementioned target syndrome is determined by the following definition: ; Where q is the query vector mentioned above, e h Let the above candidate symptoms be represented by vectors. This is the set of candidate syndromes corresponding to the coarse-grained category c output by the above-described extraction model.
[0008] As a further improvement, in step S3, the above-mentioned symptom and sign segments are first subjected to negation identification and condition range identification. After eliminating segments that are negated or related to conditions not being met, similarity matching is then performed.
[0009] As a further improvement, in step S3, the aforementioned vector index database adopts an approximate nearest neighbor retrieval structure, which supports subset retrieval within the set of candidate symptoms corresponding to the aforementioned coarse-grained categories, and manual verification is performed when the maximum similarity is lower than the threshold θ.
[0010] As a further improvement, in step S2, the above-mentioned syndrome vector is a weighted composite of the syndrome name vector and the syndrome definition vector: ; Where 0 ≤ γ ≤ 1.
[0011] As a further improvement, in step S2, the above sentence vector model performs text normalization processing, including at least one of the following: merging medical synonyms, unifying simplified and traditional Chinese characters, and normalizing irrelevant punctuation and whitespace, in order to improve the consistency of vector representation.
[0012] As a further improvement, in step S1, the above symptom and sign extraction classification model adopts a parallel structure of encoder, conditional random field sequence labeling head, and category discriminant head, and its training loss is: ; in The negative log-likelihood for sequence labeling. α is the cross-entropy loss for coarse-grained categories, and α is a hyperparameter.
[0013] As a further improvement, in step S1, at least one of the following quality controls is performed on the pre-annotated corpus: format integrity check, category consistency check, fragment deduplication and out-of-bounds truncation, and the above symptom and sign extraction classification model is trained only with the data that passes the checks.
[0014] Another aspect of the present invention provides a symptom and sign semantic alignment system for syndromes, applied to the symptom and sign semantic alignment method proposed in any of the above claims, comprising: Input interfaces, output interfaces, memory, and processor; The extraction model is deployed on the processor mentioned above to extract symptom and sign fragments from the original medical record text and output the corresponding coarse-grained categories. The sentence vector model, deployed on the aforementioned processor, is used to encode the aforementioned fragments into query vectors; The syndrome vector knowledge base and vector index database are stored in the aforementioned memory; The syndrome semantic matching module, deployed on the processor, is used to retrieve and output the target syndrome based on similarity within the set of candidate syndromes corresponding to the coarse-grained categories.
[0015] Further improvements also include The labeled data generation subsystem includes a benchmark labeling model, a quality control unit, and a training unit, and is configured to: pre-label unlabeled medical record text using the benchmark labeling model, and after verification by the quality control unit, train the symptom and sign extraction classification model to generate a set of deployment extraction model parameters for online application.
[0016] Compared with the prior art, the beneficial effects of the present invention are: Firstly, this invention uses a symptom and sign extraction classification model to first provide coarse-grained categories, and then performs vector retrieval within the set of candidate syndromes in these coarse-grained categories. The query vector is encoded by a sentence vector model, and the syndrome vector is synthesized by weighting the syndrome name vector and the syndrome definition vector, and cosine similarity matching is used. This narrows the retrieval space from the entire database to a semantically relevant subset, significantly reducing mismatches caused by synonyms and name ambiguities, thus improving the hit rate of the target syndrome and the stability of the results.
[0017] Secondly, this invention uses a benchmark annotation model to generate pre-annotated corpora in batches, which are then validated for consistency and format for training a symptom and sign extraction classification model. Online judgment only requires one extraction combined with one approximate nearest neighbor search in the vector index database to complete the mapping. Additions, deletions, and modifications to the syndrome vector knowledge base only require updating the vectors to take effect. This reduces the workload of manual annotation and rule maintenance, lowers latency and computational consumption, and facilitates smooth expansion and rapid iteration in large-scale syndrome databases and multi-institutional scenarios.
[0018] Third, this invention introduces negation identification and condition range identification before retrieval, combined with text normalization processes such as medical synonym merging, simplified / traditional character unification, and symbol regularization. When the maximum similarity is below a threshold, an uncertain result is output for manual review. This pre-filters invalid or misleading segments, stabilizes vector representation, establishes controllable safety boundaries and a traceable decision-making loop, reduces the risk of misjudgment, and improves the reliability and robustness of clinical applications. Attached Figure Description
[0019] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained from these drawings without creative effort.
[0020] Figure 1 This is a schematic diagram of the system framework of the present invention; Figure 2 This is a flowchart of the steps of the method of the present invention. Detailed Implementation
[0021] To facilitate understanding by those skilled in the art, the structure of the present invention will now be described in further detail with reference to the accompanying drawings: like Figure 2 As shown, this invention provides a method for semantic alignment of symptoms and signs with syndromes, comprising the following steps: Step S1: Based on the benchmark annotation model, generate pre-annotated corpus containing symptom and sign fragments and coarse-grained categories from the unannotated medical record text. Perform consistency and format verification on the pre-annotated corpus and use it to train the symptom and sign extraction and classification model to obtain the deployment extraction model.
[0022] like Figure 1 and Figure 2As shown, this step is used to build a trainable dataset with low manual costs. The benchmark annotation model targets free medical record text, outputting the start and end positions of segments and coarse-grained category labels. The pre-annotated corpus is validated according to rules and procedures to form a training sample set, which is then divided into training, validation, and test sets. In one specific embodiment, the medical record text is first standardized in character encoding and line / segment format, then segmented into sentences and fed into the benchmark annotation model to generate candidate labels. The label set and boundary validity are then validated using templates and field constraints, eliminating samples with overlapping boundaries, cross-sentence boundaries, and empty labels. Samples with multiple conflicting labels are entered into a manual sampling pool, and only those that pass the sampling are added to the database. During the training phase, an incremental batch approach is adopted, incorporating the latest pre-annotated samples into the training set while retaining a certain proportion of older samples to ensure stable distribution.
[0023] Furthermore, in step S1, the symptom and sign extraction classification model adopts a parallel structure of encoder, conditional random field sequence labeling head, and category discriminant head, and its training loss is: ; in The negative log-likelihood for sequence labeling. α is the cross-entropy loss for coarse-grained categories, and α is a hyperparameter.
[0024] In this embodiment, the encoder preferably uses a pre-trained Chinese language model, taking word-segmented or character-granular sequences as input and outputting contextual semantic representations. The sequence labeling head predicts segment boundaries according to the BIO tagging system, and the category discrimination head outputs coarse-grained categories at the document or sentence level. During training, both losses are minimized simultaneously, with α determined through a validation set grid search. In one specific embodiment, the maximum sequence length is between 256 and 512, the batch size is between 16 and 64, and the learning rate employs a warm-up plus segmented decay strategy. To alleviate class imbalance, minority classes are weighted by loss or oversampled. Early stopping conditions are triggered based on a weighted index of validation set F1 and overall accuracy.
[0025] like Figure 1 and Figure 2 As shown, in step S1, at least one of the following quality controls is performed on the pre-annotated corpus: format integrity check, category consistency check, fragment deduplication and out-of-bounds truncation processing, and the symptom and sign extraction classification model is trained only with the data that passes the checks.
[0026] In this embodiment, format integrity verification ensures that each sample contains the three elements of text, boundary, and category; category consistency verification checks the consistency of category outputs for multiple identical segments within the same document, and inconsistent samples are placed in a queue for review; segment deduplication removes duplicate segments caused by sentence segmentation or multiple rounds of parsing; and out-of-bounds truncation trims abnormal spans across sentences or paragraphs to a legal range. In one specific embodiment, length thresholds and character set thresholds can also be added to exclude pseudo-segments that are too short or contain only symbols, and a verification log is recorded for backtracking.
[0027] like Figure 1 and Figure 2 As shown, in step S2, the syndrome name and syndrome definition are encoded using the sentence vector model, and a syndrome vector knowledge base and a vector index database are established.
[0028] This step constructs a retrieval-oriented semantic space for syndromes. Syndrome names and definitions are encoded separately to form two vector sets. Simultaneously, a mapping table is established to maintain the correspondence between syndrome identifiers, name texts, definition texts, and their respective coarse-grained categories. In one specific embodiment, the sentence vector model output dimension ranges from 256 to 1024, employing batch offline encoding and persistent storage. The vector index database is fragmented according to coarse-grained categories, supporting incremental insertion and online reconstruction, facilitating rapid updates to the knowledge base.
[0029] In step S2, the syndrome vector is a weighted composite of the syndrome name vector and the syndrome definition vector: ; Where 0 ≤ γ ≤ 1.
[0030] Specifically, weighted synthesis is used to balance the contributions of short names and long definitions in semantic representation. In one specific embodiment, γ is tuned using a small sample validation set, typically ranging from 0.3 to 0.7; when a syndrome lacks a definition text, it degenerates into using only the name vector; when a name has multiple aliases, alias merging is performed before encoding; after synthesis, the resulting vector is normalized to stabilize subsequent similarity calculations.
[0031] In step S2, the sentence vector model normalizes the text, including at least one of the following: merging medical synonyms, unifying simplified and traditional Chinese characters, and normalizing irrelevant punctuation and whitespace, in order to improve the consistency of vector representation.
[0032] In this embodiment, normalization is performed before encoding. Synonym merging is based on a medical thesaurus to establish a mapping, unifying common colloquialisms and professional names to standard word forms. Simplified and traditional Chinese characters are unified by converting different character forms into a consistent encoding. Punctuation and whitespace are standardized by removing irrelevant symbols, merging redundant whitespace, and retaining key marker words. In one specific embodiment, numerical standardization and unit unification can also be performed to ensure that expressions related to measurement are comparable in the vector space.
[0033] Step S3: Receive the original medical record text, call the deployment extraction model to extract symptom and sign fragments, and output the corresponding coarse-grained categories; encode the symptom and sign fragments into query vectors, calculate the similarity within the set of candidate syndromes corresponding to the coarse-grained categories, and output the target syndrome with the highest similarity as the mapping result.
[0034] During online inference, text cleaning and sentence segmentation are first completed, and then the text is fed into the deployment extraction model to obtain fragments and coarse-grained categories. The fragments, along with the necessary context windows, are input into the sentence vector model and encoded into query vectors. Based on the coarse-grained categories, a retrieval is performed within the corresponding set of candidate syndromes, and the ranking results are returned. The syndrome ranked first is taken as the target output, and the relevant scores, candidate lists, and intermediate vectors are recorded in the log for easy auditing and playback. Preferably, the system supports outputting the top K candidate syndromes and their similarities for further decision-making by upstream business based on thresholds and rules; the default output is the target syndrome ranked first.
[0035] In one specific embodiment, parallel encoding of multiple segments and batch retrieval are supported to improve throughput.
[0036] The similarity in step S3 is the cosine similarity, which is determined by the following formula: ; The target syndrome is determined by the following definition: ; Where q is the query vector, e h The vector representation of candidate symptoms. This is the set of candidate syndromes corresponding to the coarse-grained category c output by the deployment extraction model.
[0037] In this embodiment, cosine similarity is used to measure the similarity of the angle between the query vector and the syndrome vector, with a value ranging from -1 to 1. A single target syndrome is obtained by calculating the maximum similarity within the set of candidate syndromes corresponding to the coarse-grained category. Preferably, when candidates with the same similarity exist, they can be secondary sorted according to the prior frequency of the syndrome or the sample confidence level. When the maximum similarity is lower than an empirical threshold, a fallback strategy is triggered, entering a process of manual review or expanding the search scope.
[0038] In step S3, the symptom and sign segments are first subjected to negation identification and condition range identification. After eliminating segments that are negated or related to conditions not being met, similarity matching is then performed.
[0039] In this embodiment, negation recognition targets negation trigger words such as "none," "deny," and "not seen," and determines the scope of negation by combining distance and syntactic clues; conditional range recognition targets conditional phrases such as "after activity," "at night," and "when cold," marking fragments that do not meet the conditions as invalid. Preferably, negation recognition is performed first, followed by conditional range recognition; uncertain samples are retained with low weight or directly eliminated, controlled by a threshold strategy.
[0040] In step S3, the vector index database adopts an approximate nearest neighbor retrieval structure, which supports subset retrieval within the set of candidate symptoms corresponding to coarse-grained categories, and manual verification is performed when the maximum similarity is lower than the threshold θ.
[0041] Preferably, when the maximum similarity is less than the first threshold θ1, the search is expanded to the set of the top K candidate symptoms in the coarse-grained category scores and the search is repeated; if the maximum similarity after the expanded search is still less than the second threshold θ2, an uncertain result is output and the manual review process is initiated; θ1, θ2 and K are determined based on the validation set parameter tuning.
[0042] Preferably, the near nearest neighbor structure can employ an inverted multi-index or hierarchical graph structure, supporting sharding and subset retrieval by coarse-grained categories, balancing retrieval speed and accuracy. The threshold θ is determined based on validation set parameter tuning and can be configured separately for departments or data sources. In one specific embodiment, the system automatically imports samples below the threshold into a manual workbench, and after review, the results are backfilled to update the syndrome vector knowledge base and training data, achieving closed-loop optimization.
[0043] like Figure 1 As shown, another aspect of the present invention provides a symptom and sign semantic alignment system for syndromes, applicable to any of the symptom and sign semantic alignment methods proposed above, including an input interface, an output interface, a memory, and a processor. It also includes a deployment extraction model, a sentence vector model, a syndrome vector knowledge base and a vector index database, and a syndrome semantic matching module.
[0044] Specifically, the extraction model is deployed on the processor to extract symptom and sign fragments from the original medical record text and output the corresponding coarse-grained categories; the sentence vector model is deployed on the processor to encode the fragments into query vectors; the syndrome vector knowledge base and vector index database are stored in the memory; and the syndrome semantic matching module is deployed on the processor to retrieve and output the target syndrome based on similarity within the set of candidate syndromes corresponding to the coarse-grained categories.
[0045] In this embodiment, the system uses a processor as its core to coordinate the collaborative work of various modules: the input interface receives medical record text and performs basic cleaning; the deployment extraction model outputs fragments and coarse-grained categories; the sentence vector model completes query vector encoding; the syndrome semantic matching module retrieves and returns the target syndrome from the vector index database; and the final result is output through the result interface and can be written to the database. Preferably, the processor uses a general-purpose server or cloud computing resources, and the memory is configured according to the vector scale, supporting cold and hot tiered storage; the system provides log and monitoring components to record key intermediate quantities to support traceability and auditing.
[0046] It also includes a labeled data generation subsystem, which includes a benchmark labeling model, a quality control unit, and a training unit. The subsystem is configured to: use the benchmark labeling model to pre-label unlabeled medical record texts, and after verification by the quality control unit, train a symptom and sign extraction classification model to generate a set of deployment extraction model parameters for online application.
[0047] The labeled data generation subsystem is responsible for offline production and updates. The baseline labeling model periodically captures new medical records to generate pre-labels in batches. The quality control unit performs format and consistency checks and outputs qualified samples. The training unit then fine-tunes the extraction classification model and exports the latest parameter set. The deployment process adopts a canary release strategy, first verifying in a low-traffic environment before switching to a full deployment to ensure online stability. As a preferred feature, the subsystem provides version management and rollback mechanisms, establishing a correlation between each updated sample set, model parameters, and evaluation results to facilitate continuous optimization and compliance auditing.
[0048] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the invention by those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the invention should be included within the scope of protection of the invention.
Claims
1. A symptom sign and syndrome semantic alignment method, characterized in that, The method comprises the following steps: S1: based on a benchmark annotation model, generating pre-annotated corpus containing symptom and sign fragments and coarse-grained categories from unannotated medical record texts, performing consistency and format verification on the pre-annotated corpus, and using the pre-annotated corpus to train a symptom and sign extraction and classification model to obtain a deployed extraction model; S2: using a sentence vector model to encode the names and definitions of syndromes respectively, and establishing a syndrome vector knowledge base and a vector index database; S3: receiving an original medical record text, calling the deployed extraction model to extract symptom and sign fragments, and outputting the corresponding coarse-grained categories; encoding the symptom and sign fragments into query vectors, calculating the similarity in the set of candidate syndromes corresponding to the coarse-grained categories, and outputting the target syndrome with the highest similarity as the mapping result.
2. The method of claim 1, wherein the symptom and sign and syndrome semantic alignment is performed by a computer system. The similarity in step S3 is a cosine similarity, which is determined by the following relationship: ; The target syndrome is determined by the following definition: ; wherein q is the query vector, e h is the vector representation of the candidate syndrome, is the set of candidate syndromes corresponding to the deployment extraction model output coarse-grained category c.
3. The method of claim 2, wherein the symptom and sign and syndrome semantic alignment is performed by: In step S3, the symptom and sign fragments are first subjected to negative recognition and conditional range recognition, and then the fragments that are negated or related to conditions that are not met are removed before similarity matching.
4. The method of claim 2, wherein the symptom and sign and syndrome semantic alignment is performed by a computer program. In step S3, the vector index database adopts an approximate nearest neighbor search structure, supports subset retrieval in the set of candidate syndromes corresponding to the coarse-grained categories, and when the maximum similarity is lower than a threshold θ, manual intervention is required for review.
5. The method of claim 1, wherein the symptom and sign and syndrome semantic alignment is performed by a computer system. In step S2, the syndrome vector is a weighted combination of the syndrome name vector and the syndrome definition vector: ; 0≤γ≤1.
6. The method of claim 5, wherein the symptom and sign and syndrome semantic alignment is performed by a computer program. In step S2, the sentence vector model performs normalization processing on the text, including at least one of medical synonym merging, simplified and traditional Chinese unification, irrelevant punctuation and blank regularity, to improve the consistency of the vector representation.
7. The method of claim 1, wherein the symptom and sign and syndrome semantic alignment is performed by a computer system. In step S1, the symptom and sign extraction and classification model adopts a parallel structure of an encoder and a conditional random field sequence labeling head and a category discrimination head, and the training loss is: ; where is the negative log-likelihood for sequence labeling, is the cross-entropy loss for coarse-grained classes, and a is a hyperparameter.
8. The method of claim 1, wherein the symptom, sign and syndrome semantic alignment is performed by a computer program. In step S1, at least one of the following quality controls is performed on the pre-annotated corpus: format integrity verification, category consistency verification, fragment deduplication and boundary truncation processing, and only the data that passes the verification is used to train the symptom and sign extraction and classification model.
9. A symptom and sign and syndrome semantic alignment system, applied to the symptom and sign and syndrome semantic alignment method of any one of claims 1-8, characterized in that, It comprises: an input interface, an output interface, a memory and a processor; a deployed extraction model deployed on the processor for extracting symptom and sign fragments from an original medical record text and outputting corresponding coarse-grained categories; a sentence vector model deployed on the processor for encoding the fragments into query vectors; a syndrome vector knowledge base and a vector index database stored in the memory; a syndrome semantic matching module deployed on the processor for searching and outputting a target syndrome based on similarity in the set of candidate syndromes corresponding to the coarse-grained categories.
10. The system for semantic alignment of symptoms, signs and syndrome according to claim 9, wherein, It further comprises an annotation data generation subsystem comprising a benchmark annotation model, a quality control unit and a training unit, and configured to pre-annotate unannotated medical record texts using the benchmark annotation model, and after verification by the quality control unit, train a symptom and sign extraction and classification model to generate a deployed extraction model parameter set for online application.