Community discovery method, device and storage medium for mineral knowledge graph

By performing text segmentation, entity relationship graph construction and modularity aggregation on the mineral knowledge graph, the problems of computing power dependence and model limitations in traditional methods are solved, efficient community discovery and data reorganization are achieved, and the application efficiency and accuracy of the knowledge graph are improved.

CN120144780BActive Publication Date: 2025-09-19INST OF MINERAL RESOURCES CHINESE ACAD OF GEOLOGICAL SCI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510214034.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-26
Publication Date
2025-09-19
Estimated Expiration
2045-02-26

AI Technical Summary

Technical Problem

Traditional mineral resource knowledge graph construction methods are highly dependent on computing power and have high limitations. They are difficult to accurately capture cross-text entity relationships, have slow data updates, lack model versatility, and are difficult to develop applications.

Method used

By acquiring the knowledge base and performing text segmentation, extracting entities, building an entity relationship diagram, calculating entity distance and similarity, and aggregating communities based on modularity, we reduce dependence on high-performance large models and adopt a quantitative method of weight analysis to achieve community aggregation and reorganization.

Benefits of technology

It reduces the dependence on high-performance large models, improves the knowledge graph's ability to answer questions, reduces uncertainty, enhances community differentiation and data retrieval efficiency, and provides a logical basis for community formation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120144780B_ABST
    Figure CN120144780B_ABST
Patent Text Reader

Abstract

The present invention relates to a community discovery method, device, and storage medium for a mineral knowledge graph. The community discovery method for a mineral knowledge graph aggregates discrete knowledge base documents, reducing reliance on high-performance large models and improving the ability to answer questions. Compared to traditional techniques that use weight values ​​from prompt words, this method proposes a quantitative approach to weight analysis, which reduces performance requirements and achieves better community differentiation. Finally, modularity is used to achieve community aggregation and reorganization of community data, providing a logical basis for the formation of geological communities and reducing the uncertainty of large model outputs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer information processing, and in particular to a community discovery method, device and storage medium for a mineral knowledge graph. Background Art

[0002] Large language models can rapidly process and analyze vast amounts of mineral resource literature, accurately extracting key information and providing strong support to decision makers. Specifically, they can help researchers quickly organize core data such as the distribution, reserves, and mining status of mineral resources, thereby constructing a comprehensive knowledge graph for the mineral resource sector. Through intelligent analysis, the model can accurately identify and distinguish complex direct and indirect relationships within the knowledge graph, enabling community discovery. This helps decision makers gain a comprehensive understanding of the situation and provides a solid technical foundation for the intelligent management of mineral resources.

[0003] However, the inventors found that the traditional method of constructing mineral resource knowledge graphs has problems such as high dependence on computing power and high limitations. Summary of the Invention

[0004] Based on this, it is necessary to provide a community discovery method, device and storage medium that can accurately obtain a mineral knowledge graph with low computing power dependence and good generalization in real time.

[0005] To achieve the above objectives, on the one hand, an embodiment of the present application provides a community discovery method for a mineral knowledge graph, comprising the steps of:

[0006] Obtain a knowledge base and divide the knowledge base into text blocks to obtain text blocks;

[0007] Based on each text block, obtain the entities of the knowledge base;

[0008] Constructing a first entity relationship diagram according to the entities and the relationships between the entities;

[0009] Obtaining a first distance between any two entities within each text block, and determining a second distance between any two entities in the knowledge base based on the first distance;

[0010] Get the similarity between any two entities and the concept library;

[0011] The sum of the similarity and the second distance is determined as the weight value of the edge in the first entity relationship graph; wherein the edge is formed based on any two entities;

[0012] According to the weight value of the edge, the modularity is obtained;

[0013] Based on the increment of modularity, the nodes of the first entity relationship graph are aggregated to obtain multiple communities.

[0014] In one embodiment, the step of determining a second distance between any two entities in the knowledge base based on the first distance includes:

[0015] Set the truncation function;

[0016] A second distance is obtained based on the cutoff function and the first distance.

[0017] In one embodiment, in the step of obtaining the second distance based on the truncation function and the first distance, the second distance is obtained based on the following formula:

[0018]

[0019] Wherein, WD is the second distance; d w is the first distance; δ c is the truncation function; all i The maximum number of times any two entities appear simultaneously within a preset range.

