PDF knowledge graph construction method and device, equipment, storage medium and program product

By performing chunking and clustering on PDF documents, combined with large language models and embedding models, the problem of deviation between knowledge point clustering and document logical structure is solved, achieving high-quality knowledge graph construction and improving the accuracy and completeness of knowledge extraction.

CN121579708BActive Publication Date: 2026-05-01CHENGDOU HUAQIYUN TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHENGDOU HUAQIYUN TECH CO LTD
Filing Date
2026-01-27
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively integrate the semantic and locational information of knowledge points in the construction of knowledge graphs for PDF documents, leading to a deviation between the knowledge point clustering results and the document's logical structure.

Method used

By segmenting text based on text content, page number information, and paragraph structure, knowledge points are extracted using a large language model and an embedding model. Semantic similarity and page number position information are used for clustering to construct a hierarchical knowledge point tree. Finally, a knowledge graph is constructed through candidate relationship description and consistency verification.

Benefits of technology

It achieves knowledge point clustering that is more consistent with document structure, improves the accuracy, robustness and interpretability of knowledge graphs, and significantly enhances the quality of knowledge extraction and organization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121579708B_ABST
    Figure CN121579708B_ABST
Patent Text Reader

Abstract

The application discloses a PDF knowledge graph construction method and device, equipment, a storage medium and a program product, relates to the technical field of data processing, and comprises the following steps: performing block processing on a PDF document based on the text content, page number information and paragraph structure of the PDF document to be processed, and obtaining a set of text blocks to be processed; extracting knowledge points from the text blocks to be processed to obtain a plurality of knowledge points and page number position information where the knowledge points are located; performing clustering processing on the knowledge points based on the semantic similarity and the page number position information between the knowledge points, and obtaining a hierarchical knowledge point tree; determining a plurality of candidate relationship descriptions of a knowledge node through a large language model, determining a relationship type of the knowledge node and other knowledge nodes in the hierarchical knowledge point tree based on the semantic similarity between the candidate relationship description of the current knowledge node and the text description of the other knowledge nodes in the hierarchical knowledge point tree, and constructing a knowledge graph of the PDF document to be processed, so that high-quality extraction and organization of structured document knowledge are realized.
Need to check novelty before this filing date? Find Prior Art

Description

PDF knowledge graph construction methods, apparatus, equipment, storage media, and program products Technical Field

[0001] This application relates to the field of data processing technology, and in particular to methods, apparatus, devices, storage media, and program products for constructing PDF knowledge graphs. Background Technology

[0002] With the explosive growth of PDF-format digital documents such as academic papers, textbooks, and technical manuals, how to automatically extract structured knowledge points from them and construct high-quality knowledge graphs has become a key research direction in the field of knowledge engineering and intelligent learning systems.

[0003] In related technologies, the construction of knowledge graphs for PDF documents typically relies on fixed-length blocks, paragraph segmentation, or pure semantic clustering to organize knowledge points. These methods mostly remain at the level of pure semantic similarity calculation, lacking the integration and utilization of the physical location relationships within the document. However, in structured documents such as academic papers, technical manuals, or textbooks, the spatial distribution of knowledge points often contains important logical connections. Traditional methods struggle to capture this complex relationship between location and semantics, easily leading to deviations between the knowledge point clustering results and the document's logical structure. Therefore, how to integrate semantic and location information in knowledge point clustering remains a pressing issue in the field of PDF document knowledge graph construction. Summary of the Invention

[0004] The main purpose of this application is to provide a method, apparatus, device, storage medium and computer product for constructing PDF knowledge graphs, aiming to solve the technical problem of deviation between knowledge point clustering results and document logical structure in the construction of PDF knowledge graphs.

[0005] To achieve the above objectives, this application proposes a method for constructing a PDF knowledge graph, the method comprising:

[0006] Based on the text content, page number information, and paragraph structure of the PDF document to be processed, the PDF document is divided into blocks to obtain a set of text blocks to be processed.

[0007] For each text block in the set of text blocks to be processed, knowledge points are extracted from the text block to obtain multiple knowledge points and the page number position information of the knowledge points.

[0008] Based on the semantic similarity and page number position information between each knowledge point, the knowledge points are clustered to obtain a hierarchical knowledge point tree;

[0009] For each knowledge node in the hierarchical knowledge point tree, multiple candidate relation descriptions of the knowledge node are determined through a large language model. Based on the semantic similarity between the candidate relation description of the current knowledge node and the text descriptions of other knowledge nodes in the hierarchical knowledge point tree, the relation type between the knowledge node and other knowledge nodes in the hierarchical knowledge point tree is determined, and a knowledge graph of the PDF document to be processed is constructed.

[0010] In one embodiment, the step of dividing the PDF document into blocks based on its text content, page number information, and paragraph structure to obtain a set of text blocks to be processed includes:

[0011] The PDF document to be processed is parsed to obtain the structured parsing results of the PDF document;

[0012] The PDF text content in the structured parsing result is sequentially traversed and the length of the traversed text is accumulated. When the accumulated length of the traversed text reaches the first text length, the position of the next paragraph of the currently traversed text is detected, and the page span between the next paragraph position and the currently traversed text paragraph is determined.

[0013] If the page span exceeds the maximum allowed span, stop traversing and treat the traversed text as a block of text to be processed.

[0014] If the page span does not exceed the maximum allowed span, continue traversing until the second text length is reached, and treat the traversed text as a text block to be processed.

[0015] Complete the traversal of the entire PDF document to be processed, and obtain the set of text blocks to be processed.

[0016] In one embodiment, the step of extracting knowledge points from each text block in the set of text blocks to be processed to obtain multiple knowledge points includes:

[0017] For each text block in the set of text blocks to be processed, the text block to be processed is input into the large language model, and combined with the prompt words, multiple knowledge points and the page number position information of each knowledge point are output.

