Method, system, and medium for association of implicit semantics and explicit terminology of traditional chinese medicine ancient books

By combining a large language model with a graph neural network, we solved the problem of the association between implicit semantics and explicit terms in ancient Chinese medical books, constructed a high-quality knowledge graph, and realized the in-depth mining and application of ancient Chinese medical books.

CN120611717BActive Publication Date: 2025-10-17CHENGDU UNIV OF TRADITIONAL CHINESE MEDICINE
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511099064.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-06
Publication Date
2025-10-17
Estimated Expiration
2045-08-06

AI Technical Summary

Technical Problem

Existing technologies have difficulty in effectively identifying and associating implicit semantics and explicit terms in ancient Chinese medical texts, resulting in incomplete and inaccurate knowledge graph construction. They also rely on manual rules and dictionaries, which have high maintenance costs and lack adaptive learning mechanisms.

Method used

A large language model is used for explicit term recognition, combined with a pre-trained language model and graph neural network, to construct a knowledge graph of ancient Chinese medicine books through semantic feature extraction, association weight calculation and graph structure optimization.

Benefits of technology

It achieves accurate identification of explicit terms and deep association of implicit semantics in ancient Chinese medical texts, builds a more complete and accurate semantic-term association matrix, improves the accuracy and reliability of the knowledge graph, and reduces reliance on manual rules.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120611717B_ABST
    Figure CN120611717B_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of natural language processing for traditional Chinese medicine ancient books, and particularly relates to a method, system and medium for associating implicit semantics and explicit terms of traditional Chinese medicine ancient books. The method of the present application extracts implicit semantic feature vectors from the text sequence of the structured traditional Chinese medicine ancient book text by using a pre-trained language model to obtain implicit semantic features; identifies explicit terms in the traditional Chinese medicine ancient book text by using a large language model to obtain explicit term encoding; and constructs a knowledge graph containing implicit semantic nodes and explicit term nodes based on the association between the implicit semantic feature vectors and the explicit term encoding. The present application can construct a knowledge graph based on the association between implicit semantics and explicit terms, and has the advantages of accuracy, efficiency and reliability, which provides strong support for the deep mining and application of traditional Chinese medicine knowledge, is conducive to the dissemination and popularization of traditional Chinese medicine ancient books, and has good application prospects.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of natural language processing for traditional Chinese medicine ancient books, and particularly relates to a method, system and medium for associating implicit semantics and explicit terms of traditional Chinese medicine ancient books. BACKGROUND

[0002] Traditional Chinese medicine ancient books are important carriers of traditional Chinese medicine literature, recording rich medical knowledge and practical experience. The texts not only contain explicit terms (such as disease names, drug names, and treatment method names), but also imply a large amount of deep semantic information. These implicit semantics are crucial for a comprehensive understanding of traditional Chinese medicine theory. However, the language of traditional Chinese medicine ancient books is complex and diverse, and the modeling of the association between implicit semantics and explicit terms is a key step in the construction of traditional Chinese medicine knowledge graphs and semantic mining.

[0003] Existing technologies mainly rely on artificial rules and term dictionaries for explicit term recognition and association construction. This method has limitations such as rule limitations, high labor costs, and shallow semantic understanding. Fixed rules are difficult to cover the full complexity and diversity of traditional Chinese medicine ancient book language, especially for the recognition and association of implicit semantics. At the same time, rule development and dictionary maintenance require a large number of experts, and with the change of corpus, the updating of rules becomes difficult. Relying only on explicit terms and simple rules cannot deeply mine the deep semantic associations in the text, resulting in incomplete and inaccurate knowledge graphs.

[0004] In recent years, with the rapid development of large language models (LLM) and other artificial intelligence technologies, researchers have also begun to apply artificial intelligence to the digital processing of traditional Chinese medicine ancient books. For example, patent application CN119833154 A "A knowledge graph construction method, device and storage medium based on traditional Chinese medicine medical records" provides a knowledge graph construction method based on traditional Chinese medicine medical records, which uses a large language model to extract various entities from medical record data and constructs a knowledge graph through a graph database. This method effectively converts unstructured traditional Chinese medicine ancient book information into a structured knowledge network, facilitating understanding and utilization.

