Data processing method, device, equipment and storage medium

By calculating the correlation between entity and relational information in the knowledge graph and updating entity representation information, the problem of poor accuracy of entity representation information in the prior art is solved, and higher accuracy and interpretability are achieved.

CN112163095BActive Publication Date: 2025-04-25PEKING UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010981924.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-17
Publication Date
2025-04-25
Estimated Expiration
2040-09-17

AI Technical Summary

Technical Problem

When processing entity representation information in the knowledge graph, the prior art ignores the interpretability of the entity and relationship representation information, resulting in poor accuracy of entity representation information.

Method used

By obtaining entity information in the knowledge graph, including entity attribute information and relational information, the correlation of these information is calculated, and the entity representation information is updated based on the relevant information until the target conditions are met, the accuracy of entity representation information is improved.

Benefits of technology

By analyzing the correlation between relationship information and attribute information in a decoupled way, we can dig deeper into the relationship between entities and improve the accuracy and interpretability of entity representation information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112163095B_ABST
    Figure CN112163095B_ABST
Patent Text Reader

Abstract

The present application discloses a data processing method, device, equipment and storage medium, which belongs to the field of artificial intelligence technology. In the embodiment of the present application, the correlation between different relationships between entities and different attribute information is taken into account. For example, the relationship between entities may be based on certain attribute information, or when certain attribute information is different, the relationship between entities may be different, and when certain attribute information is the same, the relationship between entities is the same. In this way, by decoupling, the correlation between relationship information and each attribute information is analyzed, and the relationship between entities can be more deeply explored. The entity representation information determined in this way can better reflect the relationship between entities and effectively improve the accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a data processing method, device, equipment and storage medium. Background Art

[0002] With the development of computer science and the rise of artificial intelligence, the application of knowledge graphs has become more and more extensive. Knowledge graphs are used to describe the attributes of entities and the relationships between entities. It is necessary to process the entity information in the knowledge graph to determine the entity representation information of each entity, and then complete the knowledge graph, or perform other processing on the entity based on the entity representation information.

[0003] At present, the data processing method usually maps the attribute information of the first entity and the second entity in the knowledge graph to obtain the corresponding entity representation information, then maps the entity representation information corresponding to the first entity and the relationship information to the representation space, and then reconstructs the entity representation information of the second entity based on the two, and determines the accuracy of the reconstructed entity representation information based on the calculated difference between the reconstructed entity representation information and the real entity representation information.

[0004] The above method determines the accuracy of entity representation information based on reconstruction, but ignores the interpretability of entity and relationship representation information. The above method uses a black box structure to obtain entity representation information of entities, which is difficult to understand, and simply determines entity representation information through mapping and the relationship between entities. The accuracy of the entity representation information is relatively poor. Summary of the invention

[0005] The embodiments of the present application provide a data processing method, device, equipment and storage medium, which can improve accuracy and processing efficiency. The technical solution is as follows:

[0006] In one aspect, a data processing method is provided, the method comprising:

[0007] Acquire entity information in a knowledge graph, wherein the entity information includes at least two attribute information of a first entity and a second entity and relationship information between the first entity and the second entity;

[0008] Based on at least two pieces of attribute information of the first entity and the second entity and the relationship information, acquiring related information between the relationship information and the at least two pieces of attribute information;

[0009] Based on at least two attribute information of the first entity and the second entity, the relationship information, and the related information, acquiring entity representation information of the first entity;

[0010] Based on the entity representation information of the first entity, obtaining a target loss value, wherein the target loss value is related to the semantic rationality of the entity representation information;

[0011] Based on the target loss value, the relevant information and the entity representation information are updated until the target condition is met, thereby obtaining the entity representation information of the first entity in the knowledge graph.

[0012] In one aspect, a data processing device is provided, the device comprising:

[0013] An entity information acquisition module, used to acquire entity information in a knowledge graph, wherein the entity information includes at least two attribute information of a first entity and a second entity and relationship information between the first entity and the second entity;

[0014] A related information acquisition module, configured to acquire related information about the relationship information and the at least two attribute information of the first entity and the second entity based on the at least two attribute information and the relationship information;

[0015] a representation information acquisition module, configured to acquire entity representation information of the first entity based on at least two attribute information of the first entity and the second entity, the relationship information, and the related information;

[0016] A loss acquisition module, configured to acquire a target loss value based on the entity representation information of the first entity, wherein the target loss value is related to the semantic rationality of the entity representation information;

[0017] An updating module is used to update the relevant information and the entity representation information based on the target loss value until the target condition is met, thereby obtaining the entity representation information of the first entity in the knowledge graph.

[0018] In a possible implementation, the relevant information acquisition module is used to:

[0019] Concatenate at least two attribute information of the first entity and the second entity and the relationship information to obtain at least two entity combination information corresponding to the at least two attribute information;

[0020] Based on the first matrix, transform the at least two entity combination information to obtain relevant information of the relationship information and the at least two attribute information;

[0021] The update module is used to:

[0022] Based on the target loss value, updating the first matrix;

[0023] Based on the updated first matrix, converting the at least two entity combination information to obtain updated related information;

[0024] Based on the updated relevant information, the entity representation information is updated.

[0025] In a possible implementation, the relevant information acquisition module is used to:

[0026] Based on the first matrix, transform the at least two entity combination information to obtain first related information of the relationship information and the at least two attribute information;

[0027] The first related information is standardized to obtain related information of the relationship information and the at least two attribute information.

[0028] In a possible implementation, the relevant information acquisition module is used to:

[0029] Based on the first matrix, transform the at least two entity combination information to obtain first related information of the relationship information and the at least two attribute information;

[0030] Performing standardization processing on the first relevant information to obtain second relevant information;

[0031] The second related information is normalized to obtain related information between the relationship information and the at least two attribute information.

[0032] In a possible implementation, the representation information acquisition module is used to:

[0033] Based on at least two first attribute information, at least two second attribute information and the relationship information, obtaining at least two entity representation component information corresponding to the at least two first attribute information, wherein the first attribute information is attribute information of the first entity, and the second attribute information is attribute information of the second entity;

[0034] Based on the correlation information between the relationship information and the at least two attribute information, the at least two entity representation component information are weighted to obtain entity representation information of the first entity.

[0035] In a possible implementation, the entity information acquisition module is used to:

[0036] Extracting first entity information from the knowledge graph;

[0037] Performing negative sampling on the knowledge graph to obtain second entity information in which the relationship between the entities is erroneous;

[0038] The loss acquisition module is used to obtain a target loss value based on the entity representation information of the first entity and the target weights corresponding to the first entity information and the second entity information respectively. The target loss value is related to the semantic rationality gap between the entity representation information corresponding to the first entity information and the second entity information.

[0039] In a possible implementation, the loss acquisition module is used to:

[0040] Based on the entity representation information of the first entity, obtaining semantic rationality of the entity representation information;

[0041] According to the target weights corresponding to the first entity information and the second entity information respectively, the semantic rationality of the entity representation information in the two entity information is weighted to obtain the target loss value, the target weight corresponding to the first entity information is a positive number, and the target weight corresponding to the second entity information is a negative number.

[0042] In a possible implementation, the loss acquisition module is used to transform the entity representation information of the first entity based on the second matrix to obtain the semantic rationality of the entity representation information.

[0043] In a possible implementation, the loss acquisition module is used to:

[0044] Obtaining indices corresponding to products of target weights and corresponding semantic rationality corresponding to the first entity information and the second entity information respectively;

[0045] The sum of logarithms corresponding to the exponents is obtained as the target loss value.

[0046] In a possible implementation, the loss value obtained by weighting the semantic rationality of the entity representation information in the two entity information is a first loss value;

[0047] The loss acquisition module is used for:

[0048] Obtain at least one of a second loss value or a third loss value, wherein the second loss value is determined based on relevant information corresponding to at least two target entity information in the knowledge graph, the relationship information in the at least two target entity information is the same, and the third loss value is determined based on relevant information between the relationship information and the at least two attribute information;

[0049] The target loss value is obtained based on the first loss value and at least one of the second loss value or the third loss value.

[0050] In a possible implementation, the loss acquisition module is used to:

[0051] Obtaining a second loss value based on a difference between relevant information corresponding to at least two target entity information in the knowledge graph;

[0052] In a possible implementation, the loss acquisition module is used to:

[0053] Obtaining the sum of the relevant information of the largest target quantity among the at least two relevant information;

[0054] A third loss value is obtained according to the sum of the relevant information and the target value.

[0055] In a possible implementation, the device further includes:

[0056] An extraction module, configured to extract entity representation information of a target entity from the knowledge graph in response to a function execution instruction;

[0057] An execution module is used to execute a corresponding target function based on the entity representation information of the target entity.

[0058] On the one hand, an electronic device is provided, which includes one or more processors and one or more memories, wherein at least one program code is stored in the one or more memories, and the at least one program code is loaded and executed by the one or more processors to implement various optional implementation methods of the above-mentioned data processing method.

