A template determination method and related device for knowledge graph

By automatically analyzing the attributes and type proportion parameters in the knowledge content and generating knowledge definition templates, the problem of high cost of manual construction of templates and relying on human experience in the existing technology is solved, and efficient and accurate template generation is achieved.

CN113704482BActive Publication Date: 2025-08-26TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202110400070.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-14
Publication Date
2025-08-26
Estimated Expiration
2041-04-14

AI Technical Summary

Technical Problem

In the prior art, the construction of knowledge-defined templates relies on manual enumeration, which is costly and has a human experience, resulting in poor rationality and accuracy of templates.

Method used

By automatically analyzing the attributes and type proportion parameters in the knowledge content, determining the main attributes of types and attributes, generating knowledge definition templates, reducing manpower consumption and improving the accuracy and rationality of the templates.

Benefits of technology

It realizes high precision and wide coverage of knowledge-defined templates, reduces the demand for manual factors, and improves template generation efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113704482B_ABST
    Figure CN113704482B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a template determination method for a knowledge graph, which includes: obtaining knowledge content to be processed; determining the attribute proportion parameter corresponding to the type and the type proportion parameter corresponding to the attribute based on the type of entities involved in the knowledge content and the corresponding attributes; determining at least one main attribute corresponding to the type in the knowledge content based on the attribute proportion parameter and the type proportion parameter; generating a knowledge definition template based on the type and the main attribute corresponding to the type, the knowledge definition template corresponding to the knowledge graph of the knowledge content, and the knowledge definition template can be stored on the chain through blockchain technology for subsequent access. The processing device can automatically determine a more accurate main attribute and generate a more reasonable knowledge definition template, thereby improving the rationality and accuracy of template generation and reducing the consumption of human resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing, and in particular to a template determination method and related devices for knowledge graphs. Background Art

[0002] A knowledge graph is a structured semantic knowledge base used to describe concepts and their relationships in the physical world in symbolic form. Knowledge definition templates (such as Schema) are used to define the categories and attributes within a knowledge graph. Knowledge definition templates can assist in the construction of knowledge graphs, standardizing their composition and structure. They can also aid in data queries within knowledge graphs. For example, in a knowledge graph-based question-and-answer scenario, knowledge definition templates can parse user questions into a structure of types and attributes, and then quickly determine the corresponding answers from the knowledge graph.

[0003] It can be seen that high-quality and high-coverage knowledge definition templates are very important for knowledge graphs. They greatly improve the regularity of data and facilitate data users to quickly and accurately locate target data.

[0004] Related technologies mainly rely on manually constructing knowledge definition templates based on manually enumerating all possible attributes and attribute aliases. The construction cost is very high and the accuracy is highly dependent on human experience. Summary of the Invention

[0005] In order to solve the above technical problems, the present application provides a template determination method for knowledge graphs, in which the processing equipment can automatically determine more accurate main attributes and generate more reasonable knowledge definition templates, thereby improving the rationality and accuracy of template generation and reducing the consumption of human resources.

[0006] The embodiments of this application disclose the following technical solutions:

[0007] In a first aspect, an embodiment of the present application provides a method for determining a template for a knowledge graph, the method comprising:

[0008] Acquire knowledge content to be processed;

[0009] Determine, based on the type of entity involved in the knowledge content and the corresponding attribute, an attribute proportion parameter corresponding to the type and a type proportion parameter corresponding to the attribute, wherein the attribute proportion parameter is used to identify the proportion of different attributes in the attributes related to the type in the knowledge content, and the type proportion parameter is used to identify the proportion of different types in the types related to the attribute in the knowledge content;

[0010] Determining at least one main attribute corresponding to the type in the knowledge content based on the attribute proportion parameter and the type proportion parameter;

[0011] A knowledge definition template is generated according to the type and the main attributes corresponding to the type, and the knowledge definition template corresponds to the knowledge graph of the knowledge content.

[0012] In a second aspect, an embodiment of the present application provides a template determination device for a knowledge graph, characterized in that the device includes a first acquisition unit, a first determination unit, a second determination unit, and a generation unit:

[0013] The first acquisition unit is used to acquire knowledge content to be processed;

[0014] The first determining unit is configured to determine, based on the type of entity involved in the knowledge content and the corresponding attribute, an attribute proportion parameter corresponding to the type and a type proportion parameter corresponding to the attribute, the attribute proportion parameter being used to identify the proportions of different attributes among the attributes related to the type in the knowledge content, and the type proportion parameter being used to identify the proportions of different types among the types related to the attribute in the knowledge content;

[0015] The second determining unit is configured to determine at least one main attribute corresponding to the type in the knowledge content based on the attribute proportion parameter and the type proportion parameter;

[0016] The generating unit is configured to generate a knowledge definition template according to the type and the main attributes corresponding to the type, wherein the knowledge definition template corresponds to the knowledge graph of the knowledge content.

[0017] In a third aspect, an embodiment of the present application provides a computer device, the device comprising a processor and a memory:

[0018] The memory is used to store program code and transmit the program code to the processor;

[0019] The processor is used to execute the template determination method for the knowledge graph described in the first aspect according to the instructions in the program code.

[0020] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, characterized in that the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the template determination method for the knowledge graph described in the first aspect.

[0021] It can be seen from the above technical solution that the efficient construction and query of knowledge graphs can be achieved through the accurate and comprehensive definition of types and attributes by the knowledge definition template. To this end, after obtaining the knowledge content to be processed, the attribute proportion parameter corresponding to the type and the type proportion parameter corresponding to the attribute are determined according to the type of entity involved in the knowledge content and the corresponding attribute. The attribute proportion parameter is used to identify the proportion of different attributes in the attributes related to the type in the knowledge content, and the type proportion parameter is used to identify the proportion of different types in the types related to the attribute in the knowledge content. Based on the attribute proportion parameter, it is possible to identify important attributes related to a type with type as the granularity. Compared with the method of determining important attributes based on global data in some related technologies, the attribute proportion parameter can be used to accurately extract important attributes of some niche types, reducing the possibility of missing attributes; based on the type proportion parameter, it is possible to identify which types an attribute is more important than with attribute as the granularity, and which types it is an important attribute of these types. It is possible to further identify attributes that do not have a high proportion under a type but play a key role in the type. Therefore, based on the complementary role of attribute proportion parameters and type proportion parameters, the type in the knowledge content and at least one main attribute corresponding to the type in the knowledge content can be accurately and comprehensively determined. The knowledge definition template generated according to the type and the main attribute corresponding to the type has the characteristics of high precision and wide coverage, which improves the generation efficiency and accuracy of the knowledge definition template and reduces the demand for human factors. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. 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 any creative work.

[0023] Figure 1 A schematic diagram of a method for determining a template for a knowledge graph in an actual application scenario provided in an embodiment of the present application;

[0024] Figure 2 A flowchart of a method for determining a template for a knowledge graph provided in an embodiment of the present application;

[0025] Figure 3 A schematic diagram of a method for determining a template for a knowledge graph provided in an embodiment of the present application;

[0026] Figure 4 A flowchart of a method for determining a template for a knowledge graph in an actual application scenario provided in an embodiment of the present application;

[0027] Figure 5A structural block diagram of a template determination device for a knowledge graph provided in an embodiment of the present application;

[0028] Figure 6 A structural diagram of a computer device provided in an embodiment of the present application;

[0029] Figure 7 A structural diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION

[0030] The embodiments of the present application are described below with reference to the accompanying drawings.

[0031] Whether the knowledge definition template can be accurately generated will directly affect the use effect of the knowledge graph. In the relevant technology, there are mainly two methods to generate knowledge definition templates. One is to generate knowledge definition templates manually, which requires manual enumeration of all possible attributes and related information corresponding to the attributes, which consumes a lot of human resources and is inefficient; the other is to use the attribute statistics of Internet terms (User Generated Content, abbreviated as UGC) triples to generate attributes, and obtain the attributes corresponding to the type by counting the frequency or proportion of the attribute. However, since this statistical method is to count all the acquired content as a whole, it will cause some long-tail attributes with low frequency and low proportion to be discarded. These long-tail attributes may contain representative attributes for certain types. Therefore, the rationality and accuracy of the knowledge definition template obtained by this method are poor.