[0005] However, these existing methods rely too much on artificial rules and lack adaptive learning mechanisms, making it difficult to handle the special language phenomena of traditional Chinese medicine ancient books and the complex association between implicit semantics and explicit terms. Although large language models have strong context understanding and generation capabilities, there is still a lack of relevant research on the complex association between implicit semantics and explicit terms in the traditional Chinese medicine field, and general large language models still lack the ability to recognize and associate implicit semantics in the traditional Chinese medicine field. SUMMARY

[0006] To solve the above problems in the prior art, the present application provides a method, system and medium for associating implicit semantics and explicit terms of traditional Chinese medicine ancient books.

[0007] A method for associating implicit semantics and explicit terms in traditional Chinese medical books, comprising the following steps:

[0008] Step 1, inputting a traditional Chinese medical book text;

[0009] Step 2, preprocessing to obtain a structured text sequence;

[0010] Step 3, using a pre-trained language model to extract semantic feature vectors from the structured text sequence to obtain implicit semantic features; identifying explicit terms in the traditional Chinese medical book text through a large language model, encoding to obtain explicit term encoding;

[0011] Step 4, calculating the association weight between the implicit semantic features and the explicit term encoding, and constructing a semantic association matrix based on the association weight;

[0012] Step 5, optimizing learning the semantic association matrix through a graph neural network to obtain node embedding vectors, the nodes including implicit semantic nodes and explicit term nodes;

[0013] Step 6, generating a knowledge graph containing implicit semantic nodes and explicit term nodes through the node embedding vectors and the association weight.

[0014] Preferably, in step 2, the traditional Chinese medical book text is preprocessed by HanLP, and the preprocessing includes at least one of the following processing steps: word segmentation, part-of-speech tagging, and syntactic analysis.

[0015] And / or, the preprocessing includes introducing a character mapping table and a context completion algorithm to standardize the text into a form that can be processed by modern Chinese for special language phenomena of traditional Chinese medical books; the special language phenomena include at least one of traditional Chinese characters, variant characters, or omitted sentences in ancient Chinese.

[0016] Preferably, in step 3, the pre-trained language model is a domain-adapted pre-trained BERT model, XLNet model, or ERNIE model.

[0017] Preferably, in step 3, the identification of the explicit term includes the following steps:

[0018] Inputting the structured text sequence into a large language model to output the identified explicit terms and their categories;

[0019] Using the generation capability of the large language model to expand new explicit terms or variants of explicit terms;

[0020] Performance optimization of explicit term identification through block processing.

[0021] Preferably, in step 4, the association weight is calculated by an attention mechanism, a calculation method based on cosine similarity, or a calculation method based on Euclidean distance;

[0022] Preferably, when the calculation is performed by the attention mechanism, the calculation formula of the association weight is:

[0023]

[0024] in, A represents the association matrix composed of association weights, Q Represents the query vector, from the latent semantic feature matrix H Extracted from represents the key vector, encoded from the explicit term matrix T Extracted from is the dimension of the key vector; the softmax function is used to normalize the attention weights.

[0025] Preferably, in step 5, the embedding vector of the node is updated by the following formula:

[0026]

[0027] in, is a node i The updated embedding vector, is a node i The embedding vector of is a node j The embedding vector of and is the weight matrix, is a node i The set of neighbor nodes of is a node j The set of neighbor nodes, σ is the activation function, It is The implicit semantic features and The association weights between explicit terms.

[0028] Preferably, in step 6, the knowledge graph is generated by Neo4j or PyTorch Geometric.

[0029] The present invention also provides a system for realizing the method of associating the implicit semantics and explicit terms in the above-mentioned ancient Chinese medical books, comprising

[0030] The input module is configured to input the text of ancient Chinese medical books;

[0031] A preprocessing module is configured to preprocess the ancient Chinese medical text to obtain a structured text sequence;

[0032] The implicit semantic feature extraction module is configured to extract semantic feature vectors from the structured text sequence by using a pre-trained language model to obtain implicit semantic features.

[0033] The explicit term extraction and encoding module is configured to identify explicit terms in the traditional Chinese medical text by a large language model, encode the explicit terms, and obtain explicit term encodings.

[0034] The semantic association matrix construction module is configured to calculate the association weight between the implicit semantic features and the explicit term encodings, and construct a semantic association matrix based on the association weight.

