Method and device for updating entity type in knowledge graph and computer equipment

By obtaining the entities to be updated and their associated entities in the knowledge graph, and predicting based on entity type and associated attribute information, the entity type is updated in the knowledge graph, and the entity type is not complete and accurate enough, realizing a more efficient update process.

CN119046472APending Publication Date: 2024-11-29TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202310621750.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-29
Publication Date
2024-11-29

AI Technical Summary

Technical Problem

The update of entity type information in the knowledge graph requires a lot of human resources, and the update is not complete and accurate enough. How to improve the integrity and accuracy of entity type update is an urgent problem.

Method used

By obtaining the entity to be updated and its associated entities in the knowledge graph, entity type prediction is performed based on entity type and associated attribute information, the target entity type of the entity to be updated is determined, thereby updating the entity type to be updated, taking into account the type and association of the entity itself The type of entity and related information improves the accuracy and completeness of updates.

Benefits of technology

This method can describe entity types more accurately and completely, improve the integrity and accuracy of entity type updates in the knowledge graph, reduce manual intervention, and improve update efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119046472A_ABST
    Figure CN119046472A_ABST
Patent Text Reader

Abstract

The invention relates to an updating method and device for entity types in a knowledge graph, computer equipment, a storage medium and a computer program product. The method comprises the steps that a knowledge graph is obtained, the knowledge graph comprises to-be-updated entities, and the to-be-updated entities have corresponding to-be-updated entity types; determining an associated entity having an associated edge with the to-be-updated entity from the knowledge graph, the associated edge being used for describing an association relationship between the entities; performing entity type prediction based on the to-be-updated entity type and the associated attribute information corresponding to the associated entity to determine the probability that the to-be-updated entity belongs to a plurality of preset entity types, and determining a target entity type of the to-be-updated entity based on the probability that the to-be-updated entity belongs to the plurality of preset entity types; and updating the to-be-updated entity type based on the target entity type. By adopting the method, the updating integrity and accuracy of the entity type in the knowledge graph can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to information processing technology, and in particular to a method, apparatus and computer device for updating entity types in a knowledge graph. Background Art

[0002] Knowledge graphs store and organize knowledge consisting of entities and relationships in a graph structure, and can provide functions such as query and reasoning according to needs, becoming one of the important technologies for realizing cognitive systems in the field of artificial intelligence. At present, knowledge graphs have played an important role in various fields. At present, there are many representation models proposed for the representation of knowledge graphs. For the entity type information that is missing in the knowledge graph, it is generally supplemented based on data mining, that is, data mining can be performed from tabular / encyclopedia web pages to supplement the entity type information of each entity in the graph. However, the entity type information in tabular / encyclopedia web pages usually needs to be manually edited or manually reviewed, and many entities lack structured data information that has been manually edited or manually reviewed. Therefore, the update of entity type information in the knowledge graph requires a lot of human resources, and there is also the problem that the update is not complete and accurate. Therefore, how to improve the completeness and accuracy of the update of entity types in the knowledge graph is an urgent problem to be solved. Summary of the invention

[0003] Based on this, it is necessary to provide a method, apparatus, computer device and storage medium for updating entity types in a knowledge graph, which can improve the completeness and accuracy of updating entity types in the knowledge graph, in response to the above technical problems.

[0004] In a first aspect, the present application provides a method for updating entity types in a knowledge graph. The method comprises:

[0005] Obtain a knowledge graph, the knowledge graph includes entities to be updated, and the entities to be updated have corresponding entity types to be updated;

[0006] From the knowledge graph, determine the associated entities that have associated edges with the entity to be updated. The associated edges are used to describe the association relationship between entities.

[0007] Entity type prediction is performed based on the entity type to be updated and the associated attribute information corresponding to the associated entity to determine the probability that the entity to be updated belongs to multiple preset entity types, and the target entity type of the entity to be updated is determined based on the probability that the entity to be updated belongs to the multiple preset entity types, wherein the associated attribute information at least includes: the entity type of the associated entity and the associated information related to the entity type;

[0008] Updates the entity type to be updated based on the target entity type.

[0009] In a second aspect, the present application also provides a device for updating entity types in a knowledge graph. The device comprises:

[0010] A knowledge graph acquisition module is used to acquire a knowledge graph, wherein the knowledge graph includes entities to be updated, and the entities to be updated have corresponding entity types to be updated;

[0011] An associated entity determination module is used to determine, from the knowledge graph, associated entities that have associated edges with the entity to be updated, where the associated edges are used to describe the association relationship between the entities;

[0012] an entity type determination module, configured to predict the entity type based on the entity type to be updated and the associated attribute information corresponding to the associated entity, so as to determine the probability that the entity to be updated belongs to a plurality of preset entity types, and determine the target entity type of the entity to be updated based on the probability that the entity to be updated belongs to the plurality of preset entity types, wherein the associated attribute information at least includes: the entity type of the associated entity and the associated information related to the entity type;

[0013] The entity type updating module is used to update the entity type to be updated based on the target entity type.

[0014] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0015] Obtain a knowledge graph, the knowledge graph includes entities to be updated, and the entities to be updated have corresponding entity types to be updated;

[0016] From the knowledge graph, determine the associated entities that have associated edges with the entity to be updated. The associated edges are used to describe the association relationship between entities.

[0017] Entity type prediction is performed based on the entity type to be updated and the associated attribute information corresponding to the associated entity to determine the probability that the entity to be updated belongs to multiple preset entity types, and the target entity type of the entity to be updated is determined based on the probability that the entity to be updated belongs to the multiple preset entity types, wherein the associated attribute information at least includes: the entity type of the associated entity and the associated information related to the entity type;

[0018] Updates the entity type to be updated based on the target entity type.

[0019] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0020] Obtain a knowledge graph, the knowledge graph includes entities to be updated, and the entities to be updated have corresponding entity types to be updated;

[0021] From the knowledge graph, determine the associated entities that have associated edges with the entity to be updated. The associated edges are used to describe the association relationship between entities.

[0022] Entity type prediction is performed based on the entity type to be updated and the associated attribute information corresponding to the associated entity to determine the probability that the entity to be updated belongs to multiple preset entity types, and the target entity type of the entity to be updated is determined based on the probability that the entity to be updated belongs to the multiple preset entity types, wherein the associated attribute information at least includes: the entity type of the associated entity and the associated information related to the entity type;

[0023] Updates the entity type to be updated based on the target entity type.

[0024] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0025] Obtain a knowledge graph, the knowledge graph includes entities to be updated, and the entities to be updated have corresponding entity types to be updated;

[0026] From the knowledge graph, determine the associated entities that have associated edges with the entity to be updated. The associated edges are used to describe the association relationship between entities.

[0027] Entity type prediction is performed based on the entity type to be updated and the associated attribute information corresponding to the associated entity to determine the probability that the entity to be updated belongs to multiple preset entity types, and the target entity type of the entity to be updated is determined based on the probability that the entity to be updated belongs to the multiple preset entity types, wherein the associated attribute information at least includes: the entity type of the associated entity and the associated information related to the entity type;

[0028] Updates the entity type to be updated based on the target entity type.

[0029] The updating method, device, computer equipment, storage medium and computer program product of entity types in the above-mentioned knowledge graph obtains a knowledge graph, the knowledge graph includes entities to be updated, and the entities to be updated have corresponding entity types to be updated, and then from the knowledge graph, determine the associated entities with associated edges between the entities to be updated, the associated edges are used to describe the association relationship between entities, and the entity type is predicted based on the entity type to be updated and the associated attribute information corresponding to the associated entity to determine the probability that the entity to be updated belongs to multiple preset entity types, and determine the target entity type of the entity to be updated based on the probability that the entity to be updated belongs to multiple preset entity types, and the associated attribute information at least includes: the entity type of the associated entity, and the association information related to the entity type. Based on this, the entity type to be updated is updated based on the target entity type. Since the knowledge graph includes entities and attribute information of each entity, in the process of updating the entity type, the associated entities that have an association relationship with the entity are determined, so that on the basis of considering the entity type of the entity itself, the entity type of the associated entity and the associated information related to the entity type can also be considered, so that the determined target entity type can more accurately and completely describe the type of the entity, and then the entity type to be updated is updated through the more accurate and complete target entity type, so as to improve the completeness and accuracy of the update of entity types in the knowledge graph. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 An application environment diagram of a method for updating entity types in a knowledge graph in one embodiment;

[0031] Figure 2 A schematic diagram of a model framework of an entity type recognition model in one embodiment;

[0032] Figure 3 A schematic diagram of a process for updating entity types in a knowledge graph in one embodiment;

[0033] Figure 4 is a schematic diagram of a knowledge graph in one embodiment;

[0034] Figure 5 A schematic diagram of a process for determining a target entity type of an entity to be updated in one embodiment;

[0035] Figure 6 A schematic diagram of a process of determining an associated entity having an associated edge with an entity to be updated in one embodiment;

[0036] Figure 7 is a schematic diagram of associated entities in one embodiment;

[0037] Figure 8 A schematic diagram of a flow chart of determining a target entity type of an entity to be updated in another embodiment;

[0038] Fig. 9 A schematic diagram of constructing an associated subgraph through a knowledge graph in one embodiment;

[0039] Fig.10 A schematic diagram of performing information encoding processing on an associated subgraph to determine a second splicing feature in an embodiment;

[0040] Fig.11 A schematic diagram of outputting a second splicing feature in one embodiment;

[0041] Fig.12 A schematic diagram of a method for acquiring an entity type recognition model in one embodiment;

[0042] Fig.13 A schematic diagram of updating an entity type to be updated based on a target entity type in one embodiment;

[0043] Fig.14 A schematic diagram of a complete process of a method for updating entity types in a knowledge graph in one embodiment;

[0044] Fig.15 It is a structural block diagram of a device for updating entity types in a knowledge graph in one embodiment;

[0045] Fig.16 It is a structural block diagram of a device for updating entity types in a knowledge graph in another embodiment;

