Knowledge base construction method, device, equipment and medium

By constructing a target tree structure based on the document type and location identification information of the knowledge document, the problem of inaccurate knowledge base retrieval in the existing technology is solved, and multi-dimensional information retrieval and efficient retrieval are achieved.

CN120297399BActive Publication Date: 2025-09-09ZHONGDIAN DATA IND CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510783018.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-12
Publication Date
2025-09-09
Estimated Expiration
2045-06-12

AI Technical Summary

Technical Problem

The knowledge base retrieval method based on rule matching in the existing technology is difficult to enumerate all possible problem variations and complex situations, resulting in inaccurate retrieval results.

Method used

By obtaining the document type of the knowledge document, parsing the document sub-information and determining the location identification information, a target tree structure is constructed, and the node attributes include the location identification and document description information, thereby realizing multi-dimensional knowledge information retrieval.

Benefits of technology

It improves the retrieval accuracy and efficiency of the knowledge base, avoids data loss, and meets multi-dimensional information retrieval needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120297399B_ABST
    Figure CN120297399B_ABST
Patent Text Reader

Abstract

The disclosed embodiments relate to a method, apparatus, device, and medium for constructing a knowledge base, wherein the method includes: obtaining a plurality of knowledge documents and determining the document type corresponding to each knowledge document; parsing each knowledge document according to a predetermined document parsing rule corresponding to the document type, obtaining at least one document sub-information of each knowledge document, and determining the location identification information of the document sub-information in the knowledge document; obtaining document description information of each knowledge document and the knowledge type to which it belongs; using each document sub-information as a first node and each knowledge document as a second node, and performing node association between each first node and the second node to which it belongs, so as to generate a target tree structure of the knowledge base, thereby constructing the knowledge base. In this technical solution, the accuracy and efficiency of information retrieval are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing technology, and in particular to a method, apparatus, device, and medium for constructing a knowledge base. Background Art

[0002] With the development of computer technology, providing corresponding answers based on input search text has become a common demand. For example, in the internal knowledge system of an enterprise, it is common to search the internal knowledge base of the enterprise by inputting search text to obtain search answers.

[0003] In related technologies, a rule-based matching method is used to meet retrieval requirements. Specifically, the rules for obtaining answers are set in advance, and the answers corresponding to the search text are obtained in the knowledge base based on the rules for obtaining answers. For example, the answer matching rule is set to keyword search, and the answers corresponding to the search text are matched in the knowledge base based on the keyword matching rules.

[0004] However, in the above rule-matching-based method for meeting retrieval requirements, since it is difficult to enumerate all the rules and it is difficult to set up rules that cover all possible question variants and complex situations, it may lead to inaccurate retrieval results. Summary of the Invention

[0005] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a method, apparatus, device and medium for constructing a knowledge base.

[0006] An embodiment of the present disclosure provides a method for constructing a knowledge base, the method comprising: obtaining a plurality of knowledge documents and determining a document type corresponding to each of the knowledge documents; parsing each of the knowledge documents according to a predetermined document parsing rule corresponding to the document type, obtaining at least one document sub-information of each of the knowledge documents, and determining the location identification information of the document sub-information in the knowledge document; obtaining document description information of each of the knowledge documents and the knowledge type to which it belongs; taking each of the document sub-information as a first node and each of the knowledge documents as a second node, and performing node association between each of the first nodes and the second node to which it belongs, so as to generate a target tree structure of the knowledge base, and thereby constructing the knowledge base; wherein the node attributes of each of the first nodes include the corresponding location identification information, and the node attributes of each of the second nodes include the corresponding document description information and the knowledge type, and wherein the target tree structure is used for knowledge information retrieval of the knowledge base.

[0007] An embodiment of the present disclosure also provides a device for constructing a knowledge base, which includes: a first acquisition module for acquiring multiple knowledge documents; a determination module for determining the document type corresponding to each of the knowledge documents; a second acquisition module for parsing each of the knowledge documents according to a predetermined document parsing rule corresponding to the document type, acquiring at least one document sub-information of each of the knowledge documents, and determining the location identification information of the document sub-information in the knowledge document; a third acquisition module for acquiring document description information of each of the knowledge documents and the knowledge type to which it belongs; a construction module for taking each of the document sub-information as a first node and each of the knowledge documents as a second node, and performing node association between each of the first nodes and the second node to which it belongs, so as to generate a target tree structure of the knowledge base, and thereby construct the knowledge base; wherein the node attributes of each of the first nodes include the corresponding location identification information, and the node attributes of each of the second nodes include the corresponding document description information and the knowledge type, wherein the target tree structure is used for knowledge information retrieval of the knowledge base.

