Teaching material knowledge graph construction method based on large language model

The knowledge graph of subject textbooks is constructed through a large language model, and the self-prompt framework and multi-round dialogue technology are used to automatically extract and integrate knowledge points and their relationships, solving the problem of inefficiency in the existing technology, achieving efficient and accurate knowledge graph construction, adapting to the complex semantic relationships of interdisciplinary textbooks.

CN120409646APending Publication Date: 2025-08-01SOUTHEAST UNIV
View PDF 0 Cites 10 Cited by

Patent Information

Application Number
CN202510549287.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-29
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

The existing knowledge graph construction methods are inefficient and rely on manual intervention, making it difficult to deal with complex semantic relationships and diverse text expressions in interdisciplinary textbooks, especially in different disciplines, which are difficult to accurately capture the complex logical relationships and hierarchies of knowledge points.

Method used

A large language model is used to construct a knowledge graph of subject textbooks, and through a self-prompt framework, multiple rounds of dialogue and knowledge fusion technology, knowledge points and their relationships are automatically extracted, and structured knowledge graphs are constructed, including generating relationship synonyms, synthesizing samples, extracting knowledge point entities and relationship triplets, and verifying and knowledge fusion through entity embedding and candidate alignment entities.

Benefits of technology

It significantly improves the efficiency and accuracy of knowledge graph construction, reduces manual intervention, enhances the ability to identify complex semantic relationships, ensures the integrity and consistency of knowledge graphs, and adapts to the diverse expressions of different disciplines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120409646A_ABST
    Figure CN120409646A_ABST
Patent Text Reader

Abstract

The invention relates to a method for constructing a subject textbook knowledge graph by using a large language model, and the method is realized through six steps: firstly, introducing a self-prompt framework, generating relation synonyms, synthesizing samples and sentence variants through three rounds of dialogues, and providing rich semantic guidance for subsequent relation extraction; secondly, guiding a large language model to accurately extract core knowledge point entities from teaching materials, exercises and PPT texts by means of a professional field instruction template; then, respectively extracting an attribute triple and a relation triple of the knowledge points by applying a multi-round dialogue mode and combining with a synthetic sample prompt; then, inputting the extracted triad into a verification module, and ensuring the accuracy through iterative verification; and finally, generating an entity embedding vector by utilizing an MPNet model subjected to subject knowledge fine adjustment, calculating entity similarity through a dynamic weighted pooling mechanism, judging entity pairs with high similarity, performing knowledge fusion if the entity pairs represent the same concept, and otherwise, reasoning a potential missing relationship and complementing the knowledge graph. According to the method, the knowledge graph of the course of the specific subject can be automatically constructed from the unstructured text efficiently and accurately, and powerful support is provided for teaching and learning of related subjects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of knowledge graphs, and particularly relates to a method for constructing a subject textbook knowledge graph based on a large language model. Through the efficient text processing ability of the large language model and combined with knowledge graph technology, this method can automatically extract knowledge points and their relationships from unstructured texts such as textbooks, courseware, and exercises, and construct a structured knowledge graph to provide support for teaching and research in specific subject fields. Background Art

[0002] With the development of educational informatization, a large number of knowledge points and their complex interrelationships are contained in unstructured texts such as courseware and exercises of various subject textbooks (such as science and engineering, humanities and social sciences, medicine, etc.). Traditional knowledge graph construction methods usually rely on manual annotation and rule extraction, with low efficiency and difficulty in coping with the processing requirements of large-scale text data. In recent years, large language models (such as GPT, PaLM, etc.) have performed excellently in natural language processing tasks and can efficiently extract structured information from texts. However, how to use large language models to automatically extract knowledge points and their relationships from unstructured texts and construct a knowledge graph is still a challenging problem.

[0003] Existing knowledge graph construction methods usually require a large amount of manual intervention and are difficult to handle the complex semantic relationships and diverse text expressions in cross-disciplinary textbooks. Especially in different subject fields (such as computer science, medicine, history, etc.), the complexity and expression differences of knowledge points make it difficult for traditional methods to cope. The knowledge systems of each subject usually include multi-level contents such as core concepts, principle methods, and application scenarios. There are complex logical relationships and hierarchical structures among these knowledge points, and traditional knowledge graph construction methods are difficult to accurately capture these cross-domain semantic associations.

[0004] The present invention proposes a knowledge graph construction method based on a large language model. By introducing a self-prompting framework, multi-round dialogue, and knowledge fusion technology, it can automatically extract knowledge points and their relationships from unstructured texts and construct a structured knowledge graph, significantly improving the efficiency and accuracy of knowledge graph construction. Taking the subject of knowledge engineering as an example, the present invention can extract core knowledge points such as "knowledge representation", "knowledge reasoning", and "knowledge acquisition" from textbooks, courseware, and exercises, and construct the relationships among them to form a complete knowledge graph to provide support for teaching and research in the field of knowledge engineering. Summary of the Invention

[0005] To solve the problems of low efficiency in constructing knowledge graphs, dependence on manual intervention, and difficulty in dealing with complex semantic relationships in the existing technology, the present invention discloses a method for constructing a knowledge graph of subject textbooks using a large language model. This method extracts knowledge points and their relationships from unstructured text automatically, constructs a structured knowledge graph, significantly improves the efficiency and accuracy of knowledge graph construction, and provides strong support for research in the field of subject education.

[0006] The present invention starts with unstructured texts such as subject textbooks, courseware, and exercises, and automatically extracts knowledge points and their relationships through the efficient text processing ability of a large language model to construct a knowledge graph. Specifically, by introducing a self-prompting framework, multi-round dialogue, and knowledge fusion technology, the present invention can automatically extract knowledge points and their relationships from text and construct a structured knowledge graph, avoiding a large amount of repetitive manual annotation and rule extraction work, and significantly improving the efficiency and quality of knowledge graph construction.

[0007] To achieve the above object, the technical solution of the present invention is as follows:

[0008] A method for constructing a knowledge graph of subject textbooks using a large language model, comprising the following steps:

[0009] 1) Generate relationship synonyms and synthetic samples: Introduce a self-prompting framework through three rounds of dialogue. Specifically, in the first round of dialogue, generate synonyms of the relationship types of a predefined Schema. The relationship Schema described in this method includes relationship types of attribute types and non-attribute types. Among them, the relationship types of attribute types include "entity_is defined as_text", "entity_content_text", "entity_English name_text", and the relationship types of non-attribute types include "contains",

[0010] "instance", "equivalent", "develops into", "premise", "realizes", "exercise". In the second round of dialogue, generate sentences containing this relationship. The generated sentences and the triples containing the relationship in the sentences are collectively called synthetic samples. In the third round of dialogue, restate the sentences in the synthetic samples to generate diverse sentences and annotated relationship triples as prompts for subsequent extraction of knowledge point attribute triples and relationship triples.