[0018] Input the title and content corresponding to the knowledge point into the Embedding model to obtain a high-dimensional vector representation of the knowledge point;

[0019] A set of knowledge points is constructed based on the high-dimensional vector representation of knowledge points and the corresponding page number position information.

[0020] In one embodiment, the step of clustering knowledge points based on semantic similarity and page number position information to obtain a hierarchical knowledge point tree includes:

[0021] For any two knowledge point elements in the knowledge point set, the comprehensive similarity between the two knowledge point elements is determined based on the semantic similarity between the two knowledge point elements and the page number distance weight between the two elements.

[0022] For each knowledge point element in the knowledge point set, based on the comprehensive similarity between the current knowledge point element and other knowledge point elements, high-quality neighbors are selected for each knowledge point element, and edges are added between the knowledge point and its neighbors to construct a sparse graph of knowledge points.

[0023] The community detection algorithm is used to cluster the sparse graph of knowledge points to obtain multiple clusters.

[0024] By generating corresponding topics for each cluster using a large language model, a hierarchical knowledge point tree is obtained.

[0025] In one embodiment, for each knowledge node in a hierarchical knowledge point tree, a candidate relation description for the knowledge node is determined using a large language model. Based on the similarity between the candidate relation description of the current knowledge node and other knowledge nodes in the hierarchical knowledge point tree, a knowledge node relation network is determined, and a knowledge graph of the PDF document to be processed is constructed. The steps include:

[0026] For each knowledge node in the hierarchical knowledge point tree, we determine multiple candidate relation types for the knowledge node, and generate multiple candidate relation descriptions for each candidate relation type using a large language model.

[0027] For each knowledge node in the hierarchical knowledge point tree, a coarse match is performed based on the cosine similarity between the candidate relation description of the current knowledge node and the text description of other knowledge nodes to determine the candidate target relation type between the current knowledge node and other knowledge nodes from multiple candidate relation types.

[0028] The candidate target relation types are then validated again using the large language model to determine the target relation types between the current knowledge node and other knowledge nodes.

[0029] Construct a knowledge graph of the PDF documents to be processed.

[0030] In one embodiment, before constructing the knowledge graph of the PDF document to be processed, the following steps are included:

[0031] Perform a consistency check on any two nodes that have a relationship to determine the consistency of the relationship between the two nodes;

[0032] If the relationship between two nodes is inconsistent, the relationship will be repaired according to the corresponding repair strategy.

[0033] Secondly, to achieve the above objectives, this application further provides a PDF knowledge graph construction apparatus, the apparatus comprising:

[0034] The text block confirmation module divides the PDF document into blocks based on the text content, page number information, and paragraph structure of the PDF document to be processed, and obtains a set of text blocks to be processed.

[0035] The knowledge point extraction module extracts knowledge points from each text block in the set of text blocks to be processed, and obtains multiple knowledge points and the page number information where the knowledge points are located.

[0036] The clustering module performs clustering on knowledge points based on semantic similarity and page number position information between them, and obtains a hierarchical knowledge point tree.

[0037] The knowledge graph construction module, for each knowledge node in the hierarchical knowledge point tree, determines multiple candidate relation descriptions of the knowledge node through a large language model. Based on the semantic similarity between the candidate relation description of the current knowledge node and the text descriptions of other knowledge nodes in the hierarchical knowledge point tree, it determines the relation type between the knowledge node and other knowledge nodes in the hierarchical knowledge point tree, and constructs the knowledge graph of the PDF document to be processed.

[0038] Thirdly, to achieve the above objectives, this application further provides a PDF knowledge graph construction device, the device comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being configured to implement the steps of the above-described PDF knowledge graph construction method.

[0039] Fourthly, to achieve the above objectives, this application further provides a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the above-described PDF knowledge graph construction method.

[0040] Fifthly, to achieve the above objectives, this application further provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the above-described PDF knowledge graph construction method.

[0041] One or more technical solutions proposed in this application have at least the following technical effects:

[0042] This application integrates semantic information and document physical location information, and introduces a multi-layered verification mechanism using a large language model in the knowledge point clustering and relation recognition stages. Through page-number-aware intelligent segmentation, semantic-location fusion-based comprehensive similarity calculation, sparse graph neighbor construction, and community discovery clustering, it achieves a hierarchical knowledge point tree that better conforms to the document's knowledge structure. Simultaneously, it utilizes a large model to generate candidate relation descriptions and performs secondary semantic verification, making relation recognition more accurate and reliable. Furthermore, through relation consistency verification and repair mechanisms, it further enhances the structural integrity and logical rigor of the knowledge graph, thereby significantly improving the accuracy, robustness, and interpretability of PDF knowledge graph construction, and achieving high-quality extraction and organization of structured document knowledge. Attached Figure Description

[0043] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0044] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, those skilled in the art can obtain other drawings based on these drawings without creative effort.

[0045] Figure 1 is a flowchart illustrating the PDF knowledge graph construction method in an embodiment of this application.

[0046] Figure 2 is a schematic diagram of the module connections of the PDF knowledge graph construction device.

[0047] Figure 3 is a schematic diagram of the structure of the PDF knowledge graph construction device.

[0048] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0049] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.

[0050] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.

[0051] The main solution of this application embodiment is as follows: intelligently segment the document by parsing the text content, page number information and paragraph structure, extract knowledge points with page number position information from the text blocks, and construct a knowledge point set by combining embedding vectors; then construct a sparse graph of knowledge points based on the comprehensive similarity of semantic similarity and page number distance, and form a hierarchical knowledge point tree through community detection algorithm; on this basis, use a large language model to generate candidate relation descriptions, determine the relationship type between nodes through coarse matching and secondary verification, and perform consistency verification and repair on the relations, finally generating a PDF document knowledge graph with clear structure and accurate semantics.