[0035] The embedding vector construction module is configured to optimize learning of the semantic association matrix by a graph neural network to obtain embedding vectors of nodes, the nodes including implicit semantic nodes and explicit term nodes.

[0036] The knowledge graph construction module is configured to generate a knowledge graph including the implicit semantic nodes and the explicit term nodes by the node embedding vectors and the association weight.

[0037] Preferably, the method further comprises:

[0038] The visualization module is configured to display the association relationship between the implicit semantics and the explicit terms by a visualization tool.

[0039] The application also provides a computer readable storage medium having stored thereon a computer program for implementing the above-mentioned association method of implicit semantics and explicit terms of traditional Chinese medical books.

[0040] In the application, the definitions of some terms are as follows:

[0041] Implicit semantics refer to deep semantic information implied in traditional Chinese medical texts without being directly presented in the form of explicit terms, but through the context, historical background or metaphorical expression, such as the prescription compatibility principle implied by "jun, chen, zhu and shi".

[0042] Explicit terms refer to professional vocabularies in traditional Chinese medical books that are explicitly identified, have fixed definitions and usage, such as disease names, drug names, treatment method names, etc., which can usually be directly extracted from the text and used as basic nodes of the knowledge graph.

[0043] Semantic association matrix: a mathematical structure used to quantify the association strength between implicit semantics and explicit terms, the matrix elements representing the association weight of the two in a specific context, and being the core data representation form of association modeling.

[0044] In the present invention, "implicit semantic features" are deep semantic information extracted in text analysis, and "explicit term encoding" is the structured representation of explicit terms. The "implicit semantic node" or "explicit term node" is the carrier of the structured representation of these implicit semantic features or explicit term encoding in the knowledge graph.

[0045] Taking the representation of implicit semantics as an example, the implicit semantic features are the semantic basis of the implicit semantic nodes, and the implicit semantic nodes are the structured representation of the implicit semantic features. The two work together to enable the knowledge graph to effectively represent the implicit semantic relationships in the text. For example, assume that there is a traditional Chinese medical text: "The patient has qi deficiency, often feels weak, and has pale complexion." The implicit semantic features contained in this text are: through context analysis, there is a causal relationship between "qi deficiency" and "weakness", and this causal relationship is an implicit semantic feature. The implicit semantic node is: in the knowledge graph, the implicit semantic feature "qi deficiency leads to weakness" is represented as an implicit semantic node. This node is connected to other nodes (such as the two explicit term nodes "qi deficiency" and "weakness") through edges, and the weight of the edge represents the strength of their association.

[0046] The present invention provides a method and system for associating implicit semantics with explicit terms based on the characteristics of traditional Chinese medical books. The method and system of the present invention have the following beneficial technical effects:

[0047] 1. The present invention innovatively uses a large language model (LLM) for explicit term recognition, achieving accurate recognition of explicit terms in traditional Chinese medical books. The powerful context understanding and generation capabilities of the large model significantly improve the accuracy and efficiency of term recognition, without relying on artificial rules and predefined entity relationships.

[0048] 2. The present invention cross-modally fuses the implicit semantic features extracted by the large language model with the structured explicit term encoding. Through a specific fusion algorithm, the two are accurately aligned in the semantic space, thereby constructing a more complete and accurate semantic-term association matrix. This fusion mechanism provides a high-quality data foundation for subsequent knowledge graph construction.

[0049] 3. The present invention introduces a self-attention mechanism, which calculates the association weight between the implicit semantic feature vector and the explicit term encoding vector, realizes an association calculation method based on dynamic adjustment of attention weight in the context, and can flexibly adjust the association strength of implicit semantics and explicit terms according to the semantic background of different text segments. This method effectively solves the semantic ambiguity and ambiguity problem in ancient books, further improving the accuracy and reliability of semantic association.

[0050] 4、The application utilizes a graph neural network (GNN) in combination with a prior knowledge base to optimize an initial association matrix. Through graph structure propagation and constraint correction, the rationality and integrity of semantic association are strengthened. The optimized knowledge graph can more accurately reflect the semantic structure in traditional Chinese medical books, providing strong technical support for the deep mining and application of traditional Chinese medical knowledge.