[0011] 2) Extract knowledge point entities: By inputting textbook text and instructions, guide the large language model to extract core knowledge point entities from textbook, exercise, and PPT text, and output a list of knowledge point entities.

[0012] 3) Extract knowledge point attribute triples: Through multi-round dialogue, combined with the synthetic samples in step 1), extract knowledge point attribute triples.

[0013] 4) Extract knowledge point relationship triples: Through multiple rounds of conversations, combined with the synthesized samples in step 1), extract the relationship triples between knowledge points.

[0014] 5) Triple verification: Use the verification module to iteratively verify the extracted triples to ensure the accuracy, integrity, and consistency of the triples.

[0015] 6) Entity embedding and selection of candidate aligned entity pairs: Fine-tune the pre-trained MPNet model with subject knowledge so that it can better understand the terms and semantics in a specific subject area, thereby generating more accurate entity embedding vectors.

[0016] Through the dynamic weighted pooling mechanism, use the MPNet model fine-tuned with subject knowledge to generate the comprehensive embedding vector of the entity, dynamically allocate weights to improve the quality of entity embedding. Calculate the cosine similarity of the comprehensive embedding vectors, and select the entity pairs with a similarity greater than 0.8 as candidate aligned entity pairs, denoted as (benchmark entity, candidate entity).

[0017] 7) Heuristic attribute selection, entity alignment, knowledge fusion, and knowledge graph completion: For the candidate entity pairs extracted in step 6), use the heuristic attribute selection method to screen out highly discriminative attributes for entity alignment and knowledge fusion. Then use the large language model to judge whether the entities represent the same concept, and perform knowledge fusion or knowledge graph completion. If the entity pair represents the same concept, use the benchmark entity as the final name, merge the attribute information of the two entities, avoid redundancy and retain the most complete and informative description. If the entity pair does not represent the same concept, input their attribute triples as prompts to guide the large language model to infer potential missing relationships, and complete the missing relationship triples in the knowledge graph according to the predefined relationship Schema.

[0018] In the method for constructing a knowledge graph based on a large language model of the present invention, the knowledge point entities, knowledge point attribute triples, knowledge point relationship triples, and knowledge graph in the above steps are defined as follows:

[0019] Definition 1: Knowledge point entity. The knowledge point entity e = (E, d), where E ∈ ε is the name of the knowledge point, and ε = {E1, E2,..., E m} is a finite set of m knowledge point names, and d represents the definition of the knowledge point. (Italic, subscript)

[0020] Definition 2: Knowledge point attribute triple. The knowledge point attribute triple SPO is a set of triples (e, a, v), where e is the knowledge point entity, a is the attribute relationship, and v is the specific text description.

[0021] Definition 3: Knowledge point relationship triple. The knowledge point relationship triple SPO is a set of triples (e1, r, e2), where e1 and e2 are knowledge point entities, and r is the relationship between the knowledge point entities.

[0022] Definition 4: Knowledge graph. The knowledge graph KG is a set of triples (e1, r, e2), where e1 and e2 are knowledge point entities, and r is the relationship between the knowledge point entities.

[0023] In the method for constructing a knowledge graph based on a large language model of the present invention, in step 1), relationship synonyms, synthetic samples, and restated sentences are generated in the following manner: 1-a) Input the predefined relationship types that conform to the Schema and their domain description texts into the large language model, and add an instruction to express the following meaning: As an expert in the [subject] field, for a certain relationship type, whose description is: "", generate {k} synonyms or semantically equivalent expressions. So that the large language model outputs a list of synonyms for the relationship;

[0024] 1-b) Input the relationship type and its domain description text into the large language model, and add an instruction to express the following meaning: Based on [subject] knowledge, generate sentences containing one or more of a certain relationship type, the number of generated sentences is set manually, and the triples are marked. Through the above input and processing, multiple synthetic samples are obtained, that is, the generated sentences and the triples marked in the sentences, for subsequent steps;

[0025] 1-c) Input the synthetic samples output in 1-b) into the large language model, and add an instruction to express the following meaning: Perform semantic equivalent restatement on the following [subject] field sentences, and the original triples in the sentences need to be retained. Through the above input and processing, a set of restated sentences and the marked triples are obtained, which are used as synthetic samples for subsequent step prompts; 1-d) Perform the above steps for all relationships defined by the Schema until synthetic samples are generated for all relationship types.

[0026] In the method for constructing a knowledge graph based on a large language model of the present invention, in step 2), knowledge point entities are extracted in the following manner: 2-a) Input the textbook text content of a specific subject field into the large language model, and add an instruction to express the following meaning: You are an expert in a certain subject field, specifically responsible for extracting core concepts and terms from the text to build a structured knowledge system. Please accurately identify the professional terms related to this subject from the input text. Through the above input and processing, the knowledge point entities of this subject are obtained.

[0027] In the method for constructing a knowledge graph based on a large language model of the present invention, in step 3), the knowledge point attribute triples are extracted in the following manner: 3-a) For each predefined attribute relationship type (such as "is defined as"), perform the following operations: 1) Prepare example samples of this relationship, including the synthetic sentences generated in step 1-c) and the annotated triples; 2) Input the text to be processed and the list of recognized entities; 3) Append an instruction to express the following meaning: "Judge whether there is a [relationship type] relationship between [entity A] in the text. If so, extract the corresponding description"; Obtain the attribute triples extracted from the text through the above input and processing.

[0028] In the method for constructing a knowledge graph based on a large language model of the present invention, in step 4), the knowledge point relationship triples are extracted in the following manner: 4-a) For each predefined relationship type (such as "contains"), perform the following operations: 1) Prepare example samples of this relationship, including the synthetic sentences generated in step 1-c) and the annotated triples; 2) Input the text to be processed and the list of entities; 3) Append an instruction to express the following meaning: "Analyze whether there is a certain relationship type between the input entities". If so, output the relationship triples, and if not, output an empty set. Obtain the knowledge point relationship triples through the above input and processing.

[0029] In the method for constructing a knowledge graph based on a large language model of the present invention, in step 5), the triples are verified in the following manner: 5-a) Input the text and the triples preliminarily extracted from the text, and express the following meaning through an instruction: Judge whether the extracted triples are incorrect. If the triples are correct, output "Correct". If the triples are incorrect, output the incorrect triples and their corrected versions, and repeat the verification process until "Correct" is output or the maximum number of iterations is reached.