[0020] In one embodiment, the step of obtaining the similarity between any two entities and the concept library includes:

[0021] Get the description text and concept library corresponding to any two entities;

[0022] Perform vectorized calculation on the description texts corresponding to any two entities to obtain vectorized entities;

[0023] Based on the vectorized entities, the vector of the target concept is obtained from the concept library;

[0024] Based on the vectors of the vectorized entities and target concepts, the similarity between any two entities and the concept library is obtained.

[0025] In one embodiment, in the step of obtaining the similarity between any two entities and the concept library based on the vectorized entity and target concept vectors, the similarity is obtained based on the following formula:

[0026]

[0027] Among them, CD is the similarity; i is the category code of the target concept; allc represents the number of categories; is one of any two vectorized entities; is the other of any two vectorized entities; is the vector of the target concept of category i extracted according to one of the vectorized entities; is the vector of the target concept of category i extracted based on another vectorized entity. ci is the weight of the target concept with category code i.

[0028] In one embodiment, the steps are further included:

[0029] Get the description text corresponding to each community;

[0030] The description texts corresponding to each community are summarized to obtain a community summary.

[0031] In one embodiment, the steps are further included:

[0032] Receive a user's request;

[0033] Convert the request into a request vector;

[0034] Perform similarity matching between the request vector and the community summary to obtain the target community;

[0035] Extract entities matching the request vector in the target community.

[0036] In one embodiment, the step of dividing the knowledge base into text blocks to obtain the text blocks includes:

[0037] Split the knowledge base into multiple statements;

[0038] Vectorize each statement to obtain multiple vectors;

[0039] Based on the cosine similarity of their vectors, adjacent sentences are classified as the same text block or different text blocks.

[0040] In one aspect, an embodiment of the present invention provides a community discovery device for a mineral knowledge graph, comprising:

[0041] The block module is used to obtain the knowledge base and divide the knowledge base into text blocks to obtain various text blocks;

[0042] The entity extraction module is used to obtain entities in the knowledge base based on each text block;

[0043] A construction module, configured to construct a first entity relationship graph based on the entities and the relationships between the entities;

[0044] A distance acquisition module is used to acquire a first distance between any two entities in each text block, and to determine a second distance between any two entities in the knowledge base based on the first distance;

[0045] Similarity acquisition module, used to obtain the similarity between any two entities and the concept library;

[0046] A weight value calculation module is used to determine the sum of the similarity and the second distance as the weight value of the edge in the first entity relationship graph; wherein the edge is formed based on any two entities;

[0047] The modularity calculation module is used to obtain the modularity based on the edge weight value;

[0048] The aggregation module is used to aggregate the nodes of the first entity relationship graph based on the increment of modularity to obtain multiple communities.

[0049] On the other hand, the present application provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of the above method when run.

[0050] One of the above technical solutions has the following advantages and beneficial effects:

[0051] The community discovery method for the mineral knowledge graph described above aggregates discrete knowledge base documents, reducing reliance on high-performance large models and improving question-answering capabilities. Compared to traditional techniques that use weights derived from prompt words, this method proposes a quantitative weight analysis approach, lowering performance requirements while also achieving better community differentiation. Finally, through modularity, community aggregation and community data reorganization are achieved, providing a logical basis for the formation of geoscience communities and reducing the uncertainty of large model outputs. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0054] Figure 1 is a first schematic flow chart of a community discovery method for a mineral knowledge graph in one embodiment;

[0055] Figure 2 is a schematic flow chart of the steps of obtaining the similarity between any two entities in a concept library in one embodiment;

[0056] Figure 3 is a schematic flowchart of a step of confirming a second distance between any two entities in a knowledge base based on a first distance in one embodiment;

[0057] Figure 4 is a second schematic flow chart of a community discovery method for a mineral knowledge graph in one embodiment;

[0058] Figure 5The figure is a schematic flow chart of the steps of dividing the text of the knowledge base into blocks and obtaining each text block in one embodiment. DETAILED DESCRIPTION

[0059] To facilitate understanding of the present application, the present application will be described more fully below with reference to the accompanying drawings. The accompanying drawings provide embodiments of the present application. However, the present application may be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to make the disclosure of the present application more thorough and comprehensive.