[0051] Obviously, according to the above content of the present application, according to the ordinary technical knowledge and common means in the art, other various forms of modifications, substitutions or changes can be made without departing from the above basic technical ideas of the present application.

[0052] The above content of the present application will be further described in detail through the specific embodiments in the form of examples. However, this should not be understood as limiting the scope of the above subject matter of the present application to the following examples. Any technology realized based on the above content of the present application belongs to the scope of the present application. BRIEF DESCRIPTION OF DRAWINGS

[0053] Figure 1 The technical scheme of the embodiment 1 of the present application is a general flowchart;

[0054] Figure 2 The embodiment 1 of the present application is a schematic diagram of Chinese text preprocessing and implicit semantic feature extraction;

[0055] Figure 3 The embodiment 1 of the present application is a schematic diagram of explicit term recognition and coding process;

[0056] Figure 4 The embodiment 1 of the present application is a schematic diagram of implicit semantic-explicit term association matrix construction;

[0057] Figure 5 The term category distribution result graph of the selected section of the example ancient book “Shennong Bencao Jing”;

[0058] Figure 6 The implicit semantic-explicit term association matrix result graph of the selected section of the example ancient book “Shennong Bencao Jing”;

[0059] Figure 7 The knowledge graph constituted by one explicit term node and the 30 implicit semantic nodes with the highest weight in the selected section of the example ancient book “Shennong Bencao Jing”. DETAILED DESCRIPTION

[0060] It should be particularly noted that the algorithms of the data acquisition, transmission, storage and processing steps not specifically described in the embodiments, and the hardware structure, circuit connection, etc. not specifically described can be realized through the existing technology.

[0061] The association method and system of implicit semantics and explicit terms in traditional Chinese ancient books in embodiment 1

[0062] The system of the embodiment comprises:

[0063] An input module configured to input a traditional Chinese medical text;

[0064] A preprocessing module configured to preprocess the traditional Chinese medical text to obtain a structured text sequence;

[0065] An implicit semantic feature extraction module configured to extract semantic feature vectors from the structured text sequence by using a pre-trained language model to obtain implicit semantic features;

[0066] An explicit term extraction and encoding module configured to identify explicit terms in the traditional Chinese medical text by using a large language model, encode the explicit terms, and obtain explicit term encodings;

[0067] A semantic association matrix construction module configured to calculate association weights between the implicit semantic features and the explicit term encodings, and construct a semantic association matrix based on the association weights;

[0068] An embedding vector construction module configured to optimize learning of the semantic association matrix by using a graph neural network to obtain embedding vectors of nodes, the nodes including implicit semantic nodes and explicit term nodes;

[0069] A knowledge graph construction module configured to generate a knowledge graph including the implicit semantic nodes and the explicit term nodes by using the node embedding vectors and the association weights;

[0070] A visualization module configured to display the association between the implicit semantics and the explicit terms by using a visualization tool.

[0071] The method steps of the association between the implicit semantics and the explicit terms by using the above system are shown in Figures 1-4 , and specifically include:

[0072] S1, input a traditional Chinese medical text, preprocess the text to obtain a structured text sequence, and extract semantic feature vectors from the structured text sequence by using a pre-trained language model to obtain implicit semantic features.

[0073] 1. Text preprocessing

[0074] The traditional Chinese medical text is segmented, tagged with parts of speech, and analyzed for syntax. A domain-adapted natural language processing tool such as HanLP is used to process the ancient text to generate a structured word sequence and a syntax tree.

[0075] In view of the special language phenomena (such as traditional Chinese characters, variant characters, and omitted sentences in ancient texts) of traditional Chinese medical texts, a character mapping table and a context completion algorithm are introduced to standardize the text into a form that can be processed by modern Chinese.

[0076] After preprocessing by HanLP, the text has a basic structured form, preparing for further implicit semantic feature extraction.

[0077] An example of a traditional Chinese medicine text is as follows: "Guizhifulang: Guizhi three two (peeling), Shaoyao three two, Gancao two two (zhizheng), Shengjiang three two (qie), Dazao twelve (bo)".

[0078] Examples of each step of preprocessing are as follows:

[0079] Word segmentation processing output example:

[0080] ['Guizhifulang', 'Guizhi', 'three two', '(', 'peeling', ')']

[0081] Part-of-speech tagging output example:

[0082] [('Guizhifulang', 'NN'), ('Guizhi', 'NR'), ('three two', 'NR'), ('(', 'O'), ('peeling', 'O'), (')', 'O')]

[0083] Dependency syntax analysis output example: [(1, 'nsubj'), (2, 'root')].

[0084] 2. Implicit semantic feature extraction

[0085] In text processing, implicit semantics refers to the meaning that is not directly expressed in the text but can be inferred through context and semantic relationships. It reflects the deep semantic structure of the text, rather than just the surface lexical and grammatical information. For example, in traditional Chinese medicine, the two words "qi deficiency" and "weakness" have no direct logical relationship, but through the context, it can be inferred that "qi deficiency" may lead to "weakness", and this inferred semantic relationship is implicit semantics.

[0086] For example: Suppose there is a traditional Chinese medicine text: "The patient has qi deficiency, often feels weak, and has pale complexion."

[0087] Explicit terms: In this text, "qi deficiency" and "weakness" are directly appearing terms, which are explicitly expressed concepts in the text.

[0088] Implicit semantics: Through context analysis, there is a causal relationship between "qi deficiency" and "weakness", i.e. "qi deficiency" may lead to "weakness". This causal relationship is not directly expressed in the text, but can be inferred through semantic analysis, which is implicit semantics.

[0089] The extraction of implicit semantics is crucial for understanding the deep meaning of text. In traditional Chinese medical books, many concepts and relationships are not directly expressed but are implied through context and semantic association. To capture these implicit semantic information, we use the domain-adapted pre-trained language model "BERT-TCM" (Bidirectional Encoder Representation from Transformers) to extract implicit semantic feature vectors from the text sequence preprocessed by HanLP.

[0090] The model input is the preprocessed text sequence, and the output is the semantic embedding vector of each word, where d is the embedding dimension, =1,2,…,m.

[0091] The context semantic representation of the text is calculated by the following formula:

[0092]

[0093] where H is a matrix, each row representing a semantic embedding vector of a word.

[0094] S2, identify explicit terms in traditional Chinese medical books through large language models, encode, and get explicit term encoding.

[0095] 1. Explicit term recognition

[0096] Use the large language model (LLM) application development platform to build an agent with explicit term recognition capability. Use the context understanding ability of the large model, combined with the named entity recognition (NER) task, to achieve accurate recognition of explicit terms in traditional Chinese medical books. The recognition of explicit terms is an important basis for understanding traditional Chinese medical books. Through the recognized explicit terms, we can further mine the implicit semantic information in the text.

[0097] (1) NER task adaptation

[0098] Design a prompt template to enable the agent to call the Deepseek, Doubao, Tongyi, and other large language model capabilities to complete the NER task. Input the preprocessed text into the large language model, and the large language model directly outputs the explicit terms and their categories based on its context understanding ability.

[0099] (2) Term expansion

[0100] Discover new terms or term variants using the generative capabilities of large models. The specific method is to generate contexts related to known terms to mine potential terms. Input prompts into large models, and the large models generate other terms related to known terms, thereby expanding the term library.

[0101] (3) Performance optimization

[0102] For large-scale ancient text, use block processing to improve processing efficiency. The specific steps are as follows:

[0103] ① Text blocking: The preprocessed ancient text is blocked according to a fixed length. Assuming the total length of the text is L words, and the length of each block is l words, then the number of blocks is blocks, where represents rounding up. The specific formula is:

[0104]

[0105] where L is the total length of the ancient text, l is the length of each block of text.

[0106] ② Block processing: input each block of text into the large model to perform the NER task. For each block of text Ta , use the NER task adaptation method to identify the explicit terms and their categories.

[0107] ③ Result merging: merge the recognition results of each block of text to form a complete term list. For terms that span blocks, correct and merge them through context information to ensure the integrity of term recognition.

[0108] 2. Term encoding

[0109] Convert the identified explicit terms into structured semantic encoding, including term categories, attributes, and relationships. The purpose of explicit term encoding is to structure the semantic information of explicit terms for subsequent semantic association analysis.

[0110] Explicit term encoding uses multi-dimensional vector representation, for example:

[0111]

[0112] where represents the encoding vector of the th explicit term ( =1,2,…,n). represents the term category, represents the term attribute, Representing term relationships.