[0008] An embodiment of the present disclosure also provides an electronic device, which includes: a processor; a memory for storing instructions executable by the processor; the processor is used to read the executable instructions from the memory and execute the instructions to implement the knowledge base construction method provided by the embodiment of the present disclosure.

[0009] The embodiments of the present disclosure further provide a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is used to execute the method for constructing a knowledge base as provided in the embodiments of the present disclosure.

[0010] The technical solution provided by the embodiments of the present disclosure has the following advantages over the prior art:

[0011] The knowledge base construction scheme provided by the embodiment of the present disclosure obtains multiple knowledge documents and determines the document type corresponding to each knowledge document, parses each knowledge document according to a predetermined document parsing rule corresponding to the document type, obtains at least one document sub-information of each knowledge document, and determines the position identification information of the document sub-information in the knowledge document, and then obtains the document description information and the knowledge type to which it belongs, takes each document sub-information as the first node, takes each knowledge document as the second node, and associates each first node with the second node to which it belongs to generate a target tree structure of the knowledge base, thereby constructing the knowledge base; wherein the node attribute of each first node includes the corresponding position identification information, and the node attribute of each second node includes the corresponding document description information and the knowledge type, wherein the target tree structure is used for knowledge information retrieval of the knowledge base. In this technical solution, a target tree structure is constructed based on the knowledge points to which the knowledge document belongs, the work sub-documents contained therein, etc., and on the basis of avoiding the loss of knowledge document data, the knowledge document is described from multiple dimensions, which can meet the retrieval requirements of work information from multiple dimensions, thereby improving the accuracy and efficiency of information retrieval. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale.

[0013] Figure 1 A schematic diagram of a process for constructing a knowledge base provided in an embodiment of the present disclosure;

[0014] Figure 2 A schematic diagram of a target tree structure provided by an embodiment of the present disclosure;

[0015] Figure 3 A schematic diagram of a flow chart of another method for constructing a knowledge base provided in an embodiment of the present disclosure;

[0016] Figure 4 A schematic diagram of a flow chart of another method for constructing a knowledge base provided in an embodiment of the present disclosure;

[0017] Figure 5 A flowchart of another method for constructing a knowledge base provided in an embodiment of the present disclosure;

[0018] Figure 6 A flowchart of another method for constructing a knowledge base provided in an embodiment of the present disclosure;

[0019] Figure 7 A flowchart of another method for constructing a knowledge base provided in an embodiment of the present disclosure;

[0020] Figure 8 A schematic diagram of the structure of a knowledge base construction device provided in an embodiment of the present disclosure;

[0021] Figure 9 A schematic structural diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0022] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.

[0023] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0024] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.

[0025] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0026] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".

[0027] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0028] In order to solve the above problems, the embodiments of the present disclosure provide a method for constructing a knowledge base, which is introduced below in conjunction with specific embodiments.

[0029] Figure 1This is a flow chart of a method for constructing a knowledge base provided by an embodiment of the present disclosure. This method can be executed by a knowledge base construction device, wherein the device can be implemented using software and / or hardware and can generally be integrated into an electronic device. Figure 1 As shown, the method includes:

[0030] Step 101: Acquire multiple knowledge documents and determine the document type corresponding to each knowledge document.

[0031] Knowledge documents include various documents produced by an enterprise during its workflow, including but not limited to technical documents, contract documents, etc. In an embodiment of the present disclosure, knowledge documents can be periodically acquired at preset time intervals to ensure the comprehensiveness of document information covered in the target tree structure subsequently constructed.

[0032] In an embodiment of the present disclosure, the document type corresponding to each knowledge document is determined, wherein the document type includes but is not limited to at least one of the following: technical documents, system documents, management documents, etc., wherein different document types may have a hierarchical relationship, for example, a technical document may include a technical specification sub-document type, and technical research and development may include a sub-document type, etc.

[0033] Step 102: parse each knowledge document according to a predetermined document parsing rule corresponding to the document type, obtain at least one document sub-information corresponding to each knowledge document, and determine the location identification information of each document sub-information in the knowledge document.

[0034] Among them, the document parsing rules are used to parse the knowledge document to break down the knowledge document into document sub-information granularity, wherein the document sub-information can be partial information in the knowledge document, for example, the document sub-information is a document fragment contained in the knowledge document, and the document sub-information can also be descriptive information of partial information contained in the knowledge document. The information format of the descriptive information includes but is not limited to text, video, etc. For example, when the knowledge document contains a picture, the document sub-information can be the descriptive text information of the picture. For example, when the knowledge document contains a PPT, the document sub-information can be video information describing the PPT, etc.