[0059] On the one hand, a computer-readable storage medium is provided, in which at least one program code is stored. The at least one program code is loaded and executed by a processor to implement various optional implementations of the above-mentioned data processing method.

[0060] In one aspect, a computer program product or a computer program is provided, wherein the computer program product or the computer program includes one or more program codes, and the one or more program codes are stored in a computer-readable storage medium. One or more processors of an electronic device can read the one or more program codes from the computer-readable storage medium, and the one or more processors execute the one or more program codes, so that the electronic device can perform the data processing method of any possible implementation mode described above.

[0061] In the embodiments of the present application, the correlations between different relationships between entities and different attribute information are taken into consideration. For example, the relationship between entities may be based on certain attribute information, or when certain attribute information is different, the relationship between entities may be different, and when certain attribute information is the same, the relationship between entities is the same. In this way, by decoupling, the correlation between relationship information and each attribute information is analyzed, and the relationship between entities can be more deeply explored. The entity representation information determined in this way can better reflect the relationship between entities and effectively improve the accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0063] Figure 1 It is a schematic diagram of an implementation environment of a data processing method provided in an embodiment of the present application;

[0064] Figure 2 is a flow chart of a data processing method provided in an embodiment of the present application;

[0065] Figure 3 is a flow chart of a data processing method provided in an embodiment of the present application;

[0066] Figure 4 It is a structural schematic diagram of a data processing method provided in an embodiment of the present application;

[0067] Figure 5 It is a schematic diagram of a data processing method provided in an embodiment of the present application;

[0068] Figure 6 It is a schematic diagram of a data processing method provided in an embodiment of the present application;

[0069] Figure 7 is a schematic diagram of a data processing model provided in an embodiment of the present application;

[0070] Figure 8 is a schematic diagram of an experimental result of a data processing method provided in an embodiment of the present application;

[0071] Fig. 9 is a structural schematic diagram of a data processing device provided in an embodiment of the present application;

[0072] Fig.10 It is a structural block diagram of a terminal provided in an embodiment of the present application;

[0073] Fig.11 It is a structural diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION

[0074] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0075] In the present application, the terms "first", "second", etc. are used to distinguish between identical or similar items having substantially the same effects and functions. It should be understood that there is no logical or temporal dependency between "first", "second", and "nth", nor is the quantity and execution order limited. It should also be understood that although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of the various described examples, a first image can be referred to as a second image, and similarly, a second image can be referred to as a first image. Both the first image and the second image can be images, and in some cases, can be separate and different images.

[0076] The term "at least one" in this application means one or more, and the term "plurality" in this application means two or more, for example, a plurality of data packets means two or more data packets.

[0077] It should be understood that the terms used in the description of the various examples herein are only for describing specific examples and are not intended to be limiting. As used in the description of the various examples and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.

[0078] It should also be understood that the term "and / or" used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items. The term "and / or" is a description of the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this application generally indicates that the associated objects before and after are in an "or" relationship.

[0079] It should also be understood that in the various embodiments of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0080] It should also be understood that determining B based on A does not mean determining B only based on A. B can also be determined based on A and / or other information.

[0081] It should also be understood that the term “comprising” (also known as “inCludes”, “inCluding”, “Comprises” and / or “Comprising”) when used in this specification specifies the presence of stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0082] It should also be understood that the term "if" may be interpreted to mean "when" or "upon" or "in response to determining" or "in response to detecting." Similarly, the phrase "if it is determined that ..." or "if [a stated condition or event] is detected" may be interpreted to mean "upon determining that ..." or "in response to determining that ..." or "upon detecting [a stated condition or event]" or "in response to detecting [a stated condition or event]," depending on the context.

[0083] The nouns involved in this application are explained below.

[0084] Coupling: refers to the phenomenon that two or more systems or two forms of motion influence each other and even unite through interaction.

[0085] Decoupling: It is a technique to separate two movements by mathematical methods to solve problems. The commonly used decoupling method is to ignore or simplify a movement that has a smaller impact on the problem being studied and only analyze the main movement. In the embodiment of the present application, it is used to decouple attribute information, and it is possible to separate the attribute information through learning, focus on the correlation between the relationship information between entities and each attribute information, and thus express the attribute information in an entity.

[0086] End-to-end: Starting from the user demand side, and ending with satisfying the user demand, providing end-to-end services. The input side of the end-to-end service is the market (user demand), and the output side is also the market (satisfying user demand). The end-to-end service is very fast and very effective, and there is no need for operation in the middle, and the process is very smooth. It can reduce labor costs, management costs, and thus operating costs.

[0087] Attention Mechanism: In cognitive science, due to the bottleneck of information processing, humans selectively focus on part of all information while ignoring other visible information. Since different parts of the human retina have different degrees of information processing capabilities, i.e., acuity, only the fovea centralis has the strongest acuity. In order to make rational use of limited visual information processing resources, humans need to select a specific part of the visual area and then focus on it. Therefore, the mechanism of focusing on part of all information and ignoring the other part is called the attention mechanism.

[0088] The present application relates to artificial intelligence technology, which is explained below.

[0089] Artificial Intelligence (AI) 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.

[0090] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics and other technologies. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0091] The key technologies of speech technology include automatic speech recognition technology (ASR), text-to-speech technology (TTS) and voiceprint recognition technology. Enabling computers to listen, see, speak and feel is the future development direction of human-computer interaction, among which speech has become one of the most promising human-computer interaction methods in the future.

[0092] Natural language processing (NLP) is an important direction in the fields of computer science and artificial intelligence. It studies various theories and methods that can achieve effective communication between people and computers using natural language. Natural language processing is a science that integrates linguistics, computer science, and mathematics. Therefore, research in this field will involve natural language, that is, the language people use in daily life, so it is closely related to the study of linguistics. Natural language processing technology usually includes text processing, semantic understanding, machine translation, robot question answering, knowledge graph and other technologies.

[0093] Machine Learning (ML) is a multi-disciplinary subject that involves 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 performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and teaching learning.

[0094] With the research and advancement of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned driving, automatic driving, drones, robots, smart medical care, smart customer service, etc. I believe that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.

[0095] The solution provided in the embodiments of the present application involves technologies such as natural language processing of artificial intelligence, specifically knowledge graph technology, which is specifically illustrated by the following embodiments.

[0096] The implementation environment of this application is described below.

[0097] Figure 1 1 is a schematic diagram of an implementation environment of a data processing method provided in an embodiment of the present application. The implementation environment includes a terminal 101, or the implementation environment includes a terminal 101 and a data processing platform 102. The terminal 101 is connected to the data processing platform 102 via a wireless network or a wired network.

[0098] The terminal 101 can be at least one of a smart phone, a game console, a desktop computer, a tablet computer, an e-book reader, an MP3 (Moving Picture Experts Group Audio Layer III, Moving Picture Experts Group Audio Layer 3) player or an MP4 (Moving Picture Experts Group Audio Layer IV, Moving Picture Experts Group Audio Layer 4) player, a laptop computer, and an intelligent robot. The terminal 101 is installed and runs an application that supports data processing, for example, the application can be a system application, an instant messaging application, a news push application, a shopping application, an online video application, and a social application.

[0099] Exemplarily, the terminal 101 can have a data processing function, can process entity data related to the knowledge graph, determine the entity representation information of the entity in the knowledge graph, and can also perform other functions based on the entity representation information. The terminal 101 can complete this work independently, and can also provide data services for it through the data processing platform 102. This embodiment of the application is not limited to this.

[0100] The data processing platform 102 includes at least one of a server, multiple servers, a cloud computing platform, and a virtualization center. The data processing platform 102 is used to provide background services for applications that support data processing. Optionally, the data processing platform 102 undertakes the main processing work, and the terminal 101 undertakes the secondary processing work; or, the data processing platform 102 undertakes the secondary processing work, and the terminal 101 undertakes the main processing work; or, the data processing platform 102 or the terminal 101 can undertake the processing work separately. Alternatively, the data processing platform 102 and the terminal 101 use a distributed computing architecture for collaborative computing.

[0101] Optionally, the data processing platform 102 includes at least one server 1021 and a database 1022, and the database 1022 is used to store data. In an embodiment of the present application, the database 1022 can store sample images or sample facial images to provide data services for at least one server 1021.

[0102] The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal can be a smart phone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, etc., but is not limited to these.

[0103] Those skilled in the art will appreciate that the number of the above-mentioned terminals 101 and servers 1021 can be more or less. For example, the above-mentioned terminal 101 and server 1021 can be only one, or the above-mentioned terminals 101 and servers 1021 can be dozens or hundreds, or more. The embodiment of the present application does not limit the number and device type of the terminals or servers.

[0104] Figure 2 is a flow chart of a data processing method provided in an embodiment of the present application, the method is applied to an electronic device, the electronic device is a terminal or a server, see Figure 2 , the method comprises the following steps.

