Entity chain refers to methods, devices, equipment and storage media
Patent Information
- Application Number
- CN202210615571.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-31
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2042-05-31
AI Technical Summary
Existing entity linking methods fail to fully interactively integrate text-side information and graph-side information, resulting in low entity linking accuracy.
Determine the sub-graph information of the target text and candidate entities in the knowledge graph, extract the semantic information of the target text and sub-graph information, and use the attention mechanism to interactively fuse them to obtain the fused semantic information of each sub-graph information, thereby determining the link entity of the entity to be linked in the knowledge graph.
The accuracy of entity chaining is improved, and the precision of entity chaining is enhanced by fully interactively integrating semantic information.
Smart Images

Figure CN115129885B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to an entity linking method, apparatus, device, and storage medium. Background Art
[0002] Internet webpages, such as news and blogs, contain numerous entities. Most webpages lack context or explanation of these entities. To help people better understand the webpage content, entities appearing on the webpage are linked to corresponding entities in the knowledge graph. This process is called entity linking.
[0003] The current entity linking method does not fully interactively integrate text-side information with graph-side information, resulting in low accuracy of entity linking. Summary of the Invention
[0004] The present application provides an entity linking method, apparatus, device and storage medium to improve the accuracy of entity linking.
[0005] In a first aspect, the present application provides an entity linking method, comprising:
[0006] In the knowledge graph, determine the subgraph information of N candidate entities associated with the entity to be linked in the target text, where N is a positive integer;
[0007] Determining the semantic information of the target text and the semantic information of each sub-graph information in the sub-graph information of the N candidate entities;
[0008] Interactively fusing the semantic information of the target text with the semantic information of each sub-graph information to obtain fused semantic information of each sub-graph information;
[0009] According to the fused semantic information of each sub-graph information, the link entity of the to-be-linked entity in the knowledge graph is determined from the N candidate entities.
[0010] In a second aspect, a physical chain finger device is provided, comprising:
[0011] A first determining unit is configured to determine, in the knowledge graph, subgraph information of N candidate entities associated with the entity to be linked in the target text, where N is a positive integer;
[0012] A second determining unit is configured to determine the semantic information of the target text and the semantic information of each sub-graph information in the sub-graph information of the N candidate entities;
[0013] A fusion unit, configured to interactively fuse the semantic information of the target text with the semantic information of each sub-graph information to obtain fused semantic information of each sub-graph information;
[0014] The linking unit is used to determine the linking entity of the entity to be linked in the knowledge graph from the N candidate entities based on the fused semantic information of each sub-graph information.
[0015] In a third aspect, an electronic device is provided, comprising a processor and a memory, wherein the memory is configured to store a computer program, and the processor is configured to call and execute the computer program stored in the memory to execute the method of the first aspect or its implementations.
[0016] In a fourth aspect, a chip is provided for implementing the method described in any one of the first and second aspects above, or in their respective implementations. Specifically, the chip includes a processor configured to load and execute a computer program from a memory, causing a device equipped with the chip to perform the method described in any one of the first aspect above, or in their respective implementations.
[0017] In a fifth aspect, a computer-readable storage medium is provided for storing a computer program, wherein the computer program enables a computer to execute the method of any aspect of the first aspect or its various implementations.
[0018] In a sixth aspect, a computer program product is provided, comprising computer program instructions, wherein the computer program instructions enable a computer to execute the method of any one of the first aspects or its various implementations.
[0019] In a seventh aspect, a computer program is provided, which, when executed on a computer, enables the computer to execute the method in any one of the above-mentioned first aspects or its various implementations.
[0020] In summary, the present application determines the subgraph information of N candidate entities associated with the entity to be linked in the target text in the knowledge graph; determines the semantic information of the target text and the semantic information of each subgraph information in the subgraph information of the N candidate entities; interactively fuses the semantic information of the target text with the semantic information of each subgraph information to obtain the fused semantic information of each subgraph information; and determines the link entity of the entity to be linked in the knowledge graph from the N candidate entities based on the fused semantic information of each subgraph information. That is, the embodiment of the present application extracts the semantic information of the target text and the semantic information of the subgraph information, and interactively fuses the semantic information of the target text with the semantic information of the subgraph information to achieve full interactive fusion of the target text and the subgraph information, and obtains the fused semantic information of the subgraph information. In this way, when performing entity linking based on the fused semantic information of the fully interactively fused subgraph information, the accuracy of entity linking can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 This is a schematic diagram of the knowledge graph involved in the embodiments of this application;
[0023] Figure 2 A schematic diagram of an application scenario involved in an embodiment of the present application;
[0024] Figure 3 A schematic diagram of the entity linking method flow provided in one embodiment of the present application;
[0025] Figure 4A and Figure 4B This is a schematic diagram of sub-graph information involved in an embodiment of the present application;
[0026] Figure 4C It is a schematic diagram of the entity chain finger principle;
[0027] Figure 5 A schematic diagram of determining the semantic information of a target text involved in an embodiment of the present application;
[0028] Figure 6 Schematic diagram of determining semantic information of sub-graph information involved in an embodiment of the present application;
[0029] Figure 7 A schematic diagram of a chain finger method flow chart provided in one embodiment of the present application;
[0030] Figure 8 A schematic diagram of an entity chain finger model provided in an embodiment of the present application;
[0031] Figure 9 Schematic diagram of the training method of the entity chain finger model involved in the embodiment of the present application;
[0032] Figure 10 A schematic diagram of a model training embodiment of the present application;
[0033] Figure 11 is a schematic block diagram of a physical link finger device provided in one embodiment of the present application;
[0034] Figure 12 It is a schematic block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0035] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0036] It should be understood that in the embodiments of the present invention, "B corresponding to A" means that B is associated with A. In one implementation, B can be determined based on A. However, it should also be understood that determining B based on A does not mean determining B based solely on A; B can also be determined based on A and / or other information.
[0037] In the description of the present application, unless otherwise specified, "plurality" means two or more than two.
[0038] In addition, to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. Those skilled in the art will understand that the words "first" and "second" do not limit the quantity or execution order, and the words "first" and "second" do not necessarily mean different.
[0039] To facilitate understanding of the embodiments of the present application, the following briefly introduces the relevant concepts involved in the embodiments of the present application:
[0040] Artificial Intelligence (AI) refers to the theories, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, to perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. AI also studies the design principles and implementation methods of various intelligent machines, enabling them to possess the capabilities of perception, reasoning, and decision-making.
[0041] Artificial intelligence (AI) technology is a comprehensive discipline encompassing a wide range of fields, encompassing both hardware and software technologies. Foundational AI technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, speech processing, natural language processing, and machine learning / deep learning.
[0042] Machine learning (ML) is a multidisciplinary field that encompasses probability theory, statistics, approximation theory, convex analysis, and algorithmic complexity theory. It specifically studies how computers can simulate or implement human learning behaviors to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is at the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications span all areas of AI. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning.
[0043] With the research and advancement of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields, such as intelligent search, intelligent reading, etc., and has played an increasingly important role.
[0044] The following is an introduction to the knowledge graph and entity links involved in the embodiments of this application.
[0045] The knowledge graph is basically composed of several important elements such as entities and relationships between entities. A knowledge graph is composed of multiple subgraphs. Basic graph subgraphs are as follows: Figure 1 As shown in the figure, a subgraph is constructed around the two entities entity id1 and entity id2, where the elements are as follows:
[0046] Entities: id1 and id2;
[0047] Relationship: work, birthplace, etc.;
[0048] Attributes: photo, poster, name, type.
[0049] Specifically, entity id1 is of type person, occupation is singer and actor, and name is Zhao Si. Entity id2 is of type person, occupation is professor, birthplace is Beijing, and name is Zhao Si.
[0050] From the above, we can see that the knowledge graph is essentially a knowledge base of a semantic network, that is, a knowledge base with a directed graph structure.
[0051] In the embodiments of this application, it is hoped that knowledge graphs can be used for knowledge enhancement. For example, in an article about Zhao Si attending a movie press conference, it may be easy to conclude based on the article content that Zhao Si refers to the movie star Zhao Si. However, if the article refers to Zhao Si at a cultural exchange conference, then this entity may refer to Zhao Si, a university professor. In this case, entity linking is required to determine which entity in the knowledge graph Zhao Si refers to.
[0052] Internet webpages, such as news and blogs, contain numerous entities. Most webpages lack context or explanation of these entities. To help people better understand the content, many websites and authors link entities appearing on webpages to corresponding knowledge base entries, providing readers with more detailed background information. This practice effectively establishes a link between entities on the webpage and entities in the knowledge graph, hence the term "entity linking."
[0053] Manually establishing entity linking relationships is extremely laborious, so how to enable computers to automatically implement entity linking has become a key technical prerequisite for the large-scale application of knowledge graphs. For example, when presenting a knowledge graph on a search engine results page, this technology is needed to automatically identify entities in the user's query and link them to the corresponding nodes in the knowledge graph.
[0054] Entity chaining has two main tasks: entity recognition and entity disambiguation.
[0055] Entity recognition aims to identify entities to be linked from text. Typical entities include names of people, places, and organizations. In recent years, efforts have been made to identify a wider range of entity types, such as movie titles and product names.
[0056] The same entity name may correspond to different entities in different contexts. For example, "apple" may refer to a certain fruit, a famous IT company, or even a movie. This polysemy, or ambiguity, is a common problem in natural language. Linking a name appearing in a document to a specific entity is a process called disambiguation. The basic idea behind disambiguation is to fully utilize the context in which a name appears and analyze the probability of different entities appearing in that context.
[0057] Figure 2 This is a schematic diagram of an application scenario involved in an embodiment of the present application, including a terminal device 101 and a server 102.
[0058] The terminal device 101 may include, but is not limited to, a PC (Personal Computer), a PDA (Tablet Computer), a mobile phone, a wearable smart device, etc. The device is often equipped with a display device, which may be a display, a screen, a touch screen, etc. The touch screen may also be a touch screen, a touch panel, etc. The display device may be used to display the registration results of the target, etc.
[0059] The server 102 may be one or more servers. When there are multiple servers 102, there are at least two servers for providing different services, and / or there are at least two servers for providing the same service, such as providing the same service in a load balancing manner, which is not limited in this embodiment of the present application. The above-mentioned server 102 may 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 (Content Delivery Network), and big data and artificial intelligence platforms. Server 102 may also become a node of the blockchain.
[0060] The terminal device 101 and the server 102 can be connected directly or indirectly through wired communication or wireless communication, which is not limited in this application.
[0061] In some embodiments, the server 102 of the embodiment of the present application can implement training of the network model involved in the embodiment of the present application, such as training the language module, and storing the trained language module and graph encoding module. Optionally, the graph encoding module can also be trained and the trained graph encoding module can be stored. Among them, the language module is used to extract the semantic information of the target text. The graph encoding module is used to encode the sub-graph information of the candidate entity to obtain the semantic information of the sub-graph information.
[0062] In some embodiments, the registration method of the embodiment of the present application can be performed by the terminal device 101, which stores the knowledge graph, or the terminal device 101 can read the knowledge graph from other storage devices. In this way, the terminal device 101 can load the network model in the server 102, and through the method of the embodiment of the present application, query the knowledge graph to obtain the linking entity of the to-be-linked entity in the target text, and link the linking entity to the linking entity in the knowledge graph.
[0063] In some embodiments, the registration method of the embodiment of the present application can be completed by the server 102, which stores the knowledge graph, or the server 102 can read the knowledge image from other storage devices. In this way, the terminal device 101 sends the target text to the server 102, and the server 102 identifies the entity to be linked in the target text, and through the method of the embodiment of the present application, searches the knowledge image to obtain the linking entity of the entity to be linked in the target text, and links the linking entity to the linking entity in the knowledge graph.
[0064] In some embodiments, the entity linking method of the embodiment of the present application can be jointly completed by the terminal device 101 and the server 102. For example, the server 102 performs operations related to the network model, and the terminal device 101 performs other operations except the network model. Exemplarily, the terminal device 101 determines the entity to be linked in the target text, and sends the entity to be linked and the target text to the server 102. The server 102 uses the semantic model to determine the semantic information of the target text, and determines the semantic information of each sub-graph information in the sub-graph information of the N candidate entities through the graph encoding module. Then, based on the attention mechanism, the server 102 interactively fuses the semantic information of the target text with the semantic information of each sub-graph information to obtain the fused semantic information of each sub-graph information, and finally determines the link entity of the entity to be linked in the knowledge graph from the N candidate entities based on the fused semantic information of each sub-graph information. Then, the server 102 sends the relevant information of the link entity of the entity to be linked in the knowledge graph to the terminal device 101 for display.
[0065] It should be noted that the application scenarios of the embodiments of the present application include but are not limited to Figure 2 shown.
[0066] The embodiments of this application can be applied to any field that requires entity linking. For example, the technical solution of this application can be applied to the field of intelligent indexing, such as linking entities in a query to related entities in a knowledge graph to complete intelligent search. For another example, the implementation of this application can also be applied to web pages, such as linking entities in a web page to related entities in a knowledge graph to facilitate reading comprehension of the web page.
[0067] The current entity linking method is to directly concatenate the text-side information v1 = fun_embedding(content+title) and the graph-side information v2 = fun_embedding2(sub_graph) to obtain the concatenated information fusion = [v1:v2], and perform category judgment judge_classify(fusion) based on the concatenated information fusion = [v1:v2] to determine the consistency between the entities in the text-side information and the entities in the graph-side information.
[0068] From the above, we can see that the current entity linking method simply splices text-side information with graph-side information without sufficient interactive integration, which results in low accuracy of entity linking.
[0069] In order to solve the above technical problems, an embodiment of the present application determines the sub-graph information of N candidate entities associated with the entity to be linked in the target text in the knowledge graph, then determines the semantic information of the target text and the semantic information of each sub-graph information in the sub-graph information of the N candidate entities, and then based on the attention mechanism, interactively fuses the semantic information of the target text with the semantic information of each sub-graph information to obtain the fused semantic information of each sub-graph information, and finally determines the link entity of the entity to be linked in the knowledge graph from the N candidate entities based on the fused semantic information of each sub-graph information. That is, an embodiment of the present application realizes full interactive fusion of the target text and the sub-graph information by extracting the semantic information of the target text and the semantic information of the sub-graph information, and interactively fuses the semantic information of the target text with the semantic information of the sub-graph information, so that when performing entity linking based on the fused semantic information obtained by the full interactive fusion, the accuracy of entity linking can be achieved.
[0070] The following describes the technical solutions of the embodiments of the present application in detail through some embodiments. The following embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0071] Figure 3 A flow chart of an entity linking method provided in one embodiment of the present application.
[0072] The execution subject of the embodiments of the present application is a device having an entity linking function, such as an entity linking device. In some embodiments, the entity linking device may be a server. In some embodiments, the entity linking device may be a terminal device. In some embodiments, the entity linking device may be a system consisting of a server and a terminal device. Both the server and the terminal device can be understood as electronic devices. Therefore, for ease of description, the following description will be made using the execution subject as an electronic device as an example.
[0073] like Figure 3 As shown, the method of the embodiment of the present application includes:
[0074] S301. In the knowledge graph, determine the subgraph information of N candidate entities associated with the entity to be linked in the target text, where N is a positive integer.
[0075] The target text of the embodiment of the present application can be the search content entered in the search box, that is, the query, or a sentence in a web page, or a paragraph of an article. The embodiment of the present application does not limit the specific method of obtaining the target text.
[0076] The above target text includes at least one entity, which can be a person's name, a movie name, a plant name, an animal name, a building name, a place name, an organization name, etc. The embodiment of the present application does not limit the specific type of the entity.
[0077] The embodiment of the present application performs entity recognition on the target text to obtain at least one entity in the target text. For example, the target text is input into a pre-trained entity recognition model, and the entity recognition model can recognize at least one entity in the target text.
[0078] In some embodiments, one of the at least one entities in the identified target text may be used as an entity to be linked to execute the method of the embodiment of the present application.
[0079] The to-be-linked entity in the embodiment of the present application can be understood as an entity in the target text that needs to establish a link relationship with an entity in the knowledge graph. Correspondingly, the to-be-linked entity in the knowledge graph can be understood as an entity in the knowledge graph that establishes a link relationship with the to-be-linked entity.
[0080] It should be noted that in the embodiment of the present application, the method for determining the linked entity in the knowledge graph for each entity in at least one entity in the target text is the same. For the sake of convenience of description, an entity in the target text in the embodiment of the present application is used as an example of the entity to be linked.
[0081] After determining the entity to be linked in the target text, in the knowledge graph, subgraph information of N candidate entities associated with the entity to be linked in the target text is determined.
[0082] In the embodiment of the present application, the candidate entity associated with the entity to be linked can be understood as an entity having the same strokes or the same pronunciation as the entity to be linked.
[0083] Specifically, the knowledge graph is searched for entities with the same strokes or pronunciation as the entity to be linked in the target text, thereby obtaining N candidate entities. Then, for each of the N candidate entities, the graph information of the candidate entity is obtained in the knowledge graph, thereby obtaining the subgraph information of the candidate entity.
[0084] In some embodiments, the sub-graph information of a candidate entity may be a graph within one or two hops directly associated with the candidate entity.
[0085] For example, assuming the target text is "Zhao Si attended the cultural exchange meeting held in Beijing tonight", the entity to be linked is "Zhao Si". Based on the entity to be linked, the sub-graph information of the two candidate entities related to the entity to be linked is queried in the knowledge graph. For example, Figure 4A and Figure 4B As shown. Figure 4C As shown in the figure, the entity to be linked in the target text is "Zhao Si" and Figure 4A and Figure 4B The two candidate entities in the table are linked to each other, the linking entity of the entity to be linked is determined, the consistency ranking of the two candidate entities is obtained, and the candidate entity with the greatest consistency is determined as the linking entity of the entity to be linked in the knowledge graph.
[0086] S302: Determine the semantic information of the target text and the semantic information of each sub-graph information in the sub-graph information of the N candidate entities.
[0087] In an embodiment of the present application, in order to improve the accuracy of entity linking, by determining the semantic information of the target text and the semantic information of each sub-graph information in the sub-graph information of N candidate entities, the linking entity of the entity to be linked in the target text in the knowledge graph is accurately determined based on the semantic information of the target text and the semantic information of each sub-graph information in the sub-graph information of N candidate entities.
[0088] It should be noted that the embodiment of the present application does not limit the order of determining the semantic information of the target text and determining the semantic information of the sub-graph information.
[0089] The embodiments of the present application do not limit the specific method of determining the semantic information of the target text.
[0090] In a possible implementation, semantic encoding is performed on the target text by a language module to obtain semantic information of the target text.
[0091] The embodiment of the present application does not limit the specific network structure of the above-mentioned language module.
[0092] In Example 1, the language module can be a BERT (Bidirectional Encoder Representations from Transformer) model. This involves inputting the target text into the BERT model to determine the semantic information of the target text.
[0093] In one possible implementation, the target text and the entities to be linked in the target text are input into the BERT model for semantic analysis to obtain the semantic information of the target text.
[0094] For example, the input of the BERT model is: {"mention":"entity to be linked","content_m":"target text"}.
[0095] For example, Figure 5 As shown in the figure, the target text is "Zhao Si attended the cultural exchange meeting held in Beijing tonight", and the entity to be linked is "Zhao Si". The input of the BERT model is: {"mention":"Zhao Si","content_m":"Zhao Si attended the cultural exchange meeting held in Beijing tonight"}.
[0096] In some embodiments, the output vector corresponding to the CLS (classification) flag in the BERT model can reflect the semantic information of the entire input. Therefore, in embodiments of the present application, the output vector corresponding to the CLS in the BERT model can be determined as the semantic information of the target text. At this time, the semantic information of the target text determined in the BERT model can be expressed as shown in formula (1):
[0097] T_emb = BERT(mention+content) (1)
[0098] Among them, T_emb is the semantic information of the target text, that is, the output vector corresponding to CLS in the BERT model, mention represents the entity to be linked, and content represents the target text.
[0099] In Example 2, the language module can be an LSTM (Long Short-Term Memory) model. The target text is input into the LSTM to determine the semantic information of the target text.
[0100] For example, the input of the LSTM model is: {“mention”: “entity to be linked”, “content_m”: “target text”}.
[0101] In some embodiments, the output vector corresponding to the last token in the LSTM model can reflect the semantic information of the entire input. Therefore, in the embodiment of the present application, the output vector corresponding to the last token in the LSTM model can be determined as the semantic information of the target text. At this time, the semantic information of the target text determined by the LSTM model can be expressed as shown in formula (2):
[0102] T_emb = LSTM(mention +content) (2)
[0103] Among them, T_emb is the semantic information of the target text, that is, the output vector corresponding to the last token in the LSTM model.
[0104] In addition to the above-mentioned BERT and LSTM models, the language module in the embodiment of the present application can also be other language modules, and the embodiment of the present application does not limit this.
[0105] The embodiment of the present application does not limit the specific method of determining the semantic information of each sub-graph information in the sub-graph information of the N candidate entities in the above S302.
[0106] For example, the semantic information in the sub-graph information is determined through a neural network model. For example, the feature representation of each node in the sub-image information is input into the neural network model for node semantic analysis to obtain the semantic information of the sub-graph information.
[0107] In the entity linking method of some embodiments, the processing of the entity surrounding information of the sub-graph is relatively rough. Usually, the information of the nodes in the sub-graph is spliced together by splicing. However, the splicing method itself is disordered, and the topological information of the sub-graph itself is lost, which makes the entity linking inaccurate.
[0108] To solve this technical problem, in some embodiments, when determining the semantic information of the sub-graph information, the topological information of the sub-graph is taken into account. That is, the above-mentioned step S302 of determining the semantic information of each sub-graph information in the sub-graph information of N candidate entities includes the following step S302-A:
[0109] S302-A. For the i-th candidate entity among N candidate entities, determine the semantic information of the sub-graph information of the i-th candidate entity based on the topological information of the sub-graph information of the i-th candidate entity, where i is a positive integer less than or equal to N.
[0110] From the above, it can be seen that a sub-graph includes multiple nodes and edges between nodes. Therefore, in an embodiment of the present application, the semantic information of the sub-graph information includes at least one of the semantic information of each node and the semantic information of the edge included in the sub-graph.
[0111] In an embodiment of the present application, the process of determining the semantic information of the sub-graph information of each candidate entity among N candidate entities is the same. For the sake of convenience of description, the process of determining the semantic information of the sub-graph information of the i-th candidate entity among N candidate entities is used as an example to illustrate.
[0112] The entity association information in the subgraph information itself has topological information. In the embodiment of the present application, in order to prevent the loss of topological information in the subgraph information, taking the subgraph information of the i-th candidate entity as an example, the semantic information of the i-th candidate entity's subgraph information is determined based on the topological information of the i-th candidate entity's subgraph information, and the determined semantic information retains the topological information of the i-th candidate entity's subgraph information. In this way, when performing entity chaining based on the semantic information that retains the topological information, the accuracy of entity chaining can be further improved.
[0113] Specific methods for determining the semantic information of the sub-graph information of the i-th candidate entity based on the topological information of the sub-graph information of the i-th candidate entity in S302-A include but are not limited to the following:
[0114] Method 1: The topological information of the subgraph information of the i-th candidate entity and the node information of the subgraph information of the i-th candidate entity are used as inputs of the neural network model. The semantic vector of each node in the subgraph information of the i-th candidate entity is determined through the neural network model. The semantic vector of each node in the subgraph information constitutes the semantic information of the subgraph information. That is, during the training process of the neural network model, the topological information and node information of the subgraph information are used as inputs for training. During the training process, the neural network model learns the topological information of the subgraph information. In this way, when the trained neural network model is used to determine the semantic information of the subgraph information of the i-th candidate entity, the topological information of the subgraph information of the i-th candidate entity and the node information of the subgraph information of the i-th candidate entity are input into the trained neural network model. The neural network model can output the semantic information of the subgraph information of the i-th candidate entity based on the topological information.
[0115] Method 2: Input the subgraph information of the i-th candidate entity with topological information into the graph encoding module for encoding to obtain the semantic information of the subgraph information of the i-th candidate entity. Figure 4A and Figure 4BAs can be seen, subgraph information itself has topological information. Therefore, in the embodiment of the present application, the topological information of the subgraph information of the i-th candidate entity is input into the graph encoding module for semantic encoding, thereby obtaining the semantic information of the i-th candidate entity's subgraph information. This semantic information contains the topological information of the i-th candidate entity's subgraph information. In this way, when performing entity chaining based on semantic information with topological information, the accuracy of entity chaining can be further improved.
[0116] The embodiment of the present application does not limit the specific network structure of the above-mentioned graph encoding module.
[0117] In some embodiments, the graph encoding module is a graph convolutional network (GCN). That is, in this embodiment of the present application, the topological information of the subgraph information of the i-th candidate entity is input into the GCN for semantic encoding to obtain the semantic information of the subgraph information of the i-th candidate entity.
[0118] For example Figure 6 As shown, assuming that the subgraph information of the i-th candidate entity is as follows Figure 4A As shown, Figure 4A The sub-graph information of the i-th candidate entity shown is input into GCN for semantic analysis to obtain the semantic information of the sub-graph information of the i-th candidate entity. Figure 6 The semantic information of the sub-graph information shown is the semantic information of the four nodes in the sub-graph information. However, the semantic information of the sub-graph information includes not only the semantic information of the nodes, but also the semantic information of the edges between the nodes.
[0119] In one example, if the semantic information of the subgraph of the i-th candidate entity includes the semantic information of the nodes and the semantic information of the edges between the nodes, the semantic information of the subgraph information determined by GCN can be shown as formula (3):
[0120] Nodei|Sidej = GCN(sub_graph) (3)
[0121] Among them, Nodei represents the semantic information of the i-th node in the subgraph information, Sidej represents the semantic information of the j-th edge in the subgraph information, and sub_graph is the subgraph.
[0122] In some embodiments, the graph encoding module may also be other graph encoders, such as node2vec.
[0123] According to the above method, the semantic information of the target text and the semantic information of the sub-graph information of each candidate entity in the N candidate entities are determined. Then, the following step S303 is executed.
[0124] S303: Interactively fuse the semantic information of the target text with the semantic information of each sub-graph information to obtain the fused semantic information of each sub-graph information.
[0125] In an embodiment of the present application, the semantic information of the target text and the semantic information of the sub-graph information of each candidate entity in N candidate entities are determined through the above steps. Then, the semantic information of the target text is interactively fused with the semantic information of each sub-graph information to obtain the fused semantic information of each sub-graph information. When entity chaining is performed based on the fused semantic information after full interaction of the information, the accuracy of entity chaining can be improved.
[0126] The implementation methods of S303 include but are not limited to the following:
[0127] Method 1: Input the semantic information of the target text and the semantic information of the sub-graph information into the feature fusion module to fuse the semantic information of the sub-graph information with the semantic information of the target text to obtain the fused semantic information of the sub-graph information.
[0128] The embodiment of the present application does not limit the specific network structure of the feature fusion module. For example, the feature fusion module includes at least one convolution layer.
[0129] Mode 2: The above S303 includes the following S303-A:
[0130] S303-A: Based on the attention mechanism, the semantic information of the target text is interactively fused with the semantic information of each sub-graph information to obtain the fused semantic information of each sub-graph information.
[0131] In this method 2, in order to prevent information overload, improve computing performance, and achieve effective fusion of the semantic information of the target text and the semantic information of the sub-graph information, the embodiment of the present application uses an attention mechanism to interactively fuse the key information of the semantic information of the target text and the semantic information of the sub-graph information, reduce attention to other information, and even filter out irrelevant information, thereby solving the problem of information overload and improving the efficiency and accuracy of information fusion.
[0132] In the embodiment of the present application, there is no limitation on the specific implementation of the above S303-A.
[0133] In one possible implementation, taking the i-th candidate entity among N candidate entities as an example, the semantic information of the target text and the semantic information of the sub-graph information of the i-th candidate entity are input into a pre-trained attention mechanism module for information fusion interaction to obtain the fused semantic information of the sub-graph information.
[0134] In another possible implementation, the above S303-A includes the following steps S303-A1 and S303-A2:
[0135] S303-A1, based on the attention mechanism, processing the semantic information of the target text to obtain the attention information of the target text;
[0136] S303-A2. For the i-th candidate entity among N candidate entities, the attention information of the target text is fused with the semantic information of the sub-graph information of the i-th candidate entity to obtain the fused semantic information of the sub-graph information of the i-th candidate entity, where i is a positive integer less than or equal to N.
[0137] In this approach, the semantic information of the target text is processed based on the attention mechanism, but the semantic information of the sub-graph information is not processed by the attention mechanism.
[0138] The embodiment of the present application does not limit the specific method of processing the semantic information of the target text based on the attention mechanism in the above S303-A1 to obtain the attention information of the target text.
[0139] For example, the semantic information of the target text is input into the trained attention module for processing to obtain the attention information of the target text.
[0140] The embodiment of the present application does not limit the specific network structure of the above-mentioned attention module.
[0141] In one example, the above S303-A1 includes the following steps:
[0142] S303-A11, mapping the semantic information of the target text through the mapping parameter matrix in the attention module to obtain semantic mapping information of the target text;
[0143] S303-A12: Determine the attention information of the target text based on the semantic mapping information.
[0144] In an embodiment of the present application, the attention module can implement feature mapping, that is, the attention module includes a mapping parameter matrix, through which the semantic information of the target text is mapped to obtain the semantic mapping information of the target text.
[0145] For example, the semantic information of the target text is mapped by the following formula (4):
[0146] X = W*T_emb + b (4)
[0147] Among them, X is the semantic mapping information of the target text, W is the mapping parameter matrix, T_emb is the semantic information of the target text, and b is the bias constant.
[0148] In some embodiments, the dimension of W is m*k, where m is the dimension of T_emb and k is the number of nodes in the subgraph information. The dimension of b is k, so after mapping according to the above formula (4), a vector X of size k is obtained.
[0149] After the semantic mapping information of the target text is determined according to the above formula (4), the attention information of the target text is determined according to the semantic mapping information of the target text.
[0150] For example, the semantic mapping information of the target text is determined as the attention information of the target text.
[0151] For another example, the semantic mapping information is normalized to obtain normalized semantic mapping information; and the attention information of the target text is determined based on the normalized semantic mapping information.
[0152] In one example, the semantic mapping information of the target text is normalized according to the following formula (5):
[0153] Att_emb=exp(X)(5)
[0154] Among them, Att_emb is the normalized semantic mapping information of the target text, exp is the normalization function, and the calculation formula of exp is e(-x_i) / sum[e-(x_j)], where x_i is the i-th element in the semantic mapping information of the target text, and x_j is the i-th element in the semantic mapping information of the target text.
[0155] Optionally, the embodiment of the present application may also normalize the semantic mapping information through other normalization methods to obtain normalized semantic mapping information.
[0156] Next, the attention information of the target text is determined based on the normalized semantic mapping information.
[0157] For example, the normalized semantic mapping information of the target text is determined as the attention information of the target text.
[0158] For another example, other methods are used to process the normalized semantic mapping information of the target text to determine the attention information of the target text.
[0159] According to the above method, after determining the attention information of the target text, execute the above S303-A2. For the i-th candidate entity among the N candidate entities, the attention information of the target text is fused with the semantic information of the sub-graph information of the i-th candidate entity to obtain the fused semantic information of the sub-graph information of the i-th candidate entity.
[0160] For example, the attention information of the target text is fused with the semantic information of the sub-graph information of the i-th candidate entity by adding, splicing, or other fusion methods to obtain the fused semantic information of the sub-graph information of the i-th candidate entity.
[0161] For another example, the attention information of the target text is multiplied by the semantic information of the sub-graph information of the i-th candidate entity to obtain the fused semantic information of the sub-graph information of the i-th candidate entity.
[0162] Exemplarily, the fusion semantic information of the sub-graph information is determined according to the following formula (6):
[0163] Graph_emb=sum[att_k*node_k],k=1,2...K(6)
[0164] Among them, Graph_emb is the fused semantic information of the sub-graph information, att_k is the k-th element in the attention information of the target text, node_k is the semantic information of the k-th node in the sub-graph information, and the sub-graph includes K nodes.
[0165] According to the above method, the semantic information of the sub-graph information of each candidate entity among the N candidate entities is interactively fused with the semantic information of the target text to obtain the fused semantic information of each sub-graph information, and then the following step S304 is executed.
[0166] S304. Determine the link entity of the entity to be linked in the knowledge graph from N candidate entities based on the fused semantic information of each sub-graph information.
[0167] In an embodiment of the present application, the semantic information of the target text and the semantic information of the sub-graph information of each candidate entity among N candidate entities are determined, and then the semantic information of the target text and the semantic information of each sub-graph information are interactively fused to achieve a full interactive fusion of text-side information and graph-side information. In this way, based on the fused semantic information of the fully interactive fusion of information, the linking entity of the entity to be linked in the target text can be accurately determined from the N candidate entities, thereby improving the accuracy of entity linking.
[0168] The embodiment of the present application does not limit the specific implementation of the above S304.
[0169] In some embodiments, the above S304 includes the following steps:
[0170] S304-A1. For the i-th candidate entity among the N candidate entities, determine the consistency information between the i-th candidate entity and the entity to be linked based on the fused semantic information of the i-th candidate entity's subgraph information.
[0171] The consistency information is used to indicate whether the i-th candidate entity is consistent with the entity to be linked.
[0172] In one example, the consistency information may be a binary value. For example, if the consistency information between the i-th candidate entity and the entity to be linked is 1, it indicates that the i-th candidate entity is consistent with the entity to be linked; if the consistency information between the i-th candidate entity and the entity to be linked is 0, it indicates that the i-th candidate entity is inconsistent with the entity to be linked.
[0173] In another example, the consistency information is a value between 0 and 1. For example, if the consistency information between the i-th candidate entity and the entity to be linked is greater than or equal to a preset value (e.g., 0.8), it indicates that the i-th candidate entity is consistent with the entity to be linked; if the consistency information between the i-th candidate entity and the entity to be linked is less than the preset value, it indicates that the i-th candidate entity is inconsistent with the entity to be linked. The embodiment of the present application does not limit the specific value of the above-mentioned preset value, which is determined according to actual needs.
[0174] In the embodiment of the present application, the method of determining the fusion semantic information of the sub-graph information of each candidate entity among N candidate entities is consistent. For the sake of convenience of description, the i-th candidate entity among the N candidate entities is used as an example for explanation.
[0175] In an embodiment of the present application, the consistency information between each candidate entity in the N candidate entities and the entity to be linked is determined by fusing the semantic information of the sub-graph information of each candidate entity in the N candidate entities, and then based on the consistency information, the link entity of the entity to be linked in the knowledge graph is determined from the N candidate entities.
[0176] The embodiment of the present application does not limit the specific method of determining the consistency information between the i-th candidate entity and the entity to be linked based on the fused semantic information of the sub-graph information of the i-th candidate entity in the above S304-A1.
[0177] In some embodiments, the fused semantic information of the sub-graph information of the i-th candidate entity is input into the discrimination module for consistency discrimination to obtain consistent information between the i-th candidate entity and the entity to be linked.
[0178] In some embodiments, the above S304-A1 includes the following steps S304-A11 and S304-A12:
[0179] S304-A11. Fuse the fused semantic information of the sub-graph information of the i-th candidate entity with the semantic information of the target text to obtain target fused semantic information.
[0180] For example, the fused semantic information of the sub-graph information of the i-th candidate entity is spliced with the semantic information of the target text to obtain the target fused semantic information.
[0181] For another example, the fused semantic information of the sub-graph information of the i-th candidate entity is added to the semantic information of the target text to obtain the target fused semantic information.
[0182] For another example, the fused semantic information of the sub-graph information of the i-th candidate entity is multiplied with the semantic information of the target text to obtain the target fused semantic information.
[0183] S304-A12: Determine the consistency information between the i-th candidate entity and the entity to be linked based on the target fusion semantic information.
[0184] In the embodiment of the present application, the above method is used to fully interactively fuse the target text on the text side with the sub-graph information of the candidate entity on the graph side for each of the N candidate entities, thereby obtaining the target fused semantic information of the sub-graph information of each candidate entity in the N candidate entities. In this way, when performing entity chaining based on this target fused semantic information, the accuracy of entity chaining can be improved.
[0185] The embodiments of the present application do not limit the specific methods of determining the consistency information between the i-th candidate entity and the entity to be linked based on the target fusion semantic information of the sub-graph information of the i-th candidate entity.
[0186] In some embodiments, the target fusion semantic information of the sub-graph information of the i-th candidate entity is input into a pre-trained discriminant module, and the discriminant module can predict the consistency information between the i-th candidate entity and the entity to be linked.
[0187] The embodiment of the present application does not limit the specific network structure of the above-mentioned discrimination module.
[0188] In a possible implementation, the discrimination module may be a classification module, that is, the classification module is used to perform classification processing on the target fusion semantic information to obtain consistency information between the i-th candidate entity and the entity to be linked.
[0189] For example, the target fusion semantic information of the sub-graph information of the i-th candidate entity is input into the classification module for binary classification processing to obtain the classification result of the i-th candidate entity, and the classification result is determined as the consistency information between the i-th candidate entity and the entity to be linked. Exemplarily, if the classification result of the i-th candidate entity is 1, it indicates that the i-th candidate entity is consistent with the entity to be linked, and if the classification result of the i-th candidate entity is 0, it indicates that the i-th candidate entity is inconsistent with the entity to be linked.
[0190] The above embodiment takes the determination of consistency information between the i-th candidate entity and the entity to be linked among N candidate entities as an example. With reference to the i-th candidate entity, consistency information between each candidate entity and the entity to be linked among the N candidate entities can be determined. Then, the following S304-A2 is executed.
[0191] S304-A2. According to the consistency information between each candidate entity and the entity to be linked among the N candidate entities, determine the linking entity of the entity to be linked in the knowledge graph from the N candidate entities.
[0192] For example, among N candidate entities, the candidate entity whose consistent information is greater than a preset threshold is determined as the link entity to be linked in the knowledge graph.
[0193] For example, when the consistency information is a binary classification result, the candidate entity with a component result of 1 among the N candidate entities can be determined as the link entity of the entity to be linked in the knowledge graph.
[0194] The entity linking method provided in the embodiment of the present application determines, in the knowledge graph, the subgraph information of N candidate entities associated with the entity to be linked in the target text; determines the semantic information of the target text and the semantic information of each subgraph information in the subgraph information of the N candidate entities; interactively fuses the semantic information of the target text with the semantic information of each subgraph information to obtain the fused semantic information of each subgraph information; and determines the linking entity of the entity to be linked in the knowledge graph from the N candidate entities based on the fused semantic information of each subgraph information. That is, the embodiment of the present application extracts the semantic information of the target text and the semantic information of the subgraph information, and interactively fuses the semantic information of the target text with the semantic information of the subgraph information to achieve full interactive fusion of the target text and the subgraph information, and obtains the fused semantic information of the subgraph information. In this way, when performing entity linking based on the fused semantic information of the fully interactively fused subgraph information, the accuracy of entity linking can be improved.
[0195] Figure 7 A schematic flow chart of a chain finger method provided in one embodiment of the present application is provided. Figure 8 This is a schematic diagram of an entity chain finger model provided in an embodiment of the present application. Figure 7 The chain finger method shown is achieved by Figure 8 The entity chain shown indicates that the model is complete.
[0196] like Figure 8As shown, the entity linking model of the embodiment of the present application includes a language module, a graph encoding module, an attention module and a classification module. Among them, the language module is used to extract the semantic information of the target text, the graph encoding module is used to extract the semantic information of each sub-graph information in the sub-graph information of N candidate entities, the attention module is used to process the semantic information of the target text, and the classification module is used to predict the consistency information between each candidate entity in the N candidate entities and the entity to be linked.
[0197] like Figure 7 As shown, the embodiment of the present application includes:
[0198] S401. In the knowledge graph, determine the subgraph information of N candidate entities associated with the entity to be linked in the target text, where N is a positive integer.
[0199] The specific implementation process of the above S401 refers to the description of the above S301 and will not be repeated here.
[0200] S402: Determine the semantic information of the target text through the language module.
[0201] For example, the target text is input into a trained language module for semantic analysis to obtain the semantic information of the target text.
[0202] For another example, the target text and the entities to be linked in the target text are taken as input and input into a trained language module for semantic analysis to obtain the semantic information of the target text.
[0203] The embodiment of the present application does not limit the specific network structure of the above-mentioned language module.
[0204] In one possible implementation, the language module may be a BERT model.
[0205] The specific implementation of the above S402 can refer to the description of the above S302 and will not be repeated here.
[0206] S403. Determine the semantic information of each sub-graph information in the sub-graph information of the N candidate entities through the graph encoding module.
[0207] In an embodiment of the present application, sub-graph information with topological information is input as input to a graph encoding module, so that the graph encoding module performs semantic analysis based on the topological information of the sub-graph information, thereby making the semantic information of the obtained sub-graph information implicitly contain topological information. In this way, when entity linking is performed based on the semantic information of the sub-graph information, the accuracy of entity linking can be improved.
[0208] The embodiment of the present application does not limit the specific network structure of the above-mentioned graph encoding module.
[0209] In a possible implementation, the graph encoding module may be a GCN model.
[0210] The specific implementation of the above S403 can refer to the description of Method 2 in the above S302-A, which will not be repeated here.
[0211] S404: Process the semantic information of the target text through the attention module to obtain the attention information of the target text.
[0212] For example, the semantic information of the target text is fully connected and normalized through the attention module to obtain the attention information of the target text.
[0213] For example, the full connection mapping and normalization are performed according to the following formula (7) to obtain the attention information of the target text:
[0214] Att_emb=exp(W*T_emb+b)(7)
[0215] Among them, Att_emb is the attention information of the target text, exp() is the normalization function, T_emb is the semantic information of the target text, W is the mapping parameter matrix, and b is the bias constant.
[0216] S405. For the i-th candidate entity among the N candidate entities, multiply the attention information of the target text by the semantic information of the sub-graph information of the i-th candidate entity to obtain the fused semantic information of the sub-graph information of the i-th candidate entity.
[0217] In an embodiment of the present application, the semantic information of the target text is processed through an attention mechanism to obtain the attention information of the target text, so that the attention information of the target text is multiplied by the semantic information of the sub-graph information to achieve full interactive fusion of the target text and the sub-graph information, and obtain the fused semantic information of the sub-graph information. In this way, when performing entity linking based on the fused semantic information of the fully interactively fused sub-graph information, the accuracy of entity linking can be improved.
[0218] S406: Concatenate the fused semantic information of the sub-graph information of the i-th candidate entity with the semantic information of the target text to obtain target fused semantic information.
[0219] S407 , classifying the target fusion semantic information through a classification module to obtain consistency information between the i-th candidate entity and the entity to be linked.
[0220] Optionally, the classification module may include a classification function, such as a sigmoid function, and binary classification is achieved through the sigmoid function.
[0221] S408. According to the consistency information between each candidate entity and the entity to be linked among the N candidate entities, determine the link entity of the entity to be linked in the knowledge graph from the N candidate entities.
[0222] For example, among N candidate entities, the candidate entity whose consistency information is greater than a preset threshold is determined as the link entity to be linked in the knowledge graph.
[0223] In an embodiment of the present application, the semantic information of the target text is determined by the language module, and the semantic information of each sub-graph information in the sub-graph information of the N candidate entities is determined by the graph encoding module, so that the semantic information of the determined sub-graph information implicitly includes the topological information of the sub-graph. Then, the semantic information of the target text is processed by the attention module to obtain the attention information of the target text, and for the i-th candidate entity among the N candidate entities, the attention information of the target text is multiplied by the semantic information of the sub-graph information of the i-th candidate entity to obtain the fused semantic information of the sub-graph information of the i-th candidate entity, thereby realizing the effective interaction of the information on the text side and the graph side. Then, the target fused semantic information is classified and processed by the classification module to obtain the consistency information of the i-th candidate entity and the entity to be linked. Finally, based on the consistency information, the link entity of the entity to be linked in the knowledge graph is accurately determined from the N candidate entities, thereby improving the accuracy of the entity link.
[0224] The above Figure 7 In the entity linking process shown in Figure 8 The entity chain finger model is the trained entity chain finger model.
[0225] The following is the above Figure 8 The training process of the entity chain finger model shown is introduced.
[0226] Figure 9 Schematic diagram of the training method of the entity chain finger model involved in the embodiment of this application. Figure 10 This is a model training diagram of an embodiment of the present application. Figure 9 and Figure 10 Shown, including:
[0227] S501: Obtain training data.
[0228] In an embodiment of the present application, the training data includes multiple training samples, each training sample includes training text, training sub-graph information, and a label, where the label is used to indicate whether an entity in the training text is consistent with an entity in the training sub-graph information.
[0229] For example, assuming that the training text is "Zhao Si attended the cultural exchange meeting held in Beijing tonight", the training sub-graph information is as follows: Figure 4AAs shown, it includes 4 nodes: entity: id1, name: Zhao Si, job: singer, type: person.
[0230] Based on this, in one example, the format of the training sample Sample is as follows:
[0231] Sample = [{“mention”:”Zhao Si”,”content_m”:”Zhao Si attended the cultural exchange meeting held in Beijing tonight”},{“id”:”id1”,“name”:”Zhao Si”,”Occupation”:”Singer”…},[{“label”:1}]].
[0232] From the above example, we can see that each training sample consists of training text information {"mention":"Zhao Si","content_m":"Zhao Si attended the cultural exchange meeting held in Beijing tonight"}, training sub-graph information {"id":"id1","name":"Zhao Si","job":"singer"...}, and label {"label":1}.
[0233] The training sub-graph information is usually the sub-graph information within one or two hops of the associated entity in the graph of the entity in the training text.
[0234] S502: Perform semantic analysis on the training text through the language module to obtain semantic information of the training text.
[0235] For example, the training text is input into the language module for semantic analysis to obtain the semantic information of the training text.
[0236] For another example, the training text and entities in the training text are taken as input and input into the language module for semantic analysis to obtain the semantic information of the training text.
[0237] The embodiment of the present application does not limit the specific network structure of the above-mentioned language module.
[0238] In one possible implementation, the language module may be a BERT model.
[0239] The specific implementation of the above S502 can refer to the description of the above S302 and will not be repeated here.
[0240] S503: Determine the semantic information of the training sub-graph information through the graph encoding module.
[0241] In the embodiment of this application, Figure 10As shown, the training sub-graph information with topological information is taken as input and input into the graph encoding module, so that the graph encoding module performs semantic analysis based on the topological information of the training sub-graph information, thereby making the semantic information of the obtained training sub-graph information implicitly contain topological information.
[0242] The embodiment of the present application does not limit the specific network structure of the above-mentioned graph encoding module.
[0243] In a possible implementation, the graph encoding module may be a GCN model.
[0244] The specific implementation of the above S503 can refer to the description of Method 2 in the above S302-A, which will not be repeated here.
[0245] S504: Process the semantic information of the training text through the attention module to obtain attention information of the training text.
[0246] For example, the semantic information of the training text is fully connected and normalized through the attention module to obtain the attention information of the training text.
[0247] Exemplarily, the full connection mapping and normalization are performed according to the above formula (8) to obtain the attention information of the training text.
[0248] S505: Multiply the attention information of the training text by the semantic information of the training sub-graph information to obtain the fused semantic information of the training sub-graph information.
[0249] In an embodiment of the present application, the semantic information of the training text is processed through the attention mechanism to obtain the attention information of the training text. In this way, the attention information of the training text is multiplied by the semantic information of the training sub-graph information to achieve full interactive fusion of the training text and the training sub-graph information, and obtain the fused semantic information of the training sub-graph information.
[0250] S506: Concatenate the fused semantic information of the training sub-graph information with the training semantic information to obtain target fused semantic information.
[0251] S507: Classify the target fusion semantic information through the classification module to obtain consistency information between the entities in the training text and the entities in the training sub-graph information.
[0252] Optionally, the classification module may include a classification function, such as a sigmoid function, and binary classification is achieved through the sigmoid function.
[0253] S508: Determine the loss of the entity linking model based on the consistency information and labels corresponding to the training samples, and train the entity linking model based on the loss.
[0254] In the embodiment of the present application, the label can be understood as the true value of the consistency information between the entity in the training text and the entity in the training sub-graph information. In this way, the loss of the entity chain model is determined based on the predicted value of the consistency information between the entity in the training text and the entity in the training sub-graph information, and the true value between the two entities. Then, the loss of the entity chain model is determined based on the loss. Figure 10 Specifically, the parameters in the entity chain finger model are adjusted according to the loss, and the above processing is performed on the next training sample through the entity chain finger model after parameter adjustment to obtain the loss corresponding to the next training sample. Then, it is determined whether the model training end condition is met. If the model training end condition is not met, the model is continued to be adjusted according to the loss, and the new training sample is used to train the parameter-adjusted model. The above training steps are repeated until the model training end condition is met. The model training end condition can be that the number of training times reaches a preset number, or the loss reaches a preset loss.
[0255] The embodiment of the present application does not limit the specific method of determining the loss of the entity chain model. For example, the loss of the entity chain model is determined by a negative logarithmic cross entropy function.
[0256] After the entity chain finger model is trained according to the above method, the trained entity chain finger model is used to perform the above Figure 3 and / or Figure 7 The entity chain shown refers to the method.
[0257] Combined with the above Figures 3 to 10 , describes the method embodiment of the present application in detail, and the following is combined with Figures 11 to 12 , describe in detail the device embodiments of the present application.
[0258] Figure 11 1 is a schematic block diagram of a physical link finger device provided in an embodiment of the present application. The device 10 can be an electronic device or a part of an electronic device.
[0259] like Figure 11 As shown, the physical chain finger device 10 may include:
[0260] A first determining unit 11 is configured to determine, in the knowledge graph, subgraph information of N candidate entities associated with the entity to be linked in the target text, where N is a positive integer;
[0261] A second determining unit 12 is configured to determine the semantic information of the target text and the semantic information of each sub-graph information in the sub-graph information of the N candidate entities;
[0262] A fusion unit 13 is configured to interactively fuse the semantic information of the target text with the semantic information of each sub-graph information to obtain fused semantic information of each sub-graph information;
[0263] The linking unit 14 is used to determine the linking entity of the to-be-linked entity in the knowledge graph from the N candidate entities based on the fused semantic information of each sub-graph information.
[0264] In some embodiments, the fusion unit 13 is specifically used to interactively fuse the semantic information of the target text with the semantic information of each sub-graph information based on the attention mechanism to obtain the fused semantic information of each sub-graph information.
[0265] In some embodiments, the fusion unit 13 is specifically used to process the semantic information of the target text based on the attention mechanism to obtain the attention information of the target text; for the i-th candidate entity among the N candidate entities, the attention information of the target text is fused with the semantic information of the sub-graph information of the i-th candidate entity to obtain the fused semantic information of the sub-graph information of the i-th candidate entity, where i is a positive integer less than or equal to N.
[0266] In some embodiments, the fusion unit 13 is specifically used to map the semantic information of the target text through the mapping parameter matrix in the attention module to obtain the semantic mapping information of the target text; and determine the attention information of the target text based on the semantic mapping information.
[0267] In some embodiments, the fusion unit 13 is specifically configured to normalize the semantic mapping information to obtain normalized semantic mapping information; and determine the attention information of the target text based on the normalized semantic mapping information.
[0268] In some embodiments, the fusion unit 13 is specifically used to multiply the attention information of the target text with the semantic information of the sub-graph information of the i-th candidate entity to obtain the fused semantic information of the sub-graph information of the i-th candidate entity.
[0269] In some embodiments, the determining unit 12 is specifically configured to perform semantic encoding on the target text through a language module to obtain semantic information of the target text.
[0270] In some embodiments, the determination unit 12 is specifically used to determine the semantic information of the sub-graph information of the i-th candidate entity among the N candidate entities based on the topological information of the sub-graph information of the i-th candidate entity, where i is a positive integer less than or equal to N.
[0271] In some embodiments, the determination unit 12 is specifically configured to input the sub-graph information of the i-th candidate entity having topological information into a graph encoding module for encoding to obtain semantic information of the sub-graph information of the i-th candidate entity.
[0272] In some embodiments, the link unit 14 is specifically used to determine, for the i-th candidate entity among the N candidate entities, the consistency information between the i-th candidate entity and the entity to be linked based on the fusion semantic information of the sub-graph information of the i-th candidate entity, the consistency information is used to indicate whether the i-th candidate entity is consistent with the entity to be linked, and i is a positive integer less than or equal to N; based on the consistency information between each candidate entity among the N candidate entities and the entity to be linked, determine the link entity of the entity to be linked in the knowledge graph from the N candidate entities.
[0273] In some embodiments, the link unit 14 is specifically used to fuse the fused semantic information of the sub-graph information of the i-th candidate entity with the semantic information of the target text to obtain target fused semantic information; and determine the consistency information between the i-th candidate entity and the entity to be linked based on the target fused semantic information.
[0274] In some embodiments, the linking unit 14 is specifically used to splice the fused semantic information of the sub-graph information of the i-th candidate entity with the semantic information of the target text to obtain the target fused semantic information.
[0275] In some embodiments, the linking unit 14 is specifically configured to classify the target fusion semantic information through a classification module to obtain consistency information between the i-th candidate entity and the entity to be linked.
[0276] In some embodiments, the semantic information of the sub-graph information includes at least one of semantic information of nodes in the sub-graph and semantic information of edges between nodes.
[0277] It should be understood that the device embodiment and the method embodiment may correspond to each other, and similar descriptions may refer to the method embodiment. To avoid repetition, they will not be described here. Specifically, Figure 11 The device shown can execute the embodiments of the above method, and the aforementioned and other operations and / or functions of each module in the device are respectively for implementing the embodiments of the above method, which will not be described again for the sake of brevity.
[0278] The apparatus of the embodiment of the present application is described above from the perspective of functional modules in conjunction with the accompanying drawings. It should be understood that the functional module can be implemented in hardware form, can be implemented by instructions in software form, or can be implemented by a combination of hardware and software modules. Specifically, the steps of the method embodiment in the embodiment of the present application can be completed by the hardware integrated logic circuit and / or software form instructions in the processor, and the steps of the method disclosed in the embodiment of the present application can be directly embodied as being executed by a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. Optionally, the software module can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps in the above method embodiment in conjunction with its hardware.
[0279] Figure 12 This is a schematic block diagram of an electronic device provided in an embodiment of the present application, which is used to execute the above method embodiment.
[0280] like Figure 12 As shown, the electronic device 30 may include:
[0281] The memory 31 and the processor 32 are configured to store a computer program 33 and transmit the program code 33 to the processor 32. In other words, the processor 32 can call and run the computer program 33 from the memory 31 to implement the method in the embodiment of the present application.
[0282] For example, the processor 32 may be configured to execute the above method steps according to instructions in the computer program 33 .
[0283] In some embodiments of the present application, the processor 32 may include but is not limited to:
[0284] General-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.
[0285] In some embodiments of the present application, the memory 31 includes but is not limited to:
[0286] Volatile memory and / or non-volatile memory. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus random access memory (DR RAM).
[0287] In some embodiments of the present application, the computer program 33 may be divided into one or more modules, which are stored in the memory 31 and executed by the processor 32 to implement the method for recording a page provided by the present application. The one or more modules may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program 33 in the electronic device.
[0288] like Figure 12 As shown, the electronic device 30 may further include:
[0289] The transceiver 34 may be connected to the processor 32 or the memory 31 .
[0290] The processor 32 may control the transceiver 34 to communicate with other devices. Specifically, the processor 32 may send information or data to other devices or receive information or data sent by other devices. The transceiver 34 may include a transmitter and a receiver. The transceiver 34 may further include one or more antennas.
[0291] It should be understood that the various components in the electronic device 30 are connected via a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus and a status signal bus.
[0292] According to one aspect of the present application, a computer storage medium is provided, on which a computer program is stored. When the computer program is executed by a computer, the computer is enabled to perform the method of the above method embodiment.
[0293] An embodiment of the present application also provides a computer program product comprising instructions, which, when executed by a computer, enables the computer to perform the method of the above method embodiment.
[0294] According to another aspect of the present application, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform the method of the above method embodiment.
[0295] In other words, when implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (DVD)), or a semiconductor medium (e.g., a solid-state drive (SSD)).
[0296] Those skilled in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0297] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules is merely a logical function division. In actual implementation, there may be other division methods, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0298] Modules described as separate components may or may not be physically separate, and components displayed as modules may or may not be physical modules, i.e., they may be located in one place or distributed across multiple network elements. Some or all of the modules may be selected based on actual needs to achieve the purpose of the present embodiment. For example, the functional modules in the various embodiments of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into a single module.
[0299] The above content is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. An entity chaining method, characterized in that: include: In the knowledge graph, determine the subgraph information of N candidate entities associated with the entity to be linked in the target text, where N is a positive integer; Determine the semantic information of the target text and the semantic information of each sub-graph information in the sub-graph information of the N candidate entities, where the semantic information of the sub-graph information includes the semantic information of the nodes in the sub-graph information and the semantic information of the edges between the nodes; Interactively fusing the semantic information of the target text with the semantic information of each sub-graph information to obtain fused semantic information of each sub-graph information; For the i-th candidate entity among the N candidate entities, the fused semantic information of the subgraph information of the i-th candidate entity is fused with the semantic information of the target text to obtain target fused semantic information, where i is a positive integer less than or equal to N; Determining consistency information between the i-th candidate entity and the entity to be linked based on the target fusion semantic information, wherein the consistency information is used to indicate whether the i-th candidate entity is consistent with the entity to be linked; According to the consistency information between each candidate entity and the entity to be linked in the N candidate entities, the link entity of the entity to be linked in the knowledge graph is determined from the N candidate entities.
2. The method according to claim 1, characterized in that The interactive fusion of the semantic information of the target text with the semantic information of each sub-graph information to obtain the fused semantic information of each sub-graph information includes: Based on the attention mechanism, the semantic information of the target text is interactively fused with the semantic information of each sub-graph information to obtain the fused semantic information of each sub-graph information.
3. The method according to claim 2, characterized in that Based on the attention mechanism, the semantic information of the target text is interactively fused with the semantic information of each sub-graph information to obtain the fused semantic information of each sub-graph information, including: Based on the attention mechanism, the semantic information of the target text is processed to obtain the attention information of the target text; For the i-th candidate entity among the N candidate entities, the attention information of the target text is fused with the semantic information of the sub-graph information of the i-th candidate entity to obtain the fused semantic information of the sub-graph information of the i-th candidate entity, where i is a positive integer less than or equal to N.
4. The method according to claim 3, characterized in that The processing of the semantic information of the target text based on the attention mechanism to obtain the attention information of the target text includes: Mapping the semantic information of the target text through the mapping parameter matrix in the attention module to obtain the semantic mapping information of the target text; Attention information of the target text is determined according to the semantic mapping information.
5. The method according to claim 4, characterized in that The determining of the attention information of the target text according to the semantic mapping information includes: Normalizing the semantic mapping information to obtain normalized semantic mapping information; Determine the attention information of the target text based on the normalized semantic mapping information.
6. The method according to any one of claims 3 to 5, characterized in that: The step of fusing the attention information of the target text with the semantic information of the sub-graph information of the i-th candidate entity to obtain the fused semantic information of the sub-graph information of the i-th candidate entity includes: The attention information of the target text is multiplied by the semantic information of the sub-graph information of the i-th candidate entity to obtain the fused semantic information of the sub-graph information of the i-th candidate entity.
7. The method according to any one of claims 1 to 4, characterized in that Determining the semantic information of the target text includes: The target text is semantically encoded by a language module to obtain semantic information of the target text.
8. The method according to any one of claims 1 to 4, characterized in that Determining semantic information of each sub-graph information in the sub-graph information of the N candidate entities includes: For the i-th candidate entity among the N candidate entities, the semantic information of the sub-graph information of the i-th candidate entity is determined based on the topological information of the sub-graph information of the i-th candidate entity, where i is a positive integer less than or equal to N.
9. The method according to claim 8, characterized in that The determining, based on the topological information of the sub-graph information of the i-th candidate entity, the semantic information of the sub-graph information of the i-th candidate entity includes: The sub-graph information of the i-th candidate entity with topological information is input into the graph encoding module for encoding to obtain the semantic information of the sub-graph information of the i-th candidate entity.
10. The method according to claim 1, characterized in that The step of fusing the fused semantic information of the subgraph information of the i-th candidate entity with the semantic information of the target text to obtain target fused semantic information includes: The fused semantic information of the sub-graph information of the i-th candidate entity is spliced with the semantic information of the target text to obtain the target fused semantic information.
11. The method according to claim 10, characterized in that The determining, based on the target fusion semantic information, the consistency information between the i-th candidate entity and the entity to be linked includes: The target fusion semantic information is classified and processed by a classification module to obtain consistency information between the i-th candidate entity and the entity to be linked.
12. The method according to any one of claims 1 to 4, characterized in that The semantic information of the sub-graph information includes at least one of semantic information of nodes in the sub-graph and semantic information of edges between nodes.
13. A physical chain finger device, characterized in that: include: A first determining unit is configured to determine, in the knowledge graph, subgraph information of N candidate entities associated with the entity to be linked in the target text, where N is a positive integer; A second determining unit is used to determine the semantic information of the target text and the semantic information of each sub-graph information in the sub-graph information of the N candidate entities, where the semantic information of the sub-graph information includes the semantic information of the nodes in the sub-graph information and the semantic information of the edges between the nodes; A fusion unit is used to interactively fuse the semantic information of the target text with the semantic information of each sub-graph information to obtain fused semantic information of each sub-graph information, and for the i-th candidate entity among the N candidate entities, fuse the fused semantic information of the sub-graph information of the i-th candidate entity with the semantic information of the target text to obtain target fused semantic information; Determine, based on the target fusion semantic information, consistency information between the i-th candidate entity and the entity to be linked, where the consistency information indicates whether the i-th candidate entity is consistent with the entity to be linked, where i is a positive integer less than or equal to N; The linking unit is used to determine the linking entity of the entity to be linked in the knowledge graph from the N candidate entities based on the consistency information between each candidate entity and the entity to be linked in the N candidate entities.
14. An electronic device, characterized in that: including processor and memory; The memory is used to store computer programs; The processor is configured to execute the computer program to implement the method according to any one of claims 1 to 12.
15. A computer-readable storage medium, characterized in that Used to store a computer program, wherein the computer program causes a computer to execute the method according to any one of claims 1 to 12.
16. A computer program product, characterized in that The method comprises computer program instructions, wherein the computer program instructions enable a computer to execute the method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Entity linking method based on integration of knowledge graph subgraph information and entity information
CN113626613A