[0035] It should be understood that the information types contained in knowledge documents corresponding to different document types are different. Therefore, in order to more comprehensively and better sort out the document sub-information contained in each knowledge document, each knowledge document is parsed according to the predetermined document parsing rules corresponding to the document type to obtain at least one document sub-information corresponding to each knowledge document.

[0036] It should be noted that in different application scenarios, the way to parse each knowledge document is different according to the predetermined document parsing rules corresponding to the document type. Examples are as follows:

[0037] In some possible embodiments, a document parsing code corresponding to each document parsing rule may be pre-constructed, and the knowledge document may be parsed by calling the document parsing code corresponding to each document parsing rule to obtain at least one document sub-information corresponding to each knowledge document.

[0038] In some possible embodiments, each work type matches a corresponding document parsing rule, including a specific processing flow for the knowledge document, and the knowledge document is processed according to the corresponding processing flow to obtain at least one document sub-information corresponding to each knowledge document.

[0039] For example, when the document type includes a structured document type, wherein the structured document type can be a CSV document type, an Excel document type, etc., in this example, the various structured data contained in the knowledge document corresponding to the structured document type are parsed. For example, when the knowledge document is Excel, the table data contained in Excel is parsed to determine the data association relationship between the various structured data. The data association relationship is used to indicate the relationship between the various structured data. For example, when the knowledge document is Excel, the table data contained in Excel is parsed. Data belonging to the same category or column can be regarded as having a data association relationship, or a group of data belonging to the same type can be regarded as having a data association relationship. The data association relationship is related to the specific table structure. Furthermore, the structured data with a data association relationship is regarded as a document sub-information. For example, when the knowledge document is Excel, and the Excel table contains m groups of data of m objects, a group of data for each object in the m groups of data can be regarded as a document sub-information.

[0040] For another example, when the document type includes an unstructured document type, which may include a Word document type, a TXT document type, etc., in this embodiment, each information element contained in the knowledge document corresponding to the document type is identified, where the information element includes at least one of the following: an image, a video, or a text fragment, and a natural language description text is generated for each information element. For example, when the information element includes a text fragment, the text fragment is input into the large language model to obtain a natural language description text of the text fragment. In this embodiment, the natural language description text is used as a document sub-information.

[0041] In an embodiment of the present disclosure, the location identification information of each document sub-information in the knowledge document to which it belongs is also determined. The location identification information may include at least one of the following: the document sub-title of the document fragment where the document sub-information is located, the document sub-summary of the document fragment where the document sub-information is located, and the like. The document location identification information is used to assist in locating the source location of the document sub-information in the knowledge document. The location identification information corresponding to the document sub-information can be extracted from the document sub-information or obtained by summarizing the content of the document sub-information and the knowledge document to which it belongs using a pre-trained model.

[0042] Step 103: Obtain document description information of each knowledge document and the knowledge type to which it belongs.

[0043] The document description information may include any identification information that uniquely locates the document, including at least one of the following: the document title and the document summary. The location identification information may include at least one of the following: the document subtitle of the document segment where the document sub-information is located and the document sub-summary of the document segment where the document sub-information is located.

[0044] In an embodiment of the present disclosure, document description information of each knowledge document and the knowledge type to which each knowledge document belongs are obtained, wherein the knowledge type corresponds to a work link, and the knowledge type is used to describe the knowledge type contained in the work information generated in the work link. For example, the work link may include: raw material procurement, production and manufacturing, quality inspection, product sales, etc., wherein each work link is related to the knowledge type of the enterprise, for example, the procurement link involves knowledge types such as supplier information and procurement contract terms.

[0045] Step 104, taking each document sub-information as the first node, taking each knowledge document as the second node, and associating each first node with the second node to which it belongs, to generate a target tree structure of the knowledge base, thereby constructing the knowledge base; wherein the node attributes of each first node include corresponding location identification information, and the node attributes of each second node include corresponding document description information and knowledge type, wherein the target tree structure is used for knowledge information retrieval of the knowledge base.