[0105] 201. An electronic device obtains entity information in a knowledge graph, where the entity information includes at least two attribute information of a first entity and a second entity and relationship information between the first entity and the second entity.

[0106] Knowledge Graph (KG) is a modern theory that combines the theories and methods of applied mathematics, graphics, information visualization technology, information science and other disciplines with methods such as metrology citation analysis and co-occurrence analysis, and uses visual graphs to vividly display the core structure, development history, frontier fields and overall knowledge architecture of the discipline to achieve the purpose of multidisciplinary integration. The knowledge graph stores the attributes of entities and the relationships between entities in the form of graph data. In the knowledge graph, entities are nodes, edges are used to reflect the relationship between two entities, and the weight of the edge is used to reflect the relationship between the two entities.

[0107] An entity is something that exists objectively and can be distinguished from each other. An entity can be a specific person, thing, or object, or an abstract concept or connection. That is, an entity is used to represent an object or concept in the real world. For example, an apple, a person's name (user), etc.

[0108] The relationship information is used to indicate the relationship between the first entity and the second entity.

[0109] 202. The electronic device obtains related information of the relationship information and the at least two attribute information of the first entity and the second entity based on the relationship information.

[0110] Attribute information is information related to an entity. Attribute information can be used to understand various aspects of the entity. Based on the acquired entity information, the electronic device can determine the relevant information between the relationship information and each attribute information, so as to analyze which attribute information of the entity the relationship information focuses on. Through this relevant information, the process of entity representation of multiple attribute information based on decoupling can be realized.

[0111] 203. The electronic device obtains entity representation information of the first entity based on at least two attribute information of the first entity and the second entity, the relationship information, and the related information.

[0112] If there is a relationship between entities in an entity information, then there is also a relationship between the entity representation information of the entities. For example, an entity can become another entity through a certain relationship. The sum of the entity representation information of the entity and the representation information of the relationship information should be the entity representation information of the other entity, so that the entity representation information obtained can accurately reflect the relationship between entities in the knowledge graph.

[0113] Through the above steps, the electronic device can determine the entity representation information of the first entity and the related information of the relationship information and each attribute information. The relationship information between entities is related to the attribute information. For example, some relationships between entities are based on certain attribute information. For example, because two entities both have certain attributes, the two entities establish a relationship. In order to better enable the entity representation information to reflect the relationship between entities and the attribute information, the electronic device also takes the related information into consideration when determining the entity representation information. In this way, the correlation between the relationship information and each attribute information is analyzed by decoupling, and the relationship between entities can be more deeply explored. The entity representation information determined in this way can better reflect the relationship between entities and effectively improve the accuracy.

[0114] 204. The electronic device obtains a target loss value based on the entity representation information of the first entity, where the target loss value is related to the semantic rationality of the entity representation information.

[0115] The above steps 201 to 203 are an iterative process. After the electronic device determines the entity representation information of the first entity, it can determine whether the entity representation information is accurate, so as to determine whether further optimization is needed to obtain more accurate entity representation information.

[0116] The target loss value is related to the semantic rationality of the entity representation information. Optionally, the two are negatively correlated. That is, the higher the semantic rationality, the smaller the target loss value. It is understandable that through the learning process, we hope to learn entity representation information with higher semantic rationality, so that the obtained entity representation information is better, and the relevant information of relationship information and attribute information can be better reflected in the entity representation information.

[0117] 205. The electronic device updates the relevant information and the entity representation information based on the target loss value until the target condition is met, thereby obtaining the entity representation information of the entity in the first entity information in the knowledge graph.

[0118] Based on the target loss value, the electronic device can update the relevant information and entity representation information, that is, change some parameters, and repeat the above iterative steps until the target conditions are met, that is, stop when the entity representation information is accurate enough, and the entity representation information of the entity in the knowledge graph can be obtained.

[0119] In the embodiments of the present application, the correlations between different relationships between entities and different attribute information are taken into consideration. For example, the relationship between entities may be based on certain attribute information, or when certain attribute information is different, the relationship between entities may be different, and when certain attribute information is the same, the relationship between entities is the same. In this way, the relationship between entities can be deeply explored through the correlation, and the entity representation information determined in this way can better reflect the relationship between entities, effectively improving the accuracy.

[0120] Figure 3 is a flow chart of a data processing method provided in an embodiment of the present application, see Figure 3 , the method comprises the following steps.

[0121] 301. The electronic device extracts first entity information from the knowledge graph.

[0122] 302. The electronic device performs negative sampling on the knowledge graph to obtain second entity information in which the relationship between the entities is erroneous, wherein the first entity information and the second entity information include at least two attribute information of the first entity and the second entity and the relationship information between the first entity and the second entity.

[0123] The above steps 301 and 302 are the process of obtaining entity information in the knowledge graph, during which the electronic device can obtain positive samples and negative samples from the knowledge graph. Among them, the first entity information directly extracted from the knowledge graph is the positive sample, and the second entity information obtained by negative sampling is the negative sample. The electronic device processes the positive and negative samples and obtains results that are quite different, which means that the processing method of the electronic device is accurate, and it can accurately distinguish the difference between positive and negative samples, and can accurately distinguish the correctness and errors of the relationship between entities.

[0124] For negative sampling, in the field of natural language processing, the text can be sampled to obtain a context word and a target word to generate a positive example. The electronic device uses the same context word as the positive sample and randomly selects a word to generate a negative sample. The process of generating negative samples is negative sampling. In an embodiment of the present application, the electronic device can extract a positive sample from the knowledge graph, and can modify any one of the first entity, the second entity, and the relationship information in the first entity information based on the positive sample, and replace it with other information obtained by random sampling, thereby obtaining erroneous entity information, so that the entity information is a negative sample. There are errors in the relationship between entities in the negative sample.

[0125] In a specific example, the knowledge graph usually uses entities as nodes, and edges are used to represent the relationships between entities. The knowledge graph can be formally represented as where ε and Respectively represent the entity set and edge set of the knowledge graph. Take the first entity information and the second entity information as triple data as an example, for the triple (h, r, t). Among them, h is head, which refers to the head entity. r is relation, which refers to the relationship. t is tail, which refers to the tail entity.

[0126] In the embodiment of the present application, the entity representation information of the electronic device entity is an embedded representation, which can be a multi-dimensional vector. For example, for the triple in the knowledge graph G We denote their embedding as h, Where d and l represent the vector dimensions and are positive integers.

[0127] For example, in a specific example, the knowledge graph can store entity information in the form of triples. For example, the triple (h, r, t), h, r, t can be the identifier of the head entity, the identifier of the relationship, and the identifier of the tail entity, respectively. For example, (2, a, 4), where 2 and 4 are the identifiers of the entity, and a is the identifier of the relationship. The relationship between two entities can be determined through the triple. Specifically, the electronic device can obtain at least two attribute information of the entity and the relationship information between the two entities based on the identifiers of the entity and the relationship.

[0128] 303. The electronic device obtains related information of the relationship information and the at least two attribute information of the first entity and the second entity based on the relationship information.

[0129] After the electronic device obtains two types of entity information, the first entity and the second entity in the two entity information each have at least two attribute information. The electronic device can analyze the correlation between the relationship information and each of the at least two attribute information to analyze which attribute information the relationship information pays more attention to, and then add the relevant information to perform the following entity representation information acquisition steps, which can make the correlation between the relationship and the attribute information in the entity representation information more obvious, and the entity representation information is also more accurate.

[0130] In a possible implementation, when analyzing the correlation between the relationship information and each attribute information, the correlation between the information in the entity combination information can be determined by concatenating the attribute information and the relationship information of two entities in the entity information and then transforming the concatenated entity combination information. Therefore, step 303 can be implemented by the following steps 1 and 2.

[0131] Step 1: The electronic device combines at least two attribute information of the first entity and the second entity and the relationship information to obtain at least two entity combination information corresponding to the at least two attribute information.

[0132] The electronic device can splice multiple types of information into a combined information through the splicing step, so that the relevant information between the various parts of the combined information can be obtained by converting the combined information as a whole.

[0133] For example, entity information can be triple data, and the three types of information can be spliced ​​through the splicing step to obtain the combined information [h k ;;t k ], [·;·] represents the concatenation operation. k is the identifier of the attribute information of the entity.

[0134] Step 2: The electronic device converts the at least two entity combination information based on the first matrix to obtain relevant information of the relationship information and the at least two attribute information.

[0135] The electronic device can convert the multi-dimensional information into numerical values ​​by converting the entity combination information through the first matrix, and the relevant information between the relationship information and the attribute information is reflected through the numerical values.

[0136] Optionally, the relevant information may be a correlation degree, which can reflect the attention paid by the relationship information to a certain attribute information. The attention information may be an absolute value or a relative value, which is not limited in the embodiment of the present application.