[0060] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application pertains. The terms used herein in the specification of this application are for the purpose of describing specific embodiments only and are not intended to limit this application.

[0061] In the subsequent description, the suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of this application and have no specific meaning. Therefore, "module" and "component" can be used interchangeably.

[0062] It can be understood that the “connection” in the following embodiments should be understood as “electrical connection”, “communication connection”, etc. if there is transmission of electrical signals or data between the connected circuits, modules, units, etc.

[0063] When used herein, the singular forms "a", "an", and "the" may also include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the terms "include / comprise" or "have" and the like specify the presence of stated features, integers, steps, operations, components, parts, or combinations thereof, but do not preclude the possibility of the presence or addition of one or more other features, integers, steps, operations, components, parts, or combinations thereof.

[0064] Currently, traditional methods for constructing mineral resource knowledge graphs primarily rely on relational databases (such as trade databases) or are based on small datasets and small deep learning models. However, the inherent limitations of these methods lead to the following problems:

[0065] 1. Limitations of cross-text entity relationship extraction: When processing information across paragraphs, sentences, and even documents, these methods struggle to accurately capture and establish connections between core knowledge points. This limitation significantly hinders the discovery of universal knowledge and makes it difficult to comprehensively extract key information from multiple documents.

[0066] Data update lags: The tedious and time-consuming training process for deep learning models, coupled with the complex construction process, results in slow data updates. This means that it often takes a long time from the time a batch of data is collected to the time the model is trained and put into use.

[0067] 2. Insufficient model versatility: Traditional methods typically use small models, and their application is often limited to specific fields. In the current technological context of the continuous emergence of large models, small models are no longer able to meet the needs of building cross-domain, universal knowledge graphs.

[0068] 3. Application Development Challenges: Once the knowledge graph is built, subsequent application development also faces numerous challenges. In particular, when implementing natural language-based question-and-answer (Q&A) queries, the technical limitations of traditional methods often make it difficult to quickly and efficiently develop applications that meet user needs.

[0069] In summary, traditional mineral resource knowledge graph construction methods have significant shortcomings in terms of cross-text relationship extraction, data timeliness, model universality, and application development. The community discovery method of the mineral knowledge graph provided in this application can effectively solve the above problems.

[0070] In one embodiment, Figure 1 As shown, a community discovery method for a mineral knowledge graph is provided, including the following steps:

[0071] S110, obtaining a knowledge base and dividing the knowledge base into text blocks to obtain text blocks;

[0072] Specifically, a knowledge base can be obtained by rapidly processing and analyzing a large amount of mineral resource-related literature using a language model. The content of the knowledge base is segmented into smaller, easier-to-process text blocks according to certain logic or rules. This facilitates information extraction and processing in subsequent steps. In one example, natural paragraphs can also be obtained through formatting features to form text blocks. In another specific example, a vector model can be used to segment text blocks. This allows text blocks to be aggregated according to semantics, to some extent avoiding the phenomenon of text blocks interrupting semantics and avoiding segmentation errors caused by the often diverse styles of paragraph formatting, typesetting, and punctuation.

[0073] S120, obtaining entities of the knowledge base based on each text block;

[0074] Specifically, key entities are extracted from each text block. Entities can be noun phrases, names of people, places, or organizations. Furthermore, this step leverages the understanding capabilities of a large language model to extract entities one by one, per text block, to obtain entity text. After extraction, the entity text undergoes a first cleansing step using regular expression matching. Then, the entity model undergoes a second cleansing step using a vector model, completely eliminating duplicate information to obtain the final entities. Entity extraction within the knowledge base determines the division of communities.

[0075] S130, constructing a first entity relationship graph based on the entities and the relationships between the entities;

[0076] Specifically, we analyze the relationships between entities in a text block, which can be identified and confirmed through co-occurrence, semantic similarity, or specific relationship templates. Based on the identified entities and their relationships, we construct a preliminary entity-relationship graph, where nodes represent entities and edges represent relationships.

[0077] S140, obtaining a first distance between any two entities within each text block, and determining a second distance between any two entities in the knowledge base based on the first distance;