[0046] In an embodiment of the present disclosure, the target tree structure is generated by integrating the knowledge type, document type and document sub-information of the knowledge document. On the basis of ensuring the content integrity of the knowledge document, the entire processing flow is automated, which reduces labor costs. In an embodiment of the present disclosure, each document sub-information is taken as the first node, and each knowledge document is taken as the second node. A node association is constructed between the first node and the second node to which it belongs, that is, a connection edge is constructed from the first node to the second node to which it belongs, to generate a target tree structure, wherein the node attributes of each first node in the target tree structure include the location identification information of the first node, such as the subtitle information of the first node, etc., and the node attributes of the second node include the document description information and knowledge type of the second node. In some other possible embodiments, the node attributes of the second node may also include the document type, etc. In an embodiment of the present disclosure, the target tree structure constructs a knowledge base in the form of a tree structure.

[0047] For example, in the knowledge document including knowledge document A and knowledge document B, the document sub-information included in knowledge document A includes a1, a2, a3...a7, and the document sub-information included in knowledge document B includes b1, b2...b9, then the corresponding target tree structure is as follows Figure 2 As shown, the target tree structure can be displayed intuitively on the relevant interface. When the user triggers the corresponding node, the attribute information of the node is displayed. For example, Figure 2 In the example, when the knowledge document A is triggered, the node attribute information of the knowledge document A is displayed. Of course, the node attribute information can also be displayed in other possible ways, which are not listed here one by one.

[0048] The target tree structure constructed by the present disclosure can be used for the retrieval of knowledge information, wherein the retrieval method can be set according to the specific scenario. In some possible embodiments, for example Figure 3 As shown, the step of retrieving knowledge information based on the target tree structure including the first node and the second node may include:

[0049] Step 301 : In response to obtaining a search request carrying a search text, semantic matching is performed between the search text and the document sub-information of each first node to obtain a semantic matching degree.

[0050] The search text may be used to indicate a description text of the acquired work information, for example, the search text may be "acquire sales promotion information of product A".

[0051] In an embodiment of the present disclosure, in response to obtaining a search request carrying a search text, the search text is semantically matched with the document sub-information of each first node to obtain a semantic matching degree, that is, information retrieval is performed at the granularity of the document sub-information.

[0052] Step 302: Determine at least one first node that is successfully matched in the target tree structure according to the semantic matching degree.

[0053] In an embodiment of the present disclosure, at least one first node that is successfully matched is determined in the target tree structure according to the semantic matching degree. For example, the first node whose semantic matching degree is greater than a certain threshold is directly used as the first node that is successfully matched.

[0054] Step 303: Generate an answer corresponding to the search request based on the document sub-information of at least one successfully matched first node.

[0055] In an embodiment of the present disclosure, an answer corresponding to the retrieval request can be generated based on the document sub-information of at least one first node that is successfully matched. For example, the document sub-information of at least one first node can be input into a pre-trained large language model to obtain the answer output by the large language model.

[0056] In summary, the knowledge base construction method of the embodiment of the present disclosure obtains multiple knowledge documents and determines the document type corresponding to each knowledge document, parses each knowledge document according to a predetermined document parsing rule corresponding to the document type, obtains at least one document sub-information corresponding to each knowledge document, and then obtains the document description information of each knowledge document and the knowledge type to which each knowledge document belongs, determines the position identification information of each document sub-information in the knowledge document to which it belongs, takes each document sub-information as the first node, takes each knowledge document as the second node, and constructs a connection edge from each first node to the second node to generate a target tree structure, wherein the node attribute of each first node in the target tree structure includes the position identification information of the first node, and the node attribute of each second node includes the document description information and the knowledge type of the second node, wherein the target tree structure is used for work information retrieval. In this technical solution, a target tree structure is constructed based on the knowledge points to which the knowledge document belongs, the work sub-documents contained therein, etc., and on the basis of avoiding the loss of knowledge document data, the knowledge document is described from multiple dimensions, which can meet the retrieval requirements of work information from multiple dimensions, thereby improving the accuracy and efficiency of information retrieval.

[0057] Based on the above embodiment, the target tree structure may be further expanded in dimension to meet retrieval requirements in more dimensions.

[0058] In one embodiment of the present disclosure, Figure 4 As shown, the method further includes:

[0059] Step 401: determine each work department corresponding to the business process, and use each work department as a third node.

[0060] Among them, work departments correspond to business processes. For example, business processes include raw material procurement, production and manufacturing, quality inspection, product sales, etc., and each business process corresponds to a specific work department. For example, the quality inspection process corresponds to the quality inspection department, etc.

[0061] Step 402 : Associate each second node with its corresponding third node in the target tree structure, and associate the third nodes corresponding to each work department according to the business process to update the target tree structure.