[0052] Specifically, this application provides a method for constructing a PDF knowledge graph. Referring to Figure 1, which is a flowchart of the first embodiment of the PDF knowledge graph construction method of this application.

[0053] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device capable of performing the above functions, such as a PDF knowledge graph construction device. The following description uses a PDF knowledge graph construction device as an example to illustrate this embodiment and the subsequent embodiments.

[0054] In this embodiment, the PDF knowledge graph construction method includes steps S10 to S40:

[0055] Step S10: Based on the text content, page number information, and paragraph structure of the PDF document to be processed, the PDF document is divided into blocks to obtain a set of text blocks to be processed.

[0056] It should be noted that this embodiment provides a text block segmentation method that introduces page number boundary constraints to avoid forcibly splitting cross-page content and ensure the semantic integrity of the segmentation.

[0057] In one feasible implementation, step S10 includes steps A10 to A50:

[0058] Step A10: Parse the PDF document to be processed to obtain the structured parsing result of the PDF document.

[0059] Step A20: Sequentially traverse the PDF text content in the structured parsing result and accumulate the traversed text length. When the accumulated traversed text length reaches the first text length, detect the next paragraph position of the currently traversed text and determine the page span between the next paragraph position and the currently traversed text paragraph.

[0060] In step A30, if the page span exceeds the maximum allowed span, stop traversing and treat the traversed text as a block of text to be processed.

[0061] In step A40, if the page span does not exceed the maximum allowed span, continue traversing until the second text length is reached, and treat the traversed text as a text block to be processed.

[0062] Step A50: Complete the traversal of the entire PDF document to be processed and obtain the set of text blocks to be processed.

[0063] Specifically, this step takes as input the structured parsing result (content_list.json) of the PDF document to be processed, including text content, page number information, paragraph hierarchy, etc., and outputs a collection of text blocks {Chunk1, Chunk2, ..., Chunk...} n}

[0064] For example, a PDF parsing tool such as MinerU is used to process the input PDF document to obtain structured data Content={content1,content2,...,content...}. n Each record contains content. i Contains text i (text content), page i (Page number information)

[0065] Subsequently, the block parameters are set as min_size = 2000 characters, max_size = 3000 characters, and page_gap_threshold = 2 pages. The parsed structured data is sequentially traversed, and each content element is accumulated, with the text length len_acc. When len_acc ≥ min_size, a decision is made on whether to continue merging.

[0066] If |page i+1 page i If |≤1 and len_acc≤max_size×1.2, then merge; if |page i+1 page i The `page_gap_threshold` directive forces text to be divided into chunks. The output text chunk set is `Chunks = {Chunk1, Chunk2, ..., Chunk}`. m}, each text block Chunk j Contains text j (text content) and [page_start] j ,page_end j(Page range). Specifically, when the cumulative length reaches max_size, check the page number of the next paragraph. i+1 If the next paragraph is on the same page or adjacent to the current block, and its cumulative length does not exceed max_size × 1.2, then continue merging. If the next paragraph has a large span (|page... i+1 page i If |>2), then forced chunking is enforced to avoid content mixing across pages. Each text chunk is preserved. j The page number range information [start_page, end_page].

[0067] Step S20: For each text block in the set of text blocks to be processed, extract knowledge points from the text block to be processed to obtain multiple knowledge points and the page number position information of the knowledge points.

[0068] It should be noted that each text block to be processed can obtain at least one knowledge point, and the location information of each knowledge point needs to be marked.

[0069] In one feasible implementation, step S20 may include steps B10 to B30:

[0070] Step B10: For each text block in the set of text blocks to be processed, input the text block to be processed into the large language model, combine it with the prompt words, and output multiple knowledge points and the page number position information of each knowledge point.

[0071] Step B20: Input the title and content corresponding to the knowledge point into the Embedding model to obtain a high-dimensional vector representation of the knowledge point.

[0072] Step B30: Construct a set of knowledge points based on the high-dimensional vector representation of the knowledge points and the corresponding page number position information.

[0073] Specifically, this implementation method inputs a set of text blocks to be processed: {Chunk1, Chunk2, ..., Chunk} n Output the set of knowledge points {KP1, KP2, ..., KP}. m Each knowledge point contains a unique identifier id, a knowledge point title title, a knowledge point description description, a page number (page number position information) page_idx, and a vector representation embedding.

[0074] For example, asynchronous concurrent calls are used to process each text chunk. i The large language model is used to extract knowledge points by combining prompt words, and each text chunk to be processed is processed.j The large language model outputs multiple knowledge points (KP). j ={kp1,kp2,...,kp k}, where 2≤k≤7.

[0075] In the design of the prompt words, the large language model is required to accurately label the page number for each knowledge point, and the page number must be the actual page number provided in the text and cannot be fabricated. Then, the correctness of the format of the large language model's output is verified; if the format is incorrect, it is retried (maximum 3 times).

[0076] Subsequently, the Embedding model is invoked in batches to generate a 768-dimensional vector representation for each knowledge point. The text input to the Embedding model consists of the knowledge point title and description. All vector representations are then processed to obtain the knowledge point set KP. Set ={KP1,KP2,...,KP n}

[0077] It is understandable that requiring large language models to annotate the accurate page numbers of knowledge points can provide basic data for subsequent weighted clustering based on page number positions.

[0078] Step S30: Based on the semantic similarity and page number position information between each knowledge point, cluster the knowledge points to obtain a hierarchical knowledge point tree.

[0079] It should be noted that this step takes a set of knowledge points as input and outputs a hierarchical knowledge point tree. The root node of the hierarchical knowledge point tree contains multiple sub-topics, and each sub-topic contains several knowledge points.