[0137] The relevant information can be obtained in a variety of ways in step 2. During the conversion process, the electronic device maps the entity combination information into a value that can characterize the correlation. After mapping, in order to make the correlations obtained from different entity information more comparable, post-processing can be performed after mapping to obtain more accurate relevant information. Two possible implementation methods are provided below. The embodiments of the present application can use any method to obtain the relevant information, or other methods can be used. The embodiments of the present application are not limited to this.

[0138] Method 1: Based on the first matrix, transform the at least two entity combination information to obtain first related information between the relationship information and the at least two attribute information; standardize the first related information to obtain related information between the relationship information and the at least two attribute information.

[0139] In the first method, since the entity combination information is obtained based on the splicing of the entity information, the span of the obtained values ​​may be relatively large, and the relationship between the values ​​obtained from different entity information may also be relatively complex, because the entity combination information is directly converted using the first matrix. The electronic device can standardize the first related information after mapping, and the obtained related information is in a unified form, which can reflect the linear relationship between the related information obtained from different entity information, that is, it can more accurately reflect the difference between the related information obtained from different entity information.

[0140] In one possible implementation, the normalization process can be implemented by a Rectified Linear Unit (ReLU) function.

[0141] For example, in a specific example, taking the first entity information and the second entity information as triple data, for the triple (h, r, t), the present invention uses an attention mechanism to explicitly select the relevant parts of entities h and t according to the relationship r. Specifically, the model first concatenates the embedding representations of the head and tail entities and the relationship, and then calculates the attention value of the relationship to the kth component of the head and tail entity embeddings through a nonlinear transformation, where k is a positive integer.

[0142] For example, in a specific example, electronic devices are spliced ​​to obtain [h k ;r;t k ], we can use the first matrix W 1 , mapping obtains the first relevant information, and then normalizes it through ReLU to obtain relevant information.

[0143] a k =ReLU(W 1 [h k ;r;t k ]), Formula 1

[0144] in, is the first matrix, and [·;·] represents the concatenation operation. k It represents the related information of a certain relationship r and the kth component of the head and tail entities h and t, which can reflect the attention of a certain relationship r to the kth component of the head and tail entities h and t.

[0145] In a possible implementation, the first matrix may be a trainable matrix. In this implementation, in the following step 306, the electronic device may update the first matrix based on the target loss value.

[0146] Method 2: Based on the first matrix, transform the at least two entity combination information to obtain first related information between the relationship information and the at least two attribute information; standardize the first related information to obtain second related information; normalize the second related information to obtain related information between the relationship information and the at least two attribute information.

[0147] Compared with the first method, the electronic device in the second method processes the second related information into relatively related information through normalization after normalizing the first related information. Through the normalization, the related information obtained from different relationship information can be converted into the same value range, so that the related information obtained from different relationship information is more referenceable. And by performing subsequent calculations through such related information, the amount of calculation can be effectively reduced and the data processing efficiency can be improved.

[0148] The related information obtained by normalization processing can be understood as the relative related information between the relationship information and at least two attribute information. The relative related information can reflect the relative attention of different relationship information to the attribute information, that is, the relative attention value.

[0149] For example, in a specific example, after method 1, the electronic device can also obtain relevant information through the following formula 2.

[0150]

[0151] Among them, α k is the relevant information obtained after applying the normalization operation. j is the identifier of the attribute information.

[0152] 304. The electronic device obtains entity representation information of the first entity based on at least two attribute information of the first entity and the second entity, the relationship information, and the related information.

[0153] The electronic device obtains the attribute information and relationship information of different entities, and also analyzes the related information between the relationship information and each attribute information. Then, the electronic device can combine the attribute information, relationship information and related information to obtain the entity representation information of the entity. In this step 304, only the acquisition of the entity representation information of the first entity is used as an example for explanation. The first entity is any one of the two entities included in each entity information. For example, taking an entity information as an example, the entity information includes a head entity, a tail entity and the relationship information between the head entity and the tail entity. The first entity can be a head entity or a tail entity. The electronic device can execute this step 304 for all entities in the entity information to obtain the entity representation information.

[0154] In a possible implementation, the head entity h, the tail entity t, and the relationship information r in the entity information have the following relationship: h+t=r. Based on this relationship, the electronic device can obtain the representation information of the first entity, the second entity, and the relationship information in the entity information. Among them, the representation information of the first entity and the second entity is the entity representation information, and the representation information of the relationship information is the relationship representation information.

[0155] In one possible implementation, the entity representation information and the relationship representation information may be embedded representations. In the above step 304, the electronic device may embed both the attribute information and the relationship information of the entity when representing the entity information to obtain an embedded representation, wherein the sum of the embedded representation of the head entity and the embedded representation of the relationship information is the embedded representation of the tail entity.

[0156] The electronic device can obtain the representation information of the first entity and the second entity in different ways. It should be noted that when obtaining the entity representation information corresponding to the entity information, the entity and the relationship information are usually processed together to obtain the representation information. Two methods for obtaining entity representation information are provided below. The embodiments of the present application may adopt any of the acquisition methods or other methods, and the embodiments of the present application are not limited to this.

[0157] Acquisition method 1: The electronic device can acquire entity representation information of the first entity based on a reconstruction method.

[0158] Specifically, the electronic device can embed the attribute information and relationship information of the first entity and the second entity with the conversion relationship between the first entity, the second entity and the relationship information as a constraint to obtain the entity representation information of the first entity and the second entity and the representation information of the relationship information. The electronic device can obtain the entity representation information of another entity information based on any entity information, relationship information and the above-mentioned conversion relationship in the entity information, and compare it with the target entity representation information of the other entity information to determine the difference value, and determine the entity representation information that satisfies the semantic rationality condition based on the difference value.

[0159] In one possible implementation, in the acquisition method one, the electronic device can be implemented through the TransE (TranslatingEmbedding) model. The electronic device can input the first entity information and the second entity information into the TransE model, and the TransE model outputs the entity representation information of the first entity in the two entity information. Optionally, the TransE model can also output the entity representation information of the second entity. Optionally, the TransE model can also output the representation information of the relationship information. For the entity representation information of the first entity, it can be shown as follows in Formula 3.

[0160] o k =[h k ;r;t k ], Formula 3

[0161] in, is the output representation of the kth component.

[0162] Acquisition method 2: The electronic device can acquire entity representation information of the first entity based on a bilinear method.

[0163] In the second acquisition method, the electronic device can embed at least two attribute information and relationship information of the first entity and the second entity to obtain embedded representations of the first entity, the second entity and the relationship information, and perform convolution processing on the three types of information to obtain the convolved embedded representation. The electronic device can perform rectification processing on the convolved embedded representation to obtain entity representation information of the first entity. Optionally, the electronic device can also obtain entity representation information of the second entity. Optionally, the electronic device can also obtain representation information of the relationship information. For the entity representation information of the first entity, it can be shown as shown in the following formula four.