[0046] Fig.17 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0048] In the embodiment of the present application, a method for updating entity types in a knowledge graph is provided, which can improve the completeness and accuracy of updating entity types in the knowledge graph. The method for updating entity types in the knowledge graph provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown, the terminal 102 communicates with the server 104 through a network. The data storage system can store data that the server 104 needs to process. The data storage system can be integrated on the server 104, or placed on the cloud or other servers.

[0049] Specifically, taking the application to server 104 as an example for explanation, server 104 first obtains a knowledge graph, the knowledge graph includes entities to be updated, and the entities to be updated have corresponding entity types to be updated. Then, server 104 determines from the knowledge graph the associated entities that have associated edges with the entities to be updated, the associated edges are used to describe the association relationship between entities, and then performs entity type prediction based on the entity types to be updated and the associated attribute information corresponding to the associated entities, so as to determine the probability that the entity to be updated belongs to multiple preset entity types, and determine the target entity type of the entity to be updated based on the probability that the entity to be updated belongs to multiple preset entity types, the associated attribute information at least includes: the entity type of the associated entity, and the associated information related to the entity type. Thus, server 104 can update the entity type to be updated based on the determined target entity type. Since the associated entities that have an association relationship with the entity are determined in the process of updating the entity type, the entity type of the associated entity and the associated information related to the entity type can be considered in addition to the entity type of the entity itself, so that the determined target entity type can more accurately and completely describe the type of the entity, and then the entity type to be updated is updated through the more accurate and complete target entity type, so as to improve the completeness and accuracy of the update of entity types in the knowledge graph.

[0050] Among them, the terminal 102 can be but is not limited to various desktop computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented with an independent server or a server cluster composed of multiple servers. Secondly, the update of entity types in the knowledge graph provided in the embodiment of the present application can be applied at least to scenarios such as search engines and intelligent recommendations of items, and because the completeness and accuracy of the update of entity types can be improved, if applied to the scenario of search engines, more complete and accurate search results can be obtained, and if applied to the scenario of intelligent recommendation of items, more complete and accurate recommendation results can be obtained.

[0051] The following briefly describes the model framework of the entity type recognition model in the embodiment of the present application. Figure 2As shown, the model framework includes at least an encoder 202 and a classifier 204. First, all entity types included in the entire knowledge graph 206 are taken as preset entity types, and each entity sample and the entity type corresponding to each entity sample are determined. The aforementioned entity types can be described in various forms such as entity type labels and entity type information, which are not limited here. Based on this, the encoder 202 will encode the entity samples in the knowledge graph 206, the attribute information of each entity sample, and the association relationship between each entity sample to obtain the corresponding feature information, and then further input the feature information into the classifier. The classifier 204 will output the probability that each entity sample belongs to each preset entity type, and then the target entity type of the entity sample can be determined based on the probability that each entity sample belongs to each preset entity type.

[0052] Based on the above discussion, it can be seen that since the knowledge graph is one of the important technologies for realizing cognitive systems in fields such as artificial intelligence (AI), and the updating of entity types in the knowledge graph in the embodiment of the present application, it is necessary to involve technical directions such as machine learning (ML) / deep learning in the field of AI. This is briefly introduced below:

[0053] 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 obtain 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 intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.

[0054] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. Basic artificial intelligence technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, and mechatronics. Artificial intelligence software technology mainly includes several major directions such as computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning. The embodiments of this application specifically involve the direction of machine learning. ML is a multi-field cross-disciplinary subject involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory, and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their own performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all fields of artificial intelligence. Machine learning and deep learning generally include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and teaching learning.

[0055] The solution provided in the embodiments of the present application involves technologies such as machine learning and deep learning in artificial intelligence, which are specifically described by the following embodiments: In one embodiment, Figure 3 As shown in the figure, a method for updating entity types in a knowledge graph is provided, and this method is applied to Figure 1 The server 104 in the example is used for explanation. It is understandable that the method can also be applied to the terminal 102, and can also be applied to a system including the terminal 102 and the server 104, and is implemented through the interaction between the terminal 102 and the server 104. In this embodiment, the method includes the following steps:

[0056] Step 302, obtaining a knowledge graph, the knowledge graph includes entities to be updated, and the entities to be updated have corresponding entity types to be updated.

[0057] Among them, the knowledge graph is composed of the association relationship between entities, that is, the basic component unit of the knowledge graph is: entity-association relationship-entity triple structure, so entities are specifically connected to each other through association relationships to form a network knowledge structure, thereby forming a knowledge graph. And each entity has corresponding entity attribute information, and the entity attribute information includes at least entity type and entity description information and other related information. The entity type is specifically used to describe the type information of the entity, and the classification of specific type information needs to be determined based on actual conditions and the construction requirements of the knowledge graph. The entity description information is information that describes the entity from multiple dimensions. For example, if the entity is specifically a film and television work 1, then the entity attribute information of film and television work 1 can include the entity type, and the entity type can describe film and television work 1 as any of the types of film and television works such as movies, TV series or animations, and the entity description information can include: the name of the film and television work, the creator of the film and television work, the release time of the film and television work, the film type of the film and television work, and even the number of episodes of the film and television work, and the duration of the film and television work.

[0058] Secondly, the association relationship between entities is specifically used to: describe the relationship between entities. The aforementioned relationship can be used to describe the relationship between events, concepts, conditions, actions and objects. For example, if entity A1 is actor 1 and entity A2 is film and television work 1, if actor 1 starred in film and television work 1, then it can be determined that there is an association relationship between entity A1 and entity A2, and the specific association relationship is entity A1 (actor 1) starred in entity A2 (film and television work 1). Secondly, if entity A3 is singer 1 and entity A4 is song 1, if singer 1 sang song 1, then it can be determined that there is an association relationship between entity A3 and entity A4, and the specific association relationship is entity A3 (singer 1) sang entity A2 (song 1).

[0059] For ease of understanding, Figure 4 As shown, Figure 4 The entities in the knowledge graph include person 401, geographic location 402, film and television work 403, and song 404. Among them, person 401 may include entity types of singers and actors, geographic location 402 may include entity types of provinces or even urban areas, film and television work 403 may be an entity type of any of the film and television work types such as movies, TV series or animations, and song 404 may be an entity type of any of the music types such as folk songs, pop, rock, rap, etc. From the above introduction, it can be seen that the knowledge graph may include entities of the entity type to be updated, so the entity of the entity type to be updated is defined as the entity to be updated, and the entity to be updated has a corresponding entity type to be updated.

[0060] Specifically, when there is a need to update the entity type of an entity in a knowledge graph, the server first obtains the knowledge graph. That is, the knowledge graph can be obtained by artificially processing the entity type of the entity through manual editing or manual review, and then the server obtains the knowledge graph through communication between the terminal and the server. Alternatively, after the data storage system stores the constructed knowledge graph, when the entity type of the entity in the knowledge graph needs to be updated, the server obtains the stored knowledge graph from the data storage system. Secondly, since the knowledge graph is a structured semantic knowledge base, the knowledge graph of the embodiment of the present application can be a "general knowledge graph" for constructing structured encyclopedic knowledge, or it can be a "domain knowledge graph" constructed and applied based on industry data. And in actual applications, the knowledge graph can still be obtained by updating the entity type by data mining based on table format / encyclopedia web pages. Therefore, the knowledge graph and the specific method of obtaining the knowledge graph are not limited here.

[0061] Step 304: Determine, from the knowledge graph, associated entities that have associated edges with the entity to be updated, where the associated edges are used to describe the association relationship between entities.

[0062] Among them, the association edge is used to describe the existence of an association relationship between entities, and there is an association edge between the associated entity and the entity to be updated, that is, there is an association relationship between the associated entity and the entity to be updated, and there may be more than one entity with an association edge with the entity to be updated in the knowledge graph, so the associated entity is composed of at least one entity with an association edge with the entity to be updated. The association relationship between entities is specifically used to: describe the relationship between entities. The aforementioned relationship can be a relationship between events, concepts, conditions, actions and objects, and similar entity types or entity description information may exist in the entity attribute information corresponding to the entities with association relationships. For a further understanding of association relationships, please refer again. Figure 4 , Figure 4 The entities in the knowledge graph include person 401, geographic location 402, film and television work 403, and song 404. Among them, the birthplace of person 401 is geographic location 402, person 401 starred in film and television work 403, and task 401 also sang song 404, that is, there is an association relationship between person 401 and geographic location 402, film and television work 403, and song 404.

[0063] Similarly, geographical location 402 is the birthplace of character 401, and geographical location 402 also belongs to the film and television work.

[0064] Product 403, that is, there is an association relationship between geographic location 402 and person 401 and film and television work 403. Also, film and television work 403 is performed by person 401, and film and television work 403 includes geographic location 402, therefore, there is an association relationship between film and television work 403 and person 401 and geographic location 402. Also, song 404 is sung by person 401, therefore, there is an association relationship between song 404 and person 401. From the above examples, it can be seen that in the knowledge graph, there will be an association edge between entities with an association relationship.

[0065] Specifically, since there are associated edges between entities with associated relationships in the knowledge graph, after the server determines the entity to be updated from the knowledge graph, it determines the entity with associated edges with the entity to be updated as the associated entity, that is, each entity in the associated entity has an associated relationship with the entity to be updated. For easier understanding, please refer to Figure 4 Through the above analysis, it can be known that the birthplace of character 401 is geographic location 402, character 401 starred in film and television work 403, and task 401 also sang song 404, that is, there is an association relationship between character 401 and geographic location 402, film and television work 403 and song 404. That is, when character 401 is the entity to be updated, it can be determined that the associated entities with the entity to be updated (character 401) having an associated edge include at least: geographic location 402, film and television work 403 and song 404.