[0032] In order to solve the above technical problems, an embodiment of the present application provides a template determination method for a knowledge graph. The processing device can automatically analyze each type and corresponding attribute involved in the knowledge content to be processed from two perspectives: the proportion of types corresponding to attributes and the proportion of attributes corresponding to types. In this way, some long-tail attributes and targeted attributes can also be incorporated into the determination of the main attributes corresponding to the types, thereby determining more accurate main attributes and generating a more reasonable knowledge definition template, thereby improving the rationality and accuracy of template generation and reducing the consumption of human resources.

[0033] It is understandable that the method can be applied to a processing device, which is a processing device with a template determination function, for example, a terminal device or a server with a template determination function. The method is independently executed by a terminal device or a server, and can also be applied to a network scenario in which a terminal device and a server communicate, and is operated in conjunction with the terminal device and the server. Among them, the terminal device can be a mobile phone, a desktop computer, a personal digital assistant (PDA), a tablet computer and other devices. The server can be understood as an application server or a web server. In actual deployment, the server can be an independent physical server or a server cluster or distributed system composed of multiple physical servers. The terminal and the server can be directly or indirectly connected via wired or wireless communication, and this application is not limited here.

[0034] The embodiments of the present application can also apply blockchain technology. For example, in the template determination method disclosed in the present application, the generated knowledge definition template can be saved in the blockchain so that relevant personnel or relevant equipment can more conveniently obtain the knowledge definition template and perform operations such as constructing a knowledge graph.

[0035] In addition, this application also relates to artificial intelligence (AI) technology. Artificial intelligence is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to achieve the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new type of intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is the study of the design principles and implementation methods of various intelligent machines, so that machines have the functions of perception, reasoning and decision-making.

[0036] Artificial intelligence technology is a comprehensive discipline covering a wide range of fields, encompassing both hardware and software technologies. Basic AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, speech processing, natural language processing, and machine learning / deep learning. This application primarily addresses natural language processing and machine learning technologies.

[0037] Natural language processing (NLP) is a key area of ​​research in computer science and artificial intelligence. It studies the theories and methods that enable effective communication between humans and computers using natural language. Natural language processing (NLP) integrates linguistics, computer science, and mathematics. Therefore, research in this field involves natural language—the language we use in everyday life—and is closely linked to the study of linguistics. Natural language processing technologies typically include text processing, semantic understanding, machine translation, robotic question answering, and knowledge graphs.

[0038] Machine learning (ML) is a multidisciplinary field that encompasses probability theory, statistics, approximation theory, convex analysis, and algorithmic complexity theory. It specifically studies how computers can simulate or implement human learning behaviors to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is at the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications span all areas of AI. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning.

[0039] For example, in an embodiment of the present application, through natural language processing technology, the processing device can more accurately determine the attribute alias corresponding to each attribute; through machine learning technology, the processing device can statistically obtain more accurate attribute proportion parameters and type proportion parameters, etc.

[0040] In order to facilitate understanding of the technical solution provided by this application, the following will introduce a template determination method for a knowledge graph provided in an embodiment of this application in combination with an actual application scenario.

[0041] See also Figure 1 , Figure 1 A schematic diagram of a template determination method for a knowledge graph in an actual application scenario provided in an embodiment of the present application. In this actual application scenario, the processing device is a server 101 capable of generating knowledge definition templates.

[0042] After obtaining the knowledge content to be processed, the server 101 can first analyze which entity types the knowledge content involves, and which attributes these types correspond to in the knowledge content. For example, as shown in the figure, the knowledge content involves type A, and the attributes corresponding to type A include attribute A, attribute B, and attribute C. Since the knowledge content may involve a large number of entity types and attributes, if they are to be analyzed and judged one by one manually, it will take a lot of energy and time, and the construction cost of the knowledge definition template is relatively high. Therefore, in order to reduce labor costs and improve the efficiency of template determination, the server 101 can automatically determine the main attributes corresponding to the type A, and the server 101 can respectively determine the attribute ratio parameters corresponding to the type A, and the type ratio parameters corresponding to these related attributes. Among them, the main attribute refers to the attribute that is representative or universal for a certain type of entity, that is, the attribute that is more important for the type.

[0043] As shown in the figure, among the attribute proportion parameters corresponding to Type A, Attribute A accounts for 63%, while Attribute B and Attribute C only account for 5% and 10% respectively. This indicates that most entities of Type A possess Attribute A, meaning that Attribute A is universal for entities of Type A. Therefore, Attribute A can be identified as one of the primary attributes corresponding to Type A. Because attribute proportion parameters are determined at the granularity of Type A, this can, to a certain extent, avoid the problem of overlooking attributes of Type A due to low proportion parameters when determining proportion parameters at the granularity of the entire knowledge content, as the entities corresponding to Type A are relatively small. For example, entities corresponding to Type A may appear relatively few times in the knowledge content, while Attribute A may primarily appear in entities of Type A. Therefore, if the proportion parameter is determined for the entire knowledge content, Attribute A is likely to be overlooked due to its low proportion parameter. However, if the proportion parameter is determined based on Type A, Attribute A has a higher proportion parameter and can be identified as the primary attribute of Type A.

[0044] Meanwhile, although attribute B only accounts for 5% of the attribute share parameter for type A, the corresponding type share parameter for attribute B shows that type A's share parameter is as high as 80%, indicating that entities containing attribute B are generally type A entities. This shows that attribute B is a highly representative attribute of type A entities and is also relatively important to type A. For example, attribute B could be "movie box office" and type A could be "movie." In the attribute share parameter corresponding to "movie," attributes such as "movie genre" and "leading actor" might have higher share parameters because more knowledge content focuses on these attributes of movies. Meanwhile, the attribute "movie box office" may be introduced less frequently and therefore has a lower value in the attribute share parameter. However, within the type involving the attribute "movie box office," the "movie" type undoubtedly has a higher share parameter because it is a more representative attribute of the "movie" type. Therefore, attribute B can also be considered one of the main attributes corresponding to type A. However, for attribute C, which has a similarly low attribute proportion parameter, the type proportion parameter corresponding to type A is only 2%, while the type proportion parameter of type B is as high as 73%. This shows that attribute C is not an important attribute of type A, but an important attribute of type B.

[0045] After the above judgment process, server 101 can determine that the main attributes of type A include attribute A and attribute B. Then, server 101 can generate a knowledge definition template corresponding to the knowledge graph of the knowledge content based on the type and the corresponding main attributes. As can be seen from the figure, in this knowledge definition template, the main attributes corresponding to type A include attribute A and attribute B.

[0046] As can be seen from the above process, through this template generation method, when determining the main attributes corresponding to the type, using type A as the granularity can, to a certain extent, avoid the omission of some key attributes due to the relatively small number of type A entities; at the same time, using the various attributes related to type A as the granularity can also more accurately identify some attributes that are highly representative of type A, further reducing the probability of attribute omissions and improving the accuracy and rationality of the knowledge definition template. In addition, since the attribute proportion parameter and the type proportion parameter are parameters that can be determined by the server 101 itself based on the knowledge content, no human intervention is required. Therefore, the knowledge template determination process can be implemented more automatically, reducing the demand for manpower and improving the efficiency of template determination.

[0047] Next, a template determination method for a knowledge graph provided in an embodiment of the present application will be introduced in conjunction with the accompanying drawings.

[0048] See also Figure 2 , Figure 2A flowchart of a method for determining a template for a knowledge graph provided in an embodiment of the present application, the method comprising:

[0049] S201: Acquire knowledge content to be processed.

[0050] Knowledge content refers to content with entities and entity-related information. An entity is a distinct and independently existing thing, such as a person's name, company name, or city name. Entity-related information can include the various types corresponding to the entity and the various attributes corresponding to each type. For example, "Beijing" is an entity, "city" is a type corresponding to the entity, and "city population" is an attribute corresponding to the "city" type.

[0051] This knowledge content can be obtained through various channels, such as from various websites, articles, and public accounts, which are not limited here.

[0052] S202: Determine an attribute ratio parameter corresponding to the type and a type ratio parameter corresponding to the attribute according to the type of the entity involved in the knowledge content and the corresponding attribute.

[0053] It is understandable that knowledge content typically involves a large number of entity types and attributes. Manually constructing a knowledge definition template consumes considerable time and effort, and relies heavily on human experience. Therefore, to reduce the difficulty of constructing a knowledge definition template and improve its efficiency, in an embodiment of the present application, a processing device can automatically construct the knowledge definition template in the following manner.