[0030] In the method for constructing a knowledge graph based on a large language model of the present invention, in step 6), entity embedding and selection of candidate aligned entity pairs are performed in the following manner: 6-a) Fine-tune the pre-trained MPNet model for subject knowledge. First, collect textbook, courseware, and exercise text data in a specific subject field to form a domain-adaptive pre-training corpus. Then, by inputting the pre-training corpus, use the Masked Language Modeling (MLM) task to fine-tune the MPNet model. Randomly mask some of the words in the input text and let the model predict the masked words. Then, update the model parameters through backpropagation. Repeat the above fine-tuning steps until the model converges on the subject field data or reaches the preset number of training epochs.

[0031] 6-b) Through the dynamic weighted pooling mechanism, use the MPNet model fine-tuned with disciplinary knowledge to generate the comprehensive embedding vector of the entity, dynamically allocate weights to improve the quality of entity embeddings. For each entity e, extract its various attributes a i (such as name, definition, content, etc.). Use the MPNet model fine-tuned with disciplinary knowledge to encode each attribute a i to generate the embedding vector h i :

[0032] h i = MPNet(a i )

[0033] Then calculate the weight a of each attribute i :

[0034]

[0035] where q is the query vector and W is the weight matrix. These parameters are randomly initialized at the beginning and optimized through the training process. According to the weight αi, generate the comprehensive embedding vector v of the entity e :

[0036]

[0037] To learn the parameters q and W that can better represent the entity, the training phase needs to prepare labeled entity pair data. The labeled data contains the entity pairs of this discipline and their similarity labels (1 indicates the same concept, 0 indicates different concepts), and define the loss function. Use Binary Cross-Entropy Loss to optimize the model parameters to ensure that the generated comprehensive embedding vector can correctly reflect the similarity between entities:

[0038] L = -y·log(sim(v1, v2)) - (1 - y)·log(1 - sim(v1, v2))

[0039] Calculate the gradients of the loss function with respect to q and W, and use the optimization algorithm Adam to update the parameters:

[0040]

[0041] where η is the learning rate. Through the above training process, the model can learn the optimal query vector q and weight matrix W.

[0042] 6-c) Calculate the cosine similarity of the comprehensive embedding vector. For two entities e1 and e2, calculate the cosine similarity of their comprehensive embedding vectors v1 and v2:

[0043]

[0044] Select entity pairs with a similarity greater than 0.8 as candidate alignment entity pairs, denoted as (reference entity, candidate entity).

[0045] In the method for constructing a knowledge graph based on a large language model of the present invention, in step 7), entity alignment, knowledge fusion, and knowledge graph completion are performed as follows: 7-a) All entities in the candidate entity pairs extracted in step 6) are combined into an entity set C e , and the set composed of all attribute triples of these entities is T att , calculate the function degree of each attribute a e of each entity in C i :

[0046]

[0047] where h represents the head entity and v represents the attribute value. The numerator represents the number of entities with attribute a i , and the denominator represents the total number of occurrences of attribute a i . The higher the function degree, the stronger the uniqueness of the attribute value; the function degree measures the discrimination ability of the attribute. If multiple entities share the same attribute value, the function degree of this attribute is lower; conversely, if the attribute value is unique, the function degree is higher.

[0048] 7-b) Calculate the frequency of each attribute in the candidate entity set C e :

[0049]

[0050] where the numerator counts the number of entities in the candidate entity set C e that contain attribute a i (obtained by retrieving the attribute triple set T att ), and the denominator is the total number of candidate entities. This formula counts the occurrence frequency of attribute a i in the candidate entity set C e ;

[0051] 7-c) Calculate the identifiability of each attribute:

[0052] identy att (a i ,C e ) = fun att (a i ) × freq att (a i ,C e )

[0053] The recognizability metric combines functionality and frequency, calculates the recognizability of all attributes, and finally selects the top k highly recognizable attributes (such as "definition", "English name") for subsequent alignment input;

[0054] 7-d) Input the candidate entity pairs and their top k highly recognizable attributes into the large language model, and use instructions to guide the large language model to judge whether the entities represent the same concept;

[0055] 7-e) If the entity pair represents the same concept, use the reference entity as the final name, merge the attribute information of the two entities, avoid redundancy and retain the most complete and informative description, and output the merged entity and attributes.

[0056] 7-f) If the entity pair does not represent the same concept, use instructions to guide the large language model to infer potential missing relationships, output the inferred relationship triples and require the relationships to conform to the predefined relationship Schema, which is used to complete the missing relationship triples in the knowledge graph. If there is no relationship, output an empty list.

[0057] The described knowledge graph construction method is applicable to automatically extracting knowledge point triples from unstructured texts (such as textbooks, courseware, exercises, etc.) and constructing a structured knowledge graph for teaching and research in subject courses.

[0058] The beneficial effects of the present invention are as follows:

[0059] First, by introducing a self-prompting framework, the present invention uses the large language model to dynamically generate relationship synonyms, synthetic samples, and diverse sentence variants, significantly improving the semantic coverage ability and generalization of relationship extraction. Through a three-round dialogue mechanism, the framework generates synonym expansions, labeled samples, and semantically equivalent restated sentences for each predefined relationship type, ensuring that diverse expressions of relationships in the text can be recognized in the subsequent extraction process. For example, for the "contains" relationship, the system can simultaneously recognize synonymous expressions such as "includes", "covers", etc., avoiding extraction omissions caused by language expression differences in traditional methods.

[0060] Second, the multi-round step-by-step extraction mechanism of the present invention guides the large language model to sequentially perform entity recognition, attribute triple extraction, and relationship triple extraction tasks through professional domain instruction templates. Each step strictly limits the processing scope and injects synthetic samples as semantic references, avoiding multi-task interference and ensuring the domain adaptability of the extraction results. For example, when extracting the "is defined as" attribute, the model only focuses on definition-type text fragments and performs precise matching in combination with the generated synthetic samples, significantly reducing noise interference.

[0061] In addition, the present invention innovatively adopts a dynamic weighted pooling mechanism to generate entity comprehensive embedding vectors. By fine-tuning the pre-trained MPNet model with subject knowledge and dynamically allocating attribute weights based on query vectors and learnable weight matrices, the generated embedding vectors can more accurately reflect the domain semantic features of entities. For example, in the field of computer science, the "definition" attribute usually has higher discriminability than the "link" attribute, and the model automatically assigns it a greater weight through training, thereby improving the accuracy of subsequent entity alignment.

[0062] In the knowledge fusion stage, the present invention proposes a heuristic attribute selection algorithm. By calculating the functionality, frequency, and recognizability of attributes, it automatically screens out high-discriminability attributes as the basis for alignment. For example, "English name" and "definition" usually have high recognizability, while "content" may have low functionality due to its long expression. This method effectively reduces redundant calculations and, combined with the semantic judgment ability of large language models, realizes the intelligent merging of conflicting attributes and the automatic completion of missing relationships.

