Document-level knowledge extraction and fusion method and system based on large language model
By applying the document-level knowledge extraction and fusion method of large language models in the field of robotics, we solve the problem of knowledge extraction in document-level unstructured data in the field of robotics, achieve efficient and accurate knowledge extraction and fusion, and improve data quality and system performance. .
Patent Information
- Application Number
- CN202411561355.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-11-04
AI Technical Summary
In the field of robotics, it is difficult for the prior art to extract and integrate knowledge from document-level unstructured data efficiently and accurately, resulting in a low quality of information extraction.
Adopting document-level knowledge extraction and fusion methods based on large language models, by determining the scope of key information and establishing key dictionaries, the document is divided into paragraphs, and the user-consumer model integrates asynchronous architecture for knowledge extraction and fusion.
Realize efficient and accurate knowledge extraction and integration, improve data quality and extraction accuracy, reduce the difficulty of processing complex documents in large models, and improve the system's concurrent processing capacity and performance.
Smart Images

Figure CN119358546A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of industrial robots, and in particular to knowledge extraction and fusion of documents related to the robot field. Background Art
[0002] In the field of robotics, a detailed robot design plan usually includes everything from parts to components and even electrical design and control design. These plans cover a large amount of information such as drawings, BOMs, and design specifications. However, due to the large amount of information and inefficient retrieval methods, it is difficult to identify and use common or reusable components, which increases labor costs. Knowledge graphs are a good solution. Organizing a large number of design plans in a graph structure and establishing relationships between plans can effectively solve the above-mentioned problems.
[0003] However, how to mine the associations between solutions from the large amount of unstructured data in the design solution becomes the first problem to be solved. Traditional natural language processing algorithms often rely on a large amount of training data, and the processing effect of document-level unstructured data is poor, making it difficult to mine the required content efficiently and accurately. This is a common problem in the development of specialized domain knowledge graph systems.
[0004] In the prior art, the Chinese invention patent application "A method for extracting knowledge from unstructured text data based on a large language model" with publication number CN118036734A includes: step S1, performing named entity recognition on the acquired original document to obtain named entity candidates; step S2, performing named entity classification on the named entity candidates to determine the corresponding specific domain named entities; step S3, performing permutation and combination processing on the specific domain named entities to obtain multiple named entity pair candidates; step S4, performing subject completion processing on the original text; step S5, based on the relationship reasoning of the named entity pair candidates, using the subject-completed text, determine the corresponding entity relationship triple candidate. In step S1, the original document is segmented, and based on each segment, in response to the given first prompt information, the entity to be confirmed is extracted from the current document. It can be seen that the division of document-level unstructured data in this patent application is a simple division based on keywords. When extracting information from texts in the field of robotics, due to the presence of a large number of specialized nouns and complex sentence structures in the field of robotics, this method is difficult to accurately understand and extract key information. It does not have a strong ability to understand the field, and the quality of knowledge extraction in the field of robotics is low. Summary of the invention
[0005] The technical problem to be solved by the present invention is how to achieve efficient and accurate knowledge extraction and fusion in document-level unstructured data in the field of robotics.
[0006] The present invention solves the above technical problems through the following technical solutions: a document-level knowledge extraction and fusion method based on a large language model, comprising the following steps:
[0007] Step 1: Determine the scope of key information required and establish a keyword dictionary;
[0008] Step 2: Divide the document-level unstructured data into paragraphs according to the keyword dictionary to obtain the divided sub-documents;
[0009] Step 3: Use the asynchronous architecture of the producer-consumer model to build a software system, and use the software system to perform knowledge extraction tasks on the divided sub-documents in turn to extract key information from the unstructured data of the sub-documents;
[0010] Step 4: Integrate and classify all key information extracted from the same sub-document to obtain regular data, and then perform knowledge fusion processing on the regular data.
[0011] Beneficial effects: The present invention uses paragraphs as the minimum granularity, divides documents based on the degree of correlation between paragraphs and a keyword dictionary, integrates paragraphs with high correlation, that is, paragraphs with strong contextual relationships, and achieves high aggregation of sub-document content after division. Highly aggregated similar knowledge points can significantly improve data quality. It does not rely solely on simple keyword matching, but retains the structural relationship between paragraphs without destroying the contextual connection of the document. It can ensure that the information of the divided sub-documents is coherent and the structure is clear. The fine-grained processing method can ensure high accuracy of subsequent classification and knowledge extraction, thereby reducing the difficulty of large models in processing complex documents. By integrating the producer-consumer model in the large model, the decoupling design of the producer thread and the consumer thread can decompose the document processing task into independent knowledge extraction tasks, effectively avoiding system blocking, and improving the system's concurrent processing capability and system performance.
[0012] Preferably, the step 1 comprises:
[0013] 1.1. Collect key parameters and terms from product manuals, technical specifications and industry standards to obtain keywords;
[0014] 1.2. Define synonyms and related terms for each keyword;
[0015] 1.3. Dynamically update and maintain keyword dictionaries;
[0016] 1.4. Perform configuration management on keyword dictionary.
[0017] Beneficial effects: By defining synonyms and related terms for each keyword, and classifying and aggregating paragraphs according to keywords and synonyms, the aggregation of similar knowledge points is achieved, which not only simplifies the processing tasks of large models, but also improves data quality and the accuracy of knowledge extraction. The configurable management of keywords and their synonyms enables the system to have flexible dynamic update capabilities, allowing the system to adapt to the ever-changing and expanding knowledge base, and ensuring the accuracy and comprehensiveness of keyword matching.
[0018] Preferably, the step 2 comprises:
[0019] 2.1. Load document-level unstructured data into the system;
[0020] 2.2. Use document parsing tools to segment document-level unstructured data so that each paragraph or sentence in the document becomes an independent processing unit;
[0021] 2.3. The system scans the text in each paragraph or sentence, looking for terms or phrases that match entries in the keyword dictionary;
[0022] 2.4. Calculate the relevance between paragraphs based on keyword matching results and the structural relationship between paragraphs;
[0023] 2.5. Divide the document into several sub-documents according to the relevance between paragraphs;
[0024] 2.6. Store the divided sub-documents and generate structured output.
[0025] Beneficial effects: The relevance not only relies on simple keyword matching, but also performs deep semantic understanding through context analysis. The system will comprehensively calculate the relevance based on the keyword frequency, context semantics, and paragraph position in the paragraph, ensuring that the relevance calculation is not just based on surface vocabulary matching, but can reflect the logical and thematic connections between paragraphs. In addition to keyword matching, the system also analyzes the logical structure between paragraphs, such as the position of paragraphs in the document, the relationship between the front and the back, etc. This information accounts for a certain proportion in the relevance calculation. This ensures that the system can retain the overall structure of the document when dividing paragraphs without destroying its contextual connection, so that the relevance calculation not only relies on surface keyword matching, but also introduces deep semantic understanding and paragraph structure retention, thereby greatly improving the accuracy of paragraph division and relevance calculation.
[0026] Preferably, the calculation of the relevance between paragraphs based on the keyword matching results and the structural relationship between paragraphs comprises the following steps:
[0027] 2.4.1. Let paragraph P i and paragraph P j The keyword sets in are K i , Kj , keyword k in paragraph P i 、Paragraph P j The weights in are W(k, P i )、W(k,P j ), the calculation formula is:
[0028]
[0029] Among them, f(k,P i )、f(k,P j ) respectively represent the keyword k in paragraph P i 、Paragraph P j The frequency of occurrence in Respectively represent paragraphs P i 、Paragraph P j The sum of the occurrence frequencies of all keywords in ;
[0030] 2.4.2. Based on the importance of keywords in the field, the weight of keywords is modified. The modified keyword k is placed in paragraph P. i 、Paragraph P j The weight W′(k, P i ), W′(k,P j ) are:
[0031] W′(k,P i )=W(k,P i )·I(k),W′(k,P j )=W(k,P j )·I(k)
[0032] Among them, I(k) is the domain importance weight of keyword k;
[0033] 2.4.3. Calculate paragraph P based on the corrected keyword weights i and paragraph P j The similarity Sim(P i , P j ):
[0034]
[0035] 2.4.4. Calculate paragraph P i and paragraph P j The structural relationship weight S(P i , P j ):
[0036]
[0037] Among them, α is the adjustment parameter;
[0038] 2.4.5. Based on paragraph P i 、Paragraph P j The similarity Sim(P i , P j ) and structural relationship weight S(P i , P j ), calculate paragraph P i and paragraph P j The correlation between R(P i , P j ):
[0039] R(P i , P j )=β·Sim(P i , P j )+(1-β)·S(P i , P j )
[0040] Among them, β is the weighting parameter.
[0041] Preferably, the step three comprises:
[0042] 3.1. Deliver the divided sub-documents to the producer thread through the network. The producer thread stores the feature information of the divided sub-documents into the Redis message queue according to the generation order of the sub-documents.
[0043] 3.2. The consumer thread obtains tasks from the Redis message queue and delivers the tasks to the large model for knowledge extraction;
[0044] 3.3. Select a large model based on specific application requirements and hardware conditions;
[0045] 3.4. Customize the relationship list of the model according to specific application requirements. Based on the relationship list, extract the relationship between entities in the divided sub-documents and output them in a structured format.
[0046] Beneficial effects: Through the integration of the producer-consumer model and the asynchronous architecture, the producer thread puts the task into the message queue, and the consumer thread takes the task out of the queue and processes it, which effectively solves the problem of computing power limitation and waiting time, significantly improves the system's concurrent processing capability and overall efficiency, and ensures that when the system processes a large number of complex documents, it can reduce the computing load of the model while ensuring the quality of information extraction, so as to better meet the actual application needs. In addition, by dynamically adjusting the number of consumer threads, the hardware load is maintained at an ideal level, improving system stability.
[0047] Preferably, the step three also includes a process of performing secondary training on the model using proprietary texts in the field of robotics and a process of optimizing the relationship extraction capability of the secondary trained model. The process of performing secondary training on the model using proprietary texts in the field of robotics includes:
[0048] 3.5.1. Collect proprietary texts in the field of robotics, which cover relevant terms, technical parameters, and usage scenarios in the field of robotics;
[0049] 3.5.2. Clean and label the collected robot-specific texts;
[0050] 3.5.3. Use the labeled data to train the large model again;
[0051] The process of optimizing the relationship extraction capability of the model after secondary training includes:
[0052] 3.6.1. In the field of robotics, clarify the types of relationships between entities that need to be identified;
[0053] 3.6.2. Label the entities and their relationships in the data, and define the head entity, relationship, and tail entity;
[0054] 3.6.3. Input the labeled data into the model after secondary training for optimization training. During the optimization training process, the weights are continuously adjusted to learn how to identify different relationship triplets and output these relationships in a structured manner.
[0055] Beneficial effects: By using proprietary texts in the field of robotics to conduct secondary training on the large model, the large model can better adapt to the terminology and expressions in the field of robotics and enhance entity recognition capabilities. By introducing specific data in the field of robotics for retraining, the large model can more accurately understand and extract key information related to robots, and improve the quality and accuracy of the data extraction results of the large model. On the basis of the secondary training of the model, the model is further trained from the perspective of association relationships, making the model more intelligent and efficient when processing complex texts, which not only improves the ability to understand and extract proprietary domain information, but also enhances the accuracy of information generation and analysis. After secondary training on dedicated data sets and deep training on association relationships, the model has a stronger ability to understand the field.
[0056] Preferably, the step 4 comprises:
[0057] 4.1. Extract the attribute name and attribute value of each attribute triple;
[0058] 4.2. Use the similarity algorithm to remove duplicate information between attribute triples and existing knowledge graphs and construct new attribute triples.
[0059] Beneficial effects: By processing various triple information from different data sources, analyzing, integrating, deduplicating, and disambiguating it with the existing data in the graph database, we can finally obtain triples that can be stored in the database, effectively integrating information from different data sources, and building a more comprehensive, accurate, and valuable knowledge system, providing a reliable foundation for subsequent data analysis and application.
[0060] The present invention also provides a document-level knowledge extraction and fusion system based on a large language model, including:
[0061] Keyword building module, used to determine the scope of required key information and build a keyword dictionary;
[0062] The document segmentation module is used to segment the document-level unstructured data into paragraphs according to the keyword dictionary to obtain the segmented sub-documents;
[0063] The knowledge extraction module is used to build a software system using the asynchronous architecture of the producer-consumer model to integrate the large model. The software system is used to perform knowledge extraction tasks on the divided sub-documents in turn to extract key information from the unstructured data of the sub-documents.
[0064] The knowledge fusion module is used to integrate and classify all key information extracted from the same sub-document to obtain regular data, and then perform knowledge fusion processing on the regular data.
[0065] Preferably, the document division module is also used for:
[0066] 2.1. Load document-level unstructured data into the system;
[0067] 2.2. Use document parsing tools to segment document-level unstructured data so that each paragraph or sentence in the document becomes an independent processing unit;
[0068] 2.3. The system scans the text in each paragraph or sentence, looking for terms or phrases that match entries in the keyword dictionary;
[0069] 2.4. Calculate the relevance between paragraphs based on keyword matching results and the structural relationship between paragraphs;
[0070] 2.5. Divide the document into several sub-documents according to the relevance between paragraphs;
[0071] 2.6. Store the divided sub-documents and generate structured output.
[0072] Preferably, the calculation of the relevance between paragraphs based on the keyword matching results and the structural relationship between paragraphs comprises the following steps:
[0073] 2.4.1. Let paragraph P i and paragraph Pj The keyword sets in are K i , K j , keyword k in paragraph P i 、Paragraph P j The weights in are W(k, P i )、W(k,P j ), the calculation formula is:
[0074]
[0075] Among them, f(k,P i )、f(k,P j ) respectively represent the keyword k in paragraph P i 、Paragraph P j The frequency of occurrence in Respectively represent paragraphs P i 、Paragraph P j The sum of the occurrence frequencies of all keywords in ;
[0076] 2.4.2. Based on the importance of keywords in the field, the weight of keywords is modified. The modified keyword k is placed in paragraph P. i 、Paragraph P j The weight W′(k, P i ), W′(k,P j ) are:
[0077] W′(k,P i )=W(k,P i )·I(k),W′(k,P j )=W(k,P j )·I(k)
[0078] Among them, I(k) is the domain importance weight of keyword k;
[0079] 2.4.3. Calculate paragraph P based on the corrected keyword weights i and paragraph P j The similarity Sim(P i , P j ):
[0080]
[0081] 2.4.4. Calculate paragraph P i and paragraph P j The structural relationship weight S(P i , P j ):
[0082]
[0083] Among them, α is the adjustment parameter;
[0084] 2.4.5. Based on paragraph P i 、Paragraph P j The similarity Sim(P i , P j ) and structural relationship weight S(P i , P j ), calculate paragraph P i and paragraph P j The correlation between R(P i , P j ):
[0085] R(P i , P j )=β·Sim(P i , P j )+(1-β)·S(P i , P j )
[0086] Among them, β is the weighting parameter.
[0087] Preferably, the knowledge extraction module is also used for:
[0088] 3.1. Deliver the divided sub-documents to the producer thread through the network. The producer thread stores the feature information of the divided sub-documents into the Redis message queue according to the generation order of the sub-documents.
[0089] 3.2. The consumer thread obtains tasks from the Redis message queue and delivers the tasks to the large model for knowledge extraction;
[0090] 3.3. Select a large model based on specific application requirements and hardware conditions;
[0091] 3.4. Customize the relationship list of the model according to specific application requirements. Based on the relationship list, extract the relationship between entities in the divided sub-documents and output them in a structured format.
[0092] Preferably, the knowledge extraction module further includes a secondary training unit and a relationship extraction capability training unit, wherein the secondary training unit is used to perform secondary training on the model using proprietary texts in the field of robotics, specifically including the following process:
[0093] 3.5.1. Collect proprietary texts in the field of robotics, which cover relevant terms, technical parameters, and usage scenarios in the field of robotics;
[0094] 3.5.2. Clean and label the collected robot-specific texts;
[0095] 3.5.3. Use the labeled data to train the large model again;
[0096] The relationship extraction capability training unit is used to optimize the relationship extraction capability of the model after secondary training, which specifically includes the following process:
[0097] 3.6.1. In the field of robotics, clarify the types of relationships between entities that need to be identified;
[0098] 3.6.2. Label the entities and their relationships in the data, and define the head entity, relationship, and tail entity;
[0099] 3.6.3. Input the labeled data into the model after secondary training for optimization training. During the optimization training process, the weights are continuously adjusted to learn how to identify different relationship triplets and output these relationships in a structured manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0100] Figure 1 A flowchart of a document-level knowledge extraction and fusion method based on a large language model provided by an embodiment of the present invention;
[0101] Figure 2 A workflow diagram of a knowledge extraction module in a document-level knowledge extraction and fusion system based on a large language model provided by an embodiment of the present invention;
[0102] Figure 3 A workflow diagram of a knowledge fusion module in a document-level knowledge extraction and fusion system based on a large language model provided by an embodiment of the present invention;
[0103] Figure 4 A rendering of the document-level knowledge extraction and fusion method based on a large language model provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0104] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the technical solution of the present invention is clearly and completely described below in combination with specific embodiments and with reference to the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0105] Open source or commercial large models usually provide general functions, such as text generation, dialogue systems, content summarization, etc., and have a certain degree of information extraction capabilities. However, when faced with text extraction tasks in special fields (such as the robotics field), their performance is not outstanding. The main reason is that there are a large number of professional terms and complex sentence structures in these fields, which makes it difficult for general models to accurately understand and extract key information. In this regard, the present invention proposes a document-level knowledge extraction and fusion method and system based on a large language model.
[0106] Example 1
[0107] like Figure 1 As shown, this embodiment provides a document-level knowledge extraction and fusion method based on a large language model, including the following steps:
[0108] Step 1: Determine the scope of key information required and establish a keyword dictionary.
[0109] In the field of robotics, people usually pay more attention to the design indicators, performance parameters and component information of a product. These parameters intuitively reflect the performance, power consumption and composition of the product. Design indicators usually include size, weight, material and manufacturing process, performance parameters include speed, accuracy, power consumption and durability, and component information includes the various components of the product and their relationships. Through design indicators, performance parameters and component information, users can quickly evaluate whether the product meets their needs and determine whether the components can be reused, so as to make more reasonable decisions. Based on these needs, creating a dictionary containing keywords and synonyms becomes the starting point. The establishment of these keyword dictionaries can not only be used for document parsing and classification, but also for subsequent data mining and knowledge extraction.
[0110] Step 1 specifically includes the following processes:
[0111] 1.1. Collect key parameters and terms: Collect common design indicators, performance parameters and component terms from product manuals, technical specifications and industry standards. These parameters and terms will form the core of the keyword dictionary.
[0112] The key parameters commonly used in the field of robotics include degrees of freedom, grasping weight, load, workspace, maximum range of motion, repeatability, positioning accuracy, resolution, power capacity, etc. By summarizing and classifying the key parameters commonly used in the field of robotics and brainstorming with the team to find out the gaps, we can obtain more complete key information.
[0113] 1.2. Define synonyms and related terms: Define synonyms and related terms for each keyword to ensure the comprehensiveness and accuracy of the keyword dictionary and to ensure that the system can adapt to different usage habits and industry standards. For example, "degree of freedom" and "number of degrees of freedom" are synonyms, and power consumption can include synonyms such as "energy consumption" and "power consumption".
[0114] 1.3. Dynamically update and maintain keyword dictionaries. With the development of technology and the launch of new products, keyword dictionaries need to be regularly updated and maintained, adding new terms and deleting outdated words to maintain their timeliness and practicality.
[0115] 1.4. Perform configuration management on the keyword dictionary so that the keyword dictionary can be flexibly called and updated in the system, ensuring that the system can be quickly adapted in different scenarios and improving the adaptability and flexibility of the system.
[0116] Step 2: Divide the document-level unstructured data into paragraphs according to the keyword dictionary to obtain the divided sub-documents. The specific process includes the following:
[0117] 2.1. Load document-level unstructured data: Load the unstructured data documents to be processed into the system. The document formats include but are not limited to docx, pdf, txt, etc.
[0118] 2.2. Parsing document content: Use document parsing tools to convert document content into a processable text format. Parsing tools can be python-docx, PyPDF2, etc. The parsing tool divides the document into paragraphs or sentences, making each paragraph or sentence an independent processing unit. By dividing the document into the smallest units by paragraphs or sentences, the document content can be processed in a more fine-grained manner, which helps to improve the accuracy of subsequent classification and extraction.
[0119] 2.3. Perform keyword matching on the parsed text content. The system scans the text in each paragraph or sentence, looking for terms or phrases that match entries in the keyword dictionary. During the matching process, the system will consider synonyms of the keywords to ensure comprehensive coverage.
[0120] 2.4. Calculate the correlation between paragraphs based on keyword matching results and the structural relationship between paragraphs: The system will dynamically assign weights to different paragraphs based on the frequency of keyword appearance in the paragraph, contextual semantics, paragraph position, and the importance of keywords, and calculate the correlation between paragraphs based on the structural relationship between paragraphs.
[0121] The specific process of calculating the relevance between paragraphs based on keyword matching results and the structural relationship between paragraphs includes:
[0122] 2.4.1. Keyword matching calculation: The system first calculates the keyword matching in each paragraph and assigns weights to the keywords based on their frequency of occurrence and their importance in the context.
[0123] Suppose paragraph P i and paragraph P j The keyword sets in are K i , K j , keyword k in paragraph P i The weight in is W(k,P i ), weight W(k,P i ) is calculated as:
[0124]
[0125] Among them, f(k,P i ) indicates that keyword k is in paragraph P i The frequency of occurrence in Indicates paragraph P i The sum of the occurrence frequencies of all keywords in .
[0126] Similarly, keyword k in paragraph P j The weight W(k,P j ) is calculated as:
[0127]
[0128] Among them, f(k,P j ) indicates that keyword k is in paragraph P j The frequency of occurrence in Indicates paragraph P j The sum of the occurrence frequencies of all keywords in .
[0129] 2.4.2. Keyword weight correction: In order to better reflect the importance of keywords in specific fields, the weight of each keyword is corrected, and certain core field words will be given higher weights.
[0130] Assume that the domain importance weight of keyword k is I(k), then the modified weight W′(k, P i )for:
[0131] W′(k,P i )=W(k,P i )·I(k)
[0132] The modified weight W′(k, P j )for:
[0133] W′(k,P j )=W(k,P j)·I(k)
[0134] Among them, I(k) reflects the importance of keyword k in the domain, and the system determines I(k) through pre-training or domain vocabulary.
[0135] 2.4.3. Calculation of similarity between paragraphs: Based on the corrected weights of the keywords, the system calculates the similarity between two paragraphs. The present invention uses weighted cosine similarity to calculate the similarity between paragraphs. The calculation formula is:
[0136]
[0137] Among them, Sim(P i , P j ) indicates paragraph P i and paragraph P j The similarity, K i Indicates paragraph P i The keyword set in K j Indicates paragraph P j The keyword set in K i ∩K j Indicates paragraph P i The keyword set K in i and paragraph P j The keyword set K in j The intersection of W′(k, P i ), W′(k,P j ) respectively represent the corrected keyword k in paragraph P i 、Paragraph P j The weight in .
[0138] 2.4.4. Correction of structural relationship between paragraphs: When calculating the similarity between two paragraphs, the system also needs to consider the structural relationship between the paragraphs, such as the relative position and logical order of the paragraphs in the document.
[0139] Suppose paragraph P i 、Paragraph P j The distance in the document is d(P i , P j ), the distance can be calculated by paragraph number, position, etc. Structural relationship weight S(P i , P j ) is calculated as:
[0140]
[0141] Among them, α is an adjustment parameter that reflects the impact of structural relationship on similarity. The larger the distance, the smaller the weight of the structural relationship, and vice versa.
[0142] 2.4.5. Calculation of correlation between paragraphs: Considering keyword similarity and structural relationship, paragraph P i and paragraph P j The correlation between R(P i , P j )for:
[0143] R(P i , P j )=β·Sim(P i , P j )+(1-β)·S(P i , P j )
[0144] Among them, β is a weighting parameter, which is used to adjust the influence of similarity and structural relationship on the association degree. The optimal value is usually determined through experiments.
[0145] Paragraphs with high correlation usually indicate that their contents are closely connected in logic and topic, while paragraphs with low correlation reflect that their topics or semantics are far apart. Dynamic weight allocation means that the system will give higher weights to core domain words that appear in paragraphs, such as robot-related technical terms. Dynamic weight allocation based on the context in which keywords appear in paragraphs and the importance of keywords can improve the accuracy of calculation of correlation between paragraphs, allowing the system to better capture the hidden structure and logical relationships in documents.
[0146] Calculating the correlation between paragraphs in combination with the structural relationship between paragraphs means determining the proportion of the structural relationship between paragraphs by analyzing the logical structure between paragraphs, such as the position of paragraphs in the document, the relationship between the previous and the next paragraphs, etc. This ensures that the system can retain the overall structure of the document when dividing paragraphs without destroying the contextual connection of the document.
[0147] The present invention not only relies on surface keyword matching when calculating the relevance between paragraphs, but also introduces deep semantic understanding and paragraph structure retention, which can greatly improve the accuracy of paragraph division and relevance calculation.
[0148] 2.5. Document division: The document is divided into several sub-documents according to the correlation between paragraphs. The system integrates paragraphs with high correlation to form sub-documents with highly aggregated content. Each sub-document contains paragraphs with strong contextual relationships and similar topics, ensuring that the sub-documents have coherent information and clear structure.
[0149] 2.6. Sub-document generation: The divided sub-documents are stored and structured output is generated. The system can generate output files in various formats, including structured database entries, marked document files, etc. These structured sub-documents will be used as input for large-scale language model processing, which can improve the efficiency and accuracy of model processing.
[0150] Large-scale language models are mainly used in the field of natural language processing (NLP), including tasks such as text generation, text understanding, and text classification, but large-scale language models are usually limited by hardware performance and understanding ability, and it is difficult to efficiently process document-level unstructured data. The main reason is that the amount of information covered by document-level data is too large, covering more knowledge points, the sentence grammar involved is more advanced, the association relationship is more obscure, and there are a large number of contextual connections, which makes it difficult for the model to fully understand and extract relationship triples. The present invention divides document-level unstructured data, takes paragraphs as the minimum granularity, and assigns different weights to the degree of association between paragraphs in conjunction with a keyword dictionary to achieve document division, and integrates paragraphs with higher association, that is, paragraphs with strong contextual relationships, to achieve a high degree of aggregation of sub-document content after division and the summary of the same knowledge points. Through this document division algorithm, the system can effectively process document-level unstructured data, convert complex document content into structured and analyzable information, not only improve the processing power and efficiency of large-scale language models, but also ensure the accuracy and comprehensiveness of information extraction, and provide reliable technical support for information processing in the field of robots.
[0151] Step 3: Use the asynchronous architecture of the producer-consumer model to build a software system, and use the software system to perform knowledge extraction tasks on the divided sub-documents in turn to extract key information from the unstructured data of the sub-documents. The specific process includes the following:
[0152] 3.1. Deliver the divided sub-documents to the producer thread through the network, and the producer thread stores the feature information of the divided sub-documents in the Redis message queue according to the order in which the sub-documents were generated. In this way, tasks can be queued in an orderly manner and wait for processing.
[0153] 3.2. The consumer thread obtains tasks from the Redis message queue and delivers the tasks to the model for knowledge extraction. The overall architecture of the present invention adopts a producer-consumer model. Each consumer thread runs independently. Therefore, multiple consumer threads can be started as needed to process tasks in parallel, thereby dynamically adjusting the hardware load and keeping the system at an ideal performance level.
[0154] 3.3. Select a large language model based on specific application requirements and hardware conditions to ensure a balance between performance and accuracy. You can choose an open source or commercial large language model to search and extract key information from the divided sub-documents.
[0155] 3.4. Design the prompt words for the model
[0156] The relationship list of the model is customized according to the specific application requirements. The relationship list is used to indicate the specific relationship types that the model should focus on, such as degrees of freedom, grab weight, working speed, etc., to ensure that the model can accurately capture the required information.
[0157] Based on the relationship list, extract the relationship between entities in the divided sub-documents and output them in a structured format. Design the output format of the model, requiring the model to output the extracted relationship in a specific format, such as a relationship triple expressed in json format. This structured output is helpful for subsequent data processing and analysis. The relationship triple expressed in json format is expressed as:
[0158] ["Head Entity 1", "Relationship 1", "Tail Entity 1"],
[0159] ["Head Entity 2", "Relationship 2", "Tail Entity 2"],
[0160] ["Head Entity 3", "Relation 3", "Tail Entity 3"].
[0161] Large-scale language models are limited by computing power factors when processing tasks, and usually require a long waiting time, especially when performing document-level knowledge extraction tasks. In the case of poor hardware conditions, it is even easy to have problems such as video memory overflow. In order to solve the long waiting time for processing tasks and the problem of video memory overflow, the present invention uses a producer-consumer and integrates a large model asynchronous architecture, which can effectively avoid time-consuming extraction tasks blocking the entire system, realize the decoupling of producers and consumers, and then release the performance of the producer side, not only hiding the waiting time, but also dynamically adjusting the hardware load to maintain the balance of server load, thereby improving the stability of the software system. Specifically, when the system load is low, the number of consumer threads can be increased to speed up the processing speed; when the system load is high, the number of consumer threads can be reduced to avoid excessive consumption of resources. This dynamic adjustment mechanism ensures that the system can run stably and efficiently under different load conditions, effectively solves the problem of computing power limitation of large-scale language models when processing document-level tasks, and realizes efficient knowledge extraction. Through the design of prompt words, the system can provide accurate and fast information extraction services in different application scenarios.
[0162] Step 3 also includes the process of retraining the model using proprietary text in the robotics field, including:
[0163] 3.5.1. Data preparation: Collect proprietary texts in the field of robotics. Proprietary texts cover relevant terminology, technical parameters, usage scenarios, etc. in the field of robotics.
[0164] 3.5.2. Data cleaning and annotation: Clean and annotate the collected robot-specific text to ensure that the model can correctly understand and identify domain-specific terms and expressions.
[0165] 3.5.3. Training model: Use labeled data to conduct secondary training on the large model so that it can recognize and process entities and relationships in the domain.
[0166] The present invention uses proprietary texts in the field of robotics to perform secondary training on the big model, so that the big model can better adapt to the terminology and expressions in the field of robotics and enhance entity recognition capabilities. By introducing specific data in the field of robotics for retraining, the big model can more accurately understand and extract key information related to robots, thereby improving the quality and accuracy of the data extraction results of the big model.
[0167] Step 3 also includes the process of optimizing the relationship extraction capability of the model after secondary training, which specifically includes:
[0168] 3.6.1. Relationship Definition: In the field of robotics, it is necessary to clearly define the type of relationship between entities that need to be identified, such as the association between parts and robot models.
[0169] 3.6.2. Data labeling: Label the entities and their relationships in the data, and define the head entity, relationship, and tail entity.
[0170] 3.6.3. Model optimization training: The labeled data is input into the model after secondary training for optimization training to make it more accurate in the relationship extraction task. During the model training process, the weights are continuously adjusted to learn how to identify different relationship triplets and output these relationships in a structured manner.
[0171] On the basis of the second training model, the model is further trained from the perspective of association, especially in the knowledge graph construction scenario, and optimized for tasks such as relation triple extraction. Through further optimization and training, the model can not only identify entities and their attributes, but also flexibly handle complex associations between entities. In the field of robotics, the model can identify key entities such as robot models, functions, and performance indicators, and extract their associations with manufacturing processes, parts, etc. This deep training and optimization makes the model more intelligent and efficient when processing complex texts, not only improving the ability to understand and extract information in proprietary fields, but also enhancing the accuracy of information generation and analysis.
[0172] Through these training methods, the output of the model can not only be used to build high-quality knowledge graphs, but also play a key role in data analysis and decision support. Through continuous optimization and iteration, we can better meet the actual needs of the robotics field and promote the development of information processing technology.
[0173] Step 4: Integrate and classify all key information extracted from the same sub-document to obtain regular data, and then perform knowledge fusion processing on the regular data. The specific process includes the following:
[0174] 4.1. Perform detailed analysis on each attribute triple, including extraction of attribute name and attribute value, to ensure a clear understanding of the information of each triple.
[0175] 4.2. Compare and integrate the extracted attribute triples with the existing knowledge graph. Specifically, a similarity algorithm can be used to remove duplicate information between the attribute triples and the existing knowledge graph to ensure the accuracy and completeness of the final knowledge system.
[0176] 4.3. Based on the integration, new attribute triples are constructed to further improve the knowledge system and ensure the consistency and accuracy of information.
[0177] 4.4. The attribute triplet information after knowledge fusion processing is stored in the database.
[0178] Example 2
[0179] This embodiment provides a document-level knowledge extraction and fusion system based on a large language model, including:
[0180] Keyword building module, used to determine the scope of required key information and build a keyword dictionary; specifically includes:
[0181] 1.1. Collect key parameters and terms from product manuals, technical specifications and industry standards to obtain keywords;
[0182] 1.2. Define synonyms and related terms for each keyword;
[0183] 1.3. Dynamically update and maintain keyword dictionaries;
[0184] 1.4. Perform configuration management on keyword dictionary.
[0185] The document segmentation module is used to segment the document-level unstructured data into paragraphs according to the keyword dictionary to obtain the segmented sub-documents; specifically, it includes:
[0186] 2.1. Load document-level unstructured data into the system;
[0187] 2.2. Use document parsing tools to segment document-level unstructured data so that each paragraph or sentence in the document becomes an independent processing unit;
[0188] 2.3. The system scans the text in each paragraph or sentence, looking for terms or phrases that match entries in the keyword dictionary;
[0189] 2.4. Calculate the relevance between paragraphs based on the keyword matching results and the structural relationship between paragraphs; the calculation of the relevance specifically includes the following steps:
[0190] 2.4.1. Keyword matching calculation: The system first calculates the keyword matching in each paragraph and assigns weights to the keywords based on their frequency of occurrence and their importance in the context.
[0191] Suppose paragraph P i and paragraph P j The keyword sets in are K i , K j , keyword k in paragraph P i The weight in is W(k,P i ), weight W(k,P i ) is calculated as:
[0192]
[0193] Among them, f(k,P i ) indicates that keyword k is in paragraph P i The frequency of occurrence in Indicates paragraph P i The sum of the occurrence frequencies of all keywords in .
[0194] Similarly, keyword k in paragraph P j The weight W(k,P j ) is calculated as:
[0195]
[0196] Among them, f(k,P j ) indicates that keyword k is in paragraph P j The frequency of occurrence in It represents the total frequency of occurrence of all keywords in paragraph Pj.
[0197] 2.4.2. Keyword weight correction: In order to better reflect the importance of keywords in specific fields, the weight of each keyword is corrected, and certain core field words will be given higher weights.
[0198] Assume that the domain importance weight of keyword k is I(k), then the modified weight W′(k, P i )for:
[0199] W(k,P i )=W(k,P i )·I(k)
[0200] The modified weight W′(k, P j)for:
[0201] W(k,P j )=W(k,P j )·I(k)
[0202] Among them, I(k) reflects the importance of keyword k in the domain, and the system determines I(k) through pre-training or domain vocabulary.
[0203] 2.4.3. Calculation of similarity between paragraphs: Based on the corrected weights of the keywords, the system calculates the similarity between two paragraphs. The present invention uses weighted cosine similarity to calculate the similarity between paragraphs. The calculation formula is:
[0204]
[0205] Among them, Sim(P i , P j ) indicates paragraph P i and paragraph P j The similarity, K i Indicates paragraph P i The keyword set in K j Indicates paragraph P j The keyword set in K i ∩K j Indicates paragraph P i The keyword set K in i and paragraph P j The keyword set K in j The intersection of W′(k, P i ), W′(k,P j ) respectively represent the corrected keyword k in paragraph P i 、Paragraph P j The weight in .
[0206] 2.4.4. Correction of structural relationship between paragraphs: When calculating the similarity between two paragraphs, the system also needs to consider the structural relationship between the paragraphs, such as the relative position and logical order of the paragraphs in the document.
[0207] Suppose paragraph P i 、Paragraph P j The distance in the document is d(P i , P j ), the distance can be calculated by paragraph number, position, etc. Structural relationship weight S(P i , P j ) is calculated as:
[0208]
[0209] Among them, α is an adjustment parameter that reflects the impact of structural relationship on similarity. The larger the distance, the smaller the weight of the structural relationship, and vice versa.
[0210] 2.4.5. Calculation of correlation between paragraphs: Considering keyword similarity and structural relationship, paragraph P i and paragraph P j The correlation between R(P i , P j )for:
[0211] R(P i , P j )=β·Sim(P i , P j )+(1-β)·S(P i , P j )
[0212] Among them, β is a weighting parameter, which is used to adjust the influence of similarity and structural relationship on the association degree. The optimal value is usually determined through experiments.
[0213] 2.5. Divide the document into several sub-documents according to the relevance between paragraphs;
[0214] 2.6. Store the divided sub-documents and generate structured output.
[0215] The knowledge extraction module is used to build a software system using the asynchronous architecture of the producer-consumer model to integrate the large model. The software system is used to perform knowledge extraction tasks on the divided sub-documents in turn to extract key information from the unstructured data of the sub-documents. Specifically, it includes:
[0216] 3.1. Deliver the divided sub-documents to the producer thread through the network. The producer thread stores the feature information of the divided sub-documents into the Redis message queue according to the generation order of the sub-documents.
[0217] 3.2. The consumer thread obtains tasks from the Redis message queue and delivers the tasks to the large model for knowledge extraction;
[0218] 3.3. Select a large model based on specific application requirements and hardware conditions;
[0219] 3.4. Customize the relationship list of the model according to specific application requirements. Based on the relationship list, extract the relationship between entities in the divided sub-documents and output them in a structured format.
[0220] The knowledge extraction module also includes:
[0221] The secondary training unit is used to perform secondary training on the model using proprietary text in the robotics field. The specific process includes the following:
[0222] 3.5.1. Collect proprietary texts in the field of robotics, which cover relevant terms, technical parameters, and usage scenarios in the field of robotics;
[0223] 3.5.2. Clean and label the collected robot-specific texts;
[0224] 3.5.3. Use the labeled data to train the large model again;
[0225] The relationship extraction capability training unit is used to optimize the relationship extraction capability of the model after secondary training, which specifically includes the following processes:
[0226] 3.6.1. In the field of robotics, clarify the types of relationships between entities that need to be identified;
[0227] 3.6.2. Label the entities and their relationships in the data, and define the head entity, relationship, and tail entity;
[0228] 3.6.3. Input the labeled data into the model after secondary training for optimization training. During the optimization training process, the weights are continuously adjusted to learn how to identify different relationship triplets and output these relationships in a structured manner.
[0229] The knowledge fusion module is used to integrate and classify all key information extracted from the same sub-document to obtain regular data, and then perform knowledge fusion processing on the regular data, including:
[0230] 4.1. Extract the attribute name and attribute value of each attribute triple;
[0231] 4.2. Use the similarity algorithm to remove duplicate information between attribute triples and existing knowledge graphs and construct new attribute triples.
[0232] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A document-level knowledge extraction and fusion method based on a large language model, characterized by: The following steps are involved: Step 1: Determine the scope of key information required and establish a keyword dictionary; Step 2: Divide the document-level unstructured data into paragraphs according to the keyword dictionary to obtain the divided sub-documents; Step 3: Use the asynchronous architecture of the producer-consumer model to build a software system, and use the software system to perform knowledge extraction tasks on the divided sub-documents in turn to extract key information from the unstructured data of the sub-documents; Step 4: Integrate and classify all key information extracted from the same sub-document to obtain regular data, and then perform knowledge fusion processing on the regular data.
2. The document-level knowledge extraction and fusion method based on a large language model according to claim 1, characterized in that: The step one comprises: 1.
1. Collect key parameters and terms from product manuals, technical specifications and industry standards to obtain keywords; 1.
2. Define synonyms and related terms for each keyword; 1.
3. Dynamically update and maintain keyword dictionaries; 1.
4. Perform configuration management on keyword dictionary.
3. The document-level knowledge extraction and fusion method based on a large language model according to claim 1, characterized in that: The second step comprises: 2.
1. Load document-level unstructured data into the system; 2.
2. Use document parsing tools to segment document-level unstructured data so that each paragraph or sentence in the document becomes an independent processing unit; 2.
3. The system scans the text in each paragraph or sentence, looking for terms or phrases that match entries in the keyword dictionary; 2.
4. Calculate the relevance between paragraphs based on keyword matching results and the structural relationship between paragraphs; 2.
5. Divide the document into several sub-documents according to the relevance between paragraphs; 2.
6. Store the divided sub-documents and generate structured output.
4. The document-level knowledge extraction and fusion method based on a large language model according to claim 3 is characterized in that: The calculation of the relevance between paragraphs based on the keyword matching results and the structural relationship between paragraphs comprises the following steps: 2.4.
1. Let paragraph P i and paragraph P j The keyword sets in are K i , K j , keyword k in paragraph P i 、Paragraph P j The weights in are W(k,P i )、W(k,P j ), the calculation formula is: Among them, f(k,P i )、f(k,P j ) respectively represent the keyword k in paragraph P i 、Paragraph P j The frequency of occurrence in Respectively represent paragraphs P i 、Paragraph P j The sum of the occurrence frequencies of all keywords in ; 2.4.
2. Based on the importance of keywords in the field, the weight of keywords is modified. The modified keyword k is placed in paragraph P. i 、Paragraph P j The weight W'(k,P i )、W'(k,P j ) are: W’(k,P i )=W(k,P i )·I(k),W’(k,P j )=W(k,P j )·I(k) Among them, I(k) is the domain importance weight of keyword k; 2.4.
3. Calculate paragraph P based on the corrected keyword weights i and paragraph P j The similarity Sim(P i ,P j ): 2.4.
4. Calculate paragraph P i and paragraph P j The structural relationship weight S(P i ,P j ): Among them, α is the adjustment parameter; 2.4.
5. Based on paragraph P i 、Paragraph P j The similarity Sim(P i ,P j ) and structural relationship weight S(P i ,P j ), calculate paragraph P i and paragraph P j The correlation between R(P i ,P j ): R(P i ,P j )=β·Yes(P i ,P j )+(1-β)·S(P i ,P j ) Among them, β is the weighting parameter.
5. The document-level knowledge extraction and fusion method based on a large language model according to claim 1 is characterized in that: The step three comprises: 3.
1. Deliver the divided sub-documents to the producer thread through the network. The producer thread stores the feature information of the divided sub-documents into the Redis message queue according to the generation order of the sub-documents. 3.
2. The consumer thread obtains tasks from the Redis message queue and delivers the tasks to the large model for knowledge extraction; 3.
3. Select a large model based on specific application requirements and hardware conditions; 3.
4. Customize the relationship list of the model according to specific application requirements. Based on the relationship list, extract the relationship between entities in the divided sub-documents and output them in a structured format.
6. The document-level knowledge extraction and fusion method based on a large language model according to claim 5 is characterized by: The step three also includes a process of performing secondary training on the model using proprietary texts in the field of robotics and a process of optimizing the relationship extraction capability of the secondary trained model. The process of performing secondary training on the model using proprietary texts in the field of robotics includes: 3.5.
1. Collect proprietary texts in the field of robotics, which cover relevant terms, technical parameters, and usage scenarios in the field of robotics; 3.5.
2. Clean and label the collected robot-specific texts; 3.5.
3. Use the labeled data to train the large model again; The process of optimizing the relationship extraction capability of the model after secondary training includes: 3.6.
1. In the field of robotics, clarify the types of relationships between entities that need to be identified; 3.6.
2. Label the entities and their relationships in the data, and define the head entity, relationship, and tail entity; 3.6.
3. Input the labeled data into the model after secondary training for optimization training. During the optimization training process, the weights are continuously adjusted to learn how to identify different relationship triplets and output these relationships in a structured manner.
7. Document-level knowledge extraction and fusion system based on large language model, characterized by: include: Keyword building module, used to determine the scope of required key information and build a keyword dictionary; The document segmentation module is used to segment the document-level unstructured data into paragraphs according to the keyword dictionary to obtain the segmented sub-documents; The knowledge extraction module is used to build a software system using the asynchronous architecture of the producer-consumer model to integrate the large model. The software system is used to perform knowledge extraction tasks on the divided sub-documents in turn to extract key information from the unstructured data of the sub-documents. The knowledge fusion module is used to integrate and classify all key information extracted from the same sub-document to obtain regular data, and then perform knowledge fusion processing on the regular data.
8. The document-level knowledge extraction and fusion system based on a large language model according to claim 1, characterized in that: The document division module is also used for: 2.
1. Load document-level unstructured data into the system; 2.
2. Use document parsing tools to segment document-level unstructured data so that each paragraph or sentence in the document becomes an independent processing unit; 2.
3. The system scans the text in each paragraph or sentence, looking for terms or phrases that match entries in the keyword dictionary; 2.
4. Calculate the relevance between paragraphs based on keyword matching results and the structural relationship between paragraphs; 2.
5. Divide the document into several sub-documents according to the relevance between paragraphs; 2.
6. Store the divided sub-documents and generate structured output.
9. The document-level knowledge extraction and fusion system based on a large language model according to claim 8, characterized in that: The calculation of the relevance between paragraphs based on the keyword matching results and the structural relationship between paragraphs comprises the following steps: 2.4.
1. Let paragraph P i and paragraph P j The keyword sets in are K i , K j , keyword k in paragraph P i 、Paragraph P j The weights in are W(k,P i )、W(k,P j ), the calculation formula is: Among them, f(k,P i )、f(k,P j ) respectively represent the keyword k in paragraph P i 、Paragraph P j The frequency of occurrence in Respectively represent paragraphs P i 、Paragraph P j The sum of the occurrence frequencies of all keywords in ; 2.4.
2. Based on the importance of keywords in the field, the weight of keywords is modified. The modified keyword k is placed in paragraph P. i 、Paragraph P j The weight W'(k,P i )、W'(k,P j ) are: W’(k,P i )=W(k,P i )·I(k),W’(k,P j )=W(k,P j )·I(k) Among them, I(k) is the domain importance weight of keyword k; 2.4.
3. Calculate paragraph P based on the corrected keyword weights i and paragraph P j The similarity Sim(P i ,P j ): 2.4.
4. Calculate paragraph P i and paragraph P j The structural relationship weight S(P i ,P j ): Among them, α is the adjustment parameter; 2.4.
5. Based on paragraph P i 、Paragraph P j The similarity Sim(P i ,P j ) and structural relationship weight S(P i ,P j ), calculate paragraph P i and paragraph P j The correlation between R(P i ,P j ): R(P i ,P j )=β·Yes(P i ,P j )+(1-β)·S(P i ,P j ) Among them, β is the weighting parameter.
10. The document-level knowledge extraction and fusion system based on a large language model according to claim 1, characterized in that: The knowledge extraction module is also used for: 3.
1. Deliver the divided sub-documents to the producer thread through the network. The producer thread stores the feature information of the divided sub-documents into the Redis message queue according to the generation order of the sub-documents. 3.
2. The consumer thread obtains tasks from the Redis message queue and delivers the tasks to the large model for knowledge extraction; 3.
3. Select a large model based on specific application requirements and hardware conditions; 3.
4. Customize the relationship list of the model according to specific application requirements. Based on the relationship list, extract the relationship between entities in the divided sub-documents and output them in a structured format.
Citation Information
Patent Citations
Unstructured text data knowledge extraction method based on large language model
CN118036734A
Formula searching method and apparatus in text recognition
CN108133168A
Carbon standard knowledge graph construction method based on fusion text
CN115344712A
Data information label processing method of large language model
CN117453921A
Professional recommendation knowledge graph construction method and query system based on large language model
CN118069865A
Cited By
Multi-agent collaborative industrial document automatic generation method and system
CN120277212A
Intelligent multi-modal document fusion and personalized retrieval system and method
CN121071129A