Special equipment standard knowledge graph construction method based on large language model
Through the special equipment standard knowledge graph construction method based on large language model, the problems of information omission and inefficiency in the construction of knowledge graphs in the special equipment field are solved, more efficient entity relationship recognition and extraction are achieved, and the intelligence of the knowledge graph is improved and Adaptability.
Patent Information
- Application Number
- CN202411258270.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2024-12-27
AI Technical Summary
The existing technology is difficult to effectively build a knowledge graph in the field of special equipment, especially in standard specifications with strong context dependence and diverse expressions, there are problems of information omissions and model overfitting, resulting in inefficient and scalable triple extraction. Poor sex.
Using the special equipment standard knowledge graph construction method based on large language models, the field vocabulary data is acquired and preprocessed, and the pre-trained model BERT is used for training, and combined with LoRA fine-tuning technology is used to recognize and extract entity relationships, and the field professional dictionary and depth are used. Learning models build a knowledge graph, and combine relational databases for storage and instantiation.
It improves the accuracy and efficiency of triple extraction, enhances the intelligence and refined construction capabilities of knowledge graphs, achieves a better understanding of complex semantic relationships and cross-domain adaptability, and promotes the intelligent development of knowledge graphs.
Smart Images

Figure CN119202268A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of knowledge graph construction, and in particular to a method for constructing a special equipment standard knowledge graph based on a large language model. Background Art
[0002] Knowledge graph is a graph structure that can represent entities and complex relationships between entities. It can play a good auxiliary role in many practical application scenarios, such as search engines, recommendation systems, and intelligent question and answer. By constructing a knowledge graph, we can extract and represent the entities and complex relationships between entities contained in the massive corpus accumulated within the industry, and perform logical reasoning based on the constructed graph. The core is to extract massive and scattered knowledge in a structured manner and link different entities through relationship representation. In the process of knowledge graph construction, triple extraction is a core task that aims to automatically identify and extract entities and their relationships from massive text data. This process lays a solid foundation for the construction of knowledge graphs and enables originally isolated knowledge fragments to be structured and associated in the form of triples. With the continuous enrichment of the number and types of triples in the graph, the knowledge graph can provide more comprehensive and accurate knowledge representation. This not only enhances the expressive power and coverage of the knowledge graph, but also provides powerful and reliable support for complex upper-level applications (such as intelligent question and answer, recommendation systems, and semantic search). At the same time, optimizing triple extraction technology can also improve the accuracy and efficiency of information extraction, and further promote the intelligent and automated development of knowledge graphs.
[0003] At present, the mainstream triple extraction technology for knowledge graph construction mainly relies on pre-trained language models, such as BERT, GPT, T5, etc. These models are first pre-trained on large-scale text data, and then fine-tuned to adapt to specific triple extraction tasks. This approach has shown excellent results in recent years. Through pre-training, these models are able to capture a wide range of semantic and contextual information, so that they can handle complex language phenomena. In addition, even when there is less labeled data, these pre-trained models can still show excellent performance, significantly improving the accuracy and efficiency of triple extraction. However, my country still lacks a unified standard semantic knowledge base, and the unified integration capabilities of various industry standards are poor.
[0004] Traditional methods are difficult to fully capture the complex semantic relationships in the field of special equipment, especially for standards and specifications with strong context dependence and diverse expressions, which are prone to information omissions; with the continuous updating of special equipment standards, traditional methods require frequent manual intervention to adjust rules or keyword lists, which is inefficient and error-prone; the lack of deep learning technology makes the construction process of the knowledge graph lack the ability of self-optimization and iteration, and it is difficult to adapt to complex and changing actual needs. The triple extraction technology based on the pre-trained language model requires professional field data for fine-tuning, and has problems such as high data construction cost and poor technical scalability due to possible overfitting of the model. In addition, limited by the performance of the current pre-trained language model, this technology cannot be widely used in specific practical scenarios, that is, the availability is not high, so a special equipment standard knowledge extraction and knowledge graph construction method is needed. Summary of the invention
[0005] In order to have a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. This summary is not intended to be a general review, nor is it intended to identify key / important components or to delineate the scope of protection of these embodiments. Its only purpose is to present some concepts in a simple form as a preface to the detailed description that follows.
[0006] The present invention proposes a method for constructing a special equipment standard knowledge graph based on a large language model, comprising:
[0007] A obtains a domain vocabulary data set of relevant standards in the field of special equipment, extracts and preprocesses the text content of the relevant standards of the domain vocabulary data set to form an original data file in text format; performs word segmentation processing and word frequency analysis on the original data file to obtain word segmentation fragments;
[0008] B uses the pre-trained model BERT to train the pattern layer to obtain a special equipment standard knowledge entity relationship joint extraction training model;
[0009] C fine-tunes the special equipment standard knowledge entity relationship joint extraction training model based on the LoRA fine-tuning technology, obtains the entity relationship attributes of each single sentence, and performs entity attribute relationship recognition and extraction;
[0010] D. Obtain candidate words with larger screening indexes according to the set screening conditions to form a domain professional dictionary;
[0011] E uses standard rules to extract entities and relationships from common standard elements in the standard; enhances questions related to special equipment based on preset prompts, performs entity recognition and relationship extraction on the core elements of the standard text based on deep learning models, and constructs the data layer of the knowledge graph after obtaining triples;
[0012] F uses a relational database to store the special equipment data source knowledge, and combines the pattern layer with the data layer of the knowledge graph in the graph database to obtain the instantiation of the knowledge graph.
[0013] Furthermore, the method for constructing the domain professional dictionary includes collecting all candidate words as an initial candidate word library; screening and filtering the initial candidate word library in combination with a customized domain stop dictionary, and the filtered initial candidate word library is recorded as the domain candidate word library; calculating the adjacent information entropy and enhanced mutual information of all candidate words in the domain candidate word library, adding the scores of the two as the screening index of the candidate words, arranging the candidate words in the domain candidate word library in descending order according to the screening index, and obtaining the candidate words ranked in the top K1 to construct the domain professional dictionary.
[0014] Furthermore, the method for acquiring the domain vocabulary data set includes acquiring special equipment knowledge text, preprocessing the special equipment knowledge text to obtain a training data set, and training a special equipment standard text classification model based on the training data set; acquiring text information related to special equipment standard vocabulary, and combining the trained special equipment standard text classification model to obtain a special equipment professional domain vocabulary data set.
[0015] Furthermore, the method of fine-tuning the special equipment standard knowledge entity relationship joint extraction training model based on LoRA fine-tuning technology includes further screening and reconstruction of the preprocessed data to generate high-quality structured data that conforms to the fine-tuning process, and secondly, selecting an open source large language model according to the actual software and hardware deployment situation. Based on the fine-tuning idea of LoRA, a LoRA layer is added to the special equipment standard knowledge entity relationship joint extraction training model and the original weights are frozen, and then the model is fine-tuned.
[0016] Furthermore, questions related to special equipment are enhanced based on the preset prompt; the enhanced questions are processed based on the pre-fine-tuned target special equipment large model to obtain target reply information; and according to the preset answer security interception strategy, it is determined whether the reply interception operation corresponding to the target reply information is currently triggered, so as to complete the question and answer operation based on the second judgment result obtained.
[0017] Furthermore, the original data text is segmented and word frequency statistics are performed in combination with the domain professional dictionary, and the segmented words are filtered in combination with the domain inactive dictionary, and high-frequency keywords are selected as common entities for risk prevention and control, and the common entities for risk prevention and control are unified.
[0018] Furthermore, in step A, the standard text of special equipment is collected by scanning paper standards and downloading from the platform; most of the files of special equipment are paper files, PDF files or picture files, and the non-text files in the standard text are converted into text files through OCR technology, and then manually cleaned to delete typos, add missing words, and remove irrelevant words.
[0019] Furthermore, the entity attribute relationship identification and extraction includes:
[0020] Obtain the decoded corpus, perform part-of-speech tagging on the corpus, construct a dependency path, and annotate the path according to the dependency annotation table;
[0021] Extract the core words, construct the subject-object structure, and use the core words as the relationship to find the subject and object as two entities.
[0022] In a second aspect, an embodiment of the present application further provides an electronic device, including:
[0023] A processor; and a memory arranged to store computer executable instructions, which when executed cause the processor to perform the method steps described in the first aspect.
[0024] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores one or more programs. When the one or more programs are executed by an electronic device including multiple applications, the electronic device executes the method steps described in the first aspect.
[0025] The technical solution provided by the embodiment of the present invention may have the following beneficial effects:
[0026] The present invention uses a large language model to better understand the context and background knowledge of business scenarios, handle ambiguity in language more intelligently, and achieve intelligent ambiguity resolution; utilizes the cross-domain adaptive capabilities of the large language model to improve the generalization ability of triple extraction technology in different fields; and understands and extracts more complex semantic relationships through a large language model to promote the intelligent and refined construction of knowledge graphs. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0028] Figure 1 It is a flowchart of a method for constructing a special equipment standard knowledge graph based on a large language model according to an exemplary embodiment. DETAILED DESCRIPTION
[0029] The following description and accompanying drawings fully illustrate specific embodiments of the present invention so that those skilled in the art can practice them. The examples represent possible variations only. Unless explicitly required, separate components and functions are optional, and the order of operations can vary. Parts and features of some embodiments may be included in or replace parts and features of other embodiments. The scope of the embodiments of the present invention includes the entire scope of the claims, and all available equivalents of the claims. In this article, each embodiment may be represented individually or generally by the term "invention", which is only for convenience, and if more than one invention is in fact disclosed, it is not intended to automatically limit the scope of the application to any single invention or inventive concept. In this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, without requiring or implying any actual relationship or order between these entities or operations. Moreover, the term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method or device including a series of elements includes not only those elements, but also other elements that are not explicitly listed. The various embodiments are described in a progressive manner herein, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. As for the structures, products, etc. disclosed in the embodiments, since they correspond to the parts disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method part.
[0030] The present invention will be further described below in conjunction with the accompanying drawings and embodiments:
[0031] The present invention proposes a method for constructing a special equipment standard knowledge graph based on a large language model, comprising:
[0032] A obtains a domain vocabulary data set of relevant standards in the field of special equipment, extracts and preprocesses the text content of the relevant standards of the domain vocabulary data set to form an original data file in text format; performs word segmentation processing and word frequency analysis on the original data file to obtain word segmentation fragments;
[0033] B uses the pre-trained model BERT to train the pattern layer to obtain a special equipment standard knowledge entity relationship joint extraction training model;
[0034] C fine-tunes the special equipment standard knowledge entity relationship joint extraction training model based on the LoRA fine-tuning technology, obtains the entity relationship attributes of each single sentence, and performs entity attribute relationship recognition and extraction;
[0035] D. Obtain candidate words with larger screening indexes according to the set screening conditions to form a domain professional dictionary;
[0036] E uses standard rules to extract entities and relationships from common standard elements in the standard; enhances questions related to special equipment based on preset prompts, performs entity recognition and relationship extraction on the core elements of the standard text based on deep learning models, and constructs the data layer of the knowledge graph after obtaining triples;
[0037] F uses a relational database to store the special equipment data source knowledge, and combines the pattern layer with the data layer of the knowledge graph in the graph database to obtain the instantiation of the knowledge graph.
[0038] In this embodiment, the method for constructing the domain professional dictionary includes collecting all candidate words as an initial candidate word library; screening and filtering the initial candidate word library in combination with a customized domain stop dictionary, and the filtered initial candidate word library is recorded as the domain candidate word library; calculating the adjacency information entropy and enhanced mutual information of all candidate words in the domain candidate word library, adding the scores of the two as the screening index of the candidate words, arranging the candidate words in the domain candidate word library in descending order according to the screening index, and obtaining the candidate words ranked in the top K1 to construct the domain professional dictionary.
[0039] In this embodiment, the method for acquiring the domain vocabulary data set includes acquiring special equipment knowledge text, preprocessing the special equipment knowledge text to obtain a training data set, and training a special equipment standard text classification model based on the training data set; acquiring text information related to special equipment standard vocabulary, and combining the trained special equipment standard text classification model to obtain a special equipment professional domain vocabulary data set.
[0040] In this embodiment, the method for fine-tuning the special equipment standard knowledge entity relationship joint extraction training model based on LoRA fine-tuning technology includes further screening and reconstructing the preprocessed data to generate high-quality structured data that conforms to the fine-tuning process, and secondly selecting an open source large language model according to the actual software and hardware deployment situation. Based on the fine-tuning idea of LoRA, a LoRA layer is added to the special equipment standard knowledge entity relationship joint extraction training model and the original weights are frozen, and then the model is fine-tuned.
[0041] In this embodiment, questions related to special equipment are enhanced based on a preset prompt; the enhanced questions are processed based on a large model of the target special equipment that has been fine-tuned in advance to obtain target reply information; and a judgment is made based on a preset answer security interception strategy whether a reply interception operation corresponding to the target reply information is currently triggered, so as to complete the question and answer operation based on the second judgment result obtained.
[0042] In this embodiment, the original data text is segmented and word frequency statistics are performed in combination with the domain professional dictionary, the segmented words are filtered in combination with the domain inactive dictionary, high-frequency keywords are selected as common entities for risk prevention and control, and the common entities for risk prevention and control are unified.
[0043] In this embodiment, in step A, the standard text of special equipment is collected by scanning paper standards and downloading from the platform; most of the files of special equipment are paper files, PDF files or picture files, and the non-text files in the standard text are converted into text files through OCR technology, and then manually cleaned to delete typos, add missing words, and remove irrelevant words.
[0044] In this embodiment, the entity attribute relationship identification and extraction includes:
[0045] Obtain the decoded corpus, perform part-of-speech tagging on the corpus, construct a dependency path, and annotate the path according to the dependency annotation table;
[0046] Extract the core words, construct the subject-object structure, and use the core words as the relationship to find the subject and object as two entities.
[0047] (1) LoRA-based industry large model fine-tuning technology
[0048] Taking into account the actual situation of insufficient professional data in the machinery industry, this application uses fine-tuning technology based on LoRA (Low-Rank Adaptation) to fine-tune the large language model. This method is particularly suitable for resource-constrained scenarios and can greatly improve the efficiency of fine-tuning. LoRA greatly reduces the number of parameters that need to be updated by introducing the low-rank matrix approximation method, and represents the weight matrix that needs to be fine-tuned as the product of two smaller matrices. The original weight parameters of the pre-trained model remain frozen, and only the newly added low-rank matrix is trained. This can greatly reduce the number of parameters that need to be updated during the fine-tuning process. At the same time, LoRA significantly reduces the parameters that need to be updated when fine-tuning the model, thereby reducing the demand for memory and computing resources.
[0049] The advantages of this method mainly include: high efficiency: despite the reduction in the number of parameters, LoRA can usually maintain model performance similar to traditional fine-tuning; pluggability: it can be easily combined with other fine-tuning techniques, such as hybrid fine-tuning or layer freezing technology; versatility: LoRA is particularly suitable for scenarios with limited computing resources, such as edge devices, mobile devices or other low-computing power environments; high cost-effectiveness: for the current large-scale pre-trained language models in the industry, LoRA can greatly reduce the cost of fine-tuning while ensuring performance.
[0050] The specific fine-tuning process mainly includes: first, further screening and reconstructing the pre-processed structured data to generate high-quality structured data that conforms to the fine-tuning process; secondly, selecting an open source large language model based on the actual software and hardware deployment situation, and based on the LoRA fine-tuning idea, adding a LoRA layer to the large language model and freezing the original weights, and then fine-tuning the model.
[0051] (2) Prompt construction technology based on regular expressions
[0052] After building the industry big model, we need to adapt the questions to the big model to get answers that meet business needs. The content of the questions asked to the big model is collectively called prompt. Building efficient prompts for industry big models to improve the efficiency of question answering is a key measure to increase the speed of generating entity triples for big models. The prompt construction technology based on regular expressions aims to design regular expressions according to specific business scenarios, and realize the automatic transformation from business needs to efficient prompts through regular expressions.
[0053] (3) Large model interface packaging technology based on RESTful style
[0054] In order to ensure the efficient operation of the process of extracting triples from a large model, the present invention proposes a large model interface packaging technology based on the RESTful style. This technology can structure and package the functional modules required by the business process for the fine-tuned industry large model, and provide a unified and standardized interface to the outside of the system to achieve user-free access to the industry large model. The main process is: first, define the resource type for the structured data such as entities and triples that need to be extracted and save them in a structured form such as JSON, then design an interface for the business-oriented prompt to ensure the efficiency and scalability of the interface, and finally design the functional modules and package the interface according to the actual business process to achieve unified routing access to the large language model.
[0055] 3. Intelligent construction technology of knowledge graph based on entity relationship alignment
[0056] By calling the industry big model interface, the entity triples required by the business can be generated, and then a complete industry knowledge graph can be built based on the triples. Triple entity relationship alignment is a key step in the construction of the knowledge graph, which involves unifying relationships that describe the same semantics in different data sources or different contexts. The goal of relationship alignment is to eliminate semantic redundancy and ensure that the relationships in the knowledge graph are consistent and unified. This technology mainly includes the following steps:
[0057] (1) Relationship Standardization
[0058] Different data sources may use different terms or syntax to represent the same relationship, so it is necessary to standardize the triplet relationship, that is, to map these semantically identical but differently expressed relationships into a standardized form. This technology uses the vocabulary ontology alignment method to achieve relationship standardization, that is, to use the existing vocabulary ontology to map different relationship terms into the same standard relationship.
[0059] (2) Semantic Similarity Calculation
[0060] Two relations may be very similar in semantics, but not exactly the same. By calculating semantic similarity, semantically similar relations can be automatically identified and aligned. This technology uses a semantic similarity algorithm based on word vectors to evaluate the semantic similarity between different relations, that is, using word embedding technology (such as Word2Vec, G loVe, BERT, etc.), the relations are represented as vectors, and then the cosine similarity or Euclidean distance between the relation vectors is calculated.
[0061] (3) Continuous iterative alignment of relationships
[0062] As the knowledge graph expands, new relationships may introduce new alignment issues. This technology uses a continuous iteration approach to continuously improve and update the relationship alignment strategy. Incremental alignment is performed on newly introduced data sources to avoid duplication of work, and ultimately achieve an iterative cycle of large language models and knowledge graph construction.
[0063] Data collection: collect safety standard texts related to special equipment by scanning paper standards, downloading from government and industry association websites, etc. These texts include PDF, images and paper files.
[0064] Preprocessing: Use OCR technology to convert non-text files into text files, and perform manual cleaning to remove typos, missing words, and irrelevant words to form a clean text data set.
[0065] Text classification model training: Based on the preprocessed special equipment knowledge text, a special equipment standard text classification model is trained.
[0066] Vocabulary dataset extraction: Using the trained classification model, professional field vocabulary is extracted from the text information related to the special equipment standard vocabulary to form a special equipment professional field vocabulary dataset
[0067] Word segmentation: Combine domain-specific dictionaries and stop dictionaries to perform word segmentation on the original data files and filter out irrelevant words.
[0068] Word frequency statistics: Perform word frequency statistics on the word segmentation results and filter out high-frequency keywords as common entities for risk prevention and control.
[0069] Application of pre-trained model: Use the BERT pre-trained model to train the segmented text to obtain the special equipment standard knowledge entity relationship joint extraction training model.
[0070] LoRA fine-tuning: Based on LoRA fine-tuning technology, the training model is fine-tuned to optimize the model's performance in extracting entity relationships of special equipment standard knowledge.
[0071] Part-of-speech tagging and dependency relationship construction: Tag the decoded corpus with part-of-speech, build the dependency path, and annotate according to the dependency tagging table.
[0072] Core word extraction and relationship construction: extract core words, build a subject-object structure, use the core words as the relationship to find the subject and object as two entities, and complete the recognition and extraction of entity attribute relationships.
[0073] Standard rule extraction: Use standard rules to extract entities and relationships from common standard elements in the standard.
[0074] Question enhancement and deep learning: Based on the preset prompt, questions related to special equipment are enhanced, and the deep learning model is used to perform entity recognition and relationship extraction on the core elements of the standard text to obtain triples.
[0075] Knowledge graph instantiation: The extracted triples are stored in a relational database, and the instantiation of the knowledge graph is constructed in the graph database in combination with the pattern layer.
[0076] Question enhancement and answering: Enhance special equipment-related questions based on the preset prompt, and use the fine-tuned target special equipment large model to process the enhanced questions and obtain the target answer information.
[0077] Security interception: Based on the preset answer security interception strategy, determine whether it is necessary to trigger the answer interception operation to ensure the accuracy and security of the question and answer system.
[0078] Quick search: Users can quickly retrieve relevant information on special equipment safety standards through the knowledge graph.
[0079] Intelligent Q&A: The system can automatically answer users' questions about special equipment safety standards.
[0080] Risk warning: Through the identification and extraction of common entities for risk prevention and control, early warning and prevention of special equipment safety risks can be achieved.
[0081] Example 2
[0082] Numerical fragmented knowledge (taking GB2811-2019 "Head Protection Safety Helmets" as an example): the triple data corresponding to the ontology (standardized object) - style (standard paragraph structure) - standard indicator is "safety helmets - quality (excluding accessories) - relative error between the actual quality of the product and the marked quality". The corresponding disclosure content of this indicator is "the relative error between the actual quality of the safety helmet product and the marked quality should not be greater than 5%".
[0083] The present application also includes a structure of an electronic device. At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. Among them, the memory may include a memory, such as a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage, etc. Of course, the electronic device may also include hardware required for other services.
[0084] The processor, the network interface and the memory may be interconnected via an internal bus, which may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an ELISA (Extended Industry Standard Architecture) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc.
[0085] The memory is used to store the program. Specifically, the program may include a program code, and the program code includes a computer operation instruction. The memory may include a memory and a non-volatile memory, and provides instructions and data to the processor.
[0086] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a data mining device for safety standard knowledge based on knowledge ontology theory at the logical level. The processor executes the program stored in the memory and is specifically used to execute any of the above-mentioned special equipment standard knowledge extraction and knowledge graph construction methods.
[0087] The present invention can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor can be a general-purpose processor, including a central processing unit, a network processor (Network Processor, NP), etc.; it can also be a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field-Programmab l eGate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0088] An embodiment of the present application also proposes a computer-readable storage medium, which stores one or more programs, and the one or more programs include instructions. When the instructions are executed by an electronic device including multiple applications, they execute any of the aforementioned special equipment standard knowledge extraction and knowledge graph construction methods.
[0089] It should be understood that the above scheme has presented the foregoing description of specific exemplary embodiments of the present invention for the purpose of illustration and description. It is not intended to exclude or limit the present invention to the precise form disclosed, and it is obvious that many modifications and changes are feasible in view of the above teachings. Select and describe exemplary embodiments to explain certain principles of the present invention and their practical application, so that other technical personnel in the field can make or use various exemplary embodiments of the present invention, and various alternatives and modifications thereof. Its purpose is that the scope of the present invention will be defined by the claims attached to the present invention and their equivalents.
[0090] It is to be understood that the above embodiments are merely exemplary embodiments used to illustrate the principles of the present invention, but the present invention is not limited thereto. For those of ordinary skill in the art, various modifications and improvements can be made without departing from the spirit and essence of the present invention, and these modifications and improvements are also considered to be within the scope of protection of the present invention.
Claims
1. A method for constructing a special equipment standard knowledge graph based on a large language model, characterized in that: include: A. Obtaining a domain vocabulary data set of relevant standards in the field of special equipment, extracting and preprocessing the text content of the relevant standards in the domain vocabulary data set to form an original data file in text format; Perform word segmentation and word frequency analysis on the original data file to obtain word segmentation fragments; B uses the pre-trained model BERT to train the pattern layer to obtain a special equipment standard knowledge entity relationship joint extraction training model; C fine-tunes the special equipment standard knowledge entity relationship joint extraction training model based on the LoRA fine-tuning technology, obtains the entity relationship attributes of each single sentence, and performs entity attribute relationship recognition and extraction; D. Obtain candidate words with larger screening indexes according to the set screening conditions to form a domain professional dictionary; E uses standard rules to extract entities and relationships from common standard elements in the standard; Based on the preset prompt, questions related to special equipment are enhanced, and based on the deep learning model, entity recognition and relationship extraction of the core elements of the standard text are performed to obtain triples and construct the data layer of the knowledge graph; F uses a relational database to store the special equipment data source knowledge, and combines the pattern layer with the data layer of the knowledge graph in the graph database to obtain the instantiation of the knowledge graph.
2. According to claim 1, a method for constructing a special equipment standard knowledge graph based on a large language model is characterized in that: The method for constructing the domain professional dictionary includes collecting all candidate words as an initial candidate word library; filtering the initial candidate word library in combination with a customized domain stop dictionary, and recording the filtered initial candidate word library as the domain candidate word library; Calculate the adjacency information entropy and enhanced mutual information of all candidate words in the domain candidate word library, add the scores of the two as the screening index of the candidate words, arrange the candidate words in the domain candidate word library in descending order according to the screening index, and obtain the candidate words ranked in the top K1 to form the domain professional dictionary.
3. According to claim 1, a method for constructing a special equipment standard knowledge graph based on a large language model is characterized in that: The method for acquiring the domain vocabulary data set includes acquiring special equipment knowledge text, preprocessing the special equipment knowledge text to obtain a training data set, and training a special equipment standard text classification model based on the training data set; The text information related to the special equipment standard vocabulary is obtained, and the special equipment professional field vocabulary dataset is obtained by combining the trained special equipment standard text classification model.
4. According to claim 1, a method for constructing a special equipment standard knowledge graph based on a large language model is characterized in that: The method for fine-tuning the special equipment standard knowledge entity relationship joint extraction training model based on LoRA fine-tuning technology includes further screening and reconstruction of the preprocessed data to generate high-quality structured data that conforms to the fine-tuning process, and secondly, selecting an open source large language model according to the actual software and hardware deployment situation. Based on the fine-tuning idea of LoRA, a LoRA layer is added to the special equipment standard knowledge entity relationship joint extraction training model and the original weights are frozen, and then the model is fine-tuned.
5. According to claim 1, a method for constructing a special equipment standard knowledge graph based on a large language model is characterized in that: Enhance special equipment related questions based on preset prompts; The enhanced problem is processed based on the pre-fine-tuned target special equipment large model to obtain target answer information; According to the preset answer security interception strategy, it is determined whether the answer interception operation corresponding to the target answer information is currently triggered, so as to complete the question and answer operation based on the second judgment result obtained.
6. The method for constructing a special equipment standard knowledge graph based on a large language model according to claim 1 is characterized in that: Combine professional dictionaries in the field to perform word segmentation and word frequency statistics on the original data text, and use the domain-specific dictionary to filter the segmented words, select high-frequency keywords as common entities for risk prevention and control, and unify the common entities for risk prevention and control.
7. The method for constructing a special equipment standard knowledge graph based on a large language model according to claim 1 is characterized in that: In step A, the standard text of special equipment is collected by scanning paper standards and downloading from the platform; most of the special equipment files are paper files, PDF files or image files, so the non-text files in the standard text are converted into text files through OCR technology, and then manually cleaned to delete typos, add missing words, and remove irrelevant words.
8. The method for constructing a special equipment standard knowledge graph based on a large language model according to claim 1 is characterized in that: The entity attribute relationship identification and extraction includes: Obtain the decoded corpus, perform part-of-speech tagging on the corpus, construct a dependency path, and annotate the path according to the dependency annotation table; Extract the core words, construct the subject-object structure, and use the core words as the relationship to find the subject and object as two entities.
9. An electronic device, comprising: processor; as well as, A memory arranged to store computer executable instructions, which when executed cause the processor to perform the method according to any one of claims 1 to 8.
10. A computer-readable storage medium storing one or more programs, which, when executed by an electronic device including a plurality of application programs, enables the electronic device to execute the method according to any one of claims 1 to 8.
Citation Information
Cited By
Digital base fusion system and electronic equipment
CN119760007A
Emergency response standard knowledge extraction method based on large language model
CN120821858A
Knowledge graph construction method and device and electronic equipment
CN121303278A
Semantic consistency-based aeronautical equipment environment test knowledge graph construction method and system
CN121365720A
Method and system for constructing aviation equipment environment test knowledge graph based on semantic consistency
CN121365720B