[0062] In an embodiment of the present disclosure, each work department is taken as the third node, and each second node is associated with the third node to which it belongs in the target tree structure. For example, in this embodiment, a connection edge is constructed from each second node to the third node to which it belongs to update the target tree structure, that is, the work department to which the knowledge document corresponding to each second node belongs is determined. The updated target tree structure can associate various knowledge documents through department relationships, further meeting the retrieval needs in more scenarios. In this embodiment, the third nodes corresponding to various work departments are also associated according to the business process. For example, the third nodes are connected according to the business flow direction of the business process. For example, when the third node includes the sales department and the finance department, the sales department needs the finance department to conduct financial approval. Therefore, a connection edge from the sales department to the finance department is included between the sales department and the finance department.

[0063] When storing the target tree structure, to avoid data loss, a suitable database can be selected based on the amount of data corresponding to the target tree structure. The database may include MySQL, Oracle, etc. The corresponding nodes and node attributes can be stored in the database according to the affiliation relationship corresponding to the target tree structure. To facilitate complete data storage, different fields can be used in the database to store the node attributes of different nodes.

[0064] In the embodiment of the present disclosure, continue with Figure 2 Taking the scenario shown as an example, when knowledge document A belongs to the third node S1 and knowledge document B belongs to the third node S2, A points to S1 and contains a connection edge, and B points to S2 and contains a connection edge. When the S1 department and the S2 department have a connection relationship of S1 pointing to S2, the knowledge documents between different work departments are also associated in the target tree structure, which facilitates the query of knowledge documents under a certain dimension of different work departments.

[0065] It should be emphasized that in constructing the target tree structure, the multi-dimensional information retrieval requirements can be met based on the information of different dimensions contained in the target tree structure. For example, Figure 5 As shown, in a scenario where document tracing is performed based on a target tree structure comprising a first node, a second node, and a third node, specific retrieval steps may include:

[0066] Step 501: In response to obtaining a document tracing request carrying document content, semantic matching is performed between the document content and the document sub-information of each first node.

[0067] The document content is used to indicate the content that needs to be retrieved. For example, when a contract for a certain product needs to be retrieved, the document content may be the contract content that describes the certain product.

[0068] In this embodiment, in response to obtaining a document tracing request carrying document content, semantic matching is performed between the document content and the document sub-information of each first node.

[0069] Step 502: Determine, in the target tree structure according to the semantic matching degree, a second node connected to at least one first node that is successfully matched.

[0070] In an embodiment of the present disclosure, a second node to which at least one first node successfully matched is assigned is determined in the target tree structure based on the semantic matching degree, wherein the second node may be one or more.

[0071] Step 503: Determine a third node connected to the connected second node in the target tree structure.

[0072] Step 504 : Generate an answer corresponding to the document tracing request according to the work department of the connected third node and the knowledge type of the connected second node.

[0073] After determining the second node connected to at least one first node that is successfully matched, determining a third node connected to the connected second node in the target tree structure, wherein the third node may be one or more.

[0074] After determining the third node, an answer corresponding to the document tracing request is generated based on the work department of the connected third node and the knowledge type of the connected second node. This answer indicates the work department, knowledge type, and other information associated with the retrieved document content. Therefore, when there are multiple second nodes, different knowledge documents, different work departments, and other information associated with the document content can be retrieved based on the document content.

[0075] In summary, the knowledge base construction method of the embodiment of the present disclosure associates and integrates work sub-documents, knowledge documents, and work departments to construct a target tree structure, ensuring that the target tree structure can meet multi-dimensional information retrieval needs.

[0076] In one embodiment of the present disclosure, Figure 6 As shown, the following steps can be used to determine the document type corresponding to each knowledge document, including:

[0077] Step 601: extract document features of each knowledge document.

[0078] Among them, document features may include any features that can distinguish different document types, including but not limited to: document format (such as Word, Excel, PDF, etc.), document function (such as report, contract, manual, etc.), document content type (such as technical document, business document, management document, etc.).

[0079] Step 602: Match the document features of each knowledge document with the node attributes of the document type node in the pre-built document tag system, wherein the document tag system includes multiple document type nodes, each document type node corresponds to a document type, and the document type nodes with affiliation are associated with each other, and the node attributes of each document type node include the document features of the corresponding document type.

[0080] It is understandable that a document labeling system is pre-constructed, wherein the document labeling system includes a plurality of document type nodes, each document type node corresponds to a document type, and the document type nodes with affiliation are associated with each other. For example, the document type nodes with affiliation are connected by edges, wherein the direction of the edge points to the document type node to which they belong. For example, the technical document type may include the product technical specification document type, the technical research and development report document type, etc. Then, in the document labeling system, the product technical specification document type node has a connection edge pointing to the direction of the technical document type, and the technical research and development report document type has a connection edge pointing to the direction of the technical document type. The node attributes of each document type node in the embodiment of the present disclosure include the document features of the corresponding document type.