[0054] In order to facilitate the organization and analysis of the knowledge content and generate the corresponding knowledge graph, the processing device can first determine the corresponding knowledge definition template based on the knowledge content. The knowledge definition template is used to define the types involved in the knowledge content and the attributes contained in the types. In order to make the definition of the knowledge definition template more reasonable and clear, the processing device can determine the main attributes for each type. The main attributes refer to the attributes that are representative or universal for entities of a certain type. For example, for an entity of the type "movie", "movie starring" and "movie box office" are representative and universal attributes, and can be regarded as the main attributes corresponding to this type.

[0055] It is understood that the frequency of occurrence of types and attributes in knowledge content can, to a certain extent, reflect the universality or representativeness of the attribute. For example, attributes with higher frequency of occurrence are generally more universal. Therefore, to determine the primary attribute corresponding to a type, the processing device can perform statistical analysis on the relative frequencies of types and attributes based on the knowledge content to determine the primary attribute corresponding to each type.

[0056] However, since the knowledge content to be processed may include multiple entities and related information corresponding to the entities, and has a large amount of information, if the statistical analysis is performed with the entire knowledge content to be processed as the granularity, it may cause the frequency of attributes corresponding to some types involving a small number of entities to be too low, so that they become attributes that are easily overlooked in the statistical analysis. In fact, these attributes may appear more frequently in this type, and are universal attributes corresponding to this type, which are more important to this type. For example, since the entity type of "constellation" only includes 12 constellations and the number of entities is small, the frequency of its appearance in the knowledge content to be processed may be low, and the frequency of appearance of more important long-tail attributes such as "constellation month" corresponding to the "constellation" type may be extremely low and easily overlooked. Among them, long-tail attributes refer to composite attributes related to the type, which are usually composed of multiple words and have a long name length.

[0057] Based on this, in order to avoid the problem of low accuracy in determining the main attribute due to neglected attributes to a certain extent, in an embodiment of the present application, the processing device may determine the attribute proportion parameter corresponding to the type based on the granularity of each type involved in the knowledge content, rather than the entire knowledge content. The attribute proportion parameter is used to identify the proportion of different attributes in the attributes related to the type in the knowledge content. Thus, through this determination method, the attributes corresponding to some types with a small number of entities can also have a higher attribute proportion parameter. For example, "zodiac month" can have a higher attribute proportion parameter in the "zodiac sign" type.

[0058] In addition to analyzing the universal attributes in some entities with a smaller number, the present application can also focus on the key attributes corresponding to some entities that have a smaller proportion but belong to a specific type. For example, although the frequency of occurrence of the attribute "gender" may be low, among the entities with this attribute, they are basically all entities of the "person" type, which shows that this type of attribute is representative for this type, and therefore can also be regarded as the main attribute corresponding to this type. Based on this, the processing device can also determine the type proportion parameter corresponding to the attribute based on the knowledge content and the granularity of the attribute. The type proportion parameter is used to identify the proportion of different types in the types related to the attribute in the knowledge content. Thus, through the type proportion parameter, the processing device can know in which types of entities the attribute will mainly appear, and then determine which type of entity-specific key attribute the attribute belongs to.

[0059] S203: Determine at least one main attribute corresponding to the type in the knowledge content based on the attribute proportion parameter and the type proportion parameter.

[0060] As mentioned above, through the attribute proportion parameters for each type, the processing device can determine the universal attributes for a certain type; through the type proportion parameters for each attribute, the processing device can determine the representative attributes unique to a certain type, which are more important for the type. Therefore, the processing device can determine the universal and representative attributes corresponding to each type involved in the knowledge content based on the attribute proportion parameters and the type proportion parameters, that is, the main attributes corresponding to the type.

[0061] As shown in the table below, the processing device can determine two statistical indicators: the attribute share parameter and the type share parameter. The attribute share parameter aims to capture the high-frequency attributes corresponding to the type, that is, the attributes that are universal; the type share parameter aims to capture the exclusive attributes corresponding to the type, that is, the representative attributes. For example, in the "Journal" type, the attribute "Initial Date" accounts for a high proportion of 93%, which can be considered a high-frequency attribute of this type. In the "Cumulative Box Office" attribute, the "Movie" type accounts for 98%, indicating that almost only entities of the "Movie" type have the "Cumulative Box Office" attribute, which means that this attribute is exclusive to this type.

[0062]

[0063] Among them, the processing device may also determine the main attributes corresponding to the type crane in multiple ways. In the embodiment of the present application, the processing device may preset an attribute proportion threshold and a type proportion threshold. If the attribute proportion parameters corresponding to a certain type include an attribute whose parameters exceed the attribute proportion threshold, then the attribute may be determined to be one of the main attributes of the type; if the type proportion parameters corresponding to a certain attribute include a type whose parameters exceed the type proportion threshold, then the attribute may also be determined to be one of the main attributes of the type.

[0064] S204: Generate a knowledge definition template according to the type and the main attributes corresponding to the type.

[0065] After the above steps, the processing device can determine the main attributes corresponding to each type involved in the knowledge content. Based on this, the processing device can generate a knowledge definition template, which corresponds to the knowledge graph of the knowledge content. That is, the knowledge definition template can be used to define the type system and type attributes in the knowledge graph of the knowledge content, thereby helping the processing device to accurately construct the knowledge graph corresponding to the knowledge content.

[0066] It can be seen from the above technical solutions that the accurate and comprehensive definition of types and attributes by the knowledge definition template can realize the efficient construction and query of knowledge graphs. Based on the attribute ratio parameter, it is possible to identify the important attributes related to a type with the type as the granularity. Compared with the method of determining important attributes based on global data in some related technologies, the attribute ratio parameter can accurately extract the important attributes of some niche types, reducing the possibility of missing attributes; based on the type ratio parameter, it is possible to identify which types an attribute is more important than with the attribute as the granularity, and which are the important attributes of these types. It can further identify the attributes that have a low proportion under a type but play a key role in the type. Therefore, based on the complementary role played by the attribute ratio parameter and the type ratio parameter, the type in the knowledge content and at least one main attribute corresponding to the type in the knowledge content can be accurately and comprehensively determined. The knowledge definition template generated according to the type and the main attribute corresponding to the type has the characteristics of high precision and wide coverage, which improves the generation efficiency and accuracy of the knowledge definition template and reduces the demand for manual factors.

[0067] It is understandable that due to the diversity of languages, some attributes may have different attribute names, but their corresponding attribute semantics are relatively close, and therefore can be considered as attribute names corresponding to the same attribute. For example, although the two attributes "birthday" and "date of birth" have different attribute names, their attribute semantics are basically the same. In order to improve the rationality and completeness of the knowledge definition template and enrich the content of the knowledge definition template, after determining the main attribute corresponding to the type, the processing device can also determine the attribute alias corresponding to the main attribute based on the semantics of the main attribute. The attribute alias refers to the attribute name with similar semantics to the main attribute.

[0068] In one possible implementation, in addition to automating the construction of knowledge definition templates, the processing device can also automatically generate attribute aliases corresponding to primary attributes. Based on the semantics of the attributes, the processing device can identify pending attributes that have semantic similarities with the primary attribute and, from these pending attributes, determine attribute aliases associated with the primary attribute. For example, if the primary attribute is "job level," "job title" and "job level" can be used as pending attributes for the primary attribute.

[0069] In order to improve the rationality and accuracy of attribute aliases when determining attribute aliases, the processing device may make more detailed settings on two aspects: a method of determining attributes to be determined, and a method of determining attribute aliases from the attributes to be determined.

[0070] It is understandable that some main attributes have attribute names that can be separated into words, that is, the main attribute can be reasonably split into multiple participles. For example, the main attribute "birth time" can be split into two participles, "birth" and "time". These participles usually have corresponding participle synonyms. For example, the participle synonyms of "birth" can be "birth", "birth", etc., and the participle synonyms of "time" can be "moment", "era", etc. Since participles are obtained by splitting the main attributes, and participle synonyms are semantically closer to participles, by combining these participle synonyms, the processing device can obtain some words that are semantically similar to the main attribute. For example, the combination of "birth moment" and "birth time" has a high degree of semantic similarity.