[0080] It's also worth noting that in related technologies, the construction of knowledge graphs for PDF documents typically relies on fixed-length blocks, paragraph segmentation, or pure semantic clustering to organize knowledge points. These methods fail to effectively utilize the document's page number location information and spatial structure features, often leading to problems such as fragmented content across pages, scattered related knowledge points, and unreasonable cluster boundaries. Some improvement schemes attempt to introduce textual semantic vectors for clustering, but these mostly remain at the level of pure semantic similarity calculation, lacking the integration and utilization of the document's physical location relationships.

[0081] Especially in structured documents such as academic papers, technical manuals, or textbooks, the spatial distribution of knowledge points often contains important logical connections. Knowledge points on adjacent pages usually belong to the same subject area, while knowledge points that are far apart, even if semantically similar, may belong to different chapters. Traditional methods struggle to capture this complex relationship between location and semantics, easily leading to deviations between knowledge point clustering results and the document's logical structure.

[0082] Therefore, this embodiment provides a clustering method based on the semantic similarity and page number position information between knowledge points, avoiding the deviation between the knowledge point clustering results and the document's logical structure.

[0083] In one feasible implementation, step S30 includes steps C10 to C40:

[0084] Step C10: For any two knowledge point elements in the knowledge point set, determine the comprehensive similarity between the two knowledge point elements based on the semantic similarity between the two knowledge point elements and the page number distance weight between the two knowledge point elements.

[0085] Step C10 further includes steps C11 to C14:

[0086] Step C11: For any two knowledge point elements in the knowledge point set, calculate the page number distance between the two knowledge point elements;

[0087] Step C12: If the page number distance does not exceed the preset threshold, then determine the page number distance weight based on the basic weight and the fast decay term;

[0088] Step C13: If the page number distance exceeds the preset threshold, determine the page number distance weight based on the basic weight and the slow decay term;

[0089] Step C14: The product of semantic similarity and page number distance weight is used as the comprehensive similarity.

[0090] For example, for any two knowledge points KP i and KP j This involves fusing vector semantic similarity with page number position information. First, vector similarity (semantic dimension) is calculated:

[0091]

[0092] in, Indicates semantic similarity.

[0093] Next, calculate the page number distance weight (position dimension): The vector representation of knowledge point i. This represents the vector representation of knowledge point j.

[0094] Then, the page number distance between the two knowledge points was calculated:

[0095] page distance =|page i page j |

[0096] Among them, pagedistance Indicates page number spacing, page i Page indicates the page number of knowledge point i. j This indicates the page number of knowledge point j.

[0097] Subsequently, the page distance weight was calculated using a double exponential decay function. weight :

[0098]

[0099] Among them, page distance Indicates page number spacing.

[0100] This double exponential decay function has the following characteristics: a fast decay term. Processing pages 0-10 results in fast decay rates, while slow decay rates apply to other pages. The decay rate is slow when processing pages 10-50, and a minimum value of 0.75 is guaranteed to prevent semantically similar knowledge points from being completely ignored.

[0101] In this example, the weight distribution is as follows: within the same page (page distance When =0, page weight ≈1.20 Improvement by 20%, adjacent pages (page distance =1-2) when page weight ≈1.05-1.15, an increase of 5%-15%, medium distance (page) distance =10) page weight ≈0.85 decreased by 15%, extremely long distance (page distance =50) page weight The minimum value is approximately 0.75, while still retaining 75% weight, so that the subsequent clustering results both conform to semantic similarity and respect the document's logical structure.

[0102] Finally, the overall similarity (multi-source fusion) is calculated:

[0103] hybrid similarity =vector similarity ×page weight

[0104] Among them, hybrid similarity Representing the overall similarity, vector similarity Indicates semantic similarity, page weight This indicates the page number distance weight.

[0105] Step C20: For each knowledge point element in the knowledge point set, based on the comprehensive similarity between the current knowledge point element and other knowledge point elements, select high-quality neighbors for each knowledge point element, add edges between the knowledge point and its neighbors, and construct a sparse graph of knowledge points.

[0106] Specifically, collect the potential neighbors of the current knowledge point element, and for each knowledge point element, KP i Collect all other knowledge points and their combined similarity to form a neighbor list (Neighbors(KP)). i ).

[0107] Perform Top-K edge adaptive selection for each knowledge point KP i Sort the neighbors in descending order of overall similarity to obtain the Neighbors(KP) array. i ),

[0108] We use a dual-protection strategy to screen for high-quality neighbors:

[0109] Count the number of knowledge point elements in the neighbor array whose overall similarity to the current knowledge point element is greater than a preset threshold, len(filtered). If len(filtered) ≥ 3, then retain the top K high-quality neighbors (K=10). 15) Otherwise, retain the top 3 neighbors with the highest similarity to avoid node isolation, and then add edges according to the selected high-quality neighbors to form a sparse graph G of knowledge points. Subsequently, perform edge deduplication to avoid duplicate edges in the format of (A,B) and (B,A).

[0110] Understandably, the Top-K mechanism reduces the number of edges in the graph from O(n²) to O(n×K) by limiting the number of neighbors of each node. The double guarantee strategy ensures that each node retains at least 3 edges to avoid the occurrence of isolated nodes.

[0111] Step C30: Cluster the sparse graph of knowledge points using a community discovery algorithm to obtain multiple clusters.

[0112] Specifically, community detection algorithms (such as the Louvain algorithm) are used to perform community detection on the sparse graph G of knowledge points, automatically determining the number of clusters and outputting a community set Clusters={C1, C2, ..., C}. k}

[0113] Then, oversegmentation detection is performed: if the number of clusters is greater than a preset threshold (90% of the knowledge point set), it is judged as oversegmentation (this situation can be understood as almost each node forming a separate cluster), and the original knowledge point set is returned to terminate the recursion.

[0114] During the clustering process, for each cluster Ci If cluster C i If the number of elements exceeds a preset limit (e.g., 7), further subdivision is performed; otherwise, a large language model is invoked to generate the topics for the clusters. Finally, a hierarchical knowledge point tree is constructed based on the topics of the clusters and the knowledge points within them.