[0066] Similarly, it can be known that geographic location 402 is the birthplace of person 401, and geographic location 402 also belongs to film and television work 403, that is, there is an association relationship between geographic location 402 and person 401 and film and television work 403, that is, when geographic location 402 is an entity to be updated, it can be determined that the associated entities with an associated edge with the entity to be updated (geographic location 402) at least include: person 401 and film and television work 403. In addition, film and television work 403 is performed by person 401, and film and television work 403 includes geographic location 402, therefore, there is an association relationship between film and television work 403 and person 401 and geographic location 402, that is, when film and television work 403 is an entity to be updated, it can be determined that the associated entities with an associated edge with the entity to be updated (film and television work 403) at least include: person 401 and geographic location 402. Furthermore, song 404 is sung by person 401 , therefore, there is an association relationship between song 404 and person 401 , that is, when song 404 is the entity to be updated, it can be determined that the associated entities having an associated edge with the entity to be updated (song 404 ) at least include: person 401 .

[0067] Step 306, perform entity type prediction based on the entity type to be updated and the associated attribute information corresponding to the associated entity to determine the probability that the entity to be updated belongs to multiple preset entity types, and determine the target entity type of the entity to be updated based on the probability that the entity to be updated belongs to multiple preset entity types, and the associated attribute information at least includes: the entity type of the associated entity, and the associated information related to the entity type.

[0068] Among them, from the above introduction, it can be known that each entity has corresponding entity attribute information, and the entity attribute information includes at least relevant information such as entity type and entity description information. The entity type is specifically used to describe the type information of the entity, and the classification of the specific type information needs to be determined based on the actual situation and the construction requirements of the knowledge graph. The entity description information is information that describes the entity from multiple dimensions. Therefore, for the entity to be updated, the entity to be updated has corresponding entity attribute information that specifically includes the entity type to be updated.

[0069] For the associated entity that has an associated relationship with the entity to be updated, the associated attribute information can be determined from the entity attribute information corresponding to the associated entity, that is, the entity type of the associated entity can be determined in the entity attribute information corresponding to the associated entity, and the associated information related to the entity type can be obtained from the entity attribute information corresponding to the associated entity, that is, the entity description information related to the entity type. For example, if the associated entity is specifically a film and television work, then the entity attribute information of the film and television work can include the entity type, and the entity type specifically describes the film and television work as a movie, and the entity description information in the associated entity includes: the name of the film and television work, the creator of the film and television work, the release time of the film and television work, the film type of the film and television work, and even the number of episodes of the film and television work, and the duration of the film and television work. Then the entity description letter related to the entity type can include: the name of the film and television work, the creator of the film and television work, and the film type of the film and television work, that is, the associated information related to the entity type introduced in the embodiment of the present application can include: the name of the film and television work, the creator of the film and television work, and the film type of the film and television work. It can be understood that the associated information related to the entity type can be consistent with the entity description information of the associated entity, or it can be part of the information extracted from the entity description information of the associated entity, which is not limited here.

[0070] Specifically, after determining the entity to be updated and the associated entity, the server first determines the entity type to be updated corresponding to the entity to be updated, and obtains the associated attribute information of the associated entity, and then determines the target entity type of the entity to be updated through the entity type to be updated and the associated attribute information. And in the embodiment of the present application, the target entity type includes at least one entity type, that is, the target entity type is composed of at least one entity type. For example, the target entity type is a singer, or the target entity type is composed of a singer, an actor, and a host.

[0071] Further, the server can specifically determine the probability that the entity to be updated belongs to multiple preset entity types through the entity type to be updated and the associated attribute information. The aforementioned preset entity type can be an entity type included in the knowledge graph, or an entity type set based on the application scenario. Based on this, the server determines the target entity type through the probability that the entity to be updated belongs to multiple preset entity types. That is, the server can determine the preset entity type with a probability greater than the classification threshold as an entity type constituting the target entity type. For example, the multiple preset entity types specifically include entity type B1, entity type B2, entity type B3, entity type B4 and entity type B5, and the probability that the entity to be updated belongs to entity type B1 is 10%, the probability that the entity to be updated belongs to entity type B2 is 90%, the probability that the entity to be updated belongs to entity type B3 is 20%, the probability that the entity to be updated belongs to entity type B4 is 70%, and the probability that the entity to be updated belongs to entity type B5 is 85%. If the classification threshold is 75%, then entity type B2 and entity type B5 can be constructed as the target entity type, that is, the target entity type includes entity type B2 and entity type B5.

[0072] Alternatively, the server selects the preset entity type with the highest probability that the entity to be updated belongs to multiple preset entity types to constitute the target entity type, that is, the server sorts the probabilities that the entity to be updated belongs to multiple preset entity types, and then selects the preset entity type with the higher probability to constitute the target entity type. Taking the above example again, that is, sorting the probabilities that the entity to be updated belongs to entity types B1 to B5 from large to small, we can get: entity type B2, entity type B5, entity type B4, entity type B3, entity type B1. If the target entity type is composed of three preset entity types with higher probabilities, entity type B2, entity type B5 and entity type B4 are selected to constitute the target entity type, that is, the target entity type includes entity type B2, entity type B5 and entity type B4. The above method can also be from small to large, as long as the preset entity type with the higher probability is selected, and it is not limited here.

[0073] Step 308: Update the entity type to be updated based on the target entity type.

[0074] Specifically, the server updates the entity type to be updated based on the target entity type. That is, the server can directly replace the entity type to be updated of the entity to be updated with the target entity type, or the server determines the entity type to be deleted from the entity type to be updated based on the target entity type, and determines the newly added entity type from the target entity type, adds the newly added entity type to the entity type to be updated, and deletes the entity type to be deleted from the entity type to be updated. For example, the target entity type includes: entity type B1, entity type B2, entity type B4, and entity type B5. And the entity type to be updated includes: entity type B1, entity type B2, and entity type B6. At this time, the entity type of the entity to be updated can be directly replaced with the target entity type, or entity type B4 and entity type B5 can be determined as newly added entity types, and entity type B6 can be determined as the entity type to be deleted, so that entity type B4 and entity type B5 are added to the entity type to be updated, and entity type B6 is deleted from the entity type to be updated.

[0075] It can be understood that the examples shown in the embodiments of the present application are used to understand the present solution, and should not be understood as specific limitations of the present solution.

[0076] In the above-mentioned method for updating entity types in the knowledge graph, since the knowledge graph includes entities and attribute information of each entity, in the process of updating the entity type, the associated entities that have an association relationship with the entity are determined, so that on the basis of considering the entity type of the entity itself, the entity type of the associated entity and the associated information related to the entity type are also considered, so that the determined target entity type can more accurately and completely describe the type of the entity, and then update the entity type to be updated through the more accurate and complete target entity type, so as to improve the completeness and accuracy of the update of the entity type in the knowledge graph.

[0077] In one embodiment, Figure 5 As shown, entity type prediction is performed based on the entity type to be updated and the associated attribute information corresponding to the associated entity to determine the probability that the entity to be updated belongs to multiple preset entity types, and the target entity type of the entity to be updated is determined based on the probability that the entity to be updated belongs to multiple preset entity types, including:

[0078] Step 502: perform information encoding processing on the entity type to be updated, the associated attribute information, and the associated relationship described by the associated edge to determine the first splicing feature.

[0079] Among them, the information encoding processing is specifically: using a preset encoding method to encode the data information to obtain the encoded features corresponding to the data information. Since different encoding methods can be adapted to different application scenarios and different machine vision tasks, the implementation of this application can use Graph Neural Networks (GNN) as an encoder to perform information encoding processing on the updated entity type, associated attribute information, and the associated relationship described by the associated edge. It can be understood that in actual applications, convolutional neural networks (CNN) or long short-term memory (LSTM) and other models can also be used as encoders for information encoding processing. Therefore, the embodiments of the present application do not specifically limit the preset encoding method.

[0080] Secondly, since the information encoding process will encode the data information to obtain the encoded features corresponding to the data information, that is, the entity type to be updated, the associated attribute information and the associated relationship will all be encoded to obtain the encoded features corresponding to each information. It can be seen that the first splicing feature includes at least: the entity type feature corresponding to the entity type to be updated, the attribute information feature corresponding to the associated attribute information, and the associated relationship feature corresponding to the associated relationship.

[0081] Specifically, the server uses a preset encoding method to perform information encoding processing on the entity type to be updated, the associated attribute information, and the associated relationship described by the associated edge, and then obtains the entity type feature corresponding to the entity type to be updated, the attribute information feature corresponding to the associated attribute information, and the associated relationship feature corresponding to the associated relationship, and performs feature splicing processing on the entity type feature, the attribute information feature, and the associated relationship feature to obtain the first splicing feature.

[0082] Furthermore, before the server performs encoding processing on the entity type, associated attribute information and associated relationship to be updated, it can also perform pre-data processing on the entity type, associated attribute information and associated relationship to be updated. The pre-data processing method can include but is not limited to: reordering, dimension reduction, frequency domain transformation and linearization. Different pre-data processing methods can be applicable to different application scenarios, machine vision tasks, and even to different encoding accuracy requirements. Therefore, before performing encoding processing, the pre-data processing of the entity type, associated attribute information and associated relationship to be updated can be performed on the basis of considering the preset encoding method to meet the encoding accuracy of the preset encoding method.

[0083] Step 504 , performing classification processing based on the first concatenated feature to determine the probability that the entity to be updated belongs to multiple preset entity types, and determining the target entity type based on the probability that the entity to be updated belongs to multiple preset entity types, the target entity type includes at least one entity type.

[0084] Among them, the target entity type includes at least one entity type, which is similar to the description in the aforementioned embodiment and will not be repeated here. Specifically, the server performs classification processing based on the first splicing feature to determine the probability that the entity to be updated belongs to multiple preset entity types, and determines the target entity type based on the probability that the entity to be updated belongs to multiple preset entity types, that is, the server performs classification processing on the first splicing feature to determine the probability that the entity to be updated belongs to multiple preset entity types, and then the server determines the target entity type by the probability that the entity to be updated belongs to multiple preset entity types. Therefore, the server can determine the preset entity type with a probability greater than the classification threshold as one of the entity types constituting the target entity type. Alternatively, the server sorts the probabilities that the entity to be updated belongs to multiple preset entity types, and then selects the preset entity type with a larger probability to constitute the target entity type. The specific determination method is similar to that described in the aforementioned embodiment and will not be repeated here.