[0063] The verification module of the present invention adopts an iterative correction mechanism. Through multiple rounds of accuracy, integrity, and consistency checks, it gradually optimizes the quality of triples. Each iteration records the complete correction history and terminates when two consecutive corrections fail or the maximum number of iterations is reached, which not only ensures the rigor of verification but also avoids infinite loops. For example, for the ambiguous expression "A knowledge graph consists of an ontology and rules", the system can finally determine through multiple verifications that "consists of" should be mapped to the "contains" relationship.

[0064] In summary, through the above technological innovations, the present invention realizes the efficient, accurate, and scalable automatic construction of a structured knowledge graph from unstructured text, providing strong technical support for knowledge management in the field of subject education. Brief Description of the Drawings

[0065] Figure 1 is a schematic diagram of the overall framework of the present invention;

[0066] Figure 2 is a specific flowchart of the first-step self-prompting framework of the present invention;

[0067] Figure 3 is a specific flowchart of the seventh-step heuristic attribute selection, entity alignment, knowledge fusion, and knowledge graph completion of the present invention. Detailed Description of the Invention

[0068] Step 1): Self-prompting to construct synthetic samples

[0069] Since the words used to reflect the relationship between entities in the text are often different from the candidate relationship types set by the schema, for example, the shortcomings may be expressed in the text as needs to be improved. In order to ensure that the entity relationships extracted from the text can accurately match the predefined Schema while covering a variety of language expressions, the present invention designs a self-prompting framework driven by a large language model. The core of this framework is to utilize the semantic understanding, generation and generalization capabilities of the large language model to dynamically generate high-quality semantic guidance data through multiple rounds of dialogue, thereby significantly improving the accuracy and robustness of relationship extraction. The specific approach is to introduce a self-prompting framework through three rounds of dialogue, and produce multiple high-quality synthetic samples for each candidate relationship preset by the Schema. The detailed steps are as follows:

[0070] (1) Generate relation synonyms from historical data:

[0071] Given a relationship type (such as "include"), the large language model generates multiple synonyms (such as "include", "cover", etc.). These synonyms will be used for subsequent text generation and relationship extraction. Specifically, when generating example sentences containing specific relationships in the text generation stage, the relationship words and their synonyms will be used alternately to ensure that the generated training data contains various expressions of the relationship. For example, in the field of knowledge engineering, both "knowledge graph contains ontology" and "knowledge graph includes reasoning engine" are generated. Ensure that the model can recognize the same relationship under different expressions. This also ensures that in the relationship extraction stage, when processing text, the system not only matches the predefined precise relationship words (such as "include"), but also matches all synonyms corresponding to the relationship (such as "include", "cover", etc.).

[0072] For example, for the sentence "The knowledge graph covers the ontology and rule base," the system can recognize that "covers" is equivalent to the "includes" relationship. This helps improve the large language model's ability to understand and recognize diverse expressions of relationships.

[0073] The instructions for this step are as follows:

[0074]

[0075] {relation} is the relation type for which synonyms need to be generated in this round of dialogue, and {description} is the specific description of the relation type. Replace a subject in the instruction template with the name of a specific subject.

[0076] Through the instructions designed above, the model's output is required to conform to the professional standards of the subject area while excluding irrelevant or ambiguous terms. The model can adaptively balance the breadth and precision of semantic coverage, ensuring that subsequent steps can recognize different expressions of relationships in the text.

[0077] (2) Generate sentences containing specific relationships:

[0078] Use a large language model to generate sentences containing specific relationships and annotate the relationship triples. For example, in the field of knowledge engineering, for the relationship type "contains", the generated sentence might be "The knowledge graph contains ontology mapping", and the relationship triple is annotated as: (knowledge graph, contains, ontology mapping).

[0079] In this stage, the system strictly follows the preset instruction requirements to execute the text generation task. As a language model specifically dealing with data in a certain specific discipline field, when receiving the relationship type {relation} (such as "contains") and its detailed description {description}, it will generate {k} sentences that conform to the field specifications. Each generated sentence is carefully designed to explicitly or implicitly embody the target relationship, while maintaining informativeness and professionalism. Taking the field of knowledge engineering as an example, the system will intelligently combine typical entity pairs in the "Knowledge Engineering" textbook (such as "knowledge graph" and "ontology") to generate sentences of different complexities such as simple sentences and compound sentences. For example, a typical expression like "The core components of an expert system contain a knowledge base and an inference engine". In the output link, the system strictly follows the specified format. First, it completely presents the generated sentence, and then lists 1 - 3 standardized relationship triples, such as [("expert system", "contains", "knowledge base"), ("expert system", "contains", "inference engine")]. All outputs meet the following core requirements: the relationship expression is strictly consistent with the definition, the head and tail entities appear completely in the sentence, the complex relationship is reasonably split and annotated, the sentence structure has representative differences, the entity combination reflects the real knowledge association, and the content fully conforms to the specific discipline category. Through this standardized generation process, it is ensured that each output sample can effectively support the subsequent knowledge graph construction work.

[0080] To achieve the above goals, the instruction setting method is as follows:

[0081]

[0082]

[0083] Among them, {relation} is the relationship type for which synonyms need to be generated in this round of conversation, {description} is the specific elaboration of this relationship type. {k} is the artificially set number of sentences to be generated, and the default value of k = 5. Replace a certain discipline in the instruction template with the discipline name of a specific discipline.

[0084] (3) Sentence restatement:

[0085] During the sentence restatement phase, the large language model performs semantically preserved, diversified rewrites of the original sentence, aiming to enhance the richness and adaptability of relational representation. Given an input sentence and its annotated relational triples, the model uses deep semantic understanding to generate multiple representations with different sentence structures but equivalent meanings. For example, in the field of knowledge engineering, given the original sentence "The knowledge graph contains ontology mapping" and its annotations ("knowledge graph," "contains," "ontology mapping"), the model generates variants such as "Ontology mapping constitutes the core of the knowledge graph" and "Knowledge graph achieves structured organization through ontology mapping." These rewrites fully preserve the original entity and relational semantics while achieving expressive diversity through strategies such as active / passive conversion, subject-object position adjustment, and synonym replacement.

[0086] During the generation process, the model strictly adheres to domain constraints and semantic consistency principles. All rewritten sentences must contain the original entity pairs, ensuring that the subject and object of the relationship are not replaced or omitted. Furthermore, the model intelligently incorporates typical expressions from the subject area, such as using professional terms such as "component" and "core module" to reconstruct sentences, avoiding generating expressions that are inconsistent with domain common sense. For multiple relationships in complex sentences, the model maintains the integrity of each sub-relationship, for example, rewriting "The system contains A and B" to "A and B together constitute the system's infrastructure."