[0081] In an embodiment of the present disclosure, the document features of each knowledge document are matched with the node attributes of the document type node in the pre-built document tag system, so as to automatically classify the document type of the knowledge document according to the matching result.

[0082] Step 603: Determine the successfully matched document type node according to the matching result, and determine the document type corresponding to the successfully matched document type node, which is the document type corresponding to each knowledge document.

[0083] In this embodiment, a successfully matched document type node is determined based on the matching result, and then the document type corresponding to the successfully matched document type node is determined, which is the document type corresponding to each knowledge document.

[0084] In some possible embodiments, the document features of each knowledge document may be matched with the node attributes of the first-level document type node in the document tag system, wherein the first level is the highest level. After the first-level document type node that has been successfully matched is determined, the document features of each knowledge document may be matched with the node attributes of the document type of the first-level document type node that has been successfully matched in descending order of node levels, i.e., matching is performed level by level to improve the efficiency of determining the document type.

[0085] In this embodiment, the document type node with the lowest level among all the document type nodes that are successfully matched is determined to be the document type node that is successfully matched.

[0086] In one embodiment of the present disclosure, the node attributes of each document type node also include the document parsing rules for the corresponding document type. Before parsing each knowledge document according to the predetermined document parsing rules corresponding to the document type, the document parsing rules corresponding to the successfully matched document type nodes are determined as the document parsing rules corresponding to the document type. Thus, the document parsing rules are automatically determined, further improving the parsing efficiency and accuracy of knowledge documents.

[0087] In one embodiment of the present disclosure, Figure 7 As shown, the steps for determining the knowledge type to which each knowledge document belongs include:

[0088] Step 701, match the document content of each knowledge document with the node attributes of each work link node in the pre-built knowledge label system, wherein the knowledge label system contains multiple work link nodes, and the work link nodes with affiliation are associated with each other, wherein the node attributes of each work link node include the knowledge type associated with the corresponding work link.

[0089] In one embodiment of the present disclosure, a knowledge labeling system is pre-constructed, wherein the knowledge labeling system includes a plurality of work link nodes, and the work link nodes with affiliation are associated with each other. For example, the work link nodes with affiliation are connected by edges, wherein the direction of the connection edge is from the work link node to the work link node to which it belongs, that is, the knowledge labeling system reflects the hierarchical relationship between the work link nodes. The work link is related to the workflow. In the embodiment of the present disclosure, the node attributes of each work link node include the knowledge type associated with the corresponding work link. Based on the knowledge labeling system, knowledge can be utilized more comprehensively.

[0090] Step 702: Determine the successfully matched work link node according to the matching result, and determine the knowledge type corresponding to the successfully matched work link node, which is the knowledge type of each document sub-information.

[0091] In this embodiment, the document content of each knowledge document is matched with the node attributes of each work link node in the pre-built knowledge tag system, and then the successfully matched work link node is determined based on the matching result, and the knowledge type corresponding to the successfully matched work link node is determined as the knowledge type of each knowledge document.

[0092] In some possible embodiments, the document content of each knowledge document can be matched with the node attributes of the first-level work link nodes in the knowledge tag system, wherein the first level is the highest-level node. After determining the successfully matched first-level work link nodes, the document content of each work document can be matched with the node attributes of the work link nodes belonging to the successfully matched first-level work link nodes in descending order of node levels, and the lowest-level work link node among all successfully matched work link nodes is determined as the successfully matched work link node.

[0093] In summary, the knowledge base construction method of the embodiment of the present invention determines the document work type based on the constructed document tag system, and determines the knowledge type of the knowledge document based on the constructed knowledge tag system, thereby realizing the automation of the determination of the document work type and the knowledge type, and ensuring the consistency of the determination of the document work type and the knowledge type.

[0094] In order to implement the above embodiments, the present disclosure also proposes a knowledge base construction device.

[0095] Figure 8 This is a schematic diagram of a knowledge base construction device provided by an embodiment of the present disclosure. The device can be implemented by software and / or hardware and can generally be integrated into an electronic device. Figure 8 As shown, the device includes: a first acquisition module 810, a determination module 820, a second acquisition module 830, a third acquisition module 840, and a construction module 850, wherein:

[0096] A first acquisition module 810 is used to acquire multiple knowledge documents;

