A method and device for constructing a cervical spondylosis knowledge graph
By constructing a knowledge graph of cervical spondylosis and verifying the features of a large language model using the statistical features of concept contribution, the hallucination problem in the existing system was solved, accurate diagnosis and treatment suggestions were generated, and the reliability and interpretability of the system were improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- WANGJING HOSPITAL OF CHINA ACAD OF CHINESE MEDICAL SCI
- Filing Date
- 2025-08-15
- Publication Date
- 2026-05-15
Smart Images

Figure CN121034513B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of knowledge graph technology, and in particular to a method and apparatus for constructing a knowledge graph for cervical spondylosis. Background Technology
[0002] Cervical spondylosis is a common and frequently occurring clinical disease that seriously affects patients' quality of life. Traditional Chinese medicine has accumulated rich experience in the diagnosis and treatment of cervical spondylosis, forming a unique theoretical system and treatment methods, with the clinical experience of renowned veteran TCM doctors being particularly valuable. In recent years, Large Language Modeling (LLM) has shown great potential in the medical field, assisting doctors in disease diagnosis and treatment plan recommendations. However, existing LLM-based diagnostic and treatment systems suffer from the "hallucination" problem, meaning that the model may generate inaccurate, factually inconsistent, or even harmful diagnostic and treatment suggestions, which is unacceptable in the medical field.
[0003] Based on this, the present invention proposes a method and apparatus for constructing a knowledge graph of cervical spondylosis to solve the above-mentioned technical problems. Summary of the Invention
[0004] This invention describes a method and apparatus for constructing a knowledge graph of cervical spondylosis, which can accurately construct a knowledge graph of cervical spondylosis.
[0005] According to a first aspect, the present invention provides a method for constructing a knowledge graph of cervical spondylosis, the method comprising:
[0006] Obtain the user's medical condition information; wherein, the medical condition information includes current symptom information and historical medical records;
[0007] The disease information is input into a preset cervical spondylosis knowledge graph module to obtain the statistical characteristics of concept contribution;
[0008] Based on the aforementioned medical information, the initial intermediate layer features of the large language model for cervical spondylosis are determined.
[0009] The initial intermediate layer features are validated based on the concept contribution statistical features to obtain validated intermediate layer features; wherein, the concept contribution statistical features are used to suppress the illusion of the cervical spondylosis large language model;
[0010] Based on the verified intermediate layer features, the construction result of the cervical spondylosis knowledge graph is determined.
[0011] According to a second aspect, the present invention provides an apparatus for constructing a knowledge graph of cervical spondylosis, comprising:
[0012] The acquisition unit is configured to acquire the user's medical condition information; wherein, the medical condition information includes current symptom information and historical medical records;
[0013] The first data processing unit is configured to input the disease information into a preset cervical spondylosis knowledge graph module to obtain the concept contribution statistical features;
[0014] The second data processing unit is configured to determine the initial intermediate layer features of the cervical spondylosis big language model based on the disease information.
[0015] The third data processing unit is configured to verify the initial intermediate layer features based on the concept contribution statistical features to obtain verified intermediate layer features; wherein, the concept contribution statistical features are used to suppress the illusion of the cervical spondylosis large language model;
[0016] The fourth data processing unit is configured to determine the construction result of the cervical spondylosis knowledge graph based on the verified intermediate layer features.
[0017] Thirdly, embodiments of this specification also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, it implements the method described in any embodiment of this specification.
[0018] Fourthly, embodiments of this specification also provide a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the methods described in any embodiment of this specification.
[0019] According to the method and apparatus for constructing a cervical spondylosis knowledge graph provided by the present invention, firstly, comprehensive information about the user's condition is acquired. This information covers multiple dimensions: it includes the user's current symptoms, such as the nature of neck pain, accompanying upper limb numbness or dizziness, as well as complete historical medical records, such as previous diagnoses, treatment plans, and efficacy feedback. Subsequently, the integrated condition information is input into a pre-defined cervical spondylosis knowledge graph module. This module pre-constructs a structured network covering core concepts such as cervical spondylosis classification, pathological mechanisms, symptom associations, and treatment guidelines. Through concept matching and weight calculation of the input information, it generates statistical features of concept contribution, quantifying the importance of each medical concept in the current condition description. Simultaneously, based on the aforementioned condition information, a deep semantic analysis is performed using a large language model for cervical spondylosis. Through contextual understanding and feature extraction of textual information, initial intermediate-layer features are generated, reflecting the potential semantic associations of the condition information. To improve feature accuracy, the initial intermediate-layer features are validated using statistical features of concept contribution: by comparing the consistency of the two in the expression of key concepts, possible semantic biases or noise interference in the initial features are corrected, ultimately obtaining validated intermediate-layer features. Using the validated intermediate layer features as the final reasoning basis of the large language model can effectively integrate the structured constraints of the knowledge graph with the semantic understanding ability of the language model, thereby accurately determining the relationship between each concept node in the cervical spondylosis knowledge graph and significantly improving the accuracy and clinical applicability of the knowledge graph construction. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 A flowchart illustrating a method for constructing a cervical spondylosis knowledge graph according to one embodiment is shown.
[0022] Figure 2 A schematic block diagram of an apparatus for constructing a knowledge graph of cervical spondylosis according to one embodiment is shown. Detailed Implementation
[0023] The solution provided by the present invention will now be described with reference to the accompanying drawings.
[0024] Figure 1 This diagram illustrates a flowchart of a method for constructing a cervical spondylosis knowledge graph according to one embodiment. It is understood that this method can be executed by any device, equipment, platform, or cluster of devices with computing and processing capabilities. Figure 1As shown, the method includes:
[0025] Step 100: Obtain the user's medical condition information; the medical condition information includes current symptom information and historical medical records;
[0026] Step 102: Input the patient's condition information into the preset cervical spondylosis knowledge graph module to obtain the statistical characteristics of concept contribution;
[0027] Step 104: Based on the patient's condition information, determine the initial intermediate layer features of the large language model for cervical spondylosis;
[0028] Step 106: Validate the initial intermediate layer features based on the concept contribution statistical features to obtain the validated intermediate layer features; among them, the concept contribution statistical features are used to suppress the illusion of the cervical spondylosis large language model;
[0029] Step 108: Based on the verified intermediate layer features, determine the construction result of the cervical spondylosis knowledge graph.
[0030] In this embodiment, firstly, comprehensive information about the user's condition is acquired, encompassing multiple dimensions: including current symptoms such as the nature of neck pain and accompanying reactions like upper limb numbness or dizziness, as well as complete historical medical records such as previous diagnoses, treatment plans, and efficacy feedback. Subsequently, the integrated condition information is input into a pre-built cervical spondylosis knowledge graph module. This module pre-constructs a structured network covering core concepts such as cervical spondylosis classification, pathological mechanisms, symptom associations, and treatment guidelines. Through concept matching and weight calculation of the input information, it generates statistical features of concept contribution, quantifying the importance of each medical concept in the current description of the condition. Simultaneously, based on the aforementioned condition information, a deep semantic analysis is performed using a large language model for cervical spondylosis. Through contextual understanding and feature extraction of textual information, initial intermediate-layer features are generated, reflecting the potential semantic associations of the condition information. To improve feature accuracy, the initial intermediate-layer features are validated using statistical features of concept contribution: by comparing the consistency of the two in the expression of key concepts, possible semantic biases or noise interference in the initial features are corrected, ultimately yielding validated intermediate-layer features. Using the validated intermediate layer features as the final reasoning basis of the large language model can effectively integrate the structured constraints of the knowledge graph with the semantic understanding ability of the language model, thereby accurately determining the relationship between each concept node in the cervical spondylosis knowledge graph and significantly improving the accuracy and clinical applicability of the knowledge graph construction.
[0031] In this embodiment, the present invention innovatively constructs a "dual-channel" hybrid reasoning engine to achieve deep integration of the semantic understanding capability of the Large Language Model (LLM) and the symbolic logic reasoning capability of the Cervical Spondylosis Knowledge Graph (KG). The core of this engine employs "graph attention-guided logical constraint decoding" technology to form a closed-loop collaborative reasoning mechanism. After the LLM generates preliminary diagnostic and treatment suggestions, it automatically extracts key entities (such as traditional Chinese medicine prescriptions, syndrome differentiation, and treatment methods) and relationships between entities (such as compatibility combinations and syndrome-treatment correspondence) from the suggestions, and accurately maps them to the corresponding nodes and edges in the Cervical Spondylosis Knowledge Graph. Subsequently, a Graph Attention Network (GNN) is used to conduct deep reasoning on the relevant subgraphs of the KG: by calculating the attention weights of nodes, the core diagnostic and treatment elements are focused, and the rationality of the LLM suggestions is comprehensively verified based on preset traditional Chinese medicine logic rules (including contraindications for traditional Chinese medicine compatibility such as "eighteen incompatibilities" and "nineteen incompatibilities," and the principle of consistency in syndrome differentiation, such as the need for warming and dispersing cold treatment for wind-cold-dampness syndrome). In the final decoding and generation stage, symbolic logic constraints are embedded as strong guiding signals into the generation process: by dynamically adjusting word vector weights, reasoning paths supported by Key-Ground (KG) facts and conforming to the logic of Traditional Chinese Medicine (TCM) diagnosis and treatment are prioritized. This mechanism fundamentally suppresses conflicting content at its source, rather than simply filtering out already generated erroneous information. Simultaneously, the engine can output visualized KG reasoning paths, clearly demonstrating the logical chain from symptoms to conclusions. This makes the entire diagnostic and treatment recommendation traceable and interpretable, significantly improving the reliability and clinical credibility of the reasoning results.
[0032] In one embodiment of the present invention, the initial intermediate layer features are verified based on the statistical characteristics of concept contribution to obtain the verified intermediate layer features, including:
[0033] Based on the statistical characteristics of concept contribution and the initial intermediate layer characteristics, the first verification intermediate layer characteristics and the second verification intermediate layer characteristics are determined sequentially.
[0034] The first and second verification intermediate layer features are fused to obtain the verified intermediate layer features.
[0035] In this embodiment, the first verification intermediate layer features are determined by combining the statistical features of concept contribution with the initial intermediate layer features: based on the concept contribution degree, the feature components associated with high-weight medical concepts in the initial features are strengthened and retained, while the noise features corresponding to low-contribution concepts are weakened to ensure the prominence of core information. Subsequently, the second verification intermediate layer features are generated through reverse verification logic: focusing on the parts of the initial features that deviate from the statistical features of concept contribution, corrections are made according to the concept association rules in the knowledge graph, and missing edge feature details are supplemented to improve the completeness of the features. Finally, a weighted fusion strategy is used to integrate the first and second verification intermediate layer features, retaining the core features dominated by key concepts while incorporating the corrected edge information, forming a post-verification intermediate layer feature that combines accuracy and completeness.
[0036] In one embodiment of the present invention, the second verification intermediate layer feature is determined by the following formula:
[0037]
[0038] In the formula, Z2 represents the features of the second verification intermediate layer, Y represents the features of the initial intermediate layer, X represents the statistical features of concept contribution, and θ represents the features of the second verification intermediate layer. * Here, θ represents the optimal parameters obtained after optimization, and f represents learnable parameters such as bias. θ (Y) is the characteristic transformation function. Let σ(g) be the gradient constraint term on the manifold, I be the identity matrix, and σ(g) be the gradient constraint term on the manifold. φ (Y) is the activation function. Let g be the projection matrix of the tangent space of the manifold. φ (Y) is an auxiliary function, and γ is a weight hyperparameter of the manifold constraint term. The transformation features are obtained using the optimal parameters.
[0039] In this embodiment, the computation of the second verification intermediate layer features integrates conceptual knowledge and data geometry. Its core logic is to optimize parameters so that the initial intermediate layer features, after transformation, closely approximate the statistical features of concept contribution while preserving the inherent manifold structure of the data. First, a feature transformation function is defined, consisting of learnable parameters such as weights and biases, and an activation function, used to perform a nonlinear transformation on the initial intermediate layer features. Then, a loss function is constructed, containing two key constraints: one is the Euclidean distance between the transformed features and the statistical features of concept contribution, ensuring the features converge towards the target concept; the other is a gradient constraint term on the manifold, which projects the gradient of the feature transformation onto the normal space of the manifold through the tangent space projection matrix and minimizes its norm, thereby forcing the transformation along the tangent space direction of the manifold and preserving the geometric structure of the data. An auxiliary function further introduces additional constraints, using an activation function to nonlinearly adjust the transformed features. Finally, the optimal parameters are obtained by minimizing the loss function, applied to the feature transformation function, and combined with the constraints of the auxiliary function to obtain the second verification intermediate layer features. These features encompass both conceptual knowledge and preserve the manifold structure of the data, improving the model's interpretability and generalization ability.
[0040] In one embodiment of the present invention, the first verification intermediate layer feature is determined by the following formula:
[0041] Z1 = Y - α · ▽D(X,Y)
[0042]
[0043] In the formula, Z1 is the first validation intermediate layer feature, Y is the initial intermediate layer feature, α is the learning rate, ▽D is the gradient vector of the Euclidean distance with respect to the initial intermediate layer feature, X is the concept contribution statistical feature, and n is the dimension of the feature vector.
[0044] In this embodiment, firstly, the feature differences are quantified: the Euclidean distance between the initial intermediate layer features and the statistical features contributing to the concept is calculated. The components of the two features in each dimension are subtracted sequentially, the squares of the differences are summed, and the square root of the sum is taken to measure the "distance" between them in space. Secondly, the adjustment direction is determined: the gradient of the above distance with respect to the initial intermediate layer features (i.e., the trend of distance change with the initial features) is calculated. If the distance is not 0, the "difference vector between the initial features and the concept features" is divided by the distance value, and the result is the gradient direction (this direction naturally points to the adjustment path of "making the initial features approximate the concept features"); if the distance is 0 (the two features have completely overlapped), the gradient is 0, and no adjustment is needed. Finally, feature fine-tuning is performed: with the "learning rate" (a hyperparameter controlling the adjustment magnitude) as the step size, the initial intermediate layer features are adjusted along the direction indicated by the gradient (by subtracting the "product of the learning rate and the gradient" from the initial features), and finally the first verification intermediate layer features with fused concept constraints are obtained. In short, this is an optimization process that uses the idea of gradient descent to gradually align initial features with conceptual features. It quantifies differences, clarifies the direction of adjustment, and controls the adjustment range through the learning rate, ultimately generating validation features that incorporate conceptual knowledge.
[0045] In one embodiment of the present invention, the cervical spondylosis knowledge graph module is constructed through the following steps:
[0046] Data sources for cervical spondylosis are obtained, including ancient Chinese medical texts, literature, case studies, empirical formulas, and external databases.
[0047] The data source for cervical spondylosis is preprocessed to obtain preprocessed data;
[0048] The preprocessed data is corrected to obtain knowledge triples;
[0049] A knowledge graph module for cervical spondylosis is constructed based on knowledge triples.
[0050] In this embodiment, the construction of the cervical spondylosis knowledge graph module adopts a systematic process to ensure the comprehensiveness and accuracy of the knowledge. First, a wide range of heterogeneous cervical spondylosis data sources are collected, covering discussions on arthralgia and neck and shoulder pain in ancient Chinese medical texts, clinical research literature in modern medical journals, structured case data from hospital information systems, experienced prescriptions and medication experiences from renowned traditional Chinese medicine practitioners, and standardized diagnosis and treatment guidelines from authoritative medical databases, forming a diversified knowledge reserve. Subsequently, the collected data sources are preprocessed: unstructured text (such as original texts from ancient books and case descriptions) undergoes word segmentation, entity recognition, and semantic annotation; structured data (such as test indicators and diagnostic codes) undergoes format standardization and field mapping; simultaneously, duplicate information is removed, data errors are corrected, and heterogeneous data is transformed into a standardized intermediate data format, laying the foundation for subsequent processing. After preprocessing, the process moves to the correction stage: Entity linking technology maps disparate medical terms to a unified conceptual system, constructing knowledge triples in the form of "entity-relationship-entity". The logical rationality of these triples is verified using domain expert experience, resolving knowledge conflicts between different data sources (such as differences in the diagnosis of similar symptoms), ultimately forming a high-quality set of knowledge triples. Based on these knowledge triples, graph database technology is used for storage and visualization modeling. Knowledge nodes related to cervical spondylosis, such as disease classification, symptom manifestations, diagnostic points, and treatment plans, are connected through semantic relationships to construct a hierarchical and clearly defined cervical spondylosis knowledge graph module, providing structured knowledge support for subsequent reasoning applications.
[0051] In one embodiment of the present invention, the data source of cervical spondylosis is preprocessed to obtain preprocessed data, including:
[0052] The data source for cervical spondylosis is cleaned to obtain a cleaned data source.
[0053] The cleaned data source is then standardized to obtain a standardized data source.
[0054] The standardized data source is subjected to optical character recognition to obtain the data source with completed optical character recognition;
[0055] The data source obtained from optical character recognition is subjected to feature extraction to obtain preprocessed data.
[0056] In this embodiment, the preprocessing of the cervical spondylosis data source adopts a multi-stage progressive process to ensure data quality and usability. The specific steps are as follows: First, data cleaning is performed. Through a combination of automated algorithms and manual verification, duplicate records are removed, data entry errors (such as typos and numerical deviations) are corrected, and missing values are appropriately filled (based on the distribution patterns of similar data or expert experience). At the same time, redundant information unrelated to the diagnosis and treatment of cervical spondylosis is filtered out, resulting in a cleaned data source, laying a pure foundation for subsequent processing. Next, standardization processing is carried out. For the cleaned data, referring to authoritative medical terminology systems (such as the classification and codes of traditional Chinese medicine diseases and syndromes, and the Western medicine guidelines for the diagnosis and treatment of cervical spondylosis), key information is standardized and mapped: symptom description terms are unified (such as standardizing "neck pain" and "neck soreness" to "neck pain"), data formats are standardized (such as the unification of dates and dosage units), and cross-data source field correspondences are established to form a standardized data source, ensuring data consistency and comparability. Subsequently, optical character recognition (OCR) processing was implemented. For unstructured image data such as scanned ancient texts and handwritten medical records contained in the data source, high-precision OCR technology was used for text extraction. Through image preprocessing (denoising and enhancement) and multi-model fusion recognition, the text information in the images was converted into editable text. The recognition results were then verified and corrected a second time, generating a data source with completed OCR, overcoming the limitations of paper or image carriers on data utilization. Finally, image feature extraction was performed. For cervical spine imaging data (such as X-rays and MRI images) in the data source, computer vision algorithms (such as edge detection and region segmentation) were used to extract key image features, including quantitative indicators such as vertebral morphology, intervertebral disc degeneration, and signs of nerve root compression. These feature data were then correlated and mapped with the text data, ultimately forming structured, multimodal preprocessed data, providing comprehensive data support for knowledge graph construction.
[0057] In one embodiment of the present invention, the correction process includes PEFT-based domain-specific LLM fine-tuning and multi-strategy hint engineering-driven knowledge building.
[0058] In this embodiment, the correction process improves knowledge quality through a dual technical approach, specifically including: domain-specific LLM fine-tuning based on PEFT (parameter efficient fine-tuning), which freezes the pre-training parameters of the general language model and fine-tunes only the adaptation layer. It also optimizes model weights using annotated data from the cervical spondylosis domain (such as diagnostic terminology and treatment logic) to accurately capture the professional expressions and association rules of TCM cervical and shoulder diseases, reducing the domain bias of the general model. Simultaneously, it employs a multi-strategy prompting engineering-driven knowledge construction process: it clarifies the knowledge triple generation specifications through instruction prompts, strengthens the entity-relationship matching paradigm through example guidance, and constrains the reasoning path with logical chain prompts, guiding the model to generate structured knowledge according to TCM logic such as "symptom-syndrome-treatment method." This dual-path collaborative approach corrects semantic ambiguities and knowledge conflicts in the pre-processed data, ensuring the domain adaptability and logical consistency of the output knowledge.
[0059] In this embodiment, to achieve accurate modeling of TCM cervical spondylosis knowledge, an innovative multi-layered technical architecture is adopted, covering three core aspects: multimodal fusion, refined extraction, and precise editing. The domain-adaptive multimodal representation pre-training and alignment mechanism breaks through the limitations of traditional single-modal processing, constructing a cross-modal comparison calibration network to achieve deep fusion of heterogeneous data. This network performs unified semantic space mapping for three types of core data: for textual data such as ancient records, clinical literature, and case reports, word segmentation and context encoding are performed using a BERT-like model; for semi-structured data such as prescriptions from renowned TCM doctors, structured fields such as drug composition, dosage ratio, and applicable syndromes are parsed and transformed into semantic vectors; for unstructured visual information such as tongue images and facial videos, low-level features such as texture and color are first extracted using a convolutional neural network, and then transformed into high-dimensional visual vectors through feature processing. To enhance adaptability to the TCM domain, a dedicated pre-training task was designed: TCM terminology masking prediction (randomly masking professional terms such as "qi stagnation and blood stasis" and "cervical spondylosis of the nerve root type" and requiring the model to restore them) deepens terminology understanding; syndrome-prescription association prediction (e.g., predicting "Qianghuo Shengshi Decoction" for "wind-cold-dampness arthralgia") strengthens the connection between diagnosis and treatment logic. Cross-modal comparative learning enables semantic-level precise alignment between text descriptions (e.g., "pale and swollen tongue with teeth marks") and corresponding visual feature vectors, laying the foundation for subsequent multi-source knowledge fusion. Addressing the complexity and precision requirements of TCM knowledge, a fine-grained knowledge extraction scheme combining "structured prompt injection" and "thought chain verification" is adopted. Unlike the direct extraction of general LLM, this scheme embeds the expected structural template of the target knowledge (e.g., the "syndrome-main symptom-treatment-prescription" quadruple framework) into the prompt words, while simultaneously injecting domain constraint rules (e.g., "warming and tonifying prescriptions are contraindicated for liver yang hyperactivity syndrome"). After generating preliminary knowledge triplets based on this, the LLM model, fine-tuned in the field of Traditional Chinese Medicine (TCM), initiates a "thinking chain verification" mechanism: This mechanism forces the model to output verification paths step by step, including citing original texts from ancient books such as the *Huangdi Neijing* as supporting evidence, checking compliance against a built-in TCM compatibility database (such as the "Eighteen Incompatibilities" rule), verifying the consistency of the "symptom-diagnosis-treatment" chain through logical deduction (e.g., confirming whether the diagnostic logic of "stiff neck and shoulders with aversion to cold" and "wind-cold syndrome" is valid), and conducting a self-assessment based on a score of 0-10 based on the verification results. This mechanism significantly reduces factual errors (such as mistakenly associating "phlegm-dampness obstruction syndrome" with "blood-activating and stasis-removing methods") and low-relevance associations (such as incorrectly binding irrelevant symptoms to diagnoses). For the precise injection and correction of core knowledge, an innovative gradient-based "concept-level knowledge editing" technology is adopted.For core theories recorded in authoritative ancient texts (such as the diagnostic criteria for specific syndromes in the *Shanghan Lun*) or top expert consensus (such as the key points for early diagnosis of rare "cervical spondylotic myelopathy"), the parameter clusters related to the concept within the LLM (such as the set of neurons responsible for representing "empty marrow sea syndrome") are located through "target concept decoupling editing." Without retraining the model or affecting other knowledge modules, the weights of relevant parameters are directly adjusted to embed new knowledge. For erroneous knowledge that needs correction (such as misjudging the contraindications of a certain prescription), gradient backpropagation is used to locate the parameter nodes corresponding to the erroneous associations and perform precise correction. This technology achieves efficient knowledge updates, ensuring the authority of the core knowledge in the atlas (such as ensuring that entries related to "meridian and tendon theory" are completely consistent with authoritative literature) while avoiding the waste of resources and fluctuations in capabilities caused by full retraining.
[0060] The foregoing has described specific embodiments of the invention. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired results. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0061] According to another embodiment, the present invention provides an apparatus for constructing a knowledge graph of cervical spondylosis. Figure 2 A schematic block diagram of an apparatus for constructing a cervical spondylosis knowledge graph according to one embodiment is shown. It will be understood that this apparatus can be implemented by any device, apparatus, platform, or cluster of devices with computing and processing capabilities. Figure 2 As shown, the device includes: an acquisition unit 200, a first data processing unit 202, a second data processing unit 204, a third data processing unit 206, and a fourth data processing unit 208. The main functions of each component are as follows:
[0062] The acquisition unit 200 is configured to acquire the user's medical condition information; wherein, the medical condition information includes current symptom information and historical medical records;
[0063] The first data processing unit 202 is configured to input the disease information into a preset cervical spondylosis knowledge graph module to obtain concept contribution statistical features;
[0064] The second data processing unit 204 is configured to determine the initial intermediate layer features of the cervical spondylosis big language model based on the disease information.
[0065] The third data processing unit 206 is configured to verify the initial intermediate layer features based on the concept contribution statistical features to obtain verified intermediate layer features; wherein, the concept contribution statistical features are used to suppress the illusion of the cervical spondylosis large language model;
[0066] The fourth data processing unit 208 is configured to determine the construction result of the cervical spondylosis knowledge graph based on the verified intermediate layer features.
[0067] In one embodiment of the present invention, the third data processing unit 206 is configured to perform the following operations:
[0068] Based on the concept contribution statistical characteristics and the initial intermediate layer characteristics, the first verification intermediate layer characteristics and the second verification intermediate layer characteristics are determined sequentially.
[0069] The first verification intermediate layer features and the second verification intermediate layer features are fused to obtain the post-verification intermediate layer features.
[0070] In one embodiment of the present invention, the second verification intermediate layer feature is determined by the following formula:
[0071]
[0072] In the formula, Z2 is the second verification intermediate layer feature, Y is the initial intermediate layer feature, X is the concept contribution statistical feature, and θ * Here, θ represents the optimal parameters obtained after optimization, and f represents learnable parameters such as bias. θ (Y) is the characteristic transformation function. Let σ(g) be the gradient constraint term on the manifold, I be the identity matrix, and σ(g) be the gradient constraint term on the manifold. φ (Y) is the activation function. Let g be the projection matrix of the tangent space of the manifold. φ (Y) is an auxiliary function, and γ is a weight hyperparameter of the manifold constraint term. The transformation features are obtained using the optimal parameters.
[0073] In one embodiment of the present invention, the first verification intermediate layer feature is determined by the following formula:
[0074] Z1 = Y - α · ▽D(X,Y)
[0075]
[0076] In the formula, Z1 is the first verification intermediate layer feature, Y is the initial intermediate layer feature, α is the learning rate, ▽D is the gradient vector of the Euclidean distance with respect to the initial intermediate layer feature, X is the concept contribution statistical feature, and n is the dimension of the feature vector.
[0077] In one embodiment of the present invention, the construction device further includes a unit for constructing a cervical spondylosis knowledge graph, the cervical spondylosis knowledge graph construction unit being configured to perform the following operations:
[0078] Data sources for cervical spondylosis are obtained; wherein, the data sources include ancient Chinese medical books, literature, case studies, empirical prescriptions, and external databases;
[0079] The data source of the cervical spondylosis was preprocessed to obtain preprocessed data;
[0080] The preprocessed data is then corrected to obtain knowledge triples.
[0081] Based on the knowledge triples, the cervical spondylosis knowledge graph module is constructed.
[0082] In one embodiment of the present invention, the cervical spondylosis knowledge graph construction module unit, when performing preprocessing of the cervical spondylosis data source to obtain preprocessed data, performs the following operations:
[0083] The data source for cervical spondylosis is cleaned to obtain a cleaned data source;
[0084] The cleaned data source is then standardized to obtain a standardized data source.
[0085] The standardized data source is subjected to optical character recognition to obtain a data source with completed optical character recognition.
[0086] The data source from which the optical character recognition has been completed is subjected to influence feature extraction to obtain the preprocessed data.
[0087] In one embodiment of the present invention, the correction process includes PEFT-based domain-specific LLM fine-tuning and multi-strategy hint engineering-driven knowledge building.
[0088] According to another embodiment, a computer-readable storage medium is also provided, on which a computer program is stored, which, when executed in a computer, causes the computer to perform a combination Figure 1 The method described.
[0089] According to another embodiment, an electronic device is also provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements a combination... Figure 1 The method described.
[0090] The various embodiments in this invention are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0091] Those skilled in the art will recognize that, in one or more of the examples above, the functions described in this invention can be implemented using hardware, software, firmware, or any combination thereof. When implemented in software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium.
[0092] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solution of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for constructing a knowledge graph of cervical spondylosis, characterized in that, The method includes: Obtain the user's medical condition information; wherein, the medical condition information includes current symptom information and historical medical records; The disease information is input into a preset cervical spondylosis knowledge graph module to obtain the statistical characteristics of concept contribution; Based on the aforementioned medical information, the initial intermediate layer features of the large language model for cervical spondylosis are determined. The initial intermediate layer features are validated based on the concept contribution statistical features to obtain validated intermediate layer features; wherein, the concept contribution statistical features are used to suppress the illusion of the cervical spondylosis large language model; Based on the verified intermediate layer features, the construction result of the cervical spondylosis knowledge graph is determined; The process of validating the initial intermediate layer features based on the concept contribution statistical features to obtain validated intermediate layer features includes: Based on the concept contribution statistical characteristics and the initial intermediate layer characteristics, the first verification intermediate layer characteristics and the second verification intermediate layer characteristics are determined sequentially. The first verification intermediate layer features and the second verification intermediate layer features are fused to obtain the post-verification intermediate layer features. The second verification intermediate layer features are determined by the following formula: In the formula, This is the second verification intermediate layer feature. The initial intermediate layer features. Contribute statistical characteristics to the concept. These are the optimal parameters obtained after optimization. For learnable bias parameters, For the characteristic transformation function, For gradient constraint terms on the manifold, It is the identity matrix. For activation function, Let be the projection matrix of the tangent space of the manifold. For auxiliary functions, The weight hyperparameters for the manifold constraint terms, The transformation characteristics obtained using the optimal parameters; The first verification intermediate layer features are determined by the following formula: In the formula, This refers to the features of the first verification intermediate layer. The initial intermediate layer features. For learning rate, Let be the gradient vector of the Euclidean distance with respect to the features of the initial intermediate layer. Contribute statistical characteristics to the concept. is the dimension of the feature vector.
2. The method according to claim 1, characterized in that, The cervical spondylosis knowledge graph module was constructed through the following steps: Data sources for cervical spondylosis are obtained; wherein, the data sources include ancient Chinese medical books, literature, case studies, empirical prescriptions, and external databases; The data source of the cervical spondylosis was preprocessed to obtain preprocessed data; The preprocessed data is then corrected to obtain knowledge triples. Based on the knowledge triples, the cervical spondylosis knowledge graph module is constructed.
3. The method according to claim 2, characterized in that, The process of preprocessing the data source of the cervical spondylosis to obtain preprocessed data includes: The data source for cervical spondylosis is cleaned to obtain a cleaned data source; The cleaned data source is then standardized to obtain a standardized data source. The standardized data source is subjected to optical character recognition to obtain a data source with completed optical character recognition. The data source from which the optical character recognition has been completed is subjected to influence feature extraction to obtain the preprocessed data.
4. The method according to claim 3, characterized in that, The correction process includes PEFT-based domain-specific LLM fine-tuning and multi-strategy hint engineering-driven knowledge building.
5. A device for constructing a knowledge graph of cervical spondylosis, characterized in that, include: The acquisition unit is configured to acquire the user's medical condition information; wherein, the medical condition information includes current symptom information and historical medical records; The first data processing unit is configured to input the disease information into a preset cervical spondylosis knowledge graph module to obtain the concept contribution statistical features; The second data processing unit is configured to determine the initial intermediate layer features of the cervical spondylosis big language model based on the disease information. The third data processing unit is configured to verify the initial intermediate layer features based on the concept contribution statistical features to obtain verified intermediate layer features; wherein, the concept contribution statistical features are used to suppress the illusion of the cervical spondylosis large language model; The fourth data processing unit is configured to determine the construction result of the cervical spondylosis knowledge graph based on the verified intermediate layer features; The third data processing unit is used to perform the following operations: Based on the concept contribution statistical characteristics and the initial intermediate layer characteristics, the first verification intermediate layer characteristics and the second verification intermediate layer characteristics are determined sequentially. The first verification intermediate layer features and the second verification intermediate layer features are fused to obtain the post-verification intermediate layer features. The second verification intermediate layer features are determined by the following formula: In the formula, This is the second verification intermediate layer feature. The initial intermediate layer features. Contribute statistical characteristics to the concept. These are the optimal parameters obtained after optimization. For learnable bias parameters, For the characteristic transformation function, For gradient constraint terms on the manifold, It is the identity matrix. For activation function, Let be the projection matrix of the tangent space of the manifold. For auxiliary functions, The weight hyperparameters for the manifold constraint terms, The transformation characteristics obtained using the optimal parameters; The first verification intermediate layer features are determined by the following formula: In the formula, This refers to the features of the first verification intermediate layer. The initial intermediate layer features. For learning rate, Let be the gradient vector of the Euclidean distance with respect to the features of the initial intermediate layer. Contribute statistical characteristics to the concept. is the dimension of the feature vector.
6. An electronic device, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method as described in any one of claims 1-4.
7. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed in a computer, causes the computer to perform the method described in any one of claims 1-4.