[0164] ConvKB:o k =ReLU(Conv([h k ;r;t k ]), Formula 4

[0165] Where Conv(·) represents a convolutional layer with M filters, where M is a positive integer. is the output representation of the kth component.

[0166] In a possible implementation, the electronic device can take each attribute information as a component, and for each attribute information, can obtain an entity representation component information, and then integrate each entity representation component information based on the relationship information and the related information of each attribute information.

[0167] Specifically, the electronic device can obtain at least two entity representation component information corresponding to the at least two first attribute information based on at least two first attribute information, at least two second attribute information and the relationship information, where the first attribute information is the attribute information of the first entity and the second attribute information is the attribute information of the second entity; based on the relationship information and the related information of the at least two attribute information, the at least two entity representation component information are weighted to obtain the entity representation information of the first entity.

[0168] Among them, the relevant information can be used as the weight of each entity representation component information. Through the weighting of relevant information, the attribute information with high correlation with the relationship information in the entity representation information has a greater impact on the entity representation information. This entity representation information fully reflects the degree of attention paid by the relationship information to different attribute information. Compared with the simple mapping method, this entity representation information is more accurate. For example, the entity representation information is Among them, α k is the relevant information obtained after applying the normalization operation. is the output representation of the kth component.

[0169] 305. The electronic device obtains a target loss value based on the entity representation information of the first entity and the target weights corresponding to the first entity information and the second entity information respectively. The target loss value is related to the semantic rationality gap between the entity representation information corresponding to the first entity information and the second entity information.

[0170] Through the above steps, the electronic device can obtain the entity representation information of the first entity. In order to confirm whether the entity representation information can accurately represent the first entity, the electronic device can execute step 306 and measure the accuracy with the target loss value.

[0171] Among them, different entity information can correspond to different target weights. Through the target weight, the positive and negative samples are distinguished, so that the gap between the positive and negative samples can be reflected in the target loss value. It is understandable that the larger the gap, the stronger the ability of the electronic device to distinguish between positive and negative samples. Therefore, in the learning process (that is, the data update process), the electronic device needs to maximize the gap and improve the processing ability of the electronic device for positive and negative samples.

[0172] In one possible implementation, the target loss value is negatively correlated with the gap. That is, the smaller the target loss value, the larger the gap between the positive and negative samples reflected by the entity representation information. The larger the target loss value, the smaller the gap between the positive and negative samples reflected by the entity representation information.

[0173] In one possible implementation, the electronic device can measure the accuracy of the entity representation information by the semantic rationality of the entity representation information. It can be understood that the semantic rationality of the positive sample is relatively high, and the semantic rationality of the negative sample is relatively low. Therefore, different target weights are set for the two types of entity information, and the semantic rationality corresponding to the two types of entity information is weighted to determine the target loss value. Specifically, step 305 can be implemented by the following steps 1 and 2.

[0174] Step 1: The electronic device obtains semantic rationality of the entity representation information based on the entity representation information of the first entity.

[0175] In step 1, after the electronic device obtains the entity representation information, it can further obtain the semantic rationality of the entity representation information, and the semantic rationality can be used as a criterion for measuring whether the entity representation information is accurate. Specifically, the process of obtaining the semantic rationality can be a mapping process, by mapping the vector representation of the entity representation information to a numerical value f(h, r, t).

[0176]

[0177] Among them, when the entity indicates that the information is obtained in different ways, the W 2 For example, in the above acquisition method 1, the W 2 In the above acquisition method 2, the electronic device converts the entity representation information of the first entity based on the second matrix to obtain the semantic rationality of the entity representation information. 2 is a matrix, that is, the second matrix. Optionally, the second matrix can be updated during the learning process, that is, in the following step 306, the electronic device can update the second matrix according to the target loss value.

[0178] Step 2: The electronic device weights the semantic rationality of the entity representation information in the first entity information and the second entity information according to the target weights respectively corresponding to the two entity information to obtain the target loss value, where the target weight corresponding to the first entity information is a positive number, and the target weight corresponding to the second entity information is a negative number.

[0179] In step 2, the electronic device can perform the above step 1 on the entity representation information of the first entity in each of the first entity information and the second entity information to obtain semantic rationality. The electronic device can then synthesize the semantic rationality of the multiple entity information to determine whether the entity representation information currently determined for the positive and negative samples is accurate.

[0180] The electronic device can respectively obtain the indexes corresponding to the products of the target weights corresponding to the first entity information and the second entity information and the corresponding semantic rationality, and obtain the sum of the logarithms corresponding to the indexes as the target loss value.

[0181] For example, in a specific example, the electronic device can obtain the target loss value through the following formula six.

[0182]

[0183] Where G′ represents the invalid triplet obtained by negative sampling, that is, the negative sample. If (h, r, t)∈G, then y (h,r,t) =1, otherwise, (h, r, t)∈G′, y (h,r,t) = -1. exp() is the exponential function. Represents the target loss value.

[0184] In one possible implementation, in addition to the loss value obtained by the entity representation information, the electronic device may also add other constraints to achieve the purpose of decoupling multiple attribute information, or to clarify the relevant information between the relationship and the attribute information.

[0185] Specifically, in step 2, the electronic device obtains at least one of the second loss value or the third loss value as the first loss value by weighting the semantic rationality of the entity representation information in the two entity information, the second loss value is determined based on the relevant information corresponding to at least two target entity information in the knowledge graph, the relationship information in the at least two target entity information is the same, and the third loss value is determined based on the relevant information of the relationship information and the at least two attribute information. The electronic device can obtain the target loss value based on the first loss value and at least one of the second loss value or the third loss value.

[0186] For the second loss value, the electronic device can obtain the second loss value based on the difference between the relevant information corresponding to at least two target entity information in the knowledge graph.

[0187] Through the second loss value, the correlation between relationship information and attribute information can be more clearly defined, so that the entity representation information corresponding to each attribute information can reflect a separate semantic information, achieving the effect of decoupling. It can be understood that the same relationship will focus on the same attribute information of different entities. Therefore, for each triple (h, r, t)∈G, the electronic device can obtain N sets of triples with the same relationship through sampling T(h, r, t)∈G, where N is a positive integer. Then, by minimizing their KL (Kullback-Leible) distance, the KL distance is also called relative entropy. Constraints are imposed on the decoupling related information of these triples.

[0188] For example, the second loss value can be obtained by the following formula seven.

[0189]

[0190] in, is the second loss value, D KL (α(h, r, t), α(h′, r′, t′)) is the process of obtaining the KL distance between α(h, r, t) and α(h′, r′, t′), that is, determining the gap between the related information determined by the set of triples with the same relationship.

[0191] For the third loss value, the relationship information and the related information of the at least two attribute information are at least two related information. The electronic device can obtain the sum of the related information of the largest target quantity in the at least two related information, and obtain the third loss value according to the sum of the related information and the target value.

[0192] Through the third loss value, the relationship information can focus on the attribute information of the target quantity rather than all the attribute information, so that the relevant information between the relationship information and the attribute information is clearer.

[0193] The target number can be set by relevant technicians according to needs. For example, when the target number is 1, the relationship information focuses on one type of attribute information among multiple attribute information. During the learning process, the electronic device needs to learn which attribute information the relationship information focuses on. This embodiment of the application does not limit this.

[0194] For the same relation information, the fewer the total number of attribute information it focuses on, the better the decoupling effect. Therefore, the sum of the attention values ​​of the first m components selected each time is close to 1, where m is a positive integer, that is, the target number.

[0195] For example, the third loss value can be obtained by the following formula eight.

[0196]

[0197] in, is the third loss value, α i is the relevant information corresponding to the i-th component. m is the target number.

[0198] For the target loss value, taking the electronic device obtaining the first loss value, the second loss value and the third loss value as an example, the electronic device can weight the three loss values ​​to obtain the target loss value. For example, the first weight can be set for the second loss value, and the second weight can be set for the third loss value. In this way, the electronic device can obtain the sum of the first loss value, the product of the second loss value and the first weight, and the product of the third loss value and the second weight to obtain the target loss value. For example, the electronic device can obtain the target loss value through the following formula 9

[0199]

[0200] Wherein "β" and "η" represent the first weight and the second weight of the second loss value and the third loss value, respectively. The first weight and the second weight can be set by relevant technical personnel according to needs, and can also be updated in the following step 306, which is not limited in this embodiment of the present application. Of course, weights can also be set for the three loss values ​​respectively, which is not limited in this embodiment of the present application.

[0201] The second and third loss values ​​mentioned above can be understood as regularization terms. Regularization in algebraic geometry means giving a planar irreducible algebraic curve a certain form of holomorphic parameter representation.

[0202] Knowledge Graph Embedding (KGE) models typically learn entity and relation embeddings by maximizing a score function f(h, r, t) over observed facts, and the score tends to give higher scores to true triples than invalid triples.

[0203] It should be noted that step 305 is a step of obtaining a target loss value based on the entity representation information of the first entity. In this embodiment, an example is given in which an electronic device obtains multiple loss values ​​based on multiple information and then performs data update by integrating multiple loss values.

[0204] In one possible implementation, the electronic device may not need to obtain other loss values, but instead obtain a target loss value based on the entity representation information of the first entity, the target loss value being related to the semantic rationality of the entity representation information, and the entity representation information is updated by updating the target loss value, so that the semantic rationality of the entity representation information meets certain conditions. Specifically, the electronic device may obtain the semantic rationality of the entity representation information based on the entity representation information of the first entity, and obtain a target loss value based on the semantic rationality. Optionally, the target loss value is negatively correlated with the semantic rationality. That is, the larger the target loss value, the smaller the semantic rationality. The smaller the target loss value, the larger the semantic rationality. It can be understood that in the embodiment of the present application, it is necessary to improve the accuracy of the entity representation information by maximizing the semantic rationality, that is, making the entity representation information more able to reflect the accurate meaning.

[0205] 306. The electronic device updates the relevant information and the entity representation information based on the target loss value until the target condition is met, thereby obtaining the entity representation information of the first entity in the knowledge graph.

[0206] Corresponding to the manner of determining the relevant information based on the first matrix in step 303, in step 306, the electronic device can update the relevant information by updating the first matrix. When the relevant information is updated, the entity representation information is also updated accordingly. Specifically, the electronic device can update the first matrix based on the target loss value, convert the at least two entity combination information based on the updated first matrix to obtain updated relevant information, and update the entity representation information based on the updated relevant information.

[0207] In one possible implementation, the above data processing method can be implemented by a data processing model, and the electronic device can input the knowledge graph into the data processing model, and the data processing model executes the above steps 301 to 306, or the electronic device can execute step 301, obtain the first entity information and the second entity information, and then input the first entity information and the second entity information into the data processing model, and the data processing model executes the above steps 302 to 306 to obtain the entity representation information of the entity in the indication graph. The data processing method is end-to-end, and the user only needs to provide the data to be processed, and the data processing model can output the entity representation information of the entity. It can reduce labor costs, management costs, and operating costs, and improve data processing efficiency.

[0208] For example, in a specific example, the structure of the data processing model can be as follows Figure 4As shown in FIG. 1 , for a triple (h, r, t), the present invention uses an attention mechanism to explicitly select the relevant parts of entities h and t according to the relation r. Specifically, the model first concatenates the embedding representations of the head and tail entities and the relation, and then calculates the attention value (that is, the relevant information) α of the relation r on the kth component of the head and tail entity embeddings through a nonlinear transformation. k Then by The final entity representation information is determined, and the corresponding score (semantic rationality) is determined based on the entity representation information. In the learning process of the embodiment of the present application, for the first entity representation information, the training model is intended to maximize the score. Of course, for the second entity representation information, the score is intended to be minimized.

[0209] In one possible implementation, through the above steps 301 to 306, the electronic device can obtain the entity representation information of the entity in the knowledge graph, and subsequently improve various downstream services based on the entity representation information. Specifically, after receiving the function execution instruction, the electronic device can respond to the function execution instruction, extract the entity representation information of the target entity from the knowledge graph, and execute the corresponding target function based on the entity representation information of the target entity. The target function may be related to business needs.

[0210] The above data processing method can be applied to any application scenario that requires entity representation information. For example, the data processing method can be applied to link prediction, dialogue systems, recommendation systems, etc. This is only an exemplary description, and the application scenario of this application embodiment is not limited. Figure 5 As shown, when the data processing method is applied to link prediction, the electronic device can determine the relationship information between entity 501 and entity 502 through the entity representation information of the known entities in the knowledge graph, thereby realizing link prediction. Of course, the knowledge graph can also be completed when other information (for example, entity 502) is missing in the knowledge graph. For another example, Figure 6 As shown, when the data processing method is applied to the dialogue system 600, in the KG composed of users as entities, the entities carry rich information. For example, a user may have multiple attribute information, and this information can be compressed into multiple components. Figure 7As shown, the entity "XXXX (name)" may contain four components, such as "characteristic 701", "family 702", "work 703", "places 704", etc. For example, in characteristic 701, height (Height) and birth year (Birth_year) may be included, the height is 1.83 meters (m), and the birth year is 1975. In family 702, XXXX's father (Father_of) is AAAA (name), XXXX's daughter (Daughter) is CCCC (name), and XXXX married (Married_to) BBBB (name). In work 703, XXXX is in the team of Manchester United Football Club (MUFC). In place 704, XXXX's country (Country) is England. XXXX's living city (Live_city) is London (Landon). If a question related to the "country" or "places lived" of "XXXX" appears in the conversation, the entity representation information of the attribute information "place" is obtained from the entity representation information of the knowledge graph XXXX through the data processing method provided by this application. Then, the subsequent steps are performed to obtain the information related to the "place" of the entity, which can not only make the response more accurate, but also have a certain degree of explainability.

[0211] In order to verify the effect of the present invention, we conducted experimental analysis on two datasets of actual scenarios. The results are shown in Table 1.

[0212] Table 1

[0213]

[0214] We compared the existing mainstream KGE technologies using the link prediction task, including reconstruction-based models (TransE, RotatE, ConvE) and bilinear-based models (ComplEx, ConvKB, TuckER, KBGAT). Among them, RotatE is an embedding model proposed in Knowledge Graph Embedding by Relational Rotation in Complex Space. ConvE is an entity relationship prediction model.

[0215] From Table 1, we find the following items.

[0216] (1) On both experimental datasets, the present invention achieved competitive results, especially outperforming two closely related models, TransE and ConvKB. On the FB15k-237 dataset, the DisenE (ConvKB) of the present application improved on almost all indicators, which verifies the effectiveness of the method in link prediction tasks.

[0217] (2) It can be seen that the DisenE (ConvKB) of this application has the best result on FB15k-237 and the best MR score on WN18RR, which shows that by decoupling, the ranking of real triples can be generally higher.

[0218] (3) Compared with WN18RR, FB15k-237 has a more significant improvement. This is because in KGs with more relations, the phenomenon that entities contain multiple semantic components is more significant.

[0219] like Figure 8 As shown in Figure 2, we visualize the attention of entities and relations. Figure 8 In Figure (a), we visualize the attention values ​​of a relation on K components of different entities, where the y coordinates are randomly sampled head entities that appear in the same triplet with the relation. The figure shows that the same relation tends to focus on the same parts of different entities. By analyzing the attention distribution, we found that relations dominated by the first component are generally related to sports events, which leads to the "gender" relation of men also focusing on the first component.

[0220] Furthermore, to verify that the learned embeddings satisfy the intuition that different relations focus on different parts of entities, we Figure 8 Figure (b) in Figure 1 plots the attention values ​​on multiple components of the entity Britain, where the y-coordinate is the relation sample that appears in the same triplet as "Britain". We can observe that semantically similar relations have similar attention value distributions. For example, the relations "gdp nominal", "gdp real", "dated money", and "ppp dollars" are all related to the economy, and the relations "Amedal", "As", and "medal won" are all related to a certain sports event. Among them, A is a certain sports event. These results show that the decoupled representation learned by this model has a certain degree of interpretability.

[0221] In the embodiments of the present application, the correlations between different relationships between entities and different attribute information are taken into consideration. For example, the relationship between entities may be based on certain attribute information, or when certain attribute information is different, the relationship between entities may be different, and when certain attribute information is the same, the relationship between entities is the same. In this way, by decoupling, the correlation between relationship information and each attribute information is analyzed, and the relationship between entities can be more deeply explored. The entity representation information determined in this way can better reflect the relationship between entities and effectively improve the accuracy.

[0222] All the above optional technical solutions can be combined in any way to form optional embodiments of the present application, and will not be described in detail here.

[0223] Fig. 9 is a structural diagram of a data processing device provided in an embodiment of the present application, see Fig. 9 , the device comprises:

[0224] An entity information acquisition module 901 is used to acquire entity information in a knowledge graph, where the entity information includes at least two attribute information of a first entity and a second entity and relationship information between the first entity and the second entity;

[0225] A related information acquisition module 902, configured to acquire related information about the relationship information and the at least two attribute information of the first entity and the second entity based on the at least two attribute information and the relationship information;

[0226] A representation information acquisition module 903, configured to acquire entity representation information of the first entity based on at least two attribute information of the first entity and the second entity, the relationship information and the related information;

[0227] A loss acquisition module 904 is used to acquire a target loss value based on the entity representation information of the first entity, where the target loss value is related to the semantic rationality of the entity representation information;

[0228] The updating module 905 is used to update the relevant information and the entity representation information based on the target loss value until the target condition is met, thereby obtaining the entity representation information of the first entity in the knowledge graph.

[0229] In a possible implementation, the relevant information acquisition module 902 is used to:

[0230] Concatenate at least two attribute information of the first entity and the second entity and the relationship information to obtain at least two entity combination information corresponding to the at least two attribute information;

[0231] Based on the first matrix, transform the at least two entity combination information to obtain relevant information of the relationship information and the at least two attribute information;

[0232] The update module 905 is used to:

[0233] Based on the target loss value, updating the first matrix;

[0234] Based on the updated first matrix, transform the at least two entity combination information to obtain updated related information;

[0235] Based on the updated relevant information, the entity representation information is updated.

[0236] In a possible implementation, the relevant information acquisition module 902 is used to:

[0237] Based on the first matrix, transform the at least two entity combination information to obtain first related information between the relationship information and the at least two attribute information;

[0238] The first related information is standardized to obtain related information of the relationship information and the at least two attribute information.

[0239] In a possible implementation, the relevant information acquisition module 902 is used to:

[0240] Based on the first matrix, transform the at least two entity combination information to obtain first related information between the relationship information and the at least two attribute information;

[0241] Performing standardization processing on the first relevant information to obtain second relevant information;

[0242] The second related information is normalized to obtain related information of the relationship information and the at least two attribute information.

[0243] In a possible implementation, the representation information acquisition module 903 is used to:

[0244] Based on at least two first attribute information, at least two second attribute information and the relationship information, obtaining at least two entity representation component information corresponding to the at least two first attribute information, the first attribute information is the attribute information of the first entity, and the second attribute information is the attribute information of the second entity;

[0245] Based on the correlation information between the relationship information and the at least two attribute information, the at least two entity representation component information are weighted to obtain entity representation information of the first entity.

[0246] In a possible implementation, the entity information acquisition module 901 is used to:

[0247] Extracting first entity information from the knowledge graph;

[0248] Negative sampling is performed on the knowledge graph to obtain second entity information with errors in the relationship between the entities;

[0249] The loss acquisition module 904 is used to obtain a target loss value based on the entity representation information of the first entity and the target weights corresponding to the first entity information and the second entity information respectively. The target loss value is related to the semantic rationality gap between the entity representation information corresponding to the first entity information and the second entity information.

[0250] In a possible implementation, the loss acquisition module 904 is used to:

[0251] Based on the entity representation information of the first entity, obtaining semantic rationality of the entity representation information;

[0252] According to the target weights corresponding to the first entity information and the second entity information respectively, the semantic rationality of the entity representation information in the two entity information is weighted to obtain the target loss value, the target weight corresponding to the first entity information is a positive number, and the target weight corresponding to the second entity information is a negative number.

[0253] In a possible implementation, the loss acquisition module 904 is used to transform the entity representation information of the first entity based on the second matrix to obtain the semantic rationality of the entity representation information.

[0254] In a possible implementation, the loss acquisition module 904 is used to:

[0255] Obtaining indexes corresponding to products of target weights corresponding to the first entity information and the second entity information and corresponding semantic rationality respectively;

[0256] Get the sum of the logarithms corresponding to the index as the target loss value.

[0257] In a possible implementation, the loss value obtained by weighting the semantic rationality of the entity representation information in the two entity information is a first loss value;

[0258] The loss acquisition module 904 is used to:

[0259] Obtain at least one of a second loss value or a third loss value, the second loss value being determined based on relevant information corresponding to at least two target entity information in the knowledge graph, the relationship information in the at least two target entity information being the same, and the third loss value being determined based on relevant information about the relationship information and the at least two attribute information;

[0260] The target loss value is obtained based on the first loss value and at least one of the second loss value or the third loss value.

[0261] In a possible implementation, the loss acquisition module 904 is used to:

[0262] Obtaining a second loss value based on a difference between relevant information corresponding to at least two target entity information in the knowledge graph;

[0263] In a possible implementation, the loss acquisition module 904 is used to:

[0264] Obtaining a sum of relevant information of the largest target quantity among the at least two relevant information;

[0265] A third loss value is obtained according to the sum of the relevant information and the target value.

[0266] In a possible implementation, the device further includes:

[0267] An extraction module, configured to extract entity representation information of a target entity from the knowledge graph in response to a function execution instruction;

[0268] The execution module is used to execute the corresponding target function based on the entity representation information of the target entity.

[0269] The device provided in the embodiment of the present application takes into account the correlation between different relationships between entities and different attribute information. For example, the relationship between entities may be based on certain attribute information, or when certain attribute information is different, the relationship between entities may be different, and when certain attribute information is the same, the relationship between entities is the same. In this way, by decoupling, the correlation between relationship information and each attribute information is analyzed, and the relationship between entities can be more deeply explored. The entity representation information determined in this way can better reflect the relationship between entities, effectively improving the accuracy.

[0270] It should be noted that: when the data processing device provided in the above embodiment processes data, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the data processing device is divided into different functional modules to complete all or part of the functions described above. In addition, the data processing device provided in the above embodiment and the data processing method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0271] The electronic device in the above method embodiment can be implemented as a terminal. For example, Fig.101 is a block diagram of a terminal provided in an embodiment of the present application. The terminal 1000 may be a portable mobile terminal, such as a smart phone, a tablet computer, an MP3 (Moving Picture Experts Group Audio Layer III) player, an MP4 (Moving Picture Experts Group Audio Layer IV) player, a laptop computer or a desktop computer. The terminal 1000 may also be referred to as a user device, a portable terminal, a laptop terminal, a desktop terminal or other names.