[0115] Understandably, the oversegmentation detection mechanism ensures that when the number of clusters exceeds 90% of the number of nodes, it is judged as an invalid cluster and the recursion is terminated. Through recursive clustering and topic generation of large language models, a hierarchical structure is automatically formed, and the depth of the hierarchy is adaptively adjusted according to the document size and clustering quality.

[0116] Step S40: For each knowledge node in the hierarchical knowledge point tree, multiple candidate relation descriptions of the knowledge node are determined through a large language model. Based on the semantic similarity between the candidate relation description of the current knowledge node and the text descriptions of other knowledge nodes in the hierarchical knowledge point tree, the relation type between the knowledge node and other knowledge nodes in the hierarchical knowledge point tree is determined, and a knowledge graph of the PDF document to be processed is constructed.

[0117] Understandably, this step involves identifying the relationships between nodes. A large language model is used to generate multiple candidate relation descriptions for each knowledge node in the hierarchical knowledge point tree to represent different relation types. Subsequently, semantic similarity calculations are performed between the candidate relation descriptions of the current knowledge node and the text representations of other knowledge nodes in the knowledge point tree to determine the target relation type between them. Finally, the identified relation types are written into the connection structure between knowledge nodes to construct the knowledge graph of the PDF document to be processed.

[0118] In one feasible implementation, step S30 includes steps D10 to D40:

[0119] Step D10: For each knowledge node in the hierarchical knowledge point tree, determine multiple candidate relation types for the knowledge node, and generate multiple candidate relation descriptions for each candidate relation type using a large language model.

[0120] Step D20: For each knowledge node in the hierarchical knowledge point tree, perform coarse matching based on the cosine similarity between the candidate relation description of the current knowledge node and the text description of other knowledge nodes, and determine the candidate target relation type between the current knowledge node and other knowledge nodes from multiple candidate relation types.

[0121] Step D30: The candidate target relation types are verified again through the large language model to determine the target relation types between the current knowledge node and other knowledge nodes.

[0122] Step D40: Construct a knowledge graph of the PDF document to be processed.

[0123] Step D50: Perform a consistency check on any two nodes that have a relationship to determine the consistency of the relationship between the two nodes.

[0124] Step D60: If the relationship between two nodes is inconsistent, then the relationship is repaired according to the corresponding repair strategy.

[0125] Specifically, for each leaf node knowledge point, a large language model is used to generate candidate relations of 5 relation types: predecessor (prerequisite knowledge that must be mastered before learning this knowledge point), successor (subsequent knowledge that can be learned after mastering this knowledge point), parallel (related concepts at the same level as this knowledge point), related (other knowledge that is related to this knowledge point but not strictly dependent on it), and synonym (other terms with different expressions but the same meaning).

[0126] For each large language model, the candidate relation description is generated by calling the Embedding model to generate vectors. The top-K similar knowledge point nodes (K=3-5) are retrieved in the knowledge point tree. Cosine similarity is used as the metric to filter out candidate relations with similarity below the threshold and exclude self-loop relations (the case of the same ID, such as relation point pairs (A,A) and (B,B)). The candidate target relation type between the current knowledge node and other knowledge nodes is determined.

[0127] For example, this stage is a coarse ranking of vector similarity, which is used to quickly retrieve the top-K semantically similar candidates from the knowledge point tree. The threshold is similarity ≥ 0.5 (a lower threshold ensures recall). The output is a set of candidate relations, each candidate containing a vector similarity score. Its advantages are high computational efficiency, suitable for large-scale retrieval, high recall to avoid missing potential related knowledge points, and strong objectivity based on vector space distance.

[0128] Then, the large language model is called again to verify whether the relationships between the knowledge point nodes obtained in the coarse ranking stage actually exist and to calibrate the relationship types (reclassifying the misclassified relationships in the coarse ranking stage). The large language model outputs the confidence level C_large language model∈[0,1] and the verification reason, and outputs the set of verified relationships. Its advantages are that it has strong semantic understanding ability, can identify implicit relationships, can handle the problem of misclassification of relationship types, and provides an explainable verification reason.

[0129] Understandably, the design philosophy of the cascade mechanism in this implementation is reflected in three aspects. First, the coarse ranking of vector recall and the fine ranking of the large language model form a two-stage pipeline architecture, each leveraging its advantages. Vector similarity provides fast, objective, and high recall for candidate generation, while the semantic understanding of the large language model is accurate, interpretable, and highly accurate. Second, the confidence coverage strategy of the large language model reflects the principle of prioritizing semantic understanding, and vector similarity serves as an initial screening tool to reduce the computational cost of the large language model. Third, relation type calibration allows the large language model to reclassify relations misclassified in the vector matching stage. For example, if the vector matching stage matches "Python syntax" and "Python application" as a "successor" relation, the large language model validation stage can recalibrate them as a "parallel" relation.

[0130] Subsequently, consistency checks are performed on the relation set using four strategies to ensure the logical integrity and consistency of the knowledge graph.

[0131] Strategy 1 employs a one-to-one relation constraint strategy to ensure that only one relation type is retained for the same pair of knowledge points (A, B). The processing flow includes:

[0132] Knowledge point pairs are standardized by unifying substantially identical knowledge point pairs into the same format (e.g., knowledge point pairs (A,B) and (B,A) are unified into (min_id,max_id)) to avoid duplicate judgments and collect all candidate relations for each knowledge point pair.

[0133] Conflict detection: If the same knowledge point has multiple relationship types, it is judged as a conflict.

[0134] For each knowledge point pair, if there are multiple relation types in the knowledge point pair, the relation with the highest confidence and the relation type with the lowest confidence are found. If the difference between the highest confidence and the lowest confidence is greater than a preset threshold (e.g., 0.1), the relation type with the highest confidence is selected as the relation type of the knowledge point pair; otherwise, the relation type of the knowledge point pair is confirmed according to the relation type priority. The relation type priority is: synonym (1) > predecessor / successor (2) > parallel (3) > related (4).