[0087] This restatement mechanism significantly improves the generalization capability of subsequent relation extraction, providing rich synthetic samples for extracting relation and attribute triples. By exposing the model to the various possible expression variations generated in steps 3) and 4), the system can more accurately identify the same implicit relationship in the text.

[0088] To achieve the above purpose, set the instruction method as follows:

[0089]

[0090]

[0091] Where {sentence} and {relation} are the sentences generated in steps 1)-(2) and the triples annotated in the generated sentences. {k} is the number of rewritten sentences set manually, with k = 5 by default. A subject in the instruction template is replaced with the name of a specific subject.

[0092] Step 2): Extract knowledge point entities

[0093] In the stage of extracting knowledge point entities, the system guides the large language model to perform accurate term recognition tasks through professionally designed domain instructions. As an expert model in this subject area, when receiving the input text, it will strictly follow five core principles for entity extraction: First, the model will filter out all general vocabulary and non-professional terms, and only retain the core concepts with subject characteristics; Second, ensure that the extraction results are all in the form of complete nouns or noun phrases to avoid the fragmentation of terms; Third, adopt a standardized domain expression form to automatically correct non-standard expressions; Fourth, the output adopts a simple space-separated format and automatically removes duplicates; Finally, when there are no valid terms in the text, the model will return an empty string instead of generating false outputs. For example, in the field of knowledge engineering, when processing the text "Knowledge graph is a structured knowledge representation method", the model can accurately identify the professional term "knowledge graph", while ignoring non-term words such as "is" and "structured", and will not wrongly split "knowledge representation method" into "knowledge" and "representation method". This process is ensured by the dual guarantee of domain knowledge constraints and term library matching, ensuring that the extraction results are both complete and accurate, laying a reliable entity foundation for the subsequent construction of the knowledge graph. All outputs strictly maintain the standardized format required by the instructions, facilitating direct use in subsequent processing flows.

[0094] To achieve the above goals, the professional instruction method is set as follows:

[0095]

[0096] Among them, {text} is the original text of the knowledge point to be extracted. Replace a certain subject in the instruction template with the subject name of a specific discipline.

[0097] Step 3): Extract the knowledge point attribute triples

[0098] In the stage of extracting knowledge point attribute triples, the system adopts a multi-round dialogue mechanism to sequentially extract each predefined attribute relationship in the Schema. For each relationship type to be extracted (such as "is defined as", "content", etc.), the system initiates an independent dialogue round, and in this round, it specifically judges whether this specific relationship exists in the text. For example, in the field of knowledge engineering, taking the "is defined as" relationship as an example, the system will analyze whether there is a definition relationship between the identified entity in the text (such as "knowledge graph") and the context description (such as "a structured knowledge representation method"). If it exists, a standardized attribute triple will be generated (such as ("knowledge graph", "is defined as", "a structured knowledge representation method")), otherwise an empty value will be returned. Each round of dialogue injects the synthetic sample of the first step corresponding to this relationship as a reference, and strictly limits the processing to only the current relationship type to avoid interference between different relationships.

[0099] Through multiple rounds of conversations, the system traverses all the attribute relationship types in the Schema in sequence. By this divide-and-conquer strategy, it ensures that each potential relationship is independently verified, and finally integrates the results of all rounds to form a complete set of attribute triples. This method not only guarantees the accuracy of attribute extraction (each relationship is judged separately), but also ensures the completeness (covering all predefined relationship types), and at the same time strictly follows the JSON format output specification, facilitating subsequent automated processing.

[0100] To achieve the above goals, the conversation instructions for each round are set as follows:

[0101]

[0102] Among them, {relation} is the relationship type set in the Schema that needs to be judged in this round of conversation, {text}, {entities} are the original text and the output knowledge point entities input in step 2). {synthetic_samples} are the synthetic samples output in step 1), including the rewritten sentences and the triples containing {relation} in the sentences. Multiple synthetic samples can be input here. Replace a certain discipline in the instruction template with the discipline name of a specific discipline.

[0103] Step 4): Extract knowledge point relationship triples

[0104] Similar to step 3), in the stage of extracting relationship triples, the system also adopts a multi-round conversation mechanism to sequentially extract each non-attribute relationship type predefined in the Schema (such as "contains", "instance", "prerequisite", etc.). For each relationship type to be verified, the system initiates an independent conversation round, in which it specifically analyzes whether there is such a specific relationship between the entities already identified in the text. For example, in the field of knowledge engineering, taking the "contains" relationship as an example, the system will scan all entity pairs in the text (such as "knowledge graph" and "ontology mapping"), and if it finds that there is a contains relationship (such as "knowledge graph contains ontology mapping"), it will generate a standardized relationship triple (such as ("knowledge graph", "contains", "ontology mapping")); if not, it will return a null value. Each round of conversation also injects the synthetic samples corresponding to this relationship as reference examples, and strictly limits the processing to only the current relationship type to ensure the focus of judgment.

[0105] In the form of multiple rounds of conversations, the system sequentially traverses all non-attribute relationship types in the Schema. Through this step-by-step verification method, each potential relationship is independently evaluated, and finally the results of all rounds are integrated to form a complete set of relationship triples. This method strictly follows three constraints: the subject and object must both be recognized domain entities (not text descriptions), the predicate must strictly match the Schema definition, and the output must conform to the standard JSON format, thus ensuring the accuracy and standardization of relationship extraction and providing reliable structured relationship data for knowledge graph construction.

[0106] To achieve the above goals, the instructions for each round of conversation are set as follows:

[0107]

[0108] Among them, {relation} is the relationship type set in the Schema to be judged in this round of conversation, {text} and {entities} are the original text and the output knowledge point entities input in step 2). {synthetic_samples} is the synthetic sample output in step 1), including the rewritten sentence and the triple containing {relation} in the sentence. Multiple synthetic samples can be input here. Replace a certain discipline in the instruction template with the discipline name of a specific subject.

[0109] Step 5): Triple verification

[0110] In the triple verification stage, the system conducts strict quality control on the initially extracted triples through a multi-round iteration mechanism. The verification module first checks the standardization of the triple structure to ensure that the subject and object are both valid domain entities and the predicate strictly matches the predefined Schema relationship type; secondly, it evaluates the integrity of the content to confirm that there are no missing or redundant components; finally, it conducts a deep semantic consistency verification by comparing the triple with the original text to judge whether the relationship expression is accurate. When an error is found, the system will generate a structured output containing error analysis and correction suggestions.

[0111] If an error is found, the system will re-enter the corrected triple and the original text into the verification module for a second round of verification. This iterative process of verification - correction - re-verification will continue, and a complete correction history will be recorded for each iteration. Specifically, in each iteration: the system will save all correction records of the previous verification, compare the latest corrected version with the original text, re-evaluate using the same verification criteria, and finally generate a new verification conclusion.