[0272] Typically, the terminal 1000 includes a processor 1001 and a memory 1002 .

[0273] The processor 1001 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1001 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 1001 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 1001 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1001 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0274] The memory 1002 may include one or more computer-readable storage media, which may be non-transitory. The memory 1002 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1002 is used to store at least one instruction, which is used to be executed by the processor 1001 to implement the data processing method provided in the method embodiment of the present application.

[0275] In some embodiments, the terminal 1000 may also optionally include: a peripheral device interface 1003 and at least one peripheral device. The processor 1001, the memory 1002 and the peripheral device interface 1003 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 1003 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 1004, a display screen 1005, a camera assembly 1006, an audio circuit 1007, a positioning assembly 1008 and a power supply 1009.

[0276] The peripheral device interface 1003 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 1001 and the memory 1002. In some embodiments, the processor 1001, the memory 1002, and the peripheral device interface 1003 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1001, the memory 1002, and the peripheral device interface 1003 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.

[0277] The radio frequency circuit 1004 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 1004 communicates with the communication network and other communication devices through electromagnetic signals. The radio frequency circuit 1004 converts the electrical signal into an electromagnetic signal for transmission, or converts the received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 1004 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The radio frequency circuit 1004 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes but is not limited to: the World Wide Web, a metropolitan area network, an intranet, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 1004 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.