[0085] In this embodiment, by encoding the entity type to be updated, the associated attribute information and the associated relationship, information encoding can be performed from two consideration dimensions: the entity type of the associated entity and the associated information related to the entity type, so as to extract more complete features that are effective for type determination, thereby improving the integrity and reliability of the obtained first splicing feature, and thereby improving the integrity and accuracy of the update of the entity type in the knowledge graph.

[0086] It can be seen from the above embodiments that since there may be more than one entity with an associated edge with the entity to be updated in the knowledge graph, and there may be many associated edges between entities, as the number of associated hops increases, the associated entities with associated edges with the entity to be updated will show an exponential growth, so the increase in the number of associated hops can be considered to determine the specific associated entity. Specifically: In one embodiment, if Figure 6 As shown, from the knowledge graph, the associated entities with associated edges with the entity to be updated are determined, including:

[0087] Step 602: Determine, from the knowledge graph, a one-hop associated entity that has an associated edge with the entity to be updated.

[0088] Among them, a one-hop associated entity has an associated edge with the entity to be updated, that is, the minimum associated edge connecting the one-hop associated entity and the entity to be updated is one. Specifically, the server specifically determines the entity in the knowledge graph that has an associated edge with the entity to be updated as a one-hop associated entity.

[0089] Step 604: Determine, from the knowledge graph, a two-hop associated entity that has two associated edges with the entity to be updated.

[0090] Among them, the two-hop associated entity has two associated edges with the entity to be updated, that is, the minimum number of associated edges between the two-hop associated entity and the entity to be updated is two. Specifically, the server specifically determines the entity in the knowledge graph that has two associated edges with the entity to be updated as the two-hop associated entity.

[0091] Step 606: Determine, from the knowledge graph, a three-hop associated entity that has three associated edges with the entity to be updated.

[0092] Among them, the three-hop associated entity has three associated edges with the entity to be updated, that is, the minimum associated edges between the three-hop associated entity and the entity to be updated is three. Specifically, the server specifically determines the entity in the knowledge graph that has three associated edges with the entity to be updated as the three-hop associated entity.

[0093] And it can be seen that the associated entities at least include: one-hop associated entities, two-hop associated entities and three-hop associated entities. That is, in the embodiment of the present application, one hop to three hops are specifically used as the association of the entity, that is, the associated entity can specifically include one of the one-hop associated entities, two-hop associated entities and three-hop associated entities, or a combination of multiple items. It can be understood that in actual applications, the number of hops can also be determined based on the data volume of the knowledge graph and the actual application requirements, that is, the server can also determine a four-hop associated entity with four associated edges, a five-hop associated entity with five associated edges, etc., which is not limited here.

[0094] Further, to facilitate understanding of the one-hop association entity, the two-hop association entity, and the three-hop association entity, such as Figure 7 As shown, the knowledge graph includes entity 701, entity 702, entity 703, entity 704, and entity 705. Figure 7It can be seen that for entity 701, the minimum associated edge connecting entity 701 with entity 702 and entity 703 is one, specifically: there is an associated edge 706 between entity 701 and entity 702, and there is an associated edge 707 between entity 701 and entity 703, so it can be determined that entity 702 and entity 705 are one-hop associated entities of entity 701. The minimum associated edges connecting entity 701 and entity 704 are two, specifically: there are associated edges 707 and 708 between entity 701 and entity 704, so it can be determined that entity 704 is a two-hop associated entity of entity 701. The minimum associated edges connecting entity 701 and entity 705 are three, specifically: there are associated edges 707, 708 and 709 between entity 701 and entity 704, so it can be determined that entity 705 is a three-hop associated entity of entity 701.

[0095] Similarly, for entity 702, the minimum associated edge between entity 702 and entity 701 is one (i.e., associated edge 706), so entity 701 can be determined as a one-hop associated entity of entity 702. The minimum associated edges between entity 702 and entity 703 are two (i.e., associated edge 706 and associated edge 707), so entity 703 can be determined as a two-hop associated entity of entity 702. And the minimum associated edges between entity 702 and entity 704 are three (i.e., associated edge 706, associated edge 707, and associated edge 708), so entity 704 can be determined as a three-hop associated entity of entity 702. If a four-hop associated entity is determined based on the requirement, since the minimum associated edges between entity 702 and entity 705 are four (i.e., associated edge 706, associated edge 707, associated edge 708, and associated edge 709), entity 705 can be determined as a four-hop associated entity of entity 702. The methods for determining associated entities for other entities are similar to the above examples and will not be described one by one here.

[0096] It can be understood that the examples of the embodiments of the present application are only used to understand the present solution and should not be understood as specific limitations of the present solution.

[0097] In this embodiment, the corresponding associated entities with one hop, two hops, and three hops between the entity to be updated are determined by the number of hops of the associated edges with the entity to be updated, so that the associated entities can more comprehensively and accurately describe the relevant information between the entity to be updated, thereby ensuring that the target type is determined through more accurate and complete information, and improving the completeness and accuracy of the update of entity types in the knowledge graph through accurate and complete target types.

[0098] Since the embodiment of the present application specifically updates the entity type of the entity in the knowledge graph, and since the graph can include more dimensions and more fine-grained data, but considering the problem of large data processing volume based on the entire graph, in one embodiment, Figure 8 As shown, entity type prediction is performed based on the entity type to be updated and the associated attribute information corresponding to the associated entity to determine the probability that the entity to be updated belongs to multiple preset entity types, and the target entity type of the entity to be updated is determined based on the probability that the entity to be updated belongs to multiple preset entity types, including:

[0099] Step 802: construct an association subgraph through the entity to be updated and the associated entity. The association subgraph includes at least: a first entity node corresponding to the entity to be updated, a second entity node corresponding to the associated entity, and entity association edges connecting the entity nodes, where the entity association edges correspond to the association edges.

[0100] Among them, the associated subgraph at least includes: a first entity node corresponding to the entity to be updated, a second entity node corresponding to the associated entity, and an entity association edge connecting the entity nodes, and the entity association edge corresponds to the association edge. Since the entity association edge corresponds to the association edge, that is, there is an entity association edge between the entity nodes, it means that there is an association relationship between the entities corresponding to the entity nodes. Secondly, it can be seen from the aforementioned embodiments that there may be more than one entity in the knowledge graph that has an associated edge with the entity to be updated. Therefore, the associated entity is composed of at least one entity that has an associated edge with the entity to be updated. Then the second entity node corresponding to the associated entity specifically includes: at least one entity node that has an entity association edge with the first entity node.

[0101] Specifically, after determining the entity to be updated and the associated entity, the server can construct an associated subgraph through the entity to be updated and the associated entity, and since the associated entity is composed of at least one entity having an associated edge with the entity to be updated, the server specifically constructs an associated subgraph through the entity to be updated, the associated entity, and the associated relationship between the entity to be updated and the associated entity. That is, the server constructs a first entity node based on the entity to be updated, and then constructs a second entity node based on the associated entity having an associated relationship with the entity to be updated, and then specifically considers the associated edge between the entity to be updated and the associated entity to form an entity association edge connecting the entity nodes.

[0102] Further, based on the above-mentioned embodiments, it can be known that in the embodiments of the present application, one hop to three hops are specifically used as the association of the entity, that is, the association entity can specifically include one of the one-hop association entity, the two-hop association entity and the three-hop association entity, or a combination of multiple thereof. Based on this, the second entity node corresponding to the association entity at least includes the second entity node corresponding to the one-hop association entity, the second entity node corresponding to the two-hop association entity and the second entity node corresponding to the three-hop association entity.

[0103] For ease of understanding, the following description is given by taking the example that the association entity specifically includes a one-hop association entity, a two-hop association entity, and a three-hop association entity. Fig. 9 As shown, Fig. 9 The figure (A) shows a knowledge graph, and the knowledge graph includes the entity to be updated 901, and the associated entities 9021, 9022, 9023, 9024 that have associated edges with the entity to be updated 901, and the entity 903 that has no associated relationship with the entity to be updated 901, and the entity 904 that has an associated relationship with the entity to be updated 901 greater than three hops. Based on this, based on the entity to be updated 901, a knowledge graph is constructed. Fig. 9 The first entity node 905 in the figure (B) is constructed based on the associated entity 9021, the associated entity 9022, the associated entity 9023, and the associated entity 9024. Fig. 9 In the figure (B), the second entity node 9061, the second entity node 9062, the second entity node 9063, and the second entity node 9064 are shown. Considering the associated edges between the entity 901 to be updated and the associated entities 9021, 9022, 9023, and 9024, the first entity node 905 is connected with the second entity node 9061, 9062, 9063, and 9064, so as to obtain a complete and accurate Fig. 9 The associated subgraph shown in Figure (B).

[0104] Step 804: perform information encoding processing on the associated subgraphs to determine a second splicing feature.

[0105] Among them, similar to the above-mentioned embodiment, the information encoding process is specifically: using a preset encoding method to encode the data information to obtain the encoded features corresponding to the data information, and different encoding methods can be adapted to different application scenarios and different machine vision tasks.

[0106] Specifically, the server uses GNN as an encoder to perform information encoding processing on the associated subgraph to determine the second splicing feature. Based on this, taking the use of GNN as an encoder to perform information encoding processing on the associated subgraph as an example, as shown in formula (1):

[0107] Embedding = GNN(subgraph) (1);

[0108] Among them, Embedding is the second splicing feature, subgraph is the associated subgraph, and GNN is the encoder that encodes information on the associated subgraph.