[0113] An example output of explicit term encoding is as follows: [["Cassia twig", "Chinese medicine", {"Relationship": {"Compatibility": "Peony"}]}, ["Peony", "Chinese medicine", {"Relationship": {"Compatibility": "Cassia twig"}}]].

[0114] S3, calculate the association weight between implicit semantic features and explicit term encoding, and construct a semantic association matrix based on the association weight.

[0115] 1. Cross-modal feature fusion

[0116] This embodiment uses self-attention mechanism (Self-Attention) to calculate the association weight between implicit semantic features and explicit term encoding. The implicit semantic feature vector H and the explicit term encoding vector T are two different modal feature representations, and through cross-modal feature fusion, we can mine the association relationship between them. In text processing, the quantity relationship between the implicit semantic feature vector H and the explicit term encoding vector T is as follows:

[0117] Implicit semantic feature vector H : Each word or phrase in the text has a corresponding implicit semantic feature vector. Therefore, H is a matrix, each row of which corresponds to the semantic embedding vector of a word or phrase. Assuming there are m words or phrases in the text, the dimension of H is m x d , where d is the embedding dimension.

[0118] Explicit term encoding vector T: Each explicit term has a corresponding encoding vector. Assuming there are n explicit terms in the text, the dimension of T is n x k , where k is the dimension of the encoding vector.

[0119] For example, assume a traditional Chinese medical text: "The patient is deficient in qi, often feels weak, and has pale complexion."

[0120] Implicit semantic feature vector H :

[0121]

[0122] Each row is a semantic embedding vector of a word ( =1,2,…,m), for example corresponding to "patient", corresponding to "qi deficiency", and so on.

[0123] Explicit term encoding vector T :

[0124]

[0125] where each row is an explicit term's encoding vector ( =1,2,…,n), for example corresponding to "qi deficiency", corresponding to "weakness", and so on.

[0126] Cross-modal fusion:

[0127] To fuse the implicit semantic feature vectors H and the explicit term encoding vectors T , we need to calculate the association weight between each implicit semantic feature vector and each explicit term encoding vector , which is achieved by the following formula:

[0128]

[0129] where is the dimension of the key vector, and the softmax function is used to normalize the attention weight.

[0130] The specific steps are as follows:

[0131] (1) Query vector Q: Extract the query vector from the implicit semantic feature matrix H , i.e. , where is a learnable weight matrix.

[0132] (2) Key vector K: Extract the key vector from the explicit term encoding matrix T , i.e. , where is a learnable weight matrix.

[0133] (3) Value vector V: Extract the value vector from the explicit term encoding matrix T , i.e. , where is a learnable weight matrix.

[0134] (4) Calculate the attention weight:

[0135]

[0136] where A is m x n a matrix representing the association weight between each latent semantic feature and each explicit term.

[0137] fusion feature F : In the attention mechanism, the fusion feature F is obtained by the product of the attention weight matrix A and the value vector V:

[0138] F = AV

[0139] where F is the final fusion feature matrix with dimension m x n .

[0140] 2. Association matrix construction

[0141] Constructing the semantic association matrix , where m is the number of latent semantic features, n is the number of explicit terms.

[0142] The matrix element represents the association weight between the th latent semantic feature ( =1,2,…,m) and the th explicit term ( =1,2,…,n), and the calculation formula is:

[0143]

[0144] Through the above steps, we get an association matrix m x n with dimension A , where each element represents the association weight between the latent semantic feature and the explicit term . This association matrix provides a basis for subsequent knowledge graph generation.

[0145] In the above steps, through the calculation of query vector Q, key vector K and value vector V, and the generation of attention weight matrix A, the dynamic adjustment of the association relationship between the encoding of latent semantic features and explicit terms is realized. The association weight between each latent semantic feature vector and each explicit term encoding vector is dynamically calculated through the context information. This means that different text fragments (context) will result in different association weights, thus achieving flexible adjustment of the association strength.

[0146] S4, optimizing and learning the semantic association matrix using a graph neural network to obtain embedding vectors for nodes, wherein the nodes include latent semantic nodes and explicit terminology nodes. A knowledge graph including latent semantic nodes and explicit terminology nodes is generated using the node embedding vectors and association weights.

[0147] 1. Graph Neural Network Optimization

