Knowledge base construction method and device, electronic equipment, storage medium and product
By building a tree-structured knowledge base and using a large model to extract document summaries and content directions, the problem of real-time maintenance and dynamic expansion of the knowledge base is solved, and the intuitive display and efficient management of content direction hierarchies and document associations are achieved.
Patent Information
- Application Number
- CN202511072111.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-31
- Publication Date
- 2025-10-28
AI Technical Summary
As the number and content of documents continue to grow, the real-time maintenance and dynamic expansion of the knowledge base face difficulties, making it hard to efficiently display the content direction hierarchy and related documents.
By using a large model to extract document summaries and content directions, a tree-structured knowledge base is constructed. The tree structure is built and documents are associated through logical relationships, with each node in the tree structure representing a content direction.
It enables an intuitive display of content direction hierarchy and related documents in the knowledge base, and is easy to maintain in real time and dynamically expand.
Smart Images

Figure CN120851171A_ABST
Abstract
Description
Technical Field
[0001] This document relates to the field of computer technology, and in particular to a method, apparatus, electronic device, storage medium, and product for constructing a knowledge base. Background Technology
[0002] Knowledge bases, as an indispensable asset in the digital age, play a vital role in many scenarios, such as finding work-related information in a department's knowledge base, understanding the direction and progress of content in cross-departmental collaborations, and knowledge-based Q&A, etc.
[0003] However, with the continuous growth in the number of documents and the constant updating of document content, the real-time maintenance of the knowledge base faces enormous difficulties, becoming a bottleneck that restricts its effectiveness. Summary of the Invention
[0004] The purpose of the embodiments in this specification is to provide a method, apparatus, electronic device, storage medium, and product for constructing a knowledge base, which is used to construct a tree-structured knowledge base. Each node in the tree structure represents a content direction, and the documents in the knowledge base are associated with the nodes in the tree structure. This not only intuitively displays the content direction hierarchy and associated documents, but also makes the knowledge base easy to maintain in real time and dynamically expand.
[0005] To achieve the above objectives, the embodiments in this specification adopt the following technical solutions: Firstly, a method for constructing a knowledge base is provided, including: Obtain multiple documents for building the knowledge base, and extract a summary of each document and the content direction involved in each document through a large model; A tree structure is constructed based on the logical relationship between the content directions involved in each document. The tree structure includes multiple nodes, and each node represents a content direction. Based on the summary of each document and the content direction of each document, each document is associated with a node on the tree structure to obtain the target knowledge base.
[0006] Secondly, a knowledge base construction apparatus is provided, comprising: The acquisition module is used to acquire multiple documents for building the knowledge base and extract a summary of each document and the content direction involved in each document through a large model; The building module is used to construct a tree structure based on the logical relationship between the content directions involved in each document. The tree structure includes multiple nodes, and each node represents a content direction. The association module is used to associate each document with nodes in the tree structure based on the summary of each document and the content direction involved in each document, so as to obtain the target knowledge base.
[0007] Thirdly, an electronic device is provided, comprising: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the knowledge base construction method as provided in the first aspect.
[0008] Fourthly, a computer-readable storage medium is provided, wherein when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform a method for constructing a knowledge base as provided in the first aspect.
[0009] Fifthly, a computer program product is provided, the computer program product including a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps in the knowledge base construction method provided in the first aspect.
[0010] The solution in this specification utilizes the natural language understanding capabilities of a large model to extract summaries of documents used to build a knowledge base and the content directions involved in those documents. It then uses the logical relationships between these content directions to construct a tree-structured knowledge base. Each node in the tree structure represents a content direction, and the documents in the knowledge base are associated with the nodes in the tree structure. This not only visually displays the content direction hierarchy and associated documents but also makes the knowledge base easy to maintain in real time and dynamically expand. Attached Figure Description
[0011] The accompanying drawings, which are included to provide a further understanding of this specification and form part of this specification, illustrate exemplary embodiments and are used to explain this specification, but do not constitute an undue limitation thereof. In the drawings: Figure 1 A flowchart illustrating a method for constructing a knowledge base, as provided in one embodiment of this specification; Figure 2 A schematic diagram of a tree structure provided for one embodiment of this specification; Figure 3 A schematic diagram of a knowledge base construction apparatus provided as an embodiment of this specification; Figure 4 This is a schematic diagram of an electronic device provided as an embodiment of the present specification. Detailed Implementation
[0012] To make the objectives, technical solutions, and advantages of this specification clearer, the technical solutions of this specification will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of them. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this document.
[0013] The term "comprising" and its variations as used in this document are open-ended, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the following description. The term "in response to" indicates that the performed operation depends on a condition or state. When the dependent condition or state is met, one or more operations may be performed in real time or with a set delay. Unless otherwise specified, there is no restriction on the order in which multiple operations are performed.
[0014] It should be noted that the concepts of "first" and "second" mentioned in this document are used only to distinguish different devices, modules or units, and are not used to restrict the order of functions performed by these devices, modules or units or their interdependencies.
[0015] It should be noted that the terms "one" and "more" used in this document are illustrative rather than restrictive, and those skilled in the art should understand that they should be understood as "one or more" unless explicitly stated in the context.
[0016] The names of messages or information exchanged between multiple devices in the embodiments of this document are for illustrative purposes only and are not intended to limit the scope of these messages or information.
[0017] This specification proposes a method for constructing a knowledge base. It utilizes the natural language understanding capabilities of a large model to extract summaries of documents used to construct the knowledge base and the content directions involved in those documents. Then, it uses the logical relationships between these content directions to construct a tree-structured knowledge base. Each node in the tree structure represents a content direction, and the documents in the knowledge base are associated with the nodes in the tree structure. This method not only intuitively displays the content direction hierarchy and associated documents but also makes the knowledge base easy to maintain in real time and dynamically expand.
[0018] The technical solutions provided in the various embodiments of this specification are described in detail below with reference to the accompanying drawings.
[0019] Please refer to Figure 1The above is a flowchart illustrating a method for constructing a knowledge base, provided as an embodiment of this specification. The method may include: S102, obtain multiple documents for building the knowledge base, and extract the summary of each document and the content direction involved in each document through the large model.
[0020] The multiple documents used to build the knowledge base can be selected according to actual needs, and this specification does not limit this. In one implementation, the multiple documents may include at least one of the following: documents whose owners are members of the user group to which the created knowledge base belongs; documents whose creation time is within a preset time range; and documents with a security level lower than a preset security level.
[0021] For example, if you want to build a knowledge base for a department, and the documents in the knowledge base are required to be documents from the last three months, and all documents in the knowledge base are publicly available, then you can select documents from the candidate document set whose owners are members of the department, whose creation time is within three months before the current time, and whose confidentiality level is public, as the documents used to build the knowledge base.
[0022] For each document, a large model can be used to perform semantic understanding and summarization of its content, resulting in a summary of the document and the content direction it covers. Here, the content direction can be understood as projects or work tasks.
[0023] For example, one document introduces the advantages of cloud computing in big data processing, and the content of this document covers both cloud computing and big data processing. Another document discusses the application of deep learning in image recognition, and the content of this document covers artificial intelligence, deep learning, and image recognition.
[0024] Understandably, large models possess powerful natural language understanding and generation capabilities, enabling them to accurately and completely extract document summaries and the content directions involved, thus providing data support for the subsequent construction of high-quality knowledge bases.
[0025] In applications, large models can be various models with document processing capabilities, such as large language models, etc., and the embodiments in this specification do not limit this.
[0026] S104, construct a tree structure based on the logical relationships between the content directions involved in each document.
[0027] Logical relationships reflect the inherent connections between the content directions covered in a document, and can include, but are not limited to, inclusion, parallel, causal, progressive, and hierarchical relationships. Based on these logical relationships, the hierarchical relationships between content directions can be determined, such as a certain content direction being a sub-content direction of another content direction, thereby constructing a tree structure to represent this hierarchical relationship.
[0028] A tree structure consists of multiple nodes distributed across multiple levels, with each node representing a content direction. As you can see, the tree structure visually illustrates the relationships between the content directions involved in each document.
[0029] For example, Figure 2 A tree structure is shown, comprising nodes at three levels. The first level includes node 1, representing the content direction "Technology Research and Development." The second level includes nodes 11 and 12, both connected to node 1 and being its children. Node 11 represents the content direction "Artificial Intelligence," and node 12 represents the content direction "Cloud Computing." The third level includes nodes 111, 112, 121, and 122. Nodes 111 and 112 are connected to node 11 and are its children. Node 111 represents the content direction "Deep Learning," node 112 represents the content direction "Computer Vision," node 121 represents the content direction "Big Data Processing," and node 122 represents the content direction "Cloud Storage."
[0030] In S104 above, the tree structure can be constructed in various appropriate ways.
[0031] In one implementation, S104 includes the following steps: S1042, determine the global document from multiple documents based on the logical relationship between the content directions involved in each document.
[0032] A global document refers to a document with broad content coverage and a macro-level perspective. In some examples, a global document typically involves multiple different, relatively macro-level content directions. Based on this, for each document, if the number of content directions involved in the document is greater than or equal to a first quantity threshold, or if the content directions involved in other documents belong to sub-content directions of the content directions involved in this document, then the document is determined as a global document. The first quantity threshold can be set according to actual needs, such as 3, etc., and this specification does not limit this setting in the embodiments.
[0033] For example, document 1 involves the content direction "artificial intelligence", and other documents involve the content direction "computer vision". Since the content direction "deep learning" is a sub-content direction of "artificial intelligence", document 1 is determined as the global document.
[0034] For example, document 2 involves four content areas: "natural language processing", "speech processing", "reinforcement learning" and "generative models". These content areas are all sub-content areas of the content area "deep learning". Therefore, document 2 is identified as a global document.
[0035] Among the aforementioned multiple documents, there may also be specific documents. A specific document refers to a document whose content focuses on a single specific content direction. In some examples, for each document, if the number of content directions involved in the document is less than a first threshold, and the content directions involved in other content documents are not sub-content directions of the content direction involved in the document, then the document is identified as a specific document.
[0036] For example, document 3 involves the content direction "speech processing", and the content directions of other documents do not belong to the sub-content direction of "speech processing", so document 3 is identified as a specific document.
[0037] Understandably, determining whether a document is a global document or a specific document based on the number of content directions involved in the document and the relationship between these content directions and the content directions involved in other documents can ensure the accuracy and completeness of global document filtering and provide reliable data support for building a high-quality tree structure.
[0038] In other examples, the document and prompts for identifying the document type can be input into a large model, which can then use the model's natural language understanding capabilities to parse the content of the large document and determine whether it is a global document or a specific document.
[0039] The foregoing illustrates a partial implementation of determining the global document. It should be understood that, in practice, other methods can also be used to determine the global document among the multiple documents mentioned above, and this specification does not limit this approach.
[0040] S1044, Based on the logical relationships between the content directions involved in the global document, determine the set of content directions used to construct the knowledge base and the hierarchical relationship between the content directions in the set of content directions.
[0041] In some examples, the content directions involved in the global document are deduplicated, supplemented, and validated. For instance, if a document involves a new content direction not covered by other documents, the new content direction is added to the content direction set. Or, the consistency of descriptions of the same content direction in different documents is checked to ensure the accuracy of the content direction, resulting in a content direction set used to build the knowledge base. Then, based on the logical relationships between the content directions in the content direction set, the hierarchical relationship between the content directions in the content direction set is determined. For example, if content direction 1 is a superior concept of content direction 2, or content direction 1 contains content direction 2, then the hierarchical relationship between the two is determined as follows: content direction 2 is a sub-content direction of content direction 1.
[0042] In other examples, the content directions involved in the global document and the corresponding prompts can be input into the large model. The natural language understanding capabilities of the large model can be used to merge these content directions to obtain a set of content directions, and to identify the hierarchical relationships between the content directions in the set.
[0043] The foregoing illustrates a partial implementation of determining a set of content directions and the hierarchical relationships between them. It should be understood that other methods can also be used to determine the set of content directions and the hierarchical relationships between them in applications, and this specification does not limit such methods.
[0044] S1046, construct a tree structure based on content direction set and hierarchical relationship.
[0045] Specifically, based on the hierarchical relationship, the level to which each content direction in the content direction set belongs is determined, corresponding nodes are constructed for each content direction at each level, and connecting edges are constructed between different nodes to obtain the tree structure.
[0046] In this implementation, the global document, as a document with a wide range of content coverage and a macro perspective, involves multiple different macro-level content directions. These content directions contain a large number of content updates. The tree structure built based on the logical relationships between the content directions involved in the global document can better adapt to the continuous growth of the number of documents in the knowledge base and the continuous updates of the document content, which is conducive to the real-time maintenance and dynamic expansion of the knowledge base.
[0047] In another implementation, a tree structure can be constructed using the logical relationships between the content directions covered by all documents. The specific construction method is similar to that of constructing a tree structure based on global documents, and will not be elaborated further. This ensures the integrity of the tree structure and avoids situations where missing nodes corresponding to certain content directions prevent some documents from being associated with nodes in the tree structure.
[0048] The foregoing illustrates a partial implementation of S104. It should be understood that S104 can also be implemented in other ways, and this specification does not limit this implementation.
[0049] S106. Based on the summary of each document and the content direction involved in each document, each document is associated with nodes in the tree structure to obtain the target knowledge base. After associating all documents with nodes in the tree structure, the connection between content direction and documents is established. This allows the document associations and the associations between documents and content directions to be intuitively displayed through a tree hierarchy. This not only helps users of the target knowledge base understand the knowledge structure and better use the knowledge base for business processing, but also makes the target knowledge base easy to maintain in real time and dynamically expand. For example, when a new document is added, it can be associated with nodes in the tree structure according to the content direction involved in the new document. Or, when the content of an existing document is updated, it can be reassociated with nodes in the tree structure according to the content direction involved in the updated content, and so on.
[0050] In one implementation, the summary of each document, the content direction of each document, the nodes in the tree structure and the content direction they represent, and the corresponding prompt words are input into a large model. The natural language understanding capability of the large model is used to determine the matching nodes for each document. Furthermore, each document is associated with the nodes in the tree structure to complete the construction of the target knowledge base.
[0051] In another implementation, S106 above includes the following steps: S1062, for each document, determine at least one first node from the tree structure whose content direction matches the document's summary.
[0052] Specifically, for each node in the tree structure, the distance between the content direction represented by the node and the document summary in the same semantic space can be calculated. If the distance is less than a preset distance threshold, it is determined that the content direction represented by the node matches the document summary, and the node is then identified as the first node.
[0053] For example, with Figure 2 Taking the tree structure shown as an example, the summary of document 1 is "Discussion on the application of deep learning in image recognition". The content direction represented by node 1 ("technology research and development"), node 11 ("artificial intelligence"), and node 111 ("111") in the tree structure all match the summary. Therefore, these three nodes are determined as the first node.
[0054] S1064, Based on the content direction involved in the document and the content direction represented by each first node, determine the second node corresponding to the document from at least one first node.
[0055] Specifically, at least one first node whose content direction is similar to the content direction of the document is identified as a third node; if the number of third nodes is greater than or equal to a second quantity threshold, and each third node belongs to a different level, then the third node with the lowest level is identified as the second node corresponding to the document; if the number of third nodes is greater than or equal to the second quantity threshold, and at least two third nodes belong to the same level, then the parent node of the third nodes at the same level is identified as the second node corresponding to the document; if the number of third nodes is less than the second quantity threshold, then the third node is identified as the second node corresponding to the document.
[0056] The second quantity threshold can be set according to actual needs, and this specification does not limit it in the embodiments.
[0057] For example, if the preset quantity threshold is 2, continue with the above... Figure 2 Taking the tree structure shown as an example, assume that the first node determined for document 1 includes node 1, node 11, and node 111. The content directions involved in document 1 include "artificial intelligence" and "deep learning". "Artificial intelligence" is the content direction represented by node 11, and "deep learning" is the direction represented by node 111. Therefore, node 11 and node 111 are determined as the third nodes. Since these third nodes belong to different levels, the content direction "deep learning" represented by the lowest level third node is determined as the second node corresponding to document 1.
[0058] Assuming that the first node identified for document 2 includes node 1, node 11, and node 12, and that the content areas covered by document 2 include "artificial intelligence" and "cloud computing", with "artificial intelligence" being the content area represented by node 11 and "cloud computing" being the content area represented by node 12, then node 11 and node 12 are identified as the third nodes. Since these third nodes belong to the same level, the parent node of these third nodes, "technology research and development", is identified as the second node corresponding to document 2.
[0059] Assuming that the first node determined for document 3 includes node 1 and node 11, and the content direction involved in document 3 includes "artificial intelligence", which is the content direction represented by node 11, then node 11 is determined as the third node; since the number of third nodes is less than the second quantity threshold, node 11 is determined as the second node corresponding to document 2.
[0060] S1066, associate the document with the second node.
[0061] Understandably, a document's summary describes its main content. By combining the document's summary with the content it covers, and then associating the document with nodes in the tree structure, the accuracy of document association can be improved.
[0062] The foregoing illustrates a partial implementation of S106. It should be understood that S106 can also be implemented in other ways, and this specification does not limit such implementation.
[0063] In another embodiment, after S106 above, a global check can be performed on the tree structure and the documents associated with its nodes to correct any unreasonable parts.
[0064] For example, a second check is performed by a large model, which inputs the documents associated with each node in the tree structure and prompts containing examples of instructions and error associations into the large model, and uses the large model's natural language understanding capabilities to perform a global check and correction.
[0065] In another embodiment, after S106 above, the following steps may be included: for each node in the tree structure, determining the associated elements of the content direction represented by the node, and configuring the associated elements of the content direction represented by the node.
[0066] Each content direction can have corresponding related elements, which may include, but are not limited to, at least one of the following elements: related personnel, related events, etc.
[0067] Relevant personnel for a content direction may include, but are not limited to, the person in charge of the content direction. For each content direction, relevant personnel can be obtained through various appropriate methods, such as configuration by the business unit to which the knowledge base belongs, or determination from the owners of documents associated with the node corresponding to that content direction; this specification does not limit this approach. Relevant events for a content direction may include, but are not limited to, meeting schedules and groups involving that content direction. Meeting schedules involving a content direction may include the schedules of meetings that have already discussed that content direction, and the schedules of meetings that will discuss that content direction.
[0068] For each content area, relevant events can be obtained through various appropriate methods, which are not described in the embodiments of this specification. For example, they can be configured by the business party to which the knowledge base belongs, or obtained from meeting data related to that content area, or from the historical dialogue records of each group to obtain groups that have discussed that content area, etc.
[0069] Thus, when related elements include relevant personnel, a tree-structured knowledge base centered on content direction and relevant personnel is formed. This allows document updates, reviews, and maintenance to be directly linked to specific personnel. Especially in cross-departmental collaboration scenarios, it helps to quickly identify the Person of Contact (POC) and achieve rapid response and collaboration.
[0070] When related elements include relevant events, a tree-structured knowledge base is formed, centered on content direction and relevant facts. This allows operations such as document updates, reviews, and maintenance to be directly located to specific events, ensuring consistency between document content and specific events.
[0071] The knowledge base construction method provided by one or more embodiments of this specification utilizes the natural language understanding capabilities of a large model to extract summaries of documents used to construct the knowledge base and the content directions involved in the documents. It then uses the logical relationships between these content directions to construct a tree-structured knowledge base, where each node in the tree structure represents a content direction. Documents in the knowledge base are associated with nodes in the tree structure, which not only intuitively displays the content direction hierarchy and associated documents, but also makes the knowledge base easy to maintain in real time and dynamically expand.
[0072] In addition, with the above Figure 1 Corresponding to the knowledge base construction method shown, this specification also provides a knowledge base construction apparatus in its embodiments. Figure 3 This is a schematic diagram of the structure of a knowledge base construction device 300 provided in the embodiments of this specification, including: an acquisition module 310, a construction module 320, and an association module 330.
[0073] The acquisition module 310 is used to acquire multiple documents for building the knowledge base and extract the summary of each document and the content direction involved in each document through the large model.
[0074] The construction module 320 is used to construct a tree structure based on the logical relationship between the content directions involved in each document. The tree structure includes multiple nodes, and each node represents a content direction.
[0075] The association module 330 is used to associate each document with nodes on the tree structure based on the summary of each document and the content direction involved in each document, so as to obtain the target knowledge base.
[0076] The knowledge base construction apparatus provided in the embodiments of this specification utilizes the natural language understanding capabilities of a large model to extract summaries of documents used to construct the knowledge base and the content directions involved in the documents. It then uses the logical relationships between these content directions to construct a tree-structured knowledge base. Each node in the tree structure represents a content direction, and the documents in the knowledge base are associated with the nodes in the tree structure. This not only visually displays the content direction hierarchy and associated documents but also makes the knowledge base easy to maintain in real time and dynamically expand.
[0077] In another embodiment, the building module includes: The first determining submodule is used to determine the global document from the plurality of documents based on the logical relationship between the content directions involved in each document; The second determining submodule is used to determine, based on the logical relationship between the content directions involved in the global document, the content direction set used to construct the knowledge base and the hierarchical relationship between the content directions in the content direction set; A submodule is constructed to build a tree structure based on the content direction set and the hierarchical relationship.
[0078] In another embodiment, the first determining submodule is used to: For each document, if the number of content directions involved in the document is greater than or equal to a first quantity threshold, or if the content directions involved in other documents are sub-content directions of the content directions involved in the document, then the document is determined as a global document.
[0079] In another embodiment, the association module includes: The third determining submodule is used, for each document, to determine, from the tree structure, at least one first node whose represented content direction matches the summary of the document; The fourth determining submodule is used to determine the second node corresponding to the document from the at least one first node based on the content direction involved in the document and the content direction represented by each first node; The association submodule is used to associate the document with the second node.
[0080] In another embodiment, the fourth determining submodule is used to: The first node whose content direction is similar to the content direction involved in the document is identified as the third node; If the number of third nodes is greater than or equal to the second number threshold, and each third node belongs to a different level, then the third node with the lowest level is determined as the second node corresponding to the document. If the number of third nodes is greater than or equal to the second number threshold, and at least two third nodes belong to the same level, then the parent node of the third nodes at the same level is determined as the second node corresponding to the document. If the number of the third nodes is less than the second quantity threshold, the third node is determined to be the second node corresponding to the document.
[0081] In another embodiment, the association module is further configured to: For each node in the tree structure, obtain the associated elements of the content direction represented by the node, and the associated elements include at least one of the following elements: related personnel, related events; Configure the associated elements representing the content direction for the node.
[0082] In another embodiment, the relevant personnel for the content direction include the person in charge of the content direction.
[0083] In another embodiment, the plurality of documents includes at least one of the following documents: Documents owned by members of the user group to which the created knowledge base belongs; Documents whose creation time falls within the preset time range; Documents with a security classification lower than the preset security classification.
[0084] Obviously, the knowledge base construction apparatus in the embodiments of this specification can be used as described above. Figure 1 The entity executing the knowledge base construction method shown is therefore able to implement the knowledge base construction method in... Figure 1 The functions implemented are the same, so they will not be described in detail here.
[0085] Figure 4 This is a schematic diagram of the structure of an electronic device provided in one embodiment of this specification. Please refer to it. Figure 4 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and memory. The memory may include main memory, such as high-speed random-access memory (RAM), or non-volatile memory, such as at least one disk drive. Of course, the electronic device may also include other hardware required for other business operations.
[0086] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 4 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0087] Memory is used to store programs. Specifically, programs may include program code, which includes computer operation instructions. Memory may include main memory and non-volatile memory, and provides instructions and data to the processor.
[0088] The processor reads the corresponding computer program from non-volatile memory into main memory and then executes it, forming a knowledge base construction device at the logical level. The processor executes the program stored in memory and specifically performs the following operations: Obtain multiple documents for building the knowledge base, and extract a summary of each document and the content direction involved in each document through a large model; A tree structure is constructed based on the logical relationship between the content directions involved in each document. The tree structure includes multiple nodes, and each node represents a content direction. Based on the summary of each document and the content direction of each document, each document is associated with a node on the tree structure to obtain the target knowledge base.
[0089] The above is as described in this instruction manual. Figure 1 The method executed by the knowledge base construction apparatus disclosed in the illustrated embodiments can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this specification. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this specification can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.
[0090] It should be understood that the electronic device in the embodiments of this specification can realize a knowledge base construction apparatus. Figure 1 The embodiments shown have the same function. Since the principle is the same, the embodiments in this specification will not be described again here.
[0091] Of course, in addition to software implementation, the electronic device described in this specification does not exclude other implementation methods, such as logic devices or a combination of hardware and software. In other words, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0092] This specification also provides an embodiment of a computer-readable storage medium that stores one or more programs, the programs including instructions that, when executed by an electronic device including multiple applications, enable the electronic device to perform... Figure 1 The method of the illustrated embodiment is specifically used to perform the following operations: Obtain multiple documents for building the knowledge base, and extract a summary of each document and the content direction involved in each document through a large model; A tree structure is constructed based on the logical relationship between the content directions involved in each document. The tree structure includes multiple nodes, and each node represents a content direction. Based on the summary of each document and the content direction of each document, each document is associated with a node on the tree structure to obtain the target knowledge base.
[0093] This specification also provides a computer program product comprising a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps in the method for constructing a knowledge base as provided in the first aspect.
[0094] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0095] In summary, the above description is merely a preferred embodiment of this specification and is not intended to limit the scope of protection of this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of protection of this specification.
[0096] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.
[0097] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0098] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0099] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
Claims
1. A method for constructing a knowledge base, characterized in that, include: Obtain multiple documents for building the knowledge base, and extract a summary of each document and the content direction involved in each document through a large model; A tree structure is constructed based on the logical relationship between the content directions involved in each document. The tree structure includes multiple nodes, and each node represents a content direction. Based on the summary of each document and the content direction of each document, each document is associated with a node on the tree structure to obtain the target knowledge base.
2. The method according to claim 1, characterized in that, The construction of the tree structure based on the logical relationships between the content directions involved in each document includes: Based on the logical relationships between the content directions involved in each document, a global document is determined from the multiple documents; Based on the logical relationships between the content directions involved in the global document, determine the set of content directions used to construct the knowledge base and the hierarchical relationship between the content directions in the set of content directions; A tree structure is constructed based on the set of content directions and the hierarchical relationship.
3. The method according to claim 2, characterized in that, The process of determining the global document from the plurality of documents based on the logical relationships between the content directions involved in each document includes: For each document, if the number of content directions involved in the document is greater than or equal to a first quantity threshold, or if the content directions involved in other documents are sub-content directions of the content directions involved in the document, then the document is determined as a global document.
4. The method according to claim 1, characterized in that, The process of associating each document with nodes in the tree structure based on its summary and the content direction it covers, to obtain the target knowledge base, includes: For each document, determine at least one first node from the tree structure whose represented content direction matches the document's summary; Based on the content direction involved in the document and the content direction represented by each first node, determine the second node corresponding to the document from the at least one first node; Associate the document with the second node.
5. The method according to claim 4, characterized in that, The step of determining the second node corresponding to the document from the at least one first node based on the content direction involved in the document and the content direction represented by each first node includes: The first node whose content direction is similar to the content direction involved in the document is identified as the third node; If the number of third nodes is greater than or equal to the second number threshold, and each third node belongs to a different level, then the third node with the lowest level is determined as the second node corresponding to the document. If the number of third nodes is greater than or equal to the second number threshold, and at least two third nodes belong to the same level, then the parent node of the third nodes at the same level is determined as the second node corresponding to the document. If the number of the third nodes is less than the second quantity threshold, the third node is determined to be the second node corresponding to the document.
6. The method according to claim 1, characterized in that, After constructing the tree structure based on the logical relationships between the content directions involved in each document, the following is also included: For each node in the tree structure, obtain the associated elements of the content direction represented by the node, and the associated elements include at least one of the following elements: related personnel, related events; Configure the associated elements representing the content direction for the node.
7. The method according to claim 6, characterized in that, The relevant personnel in the content direction include the person in charge of the content direction.
8. The method according to claim 1, characterized in that, The plurality of documents includes at least one of the following documents: Documents owned by members of the user group to which the created knowledge base belongs; Documents whose creation time falls within the preset time range; Documents with a security classification lower than the preset security classification.
9. A knowledge base construction apparatus, characterized in that, include: The acquisition module is used to acquire multiple documents for building the knowledge base and extract a summary of each document and the content direction involved in each document through a large model; The building module is used to construct a tree structure based on the logical relationship between the content directions involved in each document. The tree structure includes multiple nodes, and each node represents a content direction. The association module is used to associate each document with nodes in the tree structure based on the summary of each document and the content direction involved in each document, so as to obtain the target knowledge base.
10. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the knowledge base construction method as described in any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is able to perform the method for constructing a knowledge base as described in any one of claims 1 to 8.
12. A computer program product, characterized in that, The computer program product includes a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps in the method for constructing a knowledge base as described in any one of claims 1 to 8.