[0071] Based on this, in order to be able to determine the attribute alias more flexibly, in a possible implementation method, on the one hand, the processing device can directly determine the first synonym of the main attribute, and the first synonym is the synonym corresponding to the whole word of the main attribute. On the other hand, the processing device can determine whether the main attribute can be segmented. If the main attribute can be segmented, determine the segmentation synonyms corresponding to the multiple segmentations of the main attribute, and combine the segmentation synonyms according to the arrangement structure of the multiple segmentations in the main attribute to obtain the second synonym of the main attribute, which is the synonym determined based on the segmentation. Among them, the arrangement structure is used to identify the arrangement characteristics of the multiple segmentations corresponding to the main attribute in the main attribute, so that after combining the segmentation synonyms based on the arrangement structure, the generated second synonym can be made closer to the original main attribute in structure, thereby reducing the interference caused by different word structures and improving the semantic similarity. For example, in the primary attribute "date of birth," the participle "birth" precedes the participle "date." Therefore, in the corresponding second synonym "birth moment," the participle synonym "birth" precedes the participle synonym "moment." The processing device can determine the pending attribute based on the first and second synonyms, thereby enabling the pending attribute to include a more comprehensive set of synonyms.

[0072] In addition, the processing device may also have multiple ways of determining synonyms based on semantics. For example, in one possible implementation, the processing device may pre-mine a synonym mapping table, in which the mapping relationships between semantically similar words are marked. The processing device may determine the synonyms corresponding to the main attributes or participles based on the synonym mapping table.

[0073] Since the pending attribute is mainly determined by semantics, in some possible cases, the synonyms determined by the processing device may not meet the needs of actual use even though they are semantically similar. For example, although "birth time" and "birth moment" are semantically similar, the latter is obviously not in line with actual language habits. Therefore, in order to make the generated attribute alias more reasonable, after determining the pending attribute, the processing device can perform denoising on the pending attribute and determine the denoised pending attribute as the attribute alias. The denoising process is used to remove unreasonable attributes from the pending attribute.

[0074] It is understandable that if the acquired knowledge content has a certain matching relationship with certain attributes, it can be shown to a certain extent that the attribute is a reasonable attribute that can be used, and the matching relationship is used to identify the association between the attribute and the knowledge content. Among them, the matching relationship can include multiple types. For example, if the knowledge content includes a certain attribute, it means that the attribute has been used in the knowledge content. At this time, it can be considered that the attribute and the content in the knowledge content have a matching relationship. In one possible implementation, the processing device can determine the pending attribute with a matching relationship as an attribute alias associated with the main attribute in response to the pending attribute having a matching relationship with the content in the knowledge content.

[0075] like Figure 3 As shown, Figure 3 A schematic diagram of a template determination method for a knowledge graph is shown. The main attributes determined by the processing device include "founder" and "creation time". For the "founder" attribute, the processing device can directly determine the synonyms "creator" and "founding person" corresponding to the attribute as attribute aliases based on the synonym mapping table. For the "creation time" attribute, the processing device can first perform word segmentation processing on the main attribute to obtain two word segmentations "creation" and "time", and then perform synonym mapping on these word segmentations based on the synonym mapping table. The mapping of "creation" can obtain word segmentation synonyms such as "book" and "creation", and the mapping of "time" can obtain word segmentation synonyms such as "era" and "years". The processing device can combine these word segmentation synonyms based on the arrangement structure of the word segmentations in the main attribute to obtain multiple pending attributes such as "creation era", "creation time", "creation years", and "book creation years".

[0076] The processing device can determine whether the pending attribute has a matching relationship with the knowledge content based on whether the pending attribute exists in the knowledge content. For example, the knowledge content may include multiple triples, and the triples are composed of [entity-attribute-attribute value]. If the pending attribute exists in the triple of the entity of the corresponding type of "creation time", then the pending attribute can be regarded as having a matching relationship with the knowledge content. Through this noise filtering method, the processing device can eventually determine "book writing time", "creation age", "creation time", and "creation age" as attribute aliases of the "creation time" attribute.

[0077] In addition to screening during the generation of attribute aliases, after generating attribute aliases, in order to further improve the rationality of the knowledge definition template, the processing device can further check the attributes in the type, which include the main attributes and attribute aliases, so as to exclude unreasonable attribute names and attribute aliases. In order to improve the convenience of the method, the attribute checking process can also be automatically performed by the processing device in the following manner. Among them, the attribute checking can be mainly carried out in the following two aspects:

[0078] First, the processing device can check the attributes of the type itself, that is, the type's own attributes. For example, due to the diversity of ways to generate attribute aliases, the attribute aliases generated through the above steps may have the same attribute aliases as the main attributes. When constructing a knowledge graph among the main attributes and attribute aliases corresponding to the same type, if the main attributes and attribute aliases are the same, the processing device may not be able to determine whether a certain attribute corresponding to the entity is a main attribute or an attribute alias, and may therefore be unable to accurately determine the attribute.

[0079] Based on this, in order to avoid, to a certain extent, reducing the accuracy of attribute determination due to conflicts in the type's own attributes, in a possible implementation method, the processing device can determine the main attribute and attribute alias corresponding to the target type in the knowledge definition template. The target type can be any type defined in the knowledge definition template. If it is determined that the target alias in the attribute alias is the same as the target main attribute in the main attribute, it means that an attribute conflict between the main attribute and the attribute alias occurs in the target type. The target main attribute can be any main attribute in the target type, and the target alias can be any attribute alias in the target type. At this time, since the main attribute is an attribute that is more important for the type and is highly representative of the entity of this type, the processing device can delete the target alias of the target type from the knowledge definition template for the target type, so that no attribute conflict occurs under the target type, which facilitates the processing device to determine the attributes of the entity.

[0080] The following code shows a method for checking conflicts between type attributes. Schema is a knowledge definition template, and type is a type. Using this code, if the processing device finds that an attribute alias P' and a primary attribute p in a type are identical, it deletes the alias P' and ultimately outputs a schema with no attribute conflicts.

[0081]

[0082] Secondly, in the knowledge definition template, some types have an inheritance relationship. This inheritance relationship means that one type is a subtype of another type, and the other type is the parent type of the type. Among them, the parent type refers to the type that can completely include the entity scope corresponding to the subtype within the entity scope included by the type. For example, the type "Movie and TV Star" can be a subtype of the type "Character", and the type "Action Game" can be a subtype of the type "Game". Conversely, the type "Game" is the parent type of the type "Action Game".

[0083] When the processing device constructs the knowledge graph through the knowledge definition template, it usually normalizes the attributes that are the same as the attribute alias to the main attribute corresponding to the attribute alias. If there is an attribute conflict in the type with inheritance relationship, it may cause unreasonable attributes between the parent type and the child type after the attribute normalization, resulting in contradictions in the attributes of the type with inheritance relationship. For example, the attribute alias of the parent type may not be the attribute alias of the child type, and the parent type and the child type may have the same meaning but different names of the main attributes, etc., which will lead to inaccurate construction of the knowledge graph. Therefore, in addition to detecting attribute conflicts on the type's own attributes, the processing device can also check the attributes corresponding to the type with inheritance relationship. Such attributes are called inherited attributes.

[0084] In one possible implementation, a first type and a second type may be included in a knowledge definition template, where the first type is the parent type of the second type. The first attribute is the main attribute or attribute alias corresponding to the first type, and the second attribute is the main attribute or attribute alias corresponding to the second type. The processing device may determine whether the first attribute and the second attribute are the same. If the first attribute and the second attribute are the same, it indicates that an attribute conflict has occurred between the parent type and the child type. Since the coverage of the parent type is larger than that of the child type, in order to effectively and conveniently eliminate conflicts between inherited attributes, the processing device may start from the child type and adjust the second attribute of the second type according to the first attribute.

[0085] Among them, the inspection of inherited properties can be divided into the following four cases:

[0086] First, in this knowledge definition template, the first attribute is the primary attribute corresponding to the first type, and the second attribute is the attribute alias corresponding to the second type. This means that an attribute is both the primary attribute of the parent type and the attribute alias of the child type. In this case, if the first and second attributes are the same, this can lead to situations when attributes are normalized: the attribute alias of the parent type and the attribute alias of the child type are not equivalent, or the attributes of the parent and child types may have primary attributes with the same meaning but different names.

[0087] As shown in the table below, Root refers to the root type, which encompasses the largest range of entities. In the parent type "Person," the primary attribute "Title" has the same alias as the attribute in the child type "Movie and TV Star." During attribute normalization, if the entity type is "Movie and TV Star" and the attribute is "Title," based on the attribute relationships within the parent type, the attribute is first normalized to "Title," and then to "Rank," based on the attribute relationships within the "Movie and TV Star" type. If the entity type is "Person," the attribute is "Title," based on the attribute relationships within the parent type "Person," the attribute is normalized to "Title." Consequently, the same attribute is normalized to the unequal "Title" and "Rank" in the parent and child types. Similarly, if entities in both parent and child types have the attribute "Year of Birth," the parent type entity is normalized to "Birthdate," while the child type entity is normalized to "Birthdate." This results in entities in the parent type having different attribute names with the same meaning, potentially making the resulting knowledge graph inaccurate and inaccurate.