[0135] The priority design principle is as follows: synonym (priority 1) represents the strongest semantic equivalence relation with the highest exclusivity; predecessor / successor (priority 2) represents the clear dependence of the order relation; parallel (priority 3) represents the moderate relevance of the parallel relation; and related (priority 4) represents the strongest inclusiveness of the weak relation. For example, for the knowledge point pair (A, B), the candidate relations are (A, B, synonym, 0.75) and (A, B, parallel, 0.73), with a confidence difference of 0.02 ≤ 0.1. The "synonymous" relation is selected and retained according to priority.

[0136] Strategy 2 involves automatically establishing complementary relationships between two substantially identical knowledge point pairs to complete the logic, with the goal of automatically completing the predecessor. The relationship is complementary, including successors. The processing flow is as follows:

[0137] Iterate through all knowledge point pairs. For two knowledge point pairs that are substantially the same (e.g., knowledge point pair (A, B) and knowledge point pair (B, A)), determine the relationship type of these two knowledge point pairs. If the relationship type of one of the knowledge point pairs is a type of complementary relationship, and the relationship type of the other knowledge point pair does not have a complementary relationship type with the relationship type of one of the knowledge point pairs, then add a complementary relationship type to the other knowledge point pair, and the confidence of the added complementary relationship type is the same as the confidence of the relationship type of the other knowledge point pair.

[0138] For example, if the relation type of a knowledge point pair (A, B) is "predecessor" and there is no knowledge point pair (B, A, "successor"), then (B, A, "successor", confidence) will be automatically created; if the relation type of a knowledge point pair (A, B) is "successor" and there is no knowledge point pair (B, A, "predecessor"), then (B, A, "predecessor", confidence) will be automatically created. Complementary relations inherit the confidence of the original relation. For example, if the input is (A, B, predecessor, 0.85), the output will automatically add (B, A, successor, 0.85). The technical features are automatic completion of complementary relations to reduce manual annotation work, and complementary relations inherit the confidence of the original relation.

[0139] Strategy 3 aims to automatically establish symmetrical relationships between two substantially identical knowledge point pairs, with the goal of automatically creating bidirectional connections for parallel, related, and synonymous relationships. The processing flow is as follows:

[0140] Iterate through all knowledge point pairs. For two knowledge point pairs that are substantially the same (e.g., knowledge point pair (A, B) and knowledge point pair (B, A)), determine the relation type of these two knowledge point pairs. If the relation type of one knowledge point pair is a type of symmetric relation type, while the relation type of the other knowledge point pair is empty, then add the symmetric relation type to the other knowledge point pair, and the confidence of the added symmetric relation type is the same as the confidence of the relation type of the first knowledge point pair.

[0141] For example, if the relation type of the knowledge point pair (A, B) ∈ {parallel, related, synonym}, then check if there are other relations for the knowledge point pair (B, A), query all relations of (B, A, *). If the relation type of the knowledge point pair (B, A) is empty, then (B, A, type, confidence) is automatically created; otherwise, it is skipped (to comply with the one-to-one constraint and avoid violating strategy 1). A symmetric relation is established only when there are no other relations in the reverse direction, complying with the one-to-one constraint. The symmetric relation automatically inherits the confidence of the original relation. For example, if the input is (A, B, parallel, 0.80), check if (B, A, *) does not exist, and the output will automatically add (B, A, parallel, 0.80).

[0142] Strategy 4 aims to eliminate logical contradictions in the relationship type of two substantially identical knowledge point pairs, ensuring consistency. Contradiction types include cyclic predecessors (where both A→B and B→A predecessors exist simultaneously). The processing flow is as follows:

[0143] Iterate through all knowledge point pairs. For two knowledge point pairs that are substantially the same (e.g., knowledge point pair (A, B) and knowledge point pair (B, A)), if there are two knowledge point pairs that are substantially the same and have the same relationship type but are not symmetrical, then it is determined to be a logical contradiction. Compare the confidence of the relationship type between the two knowledge point pairs that are substantially the same, retain the relationship type of the knowledge point pair with the higher confidence, and delete the relationship type of the other knowledge point pair.

[0144] For example, if the relationship type of knowledge point pairs (A, B) and (B, A) is both {predecessor} (asymmetric relationship), and the confidence score of the relationship type of knowledge point pair (A, B) is 0.75, then it is determined to be a logical contradiction. The relationship type of the knowledge point pair with the highest confidence score is retained, and the other relationship is deleted. For example, given the inputs (A, B, predecessor, 0.75) and (B, A, predecessor, 0.68), a circular contradiction is detected. The solution is to retain (A, B, predecessor, 0.75) and delete (B, A, predecessor, 0.68). The technical feature is to detect circular contradictions in asymmetric relationships, retain the relationship with higher confidence score, and delete the relationship with lower confidence score.

[0145] The above strategy is executed in the following order: First, delete the self-loop relationships between each knowledge point pair. Then, adopt a one-to-one relationship constraint strategy to ensure that only one relationship type is retained for the same knowledge point pair. Next, automatically establish complementary relationships, then automatically establish symmetrical relationships, and finally output the final relationship network after eliminating logical contradictions to construct a knowledge graph.

[0146] The overall technical features are reflected in the synergistic mechanism of four strategies: Strategy 1 ensures that only one type of relation is retained for the same knowledge point to eliminate redundancy; Strategy 2 automatically completes complementary relations (predecessors) based on the relation type. (Subsequently), Strategy 3 establishes bidirectional connections for symmetric relation types (parallel / related / synonymous), and Strategy 4 detects and resolves cyclical contradictions in asymmetric relations.