[0112] The iterative process will terminate when any of the following conditions is met: a) a "Correct" is returned in a certain verification, b) the correction suggestions are exactly the same for two consecutive times but still fail the verification, c) the preset maximum number of iterations (default is 5 times) is reached.

[0113] Throughout the process, the system will strictly maintain the consistency of the verification criteria. Each iteration will fully execute three core checks: accuracy (Schema compliance), integrity (information completeness), and consistency (text matching). All intermediate corrected versions and verification results will be fully recorded to form a traceable verification chain to ensure that the finally output triples fully conform to the discipline standards.

[0114] To achieve the above goals, the verification instructions for each iteration are set as follows:

[0115]

[0116] {text} is the original input text, and {triples} are the triples extracted in steps 2) and 3). Replace a certain discipline in the instruction template with the discipline name of a specific discipline.

[0117] Step 6): Entity embedding and selection of candidate aligned entity pairs

[0118] Through entity embedding, entities and their attributes can be transformed into semantic vectors, facilitating subsequent similarity calculation and alignment operations. Through the selection of candidate aligned entity pairs, entity pairs that may represent the same concept in different texts can be identified, laying a foundation for further knowledge fusion and knowledge graph completion. The specific implementation steps are as follows:

[0119] (1) Fine-tune the pre-trained MPNet model with discipline knowledge

[0120] The MPNet model is a pre-trained language model based on the Transformer architecture, which combines Masked Language Modeling (MLM) and Permutation Language Modeling (PLM).

[0121] First, by inputting textbook, courseware, and exercise text data in a specific subject area, a domain-adaptive pre-trained corpus is formed. For example, text data is collected from textbooks in the field of computer science, such as "A knowledge graph is a structured method of knowledge representation". Then, for subsequent training tasks, the vocabulary in the input text is randomly masked and replaced with a special [MASK] token, e.g., "A knowledge graph is a [MASK] method of knowledge representation". Moreover, the sentence order in the input text is randomly permuted to generate permuted sentence pairs, e.g., "KG is used to represent the graph structure of knowledge" and "A knowledge graph is a structured method of knowledge representation".

[0122] Then, the following two tasks are separately carried out for fine-tuning training: 1. Masked Language Modeling (MLM): The MPNet model learns the semantic relationships between vocabulary by predicting the masked vocabulary. For example, for the sentence "A knowledge graph is a [MASK] method of knowledge representation", the model needs to predict "structured". 2. Permuted Sentence Pre-training (PLM): The MPNet model learns the structural relationships between sentences by predicting the original order of the sentences. For example, for the permuted sentence pair "KG is used to represent the graph structure of knowledge" and "A knowledge graph is a structured method of knowledge representation", the model needs to judge its original order.

[0123] Finally, the model parameters are updated through backpropagation. The above fine-tuning steps are repeated until the model converges on the subject area data or reaches the preset number of training epochs.

[0124] (2) The dynamic weighted pooling mechanism generates the comprehensive embedding vector of the entity

[0125] This process involves the following key links:

[0126] For each entity e, its various attributes a i (such as name, definition, content, etc.) are extracted. The MPNet model fine-tuned with subject knowledge is used to encode each attribute a i to generate the embedding vector h i , for example, for the entity "knowledge graph", its attributes may include the name "knowledge graph", the definition "a structured method of knowledge representation", and the English name "KnowledgeGraph". By encoding these attributes through the MPNet model, the corresponding embedding vectors can be obtained.

[0127] h i = MPNet(a i )

[0128] Then, the weight a i of each attribute is calculated:

[0129]

[0130] where q is the query vector and W is the weight matrix. These parameters are randomly initialized at the beginning and optimized through the training process. According to the weight αi, the comprehensive embedding vector v of the entity is generated. e :

[0131]

[0132] To learn the parameters q and W that can better represent the entity, the training phase needs to prepare labeled entity pair data. The labeled data contains the entity pairs of this discipline and their similarity labels (1 indicates the same concept, 0 indicates different concepts), and define the loss function. The binary cross-entropy loss is used to optimize the model parameters to ensure that the generated comprehensive embedding vector can correctly reflect the similarity between entities:

[0133] L = -y·log(sim(v1, v2)) - (1 - y)·log(1 - sim(v1, v2))

[0134] Calculate the gradients of the loss function with respect to q and W, and use the Adam optimization algorithm to update the parameters:

[0135]

[0136] where η is the learning rate. Through the above training process, the model can learn the optimal query vector q and weight matrix W, so as to dynamically allocate weights, enabling the model to generate high-quality comprehensive embedding vectors of entities.

[0137] (3) Select candidate aligned entity pairs

[0138] Calculate the cosine similarity of the comprehensive embedding vectors. For two entities e1 and e2, calculate the cosine similarity of their comprehensive embedding vectors v1 and v2:

[0139]

[0140] Select the entity pairs with similarity greater than 0.8 as candidate aligned entity pairs, denoted as (reference entity, candidate entity). This threshold of 0.8 can effectively reduce misjudgment while ensuring a high accuracy rate, ensuring that the aligned entity pairs have a high semantic consistency, thus achieving a good balance effect in practical applications.

[0141] Step 7): Heuristic attribute selection, entity alignment, knowledge fusion, and knowledge graph completion (1) Heuristic attribute selection

[0142] This process involves calculating the functionality, frequency, and recognizability of each attribute to select the attributes that are most helpful for entity alignment. The following are the detailed steps:

[0143] Form an entity set C consisting of all entities in the candidate entity pairs extracted in steps (6)-(3). e The set composed of all property triples of these entities is T att Calculate, for each entity in C e and each property a i the FunctionDegree:

[0144]

[0145] where h represents the head entity and v represents the attribute value. The numerator represents the number of entities having property a i and the denominator represents the total number of occurrences of property a i . The higher the FunctionDegree, the stronger the uniqueness of the attribute value; the FunctionDegree measures the discrimination ability of the attribute. If multiple entities share the same attribute value, the FunctionDegree of this attribute is low; conversely, if the attribute value is unique, the FunctionDegree is high.

[0146] Then calculate the Frequency of each property in the candidate entity set C e :

[0147]

[0148] Count the occurrence frequency of property a i in the candidate entity set C e ;

[0149] Finally, calculate the Identifiability of each property:

[0150] identy att (a i , C e ) = fun att (a i ) × freq att (a i , C e )

[0151] The Identifiability index combines the FunctionDegree and the Frequency. By comparing the Identifiability of all properties, finally select the top k properties with high Identifiability (such as "definition", "English name") as the input for subsequent alignment; k is default set to 5 and can be adjusted dynamically.