[0109] It is understandable that in practical applications, the server may also use CNN, LSTM or other models as encoders to perform information encoding processing on the associated subgraphs to determine the second splicing feature. The embodiment of the present application does not limit the specific manner of performing information encoding processing on the associated subgraphs.

[0110] Step 806: Perform classification processing based on the second concatenation feature to determine the probability that the entity to be updated belongs to multiple preset entity types, and determine the target entity type based on the probability that the entity to be updated belongs to multiple preset entity types, the target entity type includes at least one entity type.

[0111] Among them, the target entity type includes at least one entity type, which is similar to the description of the aforementioned embodiment and will not be repeated here. Specifically, the server performs classification processing based on the second splicing feature to determine the probability that the entity to be updated belongs to multiple preset entity types, and determines the target entity type based on the probability that the entity to be updated belongs to multiple preset entity types, that is, the server performs classification processing based on the second splicing feature to determine the probability that the entity to be updated belongs to multiple preset entity types, and then the server determines the target entity type by the probability that the entity to be updated belongs to multiple preset entity types. Therefore, similar to the aforementioned embodiment, the server can determine the preset entity type with a probability greater than the classification threshold as an entity type constituting the target entity type. Alternatively, the server sorts the probabilities that the entity to be updated belongs to multiple preset entity types, and then selects the preset entity type with a larger probability to constitute the target entity type. The specific determination method is similar to that described in the aforementioned embodiment and will not be repeated here.

[0112] In this embodiment, because there are many edges associated with entities, the information of the entities to be updated, the associated entities and the associated relationships can be more concentrated and concise by constructing an associated subgraph, and the introduction of redundant information can be avoided, so that the associated subgraph contains the most critical information about the association between entities. Therefore, information encoding processing of the associated subgraph can obtain more accurate and complete features, thereby improving the accuracy of classification. Based on accurate classification results, the completeness and accuracy of updating entity types in the knowledge graph can be further improved.

[0113] As mentioned in the above embodiments, the information encoding process of the sub-graph is performed by the encoder, so the classifier is also required to perform classification in the actual classification process, which will be described in detail below: In one embodiment, Fig.10 As shown, information encoding processing is performed on the associated subgraph to determine the second splicing feature, including:

[0114] Step 1002: perform information encoding processing on the associated subgraph through an encoder in the entity type recognition model to output a second splicing feature.

[0115] The encoder may be a GNN, a CNN, or a LSTM model, which is not limited here. Secondly, the entity type recognition model is obtained through training, and the training process of the entity type recognition model will be introduced in detail in the subsequent embodiments.

[0116] Specifically, the server performs information encoding processing on the associated subgraph through the encoder in the entity type recognition model to output the second splicing feature. That is, the server inputs the associated subgraph into the encoder in the entity type recognition model, and then performs information encoding processing on the associated subgraph through the encoder, and outputs the second splicing feature.

[0117] Based on this, classification processing is performed based on the second concatenated feature to determine the probability that the entity to be updated belongs to multiple preset entity types, and the target entity type is determined based on the probability that the entity to be updated belongs to multiple preset entity types, including:

[0118] Step 1004, a classifier in the entity type recognition model performs classification processing based on the second concatenated feature to determine the probability that the entity to be updated belongs to multiple preset entity types, and determines the target entity type based on the probability that the entity to be updated belongs to multiple preset entity types.

[0119] Among them, the classifier is a multi-classification classifier, that is, the classifier in the embodiment of the present application is used to output the probability that the data information belongs to each category. Specifically, the server performs classification processing based on the second splicing feature through the classifier in the entity type recognition model to determine the probability that the entity to be updated belongs to multiple preset entity types, and determines the target entity type based on the probability that the entity to be updated belongs to multiple preset entity types. That is, the server inputs the second splicing feature into the classifier in the entity type recognition model, and then classifies the entity to be updated based on the second splicing feature through the classifier, that is, the classifier outputs the probability that the entity to be updated belongs to multiple preset entity types. Based on the aforementioned embodiment, it can be known that the aforementioned preset entity type can be an entity type included in the knowledge graph, or it can be an entity type set based on the application scenario.

[0120] Exemplarily, the probability that the classifier outputs that the entity to be updated belongs to multiple preset entity types is specifically as shown in formula (2):

[0121] a i =classifier(Embedding) (2);

[0122] Among them, a i is the probability that the entity to be updated belongs to multiple preset entity types, Embedding is the second concatenated feature, and classifier is the classifier.

[0123] Based on this, the server can determine the preset entity type with a probability greater than the classification threshold as an entity type constituting the target entity type. Alternatively, the server sorts the probabilities that the entity to be updated belongs to multiple preset entity types, and then selects the preset entity type with a larger probability to constitute the target entity type. The details are similar to those described in the above embodiment and will not be repeated here.

[0124] In this embodiment, the encoder performs information encoding processing on the associated subgraph to output a second splicing feature, and then the classifier performs classification processing based on the second splicing feature to determine the probability that the entity to be updated belongs to multiple preset entity types, and the target entity type is determined based on the probability that the entity to be updated belongs to multiple preset entity types, so as to ensure the feasibility of the information encoding processing and classification processing, and the classification prediction of the entity type recognition model obtained through training can obtain the classification result more efficiently and accurately, thereby ensuring the reliability and accuracy of the determined target entity type, and can also further improve the completeness and accuracy of the update of entity types in the knowledge graph.

[0125] The following describes in detail how to perform information encoding processing on the associated subgraph by the encoder: In one embodiment, Fig.11 As shown, the encoder in the entity type recognition model performs information encoding processing on the associated subgraph to output a second concatenation feature, including:

[0126] Step 1102: perform information encoding processing on the first entity node and the second entity node in the associated subgraph by using an encoder to obtain a first node feature of the first entity node and a second node feature of the second entity node.

[0127] The first node feature is specifically: the feature information corresponding to the entity attribute information of the node to be updated corresponding to the first entity node, so the first node feature at least includes: the entity type feature of the node to be updated, and the entity description information feature of the node to be updated. Similarly, the second node feature is specifically: the feature information corresponding to the associated attribute information of the associated node corresponding to the second entity node, so the second node feature at least includes: the entity type feature of the associated node, and the associated information feature of the associated node related to the entity type.

[0128] Specifically, the server performs information encoding processing on the first entity node and the second entity node in the associated subgraph through an encoder, that is, the encoder first performs information encoding processing on the entity attribute information of the node to be updated and the associated attribute information of the associated node, thereby obtaining the first node feature and the second node feature.

[0129] Step 1104, the entity association edge in the association subgraph is encoded by an encoder to obtain entity association features of the entity association edge, and the entity association features are used to describe: node features of the two associated entity nodes, node features of the two associated entity nodes and other entity nodes with association relationships in the association subgraph, and association relationship features of the two associated entity nodes in the association subgraph.

[0130] The entity association feature is used to describe: the node features of the two associated entity nodes, the node features of the two associated entity nodes and other entity nodes with an association relationship in the association subgraph, and the association relationship features of the two associated entity nodes in the association subgraph. Since the entity association edge is used to connect two entity nodes, and the entity association edge corresponds to the association edge, the entities connected by the association edge have an association relationship.

[0131] Specifically, in the process of performing information encoding processing on the entity association feature, the server can not only consider the association relationship between the two entities associated with the entity association edge in the association subgraph, but also consider the entity attribute information of the two entity nodes associated with the entity association edge, and further consider the entity attribute information of the two entity nodes associated with the entity association edge and other entity nodes with an association relationship in the association subgraph. That is, the server performs information encoding processing on the association relationship between the two entities associated with the entity association edge in the association subgraph, performs information encoding processing on the entity attribute information of the two entity nodes associated with the entity association edge, and further performs information encoding processing on the entity attribute information of the two entity nodes associated with the entity association edge in the association subgraph and other entity nodes with an association relationship, so as to obtain the entity association feature of the entity association edge.

[0132] Based on this, the entity association feature may include at least the following information: the association relationship between the entity to be updated and the associated entity in the association subgraph, the entity attribute information corresponding to the associated entity associated with the entity to be updated, and the association relationship between the associated entities.

[0133] Step 1106, determining a second splicing feature based on the first node feature, the second node feature and the entity association feature.

[0134] Specifically, the server performs feature splicing processing on the first node feature, the second node feature and the entity association feature to obtain a second splicing feature.

[0135] In this embodiment, by encoding the entity nodes and entity-related edges separately, multi-dimensional information can be encoded in a more fine-grained manner to extract more complete and accurate features, thereby improving the integrity and reliability of the obtained second splicing features, and thereby improving the integrity and accuracy of the update of entity types in the knowledge graph.

[0136] Based on the above embodiments, it is known that it is necessary to perform information encoding processing through the encoder in the entity type recognition model and to perform classification processing through the classifier in the entity type recognition model. Therefore, the following will introduce how to train an entity type recognition model with information encoding processing capabilities and classification processing capabilities: In one embodiment, Fig.12 As shown, the method for obtaining the entity type recognition model includes:

[0137] Step 1202, obtain a knowledge graph sample and a preset entity type set, the knowledge graph sample includes multiple entity samples, the entity samples have corresponding entity types, and the preset entity type set includes multiple preset entity types.

[0138] Among them, the knowledge graph sample includes multiple entity samples, the entity samples have corresponding entity types, and the preset entity type set includes multiple preset entity types. The entity type recognition model is specifically a supervised model, so sample training data is required, that is, the training data is constructed based on the existing knowledge graph in the embodiment of the present application, that is, the knowledge graph sample is specifically an existing knowledge graph, and the entity type corresponding to each entity sample in the knowledge graph sample is a type that has been marked and confirmed in the existing knowledge graph, thereby effectively reducing labor costs. Secondly, the preset entity type set includes multiple preset entity types, and the aforementioned preset entity type set can be all entity types included in the knowledge graph sample. For example, the preset entity type set includes at least: actors, singers, doctors, food, animals, etc. It can be understood that the preset entity type set can also be all entity types set based on the application scenario, which is not limited here.

