A domain knowledge triple extraction method, system, medium and device
By constructing a structured vector knowledge base and combining iterative RAG algorithm with a large language model, high-frequency word initial entities are generated, which solves the limitations of triple extraction in existing technologies and achieves efficient and accurate domain knowledge extraction, suitable for knowledge structuring and intelligent applications.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XIAN UNIV OF TECH
- Filing Date
- 2026-04-24
- Publication Date
- 2026-06-05
AI Technical Summary
Existing technologies suffer from severe error propagation, poor generalization ability, difficulty in capturing domain-specific association patterns, insufficient collaboration between the model and RAG leading to knowledge fragmentation, lack of scientific guidance for initial entities, lack of closed-loop mechanisms, difficulty in uncovering implicit associations, and low completeness and accuracy of domain knowledge extraction.
By constructing a structured vector knowledge base, high-frequency word initial entities are generated. The iterative RAG algorithm is combined with a large language model for multiple iterations to generate a set of triples. Entity classification is then performed and the results are imported into a graph database to form a knowledge graph.
It improves the stability, relevance, and efficiency of triple extraction, ensures the professionalism and accuracy of extraction, solves the limitations and error problems existing in traditional methods, and achieves efficient domain knowledge extraction.
Smart Images

Figure CN122154892A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of knowledge engineering technology, and in particular to a method, system, medium, and device for extracting domain knowledge triples. Background Technology
[0002] Core knowledge in specialized fields is often embedded in unstructured text. Automatic extraction of triples (subject, relation, object) is crucial for structuring knowledge and supporting downstream intelligent applications. Current triple extraction methods have significant limitations: traditional pipeline methods rely on traditional models, leading to severe error propagation in zero-label scenarios; rule-based template methods have poor generalization capabilities and high adaptation costs; statistical machine learning methods struggle to capture domain-specific association patterns, resulting in insufficient extraction accuracy and completeness.
[0003] While existing RAG-based solutions have overcome some limitations, they still suffer from the following problems: insufficient collaboration between the model and RAG leads to knowledge fragmentation; the initial entities lack scientific guidance and are prone to deviating from core knowledge; and the lack of a closed-loop mechanism makes it difficult to uncover implicit connections, resulting in low completeness and accuracy of domain knowledge extraction. Summary of the Invention
[0004] Therefore, it is necessary to provide a method, system, medium, and device for extracting domain knowledge triples to address the aforementioned technical problems.
[0005] The following technical solution is adopted in this specification: This specification provides a method for extracting domain knowledge triples, including: Acquire domain-specific texts in multiple formats, parse the domain-specific texts, and construct a structured vector knowledge base; The parsed domain-specific text is subjected to quantitative calculation and fusion screening to generate initial entities of high-frequency words; By using the iterative RAG algorithm, combined with the structured vector knowledge base, multiple iterations are performed starting from the high-frequency word initial entities to generate a set of triples corresponding to the domain-specific text. The set of triples is stored in a structured CSV file, and then the CSV file is classified into entities and imported into a graph database to form a knowledge graph visualization.
[0006] Optionally, the parsed domain-specific text can be quantitatively calculated and fused to generate initial entities for high-frequency words, including: Obtain the domain prior terminology library and calculate the local absolute frequency of each prior term in each domain-specific text. The global term frequency is obtained by accumulating the local frequency of each prior term in professional texts across all domains. The document coverage rate is obtained by calculating the ratio of the number of texts containing the term to the total number of texts. The global word frequency and the document coverage are converted into a single fusion score by weighted fusion, and high-frequency word initial entities are selected from the domain prior term library based on the fusion score.
[0007] Optionally, the initial entity selection of high-frequency words from the domain prior terminology based on the fusion score includes: Based on the fusion score, all prior terms in the domain prior terminology library are sorted in descending order, and the top K terms are selected to form the initial entity set. The initial entity set is processed by frequency parallelism, insufficient effective terms, invalid cross-text, and empty set to filter out high-frequency initial entities.
[0008] Optionally, the iterative RAG algorithm, in conjunction with the structured vector knowledge base, uses the initial high-frequency word entities as a starting point to perform multiple iterations to generate a set of triples corresponding to the domain-specific text, specifically including: Semantic retrieval is performed on the initial entities of high-frequency words, and text fragments associated with the initial entities of high-frequency words are located from the structured vector knowledge base based on the processing results. The design domain adapts the prompt words, and the corresponding triples are extracted from the text fragments using a pre-trained large language model based on the prompt words; The extracted triples are iterated through multiple rounds to uncover multiple associated entities. The above steps are repeated for each associated entity to generate a set of triples corresponding to the domain-specific text.
[0009] Optionally, the step of performing semantic retrieval on the initial entities of high-frequency words and locating text fragments associated with the initial entities of high-frequency words from the structured vector knowledge base based on the processing results specifically includes: High-frequency word initial entities are input into a pre-trained text embedding model to generate query vectors; Calculate the cosine similarity between the query vector and all text fragment vectors in the structured vector knowledge base; Candidate text segments with similarity higher than a threshold are selected, sorted in descending order of similarity, and the top N text segments are returned as the text segments associated with the initial entity of the high-frequency word.
[0010] Optionally, the method further includes: standardization processing of the triples extracted from the large language model, including format validation, redundancy removal, and validity screening.
[0011] Optionally, the text embedding model is the bge-m3 model, and the large language model is the Qwen-14B model.
[0012] This specification provides a domain knowledge triple extraction system, including: The acquisition and construction module is used to acquire domain-specific text in multiple formats, parse the domain-specific text, and construct a structured vector knowledge base. The filtering module is used to perform quantitative calculations and fusion filtering on the parsed domain-specific text to generate initial entities of high-frequency words. The iterative generation module is used to generate a set of triples corresponding to the domain-specific text by using the iterative RAG algorithm in conjunction with the structured vector knowledge base, starting from the initial entity of the high-frequency words and performing multiple rounds of iteration. The storage and visualization module is used to store the triple set in a structured CSV file, then classify the entities in the CSV file and import it into a graph database to form a knowledge graph visualization.
[0013] This specification provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described domain knowledge triple extraction method.
[0014] This specification provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the above-described domain knowledge triple extraction method.
[0015] The above-mentioned technical solutions adopted in this specification can achieve the following beneficial effects: The domain knowledge triple extraction method and system provided in this manual provide high-quality and efficient data support for triple extraction by parsing the acquired domain-specific text and transforming it into a structured vector knowledge base that can be efficiently searched. Then, the domain-specific text is quantitatively calculated and fused for screening to mine the initial entities of core high-frequency words in the domain that have both global high frequency and cross-text universality. This avoids the "local optima, global deviation" problem caused by traditional single word frequency, effectively avoids interference from non-core terms, and improves the stability, relevance, and efficiency of iterative extraction. Furthermore, the iterative RAG algorithm, combined with the structured vector knowledge base, the accurate extraction of large models, and the expansion of related entities, performs closed-loop iteration on the initial entities of high-frequency words. This can mine explicit and implicit semantic relationship triples in the text layer by layer, ensuring the strong relevance and structural integrity of the extracted triples, thereby improving the professionalism and accuracy of the model's triple extraction. Attached Figure Description
[0016] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0017] Figure 1 This specification provides a flowchart illustrating a method for extracting domain knowledge triples. Figure 2 This document provides a flowchart illustrating the steps involved in quantifying and fusing domain-specific texts to generate initial entities for high-frequency words. Figure 3 This document provides a flowchart illustrating the steps for selecting initial entities from a domain prior terminology database based on fusion scores. Figure 4 This document provides a flowchart illustrating the process of generating a set of triples corresponding to domain-specific texts through multiple iterations using an iterative RAG algorithm in conjunction with a structured vector knowledge base, starting with the initial entities of the high-frequency words. Figure 5 This document provides a flowchart illustrating the process of semantically retrieving initial entities of high-frequency words and locating text fragments associated with these initial entities from a structured vector knowledge base based on the processing results. Figure 6 This is a visualization diagram of the standard results knowledge graph provided in this specification; Figure 7 A visualization diagram of the knowledge graph of the triplet extraction results provided in this specification for the large model scheme. Figure 8 This is a visualization diagram of the knowledge graph of the triple extraction results of the random word iterative large model scheme provided in this manual; Figure 9 This is a visualization diagram of the knowledge graph extraction results of the triplet extraction results provided in the random word iterative RAG large model scheme of this manual. Figure 10 This is a schematic diagram of the knowledge graph visualization of the triple extraction results of the high-frequency word iterative RAG large model scheme of the present invention; Figure 11 This specification provides a schematic diagram of a domain knowledge triple extraction system. Figure 12 This is a schematic diagram of a computer device used to implement a domain knowledge triple extraction method, as provided in this specification. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of this specification clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments in this specification without creative effort are within the scope of protection of this application.
[0019] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.
[0020] This invention provides a method for extracting domain knowledge triples. Figure 1 The flowchart of this method is shown, and it specifically includes the following steps: S101. Obtain domain-specific texts in multiple formats, parse the domain-specific texts, and construct a structured vector knowledge base.
[0021] The multi-format domain-specific texts include professional texts in various formats within a specific knowledge domain (such as motion control), such as PDF, WORD, and TXT documents. The multi-format text parsing approach employs differentiated strategies for common text types, with the core objective of ensuring the integrity and traceability of the text content: TXT files are directly read using UTF-8 encoding, with an exception handling mechanism to address encoding anomalies and ensure complete text reading; PDF files are extracted page-by-page using PyPDF2.PdfReader, with page numbers marked for each extracted page, while filtering out invalid content such as headers, footers, and blank pages to resolve the semantic fragmentation of technical descriptions caused by pagination, ensuring the coherence of the domain's technical logic; Word documents are extracted using python-docx.Document, retaining only key identifiers such as figure and formula numbers, excluding tables, images, and internal formula details, while filtering out blank paragraphs, comments, and revisions to ensure concise and standardized extracted text.
[0022] Then, the professional text is cleaned to achieve the core goal of "noise removal and core preservation": First, regular expressions are used to merge consecutive spaces and line breaks in the text to unify the text format; second, page number markers, copyright notices, references and other non-core content are accurately removed through regular expression matching to focus on the technical knowledge itself; finally, only Chinese and English, numbers and commonly used punctuation marks in the field are retained, which not only removes irrelevant noise, but also fully preserves the original expressions of professional terms in the field of motion control such as "servo motor", "PID controller" and "encoder feedback signal", avoiding the splitting or loss of terms.
[0023] The cleaned plain text was segmented using a semantic integrity-first strategy, with each segment limited to 300 characters and ending with a period. The segmented text fragments were then stored in a CSV table. Limiting fragments to 300 characters and ending with a period avoids semantic dilution caused by longer segments while ensuring semantic integrity. This improves the relevance and accuracy of subsequent semantic retrieval and entity association extraction.
[0024] The semantic vector index of the structured vector knowledge base is built based on the bge-m3 pre-trained embedding model. This model generates a 1024-dimensional semantic vector for each text fragment. Its semantic representation capability for text in the industrial control field is superior to general embedding models, accurately capturing semantic associations specific to areas such as "servo motor-encoder" and "controller-feedback signal." An anomaly capture mechanism is incorporated into the vector generation process, logging errors and skipping failed text fragments to ensure the stability of the knowledge base construction process. Finally, text fragments are associated with their corresponding embedding vectors and stored as a efficiently searchable FAISS vector knowledge base. An index structure supporting fast cosine similarity calculation is constructed, with index construction time linearly related to text length, adapting to the processing needs of medium-to-large-scale professional books.
[0025] Through the standardized design of the entire process described above, the core problems of format heterogeneity, content noise interference, semantic fragmentation, and inefficient retrieval in professional texts are systematically solved. Unstructured motion control system domain texts are successfully transformed into a highly searchable structured vector knowledge base. The constructed vector index structure not only ensures accurate capture of domain-specific semantic relationships but also adapts to the needs of medium-to-large-scale text processing through its linear time complexity index construction characteristics. This provides high-quality, timely data support for the retrieval enhancement stage in the subsequent iterative RAG triple extraction module. Furthermore, it aligns with the core requirements of zero-annotation adaptation and knowledge structuring in professional books, laying a solid foundation for the stability and generalization of the method.
[0026] S102. Perform quantitative calculations and fusion filtering on the parsed domain-specific text to generate initial entities for high-frequency words.
[0027] In this embodiment of the invention, under the constraint of zero-annotation of the multi-text after parsing, and with the domain prior terminology library as the strong constraint boundary, the technical logic of initial entity screening through text preprocessing, two-dimensional quantization calculation, and two-dimensional fusion ranking is used to mine initial entities of core high-frequency words in the domain that have both global high frequency and cross-text universality, providing starting support for subsequent iterative RAG triple extraction. No manual data annotation or rule design is required; only multi-format professional book texts and the domain prior terminology library are used as input, and the output is a Top-K two-dimensional core entity set. A word frequency-text coverage two-dimensional evaluation system is introduced, fundamentally solving the problem of "local optima, global deviation" caused by traditional high-frequency word extraction relying solely on single word frequency. It effectively avoids interference from non-core terms, ensuring that the initial entities focus on the core logic of the domain and common knowledge across multiple texts, laying the foundation for the stability, relevance, and efficiency of iterative extraction.
[0028] Furthermore, such as Figure 2As shown, in step S102, the parsed domain-specific text undergoes quantitative calculation and fusion filtering to generate initial entities for high-frequency words, including: S1021. Obtain the domain prior term library and calculate the local absolute frequency of each prior term in each domain professional text. S1022. Accumulate the local frequency of each prior term in all domain-specific texts to obtain the global word frequency; S1023. Calculate the ratio of the number of texts containing the term to the total number of texts to obtain the document coverage rate; S1024. The global word frequency and document coverage are converted into a single fusion score through weighted fusion, and the high-frequency word initial entities are selected from the domain prior term library based on the fusion score.
[0029] First, the domain-specific text is denoised by removing redundant characters, filtering stop words, and selecting short words (length < 2 characters). Then, all terms in the acquired domain prior terminology library are registered to the word segmentation tool to avoid splitting professional terms, ensure the accuracy of subsequent term matching, and lay the data foundation for two-dimensional quantitative calculation.
[0030] Using a multi-text set T = {T1, T2, ..., TD} (where D is the total number of input texts, D ≥ 1, and D=1 degenerates into a single-text scenario, and Ti is the i-th professional text) and a prior knowledge set S = {w1, w2, ..., wm} (a finite non-empty set of core domain terms verified by domain experts, m ≥ 1, and all elements possess domain-specific attributes) as input, the precise quantification of the two-dimensional indicators is implemented as follows: (1) Local absolute frequency statistics: Traverse each text Ti and the preprocessed ordered word segmentation list Wi = {ti1, ti2, ..., tiNi} (Ni is the total number of words in Ti, Ni ≥ 1), and calculate the local absolute frequency freqlocal(w, Ti) of each prior term w ∈ S using the set cardinality method. The formula is: In the formula, |·| represents the cardinality of the set, and | is a logical constraint symbol that limits the word segmentation to a complete match with the prior term character level, with a calculation deviation of ≤0.1%, which is strictly equivalent to the logic of filtered_words.count(word) in the engineering implementation.
[0031] (2) Global index aggregation: Accumulate the local frequency of terms in all texts to obtain the global word frequency. (Representing total occurrence density); the document coverage rate is obtained by calculating the ratio of the number of texts containing the term to the total number of texts. (Value range [0,1], representing the breadth of cross-text distribution).
[0032] (3) Index normalization: Min-Max normalization is used to map freqglobal(w) to the [0,1] interval to obtain the normalized global term frequency freqnorm(w), the formula is: Where w' is any term in the prior knowledge set S, used to traverse all terms in the set to determine the extreme value of the global word frequency; if all terms freqglobal(w) are consistent, then freqnorm(w) = 1 is uniformly assigned to ensure robustness.
[0033] Furthermore, the global word frequency and document coverage dimensions are fused and ranked. Through weighted fusion, the global word frequency and document coverage are transformed into a single fusion score S(w) (within the range [0,1]), achieving the optimal term ranking in multi-text scenarios. The core formula is: wfreq and wcov are fusion weight parameters (satisfying wfreq + wcov = 1), which can be flexibly configured: the default is wfreq=0.4 and wcov=0.6 (prioritizing generality); when focusing on local core, adjust to wfreq=0.5 and wcov=0.5; when strengthening common knowledge, increase wcov to 0.7 to adapt to different multi-text combination needs.
[0034] Then, based on the fusion score S(w), high-frequency initial entities are selected from the aforementioned domain prior terminology database, as follows: Figure 3 As shown, this is done to balance the coreness, scale, and robustness of the selected entity set; S10241. Based on the fusion score, sort all the prior terms in the domain prior terminology library in descending order and select the first K terms to form the initial entity set. S10242. Perform frequency parallel processing, effective term insufficiency processing, cross-text invalid processing, and empty set processing on the initial entity set to filter out high-frequency word initial entities.
[0035] First, a basic screening is performed: all terms in the domain prior terminology library S are sorted in descending order by S(w), and the first K terms are selected to form the initial entity set initial-ents (K is a configurable parameter, default K=3, satisfying 1 ≤ K ≤ m), formally expressed as follows: , where rank(S(w)) is the position of the term after sorting by S(w), and initial-ents ⊆ S, |initial-ents| ≥ 1; then the following processing is performed in sequence: Frequency parallel processing: If the S(w) of the Kth term is consistent with that of multiple subsequent terms, all parallel terms are included in initial-ents; Handling insufficient valid terms: If the number of valid terms with freqglobal(w) ≥ 1 is less than K, then all valid terms are treated as initial-ents and a standardized warning message is output. Cross-text invalidation handling: If a term's C(w) = 0 (appears only in a single text and D ≥ 2), filter the term directly; Empty set handling: If initial-ents is empty, output standardized error messages and terminate the iteration process to ensure module robustness.
[0036] By employing an innovative design that combines dual-dimensional quantification and fusion screening of domain-specific texts, this approach addresses the core issue of imbalance between core relevance and general relevance in traditional initial entity selection. Single-frequency screening easily falls into the trap of high local relevance but low global relevance, while single-text coverage screening tends to miss high-frequency core terms with slightly lower coverage. The dual-dimensional evaluation system of frequency and text coverage achieves an organic balance between the two. The resulting initial entities possess both domain core relevance and broad relevance, avoiding invalid calculations and directional biases introduced by non-core terms from the outset of iteration. This improves the accuracy of subsequent triple extraction and reduces redundant costs in the iteration process, providing crucial support for the efficiency and stability of the entire iterative RAG triple extraction method. This aligns with the academic research and engineering application needs of structured knowledge in professional books.
[0037] S103. Using the iterative RAG algorithm and in conjunction with a structured vector knowledge base, multiple iterations are performed starting with high-frequency word initial entities to generate a set of triples corresponding to the domain-specific text.
[0038] Specifically, such as Figure 4 As shown, step S103 includes: S1031. Perform semantic retrieval on the initial entities of high-frequency words, and locate the text fragments associated with the initial entities of high-frequency words from the structured vector knowledge base based on the processing results. S1032. Domain-adapted prompt words, and extract corresponding triples from the text fragments using a pre-trained large language model based on the prompt words; S1033. Perform multiple rounds of related entity expansion iterations on the extracted triples to mine multiple related entities, and repeat the above steps for each related entity to generate a set of triples corresponding to the domain-specific text.
[0039] This embodiment uses high-frequency word initial entities as the starting point for iteration. Relying on retrieval enhancement, accurate extraction from large models, and a closed-loop architecture of iterative association of entities, it breaks through the limitations of single-retrieval extraction in traditional RAG methods, achieving efficient mining of cross-segment and multi-level related knowledge in professional texts. By strengthening the semantic binding of "entity-context-triple" through multiple rounds of iteration, it not only solves the problem of knowledge fragmentation caused by the limited context window of a simple large model, but also avoids the stability risks introduced by invalid entities in traditional iterative methods. Ultimately, it ensures the strong correlation and structural integrity of the extracted triples, which aligns with the core characteristics of professional knowledge coherence and terminology density.
[0040] Furthermore, such as Figure 5 As shown, step S1031 specifically includes: S10311. Input the initial entities of high-frequency words into the pre-trained text embedding model to generate query vectors; S10312. Calculate the cosine similarity between the query vector and all text fragment vectors in the structured vector knowledge base; S10313. Select candidate text segments with similarity higher than the threshold, sort them in descending order of similarity, and return the top N text segments as the text segments associated with the initial entity of the high-frequency word.
[0041] Semantic retrieval uses precise semantic matching and domain-adaptive filtering as dual criteria. Through vector semantic computation and threshold constraints, it locates strongly relevant text fragments for each high-frequency word's initial entity, providing high-quality contextual support for subsequent large-scale models to accurately extract triples. The steps are as follows: First, the initial entity 'e' of the high-frequency word to be processed is input into the bge-m3 pre-trained embedding model to generate a semantic query vector. ; Secondly, the query vector and the vectors of all text fragments in the structured vector knowledge base are calculated based on the cosine similarity formula. The semantic relevance is expressed by the formula: Introduced in the formula The smoothing term avoids the division by zero problem and ensures computational stability. Then, a semantic similarity threshold of 0.3 is set (the optimal threshold verified by domain experiments, balancing retrieval recall and precision), and candidate segments with similarity higher than the threshold are selected. Finally, the candidate segments are sorted in descending order of similarity, and the top N=3 segments are returned as text segments associated with the corresponding high-frequency word initial entities (N is a configurable parameter, and the default value has been verified by experiments to cover the core entity associated text), which ensures contextual focus and avoids redundant information from interfering with the extraction of large models.
[0042] Furthermore, the RAG enhancement generation step described in this embodiment of the invention is based on the highly relevant text fragments recalled in the semantic retrieval step. It relies on the deep semantic understanding capabilities of the large language model, combined with the domain-adaptive prompt word design engineering and result standardization process, to achieve accurate extraction of triples (subject-relation-object), and transform the contextual text fragments obtained in the semantic retrieval step into structured knowledge.
[0043] The design of prompt words follows three principles: domain terminology constraints, relation type limitations, and standardized output format. These principles are detailed in Table 1. Table 1. Triplet Extraction Template This design reduces the randomness of large model generation by clearly defining domain constraints, avoids the generation of general relational representations and invalid triples, and ensures the accuracy of extraction.
[0044] Then, optimize the configuration of the large model call parameters: set temperature=0.1 (to minimize generation randomness and ensure high consistency and reproducibility of triple extraction results for the same text fragments), max_tokens=1500 (to reserve sufficient output token space to adapt to the complete output requirements of multiple domain triples in three 1000-character text fragments and avoid truncation of relational information due to output length limitations); relying on the knowledge adaptation advantages of the Qwen-14B large model in the field of motion control systems, accurately capture the core correlation logic between terms to ensure the professionalism and accuracy of the corresponding triples extracted by the model from the text fragments.
[0045] The extracted triples are standardized, including format validation and redundancy removal: First, triples conforming to the (subject, relation, object) format are extracted using regular expressions. Then, invalid characters (such as extra quotation marks and garbled characters) and incorrectly formatted items (non-triple structures) are removed to ensure the standardization of the structured triple output.
[0046] Finally, the core logic of initialization, single entity processing, queue updating, and termination judgment is used to implement multi-round expansion iterations of related entities. Through entity state management and queue optimization, related entities are mined based on the extracted triples, realizing iterative expansion of domain-specific text knowledge and forming a complete knowledge mining closed loop. The core process is shown below:
[0047] (1) Initialization phase: Define the entity queue current_ents (initialized as the initial entity set of high-frequency words), the processed entity set processed (initialized as the initial entity set of high-frequency words, used to mark entities that have been processed), and the iteration counter iteration (initialized to 1); at the same time, generate 1024-dimensional embedding vectors for the initial entity set of high-frequency words through the bge-m3 embedding vector model and store them in the entity embedding dictionary entity_embeddings, laying the foundation for subsequent semantic deduplication; (2) Loop processing stage: For each entity e (e is the entity in the current queue of entities to be processed, current_ents), if e is already in the processed entity set processed, it is skipped directly; if there is no relevant fragment in the retrieval enhancement stage, the entity is also skipped; if there is a relevant fragment, triples are extracted segment by segment through the large model (the extraction rule requires that each triple must contain entity e), and the following processing is performed on each triple: ① Entity semantic matching and determination For the other entity in the triplet besides 'e' (i.e., the candidate new entity to be determined), calculate the bge-m3 1024-dimensional cosine similarity with all entities already stored in the entity embedding library. Based on the similarity result, process them in two categories: if the similarity is ≤0.9, it is determined to be a completely new entity, and a bge-m3 embedding vector is immediately generated for it and stored in the entity embedding library. Simultaneously, the new entity is directly added to the next round of entity queue next_ents (next_ents is the set storing entities to be processed in the next round), retaining the original name of the new entity.
[0048] If the similarity is greater than 0.9, it means that the candidate entity is a different representation of an existing entity, and it is replaced with the corresponding standard entity (without embedded storage and without enqueue operation). ② Triple deduplication and inventory entry For the standardized triples that have been processed, they are handled in two categories based on whether the entity has been replaced: If the triple is a new entity tag (similarity ≤ 0.9), since the new entity must correspond to a completely new triple, it is directly added to the triple_set set of the knowledge graph (triple_set is a set that stores all standardized triples) and written to the CSV file in real time; if the triple is a semantic replacement (similarity > 0.9), it is first determined whether it already exists in the triple_set set (although the replaced entity is an existing entity, the triple may still be a new triple that has not been included and needs to be verified by the triple_set). If it does not exist, it is added to the triple_set set and written to the CSV file in real time. If it exists, no operation is performed.
[0049] After all entities in this round have been processed, all entities in next_ents are added to the processed set (marked as processed), and the current queue of entities to be processed, current_ents, is updated to next_ents, before proceeding to the next iteration. (3) Termination judgment stage: When current_ents is empty, or the iteration counter reaches the preset maximum threshold (e.g., 10), the iteration terminates and outputs the triplet CSV file to avoid invalid loops and resource waste.
[0050] Through a deep collaborative closed-loop design involving semantic retrieval, RAG-enhanced generation, precise extraction from large models, and iterative expansion of associated entities, a technical paradigm of accurate positioning, efficient extraction, and stable expansion has been constructed. This provides a solution that balances accuracy, completeness, and stability for triple extraction in the zero-annotation scenario of professional books, and is the core support for achieving a breakthrough in the overall method performance.
[0051] S104. The triple set is stored in a structured CSV file, and then the CSV file is classified into entities and imported into a graph database to form a knowledge graph visualization.
[0052] In this embodiment of the invention, the domain triple set generated during the iterative extraction stage is written into a CSV file using a three-column format of subject, predicate, and object. This CSV file provides standardized, structured storage. Then, the subject and object entities in the CSV file are categorized and labeled to generate a standard CSV file containing category labels. This standard CSV file is then imported into the Neo4j graph database to ultimately construct a structured knowledge graph that supports visualization, entity association retrieval, and graph neural network inference. To ensure the uniqueness of the triple data, the bidirectional traceability of entity associations, and the interpretability of the graph representation, and to adapt to the characteristics of dense terminology and complex entity association logic in professional book texts in an engineering scenario without human intervention, this embodiment of the invention achieves this through the following mechanism, the specific process of which is as follows:
[0053] 1. Entity Classification Taking the field of motion control as an example, the entity classification in this field is shown in Table 2 below: Table 2 Entity Classification in the Motion Control Domain Based on the pre-defined entity classification rules in the motion control domain, the triple entities extracted by iterative RAG are classified. A batch inference strategy is employed to improve execution efficiency, reading 10 triple data entries from a CSV file each time and extracting the subject and object entities. The batch entities are then concatenated with classification prompts (Table 2) and input into the qwen-14b large-scale model to complete automatic entity classification. The model's output classification labels match the corresponding entities and are simultaneously added to the corresponding columns in the CSV file, ultimately generating a standard CSV file containing subject, predicate, object, subject_label, and object_label, providing a standardized and structured data foundation for subsequent Neo4j knowledge graph database entry. The corresponding entity classification prompts for this domain are shown in Table 3.
[0054] Table 3. Entity Classification Hints in the Motion Control Domain 2. Data format compatibility verification Perform Neo4j pre-input format validation on standard CSV files to confirm the compatibility of the five-column structure (subject, predicate, object, subject_label, object_label), UTF-8 encoding, and Neo4j LOAD CSV command parsing specifications, ensuring no basic format conflicts.
[0055] 3. Inbound Execution Based on a standard CSV file that has passed format validation, a Cypher import script was written. The MERGE statement replaces the regular creation statement, avoiding the problem of duplicate insertion of nodes and relationships into the database. The core import script is shown in Table 4 below: Table 4 Cypher import script Executing the Cypher script described above in the Neo4j graph database environment batch imports standardized CSV file data into the database after format validation. The script also directly outputs statistical results for head entities, tail entities, and relationships for database entry verification. This section demonstrates the transformation of CSV format triple data into a Neo4j knowledge graph through a format validation process and a standardized database entry scheme design.
[0056] based on Figure 1 The domain knowledge triple extraction method shown here analyzes the acquired domain-specific text and transforms it into a structured vector knowledge base that can be efficiently retrieved, providing high-quality and efficient data support for triple extraction. Then, the domain-specific text is quantitatively calculated and fused for screening to mine the initial entities of core high-frequency words in the domain that have both global high frequency and cross-text universality. This avoids the "local optimum, global deviation" problem caused by single word frequency, effectively avoids interference from non-core terms, and improves the stability, relevance, and efficiency of iterative extraction. Furthermore, the iterative RAG algorithm, combined with the structured vector knowledge base, the accurate extraction of large models, and the expansion of related entities, performs closed-loop iteration on the initial entities of high-frequency words. This can mine explicit and implicit semantic relationship triples in the text layer by layer, ensuring the strong relevance and structural integrity of the extracted triples, thereby improving the professionalism and accuracy of the model's triple extraction.
[0057] To verify the effectiveness of the domain knowledge triple extraction method provided by this invention, a comparative experiment was also conducted in this embodiment, and the experimental results were analyzed. The specific process is as follows: 1. Experimental setup (1) Experimental environment The hardware environment utilizes an Intel i5-13600KF CPU, an NVIDIA RTX 4070S GPU (12GB VRAM), and 32GB DDR5 RAM, representing a lightweight configuration that can support experimental operation without requiring high-end computing power. The software environment is built on Python 3.9 and integrates PyTorch 1.13.1, Ollam 0.1.28 (deploying the qwen:14b large model as the core RAG extraction unit, without fine-tuning or training), the bge-small-en-v1.5 embedding model (used for RAG retrieval vectorization), the FAISS 1.7.4 vector retrieval engine, and the NetworkX 2.8.4 knowledge network connectivity analysis tool, ensuring the compatibility and stability of the experimental toolchain.
[0058] (2) Dataset design The dataset uses a chapter from the book "Motion Control Systems" as the experimental case, with a total of approximately 12,000 characters. To ensure the objectivity of the experimental evaluation, this chapter was annotated by experts in the field of motion control systems to form 453 standard triples, which serve as a quantitative evaluation benchmark for the triple extraction performance of each method.
[0059] (3) Design of comparative schemes To accurately verify the effectiveness of the core innovations of the proposed method, the comparative scheme design focuses on three core variables: "whether an iterative mechanism is introduced," "initial entity type (high-frequency words / random words)," and "whether RAG retrieval is introduced." Four differentiated schemes are selected, and the fairness and targeting of the comparison are ensured through progressive combinations of variables. Regarding sexuality and hierarchy, see Table 5.
[0060] Table 5. Description of the core components of each method The specific design scheme is as follows: (1) Large model scheme: Taking qwen:14b and prompt word engineering as the core, the qwen:14b large model is used to extract prompt words in one go. There is no related entity iteration, no RAG, and no high-frequency words. It forms a comparison scheme with the random word iteration large model to verify the role of related entity iteration. (2) Random word iterative large model scheme: Taking qwen:14b and prompt word engineering as the core, an iterative expansion mechanism is introduced (iteration requires initial entities), without semantic retrieval and high-frequency word initial entities, the initial entities are randomly selected from the book text (3), forming a comparison scheme with the random word iterative RAG large model to verify the role of semantic retrieval; (3) Random word iterative RAG large model scheme: Taking qwen:14b and prompt word engineering as the core, an iterative expansion mechanism and semantic retrieval are introduced. The initial entities are still randomly selected (3), forming a comparison scheme with the method in this paper to verify the role of high-frequency word initial entities; (4) The proposed scheme (high-frequency word iterative RAG large model): taking qwen:14b and prompt word engineering as the core, it integrates three technologies: related entity iteration, semantic retrieval, and high-frequency word initial entities (3), as the target scheme for experimental verification, to verify the comprehensive performance of the three technologies working together.
[0061] All four approaches are executed on the same hardware environment, software toolchain, and dataset, with differences only in methodology. This ensures the comparability of experimental results and clearly quantifies the independent contribution and synergistic value of the three components: iteration mechanism, RAG retrieval, and high-frequency word initial entities. This progressively verifies the superiority of the proposed method.
[0062] (4) Evaluation index system To comprehensively and accurately quantify the core performance of each solution, an evaluation system based on quantitative indicators is constructed, covering four key dimensions: extraction accuracy, correlation completeness, overall performance, and operational efficiency. The definitions, calculation formulas, and variable explanations for each indicator are as follows: 1) Precision (P) Definition: Used to measure the accuracy of triple extraction, reflecting the ability of the scheme to avoid redundant and erroneous associations. The calculation formula is as follows:
[0063] Variable description: TP represents the number of correct triples that perfectly match the expert annotations in terms of subject, relation, and object; FP represents the number of incorrect triples that did not appear in the expert annotation test set, including cases of redundant associations, misjudgment of relations, and entity recognition errors.
[0064] 2) Recall (R) Definition: Used to evaluate the completeness of triple extraction, reflecting the solution's ability to capture core domain associations. The calculation formula is as follows: Variable descriptions: TP is defined in the same way as precision; FN represents the number of core triples not extracted in the expert-annotated test set; the expert-annotated test set is fixed at 153 valid triples to ensure a consistent evaluation benchmark.
[0065] 3). F1 Score (F1) Definition: A core metric that comprehensively balances precision and recall, avoiding evaluation bias caused by a single metric and fully reflecting the overall performance of the solution. The calculation formula is shown below:
[0066] Variable description: P is precision and R is recall, both of which are calculated using the aforementioned formula.
[0067] 4) Total Iteration Time (T) Definition: Used to measure the operational efficiency of a solution and reflect the timeliness of the entire process.
[0068] Calculation method: Under a unified hardware environment and software toolchain, record the complete runtime from input to final knowledge graph output, in minutes (min).
[0069] Note: The average of three independent runs is taken to eliminate random errors and ensure the reliability of the efficiency assessment.
[0070] 2. Experimental Results and Analysis (1) Overall quantitative comparative analysis Based on 453 triplet annotations by experts, the overall performance of the four types of schemes was quantitatively compared, and the results are shown in Table 6.
[0071] Table 6 Comparison of Quantitative Indicators for Each Comparison Scheme Results analysis: The experimental results show that the accuracy of the large model scheme reached 81.6%, reflecting the ability of qwen-14b to extract triples, which is the highest among the four schemes; however, the recall rate of this scheme was 24.1%, resulting in an F1-Score of only 37.2%. The knowledge coverage of the extracted results was seriously insufficient and could not meet the application requirements at all. The subsequent manual completion cost was extremely high.
[0072] Compared to the large-scale model approach, the random word iterative large-scale model introduces the associated entity iteration technique. This technique improves the completeness of its extraction, increasing the recall rate from 24.1% to 67.7%, meaning that a large number of correct triples were successfully extracted, and the F1-Score also increased from 37.2% to 73.1%. This fully verifies that associated entity iteration can effectively overcome the limitations of single extraction in large-scale models, extracting more triples and improving knowledge coverage. However, this approach requires traversing the text to find associations during the iteration process, which easily introduces a large number of redundant associations (such as invalid associations of non-core terms and redundant triples of repeated expressions), resulting in a precision rate of 79.4%, the lowest among the four types of approaches.
[0073] The RAG large-scale random word iterative model incorporates semantic retrieval technology on top of the existing random word iterative model. Compared to the random word iterative model, its precision increased from 79.4% to 80.7%, recall from 67.7% to 75.8%, and the overall F1-Score from 73.1% to 78.2%, fully demonstrating the role of semantic retrieval in accurately locating relevant text fragments, filtering irrelevant information, and reducing invalid computation.
[0074] This paper proposes a method that incorporates high-frequency word techniques into the large-scale random word iterative RAG model. Compared to the random word iterative RAG approach, the precision of our method is improved from 80.7% to 81.3%, and the recall is improved from 75.8% to 78.2%. Precision is close to peak while recall is improved, and the extraction results cover nearly 80% of standard triples, significantly improving extraction completeness. The overall F1-Score is improved from 78.2% to 79.7%, achieving a balance between precision and recall. The results demonstrate that using core domain terms with both global high frequency and cross-textual applicability as the starting point for iteration effectively reduces invalid iterations and erroneous extractions, thereby improving extraction performance.
[0075] In summary, this paper's approach improves triplet extraction performance in zero-label professional text scenarios through three major techniques: associated entity iteration, semantic retrieval, and high-frequency word initial entity extraction. Experimental results show that associated entity iteration addresses the issues of contextual limitations, severe knowledge fragmentation, and low recall in large-scale model extraction, significantly improving knowledge coverage through iterative extraction. Semantic retrieval solves the problems of blindly traversing text and having many redundant associations in ordinary iterative schemes, simultaneously optimizing extraction accuracy and completeness by precisely matching strongly related contexts. High-frequency word initial entity extraction addresses the problem of easily deviating from the iteration direction due to random point selection, reducing invalid iterations and erroneous extractions, and achieving a comprehensive improvement in extraction performance.
[0076] (2) Specific case verification To supplement the quantitative analysis with detailed information, specific case excerpts (Table 7) were selected to compare and analyze the number of triplet extractions, the number of correct triplets, and the visualization features of the four schemes. The specific analysis is as follows:
[0077] Table 7 Original Text of Test Text Fragments The standard triplet results for the test fragments are shown in Table 8, and the corresponding knowledge graph visualization of the standard results is shown in Table 8. Figure 6 As shown: Table 8 Standard Triple Result Table The triple extraction results of the large model scheme are shown in Table 9, and the knowledge graph visualization is shown in Table 9. Figure 7 As shown: Table 9. Triple Extraction Results for the Pure Large Model Scheme Based on the data extracted from the large model scheme, this scheme only extracted 7 triples, of which 6 were correct, achieving a precision of 85.7%. However, the recall rate was only 26.1%, making it the group with the worst knowledge coverage among the four schemes. From the extraction results and graph visualization, it is evident that this scheme can only capture surface-level explicit triples in the text, exhibiting a significant fragmentation problem. Although 6 of the extracted triples are valid, they fail to connect the core control link of "incremental encoder → PID controller → servo drive," and also lack the crucial association between the servo motor and the drive / actuator. All entities in the graph are fragmented into 3 isolated clusters of unconnected nodes, with no connecting edges between clusters, completely disrupting the complete motion control logic. This result directly confirms that the single-step extraction mode with unconnected entities suffers from the limitations of the large model context window, making it difficult to extract cross-segment related triples. This is the core reason for the dispersed graph structure and fragmented knowledge.
[0078] The triple extraction results of the random word iterative large model scheme are shown in Table 10, and the knowledge graph visualization is shown in the figure below. Figure 8 As shown: Table 10. Triple Extraction Results of the Random Word Iterative Large Model Scheme Compared to the large-scale model approach, the performance of the random word iterative large-scale model approach was significantly improved after introducing associated entity iteration. A total of 20 triples were extracted, of which 16 were correct, achieving a precision of 80.0% and a recall rate that increased from 26.1% to 69.6%. As can be seen from the extraction results and graph visualization, through associated entity iteration, this approach successfully broke through the fragmented extraction limitations of the large-scale model. Through multiple rounds of entity association mining, a logical chain of "servo driver—servo motor—incremental encoder—PID controller" was formed, transforming previously scattered entities into a coherent technical link. All entities in the graph were grouped into the same knowledge association network, eliminating isolated node clusters, and the completeness of triple extraction was fundamentally improved compared to the large-scale model approach. However, this scheme only introduces iterative techniques for related entities without combining them with semantic retrieval techniques. It remains limited by the context window of the large model, meaning it cannot complete global semantic modeling of long texts in one go, making it difficult to extract implicit relationships across segments. Furthermore, the illusion problem in the large model generation process is not effectively constrained, resulting in the omission of seven standard triples and the generation of four redundant relationships due to the lack of filtering of invalid information. This explains why its accuracy drops compared to other schemes. Overall, although this scheme improves the completeness of triple extraction, the problems of missing implicit relationships and interference from redundant relationships still exist.
[0079] The triple extraction results of the random word iterative RAG large model scheme are shown in Table 11, and the knowledge graph visualization is as follows: Figure 9 As shown: Table 11. Triple Extraction Results of the Random Word Iteration RAG Large Model Scheme By introducing semantic retrieval into the random word iterative large model scheme, the extraction performance of the random word iterative RAG large model scheme improved precision and recall. A total of 22 triples were extracted, of which 18 were correct, resulting in an extraction precision of 81.8% and a recall of 78.3%. As can be seen from the extraction results and graph visualization, this scheme not only extracted the logical chain of "servo driver - servo motor - incremental encoder - PID controller," but also accurately located implicitly related text through semantic retrieval, effectively extracting triples missed by the random word iterative RAG large model scheme, such as (servo motor, is the core execution component of..., motion control system) and (servo motor, driven by coupling, ball screw), thus improving the completeness of the extraction. The introduction of semantic retrieval technology not only broke through the length limit of the large model's context window by using semantically retrieved original text fragments, achieving accurate location of implicit cross-fragment relationships, but also imposed strong constraints on the generation of the large model, effectively suppressing the illusion problem and achieving improvements in precision and recall. However, the initial entities in this scheme are randomly selected, which essentially increases the probability of invalid iterations. This results in the need to process entities and their associations that are not closely related to the core logic of the domain during the iteration process, generating four redundant triples. This restricts the further improvement of precision and recall, and also confirms that the lack of domain core guidance in the selection of initial entities will affect the extraction quality.
[0080] The triplet extraction results of this invention are shown in Table 12, and the knowledge graph visualization is as follows: Figure 10 As shown: Table 12. Ternary extraction results of this invention This invention further improves extraction quality by introducing high-frequency word initial entity technology, extracting a total of 21 triples, of which 18 are correct, increasing precision to 85.7% while maintaining recall at 78.3%. Due to the limited content of the test text, the improvement in recall brought by high-frequency word initial entity technology was not fully demonstrated, but it did show that the technology effectively reduces invalid iterations and improves precision. As can be seen from the extraction results and graph visualization, the method of this invention achieves optimal triple extraction results through a synergistic approach of high-frequency word initial entity, associated entity iteration, and semantic retrieval. The extracted triples are all closely related to the core logic chain, forming an association network of "composition—signal acquisition—instruction generation—drive execution—motion output," thus reconstructing the technical association logic of the motion control system from component composition to motion output.
[0081] A progressive comparison of the four approaches clearly demonstrates that the three technologies deliver targeted performance improvements. First, iterative entity association is key to addressing knowledge fragmentation. Through multi-round entity association extraction, it eliminates isolated nodes and broken logic, increasing the recall rate of standard triplets from 26.1% to 69.6%, achieving a significant leap in knowledge coverage and forming the foundation for building a complete knowledge association network. Second, semantic retrieval is crucial for improving extraction quality. It overcomes the length limitations of large model context windows, enabling precise localization of implicit associations and further increasing the recall rate of standard triplets to 78.3%. It also suppresses the illusion problem of large models through original text constraints, achieving a simultaneous improvement in precision. Third, high-frequency word initial entity technology is key to ensuring extraction efficiency and domain focus. By avoiding interference from marginal entities from the iteration source, the entire extraction process unfolds from the core domain knowledge. While maintaining stable recall, it increases precision from 81.8% to 85.7%, reducing redundant triplet generation and ineffective iteration overhead, further improving the accuracy and effectiveness of triplet extraction.
[0082] In this specific case study, the trends in precision and recall of the four schemes are consistent with the overall quantitative analysis of the above, which fully verifies that the technical architecture of collaborative interaction between related entity iteration, semantic retrieval, and high-frequency word initial entities achieves the best comprehensive effect in triple extraction.
[0083] When applying the domain knowledge triple extraction method provided in this manual, it is not necessary to rely on... Figure 1 The steps shown are executed in sequence. The specific execution order of each step can be determined as needed, and this manual does not impose any restrictions on it.
[0084] The above describes one or more embodiments of the domain knowledge triple extraction method provided in this specification. Based on the same approach, this specification also provides a corresponding domain knowledge triple extraction system, such as... Figure 11 As shown.
[0085] Figure 11 This specification provides a schematic diagram of a domain knowledge triple extraction system, which includes: The acquisition and construction module 701 is used to acquire domain-specific text in multiple formats, parse the domain-specific text, and construct a structured vector knowledge base. The filtering module 702 is used to perform quantitative calculations and fusion filtering on the professional text in the field to generate initial entities of high-frequency words; The iterative generation module 703 is used to perform multiple rounds of iteration on the initial entity of the high-frequency words through the iterative RAG algorithm, in conjunction with the structured vector knowledge base, to generate a set of triples corresponding to the domain-specific text. The storage and visualization module 704 is used to perform bidirectional association mapping and storage on the triple set, generate a knowledge graph, and then perform structured visualization output.
[0086] For specific limitations regarding the domain knowledge triple extraction system, please refer to the limitations of the domain knowledge triple extraction method mentioned above, which will not be repeated here. Each module in the aforementioned domain knowledge triple extraction system can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0087] This specification also provides a computer-readable storage medium storing a computer program that can be used to execute the above-described... Figure 1 The provided method for extracting domain knowledge triples.
[0088] This instruction manual also provides Figure 12 The schematic diagram of the computer device shown is as follows: Figure 12 At the hardware level, the computer device includes a processor, internal bus, network interface, memory, and non-volatile memory, and may also include other hardware required for business operations. The processor reads the corresponding computer program from the non-volatile memory into memory and then runs it to achieve the above-mentioned functions. Figure 1 The provided method for extracting domain knowledge triples.
[0089] The domain knowledge triple extraction method and system provided in this manual provide high-quality and efficient data support for triple extraction by parsing the acquired domain-specific text and transforming it into a structured vector knowledge base that can be efficiently searched. Then, the domain-specific text is quantitatively calculated and fused for screening to mine the initial entities of core high-frequency words in the domain that have both global high frequency and cross-text universality. This avoids the "local optimum, global deviation" problem caused by single word frequency, effectively avoids interference from non-core terms, and improves the stability, relevance, and efficiency of iterative extraction. Furthermore, the iterative RAG algorithm, combined with the structured vector knowledge base, the accurate extraction of large models, and the expansion of related entities, performs closed-loop iteration on the initial entities of high-frequency words. This can mine explicit and implicit semantic relationship triples in the text layer by layer, ensuring the strong relevance and structural integrity of the extracted triples, thereby improving the professionalism and accuracy of the model in extracting triples.
[0090] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0091] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
Claims
1. A method for extracting domain knowledge triples, characterized in that, include: Acquire domain-specific texts in multiple formats, parse the domain-specific texts, and construct a structured vector knowledge base; The parsed domain-specific text is subjected to quantitative calculation and fusion screening to generate initial entities of high-frequency words; By using the iterative RAG algorithm, combined with the structured vector knowledge base, multiple iterations are performed starting from the high-frequency word initial entities to generate a set of triples corresponding to the domain-specific text. The set of triples is stored in a structured CSV file, and then the CSV file is classified into entities and imported into a graph database to form a knowledge graph visualization.
2. The domain knowledge triple extraction method as described in claim 1, characterized in that, The parsed domain-specific text is subjected to quantitative calculation and fusion filtering to generate initial entities of high-frequency words, including: Obtain the domain prior terminology library and calculate the local absolute frequency of each prior term in each domain-specific text. The global term frequency is obtained by accumulating the local frequency of each prior term in professional texts across all domains. The document coverage rate is obtained by calculating the ratio of the number of texts containing the term to the total number of texts. The global word frequency and the document coverage are converted into a single fusion score by weighted fusion, and high-frequency word initial entities are selected from the domain prior term library based on the fusion score.
3. The domain knowledge triple extraction method as described in claim 2, characterized in that, The initial entities for selecting high-frequency words from the domain prior terminology database based on fusion scores include: Based on the fusion score, all prior terms in the domain prior terminology library are sorted in descending order, and the top K terms are selected to form the initial entity set. The initial entity set is processed by frequency parallelism, insufficient effective terms, invalid cross-text, and empty set to filter out high-frequency initial entities.
4. The domain knowledge triple extraction method as described in claim 1, characterized in that, The iterative RAG algorithm, combined with the structured vector knowledge base, uses the initial high-frequency word entities as a starting point to perform multiple iterations, generating a set of triples corresponding to the domain-specific text. Specifically, this includes: Semantic retrieval is performed on the initial entities of high-frequency words, and text fragments associated with the initial entities of high-frequency words are located from the structured vector knowledge base based on the processing results. The design domain adapts the prompt words, and the corresponding triples are extracted from the text fragments using a pre-trained large language model based on the prompt words; The extracted triples are subjected to multiple rounds of related entity expansion iterations to mine multiple related entities. The above steps are repeated for each related entity to generate a set of triples corresponding to the domain-specific text.
5. The domain knowledge triple extraction method as described in claim 4, characterized in that, The step of performing semantic retrieval on the initial entities of high-frequency words and locating text fragments associated with the initial entities of high-frequency words from the structured vector knowledge base based on the processing results specifically includes: High-frequency word initial entities are input into a pre-trained text embedding model to generate query vectors; Calculate the cosine similarity between the query vector and all text fragment vectors in the structured vector knowledge base; Candidate text segments with similarity higher than a threshold are selected, sorted in descending order of similarity, and the top N text segments are returned as the text segments associated with the initial entity of the high-frequency word.
6. The domain knowledge triple extraction method as described in claim 5, characterized in that, Also includes: The triples extracted from the large language model are standardized by performing format validation and redundancy removal.
7. The domain knowledge triple extraction method as described in claim 6, characterized in that, The text embedding model is the bge-m3 model, and the large language model is the Qwen-14B model.
8. A domain knowledge triple extraction system, characterized in that, include: The acquisition and construction module is used to acquire domain-specific text in multiple formats, parse the domain-specific text, and construct a structured vector knowledge base. The filtering module is used to perform quantitative calculations and fusion filtering on the parsed domain-specific text to generate initial entities of high-frequency words. The iterative generation module is used to generate a set of triples corresponding to the domain-specific text by using the iterative RAG algorithm in conjunction with the structured vector knowledge base, starting from the initial entity of the high-frequency words and performing multiple rounds of iteration. The storage and visualization module is used to store the triple set in a structured CSV file, then classify the entities in the CSV file and import it into a graph database to form a knowledge graph visualization.
9. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the method described in any one of claims 1 to 7.
10. A computer device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method described in any one of claims 1 to 7.