[0152] (2) Use large language models for knowledge alignment, knowledge fusion, and knowledge graph completion

[0153] In the knowledge fusion and completion stage, the system conducts in-depth semantic analysis based on the complete attribute sets of the candidate entity pairs obtained in step 6)-(3). The following operations are performed on all candidate entity pairs in sequence: The large language model first judges the semantic overlap degree of the core attributes determined in step 7)-(1), and comprehensively judges the concept identity in combination with domain knowledge. When it is determined to be the same entity, the system uses the name of the reference entity as the reference name, and adopts an intelligent merging strategy to integrate attribute information: preferentially retain the more complete definition, merge complementary content descriptions, and resolve attribute conflicts through domain knowledge arbitration, and finally generate a unified standard entity representation. For entity pairs with different concepts, the model analyzes the potential association patterns between their attributes, and infers the most likely semantic relationships (such as "premise", "complementary", etc.) from the predefined relationship Schema to generate conforming knowledge completion triples. If two entities are not aligned and have no potential relationship, an empty list is output. The whole process strictly follows the instruction constraints, and all outputs adopt the standardized JSON format to ensure the consistency of the processing logic and the interpretability of the results, including the complete processing results.

[0154] To achieve the above goals, the instructions for processing each pair of candidate entity pairs are set as follows:

[0155]

[0156] Among them, the attributes required to be input for the reference entity and the candidate entity are the key attributes judged and selected in step 7)-(1), and their attribute values are the attribute values of this entity extracted in step 3) and have passed the verification in step 5) to ensure accuracy. For the attribute fields of the reference entity and the candidate entity that were not captured in the previous extraction and verification processes, the system will default their values to be empty and will not participate in the entity alignment, knowledge fusion, or knowledge graph completion processes in step 6). Replace a certain discipline in the instruction template with the discipline name of a specific discipline.

[0157] It should be noted that the above embodiments are not used to limit the protection scope of the present invention. Equivalent transformations or substitutions made on the basis of the above technical solutions fall within the protection scope of the claims of the present invention.

Claims

1. A method for constructing a knowledge graph of subject textbooks using large language models, characterized in that, The method includes the following steps: 1) Introduce a self - prompting framework through three rounds of conversations. Specifically, in the first round of conversation, generate synonyms for the relationship types of the self - predefined Schema. The relationship Schema includes relationship types of attribute types and non - attribute types. The relationship types of attribute types include "entity_defined_as_text", "entity_content_text", "entity_English_name_text", and the relationship types of non - attribute types include "contains", "instance", "equivalent", "develops into", "premise", "realizes", "exercise". In the second round of conversation, generate sentences containing this relationship. The generated sentences and the triples containing relationships in the sentences are collectively called synthetic samples. In the third round of conversation, restate the sentences in the synthetic samples to generate diverse sentences and annotated relationship triples as prompts for subsequent extraction of knowledge - point attribute triples and relationship triples; 2) By inputting teaching material texts and instructions, guide the large - language model to extract core knowledge - point entities from teaching materials, exercises, and PPT texts, and output a list of knowledge - point entities; 3) Through multiple rounds of conversations, combined with the synthetic samples in step 1), extract knowledge - point attribute triples; 4) Through multiple rounds of conversations, combined with the synthetic samples in step 1), extract relationship triples between knowledge points; 5) Use a verification module to iteratively verify the extracted triples to ensure the accuracy, integrity, and consistency of the triples; 6) Fine - tune the pre - trained MPNet model with subject knowledge so that it can better understand the terms and semantics in a specific subject area, thereby generating more accurate entity embedding vectors; through a dynamic weighted pooling mechanism, use the MPNet model fine - tuned with subject knowledge to generate comprehensive embedding vectors of entities, dynamically allocate weights to improve the quality of entity embeddings; calculate the cosine similarity of the comprehensive embedding vectors, and select entity pairs with a similarity greater than 0.8 as candidate alignment entity pairs, denoted as (reference entity, candidate entity); 7) For the candidate entity pairs extracted in step 6), use a heuristic attribute selection method to screen highly discriminative attributes for entity alignment and knowledge fusion; use the large - language model to determine whether the entities represent the same concept and perform knowledge fusion or knowledge - graph completion.

2. The method for constructing a knowledge graph of subject textbooks using a large language model according to claim 1, characterized in that, The knowledge - point entities, knowledge - point attribute triples, knowledge - point relationship triples, and knowledge graph are defined as follows: Definition 1: Knowledge Point Entity: The knowledge point entity e = (E, d), where E ∈ ε is the name of the knowledge point, and ε = {E1, E2, …, E m} is a finite set of m knowledge point names, and d represents the definition of this knowledge point; Definition 2: Knowledge - point attribute triple: A knowledge - point attribute triple SPO is a set of triples (e, a, v), where e is a knowledge - point entity, a is an attribute relationship, and v is a specific text description; Definition 3: Knowledge - point relationship triple: A knowledge - point relationship triple SPO is a set of triples (e1, r, e2), where e1 and e2 are knowledge - point entities, and r is the relationship between the knowledge - point entities; Definition 4: Knowledge graph: A knowledge graph KG is a set of triples (e1, r, e2), where e1 and e2 are knowledge - point entities, and r is the relationship between the knowledge - point entities.

3. The method for constructing a knowledge graph of subject textbooks using a large language model according to claim 1, characterized in that, In step 1), generate synonyms for relationship types, synthetic samples, and restated sentences in the following way: 1-a) Input the predefined relationship types that conform to the Schema and their domain description texts into the large language model, and add an instruction to convey the following meaning: As an expert in the [subject] field, for a certain relationship type, whose description is: "", generate {k} synonyms or semantically equivalent expressions, so that the large language model outputs a list of synonyms for the relationship; 1-b) Input the relationship type and its domain description text into the large language model, and add an instruction to convey the following meaning: Based on the knowledge of [subject], generate sentences containing one or more of a certain relationship type. The number of sentences generated is set manually, and the triples are marked. Through the above input and processing, multiple synthetic samples are obtained, that is, the generated sentences and the triples marked in the sentences, for subsequent steps; 1-c) Input the synthetic samples output in 1-b) into the large language model, and add an instruction to convey the following meaning: Semantically equivalent restate the following sentences in the [subject] field, and the original triples in the sentences should be retained. Through the above input and processing, a set of restated sentences and the marked triples are obtained as synthetic samples for subsequent step prompts; 1-d) Perform the above steps for all relationships defined in the Schema until synthetic samples are generated for all relationship types.

4. The method for constructing a knowledge graph of subject textbooks using a large language model according to claim 1, wherein In step 2), extract knowledge point entities in the following way: 2-a) Input the textbook text content of a specific subject field into the large language model, and add an instruction to convey the following meaning: An expert in a certain subject field is specifically responsible for extracting core concepts and terms from the text to build a structured knowledge system. Please accurately identify the professional terms related to this subject from the input text. Through the above input and processing, the knowledge point entities of this subject are obtained.