[0088] Supertype Subtype Main Attributes Attribute aliases Root figure job title title Root figure Date of birth Year of birth figure Movie and TV stars Rank job title figure Movie and TV stars Birthday Date of birth

[0089] Based on this, in this case, the processing device can replace the original primary attribute associated with the second attribute with the first attribute, delete the second attribute, and adjust the original primary attribute to the attribute alias of the first attribute of the second type. Therefore, when the attributes of the second type entity that has the corresponding attribute alias of the first type are normalized, they will be normalized to the first attribute through the attribute relationship in the parent type. The first type entity that has the corresponding attribute alias of the first type will also be normalized to the first attribute, maintaining the consistency of the attributes.

[0090] The second type is when the first attribute is an alias for the first type, and the second attribute is the primary attribute for the second type. This means the alias for the parent type is the same as the primary attribute for the child type. In this case, regardless of whether the entity type with the first attribute is the first or second type, it will be normalized to the primary attribute for the first type. This may prevent the primary attribute of the child type from being retained, potentially leading to the loss of some attribute information in the child type.

[0091] As shown in the table below, the attribute alias of the parent type "Root" and the primary attribute of the child type "Game" are both "Game Category." In this case, when the entity attribute of the "Game" type is "Game Category," it will be normalized to "Category" through the attribute relationship in the parent type.

[0092] Supertype Subtype Main Attributes Attribute aliases Root category Game Category Root game Game Category

[0093] In this case, in order to avoid the loss of some valid attribute information in the subtype, the processing device can first determine whether the first attribute in the first type, that is, the attribute alias of the parent type, is accurate. If it is determined that the accuracy of the first attribute meets the threshold, then normalizing the attributes of the subtype to the main attributes of the parent type is more reasonable and causes less loss of attribute information. At this time, in order to make attribute normalization more convenient and reasonably simplify the knowledge definition template, the processing device can delete the second attribute of the second type and only retain the first attribute of the first type to achieve attribute normalization of the attribute entity.

[0094] It can be understood that there are many ways to determine whether the accuracy of the first attribute meets the threshold. For example, multiple entities with the first attribute can be obtained and analyzed to see whether they correspond to the main attribute of the first type. If the proportion of the number of corresponding entities in the total number exceeds a certain proportion threshold, it can be determined that the accuracy of the first attribute meets the threshold.

[0095] The third scenario involves the first attribute being the attribute alias corresponding to the first type, and the second attribute being the attribute alias corresponding to the second type. This means that the parent type and child type share the same attribute alias. In this case, the processing device can determine whether the primary attribute associated with the first attribute and the primary attribute associated with the second attribute are the same. If they are, this indicates that the parent type and child type share the same primary attribute and attribute alias. This can lead to redundancy in the knowledge definition template, meaning that the same attribute association exists in both the parent type and child type.

[0096] As shown in the following table, the primary attribute associated with the attribute alias "Type" in both the parent type and the child type is "Category". This means that regardless of whether the entity with the "Type" attribute is a parent type entity or a child type entity, it will actually be classified as the "Category" attribute.

[0097] Supertype Subtype Main Attributes Attribute aliases Root category type Root game category Game category, type

[0098] As mentioned above, when performing attribute normalization, in addition to normalizing the attributes of the subtype based on the subtype attribute association relationship, the attributes of the subtype can also be normalized based on the attributes of the parent type. Therefore, in order to reduce the redundancy of the knowledge definition template, if it is determined that the main attribute associated with the first attribute and the main attribute associated with the second attribute are the same, the processing device can delete the second attribute in the second type, that is, delete the attribute alias in the subtype, thereby reducing the complexity of the knowledge definition template without affecting the function of the knowledge definition template, and further improving the efficiency of knowledge graph construction.

[0099] The fourth type is that the first attribute is the attribute alias corresponding to the first type, and the second attribute is the attribute alias corresponding to the second type, that is, the parent type and the child type have the same attribute alias. Similarly, the processing device can judge whether the main attributes associated with the first attribute and the second attribute are the same. If they are not the same, it means that the same attribute alias in the parent type and the child type are associated with different main attributes. In this case, different types of entities with the same attributes may be normalized to different main attributes when performing attribute normalization, which will lead to the problem that the attributes have the same meaning but different names, affecting the accuracy of the knowledge graph.

[0100] As shown in the following table, when the attributes of the subtype "Game" entity are normalized according to the knowledge definition template, they will be normalized to the main attribute "Type"; when the attributes of the parent type "Root" entity are normalized, they will be normalized to "Type".

[0101] Supertype Subtype Main Attributes Attribute aliases Root category Game Category Root game type Game Category

[0102] Based on this, in order to further improve the accuracy of the knowledge graph, attributes with the same meaning should have the same attribute name in the knowledge graph as much as possible. If the main attribute associated with the first attribute and the main attribute associated with the second attribute are different, the processing device can replace the main attribute associated with the second attribute with the main attribute associated with the first attribute, and use the main attribute associated with the second attribute as the attribute alias of the replaced main attribute, and delete the second attribute in the second type. Since the first type can cover a larger range of entities compared to the second type, the rationality of the knowledge definition template can be guaranteed to a certain extent by modifying the main attribute of the second type based on the main attribute of the first type. In addition, since the original main attribute of the second type is retained as the attribute alias of the second type, the integrity of the knowledge definition template is also guaranteed to a certain extent, avoiding the problem that the processing device cannot accurately normalize some attributes.

[0103] As shown in the following code, this code can be used to detect conflicts in inherited properties of a type.

[0104]

[0105]

[0106] Among them, f_prop is the main attribute of the parent type, f_prop' is the attribute alias of the parent type, prop is the main attribute of the child type, prop' is the attribute alias of the child type, case1, case2, case3 and case4 correspond to the first, second, third and fourth cases above respectively.

[0107] Through the above method, after generating the knowledge definition template, the processing device can automatically check the attribute conflicts therein, thus eliminating the need for manual inspection, further reducing the workload of relevant personnel, and improving the efficiency and accuracy of attribute conflict detection.

[0108] It is understandable that among the entities corresponding to each type, the importance of different entities in the type may be different. The importance refers to the representativeness or popularity of the entity in the entity group corresponding to the type. The more important the entity is, the more information content it corresponds to in the knowledge graph. For example, among the entities of the "character" type, the information content of celebrity characters is usually more than that of ordinary characters. At the same time, the frequency of querying related information for entities with higher importance is usually much higher than that of other entities. For example, users often query related information about celebrity characters. Therefore, when determining the main attributes in the knowledge definition template, in order to improve the accuracy and comprehensiveness of the main attributes, the processing device can also analyze the importance of the entity in the type, and focus on referring to the important entities therein to determine the main attributes corresponding to the type.

[0109] In one possible implementation, before generating a knowledge definition template based on the type and the main attributes corresponding to the type, the processing device may also determine the important entities related to the type in the knowledge content. The important entities refer to entities that contain a high amount of information and are more representative among the entities related to the type, such as celebrity characters among characters, high-grossing movies among movies, etc. The processing device may determine the main attributes corresponding to the type in the knowledge content based on the attributes corresponding to the important entities in the knowledge content, so that the knowledge graph including the main attributes can better meet the needs of being used. For example, if the entities related to the type "character" include star A, and the attributes corresponding to star A in the knowledge content include "age", "height", "weight", "place of birth", etc., then the processing device may use these attributes as the main attributes of the type "character" to generate a knowledge definition template.

[0110] In addition to being used to construct a knowledge graph corresponding to the knowledge content, the knowledge definition template can also be applied to a variety of other application scenarios. For example, the processing device can also answer the user's knowledge content questions through the knowledge definition template.

[0111] In one possible implementation, the processing device can obtain a user question to be processed, which involves the knowledge content. The processing device can determine the question entity and question attribute corresponding to the user question, and then determine the query combination corresponding to the question entity and question attribute through the knowledge definition template. The query combination includes a target type and target attribute determined according to the question entity and question attribute. The target type is the entity type corresponding to the question entity, and the target attribute is the attribute corresponding to the question attribute. For example, if the user question is "When is the birthday of person A", the question entity can be "person A" and the question attribute is "birthday". Through the knowledge definition template, the processing device can determine that the corresponding target type is "person" and the target attribute is "date of birth / birthday", so that the query combination (person, date of birth / birthday,?) can be obtained.