[0139] Specifically, the server constructs a knowledge graph sample based on the existing knowledge graph, and constructs a preset entity type set through multiple preset entity types. Similar to the aforementioned embodiment, the server can obtain a knowledge graph after performing manual data processing on the entity type and other related information of the entity through manual editing or manual review, and then the server obtains the existing knowledge graph through communication between the terminal and the server, and determines the existing knowledge graph as a knowledge graph sample. Based on this, the server can further construct a preset entity type set through all entity types included in the knowledge graph sample.

[0140] Alternatively, after the data storage system stores the existing knowledge graph, when entity type recognition model training is needed, the server obtains the stored knowledge graph from the data storage system and converts the knowledge graph into a knowledge graph sample. Based on this, the server can further construct a preset entity type set through all entity types included in the knowledge graph sample.

[0141] Step 1204: Based on the knowledge graph samples, determine the associated entity samples that have associated edges with each entity sample.

[0142] Among them, the associated edge is used to describe the existence of an association relationship between entities, and there is an associated edge between the entity sample and the associated entity sample, that is, there is an association relationship between the entity sample and the associated entity sample, and there may be more than one entity with an associated edge with each entity sample in the knowledge graph sample, so the associated entity sample is composed of at least one entity that has an associated edge with the entity sample.

[0143] Specifically, since there are associated edges between entity samples with associated relationships in the knowledge graph sample, the server determines the entities with associated edges with each entity sample in the knowledge graph sample as associated entity samples, that is, each entity sample in the associated entity sample has an associated relationship with the entity sample. The associated entity sample is similar to the associated entity introduced in the aforementioned embodiment, and will not be described in detail here.

[0144] Step 1206: Based on the entity type of each entity sample and the associated attribute information corresponding to the associated entity sample of each entity sample, the probability that each entity sample belongs to each preset entity type is output through the initial entity type recognition model.

[0145] Specifically, the server uses the entity type of each entity sample and the associated attribute information corresponding to the associated entity sample of each entity sample as the input of the initial entity type recognition model, and the initial entity type recognition model outputs the probability that each entity sample belongs to each preset entity type. It can be seen from the above-mentioned embodiment that the server actually needs to first construct the associated subgraph sample corresponding to each entity sample through each entity sample and the associated entity sample of each entity sample, and then use the encoder in the initial entity type recognition model to encode the row information of the associated subgraph sample corresponding to each entity sample to output the splicing feature sample corresponding to each entity sample, and then the classifier in the initial entity type recognition model classifies the splicing feature sample corresponding to each entity sample, and specifically obtains the probability that each entity sample belongs to each preset entity type through the classifier output.

[0146] Step 1208: Based on the probability that each entity sample belongs to each preset entity type and the entity type corresponding to each entity sample, adjust the model parameters of the initial entity type recognition model to obtain an entity type recognition model.

[0147] Specifically, based on the probability that each entity sample belongs to each preset entity type and the entity type corresponding to each entity sample, the model parameters of the initial entity type recognition model are adjusted to obtain the entity type recognition model. That is, the server calculates the loss value based on the probability that each entity sample belongs to each preset entity type and the entity type corresponding to each entity sample, and then adjusts the model parameters of the initial entity type recognition model according to the loss value. Thus, the server can judge whether the loss function of the initial entity type recognition model meets the convergence condition according to the loss value. If the convergence condition is not met, the model parameters of the initial entity type recognition model are adjusted using the loss value.

[0148] Based on this, until the loss function of the initial entity type recognition model reaches the convergence condition, the entity type recognition model is obtained according to the model parameters obtained after the model parameters of the initial entity type recognition model are adjusted for the last time. In practical applications, the entity type recognition model obtained through training performs type recognition on the entity to be updated to determine the target entity type of the entity to be updated.

[0149] The model parameters of the initial entity type recognition model are adjusted based on the cross entropy loss value, which is calculated based on the probability that each entity sample belongs to each preset entity type and the entity type corresponding to each entity sample. That is, the server specifically calculates the probability that each entity sample belongs to each preset entity type and the entity type corresponding to each entity sample based on the cross entropy loss function to obtain the cross entropy loss value, and then adjusts the model parameters of the initial entity type recognition model through the cross entropy loss value in a similar manner as described above until the entity type recognition model is obtained.

[0150] The above cross entropy loss function is specifically shown in formula (3):

[0151]

[0152] Among them, Loss cls1 is the cross entropy loss value, a i is the probability that the entity sample belongs to each preset entity type, y i is the entity type corresponding to the entity sample, and i is used to indicate the entity sample.

[0153] In this embodiment, during the training process of the entity type recognition model, the type of the entity sample is predicted by the entity type of the entity sample itself, the entity type of the associated entity sample and the associated information related to the entity type, so that the entity type recognition model can learn how to better encode and classify information, thereby ensuring the robustness and reliability of the entity type recognition model. Therefore, the determination of the target entity type through the entity type recognition model can further ensure the reliability of the entity type, thereby improving the completeness and accuracy of the update of the entity type in the knowledge graph.

[0154] In one embodiment, Fig.13 As shown, the entity type to be updated is updated based on the target entity type, including:

[0155] Step 1302, determining the entity type confidence corresponding to each entity type in the target entity type, where the entity type confidence is a parameter used to evaluate whether the entity type is a correct entity type that describes the entity to be updated.

[0156] Among them, the entity type confidence is: a parameter used to evaluate whether the entity type is a correct description of the entity type to be updated. Therefore, the entity type confidence can be that the entity type is credible, or that the entity type is not credible. For example, if the entity type confidence is "0", it means that the entity type is not credible, that is, the entity type is an incorrect entity type. Similarly, if the entity type confidence is "1", it means that the entity type is credible, that is, the entity type is a correct entity type. It can be understood that the entity type confidence can also be described in a probabilistic form, that is, the entity type confidence can be used to describe the probability that the entity type is a correct entity type, which is not limited here.

[0157] Specifically, the server determines the entity type confidence corresponding to each entity type in the target entity type. For example, taking the entity type confidence of "0" and "1" as an example, the target entity type includes entity type B1, entity type B2, entity type B3 and entity type B4, and the entity type confidence of entity type B1 is "0", the entity type confidence of entity type B2 is "1", the entity type confidence of entity type B3 is "1", and the entity type confidence of entity type B4 is "1". It can be seen that entity type B1 is an incorrect entity type, entity type B2 is a normal entity type, entity type B3 is a normal entity type, and entity type B4 is a normal entity type.

[0158] Step 1304 : Determine a confident entity type from the target entity types based on the confidence of each entity type.

[0159] The trusted entity type may be composed of: entity types whose entity type confidence describes trustworthiness, or entity types whose entity type confidence is greater than a confidence threshold. Specifically, the server determines the trusted entity type from the target entity type based on the entity type confidence of each entity type in the target entity type.

[0160] Exemplarily, the entity type confidences of "0" and "1" are used as examples for explanation. As in the above example, the entity type confidence of entity type B1 is "0", the entity type confidence of entity type B2 is "1", the entity type confidence of entity type B3 is "1", and the entity type confidence of entity type B4 is "1". Based on this, a confident entity type can be constructed through entity type B2, entity type B3, and entity type B4 whose entity type confidences are "1".

[0161] Alternatively, the entity type confidence is used to describe the probability that the entity type is the correct entity type, and the confidence threshold is 60%. If the entity type confidence of entity type B1 is "40%", the entity type confidence of entity type B2 is "70%", the entity type confidence of entity type B3 is "80%", and the entity type confidence of entity type B4 is "90%", based on this, a confident entity type can be constructed through entity types B2, B3 and B4 whose entity type confidences are greater than the confidence threshold.

[0162] Step 1306: Update the entity type to be updated based on the trusted entity type.

[0163] Specifically, the server updates the entity type to be updated based on the trusted entity type. That is, the server can directly replace the entity type to be updated of the entity to be updated with the trusted entity type, or the server determines the entity type to be deleted from the entity type to be updated based on the trusted entity type, and determines the newly added entity type from the trusted entity type, adds the newly added entity type to the entity type to be updated, and deletes the entity type to be deleted from the entity type to be updated. The specific implementation method is similar to the method of updating the entity type to be updated based on the target entity type in the aforementioned embodiment, and will not be repeated here.

[0164] In this embodiment, the entity type confidence is used to evaluate whether each entity type in the target entity type can be accurately described as a correct entity type, that is, the target entity type is adjusted and updated according to the accuracy of the entity type itself, and the entity type is updated through the confidence entity type with higher accuracy to improve the accuracy of the entity type update.

[0165] Based on the detailed description of the above embodiments, the complete process of the method for updating entity types in the knowledge graph in the embodiments of the present application will be described below. In one embodiment, Fig.14 As shown in the figure, a method for updating entity types in a knowledge graph is provided, and this method is applied to Figure 1 The server 104 in the example is used for explanation. It is understandable that the method can also be applied to the terminal 102, and can also be applied to a system including the terminal 102 and the server 104, and is implemented through the interaction between the terminal 102 and the server 104. In this embodiment, the method includes the following steps:

[0166] Step 1401, obtain the knowledge graph.

[0167] Among them, the knowledge graph is composed of the relationship between entities. Each entity has corresponding entity attribute information, which includes at least entity type and entity description information. The entity type is specifically used to describe the type information of the entity, and the classification of the specific type information needs to be determined based on the actual situation and the construction requirements of the knowledge graph. The entity description information is information that describes the entity from multiple dimensions.

[0168] Specifically, when there is a need to update the entity type of an entity in the knowledge graph, the server first obtains the knowledge graph. That is, the knowledge graph can be obtained by manual data processing of the entity type and other related information through manual editing or manual review, and then the server obtains the knowledge graph through communication between the terminal and the server. Alternatively, after the data storage system stores the constructed knowledge graph, when the entity type of the entity in the knowledge graph needs to be updated, the server obtains the stored knowledge graph from the data storage system.