[0278] The display screen 1005 is used to display a UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 1005 is a touch display screen, the display screen 1005 also has the ability to collect touch signals on the surface or above the surface of the display screen 1005. The touch signal can be input to the processor 1001 as a control signal for processing. At this time, the display screen 1005 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 1005 can be one, arranged on the front panel of the terminal 1000; in other embodiments, the display screen 1005 can be at least two, respectively arranged on different surfaces of the terminal 1000 or in a folding design; in other embodiments, the display screen 1005 can be a flexible display screen, arranged on a curved surface or a folding surface of the terminal 1000. Even, the display screen 1005 can also be arranged as a non-rectangular irregular figure, that is, a special-shaped screen. The display screen 1005 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).

[0279] The camera assembly 1006 is used to capture images or videos. Optionally, the camera assembly 1006 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize the panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 1006 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.

[0280] The audio circuit 1007 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 1001 for processing, or input them into the radio frequency circuit 1004 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the terminal 1000. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 1001 or the radio frequency circuit 1004 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 1007 may also include a headphone jack.

[0281] The positioning component 1008 is used to locate the current geographical location of the terminal 1000 to implement navigation or LBS (Location Based Service). The positioning component 1008 can be a positioning component based on the US GPS (Global Positioning System), China's Beidou system or Russia's Galileo system.

[0282] The power supply 1009 is used to power various components in the terminal 1000. The power supply 1009 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 1009 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery charged through a wired line, and a wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.

[0283] In some embodiments, the terminal 1000 further includes one or more sensors 1010 , including but not limited to: an acceleration sensor 1011 , a gyroscope sensor 1012 , a pressure sensor 1013 , a fingerprint sensor 1014 , an optical sensor 1015 , and a proximity sensor 1016 .

[0284] The acceleration sensor 1011 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the terminal 1000. For example, the acceleration sensor 1011 can be used to detect the components of gravity acceleration on the three coordinate axes. The processor 1001 can control the display screen 1005 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 1011. The acceleration sensor 1011 can also be used to collect motion data of games or users.

[0285] The gyro sensor 1012 can detect the body direction and rotation angle of the terminal 1000, and the gyro sensor 1012 can cooperate with the acceleration sensor 1011 to collect the user's 3D actions on the terminal 1000. The processor 1001 can implement the following functions based on the data collected by the gyro sensor 1012: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.

[0286] The pressure sensor 1013 can be set on the side frame of the terminal 1000 and / or the lower layer of the display screen 1005. When the pressure sensor 1013 is set on the side frame of the terminal 1000, it can detect the user's holding signal of the terminal 1000, and the processor 1001 performs left and right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 1013. When the pressure sensor 1013 is set on the lower layer of the display screen 1005, the processor 1001 controls the operability controls on the UI interface according to the user's pressure operation on the display screen 1005. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.

[0287] The fingerprint sensor 1014 is used to collect the user's fingerprint, and the processor 1001 identifies the user's identity based on the fingerprint collected by the fingerprint sensor 1014, or the fingerprint sensor 1014 identifies the user's identity based on the collected fingerprint. When the user's identity is identified as a trusted identity, the processor 1001 authorizes the user to perform relevant sensitive operations, including unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings. The fingerprint sensor 1014 can be set on the front, back, or side of the terminal 1000. When a physical button or a manufacturer logo is set on the terminal 1000, the fingerprint sensor 1014 can be integrated with the physical button or the manufacturer logo.

[0288] The optical sensor 1015 is used to collect the ambient light intensity. In one embodiment, the processor 1001 can control the display brightness of the display screen 1005 according to the ambient light intensity collected by the optical sensor 1015. Specifically, when the ambient light intensity is high, the display brightness of the display screen 1005 is increased; when the ambient light intensity is low, the display brightness of the display screen 1005 is reduced. In another embodiment, the processor 1001 can also dynamically adjust the shooting parameters of the camera assembly 1006 according to the ambient light intensity collected by the optical sensor 1015.

[0289] The proximity sensor 1016, also called a distance sensor, is usually arranged on the front panel of the terminal 1000. The proximity sensor 1016 is used to collect the distance between the user and the front of the terminal 1000. In one embodiment, when the proximity sensor 1016 detects that the distance between the user and the front of the terminal 1000 is gradually decreasing, the processor 1001 controls the display screen 1005 to switch from the screen-on state to the screen-off state; when the proximity sensor 1016 detects that the distance between the user and the front of the terminal 1000 is gradually increasing, the processor 1001 controls the display screen 1005 to switch from the screen-off state to the screen-on state.