[0112] The processing device can determine the corresponding answer data from the knowledge graph based on the query combination, and the answer data is used to answer the user's question. Since the knowledge graph is constructed through the knowledge definition template, the processing device can quickly locate the position of the data required by the user in the knowledge graph through the query combination, and then quickly query the relevant data required by the user for the question entity. For example, through the query combination (person, date of birth / birthday,?), the processing device can locate the data location in the knowledge graph where the data of the person's date of birth is stored, and then obtain the date of birth of person A from the data at this location as the answer data and return it to the user who asked the question.

[0113] In order to facilitate understanding of the technical solution provided by the embodiment of the present application, the following will introduce a template determination method for a knowledge graph provided by the embodiment of the present application in combination with an actual application scenario.

[0114] See also Figure 4 , Figure 4 This is a flowchart of a template determination method for a knowledge graph in an actual application scenario provided by an embodiment of the present application. In this actual application scenario, the processing device may be a template determination server. The method includes:

[0115] S401: Start.

[0116] S402: Acquire knowledge content to be processed.

[0117] After acquiring the knowledge content, the template determination server can start constructing attributes in the Schema, which is mainly divided into two methods: S403 and S404.

[0118] S403: Determine the attribute ratio parameter and the type ratio parameter.

[0119] S404: Determine type-related important entities.

[0120] S405: Determine at least one main attribute corresponding to the type.

[0121] The template determination server may determine the main attribute by using a ratio parameter or by using the corresponding attribute of the important entity in the knowledge content.

[0122] S406: Generate a Schema based on the type and the corresponding primary attributes.

[0123] After the schema is initially constructed, the template ensures that the server can generate attribute aliases.

[0124] S407: Determine a pending attribute that has semantic similarity with the main attribute.

[0125] The pending attribute can be determined by directly determining the semantic synonyms of the main attribute or determining the semantic synonyms of the segmented words after segmenting the main attribute.

[0126] S408: Determine the pending attribute with a matching relationship as an attribute alias.

[0127] After determining the attribute alias, the processing device can check for attribute conflicts in the type. Attribute conflict checking is mainly divided into two aspects: own attribute checking and inherited attribute checking.

[0128] S409: Check for attribute conflicts on own attributes

[0129] S410: Perform attribute conflict check on inherited attributes.

[0130] The conflict check of inherited attributes includes the above four cases 1 to 4.

[0131] S411: Determine whether there is a conflict.

[0132] S412: Attribute conflict processing.

[0133] If there is a conflict, the template determines that the server performs attribute conflict processing, eliminates unreasonable attributes, and then performs attribute conflict checking again until no attribute conflict is found.

[0134] S413: Generate the final Schema.

[0135] If there is no attribute conflict, the final Schema can be generated.

[0136] S414: End.

[0137] Based on the template determination method for a knowledge graph provided in the above embodiment, the present application embodiment also provides a template determination device for a knowledge graph, see Figure 5 , Figure 5 This is a structural block diagram of a template determination device 500 for a knowledge graph provided in an embodiment of the present application. The device 500 includes a first acquisition unit 501, a first determination unit 502, a second determination unit 503, and a generation unit 504:

[0138] A first acquisition unit 501 is used to acquire knowledge content to be processed;

[0139] A first determining unit 502 is configured to determine, based on the type of entity involved in the knowledge content and the corresponding attribute, an attribute proportion parameter corresponding to the type and a type proportion parameter corresponding to the attribute, wherein the attribute proportion parameter is used to identify the proportion of different attributes among the attributes related to the type in the knowledge content, and the type proportion parameter is used to identify the proportion of different types among the types related to the attribute in the knowledge content;

[0140] A second determining unit 503 is configured to determine at least one main attribute corresponding to the type in the knowledge content based on the attribute proportion parameter and the type proportion parameter;

[0141] The generating unit 504 is configured to generate a knowledge definition template according to the type and the main attributes corresponding to the type, wherein the knowledge definition template corresponds to the knowledge graph of the knowledge content.

[0142] In a possible implementation, the apparatus 500 further includes a third determining unit and a fourth determining unit:

[0143] a third determining unit, configured to determine an undetermined attribute having semantic similarity with the main attribute;

[0144] a fourth determining unit, configured to determine an attribute alias associated with the main attribute from the attributes to be determined;

[0145] The generating unit 504 is specifically configured to:

[0146] The knowledge definition template is generated according to the type, the main attribute corresponding to the type, and the attribute alias associated with the main attribute.

[0147] In a possible implementation, the third determining unit is specifically configured to:

[0148] determining a first synonym for the primary attribute;

[0149] If the main attribute can be segmented, determine segmentation synonyms corresponding to multiple segmentations of the main attribute, and combine the segmentation synonyms according to the arrangement structure of the multiple segmentations in the main attribute to obtain a second synonym for the main attribute;

[0150] The undetermined attribute is determined according to the first synonym and the second synonym.

[0151] In a possible implementation, the fourth determining unit is specifically configured to:

[0152] In response to the pending attribute having a matching relationship with the content in the knowledge content, the pending attribute having the matching relationship is determined as an attribute alias associated with the main attribute.

[0153] In a possible implementation, the apparatus 500 further includes a fifth determining unit and a deleting unit:

[0154] a fifth determining unit, configured to determine a primary attribute and an attribute alias corresponding to a target type in the knowledge definition template, wherein the target type is any type defined in the knowledge definition template;

[0155] The deleting unit is configured to delete the target alias of the target type from the knowledge definition template if it is determined that the target alias in the attribute alias is the same as the target main attribute in the main attribute.

[0156] In a possible implementation, in the knowledge definition template, the first type is a parent type of the second type, the first attribute is a primary attribute or an attribute alias corresponding to the first type, and the second attribute is a primary attribute or an attribute alias corresponding to the second type. The apparatus 500 further includes an adjustment unit:

[0157] An adjusting unit is configured to adjust the second attribute of the second type according to the first attribute if the first attribute and the second attribute are the same.

[0158] In a possible implementation, if the first attribute is a main attribute corresponding to the first type, and the second attribute is an attribute alias corresponding to the second type, the adjusting unit is specifically configured to:

[0159] The original main attribute associated with the second attribute is replaced with the first attribute, the second attribute is deleted, and the original main attribute is adjusted to an attribute alias of the first attribute of the second type.

[0160] In a possible implementation, if the first attribute is an attribute alias corresponding to the first type, and the second attribute is a main attribute corresponding to the second type, the adjusting unit is specifically configured to:

[0161] If it is determined that the accuracy of the first attribute meets a threshold, the second attribute of the second type is deleted.

[0162] In a possible implementation, if the first attribute is an attribute alias corresponding to the first type, and the second attribute is an attribute alias corresponding to the second type, the adjusting unit is specifically configured to:

[0163] If the main attribute associated with the first attribute is the same as the main attribute associated with the second attribute, the second attribute in the second type is deleted.

[0164] In a possible implementation, if the first attribute is an attribute alias corresponding to the first type, and the second attribute is an attribute alias corresponding to the second type, the adjusting unit is specifically configured to:

[0165] If the primary attribute associated with the first attribute is different from the primary attribute associated with the second attribute, the primary attribute associated with the second attribute is replaced with the primary attribute associated with the first attribute, and the primary attribute associated with the second attribute is used as the attribute alias of the replaced primary attribute, and the second attribute in the second type is deleted.

[0166] In a possible implementation, the apparatus 500 further includes a sixth determining unit and a seventh determining unit:

[0167] a sixth determining unit, configured to determine important entities in the knowledge content that are related to the type;

[0168] The seventh determining unit is configured to determine a main attribute corresponding to the type in the knowledge content according to an attribute corresponding to the important entity in the knowledge content.

[0169] In a possible implementation, the apparatus 500 further includes a second acquiring unit, an eighth determining unit, a ninth determining unit, and a tenth determining unit:

[0170] a second acquiring unit, configured to acquire a user question to be processed, wherein the user question involves the knowledge content;

[0171] An eighth determining unit, configured to determine a question entity and a question attribute corresponding to the user's question;

[0172] a ninth determining unit, configured to determine, by using the knowledge definition template, a query combination corresponding to the question entity and the question attribute, wherein the query combination includes a target type and a target attribute determined according to the question entity and the question attribute;

[0173] The tenth determination unit is used to determine corresponding answer data from the knowledge graph according to the query combination.