5. The method for constructing a knowledge graph of subject textbooks using a large language model according to claim 1, characterized in that In step 3), extract knowledge point attribute triples in the following way: 3-a) For each predefined attribute relationship type, perform the following operations: 1) Prepare example samples of this relationship, including the synthetic sentences and marked triples generated in step 1-c); 2) Input the text to be processed and the list of identified entities; 3) Append an instruction to convey the following meaning: "Judge whether there is a [relationship type] relationship between [entity A] in the text. If so, extract the corresponding description"; Through the above input and processing, the attribute triples extracted from the text are obtained.

6. The method for constructing a knowledge graph of subject textbooks using a large language model according to claim 1, characterized in that, In step 4), extract knowledge point relationship triples in the following way: 4-a) For each predefined relationship type, perform the following operations: 1) Prepare example samples of this relationship, including the synthetic sentences and marked triples generated in step 1-c); 2) Input the text to be processed and the list of entities; 3) Append an instruction to convey the following meaning: "Analyze whether there is a certain relationship type between the input entities". If so, output the relationship triples, and output empty if not. Through the above input and processing, the knowledge point relationship triples are obtained.

7. The method for constructing a knowledge graph of subject textbooks using a large language model according to claim 1, characterized in that, In step 5), perform triple verification in the following way: 5-a) The input text and the initially extracted triples in the text are expressed by the following instructions: Determine whether there are errors in the extracted triples. If the triples are correct, output "Correct". If there are errors in the triples, output the incorrect triples and their corrected versions, and repeat the verification process until "Correct" is output or the maximum number of iterations is reached.

8. The method for constructing a knowledge graph of subject textbooks using a large language model according to claim 1, characterized in that, In step 6), the embedding model is used for entity embedding in the following manner: 6-a) Fine-tune the pre-trained MPNet model for subject knowledge. The specific steps are as follows: Collect textbook, courseware, and exercise text data in a specific subject area to form a domain-adaptive pre-trained corpus. Then, use the Masked Language Modeling (MLM) task to fine-tune the MPNet model. By randomly masking some words in the input text and letting the model predict the masked words, enhance the model's understanding ability of domain-specific terms. Finally, update the model parameters through backpropagation. Repeat the above fine-tuning steps until the model converges on the subject area data or reaches the preset number of training epochs. 6-b) Through the dynamic weighted pooling mechanism, use the MPNet model fine-tuned with disciplinary knowledge to generate the comprehensive embedding vector of the entity, and dynamically allocate weights to improve the quality of entity embedding; the specific steps are as follows: Initialize the query vector q and the weight matrix W, and these parameters will be optimized through the training process; for each entity e, extract its various attributes a i ; Use the MPNet model fine-tuned with disciplinary knowledge for each attribute a i to encode and generate the embedding vector hi: h i = MPNet(a i ) Then calculate the weight a of each attribute i : Generate the comprehensive embedding vector v of the entity according to the weight αi e : Prepare labeled entity pair data in the training phase. The labeled data includes the subject entity pairs and their similarity labels (1 indicates the same concept, 0 indicates different concepts), and define a loss function. Use Binary Cross-Entropy Loss to optimize the model parameters to ensure that the generated comprehensive embedding vectors can correctly reflect the similarity between entities: L = -y·log(sim(v1, v2)) - (1 - y)·log(1 - sim(v1, v2)) Calculate the gradients of the loss function with respect to q and W, and use the Adam optimization algorithm to update the parameters: where η is the learning rate. Through the above training process, the model can learn the optimal query vector q and weight matrix W. 6-c) Calculate the cosine similarity of the comprehensive embedding vectors. For two entities e1 and e2, calculate the cosine similarity of their comprehensive embedding vectors v1 and v2: Select entity pairs with a similarity greater than 0.8 as candidate alignment entity pairs, denoted as the reference entity, candidate entity.

9. The method for constructing a knowledge graph of subject textbooks using a large language model according to claim 1, wherein In step 7), perform heuristic attribute selection, entity alignment, knowledge fusion, and knowledge graph completion in the following manner: 7-a) Form an entity set C consisting of all entities in the candidate entity pairs extracted in step 6) e , and the set of all property triples of these entities is T att , calculate the Function Degree of each property a of each entity in C e : i ​ Among them, h represents the head entity, v represents the attribute value, and the numerator represents the number of entities having the attribute a i The denominator represents the total number of occurrences of the attribute a i The higher the functionality, the stronger the uniqueness of the attribute value; functionality measures the discrimination ability of an attribute. If multiple entities share the same attribute value, the functionality of this attribute is lower; conversely, if the attribute value is unique, the functionality is higher. 7-b) Calculate the frequency of each attribute in the candidate entity set C e : Among them, the numerator counts the number of entities in the candidate entity set C e that contain the attribute a i (obtained by retrieving the attribute triple set T att ), the denominator is the total number of candidate entities, and this formula counts the occurrence frequency of the attribute a i in the candidate entity set C e ; 7-c) Calculate the identifiability of each attribute: identy att (a i ,C e ) = fun att (a i ) × freq att (a i ,C e ) The identifiability metric combines functionality and frequency. Calculate the identifiability of all attributes, and finally select the top k highly identifiable attributes for subsequent alignment input. 7-d) Input the candidate entity pairs and their top k highly identifiable attributes into the large language model, and use instructions to guide the large language model to determine whether the entities represent the same concept. 7-e) If the entity pair represents the same concept, use the reference entity as the final name, merge the attribute information of the two entities, avoid redundancy, and retain the most complete and informative description, and output the merged entity and attributes. 7-f) If the entity pair does not represent the same concept, the large language model is guided by instructions to infer potential missing relationships, and the inferred relationship triples are output, requiring that the relationships conform to the predefined relationship Schema, which is used to complete the missing relationship triples in the knowledge graph. If there is no relationship, an empty list is output.

10. The method for constructing a knowledge graph of subject textbooks using a large language model according to claim 1, wherein The knowledge graph construction method is applicable to automatically extracting knowledge point triples from unstructured text and constructing a structured knowledge graph for the teaching and research of subject courses.

Citation Information

Cited By

  • Large model courseware automatic generation method based on LangChain framework

    CN120951977A

  • A large model courseware automatic generation method based on a LangChain framework

    CN120951977B

  • Knowledge graph construction method based on ontology and large language model

    CN120973960A

  • Hybrid course knowledge graph construction method and system based on large language model

    CN121189439A

  • Metro operation accident knowledge graph construction method and system, terminal and storage medium

    CN121189452A