[0290] Those skilled in the art will understand that Fig.10 The structure shown in the figure does not constitute a limitation on the terminal 1000, and the terminal 1000 may include more or less components than those shown in the figure, or combine some components, or adopt a different component arrangement.

[0291] The electronic device in the above method embodiment can be implemented as a server. For example, Fig.11 It is a structural diagram of a server provided in an embodiment of the present application. The server 1100 may have relatively large differences due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 1101 and one or more memories 1102, wherein the memory 1102 stores at least one program code, and the at least one program code is loaded and executed by the processor 1101 to implement the data processing methods provided in the above-mentioned various method embodiments. Of course, the server may also have components such as a wired or wireless network interface and an input and output interface for input and output, and the server may also include other components for implementing device functions, which will not be described in detail here.

[0292] In an exemplary embodiment, a computer-readable storage medium is also provided, such as a memory including at least one program code, and the at least one program code is executable by a processor to complete the data processing method in the above embodiment. For example, the computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a compact disc (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, etc.

[0293] In an exemplary embodiment, a computer program product or a computer program is also provided, the computer program product or the computer program includes one or more program codes, and the one or more program codes are stored in a computer-readable storage medium. One or more processors of an electronic device can read the one or more program codes from the computer-readable storage medium, and the one or more processors execute the one or more program codes, so that the electronic device can perform the above-mentioned data processing method.

[0294] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0295] It should be understood that determining B based on A does not mean determining B only based on A. B can also be determined based on A and / or other information.

[0296] A person of ordinary skill in the art will understand that all or part of the steps to implement the above embodiments can be completed by hardware, or can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium. The above-mentioned storage medium can be a read-only memory, a disk or an optical disk, etc.

[0297] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A data processing method, characterized in that: The method comprises: Acquire entity information in a knowledge graph, wherein the entity information includes at least two attribute information of a first entity and a second entity and relationship information between the first entity and the second entity; Based on at least two pieces of attribute information of the first entity and the second entity and the relationship information, acquiring related information between the relationship information and the at least two pieces of attribute information; Based on at least two attribute information of the first entity and the second entity, the relationship information, and the related information, acquiring entity representation information of the first entity; Based on the entity representation information of the first entity, obtaining a target loss value, wherein the target loss value is related to the semantic rationality of the entity representation information; Based on the target loss value, the relevant information and the entity representation information are updated until the target condition is met, thereby obtaining the entity representation information of the first entity in the knowledge graph.

2. The method according to claim 1, characterized in that The acquiring, based on the at least two attribute information of the first entity and the second entity and the relationship information, the related information of the relationship information and the at least two attribute information includes: Concatenate at least two attribute information of the first entity and the second entity and the relationship information to obtain at least two entity combination information corresponding to the at least two attribute information; Based on the first matrix, transform the at least two entity combination information to obtain relevant information of the relationship information and the at least two attribute information; The updating of the relevant information and the entity representation information based on the target loss value includes: Based on the target loss value, updating the first matrix; Based on the updated first matrix, converting the at least two entity combination information to obtain updated related information; Based on the updated relevant information, the entity representation information is updated.

3. The method according to claim 2, characterized in that The converting the at least two entity combination information based on the first matrix to obtain the related information of the relationship information and the at least two attribute information includes: Based on the first matrix, transform the at least two entity combination information to obtain first related information of the relationship information and the at least two attribute information; The first related information is standardized to obtain related information of the relationship information and the at least two attribute information.

4. The method according to claim 2, characterized in that The converting the at least two entity combination information based on the first matrix to obtain the related information of the relationship information and the at least two attribute information includes: Based on the first matrix, transform the at least two entity combination information to obtain first related information of the relationship information and the at least two attribute information; Performing standardization processing on the first relevant information to obtain second relevant information; The second related information is normalized to obtain related information between the relationship information and the at least two attribute information.

5. The method according to claim 1, characterized in that The acquiring entity representation information of the first entity based on at least two attribute information of the first entity and the second entity, the relationship information, and the related information includes: Based on at least two first attribute information, at least two second attribute information and the relationship information, obtaining at least two entity representation component information corresponding to the at least two first attribute information, wherein the first attribute information is attribute information of the first entity, and the second attribute information is attribute information of the second entity; Based on the correlation information between the relationship information and the at least two attribute information, the at least two entity representation component information are weighted to obtain entity representation information of the first entity.

6. The method according to claim 1, characterized in that The obtaining of entity information in the knowledge graph includes: Extracting first entity information from the knowledge graph; Performing negative sampling on the knowledge graph to obtain second entity information in which the relationship between the entities is erroneous; The acquiring a target loss value based on the entity representation information of the first entity includes: Based on the entity representation information of the first entity and the target weights corresponding to the first entity information and the second entity information respectively, a target loss value is obtained, and the target loss value is related to the semantic rationality gap between the entity representation information corresponding to the first entity information and the second entity information.

7. The method according to claim 6, characterized in that The acquiring a target loss value based on the entity representation information of the first entity, the target weights respectively corresponding to the first entity information and the second entity information, comprises: Based on the entity representation information of the first entity, obtaining semantic rationality of the entity representation information; According to the target weights corresponding to the first entity information and the second entity information respectively, the semantic rationality of the entity representation information in the two entity information is weighted to obtain the target loss value, the target weight corresponding to the first entity information is a positive number, and the target weight corresponding to the second entity information is a negative number.

8. The method according to claim 7, characterized in that The acquiring, based on the entity representation information of the first entity, the semantic rationality of the entity representation information includes: Based on the second matrix, the entity representation information of the first entity is transformed to obtain the semantic rationality of the entity representation information.

9. The method according to claim 7, characterized in that: The step of weighting the semantic rationality of entity representation information in the two entity information according to the target weights respectively corresponding to the first entity information and the second entity information to obtain the target loss value includes: Obtaining indices corresponding to products of target weights and corresponding semantic rationality corresponding to the first entity information and the second entity information respectively; The sum of logarithms corresponding to the exponents is obtained as the target loss value.

10. The method according to claim 7, characterized in that The loss value obtained by weighting the semantic rationality of the entity representation information in the two entity information is a first loss value; The acquiring a target loss value based on the entity representation information of the first entity, the target weights respectively corresponding to the first entity information and the second entity information, further includes: Obtain at least one of a second loss value or a third loss value, wherein the second loss value is determined based on relevant information corresponding to at least two target entity information in the knowledge graph, the relationship information in the at least two target entity information is the same, and the third loss value is determined based on relevant information between the relationship information and the at least two attribute information; The target loss value is obtained based on the first loss value and at least one of the second loss value or the third loss value.

11. The method according to claim 10, characterized in that The second loss value is determined based on relevant information corresponding to at least two target entity information in the knowledge graph, including: Obtaining a second loss value based on a difference between relevant information corresponding to at least two target entity information in the knowledge graph; The related information between the relationship information and the at least two pieces of attribute information are at least two pieces of related information; the third loss value is determined based on the related information between the relationship information and the at least two pieces of attribute information, including: Obtaining the sum of the relevant information of the largest target quantity among the at least two relevant information; A third loss value is obtained according to the sum of the relevant information and the target value.

12. The method according to claim 1, characterized in that The method further comprises: In response to the function execution instruction, extracting entity representation information of the target entity from the knowledge graph; Based on the entity representation information of the target entity, a corresponding target function is executed.

13. A data processing device, characterized in that: The device comprises: An entity information acquisition module, used to acquire entity information in a knowledge graph, wherein the entity information includes at least two attribute information of a first entity and a second entity and relationship information between the first entity and the second entity; A related information acquisition module, configured to acquire related information about the relationship information and the at least two attribute information of the first entity and the second entity based on the at least two attribute information and the relationship information; a representation information acquisition module, configured to acquire entity representation information of the first entity based on at least two attribute information of the first entity and the second entity, the relationship information, and the related information; A loss acquisition module, configured to acquire a target loss value based on the entity representation information of the first entity, wherein the target loss value is related to the semantic rationality of the entity representation information; An updating module is used to update the relevant information and the entity representation information based on the target loss value until the target condition is met, thereby obtaining the entity representation information of the first entity in the knowledge graph.

14. An electronic device, characterized in that: The electronic device includes one or more processors and one or more memories, wherein the one or more memories store at least one program code, and the at least one program code is loaded and executed by the one or more processors to implement the data processing method according to any one of claims 1 to 12.

15. A computer-readable storage medium, characterized in that: At least one program code is stored in the storage medium, and the at least one program code is loaded and executed by the processor to implement the data processing method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Entity recognition method and device, computer readable storage medium and computer equipment

    CN111241839A

  • Reinforcement learning neural networks grounded in learned visual entities

    US20200104645A1