[0147] Understandably, this embodiment constructs a knowledge point tree that reflects the document's structure and semantic relationships by segmenting and parsing PDF documents, extracting knowledge points, and performing hierarchical clustering. It further utilizes a large language model to generate candidate relationship descriptions and combines semantic similarity to determine the relationship types between knowledge nodes, thereby automatically constructing a high-quality knowledge graph. Compared to traditional rule-based or keyword-matching methods, this solution can accurately identify deep semantic connections across paragraphs and pages, significantly improving the accuracy and completeness of knowledge extraction and promoting the structured expression and intelligent retrieval of document content.

[0148] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the PDF knowledge graph construction method of this application. Any simple modifications based on this technical concept are within the protection scope of this application.

[0149] This application also provides a PDF knowledge graph construction apparatus. Referring to Figure 2, the PDF knowledge graph construction apparatus includes:

[0150] The text block confirmation module 10 is used to divide the PDF document into blocks based on the text content, page number information and paragraph structure of the PDF document to be processed, and obtain a set of text blocks to be processed.

[0151] The knowledge point extraction module 20 is used to extract knowledge points from each text block in the set of text blocks to be processed, and obtain multiple knowledge points and the page number position information of the knowledge points.

[0152] Clustering module 30 is used to cluster knowledge points based on semantic similarity and page number position information between each knowledge point to obtain a hierarchical knowledge point tree.

[0153] The knowledge graph construction module 40 is used to determine multiple candidate relation descriptions for each knowledge node in the hierarchical knowledge point tree through a large language model. Based on the semantic similarity between the candidate relation description of the current knowledge node and the text description of other knowledge nodes in the hierarchical knowledge point tree, the relation type between the knowledge node and other knowledge nodes in the hierarchical knowledge point tree is determined, and a knowledge graph of the PDF document to be processed is constructed.

[0154] The PDF knowledge graph construction apparatus provided in this application, employing the PDF knowledge graph construction method in the above embodiments, can solve the technical problem of deviation between knowledge point clustering results and document logical structure in related technologies in PDF knowledge graph construction. Compared with related technologies, the beneficial effects of the PDF knowledge graph construction apparatus provided in this application are the same as those of the PDF knowledge graph construction method provided in the above embodiments, and other technical features in the PDF knowledge graph construction apparatus are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.

[0155] This application provides a PDF knowledge graph construction device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the PDF knowledge graph construction method in the above embodiments.

[0156] Referring to Figure 3 below, a schematic diagram of a PDF knowledge graph construction device suitable for implementing embodiments of this application is shown. The PDF knowledge graph construction device in embodiments of this application may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. The PDF knowledge graph construction device shown in Figure 3 is merely an example and should not impose any limitations on the functionality and scope of use of embodiments of this application.

[0157] As shown in Figure 3, the PDF knowledge graph construction device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in read-only memory 1002 (ROM) or a program loaded from storage device 1003 into random access memory 1004 (RAM). The random access memory 1004 also stores various programs and data required for the operation of the PDF knowledge graph construction device. The processing unit 1001, read-only memory 1002, and random access memory 1004 are interconnected via a bus 1005. An input / output interface 1006 (I / O interface) is also connected to the bus 1005. Typically, the following systems can be connected to the input / output interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the PDF knowledge graph building device to communicate wirelessly or wiredly with other devices to exchange data. Although a PDF knowledge graph building device with various systems is shown in the figure, it should be understood that it is not required to implement or possess all the systems shown. More or fewer systems can be implemented alternatively.

[0158] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.

[0159] The PDF knowledge graph construction device provided in this application, employing the PDF knowledge graph construction method described in the above embodiments, can solve the technical problem of deviation between knowledge point clustering results and document logical structure in related technologies in PDF knowledge graph construction. Compared with related technologies, the beneficial effects of the PDF knowledge graph construction device provided in this application are the same as those of the PDF knowledge graph construction method provided in the above embodiments, and other technical features in this PDF knowledge graph construction device are the same as those disclosed in the previous embodiment method, and will not be repeated here.

[0160] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0161] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0162] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, which are used to execute the PDF knowledge graph construction method in the above embodiments.

[0163] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0164] The aforementioned computer-readable storage medium may be included in the PDF knowledge graph building device; or it may exist independently and not be assembled into the PDF knowledge graph building device.

[0165] The aforementioned computer-readable storage medium carries one or more programs. When these programs are executed by the PDF knowledge graph construction device, the PDF knowledge graph construction device performs the following actions: Based on the text content, page number information, and paragraph structure of the PDF document to be processed, it performs block processing on the PDF document to obtain a set of text blocks to be processed; for each text block in the set of text blocks to be processed, it extracts knowledge points from the text block to obtain multiple knowledge points and the page number position information of the knowledge points; based on the semantic similarity between the knowledge points and the page number position information, it performs cluster processing on the knowledge points to obtain a hierarchical knowledge point tree; for each knowledge node in the hierarchical knowledge point tree, it determines multiple candidate relation descriptions of the knowledge node through a large language model; based on the semantic similarity between the candidate relation description of the current knowledge node and the text descriptions of other knowledge nodes in the hierarchical knowledge point tree, it determines the relation type between the knowledge node and other knowledge nodes in the hierarchical knowledge point tree, and constructs a knowledge graph of the PDF document to be processed.

[0166] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0167] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0168] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0169] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described PDF knowledge graph construction method. This addresses the technical problem in related technologies where the knowledge point clustering results deviate from the document's logical structure during PDF knowledge graph construction. Compared to related technologies, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the PDF knowledge graph construction method provided in the above embodiments, and will not be elaborated upon here.

[0170] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the PDF knowledge graph construction method described above.

[0171] The computer program product provided in this application can solve the technical problem of deviation between the knowledge point clustering results and the document logical structure in the construction of PDF knowledge graphs in related technologies. Compared with related technologies, the beneficial effects of the computer program product provided in this application are the same as those of the PDF knowledge graph construction method provided in the above embodiments, and will not be repeated here.