[0169] Secondly, since the knowledge graph is a structured semantic knowledge base, the knowledge graph of the embodiment of the present application can be a "general knowledge graph" for constructing structured encyclopedic knowledge, or a "domain knowledge graph" constructed and applied based on industry data. And in practical applications, the knowledge graph can still be obtained by updating the entity type through data mining based on tabular / encyclopedic web pages. Therefore, the knowledge graph and the specific method of obtaining the knowledge graph are not limited here.

[0170] Step 1402: Determine, from the knowledge graph, related entities that have associated edges with the entity to be updated.

[0171] Among them, the association edge is used to describe the existence of an association relationship between entities, and there is an association edge between the associated entity and the entity to be updated, that is, there is an association relationship between the associated entity and the entity to be updated, and there may be more than one entity with an association edge with the entity to be updated in the knowledge graph, so the associated entity is composed of at least one entity with an association edge with the entity to be updated. The association relationship between entities is specifically used to: describe the relationship between entities, the aforementioned relationship can be a relationship between events, concepts, conditions, actions and objects, and similar entity types or entity description information can exist in the entity attribute information corresponding to the entities with association relationships.

[0172] Specifically, since there will be associated edges between entities that have an associated relationship in the knowledge graph, after the server determines the entity to be updated from the knowledge graph, it will determine the entity that has an associated edge with the entity to be updated as the associated entity, that is, each entity in the associated entity has an associated relationship with the entity to be updated.

[0173] Step 1403: construct an associated subgraph through the entity to be updated and the associated entities.

[0174] The associated subgraph at least includes: a first entity node corresponding to the entity to be updated, a second entity node corresponding to the associated entity, and entity associated edges connecting the entity nodes, and the entity associated edges correspond to the associated edges. Since the entity associated edges correspond to the associated edges, that is, the entity associated edges exist between the entity nodes, that is, there is an associated relationship between the entities corresponding to the entity nodes.

[0175] Specifically, after determining the entity to be updated and the associated entity, the server can construct an associated subgraph through the entity to be updated and the associated entity, and since the associated entity is composed of at least one entity having an associated edge with the entity to be updated, the server specifically constructs an associated subgraph through the entity to be updated, the associated entity, and the associated relationship between the entity to be updated and the associated entity. That is, the server constructs a first entity node based on the entity to be updated, and then constructs a second entity node based on the associated entity having an associated relationship with the entity to be updated, and then specifically considers the associated edge between the entity to be updated and the associated entity to form an entity association edge connecting the entity nodes.

[0176] Step 1404: perform information encoding processing on the first entity node and the second entity node in the associated subgraph through the encoder in the entity type recognition model to obtain a first node feature of the first entity node and a second node feature of the second entity node.

[0177] The first node feature is specifically: the feature information corresponding to the entity attribute information of the node to be updated corresponding to the first entity node, so the first node feature at least includes: the entity type feature of the node to be updated, and the entity description information feature of the node to be updated. Similarly, the second node feature is specifically: the feature information corresponding to the associated attribute information of the associated node corresponding to the second entity node, so the second node feature at least includes: the entity type feature of the associated node, and the associated information feature of the associated node related to the entity type.

[0178] Specifically, the server performs information encoding processing on the first entity node and the second entity node in the associated subgraph through an encoder, that is, the encoder first performs information encoding processing on the entity attribute information of the node to be updated and the associated attribute information of the associated node, thereby obtaining the first node feature and the second node feature.

[0179] Step 1405 , the encoder in the entity type recognition model performs information encoding processing on the entity association edges in the association subgraph to obtain entity association features of the entity association edges.

[0180] The entity association feature is used to describe: the node features of the two associated entity nodes, the node features of the two associated entity nodes and other entity nodes with an association relationship in the association subgraph, and the association relationship features of the two associated entity nodes in the association subgraph. Since the entity association edge is used to connect two entity nodes, and the entity association edge corresponds to the association edge, the entities connected by the association edge have an association relationship.

[0181] Specifically, in the process of performing information encoding processing on the entity association feature, the server can not only consider the association relationship between the two entities associated with the entity association edge in the association subgraph, but also consider the entity attribute information of the two entity nodes associated with the entity association edge, and further consider the entity attribute information of the two entity nodes associated with the entity association edge and other entity nodes with an association relationship in the association subgraph. That is, the server performs information encoding processing on the association relationship between the two entities associated with the entity association edge in the association subgraph, performs information encoding processing on the entity attribute information of the two entity nodes associated with the entity association edge, and further performs information encoding processing on the entity attribute information of the two entity nodes associated with the entity association edge in the association subgraph and other entity nodes with an association relationship, so as to obtain the entity association feature of the entity association edge.

[0182] Based on this, the entity association feature may include at least the following information: the association relationship between the entity to be updated and the associated entity in the association subgraph, the entity attribute information corresponding to the associated entity associated with the entity to be updated, and the association relationship between the associated entities.

[0183] Step 1406, determining a second splicing feature based on the first node feature, the second node feature and the entity association feature.

[0184] Specifically, the server performs feature splicing processing on the first node feature, the second node feature and the entity association feature to obtain a second splicing feature.

[0185] Step 1407, performing classification processing based on the second concatenated feature by a classifier in the entity type recognition model to determine the probability that the entity to be updated belongs to multiple preset entity types, and determining the target entity type based on the probability that the entity to be updated belongs to multiple preset entity types.

[0186] Among them, the classifier is a multi-classification classifier, that is, the classifier in the embodiment of the present application is used to output the probability that the data information belongs to each category. Specifically, the server performs classification processing based on the second splicing feature through the classifier in the entity type recognition model to determine the probability that the entity to be updated belongs to multiple preset entity types, and determines the target entity type based on the probability that the entity to be updated belongs to multiple preset entity types. That is, the server inputs the second splicing feature into the classifier in the entity type recognition model, and then classifies the entity to be updated based on the second splicing feature through the classifier, that is, the classifier outputs the probability that the entity to be updated belongs to multiple preset entity types. Based on the aforementioned embodiment, it can be known that the aforementioned preset entity type can be an entity type included in the knowledge graph, or it can be an entity type set based on the application scenario.

[0187] Step 1408, determining the entity type confidence corresponding to each entity type in the target entity type.

[0188] The entity type confidence is a parameter used to evaluate whether the entity type is a correct description of the entity to be updated, and thus the entity type confidence can be that the entity type is credible or that the entity type is not credible. Specifically, the server determines the entity type confidence corresponding to each entity type in the target entity type.

[0189] Step 1409 , based on the confidence of each entity type, determine a confident entity type from the target entity types.

[0190] The trusted entity type may be composed of: entity types whose entity type confidence describes trustworthiness, or entity types whose entity type confidence is greater than a confidence threshold. Specifically, the server determines the trusted entity type from the target entity type based on the entity type confidence of each entity type in the target entity type.

[0191] Step 1410: Update the entity type to be updated based on the trusted entity type.

[0192] Specifically, the server updates the entity type to be updated based on the trusted entity type. That is, the server can directly replace the entity type to be updated of the entity to be updated with the trusted entity type, or the server determines the entity type to be deleted from the entity type to be updated based on the trusted entity type, determines the newly added entity type from the trusted entity type, adds the newly added entity type to the entity type to be updated, and deletes the entity type to be deleted from the entity type to be updated.

[0193] It should be understood that the specific implementations of step 1401 to step 1410 are similar to those in the aforementioned embodiment and will not be described in detail here.

[0194] It should be understood that, although the steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0195] Based on the same inventive concept, the embodiment of the present application also provides a device for updating entity types in a knowledge graph for implementing the above-mentioned method for updating entity types in a knowledge graph. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in the embodiments of the device for updating entity types in one or more knowledge graphs provided below can be referred to the limitations of the method for updating entity types in the knowledge graph above, and will not be repeated here.

[0196] In one embodiment, Fig.15 As shown, a device for updating entity types in a knowledge graph is provided, comprising: a knowledge graph acquisition module 1502, an associated entity determination module 1504, an entity type determination module 1506 and an entity type update module 1508, wherein:

[0197] The knowledge graph acquisition module 1502 is used to acquire the knowledge graph, where the knowledge graph includes entities to be updated, and the entities to be updated have corresponding entity types to be updated;

[0198] The associated entity determination module 1504 is used to determine, from the knowledge graph, an associated entity that has an associated edge with the entity to be updated, where the associated edge is used to describe the association relationship between the entities;

[0199] An entity type determination module 1506 is used to predict the entity type based on the entity type to be updated and the associated attribute information corresponding to the associated entity, so as to determine the probability that the entity to be updated belongs to a plurality of preset entity types, and determine the target entity type of the entity to be updated based on the probability that the entity to be updated belongs to a plurality of preset entity types, wherein the associated attribute information at least includes: the entity type of the associated entity and the associated information related to the entity type;

[0200] The entity type updating module 1508 is used to update the entity type to be updated based on the target entity type.

[0201] In one embodiment, the entity type determination module 1506 is specifically used to perform information encoding processing on the entity type to be updated, the associated attribute information, and the associated relationship described by the associated edge to determine the first splicing feature; perform classification processing based on the first splicing feature to determine the probability that the entity to be updated belongs to multiple preset entity types, and determine the target entity type based on the probability that the entity to be updated belongs to multiple preset entity types, and the target entity type includes at least one entity type.

[0202] In one embodiment, the entity type determination module 1506 is specifically used to construct an associated subgraph through the entity to be updated and the associated entities, the associated subgraph at least including: a first entity node corresponding to the entity to be updated, a second entity node corresponding to the associated entity, and an entity association edge connecting the entity nodes, the entity association edge corresponds to the association edge; perform information encoding processing on the associated subgraph to determine a second splicing feature; perform classification processing based on the second splicing feature to determine the probability that the entity to be updated belongs to multiple preset entity types, and determine the target entity type based on the probability that the entity to be updated belongs to multiple preset entity types, the target entity type includes at least one entity type.