[0174] The present application also provides a computer device, which is described below with reference to the accompanying drawings. Figure 6 As shown, the embodiment of the present application provides a device, which may also be a terminal device. The terminal device may be any intelligent terminal including a mobile phone, a tablet computer, a personal digital assistant (PDA), a point of sales (POS), an in-vehicle computer, etc., taking a mobile phone as an example:

[0175] Figure 6 The block diagram shows a partial structure of a mobile phone related to the terminal device provided in the embodiment of the present application. Figure 6 The mobile phone includes components such as a radio frequency (RF) circuit 610, a memory 620, an input unit 630, a display unit 640, a sensor 650, an audio circuit 660, a wireless fidelity (WiFi) module 670, a processor 680, and a power supply 690. It will be understood by those skilled in the art that Figure 6 The mobile phone structure shown in the figure does not constitute a limitation to the mobile phone, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0176] The following combination Figure 6 A detailed introduction to the various components of a mobile phone:

[0177] The RF circuit 610 can be used to receive and send signals during information transmission or calls. In particular, after receiving downlink information from the base station, it is sent to the processor 680 for processing; in addition, the designed uplink data is sent to the base station. Generally, the RF circuit 610 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (LNA), a duplexer, etc. In addition, the RF circuit 610 can also communicate with the network and other devices through wireless communication. The above-mentioned wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.

[0178] The memory 620 can be used to store software programs and modules. The processor 680 executes the various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 620. The memory 620 may mainly include a program storage area and a data storage area. The program storage area may store an operating system and at least one application required for a function (such as a sound playback function, an image playback function, etc.); the data storage area may store data created based on the use of the mobile phone (such as audio data, a phone book, etc.). In addition, the memory 620 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device.

[0179] The input unit 630 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the mobile phone. Specifically, the input unit 630 may include a touch panel 631 and other input devices 632. The touch panel 631, also known as a touch screen, can collect user touch operations on or near it (such as operations performed by the user using any suitable object or accessory such as a finger, stylus, etc. on or near the touch panel 631) and drive the corresponding connection device according to a pre-set program. Optionally, the touch panel 631 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch direction and detects the signal caused by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device and converts it into touch point coordinates, which are then sent to the processor 680. It can also receive commands sent by the processor 680 and execute them. In addition, the touch panel 631 can be implemented using various types such as resistive, capacitive, infrared and surface acoustic wave. In addition to the touch panel 631, the input unit 630 may further include other input devices 632. Specifically, the other input devices 632 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick.

[0180] The display unit 640 can be used to display information input by the user or information provided to the user and various menus of the mobile phone. The display unit 640 may include a display panel 641. Optionally, the display panel 641 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. Further, the touch panel 631 may cover the display panel 641. When the touch panel 631 detects a touch operation on or near it, it is transmitted to the processor 680 to determine the type of touch event. Subsequently, the processor 680 provides corresponding visual output on the display panel 641 according to the type of touch event. Although in Figure 6 In the embodiment, the touch panel 631 and the display panel 641 are used as two independent components to realize the input and output functions of the mobile phone, but in some embodiments, the touch panel 631 and the display panel 641 can be integrated to realize the input and output functions of the mobile phone.

[0181] The mobile phone may also include at least one sensor 650, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 641 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 641 and / or the backlight when the mobile phone is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that the mobile phone can also be configured with, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be described here.

[0182] Audio circuit 660, speaker 661, and microphone 662 provide an audio interface between the user and the phone. Audio circuit 660 converts received audio data into electrical signals and transmits them to speaker 661, which then converts them into sound signals for output. Microphone 662, on the other hand, converts collected sound signals into electrical signals, which are then received by audio circuit 660 and converted into audio data. The audio data is then processed by processor 680 and then transmitted to, for example, another phone via RF circuit 610. Alternatively, the audio data can be output to memory 620 for further processing.

[0183] WiFi is a short-range wireless transmission technology. The mobile phone can help users send and receive emails, browse the web and access streaming media through the WiFi module 670. It provides users with wireless broadband Internet access. Figure 6 A WiFi module 670 is shown, but it is understandable that it is not an essential component of the mobile phone and can be omitted as needed without changing the essence of the invention.

[0184] Processor 680 is the control center of the mobile phone, connecting all parts of the mobile phone using various interfaces and circuits. It executes software programs and / or modules stored in memory 620 and accesses data stored in memory 620 to perform various functions and process data. Processor 680 may optionally include one or more processing units. Preferably, processor 680 integrates an application processor and a modem processor. The application processor primarily handles the operating system, user interface, and application programs, while the modem processor primarily handles wireless communications. It is understood that the modem processor may not be integrated into processor 680.

[0185] The mobile phone also includes a power supply 690 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 680 through a power management system, thereby managing charging, discharging, and power consumption through the power management system.

[0186] Although not shown, the mobile phone may also include a camera, a Bluetooth module, etc., which will not be described in detail here.

[0187] In this embodiment, the processor 680 included in the terminal device further has the following functions:

[0188] Acquire knowledge content to be processed;

[0189] Determine, based on the type of entity involved in the knowledge content and the corresponding attribute, an attribute proportion parameter corresponding to the type and a type proportion parameter corresponding to the attribute, wherein the attribute proportion parameter is used to identify the proportion of different attributes in the attributes related to the type in the knowledge content, and the type proportion parameter is used to identify the proportion of different types in the types related to the attribute in the knowledge content;

[0190] Determining at least one main attribute corresponding to the type in the knowledge content based on the attribute proportion parameter and the type proportion parameter;

[0191] A knowledge definition template is generated according to the type and the main attributes corresponding to the type, and the knowledge definition template corresponds to the knowledge graph of the knowledge content.

[0192] This application embodiment also provides a server, see Figure 7 As shown, Figure 7 The structural diagram of the server 700 provided in the embodiment of the present application, the server 700 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPUs) 722 (for example, one or more processors) and memories 732, and one or more storage media 730 (for example, one or more massive storage devices) for storing application programs 742 or data 744. Among them, the memories 732 and the storage media 730 can be temporary storage or persistent storage. The program stored in the storage medium 730 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processing unit 722 can be configured to communicate with the storage medium 730 to execute a series of instruction operations in the storage medium 730 on the server 700.

[0193] The server 700 may also include one or more power supplies 726, one or more wired or wireless network interfaces 750, one or more input and output interfaces 758, and / or one or more operating systems 741, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0194] The steps performed by the server in the above embodiment can be based on Figure 7 The server structure shown.

[0195] An embodiment of the present application also provides a computer-readable storage medium for storing a computer program, which is used to execute any one of the implementation methods of the template determination method for the knowledge graph described in the aforementioned embodiments.

[0196] Those skilled in the art will understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the above-mentioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the above-mentioned storage medium can be at least one of the following media: read-only memory (English: read-only memory, abbreviated: ROM), RAM, magnetic disk or optical disk, etc., various media that can store program codes.

[0197] It should be noted that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments. The device and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. A person of ordinary skill in the art can understand and implement it without expending creative work.

[0198] The above is merely one specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A template determination method for a knowledge graph, characterized in that: The method comprises: Acquire knowledge content to be processed; Determine, based on the type of entity involved in the knowledge content and the corresponding attribute, an attribute proportion parameter corresponding to the type and a type proportion parameter corresponding to the attribute, wherein the attribute proportion parameter is used to identify the proportion of different attributes in the attributes related to the type in the knowledge content, and the type proportion parameter is used to identify the proportion of different types in the types related to the attribute in the knowledge content; Determining at least one main attribute corresponding to the type in the knowledge content based on the attribute proportion parameter, the attribute proportion threshold, the type proportion parameter, and the type proportion threshold; Determining a pending attribute that has semantic similarity with the main attribute; Determine an attribute alias associated with the main attribute from the pending attributes; generating a knowledge definition template according to the type, a main attribute corresponding to the type, and an attribute alias associated with the main attribute, wherein the knowledge definition template corresponds to a knowledge graph of the knowledge content; Obtaining a user question to be processed, wherein the user question relates to the knowledge content; Determine the question entity and question attributes corresponding to the user question; Determining a query combination corresponding to the question entity and the question attribute through the knowledge definition template, wherein the query combination includes a target type and a target attribute determined according to the question entity and the question attribute; Corresponding answer data is determined from the knowledge graph according to the query combination.

2. The method according to claim 1, characterized in that The determining of the pending attribute having semantic similarity with the main attribute includes: determining a first synonym for the primary attribute; If the main attribute can be segmented, determine segmentation synonyms corresponding to multiple segmentations of the main attribute, and combine the segmentation synonyms according to the arrangement structure of the multiple segmentations in the main attribute to obtain a second synonym for the main attribute; The undetermined attribute is determined according to the first synonym and the second synonym.