[0078] Among them, the first distance refers to the distance between two entities in different text blocks, and the second distance refers to the sum of the distances between the two entities in the knowledge base. It should be noted that the relevance of entities can be continuously improved as described below: a. The two entities appear in the same article. b. The two entities appear in the same article multiple times. c. The two entities appear in the same article, but different text blocks. d. The two entities appear in the same article, but different text blocks, and appear multiple times in each text block. e. The two entities appear in the same article, but different text blocks, and appear multiple times in each paragraph, and in each text block, appear simultaneously in multiple sentences. Furthermore, the distance between any two entities can be calculated based on the lexical distance or sentence-level distance within the text block, or based on other technical means in this field.

[0079] S150, obtaining the similarity between any two entities and the concept library;

[0080] Specifically, in some cases, two entities do not appear in the same paragraph of text, but they belong to the same category of concepts. In this category, the two entities have a certain connection. Furthermore, by introducing a specialized geoscience professional knowledge base as a concept library. In a specific example, Figure 2As shown, the steps for obtaining the similarity between any two entities and the concept library include: S210, obtaining the descriptive text corresponding to any two entities and the concept library; S220, performing vectorization calculation on the descriptive text corresponding to any two entities to obtain vectorized entities; S230, obtaining the vector of the target concept in the concept library based on the vectorized entity; S240, obtaining the similarity between any two entities and the concept library based on the vectorized entity and the vector of the target concept. In other words, the entities are summarized to obtain entity summaries (i.e., the descriptive text corresponding to the above entities), and then the content in the entity summaries is vectorized using the embedding model, and the similarity between them and related concepts in the concept library is extracted. The similarity between the extracted concepts themselves is then compared, and finally, all comparisons of categories are combined.

[0081] Specifically, in the step of obtaining the similarity between any two entities and the concept library based on the vectorized entity and the target concept vector, the similarity is obtained based on the following formula:

[0082]

[0083] Among them, CD is the similarity; i is the category code of the target concept; allc represents the number of categories; is one of any two vectorized entities; is the other of any two vectorized entities; is the vector of the target concept of category i extracted according to one of the vectorized entities; is the vector of the target concept of category i extracted based on another vectorized entity. ci is the weight of the target concept with category code i.

[0084] S160, determining the sum of the similarity and the second distance as the weight value of the edge in the first entity relationship graph; wherein the edge is formed based on any two entities;

[0085] Specifically, the similarity and the second distance are added together to obtain a weight value of each edge in the first entity relationship graph, which reflects the degree of association between entities.

[0086] S170, obtaining modularity according to the weight value of the edge;

[0087] Modularity is a measure of the quality of community delineation. It reflects the relative strength of connections between nodes within a community relative to the strength of connections between nodes outside the community. In this step, the modularity of the entire entity relationship graph is calculated based on the edge weights.

[0088] S180 , based on the increment of modularity, aggregate the nodes of the first entity relationship graph to obtain multiple communities.

[0089] Specifically, the nodes of the first entity relationship diagram are aggregated through the modularity formula and the modularity increment formula.

[0090] Modularity:

[0091] Modularity increment:

[0092] Among them, ∑ in represents the sum of the weights of all edges in community C; ∑ tot represents the sum of the weights of all variable edges pointing to community C; k i represents the sum of the weights of all edges pointing to node i; k i,in represents the sum of the weights of the edges between node i and community C; m represents the sum of the weights of all edges.

[0093] In S160, the weight of each edge has been obtained. With the weight of each edge, the sum of the weights of all edges, m, can be calculated. Then, among all the nodes, the node with the largest △Q is found and aggregated into a community. In the first step of community aggregation, each node is an independent community, so ∑ tot , which is the sum of the weights of the relationships between a node and all other nodes, that is, the sum of the weights of the edges formed by its other nodes:

[0094]

[0095] From the formula of △Q, we can see that in order to complete the aggregation, the target node k i,in and the weight value of the initial node and The difference between the two nodes determines the chance of forming a community. i represents the sum of the weights of all edges pointing to node i, also known as the target node. Therefore, when the weights of the relationships between the target node and other nodes are small, and the weights of the relationships with the initial node are sufficiently large, the initial and target nodes are more likely to form a community. A single iteration can aggregate some nodes into a community. The community then becomes a new node, and continues to aggregate with nodes from other communities according to the △Q formula, repeating this process until no new communities can be formed, meaning that △Q falls below a certain threshold, typically 0. Communities containing multiple nodes have larger ki,in values, making them more likely to aggregate with new nodes into new communities. In this way, communities gradually aggregate.