[0148] Using Graph Neural Network (GNN) to classify the correlation matrix A Perform optimization learning and correct the semantic association relationship by combining the prior knowledge base of traditional Chinese medicine. A Based on this, we further use graph neural networks for optimized learning to improve the accuracy and reliability of semantic associations.

[0149] Defining the graph structure , where the nodes Contains implicit semantic nodes and explicit term nodes, edges Represents the association weight between the two.

[0150] Update the embedding vector of the node by the following formula:

[0151]

[0152] in, is a node i The updated embedding vector, is a node i The embedding vector of is a node j The embedding vector of and is the weight matrix, is a node i The set of neighbor nodes of is a node j The set of neighbor nodes, σ is the activation function, It is The implicit semantic features and The association weights between explicit terms. i 、 j =1,2,…,m+n; =1,2,…,m; =1,2,…,n.

[0153] 2. Knowledge Graph Generation

[0154] Based on the optimized node embedding vectors and association weights, a knowledge graph containing implicit semantic nodes and explicit terminology nodes is generated. This knowledge graph allows us to intuitively display the association between implicit semantics and explicit terminology, providing strong support for the research and application of ancient Chinese medical texts.

[0155] The edge weight of the knowledge graph is calculated using the following formula:

[0156]

[0157] in is the edge weight, is the weight matrix, and the Sigmoid function is used to normalize the weights to the range [0, 1].

[0158] 3. Visual presentation

[0159] The knowledge graph is stored using the graph database Neo4j, and the association between implicit semantics and explicit terms is displayed using the visualization tool Gephi. This visualization not only facilitates researchers' browsing and analysis of the knowledge graph but also provides a new avenue for the dissemination and popularization of ancient Chinese medical texts.

[0160] The actual application results of using the method and system of this embodiment to process the ancient Chinese medical text "Shennong Bencao Jing" are as follows: Figures 5-7 shown.

[0161] in, Figure 5 This example shows the distribution of term categories in a sample excerpt from the ancient book "Shennong's Herbal Classic." This result preliminarily verifies the accuracy of the term identification step and provides a reliable foundation for subsequent semantic analysis and knowledge graph construction.

[0162] Figure 6 As an example, the implicit semantics-explicit terminology association matrix for an excerpt from the ancient text "Shennong's Herbal Classic" is displayed as a heat map. The association matrix between implicit semantic features and explicit terms is displayed using varying shades of color to illustrate the strength of the association between different implicit semantic features and explicit terms. This result validates the effectiveness of the implicit semantic feature extraction and association calculation steps, demonstrating that the model can successfully capture the deep semantic relationships in the text and provide strong support for the construction of the knowledge graph. The association matrix is ​​a key bridge connecting implicit semantics and explicit terminology, ensuring that the knowledge graph accurately reflects the complex semantic structure of the text.

[0163] Figure 7A knowledge graph is constructed by taking one explicit term node and its 30 most relevant implicit semantic nodes in a selected section of the example ancient book Shennong Bencao Jing. In the same way, a knowledge graph containing all nodes in the selected section can be further constructed. The result reflects the knowledge structure in the text and verifies the effectiveness of the entire modeling method. The successfully generated knowledge graph shows that each step from term recognition to association calculation to graph construction can work together to accurately convert the implicit semantics and explicit terms in the ancient book text into a structured knowledge graph form. As can be seen from the above embodiments, the present application provides a method and system for associating implicit semantics and explicit terms in traditional Chinese medicine, which can construct a knowledge graph based on the association of implicit semantics and explicit terms. The present application provides strong support for the deep mining and application of traditional Chinese medicine knowledge, and is conducive to the dissemination and popularization of traditional Chinese medicine books, and has good application prospects.

Claims

1. A method for associating implicit semantics with explicit terms in ancient Chinese medical books, characterized in that: The steps include: Step 1: Input the text of ancient Chinese medical books; Step 2: perform preprocessing to obtain a structured text sequence; Step 3: Using a pre-trained language model to extract semantic feature vectors from the structured text sequence to obtain latent semantic features; Identify explicit terms in ancient Chinese medical texts through a large language model, encode them, and obtain explicit term encodings; Step 4, calculating the association weights between the latent semantic features and the explicit term encodings, and constructing a semantic association matrix based on the association weights; Step 5: Optimize and learn the semantic association matrix through a graph neural network to obtain an embedding vector of a node, where the node includes an implicit semantic node and an explicit term node; Step 6: Generate a knowledge graph containing implicit semantic nodes and explicit term nodes through the embedding vectors and associated weights of the nodes.