[0172] The above are only some embodiments of this application and do not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.

Claims

1. A method for constructing a PDF knowledge graph, characterized in that, The method includes: dividing the PDF document into blocks based on its text content, page number information, and paragraph structure to obtain a set of text blocks to be processed; extracting knowledge points from each text block in the set to obtain multiple knowledge points and the page number position information of the knowledge points; clustering the knowledge points based on the semantic similarity between the knowledge points and the page number position information to obtain a hierarchical knowledge point tree; determining multiple candidate relation descriptions for each knowledge node in the hierarchical knowledge point tree using a large language model; determining the relation type between the knowledge node and other knowledge nodes in the hierarchical knowledge point tree based on the semantic similarity between the candidate relation description of the current knowledge node and the text descriptions of other knowledge nodes in the hierarchical knowledge point tree; and constructing a knowledge graph of the PDF document to be processed.

2. The PDF knowledge graph construction method as described in claim 1, characterized in that, The step of dividing the PDF document into blocks based on its text content, page number information, and paragraph structure to obtain a set of text blocks to be processed includes: parsing the PDF document to obtain a structured parsing result; sequentially traversing the PDF text content in the structured parsing result and accumulating the traversed text length; when the accumulated traversed text length reaches a first text length, detecting the next paragraph position of the currently traversed text and determining the page span between the next paragraph position and the currently traversed text paragraph; if the page span exceeds the maximum allowed span, stopping the traversal and treating the traversed text as a text block to be processed; if the page span does not exceed the maximum allowed span, continuing the traversal until a second text length is reached, treating the traversed text as a text block to be processed; completing the traversal of the entire PDF document to be processed to obtain the set of text blocks to be processed.

3. The PDF knowledge graph construction method as described in claim 1, characterized in that, The step of extracting knowledge points from each text block in the set of text blocks to be processed to obtain multiple knowledge points includes: for each text block in the set of text blocks to be processed, inputting the text block to be processed into a large language model, combining it with prompt words, and outputting multiple knowledge points and page number position information for each knowledge point; inputting the title and content corresponding to the knowledge point into an embedding model to obtain a high-dimensional vector representation of the knowledge point; and constructing a knowledge point set based on the high-dimensional vector representation of the knowledge point and the corresponding page number position information.

4. The PDF knowledge graph construction method as described in claim 3, characterized in that, The step of clustering the knowledge points based on the semantic similarity between each knowledge point and the page number position information to obtain a hierarchical knowledge point tree includes: for any two knowledge point elements in the knowledge point set, determining the comprehensive similarity between the two knowledge point elements based on the semantic similarity between the two knowledge point elements and the page number distance weight between the two elements; for each knowledge point element in the knowledge point set, selecting high-quality neighbors for each knowledge point element based on the comprehensive similarity between the current knowledge point element and other knowledge point elements, adding edges between the knowledge point and its neighbors, and constructing a knowledge point sparse graph; performing clustering processing on the knowledge point sparse graph using a community detection algorithm to obtain multiple clusters; and generating corresponding topics for each cluster using a large language model to obtain a hierarchical knowledge point tree.

5. The PDF knowledge graph construction method as described in claim 1, characterized in that, The steps of determining candidate relation descriptions for each knowledge node in the hierarchical knowledge point tree using a large language model, and determining the knowledge node relation network based on the similarity between the candidate relation descriptions of the current knowledge node and other knowledge nodes in the hierarchical knowledge point tree, and constructing the knowledge graph of the PDF document to be processed, include: for each knowledge node in the hierarchical knowledge point tree, determining multiple candidate relation types for the knowledge node, and generating multiple candidate relation descriptions for each candidate relation type using a large language model; for each knowledge node in the hierarchical knowledge point tree, performing a coarse match based on the cosine similarity between the candidate relation descriptions of the current knowledge node and the text descriptions of other knowledge nodes, and determining the candidate target relation types between the current knowledge node and other knowledge nodes from the multiple candidate relation types; performing a second verification of the candidate target relation types using the large language model to verify the candidate target relation types, and determining the target relation types between the current knowledge node and other knowledge nodes; and constructing the knowledge graph of the PDF document to be processed.

6. The PDF knowledge graph construction method as described in claim 5, characterized in that, Before constructing the knowledge graph of the PDF document to be processed, the method further includes the following steps: performing a consistency check on any two nodes that have a relationship to determine the consistency of the relationship between the two nodes; If the relationship between two nodes is inconsistent, the relationship will be repaired according to the corresponding repair strategy.

7. A PDF knowledge graph construction device, characterized in that, The device includes: a text block confirmation module, used to segment the PDF document into blocks based on the text content, page number information, and paragraph structure of the PDF document to be processed, to obtain a set of text blocks to be processed; a knowledge point extraction module, used to extract knowledge points from each text block in the set of text blocks to be processed, to obtain multiple knowledge points and the page number position information of the knowledge points; a clustering module, used to cluster the knowledge points based on the semantic similarity between the knowledge points and the page number position information, to obtain a hierarchical knowledge point tree; and a knowledge graph construction module, used to determine multiple candidate relation descriptions of each knowledge node in the hierarchical knowledge point tree through a large language model, and to determine the relation type between the knowledge node and other knowledge nodes in the hierarchical knowledge point tree based on the semantic similarity between the candidate relation description of the current knowledge node and the text description of other knowledge nodes in the hierarchical knowledge point tree, thereby constructing a knowledge graph of the PDF document to be processed.

8. A PDF knowledge graph construction device, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the PDF knowledge graph construction method as described in any one of claims 1 to 6.

9. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the PDF knowledge graph construction method as described in any one of claims 1 to 6.

10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the steps of the PDF knowledge graph construction method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Knowledge point extraction method for textbook and related equipment

    CN120509414A

  • PDF document content processing method and device, equipment, storage medium and program product

    CN120930593A