[0096] The community discovery method for the mineral knowledge graph described above aggregates discrete knowledge base documents, reducing reliance on high-performance large models and improving question-answering capabilities. Compared to traditional techniques that use weights derived from prompt words, this method proposes a quantitative weight analysis approach, lowering performance requirements while also achieving better community differentiation. Finally, through modularity, community aggregation and community data reorganization are achieved, providing a logical basis for the formation of geoscience communities and reducing the uncertainty of large model outputs.

[0097] In one embodiment, Figure 3 As shown, the second distance step of confirming any two entities in the knowledge base based on the first distance includes:

[0098] S310, setting a truncation function;

[0099] Specifically, the purpose of setting the truncation function is to w When the distance is greater than the preset threshold, the distance is not used. Since the previous summation has already taken into account the situation where entities appear in different text blocks, it is necessary to add this truncation function to eliminate the interference caused by the distance between entities across text blocks.

[0100] S320: Obtain a second distance based on the truncation function and the first distance.

[0101] In one embodiment, in the step of obtaining the second distance based on the truncation function and the first distance, the second distance is obtained based on the following formula:

[0102]

[0103] Wherein, WD is the second distance; d w is the first distance; δ c is the truncation function; all i The maximum number of times any two entities appear simultaneously within a preset range.

[0104] Furthermore, the weight value W of the edge in the first entity relationship graph l for:

[0105]

[0106] In one embodiment, the steps are further included:

[0107] Get the description text corresponding to each community;

[0108] The description texts corresponding to each community are summarized to obtain a community summary.

[0109] Specifically, after the knowledge base is abstracted and divided into several communities, these initially aggregated communities consist solely of entities and lack textual descriptions, making subsequent operations such as search enhancement and generation difficult. To address this issue, descriptive text is extracted for each entity. Furthermore, the capabilities of the large model are leveraged to deeply summarize and integrate the textual descriptions of all entities within the community, thereby forming a summary description for each community. This results in each community having its own unique descriptive text, providing a solid foundation and facilitating subsequent knowledge graph searches. This step not only enriches the information content of the community but also greatly enhances the practicality and operability of the knowledge graph.

[0110] In one embodiment, Figure 4 As shown, the steps include:

[0111] S410, receiving a user request;

[0112] S420, converting the request into a request vector;

[0113] S430, performing similarity matching on the request vector and the community summary to obtain a target community;

[0114] S440: Extract entities matching the request vector in the target community.

[0115] Specifically, aggregated communities and their corresponding entities together constitute the core structure of the knowledge graph, with communities serving as tree nodes and entities serving as leaf nodes, creating a clear hierarchy and logical structure. When performing RAG (Retrieval-Augmented Generation) operations, we first utilize advanced vector models to convert user query requests into request vectors. We then perform cosine similarity matching on this vector with the summary descriptions of each community, accurately extracting communities that are highly similar to the user's request. Next, within these selected communities, we apply similarity matching techniques to meticulously extract the entities that best match the user's request.

[0116] Compared to simple RAG operations, even RAG equipped with a rearranger, our approach can extract a wider range of text data, significantly improving the quality and depth of responses provided by large models to comprehensive questions. Furthermore, community aggregation not only enhances the efficiency and accuracy of data retrieval but also opens up new avenues for researchers to delve deeper into the underlying patterns and connections within their research subjects. This innovative approach not only optimizes the knowledge graph experience but also brings new insights and possibilities to academic research and data analysis.

[0117] In one embodiment, Figure 5As shown in FIG, the steps of dividing the knowledge base into text blocks and obtaining each text block include:

[0118] S510, splitting the knowledge base to obtain multiple statements;

[0119] S520, vectorizing each statement to obtain multiple vectors;

[0120] S530 , based on the cosine similarity of the vectors of the adjacent sentences, classify the adjacent sentences into the same text block or different text blocks.

