Dynamic ontology construction method based on large model
Through the dynamic ontology construction method based on big models, the ontology update difficulties and relying on experts in the construction of traditional knowledge graphs are solved, the flexibility and timeliness of ontology are realized, and the construction of knowledge graphs is promoted.
Patent Information
- Application Number
- CN202411620830.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-03-25
AI Technical Summary
The problems of difficulty in ontology renewal, over-reliance on experts, poor flexibility and timeliness in the construction of traditional knowledge graphs.
Using a dynamic ontology construction method based on big models, the initial ontology is constructed, and the large language model is used for hierarchical expansion and knowledge expansion, the Prompt strategy is designed for real-time data extraction, and the merger and update of the ontology in the field is achieved through Function Calling technology.
It improves the flexibility and adaptability of ontology construction, promotes the construction of knowledge graphs, reduces dependence on experts, and achieves efficient updates of ontology.
Smart Images

Figure CN119691194A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of artificial intelligence, big models and knowledge graphs, and specifically relates to a dynamic ontology construction method based on big models. Background Art
[0002] Large Language Model (LLM) is trained based on massive data and has the characteristics of strong generalization and wide application. Large models represented by GPT have strong text generation and language understanding capabilities, and can greatly reduce the cost of manual annotation. However, as a "black box" model, it has poor interpretability, and the quality of the generated text is often uncontrollable in vertical professional fields.
[0003] As a structured expression of knowledge, knowledge graph has clear structure and interpretability, and is widely used in the fields of reasoning and question answering. As the core component of knowledge graph construction, ontology defines concepts and logical relationships between them, improves the interpretability and consistency of data, and not only provides a basis for the extraction of knowledge data, but also promotes the sharing and reuse of knowledge. The ontology construction of knowledge graph is often completed manually, relying on the experience of domain experts, with strong dependence on experts and poor portability. With the growth of massive data and the real-time update of demand, it is necessary to study dynamic ontology to ensure the flexibility and real-time performance of graph construction. At present, dynamic ontology generation technology is mainly based on object data model, formal background merging and other methods. The object-based data model method mainly defines complete objects and attribute types, and requires the regular expression of the parser to be written, which is difficult to implement in engineering; the formal background merging method mainly relies on the update of experimental data, which limits the expansion scope of the ontology.
[0004] Therefore, the present invention proposes a dynamic ontology construction method based on a large model. First, the initial ontology is constructed, and then the prompt engineering technology (PromptEngineering) of the large language model is used to realize the hierarchical expansion and knowledge expansion, and the prompt strategy is designed to extract the business data in real time. Finally, based on the semantic similarity algorithm, the function calling method is used to realize the update of the domain ontology. This method can integrate the upper-level ontology resource information and various multi-source data corpus information, improve the flexibility and adaptability of ontology construction, and promote the construction of knowledge graphs. Summary of the invention
[0005] 1. Technical issues to be resolved
[0006] The technical problem to be solved by the present invention is how to provide a dynamic ontology construction method based on a large model to solve the problems of difficulty in ontology updating, over-reliance on experts, poor flexibility and timeliness in the traditional graph construction process.
[0007] (II) Technical solution
[0008] In order to solve the above technical problems, the present invention proposes a dynamic ontology construction method based on a large model, which comprises the following steps:
[0009] Step S1, comprehensively utilize expert knowledge, historical experience, databases and industry standard data to define entity types, attributes and relationships, and construct an initial ontology O1 = (C1, P1, R1), where C1, P1, and R1 represent entity types, attributes, and relationships, respectively;
[0010] Step S2: With the help of the rich knowledge contained in the big model, the expansion from the big category to the subcategory is realized. On this basis, the subcategory knowledge is further extracted through the big model technology, and the definitions of entity objects, attributes, and relationships are dynamically expanded from top to bottom to form an ontology O2 = (C2, P2, R2);
[0011] Step S3: for the structured, semi-structured and unstructured data in the business data that are updated in real time, based on the few-sample prompt learning of the large model, the entity objects, attributes and relationships are updated in real time from the bottom up to form an ontology set O3 = (C3, P3, R3);
[0012] Step S4, realize the merging and updating of domain ontologies through the Function Calling technology based on LLM; define functions through word similarity calculation based on HowNet, let the big model perform mathematical calculations, realize the merging and updating of domain ontologies, and form an ontology set of O4=(C4,P4,R4).
[0013] (III) Beneficial effects
[0014] The present invention proposes a dynamic ontology construction method based on a large model. The present invention proposes a dynamic ontology construction method based on a large model, and its main advantages are as follows:
[0015] (1) A dynamic generation method of knowledge ontology based on the large language model Prompt is designed. The top-down concept expansion can better display the hierarchical relationship between concepts, while the bottom-up data mining increases the breadth and depth of concepts and improves the quality of ontology construction.
[0016] (2) A dynamic update method for the ontology based on the Function Calling large model technology is proposed, which improves the fusion efficiency and expands the capability boundary of the large model. By calling the external function interface, the work efficiency is improved and the accuracy and real-time performance of the output are ensured. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 Constructing a flow chart for the dynamic ontology of the present invention;
[0018] Figure 2 Expand schematics for hierarchical expansion based on large models;
[0019] Figure 3 Expanding schematics for subclass content based on large models;
[0020] Figure 4 This is a schematic diagram of knowledge extraction based on Prompt design;
[0021] Figure 5 The following is a calculation schematic diagram based on FunctionCalling. DETAILED DESCRIPTION
[0022] In order to make the purpose, content and advantages of the present invention more clear, the specific implementation methods of the present invention are further described in detail below in conjunction with the drawings and examples.
[0023] The technical problem to be solved by the present invention is how to provide a dynamic ontology construction method based on a large model, design a prompt strategy based on a large language model, and realize bottom-up and top-down dynamic ontology generation to solve the problems of difficulty in ontology updating, over-reliance on experts, poor flexibility and timeliness in the traditional graph construction process.
[0024] In order to solve the above technical problems, the present invention proposes a dynamic ontology construction method based on a large model, which comprises the following steps:
[0025] Step S1, comprehensively utilize expert knowledge, historical experience, databases and industry standard data to define entity types, attributes and relationships, and construct an initial ontology O1 = (C1, P1, R1), where C1, P1, and R1 represent entity types, attributes, and relationships, respectively;
[0026] Step S2: Since the domain concepts have a certain hierarchical structure, the expansion from the big category to the subcategory is realized with the help of the rich knowledge contained in the big model. On this basis, the subcategory knowledge is further extracted through the big model technology, and the definitions of entity objects, attributes, and relationships are dynamically expanded from top to bottom to form the ontology O2 = (C2, P2, R2);
[0027] Step S3: for the structured, semi-structured and unstructured data in the business data that are updated in real time, based on the few-sample prompt learning of the large model, the entity objects, attributes and relationships are updated in real time from the bottom up to form an ontology set O3 = (C3, P3, R3);
[0028] Step S4: The merging and updating of domain ontologies is mainly achieved through the Function Calling technology based on LLM. By defining functions based on the word similarity calculation of HowNet, the large model is used to perform precise mathematical calculations to achieve the merging and updating of domain ontologies, forming an ontology set of O4 = (C4, P4, R4).
[0029] Embodiment 1:
[0030] In order to make the purpose, content and advantages of the present invention more clear, the specific implementation methods of the present invention are further described in detail below in conjunction with the drawings and examples.
[0031] In order to meet the requirements of rapidity and accuracy of ontology construction under the conditions of rapid growth of massive multi-source heterogeneous data and realize dynamic maintenance and updating of knowledge, this patent designs a dynamic ontology construction method based on a large model, which mainly solves the following problems:
[0032] (1) As data are constantly updated, how to dynamically maintain and update the ontology and form a complete and clearly structured knowledge structure is an important challenge.
[0033] (2) Ontology updates are limited by existing computing resources and time constraints, and the efficiency of continuous dynamic updates is low. How to apply large language models to this process and ensure the efficiency and accuracy of generation is an urgent problem to be solved.
[0034] like Figure 1 As shown, the present invention proposes a dynamic ontology construction method based on a large model, and the specific process is as follows:
[0035] Step S1, comprehensively utilize expert knowledge, historical experience, databases and industry standard data to define entity types, attributes and relationships, and construct an initial ontology O1 = (C1, P1, R1), where C1, P1, and R1 represent entity types, attributes, and relationships, respectively;
[0036] Step S2: Since the domain concepts have a certain hierarchical structure, the expansion from the big category to the subcategory is realized with the help of the rich knowledge contained in the big model. On this basis, the subcategory knowledge is further extracted through the big model technology, and the definitions of entity objects, attributes, and relationships are dynamically expanded from top to bottom to form the ontology O2 = (C2, P2, R2);
[0037] Step S2.1: Hierarchical expansion
[0038] Considering the hierarchical structure of knowledge, we use large model prompt engineering technology, adopt zero-sample prompt technology to achieve the expansion of large categories to sub-category sets, and adopt few-sample prompt technology for classification and recognition. By giving a small number of examples, we can identify and judge the relationship between sub-categories. The specific implementation methods are as follows: Figure 2 As shown;
[0039] Step S2.2: Subcategory content extraction
[0040] In order to further explore the sub-class content, the zero-shot prompt technology is used to generate a detailed description of the sub-class. In order for the model to better understand the task requirements, the sub-class and its context description information are passed to the large model to expand the data volume and improve the reliability of the generated results. LLM is used to extract the key content of entities, attributes, and relationships. The specific implementation method is as follows: Figure 3 As shown;
[0041] Step S3: for the structured, semi-structured and unstructured data in the business data that are updated in real time, based on the few-sample prompt learning of the large model, the entity objects, attributes and relationships are updated in real time from the bottom up to form an ontology set O3 = (C3, P3, R3);
[0042] Step S3.1: Data extraction
[0043] Extract structured, semi-structured, and unstructured data that is updated in real time in business data;
[0044] Structured data extraction:
[0045] Entity relationship extraction for structured data such as form data and dictionaries in business data, mainly through relationship mapping through form fields in the database;
[0046] Semi-structured data extraction:
[0047] For semi-structured data such as log data, configuration files, and JSON fields in business data, the fields are extracted mainly through rule matching models and then passed to the subsequent text knowledge mining module;
[0048] Unstructured data extraction:
[0049] For unstructured data such as text data and manual materials in business data, preliminary processing is first carried out through text knowledge mining, and knowledge ontology extraction is achieved using large model technology;
[0050] Step S3.2: Extracting unstructured data
[0051] The result generated in step S3.1 above is used as input. The prompt strategy of the large language model, including requirement prompts and sample prompts, is used to transform the labeling task into a generation task to extract entity types, relations, and attributes. The prompt construction design is as follows: Figure 4 As shown;
[0052] Step S4: The merge and update of domain ontology is mainly achieved through the Function Calling technology based on LLM. The update of ontology is essentially the merge and update of entity, attribute and relationship concepts. In order to make the large model perform accurate mathematical calculations, the similarity function in the present invention
[0053] Concept_correlation is designed based on the word similarity calculation of HowNet. n} as an example, the implementation principle is as follows Figure 5 As shown, the attributes and relationships can be updated in the same way.
[0054] The semantic similarity calculation adopts the semantic similarity calculation algorithm of HowNet. Taking the merger of entity C1 and entity C2 as an example, the specific steps are as follows:
[0055] Step S4.1: Calculation of concept similarity
[0056] HowNet is a concept semantic system. In HowNet, each concept is described by a semantic primitive, including the first semantic primitive, other basic semantic primitives, relational semantic primitives, and symbolic semantic primitives. The similarity calculation between entity concept C1 and entity concept C2 is shown in the following formula. When the calculation result is less than the set threshold, it means that the similarity is low and can be added as a new concept. The set threshold is generally 0.75.
[0057]
[0058] Among them, β i Represents the proportion of different semantic similarities and satisfies ∑ i 4 =1 β i =1,sim j (p1,p2) represents the similarity between the sememe p1 and the sememe p2.
[0059] In HowNet, all sememes form a sememe tree based on the hierarchical relationship. Sememe similarity is calculated by semantic distance. The similarity between sememe p1 and sememe p2 is:
[0060]
[0061] Where d represents the distance between the sememes in the seme tree, and α is an adjustable factor, which is generally taken as the distance value when the sememe similarity is 0.5.
[0062] Step S4.2: Function definition and call
[0063] According to the above concept similarity calculation method, the function Concept_correlation is defined and the external API is designed. First, the user's Prompt is determined, the function is defined, the calling parameters are generated through the big model, the function is called and the calculation results are returned. The big model will integrate the calculation results into natural language and finally return the results required by the user.
[0064] The present invention proposes a dynamic ontology construction method based on a large model, the main advantages of which are as follows:
[0065] (1) A dynamic generation method of knowledge ontology based on the large language model Prompt is designed. The top-down concept expansion can better display the hierarchical relationship between concepts, while the bottom-up data mining increases the breadth and depth of concepts and improves the quality of ontology construction.
[0066] (2) A dynamic update method for the ontology based on the Function Calling large model technology is proposed, which improves the fusion efficiency and expands the capability boundary of the large model. By calling the external function interface, the work efficiency is improved and the accuracy and real-time performance of the output are ensured.
[0067] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A dynamic ontology construction method based on a large model, characterized in that: The method comprises the following steps: Step S1, comprehensively utilize expert knowledge, historical experience, databases and industry standard data to define entity types, attributes and relationships, and construct an initial ontology O1 = (C1, P1, R1), where C1, P1, and R1 represent entity types, attributes, and relationships, respectively; Step S2: With the help of the rich knowledge contained in the big model, the expansion from the big category to the subcategory is realized. On this basis, the subcategory knowledge is further extracted through the big model technology, and the definitions of entity objects, attributes, and relationships are dynamically expanded from top to bottom to form an ontology O2 = (C2, P2, R2); Step S3: for the structured, semi-structured and unstructured data in the business data that are updated in real time, based on the few-sample prompt learning of the large model, the entity objects, attributes and relationships are updated in real time from the bottom up to form an ontology set O3 = (C3, P3, R3); Step S4, realize the merging and updating of domain ontologies through the Function Calling technology based on LLM; define functions through word similarity calculation based on HowNet, let the big model perform mathematical calculations, realize the merging and updating of domain ontologies, and form an ontology set of O4=(C4,P4,R4).
2. The method for constructing a dynamic ontology based on a large model as claimed in claim 1, characterized in that: The S2 includes: Step S2.1: Hierarchical expansion Considering the hierarchical structure of knowledge, we use large model prompting engineering technology, adopt zero-sample prompting technology to achieve the expansion of large categories to sub-category sets, and adopt few-sample prompting technology for classification and recognition. By giving a small number of examples, we can identify and judge the relationship between sub-categories. Step S2.2: Subcategory content extraction A detailed description text of the subclass is generated through zero-shot prompting technology, by passing the subclass and its contextual description information to the large model, and LLM is used to extract the key contents of entities, attributes, and relationships.
3. The method for constructing a dynamic ontology based on a large model as claimed in claim 2, characterized in that: The S3 specifically includes: Step S3.1: Data extraction Extract structured, semi-structured, and unstructured data that is updated in real time in business data; Step S3.2: Extracting unstructured data The result generated in the above step S3.1 is used as input, and the Prompt prompt strategy of the large language model, including requirement prompts and sample prompts, is used to transform the labeling task into a generation task to realize the extraction of entity types, relations, and attributes.
4. The method for constructing a dynamic ontology based on a large model as claimed in claim 3, characterized in that: In S3.1, entity relationships of structured data in business data are extracted, and relationship mapping is performed through form fields in the database; Structured data includes: form data, dictionary.
5. The method for constructing a dynamic ontology based on a large model as claimed in claim 3, characterized in that: In S3.1, for the semi-structured data in the business data, the fields are extracted through the rule matching model and then passed to the subsequent text knowledge mining module; the semi-structured data includes: log data, configuration files, and JSON fields.
6. The method for constructing a dynamic ontology based on a large model as claimed in claim 3, characterized in that: In S3.1, the unstructured data in the business data is first processed preliminarily through text knowledge mining, and the knowledge ontology extraction is achieved using large model technology; the unstructured data includes: text data, manual materials.
7. The method for constructing a dynamic ontology based on a large model according to any one of claims 3 to 6, characterized in that: In S4, the semantic similarity calculation adopts the semantic similarity calculation algorithm of HowNet. For the merging of entity C1 and entity C2, the specific steps include: Step S4.1: Calculation of concept similarity In HowNet, each concept is described by a semantic primitive, including the first semantic primitive, other basic semantic primitives, relational semantic primitives, and symbolic semantic primitives. The similarity calculation between entity concept C1 and entity concept C2 is shown in the following formula. When the calculation result is less than the set threshold, it means that the similarity is low and the concept is added as a new concept: Among them, β i Represents the proportion of similarity of different semantic primitives, and satisfies sim j (p1,p2) represents the similarity between the sememe p1 and the sememe p2; Step S4.2: Function definition and call According to the above concept similarity calculation method, the function Concept_correlation is defined and the external API is designed. First, the user's Prompt is determined, the function is defined, the calling parameters are generated through the big model, the function is called and the calculation results are returned. The big model will integrate the calculation results into natural language and finally return the results required by the user.
8. The method for constructing a dynamic ontology based on a large model as claimed in claim 7, characterized in that: In HowNet, all sememes form a sememe tree based on the hierarchical relationship. Sememe similarity is calculated by semantic distance. The similarity between sememe p1 and sememe p2 is: Among them, d represents the distance between the sememes in the sememe tree, and α is an adjustable factor.
9. The method for constructing a dynamic ontology based on a large model as claimed in claim 8, characterized in that: α is the distance value when the original similarity is 0.
5.
10. The method for constructing a dynamic ontology based on a large model as claimed in claim 7, characterized in that: Set the threshold to 0.75.
Citation Information
Cited By
Ontology-based large language model self-evolution method and device
CN120471136A
Large model application construction method based on configurable workflow and domain knowledge base
CN120631869A
A Methodology for Building Large Model Applications Based on Configurable Workflows and Domain Knowledge Bases
CN120631869B
Large-model-driven unmanned aerial vehicle equipment training knowledge graph automatic construction method
CN121581162A
Ontology dynamic updating method and system based on large model
CN122795891A