[0097] Determination module 820, for determining the document type corresponding to each knowledge document;

[0098] A second acquisition module 830 is configured to parse each knowledge document according to a predetermined document parsing rule corresponding to the document type, obtain at least one document sub-information corresponding to each knowledge document, and determine location identification information of the document sub-information in the knowledge document;

[0099] The third acquisition module 840 is used to obtain the document description information of each knowledge document and the knowledge type to which it belongs;

[0100] Construction module 850 is used to take each document sub-information as the first node, each knowledge document as the second node, and associate each first node with the second node to which it belongs, so as to generate a target tree structure of the knowledge base, and then construct the knowledge base; wherein the node attributes of each first node include corresponding location identification information, and the node attributes of each second node include corresponding document description information and knowledge type, wherein the target tree structure is used for knowledge information retrieval of the knowledge base.

[0101] The knowledge base construction device provided in the embodiments of the present disclosure can execute the knowledge base construction method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.

[0102] In order to implement the above embodiments, the present disclosure further proposes a computer program product, including a computer program / instruction, which implements the method for constructing a knowledge base in the above embodiments when executed by a processor.

[0103] Figure 9 A schematic structural diagram of an electronic device provided in an embodiment of the present disclosure.

[0104] The following specific reference Figure 9 , which shows a schematic structural diagram of an electronic device 900 suitable for implementing the embodiments of the present disclosure. The electronic device 900 in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 9 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.

[0105] like Figure 9 As shown, electronic device 900 may include a processor (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to programs stored in read-only memory (ROM) 902 or programs loaded from storage 908 into random access memory (RAM) 903. RAM 903 also stores various programs and data required for the operation of electronic device 900. Processor 901, ROM 902, and RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to bus 904.

[0106] Typically, the following devices may be connected to the I / O interface 905: an input device 906 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 907 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 908 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 909. The communication device 909 may allow the electronic device 900 to communicate with other devices wirelessly or by wire to exchange data. Figure 9 The electronic device 900 is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.

[0107] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 909, or installed from the memory 908, or installed from the ROM 902. When the computer program is executed by the processor 901, the above-mentioned functions defined in the method for constructing the knowledge base of the embodiment of the present disclosure are executed.

[0108] It should be noted that the computer-readable medium described above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. Computer-readable storage media may include, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or components, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such a propagated data signal may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wire, optical cable, RF (radio frequency), or any suitable combination thereof.

[0109] In some embodiments, the client and server can communicate using any currently known or later developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or later developed network.

[0110] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0111] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method for constructing the knowledge base.

[0112] The electronic device may write computer program code for performing the operations of the present disclosure in one or more programming languages, or a combination thereof, including but not limited to object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0113] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0114] The units involved in the embodiments described in this disclosure may be implemented in software or hardware, wherein the name of a unit does not necessarily limit the unit itself.

[0115] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0116] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fibers, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0117] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of the present disclosure is not limited to technical solutions formed by specific combinations of the aforementioned technical features. It also encompasses other technical solutions formed by any combination of the aforementioned technical features or their equivalents, without departing from the scope of the above disclosure. For example, a technical solution formed by replacing the aforementioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.

[0118] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0119] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.

Claims

1. A method for constructing a knowledge base, characterized in that: include: Acquire multiple knowledge documents and extract document features of each of the knowledge documents; Matching the document features of each of the knowledge documents with the node attributes of a document type node in a pre-constructed document tag system, wherein the document tag system includes a plurality of document type nodes, each of the document type nodes corresponds to a document type, and the document type nodes with affiliation are associated with each other, and the node attributes of each document type node include the document features of the corresponding document type; Determine a successfully matched document type node according to the matching result, and determine the document type corresponding to the successfully matched document type node, which is the document type corresponding to each of the knowledge documents; Parsing each of the knowledge documents according to a predetermined document parsing rule corresponding to the document type, obtaining at least one document sub-information of each of the knowledge documents, and determining position identification information of the document sub-information in the knowledge document; Obtaining document description information and the knowledge type of each knowledge document; Each of the document sub-information is used as a first node, each of the knowledge documents is used as a second node, and each of the first nodes is associated with the second node to generate a target tree structure of the knowledge base, thereby constructing the knowledge base; wherein the node attributes of each of the first nodes include the corresponding location identification information, and the node attributes of each of the second nodes include the corresponding document description information and the knowledge type, wherein the target tree structure is used for knowledge information retrieval of the knowledge base; Determine each work department corresponding to the business process, and use each work department as a third node; In the target tree structure, each second node is associated with its corresponding third node, and the third nodes corresponding to each work department are associated with each other according to the business process, so as to update the target tree structure.