[0121] Specifically, the knowledge base text is first segmented into chunks by sentence. Using an embedding model, the preceding and following sentences are vectorized, and the cosine similarity between these two vectors is calculated. A preset threshold is then set to determine whether the two sentences are similar. If they are similar, the two sentences are clustered together. If they are not similar, the following sentence forms a new chunk of text. This process is repeated until the text is fully segmented. This method allows text chunks to be clustered by semantics, which, to a certain extent, avoids the phenomenon of semantic disruption in text chunks.

[0122] In one embodiment, a community discovery device for a mineral knowledge graph includes:

[0123] The block module is used to obtain the knowledge base and divide the knowledge base into text blocks to obtain various text blocks;

[0124] The entity extraction module is used to obtain entities in the knowledge base based on each text block;

[0125] A construction module, configured to construct a first entity relationship graph based on the entities and the relationships between the entities;

[0126] A distance acquisition module is used to acquire a first distance between any two entities in each text block, and to determine a second distance between any two entities in the knowledge base based on the first distance;

[0127] Similarity acquisition module, used to obtain the similarity between any two entities and the concept library;

[0128] A weight value calculation module is used to determine the sum of the similarity and the second distance as the weight value of the edge in the first entity relationship graph; wherein the edge is formed based on any two entities;

[0129] The modularity calculation module is used to obtain the modularity based on the edge weight value;

[0130] The aggregation module is used to aggregate the nodes of the first entity relationship graph based on the increment of modularity to obtain multiple communities.

[0131] For the specific definition of the community discovery device of the mineral knowledge graph, please refer to the definition of the community discovery method of the mineral knowledge graph above, which will not be repeated here. The various modules in the community discovery device of the mineral knowledge graph mentioned above can be implemented in whole or in part by software, hardware and their combination. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0132] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0133] Obtain a knowledge base and divide the knowledge base into text blocks to obtain text blocks;

[0134] Based on each text block, obtain the entities of the knowledge base;

[0135] Constructing a first entity relationship diagram according to the entities and the relationships between the entities;

[0136] Obtaining a first distance between any two entities within each text block, and determining a second distance between any two entities in the knowledge base based on the first distance;

[0137] Get the similarity between any two entities and the concept library;

[0138] The sum of the similarity and the second distance is determined as the weight value of the edge in the first entity relationship graph; wherein the edge is formed based on any two entities;

[0139] According to the weight value of the edge, the modularity is obtained;

[0140] Based on the increment of modularity, the nodes of the first entity relationship graph are aggregated to obtain multiple communities.

[0141] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:

[0142] Obtain a knowledge base and divide the knowledge base into text blocks to obtain text blocks;

[0143] Based on each text block, obtain the entities of the knowledge base;

[0144] Constructing a first entity relationship diagram according to the entities and the relationships between the entities;

[0145] Obtaining a first distance between any two entities within each text block, and determining a second distance between any two entities in the knowledge base based on the first distance;

[0146] Get the similarity between any two entities and the concept library;

[0147] The sum of the similarity and the second distance is determined as the weight value of the edge in the first entity relationship graph; wherein the edge is formed based on any two entities;

[0148] According to the weight value of the edge, the modularity is obtained;

[0149] Based on the increment of modularity, the nodes of the first entity relationship graph are aggregated to obtain multiple communities.

[0150] When implementing the embodiments of the present application, reference may be made to the above embodiments, which have corresponding technical effects.

[0151] It is understood that the embodiments described herein may be implemented using hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in 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), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described herein, or a combination thereof.

[0152] For software implementation, the technology described herein can be implemented by a unit that performs the functions described herein. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.

[0153] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0154] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0155] In the embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules is merely a logical function division. In actual implementation, there may be other division methods, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0156] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0157] In addition, the functional units in the various embodiments of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in the various embodiments of the present application. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk, or an optical disk. It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.

[0158] The foregoing is merely a list of specific embodiments of the present application, intended to enable those skilled in the art to understand or implement the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the broadest scope consistent with the principles and novel features of the present application.

Claims

