A method, device and computer-readable storage medium for constructing a knowledge graph
Through the method of generating knowledge graphs, the document structure is used to directly construct the knowledge graph, which avoids the need for training models, solves the problems of low efficiency and high cost of knowledge graph construction in the existing technology, and achieves efficient and accurate knowledge extraction.
Patent Information
- Application Number
- CN202111536550.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-15
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2041-12-15
AI Technical Summary
The knowledge graph construction efficiency in the existing technology is low and the model training cost is high, especially when a large amount of manual annotation and training data sets are required, resulting in high labor costs and poor results.
By obtaining the category mapping table between the directory title of the document to be processed and the knowledge category, the knowledge point category is generated, and the text data is parsed and processed to generate a knowledge graph, which avoids the need to train the knowledge extraction model and reduces manual annotation and data Set preparation steps.
It achieves the rapid and efficient construction of knowledge graphs, reduces labor costs, improves the efficiency and accuracy of knowledge extraction, and reduces dependence on expensive resources, such as GPU servers.
Smart Images

Figure CN114238654B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and specifically to a method, device and computer-readable storage medium for constructing a knowledge graph. Background Art
[0002] The richness of knowledge is an important factor that reflects the intelligence of machines. The sources and formats of knowledge acquired by artificial intelligence (AI) systems are diverse, such as manually transmitting human knowledge to AI systems through manual organization, acquiring knowledge through the Internet or unstructured knowledge from specific product manuals, etc.; knowledge graphs can be formed by extracting knowledge. How to quickly and efficiently build a knowledge graph has become one of the basic tasks of knowledge graph research. However, the knowledge graph construction solutions used in related technologies have the problems of low efficiency or high model training costs. Summary of the invention
[0003] The present application provides a method, device and computer-readable storage medium for constructing a knowledge graph, which can reduce labor costs.
[0004] In order to solve the above technical problems, the technical solution adopted in this application is: to provide a method for constructing a knowledge graph, the method comprising: obtaining a category mapping table between the directory title of the document to be processed and the knowledge category; generating a knowledge point category based on the text data of the document to be processed and the category mapping table, the knowledge point category being the knowledge category corresponding to the text data; parsing the text data to obtain parsed data, the parsed data including entity attribute names and attribute values; generating a knowledge graph based on the knowledge point category, entity attribute names and attribute values.
[0005] In order to solve the above-mentioned technical problems, another technical solution adopted in the present application is: to provide a knowledge graph construction device, which includes a memory and a processor connected to each other, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, it is used to implement the knowledge graph construction method in the above-mentioned technical solution.
[0006] In order to solve the above-mentioned technical problems, another technical solution adopted in this application is: to provide a computer-readable storage medium, which is used to store a computer program. When the computer program is executed by a processor, it is used to implement the knowledge graph construction method in the above-mentioned technical solution.
[0007] Through the above scheme, the beneficial effects of the present application are: first, manually construct a mapping relationship between the directory of the document to be processed and the knowledge category to generate a category mapping table; then the machine obtains the category mapping table, and uses the category mapping table and the text data of the document to be processed to generate the knowledge point type, entity attribute name and attribute value corresponding to each knowledge point in the document to be processed, and then constructs a knowledge graph related to each knowledge point; since there is no need to train the knowledge extraction model, there is no need to obtain the training data set required for training the knowledge extraction model, and no large amount of manual annotation is required. Compared with the scheme that mainly relies on manual or human-computer coupling for extraction, less labor cost can be invested to obtain more efficient and accurate results. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:
[0009] Figure 1 It is a flowchart of an embodiment of a method for constructing a knowledge graph provided by the present application;
[0010] Figure 2 It is a flowchart of another embodiment of the method for constructing a knowledge graph provided by the present application;
[0011] Figure 3 It is a schematic diagram of the last level title and the second to last level title provided in this application;
[0012] Figure 4 yes Figure 3 A schematic diagram of the process of S24 in the embodiment shown;
[0013] Figure 5 yes Figure 4 The schematic diagram of the process of S43 in the embodiment shown;
[0014] Figure 6 is a schematic diagram of the directory of the automobile manual provided by the present application;
[0015] Figure 7 yes Figure 6 The mapping relationship between chapters and knowledge categories;
[0016] Figure 8 yes Figure 6 Schematic diagram of the sub-sections of the "Operating the Components" section;
[0017] Fig. 9 yes Figure 8 The specific content of "front seats";
[0018] Fig.10 yes Figure 6 , Figure 8 as well as Fig. 9 Schematic diagram of the corresponding hierarchical structure;
[0019] Fig.11 yes Fig. 9 Corresponding knowledge information;
[0020] Fig.12 It is a structural schematic diagram of an embodiment of a knowledge graph construction device provided by the present application;
[0021] Fig.13 It is a structural schematic diagram of an embodiment of a computer-readable storage medium provided by the present application. DETAILED DESCRIPTION
[0022] The present application is further described in detail below in conjunction with the accompanying drawings and examples. It is particularly noted that the following examples are only used to illustrate the present application, but are not intended to limit the scope of the present application. Similarly, the following examples are only some embodiments of the present application rather than all embodiments, and all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0023] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0024] It should be noted that the terms "first", "second" and "third" in this application are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first", "second" and "third" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "multiple" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices.
[0025] First, let's introduce the construction of the knowledge graph. The knowledge graph of a specific field (such as automobile knowledge or medical knowledge) usually has a rigorous knowledge structure system, and the construction process includes knowledge ontology modeling and entity knowledge extraction. Ontology modeling is mainly done by domain experts to sort out and design the knowledge structure, and then in the entity knowledge extraction stage, source data from different sources and in various forms are converted into structured knowledge through corresponding technical solutions. In the entity knowledge extraction stage, for application scenarios with a small amount of content knowledge, it can rely entirely on manual sorting or importing, but for scenarios such as automobiles or medicine, it is obviously time-consuming and laborious to rely entirely on manual construction of knowledge graphs.
[0026] For some unstructured or semi-structured data (such as product manuals), knowledge extraction currently mainly relies on human-machine coupling, that is, manual data annotation, machine training knowledge extraction model, and machine-assisted extraction combined with manual confirmation. Specifically, first collect a list of documents in the same field. For example, taking the field of automotive parts knowledge as an example, the document list is the product manuals of major car series. Upload the document list to the annotation platform, create an annotation task and assign it to annotators for annotation. The annotation process requires the use of knowledge structure labels defined in the knowledge platform, and use the annotation results to generate a training data set and input it into the training platform; the training platform creates a training task, loads the training data set, and generates a knowledge extraction model; then the machine runs the knowledge extraction model, which is responsible for extracting knowledge points in the document to be extracted (for example, the instruction manual of a specific car model); the extracted results also need to be finally confirmed by the auditor before they can be stored.
[0027] The above scheme adopts a combination of manual labeling and machine-assisted extraction, which has achieved a certain degree of intelligence compared to the traditional scheme that relies entirely on manual extraction; however, it has been verified through business practice that the effect of machine-assisted extraction depends on the amount and quality of the training data set. On the one hand, the more data used to train the knowledge extraction model, the better the effect of the knowledge extraction model and the more accurate the result. Therefore, to ensure the effect and accuracy of the knowledge extraction model, more training data sets need to be labeled, which will undoubtedly consume more manpower. On the other hand, the subjectivity of manual participation in the early labeling process will affect the quality of the training data set. If the quality of the training data set itself is not high, the effect of the knowledge extraction model and the result of machine-assisted extraction will also be very low. Therefore, once the amount of data labeled in the early stage is insufficient, or the quality of the training data set is not high, the accuracy of the model will be low. In order to ensure the final quality of the warehousing, a large amount of manpower will still be required for review and confirmation. Even in some application scenarios, this solution has higher investment costs and worse results than the solution that relies entirely on manual extraction. For example, in the application scenario of extracting the content of a car manual, the goal is to accurately extract the knowledge in a manual (for example, 400 pages) and store it in a database. If the extraction is done entirely by manual sorting, it will take 3-5 people and 2 months to complete. If the above-mentioned human-computer coupling solution is adopted, it is first necessary to annotate the manual of at least the same length, that is, the manpower used in the annotation of the training data set stage has reached the manpower of full manual extraction. Subsequently, in the model training stage, researchers will need to develop and optimize the model. Finally, auditors will need to participate in the review and storage stage. Therefore, the total manpower investment of this solution is significantly higher than that of the full manual extraction solution. In addition, model training also requires expensive graphics processing unit (GPU) server resources.
[0028] Based on the above problems, this application proposes an extraction solution based on document structure. The technical solution adopted by this application is elaborated in detail below.
[0029] See also Figure 1 , Figure 1 : is a flow chart of an embodiment of a method for constructing a knowledge graph provided by the present application, the method comprising:
[0030] S11: Obtain a category mapping table between the catalog title of the document to be processed and the knowledge category.
[0031] The document to be processed may be obtained from a document database, downloaded from the Internet, or received from other devices. The document to be processed may be a non-structured document with a directory, such as a product manual, a paper or a book.
[0032] Furthermore, the knowledge categories are mainly derived from the chapter titles in the documents to be processed. In order to facilitate the construction of unified and standardized knowledge categories in the field, the knowledge categories cannot directly use the chapter titles. They need to be defined in advance and a mapping relationship to the chapter titles needs to be established. Specifically, for the acquired documents to be processed, the directory structure of the documents to be processed is manually parsed, a mapping relationship between each chapter in the directory and the knowledge categories is established, and a category mapping table is generated for subsequent use. Specifically, the directory title includes the first-level title, and the category mapping table includes the first-level title and the knowledge category corresponding to the first-level title.
[0033] S12: Generate knowledge point categories based on the text data of the document to be processed and the category mapping table.
[0034] After obtaining the category mapping table, by processing the text data of the document to be processed and the category mapping table, a knowledge point category can be generated, and the knowledge point category is the knowledge category corresponding to the text data. Specifically, the document to be processed can be parsed to obtain the text data of the document to be processed, and the text data includes text, formulas or pictures; then the text data is processed using the document processing method in the relevant technology to obtain the title in the text data (i.e., the text title); then the text title is matched with the category mapping table, that is, the text title is used as a keyword to find out whether there is a directory title similar to the text title in the category mapping table. If so, the knowledge category corresponding to the directory title is used as the knowledge point category.
[0035] S13: parse the text data to obtain parsed data.
[0036] After obtaining the main text data, the document parsing method in the relevant technology can also be used to parse the main text data to generate parsed data, which includes entity attribute names and attribute values. The entity attribute names and attribute values correspond to the knowledge point categories. The entity attribute name is the name of the knowledge point, and the attribute value is the attribute information of the knowledge point.
[0037] S14: Generate a knowledge graph based on knowledge point categories, entity attribute names, and attribute values.
[0038] After obtaining the knowledge point category, entity attribute name and attribute value corresponding to each knowledge point, a correspondence between the knowledge point category, entity attribute name and attribute value can be established to obtain a knowledge graph; or, after obtaining the knowledge point category, entity attribute name and attribute value corresponding to each knowledge point, they can be saved in a document; or a correspondence between the knowledge point category, entity attribute name and attribute value can be established to obtain a knowledge correspondence table, so as to perform other operations later, such as updating or modifying the content in the knowledge correspondence table.
[0039] It can be understood that after obtaining the knowledge point categories, entity attribute names and attribute values, these knowledge information can be manually verified to ensure the accuracy of the knowledge graph finally constructed.
[0040] This embodiment proposes a knowledge extraction scheme based on document structure, which is suitable for the scenario of knowledge graph construction. First, a mapping relationship between the directory of the document to be processed and the knowledge category is manually constructed to obtain a category mapping table; then the machine (i.e., the knowledge graph construction device) obtains the category mapping table, and uses the category mapping table and the text data of the document to be processed, combined with the document analysis and processing method in the relevant technology, to obtain the knowledge point type, entity attribute name and attribute value corresponding to each knowledge point in the document to be processed, and then constructs a knowledge graph related to each knowledge point; since there is no need to train the knowledge extraction model, there is no need to obtain the training data set required for training the knowledge extraction model, and no large amount of manual annotation is required. Although this scheme also requires manual labor, compared with the scheme using the knowledge extraction model, the labor cost adopted is lower, and manual labor is only required in the construction of the category mapping table related to the directory and the verification stage. Therefore, through this scheme, the unstructured document can be efficiently constructed into a knowledge graph quickly, which can improve the efficiency and accuracy of knowledge extraction.
[0041] See also Figure 2 , Figure 2 : is a flow chart of another embodiment of the method for constructing a knowledge graph provided by the present application, the method comprising:
[0042] S21: Obtain a category mapping table between the catalog title of the document to be processed and the knowledge category.
[0043] S21 is the same as S11 in the above embodiment and will not be described again.
[0044] S22: Parse the text data to obtain text title data and text content data.
[0045] After obtaining the text data of the document to be processed, the document processing method in the related art can be used to classify the text data to split the text data into two parts: text title data and text content data. The text title data is the title that appears in the text of the document to be processed, and the text content data is the content in the text of the document to be processed other than the title. By parsing the complete document structure, data corresponding to each level of title in the text data (i.e., text title data) and data corresponding to the text content (i.e., text content data) are finally generated.
[0046] S23: Match the main text title with the category mapping table to obtain the knowledge category matching the main text title, and determine the knowledge category matching the main text title as the knowledge point category.
[0047] The main text title data includes multiple main text titles. After obtaining the main text title data, the knowledge point category can be generated based on the mapping relationship between the knowledge category and the directory title (i.e., the category mapping table) and the titles of each chapter in the main text of the document to be processed (i.e., the main text title). That is, it is determined whether there is a directory title that is the same as the main text title in the category mapping table. If so, the knowledge category corresponding to the directory title is the knowledge point category.
[0048] Furthermore, the multiple text titles include a first-level title, which is a title that appears for the first time in a chapter. The first-level title can be matched with a category mapping table to obtain a knowledge point category corresponding to the first-level title.
[0049] S24: Parse the text title data to generate entity names and attribute names.
[0050] The entity attribute name includes the entity name and the attribute name, and the entity name and the attribute name can be parsed through the last-level title and the second-to-last-level title (i.e., the title of the previous level of the last-level title). The text title data can be parsed first to obtain multiple text titles; then the multiple text titles can be processed to generate entity names and attribute names. Specifically, the multiple text titles include the last-level title and the second-to-last-level title, and the last-level title can be parsed to obtain the entity name, and the second-to-last-level title can be parsed to obtain the attribute name; or the last-level title can be parsed to obtain the attribute name, and the second-to-last-level title can be parsed to obtain the entity name.
[0051] Furthermore, although in some schemes, the last level title is parsed as the entity name and the second to last level title is parsed as the attribute name; this is not absolute. Figure 3 As shown, the last-level title "Steering Wheel Adjustment" should be parsed as an attribute name, and the second-to-last-level title "Steering Wheel" is a specific entity name; therefore, the parsing scheme for entity names and attribute names needs to be further clarified and refined. The specific implementation scheme is described below.
[0052] use Figure 4 The solution shown is processed, which specifically includes the following steps:
[0053] S41: Select the title to be processed from the last-level title and the second-to-last-level title.
[0054] Taking the product manual as an example, for a manual type document, the title that can be used as an entity name should be a noun, and the title that can be used as an attribute name is generally a verb or a combination of multiple words (containing at least one verb). Therefore, the text title can be segmented, and then the entity name and attribute name can be determined based on the part of speech and number in the segmentation result.
[0055] Furthermore, it is possible to select to perform word segmentation processing on any one of the last-level title and the second-to-last-level title, and determine whether the other title is an entity name or an attribute name based on the word segmentation result.
[0056] S42: Perform word segmentation processing on the title to be processed to obtain a word segmentation result.
[0057] The word segmentation method in the related art is used to split the title to be processed to generate a word segmentation result, which includes at least one title word; further, the word segmentation result includes the number of each title word and the part-of-speech information of the title word.
[0058] S43: Generate entity names and attribute names based on the word segmentation results.
[0059] In the knowledge graph to be constructed, the entity names should be common and standardized words in the field, such as parts in the automotive field or drug names in the medical field. Therefore, a vocabulary of entity names (i.e., preset annotation vocabulary) can be established. The preset annotation vocabulary is common in a certain field, such as the instruction manuals for different brands of cars. In the process of extracting entity names, you can refer to the words in the preset annotation vocabulary, such as Figure 5 The scheme shown processes the word segmentation results, specifically including the following steps:
[0060] S51: Determine whether there is a title word in the preset annotation vocabulary.
[0061] The preset annotation vocabulary includes multiple entity names.
[0062] S52: If there are title words in the preset annotation vocabulary, the title words are determined as entity names, and the titles in the last-level title and the second-to-last-level title except the title to be processed are determined as attribute names.
[0063] If an entity name identical to a title word is detected in the preset annotation vocabulary, the title word is extracted as the entity name. At this time, another title other than the title to be processed in the last-level title and the second-to-last-level title is determined as the attribute name, or keywords in another title can also be extracted as the attribute name.
[0064] S53: If the title word does not exist in the preset annotation vocabulary, determine the entity name and attribute name based on the number and part of speech of the title words.
[0065] Determine whether the number of title words with the preset part of speech in the word segmentation result is the preset number; if the number of title words with the preset part of speech in the word segmentation result is the preset number, set the title words as entity names, and determine the titles other than the titles to be processed in the last-level title and the second-to-last-level title as attribute names; if the number of title words with the preset part of speech in the word segmentation result is not the preset number, set the title words as attribute names, and determine the titles other than the titles to be processed in the last-level title and the second-to-last-level title as entity names. Specifically, the preset part of speech is a noun, and the preset number is 1, that is, if the word segmentation result has one and only one noun, the noun is extracted as an entity name, otherwise the noun is extracted as an attribute name.
[0066] Furthermore, when the title words do not exist in the preset annotation vocabulary, the title words are stored in the preset annotation vocabulary to update the preset annotation vocabulary, that is, the extracted entity names are used to further enrich and expand the preset annotation vocabulary.
[0067] S25: Parse the text content data to obtain attribute values.
[0068] The text content data is parsed, and the text content under the last-level title is parsed into attribute values, thereby realizing the extraction of the text content data into attribute values.
[0069] S26: Establish the correspondence between knowledge point categories, entity names, attribute names and attribute values to generate a knowledge graph.
[0070] The above scheme completes the extraction of entity names, attribute names, attribute values and the knowledge categories to which they belong, and the knowledge graph can be constructed using the extracted knowledge information.
[0071] In a specific embodiment, in order to better illustrate the technical solution adopted in this embodiment, a product manual is taken as an example for description.
[0072] Product manuals usually have a directory structure. For example, a car manual has Figure 6 As shown, the car manual includes chapters such as "Safety Instructions", "Instrument Group", "Operating Various Components", "Driving", "Audio System" and "In-Vehicle Equipment".
[0073] Knowledge categories can be defined based on chapter titles, such as "Parts" or "Driving Methods". According to the results of the knowledge system, knowledge categories and chapters do not necessarily correspond one to one. For example, Figure 6 and Figure 7As shown, the contents of the two chapters "Instrument Group" and "Operation of Various Components" can be extracted as knowledge of the "Components" category, where chapter is the chapter and concept is the knowledge category; therefore, it is necessary to establish a mapping relationship from chapter to knowledge category.
[0074] The specific chapter content also has a hierarchical structure, which can include first-level headings or second-level headings; for example, Figure 8 This is a sub-level in the "Operating the components" chapter. The content page of the "Adjusting seats - front seats" chapter is as follows: Fig. 9 As shown, the parsed hierarchical structure is as follows Fig.10 Combined with the specific content information (i.e. Fig. 9 The step description with pictures and text in the figure mainly describes the specific adjustment steps of the driver's seat. The final expected parsed extraction results are as follows Fig.11 As shown, concept is the knowledge category, entity is the entity name, property is the attribute name, and value is the attribute value.
[0075] like Figure 9-11 As shown in the figure, the last level title "driver's seat" is parsed as an entity name, and its upper level title (i.e. the penultimate level title) "adjustment steps" is parsed as an attribute name; as for the middle two levels of titles, they can be selected according to the knowledge system to be constructed in the end, for example: "front seat" can be parsed as a subtype of "parts", but not as a core knowledge point to be extracted. So far, several key elements of knowledge extraction have been refined: knowledge category, entity name, attribute name and attribute value.
[0076] This embodiment determines the number and part of speech of the word segmentation results of the last-level title / penultimate-level title according to the structural characteristics of the document to be processed, and extracts the knowledge information (including knowledge categories, entity names, attribute names, and attribute values) in the document to be processed by combining the pre-established entity name annotation vocabulary and other methods; the knowledge graph of the document to be processed can be constructed by using the results of knowledge extraction of this scheme, supplemented by a small amount of manual verification, which can save a lot of labor and machine training costs.
[0077] See also Fig.12 , Fig.12 It is a structural diagram of an embodiment of a knowledge graph construction device provided in the present application. The knowledge graph construction device 120 includes a memory 121 and a processor 122 that are connected to each other. The memory 121 is used to store computer programs. When the computer program is executed by the processor 122, it is used to implement the knowledge graph construction method in the above-mentioned embodiment.
[0078] See also Fig.13 , Fig.13It is a structural diagram of an embodiment of a computer-readable storage medium provided in the present application. The computer-readable storage medium 130 is used to store a computer program 131. When the computer program 131 is executed by a processor, it is used to implement the method for constructing a knowledge graph in the above-mentioned embodiment.
[0079] The computer-readable storage medium 130 may be a server, a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and other media that can store program codes.
[0080] In the several embodiments provided in this application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only illustrative, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0081] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0082] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0083] The above descriptions are merely embodiments of the present application and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for constructing a knowledge graph, characterized in that: include: Obtaining a category mapping table between the catalog title of the document to be processed and the knowledge category; Generate a knowledge point category based on the text data of the document to be processed and the category mapping table, where the knowledge point category is the knowledge category corresponding to the text data; Parsing the text data to obtain text title data and text content data; The text title data includes a plurality of text titles; Parsing the text title data to obtain multiple text titles; Processing the multiple text titles to generate entity names and attribute names; Parsing the text content data to obtain attribute values, the parsed data including entity attribute names and attribute values, the entity attribute names including the entity name and the attribute name; A knowledge graph is generated based on the knowledge point category, the entity attribute name and the attribute value.
2. The method for constructing a knowledge graph according to claim 1, characterized in that: The multiple text titles include a last-level title and a penultimate-level title, and the step of processing the multiple text titles to generate the entity name and the attribute name includes: Select a title to be processed from the last-level title and the second-to-last-level title; Performing word segmentation processing on the title to be processed to obtain a word segmentation result; Based on the word segmentation result, the entity name and the attribute name are generated.
3. The method for constructing a knowledge graph according to claim 2, characterized in that: The word segmentation result includes at least one title word, and the step of generating the entity name and the attribute name based on the word segmentation result includes: Determine whether the title word exists in the preset annotation word library; If yes, the title word is determined as the entity name, and the titles of the last-level title and the second-to-last-level title except the title to be processed are determined as the attribute name; If not, the entity name and the attribute name are determined based on the number and part of speech of the title words.
4. The method for constructing a knowledge graph according to claim 3, characterized in that: The step of determining the entity name and the attribute name based on the number and part of speech of the title words includes: Determine whether the number of title words with a preset part of speech in the word segmentation result is a preset number; If yes, the title word is set as the entity name, and the titles of the last-level title and the second-to-last-level title except the title to be processed are determined as the attribute name; If not, the title word is set as the attribute name, and the titles of the last-level title and the second-to-last-level title except the title to be processed are determined as the entity name.
5. The method for constructing a knowledge graph according to claim 3, characterized in that: The method further comprises: When the title word does not exist in the preset annotation word library, the title word is stored in the preset annotation word library to update the preset annotation word library.
6. The method for constructing a knowledge graph according to claim 1, characterized in that: The step of generating knowledge point categories based on the text data of the document to be processed and the category mapping table includes: Matching the text title with the category mapping table to obtain a knowledge category matching the text title, and determining the knowledge category matching the text title as the knowledge point category; The step of generating a knowledge graph based on the knowledge point category, the entity attribute name and the attribute value includes: Establish a correspondence between the knowledge point category, the entity name, the attribute name and the attribute value to generate the knowledge graph.
7. The method for constructing a knowledge graph according to claim 1, characterized in that: The catalog title includes a first-level title, and the category mapping table includes the first-level title and a knowledge category corresponding to the first-level title.
8. A knowledge graph construction device, characterized in that: It comprises a memory and a processor connected to each other, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, it is used to implement the method for constructing a knowledge graph according to any one of claims 1 to 7.
9. A computer-readable storage medium for storing a computer program, characterized in that: When the computer program is executed by a processor, it is used to implement the method for constructing a knowledge graph as described in any one of claims 1 to 7.
Citation Information
Patent Citations
A method and apparatus for constructing a knowledge map
CN109446337A
Knowledge graph determination method and device, computer equipment and storage medium
CN113190687A
