Methods, apparatus and systems for constructing knowledge graphs for knowledge documents
By combining natural language processing and large-scale model processing, the probability of comprehensive citation relationships between knowledge documents is calculated, and a knowledge graph is constructed. This solves the problem of unstructured document association in the coal mining field and enables efficient knowledge system construction and intelligent analysis support.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CCTEG COAL MINING RES INST
- Filing Date
- 2026-03-27
- Publication Date
- 2026-07-31
AI Technical Summary
Existing technologies struggle to effectively uncover and utilize the complex technical relationships between unstructured documents in knowledge service platforms within the coal mining sector, resulting in fragmented and isolated knowledge that cannot form a systematic knowledge framework to support intelligent analysis and decision-making.
By extracting the pure content, sentence units, and direct reference relationships of knowledge documents through natural language processing, and combining them with a large model for multi-level semantic processing, the probability of comprehensive reference relationships between knowledge documents is calculated, and a knowledge graph with knowledge documents as nodes and reference relationships as edges is constructed.
It significantly improves the efficiency and accuracy of mining and constructing knowledge connections from massive amounts of unstructured documents, and realizes the structured and intelligent organization of the knowledge system.
Smart Images

Figure CN122489779A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of coal mining technology, and in particular to a method, apparatus and system for constructing knowledge graphs for knowledge documents. Background Technology
[0002] In related technologies, with the rapid development of scientific research and engineering practice in the mining field, the number of unstructured documents such as technical reports, patents, and papers accumulated within knowledge service platforms has increased dramatically. The complex technical connections between these documents, such as citation patterns, thematic overlaps, and semantic similarities, are difficult to effectively mine and utilize through traditional keyword retrieval or manual classification methods. Currently, methods relying on manual organization and simple rules are not only inefficient and costly, but also struggle to adapt to the dynamic updates of knowledge and the discovery of deep relationships. This results in a large amount of high-value knowledge remaining scattered and isolated in "data silos," unable to form a systematic knowledge framework to support efficient intelligent analysis and decision-making. Summary of the Invention
[0003] To overcome the problems existing in related technologies, this disclosure provides a method, apparatus and system for constructing knowledge graphs for knowledge documents.
[0004] According to a first aspect of the present disclosure, a method for constructing a knowledge graph for knowledge documents is provided, including:
[0005] Natural language processing is performed on knowledge documents to obtain plain text, sentence units, word and sentence units, and direct reference relationships between knowledge documents; Based on the trained large model, semantic processing is performed on the word and sentence units to obtain a first semantic processing result. Then, the pure content text is input into the local large model for semantic processing to obtain a second semantic processing result. The first semantic processing result includes a score of the importance of words and sentences in their respective sentences. The second semantic processing result includes a score of the semantic relevance between knowledge document pairs. Based on the direct reference relationship, the first semantic processing result, and the second semantic processing result, calculate the probability of the comprehensive reference relationship between any two knowledge documents; Based on the comprehensive reference relationship probability, a knowledge graph is constructed with knowledge documents as nodes and reference relationships as edges.
[0006] According to a second aspect of the present disclosure, an apparatus for constructing a knowledge graph for knowledge documents is provided, comprising: The Natural Language Processing Unit is used to perform natural language processing on knowledge documents to obtain plain content text, sentence units, word and sentence units, and direct reference relationships between knowledge documents. The semantic processing unit is used to perform semantic processing on the word and sentence units and the statement units based on the trained large model to obtain a first semantic processing result, and to input the pure content text into the local large model for semantic processing to obtain a second semantic processing result; the first semantic processing result includes a score of the importance of words and sentences in their respective statements; the second semantic processing result includes a score of the semantic relevance between knowledge document pairs. The calculation unit is used to calculate the probability of a comprehensive reference relationship between any two knowledge documents based on the direct reference relationship, the first semantic processing result, and the second semantic processing result. The construction unit is used to construct a knowledge graph with knowledge documents as nodes and reference relationships as edges based on the comprehensive reference relationship probability.
[0007] According to a third aspect of the present disclosure, an electronic device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the method as described in any one of the first aspects.
[0008] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method as described in any one of the first aspects.
[0009] According to a fifth aspect of the present disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the method as described in any one of the first aspects.
[0010] The technical solutions provided by the embodiments of this disclosure can include the following beneficial effects: By extracting the pure content text, sentence units, word units, and direct citation relationships of documents through automated natural language processing, and collaboratively performing multi-level semantic processing with a general-purpose large model and a local domain large model, the direct citation relationships and deep semantic connections are effectively integrated, thereby automatically and accurately calculating the probability of comprehensive citation relationships between knowledge documents. Based on this, a knowledge graph with knowledge documents as nodes and citation relationships as edges is automatically constructed according to this probability, significantly improving the efficiency and accuracy of mining and constructing knowledge connections from massive amounts of unstructured documents, and realizing the structured and intelligent organization of the knowledge system.
[0011] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0012] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0013] Figure 1 This is a flowchart illustrating a method for constructing a knowledge graph for knowledge documents according to an exemplary embodiment.
[0014] Figure 2 This is a block diagram illustrating a knowledge graph construction apparatus for knowledge documents according to an exemplary embodiment.
[0015] Figure 3 This is a block diagram illustrating an apparatus for a method of constructing a knowledge graph for knowledge documents, according to an exemplary embodiment. Detailed Implementation
[0016] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the invention as detailed in the appended claims.
[0017] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the present disclosure. The singular forms “a” and “the” as used in this disclosure and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise.
[0018] It should be understood that although the terms first, second, third, etc., may be used to describe various information in embodiments of this disclosure, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first information may also be referred to as second information without departing from the scope of embodiments of this disclosure, and similarly, second information may also be referred to as first information. Depending on the context, the words “if” and “suppose” as used herein may be interpreted as “when”, “when”, or “in response to a determination”.
[0019] Furthermore, various forms of processes shown in the embodiments of this disclosure can be used to reorder, add, or delete steps. For example, the steps described in this application can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and no limitation is imposed herein.
[0020] It should be noted that the collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0021] Figure 1 This is a flowchart illustrating a method for constructing a knowledge graph for knowledge documents according to an exemplary embodiment, such as... Figure 1 As shown, it should be noted that the knowledge graph construction method for knowledge documents in this embodiment is applied in a knowledge graph construction apparatus for knowledge documents. Figure 1 As shown, the method may include the following steps: Step 101: Perform natural language processing on the knowledge documents to obtain pure content text, sentence units, word and sentence units, and direct reference relationships between knowledge documents.
[0022] In one embodiment, processing can be performed on a knowledge document basis. Here, a small language model is used to extract the main content of the text, removing content other than the main knowledge content such as titles, abstracts, cited references, and project information, forming pure content text, which is stored in the text corpus of the data platform for use by the large model processing module. At the same time, the knowledge document citation relationships in the text are extracted, with a total of 6 citation relationships: paper-paper citation, patent-patent citation, technical report-technical report citation, paper-patent citation, technical report-paper citation, and technical report-patent citation.
[0023] As an example, for two knowledge documents a and b, if both a and b are knowledge documents in a knowledge service platform, then the two documents have a referencing relationship, denoted as . This type of reference relationship is a strong relationship with a probability of 1. When either a or b does not exist in the knowledge service platform, this reference and referenced relationship can be stored as an attribute value of the document in the referencing attribute or the referenced attribute, denoted as . , .
[0024] Furthermore, knowledge documents can be decomposed into grammatically correct sentences that can express basic semantics, which are then used as semantic recognition units, denoted as sentences. These sentences are stored in the data platform's sentence corpus, and linked as indexes to the sentence attributes of knowledge document 'a', denoted as... .
[0025] Additionally, NLP analysis can be performed on words and phrases, breaking them down into semantic recognition units, denoted as "words." These words and phrases can then be used as indexes linked to the corresponding "sentence" units. If the document explicitly contains keywords, such as keywords from a paper, these keywords are identified and stored in a mining-specific thesaurus. The presence of such words or phrases as direct references to the document is denoted as: .
[0026] In this embodiment, a single knowledge document is used as the processing unit. A lightweight language model is used to strip away peripheral information such as titles, abstracts, and references, extracting the core pure content text. Simultaneously, various document-to-document citation relationships (such as paper-patent, report-paper, etc.) are identified. For document pairs explicitly existing within the knowledge service platform, strong citation associations are directly established (probability 1); for unilateral citations, they are recorded as document attributes. Next, the pure text is segmented into complete sentence units and indexed. Further, sentences are segmented to obtain word units. If a word belongs to an explicitly listed keyword, it is marked as a direct citation and stored in a domain-specific thesaurus, thus completing multi-granular structured parsing and semantic resource construction from document and sentence to word unit.
[0027] In some embodiments of this application, after step 101, the method may further include the following steps: Step a1: Match the word / phrase unit with words / phrase units in a pre-set professional thesaurus for the coal mining field. If the match is successful, calculate the first importance probability of the word / phrase unit in the sentence and the second importance probability of the word / phrase unit in the document. Step a2: Based on the importance score of the word / phrase in its respective sentence, the probability of first importance and the probability of second importance, calculate the keyword probability of the word / phrase using the following formula. :
[0028]
[0029] in, This represents the first semantic processing result, where P_sentence(word, sentence) is the probability of first importance. The probability of second importance. This is the adjustment coefficient; The method also includes: Attribute information in a knowledge graph is constructed based on keyword probabilities.
[0030] In some embodiments of this application, after step a2, the method may further include the following steps: The word / phrase unit is compared with the keywords explicitly marked in the knowledge document. If the word / phrase unit is a keyword, its direct reference probability is determined to be 1. Based on the probability of direct citation, the probability of first importance, the probability of second importance, and the importance score, the keyword probability is calculated using the following formula: P_keywords(word,text)=P_keywords(word,text) (1-P_quote_text(word,text))+P_quote_text(word,text) Where P_keywords(word,text) is the keyword probability, and P_quote_text(word,text) is the direct quotation probability.
[0031] In this embodiment, by introducing direct citation probability and setting its explicit rules (the probability is 1 when the word / phrase unit is a keyword explicitly marked in the document), it is ensured that the key information explicitly marked in the document is fully and accurately reflected in subsequent calculations. Furthermore, through the designed probability fusion formula, the direct citation probability is organically combined with the first importance probability, second importance probability, and importance score based on content analysis. This achieves a comprehensive balance and correction between explicit marking and implicit importance in keyword probability calculation, significantly improving the accuracy and robustness of keyword recognition. Thus, it can fully respect the document's own structured annotations while intelligently capturing potential key points in the context, ultimately generating more reliable keyword probability evaluation results that better fit the document's intent.
[0032] In this embodiment of the application, step a1 may specifically include: matching the parsed word units with the professional thesaurus.
[0033] For words and phrases that are successfully matched, their importance in the current sentence context and the overall text context is further calculated.
[0034] Specifically, the first TF-IDF value (TF-IDF(word, sentence)) of the word / sentence within its sentence unit is calculated, and the second TF-IDF value (TF-IDF(word, sentence)) of its plain text is calculated. Based on the total number of documents m in the text corpus and the total number of sentences n in the sentence corpus, the sentence-level importance probability P_sentence(word, sentence) = TF-IDF(word, sentence) / lg(n) and the document-level importance probability P_text(word, text) = TF-IDF(word, text) / lg(m) are calculated respectively.
[0035] For words or phrases that fail to match the professional terminology database, an adaptive decision model is used to determine whether they should be included as new terms in the database. Set the adjustment coefficient β (0 < β ≤ 1) and the threshold θ, when P_sentence(word, text) is satisfied. β+P_text (word, sentence)When (1-β)≥θ, the phrase is stored in a professional thesaurus and subsequently processed in the same way as the phrase in the comparison; otherwise, it is not processed. All processed phrases and probability information are stored in the data platform and indexed and associated with the corresponding sentence units and knowledge documents.
[0036] In one embodiment, matching the parsed word / phrase units with a specialized thesaurus can be achieved using string-based matching rules. For example, this can be accomplished by performing a precise string comparison between the word / phrase units and entries in the specialized thesaurus. In practical applications, a fuzzy matching method that allows for some character tolerance based on precise matching can also be used, or a longest-matching strategy based on word boundaries can be employed to handle variations in expression or out-of-vocabulary words in the actual text. Those skilled in the art can choose appropriate matching algorithms according to actual needs, and all modifications to the above-mentioned methods fall within the protection scope of this invention.
[0037] In this embodiment, by matching with an authoritative domain-specific thesaurus, precise initial screening of professional terms is achieved, ensuring the accuracy of core entity extraction and laying a reliable foundation for knowledge structuring. Secondly, by combining the TF-IDF statistical features of words and sentences in both micro-statement and macro-document contexts, and through logarithmic normalization, stable and comparable dual importance probabilities at both the statement and document levels are generated. This enables fine-grained, multi-dimensional quantitative evaluation of the semantic contribution of terms. Furthermore, based on a probability-weighted and adaptive threshold decision-making mechanism, the system can intelligently identify and incorporate emerging terms from the text into the professional thesaurus, giving the system the ability to continuously learn and self-evolve, fundamentally overcoming the bottleneck of static thesauruses' inability to adapt to the dynamic development of technical vocabulary.
[0038] In some embodiments of this application, the attribute information in the knowledge graph constructed based on keyword probabilities may specifically include: If the keyword probability is greater than or equal to 1, update the keyword probability to 1, and configure the word / phrase unit and the updated keyword probability to the attribute information of the corresponding node of the knowledge document. If the keyword probability is greater than or equal to the preset keyword probability and less than 1, the word / phrase unit configuration and keyword probability configuration will be set to the attribute information of the corresponding node in the knowledge document.
[0039] In this application embodiment, for keywords with a probability greater than or equal to 1 (e.g., keywords explicitly marked by the author in the document), the keyword probability is reset to 1 and used together with the words and phrases as node attributes. This transforms such "authoritative annotations" into attribute information with the highest certainty and strongest weight in the graph, ensuring the authority of the core knowledge tags.
[0040] In another embodiment of this application, for keyword probabilities between a preset threshold d and 1 (e.g., important terms inferred by the algorithm), their original probability values are retained as attributes, thereby constructing knowledge associations with a continuous confidence spectrum in the knowledge graph. This not only accurately reflects the real and subtle differences in the strength of association between terms and documents, but also enables subsequent graph-based intelligent applications to use these probability values for refined calculations.
[0041] In this embodiment, an intelligent strategy combining "deterministic processing" and "probabilistic preservation" is adopted to improve the automation of map construction while effectively ensuring the accuracy, richness, and computability of its output results.
[0042] Step 102: Based on the completed large model, perform semantic processing on word and sentence units to obtain the first semantic processing result; and input the pure content text into the local large model for semantic processing to obtain the second semantic processing result.
[0043] The first semantic processing result includes a score of the importance of a word or phrase within its corresponding sentence; the second semantic processing result includes a score of the semantic relevance between knowledge document pairs.
[0044] In the embodiments of this application, a large model that has completed training can refer to a large-scale deep learning model that has completed the pre-training process on massive general or domain data and has powerful semantic understanding and generation capabilities.
[0045] In this embodiment, the local large-scale model refers to a large-scale deep learning model deployed on a user's private server or dedicated cloud computing environment, which has been pre-trained and further fine-tuned and optimized using specific vertical domain knowledge (such as coal mining). Running in a closed local network environment ensures that all sensitive or proprietary knowledge document data does not leave the country, thus fundamentally protecting data sovereignty and intellectual property security. This model can possess general semantic understanding capabilities and can also deeply integrate domain terminology, technical logic, and industry standards, enabling it to perform in-depth content understanding, topic extraction, and semantic association analysis on complete professional documents, ultimately outputting high-quality semantic association scores between documents.
[0046] In this embodiment, fine-grained word and sentence units can be submitted to one or more pre-trained general-purpose large-scale model APIs for concurrent processing. Leveraging their powerful general semantic understanding capabilities, the local importance of each word within a specific sentence context can be quickly and efficiently evaluated, outputting a normalized importance score as the first semantic processing result. Simultaneously, the plain text representing the overall document content is input into a locally deployed, domain-adjusted dedicated large-scale model for processing. This local model, while ensuring sensitive data is not leaked, can deeply understand the complete technical logic and thematic context of the document, and comprehensively evaluate the overall semantic correlation strength between any two documents, outputting a semantic correlation score between the document pairs as the second semantic processing result.
[0047] In this embodiment, by utilizing the large model API to process fine-grained units and the local domain model to process complete documents in a collaborative design, both processing efficiency and the utilization of cutting-edge semantic capabilities are ensured, while also taking into account data security, in-depth mining of domain professional knowledge, and accurate judgment of overall semantic associations. This provides a semantic analysis foundation with both breadth and depth for subsequent probabilistic fusion and graph construction.
[0048] In some embodiments of this application, step 102, which involves semantic processing of word and sentence units based on a large, trained model to obtain a first semantic processing result, may specifically include the following steps: The word and sentence units are respectively input into multiple pre-trained general-purpose large models; Receive the semantic processing results returned by each general large model, and normalize the semantic processing results; the semantic processing results include at least the importance evaluation value of the corresponding words and sentences, the total number of corpora retrieved by the large model, and the number of related corpora hit; The importance evaluations returned by the general large model are weighted and fused using the following formula to obtain the first semantic processing result:
[0049] in, This is the result of the first semantic processing. Let be the weight of the i-th large model, and let the sum of the weights of all large models be 1. Let be the importance evaluation value output by the i-th large model, hit(i) be the total number of corpora retrieved by the i-th large model, and num(i) be the number of related corpora hit by the i-th large model.
[0050] In this embodiment, semantic units to be analyzed can be submitted to each model in parallel, and the processing results returned by each model, including word and sentence importance evaluation values, total number of retrieved corpora, and number of hit-related corpora, can be received. By introducing a weight-based fusion formula, not only are the importance scores of each model integrated, but the hit rate is also used as an objective correction factor. This normalizes and weights the output results of multiple models, ultimately generating a stable, reliable first semantic processing result that combines subjective and objective evaluation criteria. This effectively improves the robustness and accuracy of semantic understanding.
[0051] In some embodiments of this application, an adjustment value can be set for word and phrase units that do not match the professional thesaurus. Its value can be dynamically adjusted based on actual system operation feedback. The semantic evaluation from the large model and the statistical importance probability can be comprehensively considered, and the following judgment criteria can be used to determine whether to include the term or phrase as a new term in the professional thesaurus:
[0052] Wherein, P_api_sentence(word, sentence) is the importance score of the word / sentence in the first semantic processing result, P_sentence(word, sentence) and P_text(word, text) are the calculated sentence-level and document-level importance probabilities, respectively, β is another adjustment coefficient, and θ is the preset entry threshold.
[0053] If the above conditions are met, the term is determined to have sufficient domain relevance and importance, and is stored in the professional thesaurus. It is then processed and indexed according to the process of hitting the thesaurus. Otherwise, the term will not be treated as a professional term for the time being.
[0054] In some embodiments of this application, step 102, which involves inputting plain text into a local large model for semantic processing to obtain a second semantic processing result, may specifically include the following steps: Input plain text into a large local model that has been trained and optimized for a specific domain for semantic processing; Obtain the second semantic processing results returned by the local large model; the second semantic processing results also include the semantic importance scores of words and phrases in the professional thesaurus in the pure content text.
[0055] In this embodiment, the cleaned and refined pure content text (i.e., the core content after removing redundant formatting and peripheral information) can be input into a locally deployed large model that has been optimized and trained for a specific domain (such as coal mining). This local large model utilizes its deeply integrated domain knowledge to perform two core analyses: first, it understands the overall semantic theme and technical logic of the documents, thereby calculating the deep semantic relevance score between any two documents in the domain context; second, based on its internal knowledge representation, it performs contextual evaluation of existing terms in the professional thesaurus, determining and outputting the specific semantic importance score of each professional term in the current specific document content. This process not only achieves accurate quantification of the relationships between documents but also completes the importance calibration of professional terms in specific technical contexts, providing a crucial semantic understanding foundation for subsequently building high-quality, high-precision knowledge associations.
[0056] In some embodiments of this application, the second semantic processing result returned by the local large model includes the semantic importance score P_api_word(word, text) of words and phrases in the professional thesaurus within the pure content text. A judgment threshold q can be preset. When the semantic importance score P_api_word(word, text) is greater than or equal to the threshold q, it is determined that the professional term has a significant semantic impact on the content of the current knowledge document. At this time, the association information between the word / phrase and the document can be saved. The association information includes at least the word / phrase, the identifier of the knowledge document, and the semantic importance score, for subsequent use and integration by modules such as keyword probability calculation or knowledge graph attribute construction.
[0057] Step 103: Calculate the probability of a comprehensive reference relationship between any two knowledge documents based on the direct reference relationship, the result of the first semantic processing, and the result of the second semantic processing.
[0058] In some embodiments of this application, step 103 may specifically include the following steps: The probability P(a, b) of the comprehensive citation relationship between any two knowledge documents is calculated using the following formula:
[0059] Where a and b are any two knowledge documents, Score the semantic relevance between knowledge document a and knowledge document b. For adjustment coefficients, Score the preprocessing relevance between knowledge document a and knowledge document b. This represents a direct reference relationship between knowledge document a and knowledge document b.
[0060] In one embodiment, preprocessing correlation score It can be obtained by calculating the cosine similarity between knowledge document a and knowledge document b.
[0061] In this embodiment, direct quotations (P_quote) are used as the deterministic basis to ensure that explicit associations are not overlooked. Simultaneously, an adjustment coefficient σ is used to dynamically integrate the score (P_api) based on the overall document depth semantics with the analysis results (P_pre) based on local unit preprocessing. This approach balances overall contextual relevance with capturing fine-grained evidence, effectively overcoming the limitations of a single information source. This fusion mechanism significantly reduces the risk of misjudgment, enabling the system to automatically and accurately quantify the potential complex quotations between documents, providing a reliable and interpretable probabilistic basis for constructing high-quality, highly credible knowledge graphs.
[0062] Step 104: Based on the comprehensive citation relationship probability, construct a knowledge graph with knowledge documents as nodes and citation relationships as edges.
[0063] In one embodiment, the probability of a comprehensive citation relationship between any two documents can be determined based on a preset threshold rule: when the probability value reaches or exceeds the "strong association" threshold, a directed citation edge is directly established between the corresponding two document nodes; when the probability value is in the "moderate association" range, path analysis is initiated to find reliable citation chains formed through intermediate documents, and an indirect citation relationship network is constructed accordingly; when the probability value is below the "moderate association" range, no citation edge is established. Through this process, massive amounts of discrete unstructured knowledge documents are automatically and intelligently organized into a structured knowledge network with documents as entities and probabilistic citation relationships as links, providing a direct data foundation for intelligent retrieval, knowledge discovery, and value assessment.
[0064] In some embodiments of this application, step 104 may specifically include the following steps: Step b1: Construct a probabilistic relationship graph using knowledge documents as nodes and reference relationships as edge weights.
[0065] In this embodiment of the application, the previously calculated and quantified comprehensive reference relationship probability value can be set as the weight of the directed edge between nodes (knowledge documents), thereby constructing an initial probability relationship graph and transforming the abstract association strength into a specific and computable network topology.
[0066] Step b2: Delete the self-loop nodes in the probability graph.
[0067] In this embodiment, by deleting all edges pointing to themselves (i.e., self-loops), logical paradoxes and computational noise that may exist in the data can be actively corrected, ensuring the mathematical rigor and business rationality of the graph and providing a clean structural foundation for subsequent analysis.
[0068] Step b3: Calculate the average probability of all connected paths between any two nodes x and y in the probability graph to obtain the target reference probability.
[0069] The probability of a single path is the product of the combined reference probabilities of all edges along that path.
[0070] In this embodiment, all possible connecting paths between any two nodes in the graph can be traversed, and the product of the edge weights (i.e. probabilities) on each path can be used as the overall association strength of that path. Finally, the average value of all path strengths is taken to obtain the final target reference probability. This comprehensively considers all direct and indirect association evidence between documents, and integrates local, binary relationship probabilities into a stable index that reflects the global network connectivity strength, which greatly enhances the robustness and accuracy of the final graph construction decision.
[0071] In some embodiments of this application, step b3 may specifically include the following steps: The target reference probability of all connected paths between any two nodes x and y in the probability graph is calculated using the following formula:
[0072]
[0073] in, Let x be the target reference probability between nodes x and y. Let a, i, ..., j, b be the probability of a single path, a, i, ..., j, b be the traversal path, and root(a, i, ..., j, b) be the number of nodes visited.
[0074] In this embodiment, for any two document nodes x and y in the probability graph, the system traverses all possible connected paths between them. For each path (e.g., x, i, ..., j, y), its overall association strength is obtained by continuously multiplying the basic reference probability between each adjacent node on that path. The strength calculation results of all connected paths can be summed and divided by the total number of nodes in the involved paths for normalization (i.e., considering the number of path nodes root(a, i, ..., j, b)). Finally, a more robust target reference probability P_build(x, y) that comprehensively reflects all direct and indirect association evidence is obtained, thereby effectively overcoming the randomness or noise interference that may exist in a single direct association. The accuracy and stability of the final knowledge association judgment are improved by using the global structural information of the graph network.
[0075] Step b4: Construct a knowledge graph based on the target reference probability.
[0076] In some embodiments of this application, step a4 may specifically include the following steps: For any two knowledge documents, if the target reference probability is greater than or equal to the first threshold, then establish a reference relationship edge in the knowledge graph from the first node corresponding to one knowledge document to the second node corresponding to the other knowledge document. If the target reference probability is less than the first threshold and greater than the second threshold, then all possible paths from the first node to the second node in the probability relationship graph are traversed. If at least one candidate path with a target reference probability greater than or equal to the first threshold is found, then the target path with the highest target reference probability is selected from the at least one candidate path, and a reference relationship chain from the first node to the second node is established in the knowledge graph along the target path.
[0077] In one embodiment of this application, two key thresholds can be preset: a first threshold (high confidence threshold) and a second threshold (medium confidence threshold).
[0078] For any two documents, if the combined target citation probability is greater than or equal to the first threshold, it indicates that there is strong and direct evidence of a connection between the two documents. The system then directly establishes a citation relationship edge from the previous document node to the next document node in the knowledge graph.
[0079] When the target reference probability falls between the first and second thresholds, it indicates insufficient direct association strength but potential indirect association. In this case, instead of directly establishing edges, all possible paths from the starting node to the target node are traversed, checking if at least one sub-path among these paths has a strength reaching the first threshold (i.e., containing a strongly associated segment). If such candidate paths exist, the path with the highest overall probability is selected as the "reliable channel," and corresponding reference edges are sequentially established in the knowledge graph along the node order of this path, ultimately forming an indirect reference chain from the starting node to the target node.
[0080] In this embodiment, when the target reference probability reaches the first threshold, a reference edge is directly established, enabling rapid and accurate construction of high-confidence associations and greatly improving the efficiency of graph generation. Furthermore, when the probability is in the middle range, through intelligent path analysis, a reference relationship chain is constructed only when there is a reliable indirect channel verified by a strongly related sub-path, effectively avoiding the introduction of low-quality or false associations and ensuring the reliability of each relationship in the graph. At the same time, it mines and solidifies those deep knowledge associations that are not direct but logically rigorous, thus making the final knowledge network have high accuracy, rich connection dimensions, and good structural depth.
[0081] The knowledge graph construction method for knowledge documents proposed in this disclosure extracts the pure content text, sentence units, word units, and direct reference relationships of documents through automated natural language processing. It then collaboratively performs multi-level semantic processing using a general-purpose model and a local domain-specific model, effectively integrating direct reference relationships and deep semantic connections. This allows for the automated and accurate calculation of the comprehensive reference relationship probability between knowledge documents. Based on this probability, a knowledge graph with knowledge documents as nodes and reference relationships as edges is automatically constructed, significantly improving the efficiency and accuracy of mining and constructing knowledge relationships from massive amounts of unstructured documents, and achieving a structured and intelligent organization of the knowledge system.
[0082] Figure 2 This is a block diagram illustrating a knowledge graph construction apparatus for knowledge documents according to an exemplary embodiment. (Refer to...) Figure 2 The device includes a natural language processing unit 201, a semantic processing unit 202, a computing unit 203, and a construction unit 204.
[0083] Among them, the natural language processing unit 201 is used to perform natural language processing on knowledge documents to obtain pure content text, sentence units, word and sentence units and direct reference relationships between knowledge documents; Semantic processing unit 202 is used to perform semantic processing on word and sentence units and sentence units based on the trained large model to obtain a first semantic processing result, and to input pure content text into the local large model for semantic processing to obtain a second semantic processing result; the first semantic processing result includes the importance score of words and sentences in their respective sentences; the second semantic processing result includes the semantic relevance score between knowledge document pairs. The calculation unit 203 is used to calculate the probability of a comprehensive reference relationship between any two knowledge documents based on the direct reference relationship, the first semantic processing result and the second semantic processing result. Building unit 204 is used to construct a knowledge graph with knowledge documents as nodes and reference relationships as edges based on the comprehensive reference relationship probability.
[0084] In some embodiments of this application, the semantic processing unit 202 may specifically be used for: The word and sentence units are respectively input into multiple pre-trained general-purpose large models; Receive the semantic processing results returned by each general large model, and normalize the semantic processing results; the semantic processing results include at least the importance evaluation value of the corresponding words and sentences, the total number of corpora retrieved by the large model, and the number of related corpora hit; The importance evaluations returned by the general large model are weighted and fused using the following formula to obtain the first semantic processing result:
[0085] in, This is the result of the first semantic processing. Let i be the weights of the i-th large model. Let be the importance evaluation value output by the i-th large model, hit(i) be the total number of corpora retrieved by the i-th large model, and num(i) be the number of related corpora hit by the i-th large model.
[0086] In some embodiments of this application, the semantic processing unit 202 may specifically be used for: Input plain text into a large local model that has been trained and optimized for a specific domain for semantic processing; Obtain the second semantic processing results returned by the local large model; the second semantic processing results also include the semantic importance scores of words and phrases in the professional thesaurus in the pure content text.
[0087] In some embodiments of this application, the apparatus may further include: The calculation unit 203 is also used to match the word and phrase unit with words and phrases in a preset professional thesaurus of the coal mining field. If the match is successful, it calculates the first importance probability of the word and phrase unit in the sentence and the second importance probability of the word and phrase in the document. The calculation unit 203 is also used to calculate the keyword probability of a word or phrase based on its importance score in the sentence to which it belongs, the probability of first importance, and the probability of second importance, using the following formula. :
[0088]
[0089] in, This represents the first semantic processing result, where P_sentence(word, sentence) is the probability of first importance. The probability of second importance. This is the adjustment coefficient; The device also includes: Building unit 204 is also used to construct attribute information in the knowledge graph based on keyword probabilities.
[0090] In some embodiments of this application, the construction unit 204 may specifically be used for: If the keyword probability is greater than or equal to 1, update the keyword probability to 1, and configure the word / phrase unit and the updated keyword probability to the attribute information of the corresponding node of the knowledge document. If the keyword probability is greater than or equal to the preset keyword probability and less than 1, the word / phrase unit configuration and keyword probability configuration will be set to the attribute information of the corresponding node in the knowledge document.
[0091] In some embodiments of this application, the computing unit 203 may specifically be used for: The probability P(a, b) of the comprehensive citation relationship between any two knowledge documents is calculated using the following formula:
[0092] Where a and b are any two knowledge documents, Score the semantic relevance between knowledge document a and knowledge document b. Score the preprocessing relevance between knowledge document a and knowledge document b. This represents a direct reference relationship between knowledge document a and knowledge document b.
[0093] In some embodiments of this application, the construction unit 204 may specifically be used for: Construct a probabilistic relationship graph using knowledge documents as nodes and reference relationships as edge weights; Remove self-loop nodes from the probability graph; The target reference probability is obtained by calculating the average probability of all connected paths between any two nodes x and y in the probability graph. The probability of a single path is the product of the overall reference probabilities of all edges on that path. Knowledge graphs are constructed based on target reference probabilities.
[0094] In some embodiments of this application, the construction unit 204 may specifically be used for: The target reference probability of all connected paths between any two nodes x and y in the probability graph is calculated using the following formula:
[0095]
[0096] in, Let x be the target reference probability between nodes x and y. Let a, i, ..., j, b be the probability of a single path, a, i, ..., j, b be the traversal path, and root(a, i, ..., j, b) be the number of nodes visited.
[0097] In some embodiments of this application, the construction unit 204 may specifically be used for: For any two knowledge documents, if the target reference probability is greater than or equal to the first threshold, then establish a reference relationship edge in the knowledge graph from the first node corresponding to one knowledge document to the second node corresponding to the other knowledge document. If the target reference probability is less than the first threshold and greater than the second threshold, then all possible paths from the first node to the second node in the probability relationship graph are traversed. If at least one candidate path with a target reference probability greater than or equal to the first threshold is found, then the target path with the highest target reference probability is selected from the at least one candidate path, and a reference relationship chain from the first node to the second node is established in the knowledge graph along the target path.
[0098] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0099] The knowledge graph construction device for knowledge documents proposed in this disclosure extracts the pure content text, sentence units, word units, and direct reference relationships of documents through automated natural language processing. It then collaboratively performs multi-level semantic processing with a trained general-purpose model and a local domain-specific model, effectively integrating direct reference relationships and deep semantic connections. This allows for the automated and accurate calculation of the comprehensive reference relationship probability between knowledge documents. Based on this probability, a knowledge graph with knowledge documents as nodes and reference relationships as edges is automatically constructed, significantly improving the efficiency and accuracy of mining and constructing knowledge relationships from massive amounts of unstructured documents, and achieving a structured and intelligent organization of the knowledge system.
[0100] Figure 3 This is a block diagram illustrating an apparatus for a method of constructing a knowledge graph for knowledge documents, according to an exemplary embodiment. For example, apparatus 300 may be an electronic device, such as a mobile phone, computer, digital broadcasting terminal, messaging device, tablet device, personal digital assistant, etc.
[0101] Reference Figure 3 The device 300 may include one or more of the following components: processing component 302, memory 304, power component 306, multimedia component 308, audio component 310, input / output (I / O) interface 312, sensor component 314, and communication component 316.
[0102] Processing component 302 typically controls the overall operation of device 300, such as operations associated with display, telephone calls, data communication, camera operation, and recording. Processing component 302 may include one or more processors 320 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 302 may include one or more modules to facilitate interaction between processing component 302 and other components. For example, processing component 302 may include a multimedia module to facilitate interaction between multimedia component 308 and processing component 302.
[0103] Memory 304 is configured to store various types of data to support the operation of device 300. Examples of such data include instructions for any application or method operating on device 300, contact data, phonebook data, messages, pictures, videos, etc. Memory 304 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0104] The power supply component 306 provides power to the various components of the device 300. The power supply component 306 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to the device 300.
[0105] Multimedia component 308 includes a screen that provides an output interface between the device 300 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 308 includes a front-facing camera and / or a rear-facing camera. When the device 300 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0106] Audio component 310 is configured to output and / or input audio signals. For example, audio component 310 includes a microphone (MIC) configured to receive external audio signals when device 300 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 304 or transmitted via communication component 316. In some embodiments, audio component 310 also includes a speaker for outputting audio signals.
[0107] I / O interface 312 provides an interface between processing component 302 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, start buttons, and lock buttons.
[0108] Sensor assembly 314 includes one or more sensors for providing status assessments of various aspects of device 300. For example, sensor assembly 314 may detect the on / off state of device 300, the relative positioning of components such as the display and keypad of device 300, changes in the position of device 300 or a component of device 300, the presence or absence of user contact with device 300, the orientation or acceleration / deceleration of device 300, and temperature changes of device 300. Sensor assembly 314 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 314 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 314 may also include an accelerometer, a gyroscope, a magnetometer, a pressure sensor, or a temperature sensor.
[0109] Communication component 316 is configured to facilitate wired or wireless communication between device 300 and other devices. Device 300 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 316 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 316 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0110] In an exemplary embodiment, the apparatus 300 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.
[0111] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 304 including instructions, which can be executed by a processor 320 of the device 300 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0112] In an exemplary embodiment, a computer program product is also provided, including a computer program that implements the above-described method when executed by the processor 320 of the device 300.
[0113] Other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of the invention are indicated by the following claims.
[0114] It should be understood that the present invention is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.
Claims
1. A method for constructing a knowledge graph for knowledge documents, characterized in that, include: Natural language processing is performed on knowledge documents to obtain plain text, sentence units, word and sentence units, and direct reference relationships between knowledge documents; Based on the trained large model, semantic processing is performed on the word and sentence units to obtain a first semantic processing result. Then, the pure content text is input into the local large model for semantic processing to obtain a second semantic processing result. The first semantic processing result includes a score of the importance of words and sentences in their respective sentences. The second semantic processing result includes a score of the semantic relevance between knowledge document pairs. Based on the direct reference relationship, the first semantic processing result, and the second semantic processing result, calculate the probability of the comprehensive reference relationship between any two knowledge documents; Based on the comprehensive reference relationship probability, a knowledge graph is constructed with knowledge documents as nodes and reference relationships as edges.
2. The knowledge graph construction method for knowledge documents according to claim 1, characterized in that, The large model, based on the completed training, performs semantic processing on the word and sentence units to obtain a first semantic processing result, including: The word and sentence units are respectively input into multiple pre-trained general-purpose large models; Receive the semantic processing results returned by each general large model, and normalize the semantic processing results; the semantic processing results include at least the importance evaluation value of the corresponding words and sentences, the total number of corpora retrieved by the large model, and the number of related corpora hit; The importance evaluation returned by the general large model is weighted and fused using the following formula to obtain the first semantic processing result: in, This is the result of the first semantic processing. Let i be the weights of the i-th large model. Let be the importance evaluation value output by the i-th large model, hit(i) be the total number of corpora retrieved by the i-th large model, and num(i) be the number of related corpora hit by the i-th large model.
3. The knowledge graph construction method for knowledge documents according to claim 1, characterized in that, The plain text is input into a local large model for semantic processing to obtain a second semantic processing result, including: The plain text is input into the local large model that has been trained and optimized for a specific domain for semantic processing; Obtain the second semantic processing result returned by the local large model; the second semantic processing result also includes the semantic importance score of words and phrases in the professional thesaurus in the plain content text.
4. The knowledge graph construction method for knowledge documents according to claim 1, characterized in that, After performing natural language processing on the knowledge documents to obtain plain text, sentence units, word units, and direct reference relationships between knowledge documents, the process further includes: The word / phrase unit is matched with words / phrase units in a pre-set professional thesaurus for the field of coal mining. If the match is successful, the first importance probability of the word / phrase unit in the sentence and the second importance probability of the word / phrase unit in the document are calculated. Based on the importance score of a word or phrase within its constituent sentences, the first importance probability, and the second importance probability, the keyword probability of a word or phrase is calculated using the following formula. : in, The first semantic processing result is represented by P_sentence(word,sentence), which is the first importance probability, and P_text(word,text), which is the second importance probability, and is the adjustment coefficient. The method further includes: The attribute information in the knowledge graph is constructed based on the probability of the keywords.
5. The knowledge graph construction method for knowledge documents according to claim 4, characterized in that, The construction of attribute information in the knowledge graph based on the keyword probabilities includes: If the keyword probability is greater than or equal to 1, the keyword probability is updated to 1, and the word / phrase unit configuration and the updated keyword probability are configured as the attribute information of the corresponding node of the knowledge document. If the keyword probability is greater than or equal to the preset keyword probability and less than 1, the word / phrase unit configuration and the keyword probability configuration are set as attribute information of the corresponding node of the knowledge document.
6. The knowledge graph construction method for knowledge documents according to claim 1, characterized in that, The step of calculating the probability of a comprehensive reference relationship between any two knowledge documents based on the direct reference relationship, the first semantic processing result, and the second semantic processing result includes: The probability P(a, b) of the comprehensive citation relationship between any two knowledge documents is calculated using the following formula: Where a and b are any two knowledge documents, Score the semantic relevance between knowledge document a and knowledge document b. Score the preprocessing relevance between knowledge document a and knowledge document b. This represents a direct reference relationship between knowledge document a and knowledge document b.
7. The knowledge graph construction method for knowledge documents according to claim 6, characterized in that, The construction of a knowledge graph based on the comprehensive citation relationship probability, with knowledge documents as nodes and citation relationships as edges, includes: Construct a probabilistic relationship graph using knowledge documents as nodes and reference relationships as edge weights; Delete the self-loop nodes in the probability graph; The target reference probability is obtained by calculating the average probability of all connected paths between any two nodes x and y in the probability graph. The probability of a single path is the product of the overall reference probabilities of all edges on that path. The knowledge graph is constructed based on the target reference probability.
8. The knowledge graph construction method for knowledge documents according to claim 7, characterized in that, The calculation of the average probability of all connected paths between any two nodes x and y in the probability graph yields the target reference probability, including: The target reference probability of all connected paths between any two nodes x and y in the probability graph is calculated using the following formula: in, Let x be the target reference probability between nodes x and y. Let a, i, ..., j, b be the probability of a single path, a, i, ..., j, b be the traversal path, and root(a, i, ..., j, b) be the number of nodes visited.
9. The knowledge graph construction method for knowledge documents according to claim 7, characterized in that, The construction of the knowledge graph based on the target reference probability includes: For any two knowledge documents, if the target reference probability is greater than or equal to a first threshold, then a reference relationship edge is established in the knowledge graph from the first node corresponding to one knowledge document to the second node corresponding to the other knowledge document. If the target reference probability is less than the first threshold and greater than the second threshold, then all possible paths from the first node to the second node in the probability relationship graph are traversed. If at least one candidate path with a target reference probability greater than or equal to the first threshold is found, then the target path with the highest target reference probability is selected from the at least one candidate path, and a reference relationship chain from the first node to the second node is established in the knowledge graph along the target path.
10. A knowledge graph construction device for knowledge documents, characterized in that, include: The Natural Language Processing Unit is used to perform natural language processing on knowledge documents to obtain plain content text, sentence units, word and sentence units, and direct reference relationships between knowledge documents. The semantic processing unit is used to perform semantic processing on the word and sentence units and the statement units based on the trained large model to obtain a first semantic processing result, and to input the pure content text into the local large model for semantic processing to obtain a second semantic processing result; the first semantic processing result includes a score of the importance of words and sentences in their respective statements; the second semantic processing result includes a score of the semantic relevance between knowledge document pairs. The calculation unit is used to calculate the probability of a comprehensive reference relationship between any two knowledge documents based on the direct reference relationship, the first semantic processing result, and the second semantic processing result. The construction unit is used to construct a knowledge graph with knowledge documents as nodes and reference relationships as edges based on the comprehensive reference relationship probability.