1. A community discovery method for mineral knowledge graph, characterized in that: include: Acquire a knowledge base, and divide the knowledge base into text blocks to obtain text blocks; Based on each of the text blocks, obtaining entities of the knowledge base; Constructing a first entity relationship graph according to the entities and the relationships between the entities; Obtaining a first distance between any two of the entities within each of the text blocks, and determining a second distance between any two of the entities in the knowledge base based on the first distance; Obtaining the similarity between any two entities and the concept library; wherein the step of obtaining the similarity between any two entities and the concept library includes: obtaining description texts corresponding to any two entities and the concept library; performing vectorization calculation on the description texts corresponding to any two entities to obtain vectorized entities; obtaining a vector of a target concept from the concept library based on the vectorized entities; and obtaining the similarity between any two entities and the concept library based on the vectorized entities and the vector of the target concept; Determining the sum of the similarity and the second distance as the weight value of an edge in the first entity relationship graph; wherein the edge is formed based on any two entities; According to the weight value of the edge, the modularity is obtained; Based on the increment of the modularity, the nodes of the first entity relationship graph are aggregated to obtain a plurality of communities.

2. The community discovery method of mineral knowledge graph according to claim 1 is characterized in that: The step of confirming a second distance between any two entities in the knowledge base based on the first distance includes: Set the truncation function; The second distance is obtained based on the truncation function and the first distance.

3. The community discovery method of mineral knowledge graph according to claim 2 is characterized in that: In the step of obtaining the second distance based on the truncation function and the first distance, the second distance is obtained based on the following formula: Wherein, WD is the second distance; d w is the first distance; δ c is the truncation function; all i The maximum number of times any two entities appear simultaneously within a preset range.

4. The community discovery method of mineral knowledge graph according to claim 1, characterized in that: In the step of obtaining the similarity between any two entities in the concept library based on the vectorized entity and the vector of the target concept, the similarity is obtained based on the following formula: Wherein, CD is the similarity; i is the category code of the target concept; allc represents the number of categories; is one of any two of the vectorized entities; is the other of any two of the vectorized entities; is the vector of the target concept of category i extracted according to one of the vectorized entities; is the vector of the target concept of category i extracted based on another vectorized entity; W ci is the weight of the target concept with category code i.

5. The community discovery method of mineral knowledge graph according to claim 1, characterized in that: Also includes the steps: Obtaining description text corresponding to each of the communities; The description texts corresponding to the communities are summarized to obtain a community summary.

6. The community discovery method of mineral knowledge graph according to claim 5, characterized in that: Also includes the steps: Receive a user's request; Converting the request into a request vector; Performing similarity matching on the request vector and the community summary to obtain a target community; In the target community, entities matching the request vector are extracted.

7. The community discovery method of mineral knowledge graph according to claim 1, characterized in that: The step of dividing the knowledge base into text blocks to obtain each text block includes: Splitting the knowledge base to obtain multiple statements; Vectorizing each of the statements to obtain multiple vectors; Based on the cosine similarity of their vectors, adjacent sentences are classified as the same text block or different text blocks.

8. A community discovery device for mineral knowledge graph, characterized in that: include: A block segmentation module is used to obtain a knowledge base and segment the knowledge base into text blocks to obtain text blocks; An entity extraction module, configured to obtain entities in a knowledge base based on each of the text blocks; A construction module, configured to construct a first entity relationship graph according to the entities and the relationships between the entities; a distance acquisition module, configured to acquire a first distance between any two entities within each text block, and determine a second distance between any two entities in the knowledge base based on the first distance; A similarity acquisition module is used to obtain the similarity between any two entities and the concept library; it is also used to obtain the description texts corresponding to any two entities and the concept library, and perform vectorization calculation on the description texts corresponding to any two entities to obtain vectorized entities; it is also used to obtain the vector of the target concept in the concept library based on the vectorized entity; it is also used to obtain the similarity between any two entities and the concept library based on the vectorized entity and the vector of the target concept; a weight value calculation module, configured to determine the sum of the similarity and the second distance as the weight value of an edge in the first entity relationship graph; wherein the edge is formed based on any two of the entities; A modularity calculation module, configured to obtain the modularity according to the weight value of the edge; An aggregation module is used to aggregate the nodes of the first entity relationship graph based on the increment of the modularity to obtain multiple communities.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the steps of the method according to any one of claims 1 to 7 when executed.

Citation Information

Patent Citations

  • RAG question and answer method and system based on knowledge graph and medium

    CN118673126A

  • Knowledge discovery method and device based on large language model and knowledge graph, and medium

    CN119226466A