3. The method according to claim 1, characterized in that The determining of the attribute alias associated with the main attribute from the pending attributes includes: In response to the pending attribute having a matching relationship with the content in the knowledge content, the pending attribute having the matching relationship is determined as an attribute alias associated with the main attribute.

4. The method according to claim 1, wherein The method further comprises: Determine the primary attribute and attribute alias corresponding to the target type in the knowledge definition template, where the target type is any type defined in the knowledge definition template; If it is determined that the target alias in the attribute alias is the same as the target main attribute in the main attribute, the target alias of the target type is deleted from the knowledge definition template.

5. The method according to claim 1, wherein In the knowledge definition template, the first type is a parent type of the second type, the first attribute is a primary attribute or an attribute alias corresponding to the first type, and the second attribute is a primary attribute or an attribute alias corresponding to the second type. The method further includes: If the first attribute and the second attribute are the same, the second attribute of the second type is adjusted according to the first attribute.

6. The method according to claim 5, characterized in that If the first attribute is the main attribute corresponding to the first type, and the second attribute is the attribute alias corresponding to the second type, adjusting the second attribute of the second type according to the first attribute includes: The original main attribute associated with the second attribute is replaced with the first attribute, the second attribute is deleted, and the original main attribute is adjusted to an attribute alias of the first attribute of the second type.

7. The method according to claim 5, characterized in that If the first attribute is an attribute alias corresponding to the first type, and the second attribute is a main attribute corresponding to the second type, adjusting the second attribute of the second type according to the first attribute includes: If it is determined that the accuracy of the first attribute meets a threshold, the second attribute of the second type is deleted.

8. The method according to claim 5, characterized in that If the first attribute is an attribute alias corresponding to the first type, and the second attribute is an attribute alias corresponding to the second type, adjusting the second attribute of the second type according to the first attribute includes: If the main attribute associated with the first attribute is the same as the main attribute associated with the second attribute, the second attribute in the second type is deleted.

9. The method according to claim 5, characterized in that If the first attribute is an attribute alias corresponding to the first type, and the second attribute is an attribute alias corresponding to the second type, adjusting the second attribute of the second type according to the first attribute includes: If the primary attribute associated with the first attribute is different from the primary attribute associated with the second attribute, the primary attribute associated with the second attribute is replaced with the primary attribute associated with the first attribute, and the primary attribute associated with the second attribute is used as the attribute alias of the replaced primary attribute, and the second attribute in the second type is deleted.

10. The method according to any one of claims 1 to 9, characterized in that: Before generating a knowledge definition template according to the type, the main attribute corresponding to the type, and the attribute alias associated with the main attribute, the method further includes: Identifying important entities in the knowledge content that are relevant to the type; According to the attributes corresponding to the important entities in the knowledge content, the main attributes corresponding to the types in the knowledge content are determined.

11. A template determination device for a knowledge graph, characterized in that: The apparatus includes a first acquiring unit, a second acquiring unit, a first determining unit, a second determining unit, a third determining unit, a fourth determining unit, an eighth determining unit, a ninth determining unit, a tenth determining unit, and a generating unit: The first acquisition unit is used to acquire knowledge content to be processed; The first determining unit is configured to determine, based on the type of entity involved in the knowledge content and the corresponding attribute, an attribute proportion parameter corresponding to the type and a type proportion parameter corresponding to the attribute, the attribute proportion parameter being used to identify the proportions of different attributes among the attributes related to the type in the knowledge content, and the type proportion parameter being used to identify the proportions of different types among the types related to the attribute in the knowledge content; The second determining unit is configured to determine at least one main attribute corresponding to the type in the knowledge content based on the attribute proportion parameter, the attribute proportion threshold, the type proportion parameter, and the type proportion threshold; a third determining unit, configured to determine an undetermined attribute having semantic similarity with the main attribute; a fourth determining unit, configured to determine an attribute alias associated with the main attribute from the attributes to be determined; The generating unit is configured to generate a knowledge definition template according to the type, the main attribute corresponding to the type, and the attribute alias associated with the main attribute, wherein the knowledge definition template corresponds to the knowledge graph of the knowledge content; a second acquiring unit, configured to acquire a user question to be processed, wherein the user question involves the knowledge content; An eighth determining unit, configured to determine a question entity and a question attribute corresponding to the user's question; a ninth determining unit, configured to determine, by using the knowledge definition template, a query combination corresponding to the question entity and the question attribute, wherein the query combination includes a target type and a target attribute determined according to the question entity and the question attribute; The tenth determination unit is used to determine corresponding answer data from the knowledge graph according to the query combination.

12. The device according to claim 11, characterized in that The third determining unit is specifically configured to: determining a first synonym for the primary attribute; If the main attribute can be segmented, determine segmentation synonyms corresponding to multiple segmentations of the main attribute, and combine the segmentation synonyms according to the arrangement structure of the multiple segmentations in the main attribute to obtain a second synonym for the main attribute; The undetermined attribute is determined according to the first synonym and the second synonym.

13. The device according to claim 11, characterized in that The fourth determining unit is specifically configured to: In response to the pending attribute having a matching relationship with the content in the knowledge content, the pending attribute having the matching relationship is determined as an attribute alias associated with the main attribute.

14. The device according to claim 11, characterized in that The device further includes a fifth determining unit and a deleting unit: a fifth determining unit, configured to determine a primary attribute and an attribute alias corresponding to a target type in the knowledge definition template, wherein the target type is any type defined in the knowledge definition template; The deleting unit is configured to delete the target alias of the target type from the knowledge definition template if it is determined that the target alias in the attribute alias is the same as the target main attribute in the main attribute.

15. The device according to claim 11, characterized in that In the knowledge definition template, the first type is a parent type of the second type, the first attribute is a primary attribute or an attribute alias corresponding to the first type, and the second attribute is a primary attribute or an attribute alias corresponding to the second type. The device further includes an adjustment unit: An adjusting unit is configured to adjust the second attribute of the second type according to the first attribute if the first attribute and the second attribute are the same.

16. The device according to claim 15, characterized in that If the first attribute is a main attribute corresponding to the first type, and the second attribute is an attribute alias corresponding to the second type, the adjusting unit is specifically configured to: The original main attribute associated with the second attribute is replaced with the first attribute, the second attribute is deleted, and the original main attribute is adjusted to an attribute alias of the first attribute of the second type.

17. The device according to claim 15, characterized in that If the first attribute is an attribute alias corresponding to the first type, and the second attribute is a main attribute corresponding to the second type, the adjusting unit is specifically configured to: If it is determined that the accuracy of the first attribute meets a threshold, the second attribute of the second type is deleted.

18. The device according to claim 15, characterized in that If the first attribute is an attribute alias corresponding to the first type, and the second attribute is an attribute alias corresponding to the second type, the adjusting unit is specifically configured to: If the main attribute associated with the first attribute is the same as the main attribute associated with the second attribute, the second attribute in the second type is deleted.

19. The device according to claim 15, characterized in that If the first attribute is an attribute alias corresponding to the first type, and the second attribute is an attribute alias corresponding to the second type, the adjusting unit is specifically configured to: If the primary attribute associated with the first attribute is different from the primary attribute associated with the second attribute, the primary attribute associated with the second attribute is replaced with the primary attribute associated with the first attribute, and the primary attribute associated with the second attribute is used as the attribute alias of the replaced primary attribute, and the second attribute in the second type is deleted.

20. The device according to any one of claims 11 to 19, characterized in that The apparatus further includes a sixth determining unit and a seventh determining unit: a sixth determining unit, configured to determine important entities in the knowledge content that are related to the type; The seventh determining unit is configured to determine a main attribute corresponding to the type in the knowledge content according to an attribute corresponding to the important entity in the knowledge content.

21. A computer device, characterized in that: The device includes a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the template determination method for the knowledge graph described in any one of claims 1-10 according to the instructions in the program code.

22. A computer-readable storage medium, characterized in that The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the template determination method for the knowledge graph described in any one of claims 1-10.

Citation Information

Patent Citations

  • Knowledge graph-based hypernym mining method and apparatus

    CN108304493A

  • Question answering interaction method and system based on intelligent robot

    CN108959627A

  • Training method and device for multivariate relationship generation model, electronic equipment and medium

    CN112507040A

  • Automated Extraction, Inference and Normalization of Structured Attributes for Product Data

    US20200151201A1