2. The method for associating implicit semantics and explicit terms in ancient Chinese medical books according to claim 1, characterized in that: In step 2, preprocessing the ancient Chinese medical text is performed using HanLP, wherein the preprocessing includes at least one of the following processing steps: word segmentation, part-of-speech tagging, and syntactic analysis; And / or, the preprocessing includes introducing a character mapping table and a context completion algorithm to target special language phenomena in ancient Chinese medical texts, and standardizing the text into a form that can be processed by modern Chinese; the special language phenomena include at least one of traditional Chinese characters, variant characters or elliptical sentences in ancient Chinese.

3. The method for associating implicit semantics and explicit terms in ancient Chinese medical books according to claim 1, characterized in that: In step 3, the pre-trained language model is a domain-adapted pre-trained BERT model, XLNet model, or ERNIE model.

4. The method for associating implicit semantics and explicit terms in ancient Chinese medical books according to claim 3 is characterized in that: In step 3, the identification of the explicit term includes the following steps: Inputting the structured text sequence into a large language model and outputting the recognized explicit terms and their categories; Leverage the generative power of large language models to develop new explicit terms or variants of explicit terms; Optimize the performance of explicit term identification by block processing.

5. The method for associating implicit semantics and explicit terms in ancient Chinese medical books according to claim 1, characterized in that: In step 4, the association weight is calculated using the attention mechanism, the cosine similarity-based calculation method, or the Euclidean distance-based calculation method; When calculated by the attention mechanism, the calculation formula of the association weight is: in, A represents the association matrix composed of association weights, Q Represents the query vector, from the latent semantic feature matrix H Extracted from represents the key vector, encoded from the explicit term matrix T Extracted from is the dimension of the key vector; the softmax function is used to normalize the attention weights.

6. The method for associating implicit semantics and explicit terms in ancient Chinese medical books according to claim 1, characterized in that: In step 5, the embedding vector of the node is updated by the following formula: in, is a node i The updated embedding vector, is a node i The embedding vector of is a node j The embedding vector of and is the weight matrix, is a node i The set of neighbor nodes of is a node j The set of neighbor nodes, σ is the activation function, It is The implicit semantic features and The association weights between explicit terms.

7. The method for associating implicit semantics and explicit terms in ancient Chinese medical books according to claim 1, characterized in that: In step 6, the knowledge graph is generated through Neo4j or PyTorch Geometric.

8. A system for implementing the method for associating implicit semantics and explicit terms in ancient Chinese medical books as described in any one of claims 1 to 7, characterized in that: include The input module is configured to input the text of ancient Chinese medical books; A preprocessing module is configured to preprocess the ancient Chinese medical text to obtain a structured text sequence; A latent semantic feature extraction module is configured to extract semantic feature vectors from the structured text sequence using a pre-trained language model to obtain latent semantic features; The explicit term extraction and encoding module is configured to identify explicit terms in the ancient Chinese medical texts through a large language model, encode them, and obtain explicit term encodings; A semantic association matrix construction module is configured to calculate association weights between latent semantic features and explicit term encodings, and construct a semantic association matrix based on the association weights; An embedding vector construction module is configured to optimize and learn the semantic association matrix through a graph neural network to obtain an embedding vector of a node, wherein the node includes an implicit semantic node and an explicit term node; The knowledge graph construction module is configured to generate a knowledge graph containing implicit semantic nodes and explicit term nodes through the node embedding vectors and associated weights.

9. The system according to claim 8, characterized in that Also includes: The visualization module is configured to display the association relationship between the implicit semantics and the explicit terms through a visualization tool.

10. A computer-readable storage medium, characterized in that The computer program is stored thereon for implementing the method for associating implicit semantics and explicit terms in ancient Chinese medical books as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Knowledge graph construction method and device based on traditional Chinese medicine cases and storage medium

    CN119833154A

  • Traditional Chinese medicine ancient book mapping knowledge domain construction method, device and medium

    CN120509470A