2. The method according to claim 1, wherein The matching of the document features of each of the knowledge documents with the node attributes of the document type nodes in the pre-built document tag system includes: Matching the document features of each of the knowledge documents with the node attributes of the first-level document type nodes in the document tag system; After determining the first-level document type node that has been successfully matched, the document features of each of the knowledge documents are matched with the node attributes of the document type nodes belonging to the first-level document type node that has been successfully matched, in descending order of node levels.

3. The method according to claim 2, wherein Determining the successfully matched document type node according to the matching result includes: The lowest-level document type node among all successfully matched document type nodes is determined as the successfully matched document type node.

4. The method according to claim 1, wherein The node attribute of each document type node further includes a document parsing rule of the corresponding document type. Before parsing each knowledge document according to the predetermined document parsing rule corresponding to the document type, the method further includes: The document parsing rule corresponding to the successfully matched document type node is determined to be the document parsing rule corresponding to the document type.

5. The method according to claim 1, wherein The step of determining the knowledge type to which each of the knowledge documents belongs comprises: Matching the document content of each of the knowledge documents with the node attributes of each work link node in a pre-constructed knowledge tag system, wherein the knowledge tag system includes multiple work link nodes, and node associations are performed between the work link nodes with affiliation relationships, wherein the node attributes of each of the work link nodes include the knowledge type associated with the corresponding work link; A successfully matched work link node is determined according to the matching result, and a knowledge type corresponding to the successfully matched work link node is determined as the knowledge type of each knowledge document.

6. The method according to claim 5, wherein The matching of the document content of each of the knowledge documents with the node attributes of each work link node in the pre-built knowledge tag system includes: Matching the document content of each of the knowledge documents with the node attributes of the first-level work link nodes in the knowledge tag system; After determining the first-level work link nodes that have been successfully matched, the document content of each of the knowledge documents is matched with the node attributes of the work link nodes belonging to the first-level work link nodes that have been successfully matched, in descending order of node levels.

7. The method according to claim 6, wherein The step of determining a successful matching work link node according to the matching result includes: The lowest-level working link node among all the successfully matched working link nodes is determined as the successfully matched working link node.

8. The method according to claim 1, wherein When the document type includes a structured document type, parsing the corresponding knowledge document according to the document parsing rule corresponding to the document type to obtain at least one document sub-information corresponding to each knowledge document includes: Parsing each structured data contained in the knowledge document corresponding to the structured document type; Determining the data association relationship between the various structured data; The structured data having the data association relationship is taken as the document sub-information.

9. The method according to claim 1, wherein When the document type includes an unstructured document type, parsing the corresponding knowledge document according to the document parsing rule corresponding to the document type to obtain at least one document sub-information corresponding to each knowledge document includes: Identifying each information element contained in a document corresponding to the document type, wherein the information element includes at least one of the following: a picture, a video, and a text fragment; Generate a natural language description text for each of the information elements, and use the natural language description text as a document sub-information.

10. The method according to any one of claims 1 to 9, characterized in that: Also includes: In response to obtaining a search request carrying a search text, semantically matching the search text with the document sub-information of each first node to obtain a semantic matching degree; Determining at least one first node that is successfully matched in the target tree structure according to the semantic matching degree; An answer corresponding to the search request is generated according to the document sub-information of the at least one first node that is successfully matched.

11. The method according to any one of claims 1 to 9, wherein: The method further comprises: In response to obtaining a document tracing request carrying document content, semantically matching the document content with the document sub-information of each first node; Determining, in the target tree structure according to the semantic matching degree, a second node connected to at least one first node that successfully matches; determining, in the target tree structure, a third node connected to the connected second node; An answer corresponding to the document tracing request is generated according to the work department of the connected third node and the knowledge type of the connected second node.

12. The method according to claim 1, wherein The document description information includes at least one of the following: Document title, document summary; The location identification information includes at least one of the following: The document sub-title of the document fragment where the document sub-information is located, and the document sub-summary of the document fragment where the document sub-information is located.

13. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing instructions executable by the processor; The processor is configured to read the executable instructions from the memory and execute the executable instructions to implement the knowledge base construction method described in any one of claims 1-12.

14. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and the computer program is used to execute the method for constructing a knowledge base as described in any one of claims 1 to 12.

Citation Information

Patent Citations

  • Knowledge base visual configuration method and device, equipment, storage medium and product

    CN118861272A