Ontology construction system based on large model
Through the ontology construction system based on large models, the conversion from natural language to ontology is automatically handled, which solves the problem of insufficient automation in the existing technology, and realizes efficient and accurate ontology construction, adapts to knowledge construction tasks in different fields, and reduces the use threshold.
Patent Information
- Application Number
- CN202411201921.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2024-12-20
AI Technical Summary
The existing ontology construction tools are insufficient in automation and require too much manual intervention, which makes it difficult to improve the construction efficiency and quality and difficult to apply on a large scale.
Adopt the ontology construction system based on large models, including data set production module, large model fine-tuning module, quantitative deployment module and interactive interface. The big model is fine-tuned through natural language data sets to generate the expected big model, and realize automatic natural language to ontology Convert and provide interactive interface for output and adjustment.
It significantly reduces manual intervention, improves the efficiency and accuracy of building ontology, adapts to knowledge construction tasks in different fields, lowers the threshold for use, and allows non-professional users to participate in the ontology construction process.
Smart Images

Figure CN119167085A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software development, and in particular to an ontology construction system based on a large model. Background Art
[0002] In the computer field, ontology is a formal specification of a shared conceptual model. It is an important tool for knowledge reuse, knowledge sharing and modeling, and has a wide range of applications in intelligent information processing and natural language processing. Acquiring high-quality, structured knowledge is the basis for ontology creation, but it is difficult to extract knowledge from unstructured data. How to represent complex knowledge as a formalized ontology structure is a major problem. In addition, existing ontology construction tools are still insufficient in automation and require too much manual intervention. The construction efficiency and quality need to be improved, making them difficult to apply on a large scale. Summary of the invention
[0003] In order to solve the above problems existing in the prior art, the present invention provides an ontology construction system based on a large model, which solves the technical problem that the prior art requires too much manual intervention in the process of automatically constructing the ontology.
[0004] A large model-based ontology construction system, including a data set production module, a large model fine-tuning module, a quantitative deployment module and an interactive interface;
[0005] The data set making module is used to construct a natural text data set corresponding to the natural language and the ontology language;
[0006] The large model fine-tuning module is used to fine-tune the large model through the natural text data set to obtain the expected large model, and the expected large model is used to convert the natural language into ontology;
[0007] The quantization deployment module is used to quantize the expected large model and deploy the expected large model locally;
[0008] The interactive interface is used to input natural language into the expected large model, and then obtain and display the ontology output by the expected large model.
[0009] Furthermore, the expected large model is used to convert natural language into ontology, including:
[0010] The expected large model receives the natural language description input by the user, and parses the necessary information in the description, including key concepts, relationships, and instances, and then maps the necessary information to the structure of the ontology. Specifically, key concepts are mapped to classes, relationships are mapped to object attributes or data attributes, and instances are mapped to individuals. After the mapping is completed, a code that conforms to the specification is generated according to the mapping, and finally the code is serialized into Turtle format.
[0011] Furthermore, the interactive interface is also used to output a Turtle file, which can be opened in an ontology editing tool to view and further adjust the generated ontology structure to obtain a final ontology.
[0012] Furthermore, the natural text dataset construction process includes: selecting natural language related to the target domain from Internet resources, cleaning and preprocessing it, and converting it into an ontology, and integrating the natural language of the target domain with its corresponding ontology language as a natural text dataset.
[0013] Furthermore, the fine-tuning of the large model includes: dividing the natural text data set into a training data set and a verification data set, inputting the training data set into the basic large model for training, the training includes multiple rounds, each round traverses the entire training data set and gradually adjusts the weight of the model.
[0014] Furthermore, during the fine-tuning of the large model, a series of training examples are generated; each example includes a natural language description and a corresponding ontology representation; the loss is obtained by comparing the ontology output by the large model with the standard answer, and the large model parameters are optimized using the loss function; after the fine-tuning is completed, the generation ability of the large model is tested using a validation data set to ensure that it can accurately generate a standardized ontology structure from the natural language description; further tuning is performed for errors or deficiencies in the generation until the expected large model is obtained.
[0015] Furthermore, the quantization deployment module includes ll ama.cpp and oll ama, the ll ama.cpp is used to quantize the expected large model, and the oll ama is used to deploy the expected large model locally to provide an interface for subsequent calls.
[0016] Furthermore, the interactive interface includes a natural language input box, an ontology content output box, a generate ontology button and a file download button, wherein the natural language input box is used to input natural language, the generate ontology button is used to confirm the transmission of the natural language to the expected large model, the ontology content box is used to display the ontology file output by the expected large model, and the file download button is used to convert the ontology file displayed in the ontology content box into a Turt le file.
[0017] Furthermore, the ontology construction method includes:
[0018] Step 1: Enter the natural language description of the requirement in the natural language input box and click the Generate Ontology button after confirmation;
[0019] Step 2: Check whether the ontology file output in the ontology content output box meets expectations. If so, click the Download File button to obtain the corresponding Turtle file. If not, return to step 1.
[0020] Step 3: Input the Turtle file into the ontology editing tool to visually view and further adjust the generated ontology structure to obtain the final ontology.
[0021] The beneficial effects of the present invention include:
[0022] (1) The present invention uses a large model for ontology construction, which has significant advantages over traditional methods. The large model performs well in processing natural language and context understanding, can more accurately extract key concepts and relationships from natural language, and generate a knowledge structure diagram. In terms of the degree of automation, the large model can seamlessly execute the entire process from natural language to OWL text generation, reducing human intervention. At the same time, the present invention has stronger scalability and versatility, and is suitable for knowledge construction tasks in different fields, while traditional methods usually need to be customized for each new field. In addition, the large model used in the present invention performs well in processing large-scale data and complex relationship extraction, can automatically identify and generate complex knowledge relationships, and significantly improves the efficiency and accuracy of building the ontology. The use of the present invention makes the entire ontology construction process more efficient, accurate and adaptable.
[0023] (2) The present invention combines the automatically generated ontology with a professional ontology editing tool, which not only ensures the degree of automation but also provides flexible manual adjustment space, thereby ensuring the quality and practicality of the ontology.
[0024] (3) Provide a user interaction page, allowing users to input natural language descriptions and instantly obtain the corresponding TTL files. This lowers the usage threshold and allows non-professional users to participate in the ontology construction process. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 Workflow diagram for a large model-based ontology construction system.
[0026] Figure 2 This is a schematic diagram of the interactive interface involved in an embodiment of the present application.
[0027] Figure 3 This is a diagram showing the effect of viewing the OWL ontology involved in an embodiment of the present application in an ontology editing tool.
[0028] Figure 4 This is a flow chart of the ontology construction method involved in the embodiment of the present application. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0030] An ontology construction system based on a large model, such as Figure 1 As shown, it includes a data set production module, a large model fine-tuning module, a quantitative deployment module and an interactive interface; in this embodiment, the ontology is an OWL ontology;
[0031] The data set making module is used to construct a natural text data set corresponding to the natural language and the OWL ontology language;
[0032] The large model fine-tuning module is used to fine-tune the large model through the natural text data set to obtain the expected large model, and the expected large model is used to convert the natural language into the OWL ontology;
[0033] The quantization deployment module is used to quantize the expected large model and deploy the expected large model locally;
[0034] The interactive interface is used to input natural language into the expected large model, and then obtain and display the OWL ontology output by the expected large model, such as Figure 2 shown.
[0035] In another embodiment, the expected large model for converting natural language into OWL ontology includes:
[0036] The expected large model receives the natural language description input by the user, and parses the necessary information in the description, including key concepts, relationships, and instances, and then maps the necessary information to the structure of the OWL ontology. Specifically, key concepts are mapped to classes in OWL, relationships are mapped to object attributes or data attributes, and instances are mapped to individuals. After the response is completed, code that conforms to the OWL specification is generated according to the mapping, and finally the code is serialized into Turtle format.
[0037] In another embodiment, the interactive interface is used to output a Turtle file, which can be opened in an ontology editing tool to view and further adjust the generated ontology structure.
[0038] In another embodiment, the process of constructing the natural text data set includes: selecting natural language about the target field from Internet resources, cleaning and preprocessing, and converting it into OWL ontology, integrating the natural language of the target field with its corresponding OWL ontology language as the natural text data set. In this embodiment, the target field is the field of mobile phone manufacturing.
[0039] In another embodiment, the fine-tuning of the large model includes: dividing the natural text data set into a training data set and a verification data set, inputting the training data set into the basic large model for training, and the training includes multiple rounds, each round will traverse the entire training data set, and gradually adjust the weight of the model. Specifically, the basic large model is an llama3 model and a corresponding word segmenter. Before training, it also includes preparing a fine-tuning environment, installing PyTorch, Transformers library and Uns loth framework, and loading a pre-trained llama3 model and a corresponding word segmenter. Define training parameters, including training rounds (epochs), batch size (batch size), learning rate (learning rate), weight decay (weightdecay), etc.
[0040] In another embodiment, during the fine-tuning of the large model, a series of training examples are generated; each example includes a natural language description and a corresponding OWL ontology representation; the loss is obtained by comparing the OWL ontology output by the large model with the standard answer, and the large model parameters are optimized using the loss function; after the fine-tuning is completed, the generation capability of the large model is tested using a validation data set to ensure that it can accurately generate an ontology structure that complies with the OWL specification from the natural language description; further tuning is performed for errors or deficiencies that occur during the generation until the expected large model is obtained.
[0041] In another embodiment, the quantization deployment module includes ll ama.cpp and oll ama, wherein the l lama.cpp is used to quantize the expected large model, and the oll ama is used to deploy the expected large model locally to provide an interface for subsequent calls.
[0042] In another embodiment, the interactive interface includes a natural language input box, an ontology content output box, a generate ontology button, and a file download button, wherein the natural language input box is used to input natural language, the generate ontology button is used to confirm the transmission of natural language to the expected large model, the ontology content box is used to display the OWL ontology file output by the expected large model, and the file download button is used to convert the OWL ontology file displayed in the ontology content box into a Turtle file. Specifically, the front-end development uses the Python Web framework Flask to provide interactive pages.
[0043] In another embodiment, the ontology construction method, such as Figure 4 As shown, including:
[0044] Step 1: Enter the natural language description of the requirement in the natural language input box and click the Generate Ontology button after confirmation;
[0045] Step 2: Check whether the OWL ontology file output in the ontology content output box meets your expectations. If so, click the Download File button to obtain the corresponding Turt le file. If not, return to step 1.
[0046] Step 3: Input the Turtle file into the ontology editing tool to visually view and further adjust the generated ontology structure to obtain the final ontology.
[0047] The user can input natural language on the page, click the Generate Ontology button, call the Ollama interface and pass the user input to the interface, obtain the OWL ontology description language code displayed at the bottom of the page, click the Download File button, and call the interface to download the ontology file that conforms to Turtle syntax. Open the obtained file in the protégé software, such as Figure 3 As shown, the ontology structure can be checked and subsequent adjustments can be made. Through this page, users can input natural language descriptions and get the corresponding TTL files immediately, and the threshold for ontology construction is lowered, so that non-professional users can also participate.
[0048] In addition, professionals can also create data sets according to their own needs and fine-tune the large model to obtain the expected large model that better meets the expected effect for deployment.
[0049] In another embodiment, the ontology is an RDF ontology.
[0050] The above-mentioned embodiments only express the specific implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the protection scope of the present application. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the technical solution concept of the present application, and these all belong to the protection scope of the present application.
Claims
1. A large model-based ontology construction system, characterized in that: It includes a dataset creation module, a large model fine-tuning module, a quantitative deployment module, and an interactive interface; The data set making module is used to construct a natural text data set corresponding to the natural language and the ontology language; The large model fine-tuning module is used to fine-tune the large model through the natural text data set to obtain the expected large model, and the expected large model is used to convert the natural language into ontology; The quantization deployment module is used to quantize the expected large model and deploy the expected large model locally; The interactive interface is used to input natural language into the expected large model, and then obtain and display the ontology output by the expected large model.
2. According to claim 1, a large model-based ontology construction system is characterized in that: The expected large model for converting natural language into ontology includes: The expected large model receives the natural language description input by the user, and parses out the necessary information in the description, including key concepts, relationships, and instances, and then maps the necessary information to the structure of the ontology. Specifically, key concepts are mapped to classes, relationships are mapped to object attributes or data attributes, and instances are mapped to individuals. After the response is completed, a code that conforms to the specification is generated according to the mapping, and finally the code is serialized into the Turtle format.
3. The ontology construction system based on a large model according to claim 1, characterized in that: The interactive interface is also used to output a Turtle file, which can be opened in an ontology editing tool to view and further adjust the generated ontology structure to obtain a final ontology.
4. The ontology construction system based on a large model according to claim 1, characterized in that: The construction process of the natural text data set includes: selecting natural language related to the target field from Internet resources, cleaning and preprocessing, and converting it into an ontology, and integrating the natural language of the target field and its corresponding ontology language as a natural text data set.
5. The ontology construction system based on a large model according to claim 4, characterized in that: The fine-tuning of the large model includes: dividing the natural text data set into a training data set and a verification data set, inputting the training data set into the basic large model for training, and the training includes multiple rounds, each round traversing the entire training data set and gradually adjusting the weight of the model.
6. The ontology construction system based on a large model according to claim 5, characterized in that: During the fine-tuning process of the large model, a series of training examples are generated; each example includes a natural language description and the corresponding ontology representation; the loss is obtained by comparing the ontology output by the large model with the standard answer, and the loss function is used to optimize the large model parameters; after fine-tuning, the verification data set is used to test the generation ability of the large model to ensure that it can accurately generate a standardized ontology structure from the natural language description; further tuning is performed for errors or deficiencies in the generation until the expected large model is obtained.
7. The ontology construction system based on a large model according to claim 1, characterized in that: The quantization deployment module includes llama.cpp and ollama, wherein the l lama.cpp is used to quantize the expected large model, and the ol lama is used to deploy the expected large model locally to provide an interface for subsequent calls.
8. The ontology construction system based on a large model according to claim 1, characterized in that: The interactive interface includes a natural language input box, an ontology content output box, a generate ontology button and a file download button. The natural language input box is used to input natural language, the generate ontology button is used to confirm the transmission of natural language to the expected large model, the ontology content box is used to display the ontology file output by the expected large model, and the file download button is used to convert the ontology file displayed in the ontology content box into a Turtle file.
9. The ontology construction system based on a large model according to claim 8, characterized in that: Ontology construction methods include: Step 1: Enter the natural language description of the requirement in the natural language input box and click the Generate Ontology button after confirmation; Step 2: Check whether the ontology file output in the ontology content output box meets expectations. If so, click the Download File button to obtain the corresponding Turtle file. If not, return to step 1. Step 3: Input the obtained Turtle file into the ontology editing tool to visually view and further adjust the generated ontology structure to obtain the final ontology.
Citation Information
Patent Citations
Method and system for constructing, expanding and evaluating clinical practice guide ontology
CN117194677A
Method and device for constructing smart home body based on large model, and electronic equipment
CN117689020A
Prompt automatic generation method and system, terminal and medium
CN118485127A
Cited By
Method and system for automatically constructing ontology and business knowledge base by AI based on data directory
CN122529028A