[0203] In one embodiment, the entity type determination module 1506 is specifically used to perform information encoding processing on the associated subgraph through an encoder in the entity type recognition model to output a second splicing feature; perform classification processing based on the second splicing feature through a classifier in the entity type recognition model to determine the probability that the entity to be updated belongs to multiple preset entity types, and determine the target entity type based on the probability that the entity to be updated belongs to multiple preset entity types.

[0204] In one embodiment, the entity type determination module 1506 is specifically used to perform information encoding processing on the first entity node and the second entity node in the associated subgraph through an encoder to obtain a first node feature of the first entity node and a second node feature of the second entity node; perform information encoding processing on the entity association edge in the associated subgraph through an encoder to obtain an entity association feature of the entity association edge, and the entity association feature is used to describe: the node features of the two associated entity nodes, the node features of the two associated entity nodes and other entity nodes with an association relationship in the associated subgraph, and the association relationship features of the two associated entity nodes in the associated subgraph; based on the first node feature, the second node feature and the entity association feature, determine the second splicing feature.

[0205] In one embodiment, Fig.16 As shown, the updating device of entity types in the knowledge graph further includes: a model acquisition module 1602;

[0206] The model acquisition module 1602 is used to acquire a knowledge graph sample and a preset entity type set, wherein the knowledge graph sample includes a plurality of entity samples, the entity sample has a corresponding entity type, and the preset entity type set includes a plurality of preset entity types; based on the knowledge graph sample, determine the associated entity samples having associated edges with each entity sample; based on the entity type of each entity sample and the associated attribute information corresponding to the associated entity sample of each entity sample, output the probability that each entity sample belongs to each preset entity type through the initial entity type recognition model; based on the probability that each entity sample belongs to each preset entity type and the entity type corresponding to each entity sample, adjust the model parameters of the initial entity type recognition model to obtain the entity type recognition model;

[0207] Among them, the model parameters of the initial entity type recognition model are adjusted based on the cross entropy loss value, and the cross entropy loss value is calculated based on the probability that each entity sample belongs to each preset entity type and the entity type corresponding to each entity sample.

[0208] In one embodiment, the associated entity determination module 1504 is specifically used to determine from the knowledge graph a one-hop associated entity that has one associated edge with the entity to be updated; determine from the knowledge graph a two-hop associated entity that has two associated edges with the entity to be updated; and determine from the knowledge graph a three-hop associated entity that has three associated edges with the entity to be updated; wherein the associated entities include at least: a one-hop associated entity, a two-hop associated entity, and a three-hop associated entity.

[0209] In one embodiment, the entity type update module 1508 is specifically used to determine the entity type confidence corresponding to each entity type in the target entity type, where the entity type confidence is: a parameter used to evaluate whether the entity type is a correct description of the entity type to be updated; based on the confidence of each entity type, determine the confident entity type from the target entity type; and update the entity type to be updated based on the confident entity type.

[0210] Each module in the above-mentioned updating device of entity types in the knowledge graph can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0211] In one embodiment, a computer device is provided. The computer device may be a server or a terminal. In this embodiment, the computer device is a server as an example for explanation. The internal structure diagram thereof may be as follows: Fig.17As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store relevant data such as knowledge graphs. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for updating entity types in a knowledge graph is implemented.

[0212] Those skilled in the art will understand that Fig.17 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0213] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0214] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0215] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0216] It should be noted that the object information (including but not limited to object device information, object personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the object or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0217] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0218] The technical feature information of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical feature information in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical feature information, they should be considered to be within the scope of this specification.

[0219] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for updating entity types in a knowledge graph, characterized in that: include: Acquire a knowledge graph, wherein the knowledge graph includes entities to be updated, and the entities to be updated have corresponding entity types to be updated; Determine, from the knowledge graph, an associated entity having an associated edge with the entity to be updated, wherein the associated edge is used to describe an associated relationship between entities; Entity type prediction is performed based on the entity type to be updated and the associated attribute information corresponding to the associated entity to determine the probability that the entity to be updated belongs to multiple preset entity types, and the target entity type of the entity to be updated is determined based on the probability that the entity to be updated belongs to multiple preset entity types, wherein the associated attribute information at least includes: the entity type of the associated entity and the associated information related to the entity type; The to-be-updated entity type is updated based on the target entity type.

2. The method according to claim 1, characterized in that The performing entity type prediction based on the entity type to be updated and the associated attribute information corresponding to the associated entity to determine the probability that the entity to be updated belongs to multiple preset entity types, and determining the target entity type of the entity to be updated based on the probability that the entity to be updated belongs to multiple preset entity types, includes: Performing information encoding processing on the entity type to be updated, the associated attribute information, and the associated relationship described by the associated edge to determine a first splicing feature; Classification processing is performed based on the first splicing feature to determine the probability that the entity to be updated belongs to multiple preset entity types, and the target entity type is determined based on the probability that the entity to be updated belongs to multiple preset entity types, and the target entity type includes at least one entity type.

3. The method according to claim 1, characterized in that: The performing entity type prediction based on the entity type to be updated and the associated attribute information corresponding to the associated entity to determine the probability that the entity to be updated belongs to multiple preset entity types, and determining the target entity type of the entity to be updated based on the probability that the entity to be updated belongs to multiple preset entity types, includes: Constructing an association subgraph through the entity to be updated and the associated entity, the association subgraph at least comprising: a first entity node corresponding to the entity to be updated, a second entity node corresponding to the associated entity, and an entity association edge connecting the entity nodes, the entity association edge corresponding to the association edge; Performing information encoding processing on the associated subgraph to determine a second splicing feature; Classification processing is performed based on the second splicing feature to determine the probability that the entity to be updated belongs to multiple preset entity types, and the target entity type is determined based on the probability that the entity to be updated belongs to multiple preset entity types, and the target entity type includes at least one entity type.

4. The method according to claim 3, characterized in that The performing information encoding processing on the associated subgraph to determine the second splicing feature includes: Performing information encoding processing on the associated subgraph through an encoder in an entity type recognition model to output the second splicing feature; The performing classification processing based on the second splicing feature to determine the target entity type includes: The target entity type is determined by performing classification processing based on the second concatenation feature through a classifier in the entity type recognition model.

5. The method according to claim 3, characterized in that: The performing information encoding processing on the associated subgraph by using an encoder in the entity type recognition model to output the second splicing feature includes: Performing information encoding processing on the first entity node and the second entity node in the associated subgraph by the encoder to obtain a first node feature of the first entity node and a second node feature of the second entity node; The encoder performs information encoding processing on the entity association edge in the association subgraph to obtain entity association features of the entity association edge, wherein the entity association features are used to describe: node features of the two associated entity nodes, node features of the two associated entity nodes in the association subgraph and other entity nodes with association relationships, and association relationship features of the two associated entity nodes in the association subgraph; The second splicing feature is determined based on the first node feature, the second node feature and the entity association feature.

6. The method according to claim 3, characterized in that The method for obtaining the entity type recognition model includes: Obtain a knowledge graph sample and a preset entity type set, wherein the knowledge graph sample includes a plurality of entity samples, the entity samples have corresponding entity types, and the preset entity type set includes a plurality of preset entity types; Based on the knowledge graph samples, determining associated entity samples having associated edges with each of the entity samples; Based on the entity type of each of the entity samples and the associated attribute information corresponding to the associated entity samples of each of the entity samples, outputting the probability that each of the entity samples belongs to each of the preset entity types through an initial entity type recognition model; Based on the probability that each of the entity samples belongs to each of the preset entity types and the entity type corresponding to each of the entity samples, adjusting the model parameters of the initial entity type recognition model to obtain the entity type recognition model; Among them, the adjustment of the model parameters of the initial entity type recognition model is performed based on the cross entropy loss value, and the cross entropy loss value is calculated based on the probability that each of the entity samples belongs to each of the preset entity types, and the entity type corresponding to each of the entity samples.

7. The method according to claim 1, characterized in that Determining, from the knowledge graph, an associated entity having an associated edge with the entity to be updated, includes: Determine, from the knowledge graph, a one-hop associated entity that has an associated edge with the entity to be updated; Determine, from the knowledge graph, a two-hop associated entity having two associated edges with the entity to be updated; Determine, from the knowledge graph, a three-hop associated entity having three associated edges with the entity to be updated; The associated entities at least include: the one-hop associated entity, the two-hop associated entity and the three-hop associated entity.

8. The method according to claim 1, characterized in that The updating of the to-be-updated entity type based on the target entity type comprises: Determine an entity type confidence corresponding to each entity type in the target entity type, wherein the entity type confidence is: a parameter used to evaluate whether the entity type is a correct entity type describing the entity to be updated; Determining a confident entity type from the target entity types based on the confidence of each entity type; The to-be-updated entity type is updated based on the trusted entity type.

9. A device for updating entity types in a knowledge graph, characterized in that: The device comprises: A knowledge graph acquisition module, used to acquire a knowledge graph, wherein the knowledge graph includes entities to be updated, and the entities to be updated have corresponding entity types to be updated; An associated entity determination module, used to determine, from the knowledge graph, an associated entity having an associated edge with the entity to be updated, wherein the associated edge is used to describe an associated relationship between entities; an entity type determination module, configured to predict the entity type based on the entity type to be updated and the associated attribute information corresponding to the associated entity, so as to determine the probability that the entity to be updated belongs to a plurality of preset entity types, and determine the target entity type of the entity to be updated based on the probability that the entity to be updated belongs to a plurality of preset entity types, wherein the associated attribute information at least includes: the entity type of the associated entity and the associated information related to the entity type; An entity type updating module is used to update the to-be-updated entity type based on the target entity type.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.

12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.

Citation Information

Cited By

  • Knowledge fusion method and system based on automatic metadata

    CN119476450A

  • Multi-modal reasoning crop management method, system, equipment and medium

    CN122200641A