A text matching method, device, computer device and storage medium

By coding text information and knowledge graph semantic feature and extracting attention feature, the matching relationship between entity objects is selected, and the problem of low accuracy of entity chain reference in the prior art is solved, and a more accurate link between entity objects and knowledge graph entity objects is achieved.

CN115168609BActive Publication Date: 2025-06-27TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210818339.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-12
Publication Date
2025-06-27
Estimated Expiration
2042-07-12

AI Technical Summary

Technical Problem

The existing entity chain method has low accuracy and is difficult to effectively link entity objects and corresponding knowledge base entries in Internet web pages.

Method used

By obtaining text information and knowledge graphs, semantic feature coding and attention feature extraction are performed, and the matching relationship between entity objects in text information and reference entity objects in knowledge graphs is selected.

Benefits of technology

Improve the accuracy of entity chain reference, making the link between entity objects and corresponding entity objects in the knowledge graph more accurate and reliable.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115168609B_ABST
    Figure CN115168609B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a text matching method, apparatus, computer device, and storage medium. Embodiments of the present application can obtain text information and a knowledge graph, perform encoding processing on the text information to obtain semantic features corresponding to the text information, and perform encoding processing on the knowledge graph to obtain semantic features corresponding to the knowledge graph. Based on the semantic features corresponding to the text information, attention features corresponding to the knowledge graph are extracted to obtain attention features corresponding to the knowledge graph. Based on the semantic features corresponding to the knowledge graph, attention features corresponding to the text information are extracted to obtain attention features corresponding to the text information. Based on the attention features corresponding to the knowledge graph and the attention features corresponding to the text information, a target reference entity object that matches the entity object in the text information is screened out from at least one reference entity object in the knowledge graph, which can improve the accuracy of entity linking.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular, to a text matching method, apparatus, computer device, and storage medium. Background Art

[0002] Internet web pages, such as news, blogs, etc., contain a large number of entity objects in their text information. Most web pages themselves do not have relevant descriptions and background introductions about these entity objects. To help people better understand the content of web pages, many websites or authors will link the entity objects appearing in the web pages to the corresponding knowledge base entries to provide more detailed background materials for readers. This practice actually establishes a link relationship between the Internet web pages and the entity objects, and is therefore called entity linking. The inventors of this application found through the practice of the prior art that the existing entity linking methods have the problem of low accuracy. Summary of the Invention

[0003] Embodiments of this application propose a text matching method, apparatus, computer device, and storage medium, which can improve the accuracy of entity linking.

[0004] Embodiments of this application provide a text matching method, including:

[0005] Obtain text information and a knowledge graph, where the text information includes entity objects, and the knowledge graph includes at least one reference entity object;

[0006] Perform encoding processing on the text information to obtain semantic features corresponding to the text information, and perform encoding processing on the knowledge graph to obtain semantic features corresponding to the knowledge graph;

[0007] Based on the semantic features corresponding to the text information, perform attention feature extraction on the semantic features corresponding to the knowledge graph to obtain attention features corresponding to the knowledge graph;

[0008] Based on the semantic features corresponding to the knowledge graph, perform attention feature extraction on the semantic features corresponding to the text information to obtain attention features corresponding to the text information;

[0009] Based on the attention features corresponding to the knowledge graph and the attention features corresponding to the text information, screen out target reference entity objects that match the entity objects in the text information from at least one reference entity object in the knowledge graph.

[0010] Correspondingly, embodiments of this application also provide a text matching apparatus, including:

[0011] An acquisition unit for acquiring text information and a knowledge graph, where the text information includes entity objects, and the knowledge graph includes at least one reference entity object;

[0012] An encoding unit for encoding the text information to obtain semantic features corresponding to the text information, and encoding the knowledge graph to obtain semantic features corresponding to the knowledge graph;

[0013] A first attention feature extraction unit for extracting attention features corresponding to the knowledge graph based on the semantic features corresponding to the text information, to obtain attention features corresponding to the knowledge graph;

[0014] A second attention feature extraction unit for extracting attention features corresponding to the text information based on the semantic features corresponding to the knowledge graph, to obtain attention features corresponding to the text information;

[0015] A screening unit for screening out target reference entity objects that match the entity objects in the text information from at least one reference entity object in the knowledge graph based on the attention features corresponding to the knowledge graph and the attention features corresponding to the text information.

[0016] In one embodiment, the first attention feature extraction unit may include:

[0017] A first fully connected mapping subunit for performing a fully connected mapping on the semantic features corresponding to the text information to obtain fully connected features corresponding to the text information;

[0018] A first normalization subunit for normalizing the fully connected features corresponding to the text information to obtain normalized features corresponding to the text information;

[0019] A first attention mapping subunit for performing an attention mapping on the semantic features corresponding to the knowledge graph using the normalized features corresponding to the text information to obtain attention features corresponding to the knowledge graph.

[0020] In one embodiment, the fully connected mapping subunit may include:

[0021] A quantity determination module for determining the quantity information of the reference entity objects in the knowledge graph;

[0022] An information generation module for generating fully connected mapping information and bias information based on the quantity information;

[0023] A multiplication operation module for performing a multiplication operation on the semantic features corresponding to the text information and the fully connected mapping information to obtain initial fully connected features of the text information;

[0024] An addition operation is used to perform an addition operation on the initial fully connected feature of the text information and the bias information to obtain the fully connected feature of the text information.

[0025] In one embodiment, the attention mapping subunit may include:

[0026] A logical operation module is used to perform a logical operation on the semantic feature elements of the knowledge graph and the normalized feature elements of the corresponding text information to obtain attention feature elements;

[0027] An integration module is used to integrate the attention feature elements to obtain the attention feature corresponding to the knowledge graph.

[0028] In one embodiment, the second attention feature extraction unit may include:

[0029] A statistical subunit is used to perform a statistical operation on the semantic features corresponding to the knowledge graph to obtain the statistical features corresponding to the knowledge graph;

[0030] A second fully connected mapping subunit is used to perform a fully connected mapping on the statistical features of the knowledge graph to obtain the fully connected features corresponding to the knowledge graph;

[0031] A second normalization subunit is used to perform a normalization process on the fully connected features of the knowledge graph to obtain the normalized features corresponding to the knowledge graph;

[0032] A second attention mapping subunit is used to perform an attention mapping on the semantic features corresponding to the text information by using the normalized features corresponding to the knowledge graph to obtain the attention features corresponding to the text information.

[0033] In one embodiment, the encoding unit may include:

[0034] A feature extraction subunit is used to extract features from the text information to obtain the initial features of the text information;

[0035] A feature mining subunit is used to perform feature mining on the initial features of the text information to obtain the mined features of the text information;

[0036] A first mapping subunit is used to map the mined features of the text information into a preset semantic space to obtain the semantic features corresponding to the text information.

[0037] In one embodiment, the encoding unit may further include:

[0038] A knowledge graph recognition subunit, configured to recognize the knowledge graph to obtain entity information and entity relationship information corresponding to the knowledge graph;

[0039] A spatial feature extraction subunit, configured to extract spatial features from the entity information of the knowledge graph and the entity relationship information to obtain spatial features corresponding to the entity information and spatial features corresponding to the entity relationship information;

[0040] A first feature fusion subunit, configured to fuse the spatial features corresponding to the entity information and the spatial features corresponding to the entity relationship information to obtain target spatial features;

[0041] A second mapping subunit, configured to map the target spatial features to the knowledge graph semantic space to obtain semantic features corresponding to the knowledge graph.

[0042] In one embodiment, the screening unit may include:

[0043] A second feature fusion subunit, configured to fuse the attention features corresponding to the knowledge graph and the attention features corresponding to the text information to obtain fused attention features;

[0044] A probability distribution mapping subunit, configured to perform probability distribution mapping on the fused attention features to obtain a probability distribution mapping result;

[0045] A screening subunit, configured to screen out target reference entity objects that match the entity objects in the text information from at least one reference entity object in the knowledge graph based on the probability distribution mapping result.

[0046] In one embodiment, the text matching device proposed in the embodiments of the present application may further include:

[0047] An object determination unit, configured to determine associated entity objects that have an association relationship with the target reference entity object in the knowledge graph;

[0048] A cleaning unit, configured to collect attribute information of the associated entity objects and perform cleaning processing on the attribute information of the associated entity objects to obtain cleaned attribute information of the associated entity objects;

[0049] A sending unit, configured to send the cleaned attribute information of the associated entity objects.

[0050] The embodiments of the present application also provide a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in various alternative manners in the above-mentioned aspect.

[0051] Correspondingly, the embodiments of the present application also provide a storage medium. The storage medium stores instructions, and when the instructions are executed by a processor, the text matching method provided in any one of the embodiments of the present application is implemented.

[0052] The embodiments of the present application can obtain text information and a knowledge graph. The text information includes entity objects, and the knowledge graph includes at least one reference entity object. The text information is encoded to obtain semantic features corresponding to the text information, and the knowledge graph is encoded to obtain semantic features corresponding to the knowledge graph. Attention features corresponding to the knowledge graph are extracted based on the semantic features corresponding to the text information, and attention features corresponding to the text information are extracted based on the semantic features corresponding to the knowledge graph. A target reference entity object that matches the entity object in the text information is screened out from at least one reference entity object in the knowledge graph based on the attention features corresponding to the knowledge graph and the attention features corresponding to the text information, which can improve the accuracy of entity linking. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those skilled in the art, other accompanying drawings can be obtained based on these drawings without creative efforts.

[0054] Figure 1 is a schematic diagram of the scenario of the text matching method provided by the embodiments of the present application;

[0055] Figure 2 is a schematic flowchart of the text matching method provided by the embodiments of the present application;

[0056] Figure 3 is a schematic diagram of the scenario of the knowledge graph provided by the embodiments of the present application;

[0057] Figure 4 is another schematic diagram of the scenario of the text matching method provided by the embodiments of the present application;

[0058] Figure 5It is another schematic flowchart of the text matching method provided by the embodiments of the present application;

[0059] Figure 6 It is a schematic structural diagram of the text matching device provided by the embodiments of the present application;

[0060] Figure 7 It is a schematic structural diagram of the computer device provided by the embodiments of the present application. Detailed implementation manners

[0061] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. However, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present application.

[0062] The embodiments of the present application propose a text matching method. This text matching method can be executed by a text matching device, and this text matching device can be integrated in a computer device. Among them, the computer device may include at least one of a terminal and a server, etc. That is, the text matching method proposed by the embodiments of the present application can be executed by the terminal, can also be executed by the server, and can also be jointly executed by the terminal and the server that can communicate with each other.

[0063] Among them, the terminal may include but is not limited to a smart phone, a tablet computer, a notebook computer, a personal computer (PC), smart home appliances, wearable electronic devices, VR / AR devices, vehicle-mounted terminals, intelligent voice interaction devices, and so on.

[0064] The server may be an interoperability server or a background server between multiple heterogeneous systems, may also be an independent physical server, may also be a server cluster or a distributed system composed of multiple physical servers, and may also be 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, and big data and artificial intelligence platforms, and so on.

[0065] It should be noted that the embodiments of the present application can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, intelligent transportation, assisted driving, etc.

[0066] In one embodiment, as Figure 1As described above, the text matching device can be integrated into computer devices such as terminals or servers to implement the text matching method proposed in the embodiments of the present application. Specifically, the server 11 can obtain text information and a knowledge graph. The text information includes entity objects, and the knowledge graph includes at least one reference entity object; encode the text information to obtain the semantic features corresponding to the text information, and encode the knowledge graph to obtain the semantic features corresponding to the knowledge graph; based on the semantic features corresponding to the text information, perform attention feature extraction on the semantic features corresponding to the knowledge graph to obtain the attention features corresponding to the knowledge graph; based on the semantic features corresponding to the knowledge graph, perform attention feature extraction on the semantic features corresponding to the text information to obtain the attention features corresponding to the text information; based on the attention features corresponding to the knowledge graph and the attention features corresponding to the text information, screen out the target reference entity objects that match the entity objects in the text information from at least one reference entity object in the knowledge graph. Then, the server 11 can also determine the associated entity objects that have an association relationship with the target reference entity object in the knowledge graph; collect the attribute information of the associated entity objects, and perform cleaning processing on the attribute information of the associated entity objects to obtain the cleaned attribute information of the associated entity objects; then, the server 11 can send the cleaned attribute information of the associated entity objects to the terminal 10.

[0067] The following will be described in detail respectively. It should be noted that the description order of the following embodiments does not limit the preferred order of the embodiments.

[0068] The embodiments of the present application will be described from the perspective of a text matching device. The text matching device can be integrated into a computer device, which can be a server or a terminal or other devices.

[0069] As Figure 2 described, a text matching method is provided, and the specific process includes:

[0070] 101. Obtain text information and a knowledge graph. The text information includes entity objects, and the knowledge graph includes at least one reference entity object.

[0071] Among them, the text information can include text information in multiple different application scenarios. For example, the text information can be news, academic papers, blog content, and so on.

[0072] In one embodiment, the text information can include entity objects. Among them, the entity object can refer to an object that objectively exists in the text information and has an actual meaning. For example, personal names, place names, and institution names in the text information can all be entity objects.

[0073] In one embodiment, there are a large number of entity objects involved in text information of Internet web pages, such as news, blogs, etc. Most web pages themselves do not have relevant descriptions and background introductions about these entity objects. To help people better understand the web page content, many websites or authors will link the entity objects appearing in the web page to the corresponding knowledge base entries to provide more detailed background materials for readers. This practice actually establishes a link relationship between the Internet web page and the entity object, so it is called entity linking. The main tasks of entity linking are two, entity recognition and entity disambiguation, both of which are classic problems in the field of natural language processing.

[0074] Entity recognition aims to discover entity objects from text information, and the most typical ones include three types of entity objects: person names, place names, and organization names. In recent years, people have begun to try to recognize richer entity types, such as movie names, product names, and so on.

[0075] The same entity name in different contexts may correspond to different entities. For example, "Apple" may refer to a certain kind of fruit, a famous IT company, or a movie. This kind of polysemy or ambiguity problem exists commonly in natural language. Linking the entity objects appearing in the text information to specific entities is a disambiguation process. The basic idea of disambiguation is to make full use of the context where the entity object appears and analyze the probabilities of different entity objects that may appear there. For example, if "iphone" appears in a certain text information, then "Apple" has a higher probability of referring to the IT company named "Apple" in the knowledge graph.

[0076] In one embodiment, it is very laborious to manually establish entity connection relationships. In order to enable computer devices to automatically implement entity linking, the application of the knowledge graph has become an important technical prerequisite.

[0077] Among them, the knowledge graph is a relational network obtained by connecting all different types of information (Heterogeneous Information). Each node in this relational network represents an "entity" existing in the real world, that is, the reference entity object, and each edge is the "relationship" between entities. For example, as Figure 3 shown is a schematic diagram of a knowledge graph, where this knowledge graph illustrates the information of two people both named Zhao Si.

[0078] 102. Perform encoding processing on the text information to obtain the semantic features corresponding to the text information, and perform encoding processing on the knowledge graph to obtain the semantic features corresponding to the knowledge graph.

[0079] In one embodiment, after obtaining the text information and the knowledge graph, in order to implement the entity linking process, the text information may be encoded to obtain the semantic features corresponding to the text information, and the knowledge graph may be encoded to obtain the semantic features corresponding to the knowledge graph.

[0080] In one embodiment, there are various methods to encode the text information to obtain the semantic features corresponding to the text information.

[0081] In one embodiment, feature extraction and feature mining may be performed on the text information to obtain the mined features of the text information, and then the mined features of the text information are mapped into a preset semantic space to obtain the semantic features corresponding to the text information. Specifically, the step of "encoding the text information to obtain the semantic features corresponding to the text information" may include:

[0082] Perform feature extraction on the text information to obtain the initial features of the text information;

[0083] Perform feature mining on the initial features of the text information to obtain the mined features of the text information;

[0084] Map the mined features of the text information into a preset semantic space to obtain the semantic features corresponding to the text information.

[0085] For example, a convolutional kernel may be used to perform feature extraction on the text information to obtain the initial features of the text information. Then, forward propagation and non-linear transformation are performed on the initial features of the text information to obtain the mined features of the text information. Then, the mined features of the text information are multiplied by a preset semantic space matrix to map the mined features into the preset semantic space to obtain the semantic features corresponding to the text information.

[0086] In one embodiment, a preset text matching model may be used to encode the text information to obtain the semantic features corresponding to the text information.

[0087] Among them, the preset text matching model may be an artificial intelligence model.

[0088] Among them, Artificial Intelligence (AI) uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to obtain the best results in theory, methods, technologies, and application systems. In other words, artificial intelligence is a comprehensive technology in computer science. It attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a way similar to human intelligence. Artificial intelligence also studies the design principles and implementation methods of various intelligent machines, enabling the machines to have the functions of perception, reasoning, and decision-making.

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

[0090] Machine Learning (ML) is an interdisciplinary field that involves multiple disciplines such as probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. It specifically studies how computers can simulate or implement human learning behaviors to acquire new knowledge or skills and reorganize the existing knowledge structure to continuously improve their own performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent, and its applications cover all fields of artificial intelligence. Machine learning and deep learning usually include technologies such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and learning from demonstration. Among them, reinforcement learning is a field in machine learning that emphasizes how to act based on the environment to achieve the maximum expected benefit. Deep reinforcement learning combines deep learning and reinforcement learning, using deep learning techniques to solve reinforcement learning problems.

[0091] For example, the text matching model can be at least one of Convolutional Neural Networks (CNN), De-Convolutional Networks (DN), Deep Neural Networks (DNN), Deep Convolutional Inverse Graphics Networks (DCIGN), Region-based Convolutional Networks (RCNN), Self-Attentive Sequential Recommendation (SASRec), Faster Region-based Convolutional Networks (Faster RCNN), Bidirectional Encoder Representations from Transformers (BERT) model, Conditional Random Field (CRF) model, Graph Convolutional Networks (GCN), etc.

[0092] In one embodiment, the preset text matching model may include a text encoding module, a knowledge graph encoding module, a first attention feature extraction module, a second attention feature extraction module, and a screening module.

[0093] Among them, the text encoding module can be used to encode the text sample to obtain the semantic feature corresponding to the text sample. For example, the text encoding module can be a Bidirectional Encoder Representations from Transformers (BERT) model.

[0094] Among them, the knowledge graph encoding module can be used to encode the knowledge graph sample to obtain the semantic feature corresponding to the knowledge graph sample. For example, the knowledge graph encoding module can be a Graph Convolutional Networks (GCN).

[0095] Among them, the first attention feature extraction module can be used to perform attention feature extraction on the semantic feature corresponding to the knowledge graph sample based on the semantic feature corresponding to the text sample to obtain the attention feature corresponding to the knowledge graph sample.

[0096] Among them, the second attention feature extraction module can be used to perform attention feature extraction on the semantic features corresponding to the text sample based on the semantic features corresponding to the knowledge graph sample, so as to obtain the attention features corresponding to the text sample.

[0097] Among them, the screening module can be used to screen out the target reference entity samples that match the entity samples in the text sample from at least one reference entity sample in the knowledge graph sample based on the attention features corresponding to the knowledge graph sample and the attention features corresponding to the text sample. For example, the screening module can be a classifier. For example, the screening module can be a binary classifier. For another example, the screening module can be a multi-classifier, and so on.

[0098] In one embodiment, the text encoding module in the preset text matching model can be used to perform encoding processing on the text information to obtain the semantic features corresponding to the text information. For example, as Figure 4 shown, when the text encoding module is a BERT model, the BERT model can be used to perform encoding processing on the text information to obtain the semantic features corresponding to the text information. For example, assuming the text information is text, the semantic features corresponding to the text information can be expressed as follows:

[0099] text emb = BERT(text)

[0100] Among them, text emb can represent the semantic features of the text information.

[0101] In one embodiment, there are multiple methods to perform encoding processing on the knowledge graph to obtain the semantic features corresponding to the knowledge graph.

[0102] In one embodiment, the step of "performing encoding processing on the knowledge graph to obtain the semantic features corresponding to the knowledge graph" may include:

[0103] Identifying the knowledge graph to obtain the entity information and entity relationship information corresponding to the knowledge graph;

[0104] Performing spatial feature extraction on the entity information and entity relationship information of the knowledge graph to obtain the spatial features corresponding to the entity information and the spatial features corresponding to the entity relationship information;

[0105] Fusing the spatial features corresponding to the entity information and the spatial features corresponding to the entity relationship information to obtain the target spatial features;

[0106] Mapping the target spatial features to the knowledge graph semantic space to obtain the semantic features corresponding to the knowledge graph.

[0107] In one embodiment, the knowledge graph can be recognized to obtain the entity information and entity relationship information corresponding to the knowledge graph. Among them, the entity information corresponding to the knowledge graph can be used to describe the reference entity objects in the knowledge graph. For example, the entity object can be a matrix, and the reference entity objects in the knowledge graph are recorded in the matrix. Among them, the entity relationship information can be used to describe the relationships between the reference entity objects in the knowledge graph. For example, the entity relationship information can also be a matrix, and the values in the matrix can indicate whether there is a relationship between the reference entity objects in the knowledge graph.

[0108] In one embodiment, since the knowledge graph is a graph topology structure and the connections between nodes in the knowledge graph form a spatial relationship, the spatial features of the entity information and entity relationship information of the knowledge graph can be extracted to obtain the spatial features corresponding to the entity information and the spatial features corresponding to the entity relationship information. For example, the Laplace transform, Fourier transform, etc. can be used to extract the spatial features of the entity information and entity relationship information of the knowledge graph to obtain the spatial features corresponding to the entity information and the spatial features corresponding to the entity relationship information.

[0109] In one embodiment, the spatial features corresponding to the entity information and the spatial features corresponding to the entity relationship information can be fused to obtain the target spatial features. Then, the target spatial features are mapped to the knowledge graph semantic space to obtain the semantic features corresponding to the knowledge graph. For example, the spatial features corresponding to the entity information and the spatial features corresponding to the entity relationship information can be concatenated to obtain the target spatial features. Then, the target spatial features are multiplied by a preset semantic mapping matrix to obtain the semantic features corresponding to the knowledge graph.

[0110] In one embodiment, a preset text matching model can be used to encode the knowledge graph to obtain the semantic features corresponding to the knowledge graph. For example, the knowledge graph encoding module in the text matching model can be used to encode the knowledge graph to obtain the semantic features corresponding to the knowledge graph. For example, as Figure 4 shown, when the knowledge graph encoding module is a GCN, the GCN can be used to encode the knowledge graph to obtain the semantic features corresponding to the knowledge graph. For example, assuming the knowledge graph is graph, the semantic features of the knowledge graph can be expressed as follows:

[0111] graph emb = GCN(graph)

[0112] where graph emb can be the semantic features of the knowledge graph.

[0113] In one embodiment, there is no temporal restriction between the steps of "encoding the text information to obtain the semantic features corresponding to the text information" and "encoding the knowledge graph to obtain the semantic features corresponding to the knowledge graph". For example, these two steps can be executed simultaneously or separately. For example, the preset text matching model may include BRET and GCN. BERT can be used to encode the text information to obtain the semantic features corresponding to the text information, and GCN can be used to encode the knowledge graph to obtain the semantic features corresponding to the knowledge graph simultaneously.

[0114] 103. Extract attention features corresponding to the knowledge graph from the semantic features corresponding to the knowledge graph based on the semantic features corresponding to the text information.

[0115] In one embodiment, in order to improve the accuracy of entity linking, the embodiment of the present application proposes a cross-attention feature extraction method, that is, extracting attention features corresponding to the knowledge graph from the semantic features corresponding to the knowledge graph based on the semantic features corresponding to the text information to obtain the attention features corresponding to the knowledge graph. In addition, attention features corresponding to the text information are also extracted from the semantic features corresponding to the text information based on the semantic features corresponding to the knowledge graph.

[0116] In one embodiment, it is possible to construct an attention mechanism for the semantic features of the knowledge graph based on the semantic features of the text information, that is, to guide the extraction of key information on the knowledge graph side based on the semantic features of the text information. Specifically, the step of "extracting attention features corresponding to the knowledge graph from the semantic features corresponding to the knowledge graph based on the semantic features corresponding to the text information to obtain the attention features corresponding to the knowledge graph" may include:

[0117] Perform a fully connected mapping on the semantic features corresponding to the text information to obtain the fully connected features corresponding to the text information;

[0118] Perform a normalization process on the fully connected features corresponding to the text information to obtain the normalized features corresponding to the text information;

[0119] Use the normalized features corresponding to the text information to perform an attention mapping on the semantic features corresponding to the knowledge graph to obtain the attention features corresponding to the knowledge graph.

[0120] In one embodiment, the step of "performing a fully connected mapping on the semantic features corresponding to the text information to obtain the fully connected features corresponding to the text information" may include:

[0121] Determine the quantity information of the reference entity objects in the knowledge graph;

[0122] Generate fully connected mapping information and bias information based on the quantity information;

[0123] Perform a multiplication operation on the semantic features corresponding to the text information and the fully connected mapping information to obtain the initial fully connected features of the text information;

[0124] Perform an addition operation on the initial fully connected features of the text information and the bias information to obtain the fully connected features of the text information.

[0125] Among them, the fully connected mapping information can be used to map the semantic features corresponding to the text information into the initial fully connected features. The bias information can be used to correct the initial fully connected features of the text information to obtain the fully connected features of the text information, thereby improving the accuracy of the fully connected features. For example, the fully connected mapping information can be a matrix, and the bias information can be a vector.

[0126] In one embodiment, the number information of the reference entity objects in the knowledge graph can be determined, and then the fully connected mapping information and the bias information are generated based on the number information. For example, according to the number information of the reference entity objects, the dimension of the fully connected mapping information and the dimension of the bias information can be determined. For example, assume that there are k reference entity objects in the knowledge graph, then the dimension of the bias information can be k, and the dimension of the fully connected mapping information can be k.

[0127] In one embodiment, the semantic features corresponding to the text information can be multiplied by the fully connected mapping information to obtain the initial fully connected features of the text information. Then, an addition operation is performed on the initial fully connected features of the text information and the bias information to obtain the fully connected features of the text information.

[0128] For example, the fully connected mapping can be as follows:

[0129] X = W1 * text emb + b1

[0130] Among them, X can represent the fully connected features corresponding to the text information. W1 can represent the mapping parameter matrix, and the dimension of this matrix can be m * k, where m can be the size of the T emb dimension, and k can be the number of reference entity objects in the knowledge graph. b1 can be a bias constant with a dimension of k, so the dimension of X can also be k.

[0131] In one embodiment, the fully-connected features corresponding to the text information can be normalized to obtain the normalized features corresponding to the text information. Among them, there are various ways to normalize the fully-connected features corresponding to the text information to obtain the normalized features corresponding to the text information. For example, methods such as Layer Normalization, Batch Normalization, or Group Normalization can be used to normalize the fully-connected features corresponding to the text information to obtain the normalized features corresponding to the text information.

[0132] For example, the normalization process can be as follows:

[0133]

[0134] where text1 emb can represent the normalized features corresponding to the text information. x i and x j can represent any one of the feature elements in the fully-connected feature X corresponding to the text information. That is, the feature element currently being normalized in the fully-connected feature X corresponding to the text information is divided by the sum of all the feature elements in the fully-connected feature X corresponding to the text information to obtain the normalized result of the currently normalized feature element. Then, the normalized results of all the feature elements in the fully-connected feature X are integrated to obtain the normalized features corresponding to the text information.

[0135] In one embodiment, the semantic features corresponding to the knowledge graph can be subjected to attention mapping using the normalized features corresponding to the text information to obtain the attention features corresponding to the knowledge graph.

[0136] For example, the attention mechanism can be used to fuse the normalized features corresponding to the text information and the semantic features corresponding to the knowledge graph to obtain the attention features corresponding to the knowledge graph.

[0137] Again, for example, the normalized features corresponding to the text information can include multiple normalized feature elements, and the semantic features of the knowledge graph include multiple semantic feature elements. Then, the semantic feature elements of the knowledge graph and the corresponding normalized feature elements of the text information can be subjected to logical operation processing to obtain attention feature elements; then, the attention feature elements are integrated to obtain the attention features corresponding to the knowledge graph. Specifically, the step of "subjecting the semantic features corresponding to the knowledge graph to attention mapping using the normalized features corresponding to the text information to obtain the attention features corresponding to the knowledge graph" can include:

[0138] Subject the semantic feature elements of the knowledge graph and the corresponding normalized feature elements of the text information to logical operation processing to obtain attention feature elements;

[0139] Integrate the attention feature elements to obtain the attention feature corresponding to the knowledge graph.

[0140] In one embodiment, the normalized feature of the text information can be a matrix, and the elements in the matrix can be normalized feature elements. Similarly, the semantic feature corresponding to the knowledge graph can be a matrix, and the elements in the matrix can be semantic feature elements.

[0141] In one embodiment, the semantic feature elements of the knowledge graph and the normalized feature elements of the corresponding text information can be subjected to logical operation processing to obtain attention feature elements. For example, the semantic feature elements of the knowledge graph and the normalized feature elements of the text information can be multiplied to obtain attention feature elements. Then, the attention feature elements are integrated to obtain the attention feature corresponding to the knowledge graph.

[0142] For example, the attention feature corresponding to the knowledge graph can be expressed as follows:

[0143] Graph emb =sum[text1 i *graph i ,i=1,2,…,k

[0144] Where, Graph emb can represent the attention feature corresponding to the knowledge graph. text1 i can represent the normalized feature element in the normalized feature text1 emb corresponding to the text information. graph i can represent the semantic feature element corresponding to the semantic feature graph emb of the knowledge graph sample.

[0145] In one embodiment, the attention feature corresponding to the knowledge graph can also be extracted by using a preset text matching model based on the semantic feature corresponding to the text information. For example, the first attention feature extraction module in the preset text matching model can be used to extract the attention feature corresponding to the knowledge graph based on the semantic feature corresponding to the text information. For example, as Figure 4 shown, Figure 4 001 in can be the first attention feature extraction module, and through the first attention feature extraction module, the attention feature corresponding to the knowledge graph can be extracted based on the semantic feature corresponding to the text information.

[0146] 104. Extract attention features from the semantic features corresponding to the text information based on the semantic features corresponding to the knowledge graph, to obtain the attention features corresponding to the text information.

[0147] In one embodiment, it is also possible to extract attention features from the semantic features corresponding to the text information based on the semantic features corresponding to the knowledge graph, to obtain the attention features corresponding to the text information.

[0148] In one embodiment, the step of "extracting attention features from the semantic features corresponding to the text information based on the semantic features corresponding to the knowledge graph, to obtain the attention features corresponding to the text information" may include:

[0149] Perform statistical operations on the semantic features corresponding to the knowledge graph to obtain the statistical features corresponding to the knowledge graph;

[0150] Perform a fully connected mapping on the statistical features of the knowledge graph to obtain the fully connected features corresponding to the knowledge graph;

[0151] Perform normalization processing on the fully connected features of the knowledge graph to obtain the normalized features corresponding to the knowledge graph;

[0152] Use the normalized features corresponding to the knowledge graph to perform attention mapping on the semantic features corresponding to the text information, to obtain the attention features corresponding to the text information.

[0153] In one embodiment, since the knowledge graph may include thousands of reference entity objects, the amount of information of the attention features corresponding to the knowledge graph is relatively large. Therefore, statistical operations can be performed on the semantic features corresponding to the knowledge graph sample to obtain the statistical features corresponding to the knowledge graph. Then, based on the statistical features of the knowledge graph, guide the construction of the attention mechanism for the semantic features of the text information, that is, guide the extraction of key information on the text information side based on the statistical features of the knowledge graph.

[0154] In one embodiment, there are various ways to perform statistical operations on the semantic features corresponding to the knowledge graph to obtain the statistical features corresponding to the knowledge graph. For example, the average of the semantic features corresponding to the knowledge graph can be calculated to obtain the statistical features corresponding to the knowledge graph. For another example, the variance of the semantic features corresponding to the knowledge graph can be calculated to obtain the statistical features corresponding to the knowledge graph, and so on. For example, the statistical features corresponding to the knowledge graph can be as follows:

[0155] Avggraph emb = avgpooling(graph emb )

[0156] where Avggraph emb can be the statistical features corresponding to the knowledge graph.

[0157] In one embodiment, the statistical features of the knowledge graph can be fully connected mapped to obtain the fully connected features corresponding to the knowledge graph. For example, the statistical features of the knowledge graph can be fully connected mapped in the following manner to obtain the fully connected features corresponding to the knowledge graph:

[0158] Y = W2 * Avggraph emb + b2

[0159] Wherein, W2 can be a mapping parameter matrix with a dimension of d * n, where d can be the dimension size of Avggraph emb and n can be the dimension corresponding to the semantic features of the text information. b2 can be a bias constant with a dimension of d, so the dimension of the fully connected features of the knowledge graph sample is n * 1.

[0160] In one embodiment, the fully connected features of the knowledge graph can be normalized to obtain the normalized features corresponding to the knowledge graph. For example, the statistical features of the knowledge graph can be normalized in the following manner to obtain the normalized features corresponding to the knowledge graph:

[0161]

[0162] Wherein, graph2 emb can represent the normalized features corresponding to the knowledge graph. y i and y j can represent any one of the feature elements in the fully connected features Y corresponding to the knowledge graph. That is, the feature element currently being normalized in the fully connected features Y corresponding to the knowledge graph is divided by the sum of all the feature elements in the fully connected features Y corresponding to the knowledge graph to obtain the normalized result of the currently normalized feature element. Then, the normalized results of all the feature elements in the fully connected features Y are integrated to obtain the normalized features corresponding to the knowledge graph.

[0163] In one embodiment, the semantic features corresponding to the text information can be attention mapped using the normalized features corresponding to the knowledge graph to obtain the attention features corresponding to the text information.

[0164] For example, the attention mechanism can be used to fuse the normalized features corresponding to the knowledge graph and the semantic features corresponding to the text information to obtain the attention mechanism corresponding to the text information.

[0165] For another example, the semantic features corresponding to the text information can be attention mapped in the following manner using the normalized features corresponding to the knowledge graph to obtain the attention features corresponding to the text information:

[0166] Text emb = sum[att2 i*T i , i = 1, 2, …, n

[0167] Among them, Text emb can represent the attention features corresponding to the text information. att2 i can represent the normalized features Att2 corresponding to the knowledge graph emb The feature elements in. T i can represent the semantic features of the text information Text emb The corresponding feature elements.

[0168] In one embodiment, the preset text matching model can also be used to extract the attention features of the semantic features corresponding to the text information based on the semantic features corresponding to the knowledge graph, so as to obtain the attention features corresponding to the text information. For example, the second attention feature extraction module in the preset text matching model can be used to extract the attention features of the semantic features corresponding to the text information based on the semantic features corresponding to the knowledge graph, so as to obtain the attention features corresponding to the text information. For example, as Figure 4 shown, 002 in the figure can be the second attention feature extraction module. Through the second attention feature extraction module, the attention features corresponding to the text information can be obtained.

[0169] 105. Screen out the target reference entity object that matches the entity object in the text information from at least one reference entity object in the knowledge graph based on the attention features corresponding to the knowledge graph and the attention features corresponding to the text information.

[0170] In one embodiment, after obtaining the attention features corresponding to the knowledge graph and the attention features corresponding to the text information, the target reference entity object that matches the entity object in the text information can be screened out from at least one reference entity object in the knowledge graph based on the attention features corresponding to the knowledge graph and the attention features corresponding to the text information. That is, it can be determined which reference entity object in the knowledge graph is consistent with the entity object in the text information through the attention features corresponding to the knowledge graph and the attention features corresponding to the text information.

[0171] For example, the text information is "Zhang San attended the press conference". Among them, multiple reference entity objects named Zhang San are collected in the knowledge graph. For example, there is Zhang San who is a star, Zhang San who is a professor, and Zhang San who is an internet celebrity, etc. Through the attention features corresponding to the knowledge graph and the attention features corresponding to the text information, it can be determined which "Zhang San" among the multiple "Zhang San" in the knowledge graph the entity object "Zhang San" in the text information is.

[0172] In one embodiment, the attention features corresponding to the knowledge graph and the attention features corresponding to the text information can be fused to obtain the fused features. Then, based on the fused features, at least one target reference entity object that matches the entity object in the text information is screened out from the reference entity objects in the knowledge graph. Specifically, the step of "screening out at least one target reference entity object that matches the entity object in the text information from the reference entity objects in the knowledge graph based on the attention features corresponding to the knowledge graph and the attention features corresponding to the text information" may include:

[0173] Fuse the attention features corresponding to the knowledge graph and the attention features corresponding to the text information to obtain the fused attention features;

[0174] Perform a probability distribution mapping on the fused attention features to obtain a probability distribution mapping result;

[0175] Based on the probability distribution mapping result, screen out at least one target reference entity object that matches the entity object in the text information from the reference entity objects in the knowledge graph.

[0176] In one embodiment, there are multiple ways to fuse the attention features corresponding to the knowledge graph and the attention features corresponding to the text information to obtain the fused attention features. For example, the attention features corresponding to the knowledge graph and the attention features corresponding to the text information can be concatenated to obtain the fused attention features. Another example is that the attention features corresponding to the knowledge graph and the attention features corresponding to the text information can be multiplied to obtain the fused attention information.

[0177] In one embodiment, a probability distribution mapping can be performed on the fused attention feature information to obtain a probability distribution mapping result. Then, based on the probability distribution mapping result, at least one target reference entity object that matches the entity object in the text information can be screened out from the reference entity objects in the knowledge graph. For example, the fused attention feature information can be converted into a probability distribution mapping result by using a preset probability distribution mapping space. Then, the probability distribution mapping result can indicate which reference entity object in the knowledge graph has the highest matching probability with the entity object in the text information. Therefore, based on the probability distribution mapping result, at least one target reference entity object that matches the entity object in the text information can be screened out from the reference entity objects in the knowledge graph.

[0178] In one embodiment, a preset text matching model can also be used to screen out target reference entity objects that match the entity objects in the text information from at least one reference entity object in the knowledge graph based on the attention features corresponding to the knowledge graph and the attention features corresponding to the text information. For example, the screening module in the preset text matching model can be used to screen out target reference entity objects that match the entity objects in the text information from at least one reference entity object in the knowledge graph based on the attention features corresponding to the knowledge graph and the attention features corresponding to the text information. For example, the screening module can be a multi-classifier, and then, the multi-classifier can be used to screen out target reference entity objects that match the entity objects in the text information from at least one reference entity object in the knowledge graph based on the attention features corresponding to the knowledge graph and the attention features corresponding to the text information.

[0179] In one embodiment, after screening out the target reference entity objects that match the entity objects in the text information, the associated entity objects in the knowledge graph that have an association relationship with the target reference entity objects can also be determined, and the information of the associated entity objects can be sent. For example, if the entity object "Zhang San" in the text information obtained by the method proposed in the embodiments of the present application is the star "Zhang San" in the knowledge graph, the latest dynamic of the movie in which the star "Zhang San" participated and the news of the movie premiere can be sent to the user. Specifically, the method proposed in the embodiments of the present application further includes:

[0180] Determining the associated entity objects in the knowledge graph that have an association relationship with the target reference entity objects;

[0181] Collecting the attribute information of the associated entity objects, and performing cleaning processing on the attribute information of the associated entity objects to obtain the cleaned attribute information of the associated entity objects;

[0182] Sending the cleaned attribute information of the associated entity objects.

[0183] Among them, the associated entity objects that have an association relationship with the target reference entity objects can be the objects that have connection line segments with the target reference entity objects in the knowledge graph. For example, as Figure 3 shown, the reference entity object "singer" can be an associated entity object of the reference entity object "Zhao Si".

[0184] Then, the attribute information of the associated entity objects can be collected. Among them, the attribute information of the associated entity objects can be the information that explains the relationship between the associated entity objects and the target reference entity objects. For example, when the target reference entity object is the star Zhang San, the associated entity object can be the movie in which Zhang San starred, and the attribute information can be the release time of the movie in which Zhang San starred, and so on.

[0185] In one embodiment, since some of the attribute information of the associated entity object is outdated, after collecting the attribute information of the associated entity object, the attribute information of the associated entity object can be cleaned to obtain the cleaned attribute information of the associated entity object. For example, some preset cleaning rules can be used to process the attribute information to obtain the cleaned attribute information of the associated entity object. For example, the time of the attribute information can be cleaned to obtain the cleaned attribute information. Then, the cleaned attribute information of the associated entity object can be sent and displayed for the user to browse.

[0186] In one embodiment, before implementing the method proposed in the embodiments of the present application using the preset text matching model, the model needs to be trained to obtain a preset text matching model with performance meeting the requirements. Specifically, the method proposed in the embodiments of the present application may further include:

[0187] Obtain training samples and a text matching model, where the training samples include text samples and knowledge graph samples;

[0188] Use the text matching model to encode the text samples to obtain the semantic features corresponding to the text samples, and use the text matching model to encode the knowledge graph samples to obtain the semantic features corresponding to the knowledge graph samples;

[0189] Use the text model to extract attention features of the semantic features corresponding to the knowledge graph samples based on the semantic features corresponding to the text samples to obtain the attention features corresponding to the knowledge graph samples;

[0190] Use the text matching model to extract attention features of the semantic features corresponding to the text samples based on the semantic features corresponding to the knowledge graph samples to obtain the attention features corresponding to the text samples;

[0191] Use the attention features corresponding to the knowledge graph samples and the attention features corresponding to the text samples to train the text matching model to obtain a preset text matching model.

[0192] In an embodiment of the present application, text information and a knowledge graph can be obtained. The text information includes entity objects, and the knowledge graph includes at least one reference entity object. The text information is encoded to obtain semantic features corresponding to the text information, and the knowledge graph is encoded to obtain semantic features corresponding to the knowledge graph. Attention features corresponding to the knowledge graph are extracted based on the semantic features corresponding to the text information, and attention features corresponding to the text information are extracted based on the semantic features corresponding to the knowledge graph. A target reference entity object that matches the entity object in the text information is selected from at least one reference entity object in the knowledge graph based on the attention features corresponding to the knowledge graph and the attention features corresponding to the text information. In the embodiment of the present application, by using the semantic features corresponding to the text information to guide the generation of the attention features of the knowledge graph, and using the semantic features of the knowledge graph to guide the generation of the attention features corresponding to the text information, the fusion and interaction of features between the knowledge graph and the text information are strengthened, so that a more accurate mapping is constructed between the features of the text information and the information of the knowledge graph. Therefore, a target reference entity object that matches the entity object in the text information can be accurately selected from at least one reference entity object in the knowledge graph, and the accuracy of entity linking is improved.

[0193] According to the method described in the above embodiment, the following will give a further detailed description by way of examples.

[0194] In the embodiment of the present application, the method of the embodiment of the present application will be introduced by taking the integration of the text matching method on the server as an example.

[0195] In one embodiment, as Figure 5 shown, a text matching method has the following specific process:

[0196] 201. The server obtains a training sample and a text matching model, and the training sample includes a text sample and a knowledge graph sample.

[0197] Among them, the text matching model can be an artificial intelligence model that needs to be trained and whose performance does not meet the requirements.

[0198] In one embodiment, the text matching model can include a text encoding module, a knowledge graph encoding module, a first attention feature extraction module, a second attention feature extraction module, and a screening module.

[0199] Among them, the text encoding module can be used to encode the text sample to obtain the semantic feature corresponding to the text sample. For example, the text encoding module can be a Bidirectional Encoder Representations from Transformers (BERT) model.

[0200] Among them, the knowledge graph encoding module can be used to encode the knowledge graph sample to obtain the semantic feature corresponding to the knowledge graph sample. For example, the knowledge graph encoding module can be a Graph Convolutional Networks (GCN).

[0201] Among them, the first attention feature extraction module can be used to perform attention feature extraction on the semantic feature corresponding to the knowledge graph sample based on the semantic feature corresponding to the text sample, so as to obtain the attention feature corresponding to the knowledge graph sample.

[0202] Among them, the second attention feature extraction module can be used to perform attention feature extraction on the semantic feature corresponding to the text sample based on the semantic feature corresponding to the knowledge graph sample, so as to obtain the attention feature corresponding to the text sample.

[0203] Among them, the screening module can be used to screen out the target reference entity sample that matches the entity sample in the text sample from at least one reference entity sample in the knowledge graph sample based on the attention feature corresponding to the knowledge graph sample and the attention feature corresponding to the text sample. For example, the screening module can be a classifier. For example, the screening module can be a binary classifier. For another example, the screening module can be a multi-classifier, and so on.

[0204] Among them, the training sample can include the training data used for training the text matching model. Among them, the training sample can include the text sample and the knowledge graph sample. The text sample can be the text information used for training the text matching model. The knowledge graph sample can be the knowledge graph used for training the text matching model.

[0205] For example, the training samples can be: Sanple = [{"mention": "Zhao Si", "content_m": "Zhao Si attended the cultural exchange meeting held in Beijing tonight"}, {"id": "id1", "name": "Zhao Si", "job": "singer",...}, [{"label": 1}]]. Among them, "Zhao Si attended the cultural exchange meeting held in Beijing tonight" can be a text sample. "Zhao Si" can be an entity sample in the text sample. {"id": "id1", "name": "Zhao Si", "job": "singer",...} can be a knowledge graph sample. Among them, [{"label": 1}] can be used to illustrate the association relationship between the reference entity samples in the knowledge graph sample. For example, when the label between the reference entity samples in the knowledge graph sample is 1, it indicates that there is an association relationship between the reference entity samples. If the label between the reference entity samples in the knowledge graph sample is 0, it indicates that there is no association relationship between the reference entity samples.

[0206] 202. The server uses the text matching model to encode the text sample to obtain the semantic features corresponding to the text sample, and uses the text matching model to encode the knowledge graph sample to obtain the semantic features corresponding to the knowledge graph sample.

[0207] In one embodiment, the server can use the text matching model to encode the text sample to obtain the semantic features corresponding to the text sample. For example, the server can use the text encoding module in the text matching model to encode the text sample to obtain the semantic features corresponding to the text sample. For example, when the text encoding module is a BERT model, the BERT model can be used to encode the text sample to obtain the semantic features corresponding to the text sample. Specifically, it can be expressed as follows:

[0208] T emb = BERT(mention + content)

[0209] Among them, content can refer to the text sample, mention can refer to the entity sample in the text sample, and T emb can refer to the semantic features corresponding to the text sample.

[0210] In one embodiment, the server may encode the knowledge graph sample using a text matching model to obtain the semantic features corresponding to the knowledge graph sample. For example, the server may use the knowledge graph encoding module in the text matching model to encode the knowledge graph sample to obtain the semantic features corresponding to the knowledge graph sample. For example, when the knowledge graph encoding module is a GCN network, the GCN network may be used to encode the knowledge graph sample to obtain the semantic features corresponding to the knowledge graph sample. Wherein, the knowledge graph sample may be a graph topology structure, the entity samples in the knowledge graph sample may be nodes in the graph topology structure, and the relationships between the entity samples in the knowledge graph sample may be edges between nodes in the graph topology structure. Therefore, GCN takes the graph topology structure as input and can finally converge to obtain the semantic features of the nodes and the edges between the nodes in each graph. Specifically as follows:

[0211] Node i |Side j =GCN(sub graph )

[0212] Wherein, sub graph may represent the knowledge graph sample, Node i may be the semantic features of the entity samples in the knowledge graph sample, and Side j may be the semantic features explaining the relationships between the entity samples in the knowledge graph sample.

[0213] Based on the above encoding, the semantic features corresponding to each entity in the knowledge graph can be obtained.

[0214] 203. The server uses a text model to perform attention feature extraction on the semantic features corresponding to the knowledge graph sample based on the semantic features corresponding to the text sample, to obtain the attention features corresponding to the knowledge graph sample.

[0215] In one embodiment, to improve the accuracy of the preset text matching model, so that the preset text matching model can accurately screen out the target reference entity object that matches the entity object in the text information from at least one reference entity object in the knowledge graph sample, the embodiments of the present application can implement the construction of the attention mechanism for the semantic features of the knowledge graph based on the semantic features of the text sample, that is, guide the extraction of key information on the knowledge graph side based on the semantic features of the text sample.

[0216] In one embodiment, the server may use a text matching model to perform attention feature extraction on the semantic features corresponding to the knowledge graph sample based on the semantic features corresponding to the text sample, so as to obtain the attention features corresponding to the knowledge graph sample. For example, the first attention feature extraction module in the text matching model may be used to perform attention feature extraction on the semantic features corresponding to the knowledge graph sample based on the semantic features corresponding to the text sample, so as to obtain the attention features corresponding to the knowledge graph sample.

[0217] In one embodiment, the first attention feature extraction module may include two steps: fully connected mapping and normalization operation.

[0218] For example, perform a fully connected process on the semantic features corresponding to the text sample to obtain the fully connected features corresponding to the text sample. For example, the fully connected mapping may be as follows:

[0219] X = W1 * T emb + b1

[0220] where X may represent the fully connected features corresponding to the text sample. W1 may represent the mapping parameter matrix, and the dimension of this matrix may be m * k, where m may be the size of the dimension of T emb and k may be the number of entity samples in the knowledge graph. b1 may be the bias constant with a dimension of k, so the dimension of X may also be k.

[0221] Then, perform normalization processing on the fully connected features of the text sample to obtain the normalized features corresponding to the text information. For example, the normalization processing may be as follows:

[0222]

[0223] where Att1 emb may represent the normalized features corresponding to the text sample. x i and x j may represent any one of the feature elements in the fully connected features X corresponding to the text sample. That is, divide the feature element currently being normalized in the fully connected features X corresponding to the text sample by the sum of all the feature elements in the fully connected features X corresponding to the text sample to obtain the normalized result of the currently normalized feature element. Then, integrate the normalized results of all the feature elements in the fully connected features X to obtain the normalized features corresponding to the text sample.

[0224] Then, the normalized features corresponding to the text sample can be used to perform attention mapping on the semantic features corresponding to the knowledge graph sample to obtain the attention features corresponding to the knowledge graph sample. For example, the normalized features corresponding to the text sample and the semantic features corresponding to the knowledge graph sample can be multiplied to obtain the attention features corresponding to the knowledge graph sample. For example, the attention features corresponding to the knowledge graph sample can be expressed as follows:

[0225] Graph emb =sum[att1 i *node i ,i=1,2,…,k

[0226] Among them, Graph emb can represent the attention features corresponding to the knowledge graph sample. att1 i can represent the feature elements in the normalized features Att1 corresponding to the text information emb node i can represent the feature elements corresponding to the semantic features of the entity samples of the knowledge graph sample.

[0227] 204. The server uses the text matching model to perform attention feature extraction on the semantic features corresponding to the text sample based on the semantic features corresponding to the knowledge graph sample, and obtains the attention features corresponding to the text sample.

[0228] In one embodiment, similarly to step 203, the server can use the text matching model to perform attention feature extraction on the semantic features corresponding to the text sample based on the semantic features corresponding to the knowledge graph sample, so as to improve the accuracy of the preset text matching model.

[0229] In one embodiment, the server can use the second attention feature extraction module in the text matching model to perform attention feature extraction on the semantic features corresponding to the text sample based on the semantic features corresponding to the knowledge graph sample, and obtain the attention features corresponding to the text sample.

[0230] In one embodiment, the second attention feature extraction model may include two steps: fully connected mapping and normalization operation.

[0231] Among them, since the amount of information of the attention features corresponding to the knowledge graph sample is relatively large, statistical operations can be performed on the semantic features corresponding to the knowledge graph sample to obtain the statistical features corresponding to the knowledge graph sample. For example, the average of the semantic features of the entity samples in the knowledge graph sample and the semantic features of the relationships between the entity samples in the knowledge graph sample can be calculated to obtain the statistical features corresponding to the knowledge graph sample. For example, the semantic features corresponding to the knowledge graph sample can be shown as follows:

[0232] Avg enb= avgpooling(subgraph)

[0233] where subgraph can represent Node i and Side j .

[0234] Then, the statistical features of the knowledge graph sample can be fully connected mapped to obtain the fully connected features corresponding to the knowledge graph sample. For example, the fully connected features corresponding to the knowledge graph sample can be as follows:

[0235] Y = W2 * Avg emb + b2

[0236] where W2 can be the mapping parameter matrix with dimension d * n, where d can be the dimension size of Avg emb , and n can be the dimension corresponding to the semantic features of the text sample. b2 can be the bias constant with dimension d, so the dimension of the fully connected features of the knowledge graph sample is n * 1.

[0237] Then, the fully connected features of the knowledge graph sample can be normalized to obtain the normalized features corresponding to the knowledge graph sample. For example, the normalized features corresponding to the knowledge graph sample can be as follows:

[0238]

[0239] where Att2 emb can represent the normalized features corresponding to the knowledge graph sample. y i and y j can represent any one of the feature elements in the fully connected feature Y corresponding to the knowledge graph sample. That is, the feature element currently being normalized in the fully connected feature Y corresponding to the knowledge graph sample is divided by the sum of all the feature elements in the fully connected feature Y corresponding to the knowledge graph sample to obtain the normalized result of the currently normalized feature element. Then, the normalized results of all the feature elements in the fully connected feature Y are integrated to obtain the normalized features corresponding to the knowledge graph sample.

[0240] Then, the semantic features corresponding to the text sample can be attention mapped using the normalized features corresponding to the knowledge graph sample to obtain the attention features corresponding to the text sample. For example, the normalized features corresponding to the knowledge graph sample and the semantic features corresponding to the text sample can be multiplied to obtain the attention features corresponding to the text sample. For example, the attention features corresponding to the text sample can be expressed as follows:

[0241] T emb = sum[att2 i * T i , i = 1, 2, …, n

[0242] Among them, T emb can represent the attention features corresponding to the text sample. att2 i can represent the normalized features Att2 corresponding to the knowledge graph sample emb in the feature elements. T i can represent the semantic features T of the text sample emb corresponding feature elements.

[0243] 205. The server uses the attention features corresponding to the knowledge graph sample and the attention features corresponding to the text sample to train the text matching model, and obtains a preset text matching model.

[0244] In one embodiment, the server can use the attention features corresponding to the knowledge graph sample and the attention features corresponding to the text sample to train the text matching model, and obtain a preset text matching model.

[0245] For example, the server can fuse the attention features corresponding to the knowledge graph sample and the attention features corresponding to the text sample to obtain the fused attention features. Then, use the screening module in the text matching model to determine whether the entity objects in the text sample and the reference entity objects in the knowledge graph sample are consistent.

[0246] For example, the attention features corresponding to the knowledge graph sample and the attention features corresponding to the text sample can be concatenated to obtain the fused attention features. For example, it can be as follows:

[0247] Fusion = [text emb :Graph emb

[0248] Among them, Fusion can represent the fused attention features.

[0249] Then, the fused attention features can be input into a binary classifier for discrimination to obtain a discrimination result. Then, the loss information can be calculated based on the discrimination result. Then, according to the loss information, the model parameters in the text matching model are adjusted to obtain a preset text matching model. For example, based on the discrimination result, the negative log cross-entropy function can be used to calculate the loss information. Then, according to the loss information, the mapping parameter matrices W1 and W2, and the bias vectors b1 and b2, etc. in the text matching model are adjusted to obtain a preset text matching model.

[0250] ​In the embodiments of the present application, the server obtains training samples and a text matching model. The training samples include text samples and knowledge graph samples. The server encodes the text samples using the text matching model to obtain semantic features corresponding to the text samples, and encodes the knowledge graph samples using the text matching model to obtain semantic features corresponding to the knowledge graph samples. The server uses the text model to extract attention features from the semantic features corresponding to the knowledge graph samples based on the semantic features corresponding to the text samples, to obtain attention features corresponding to the knowledge graph samples. The server uses the text matching model to extract attention features from the semantic features corresponding to the text samples based on the semantic features corresponding to the knowledge graph samples, to obtain attention features corresponding to the text samples. The server uses the attention features corresponding to the knowledge graph samples and the attention features corresponding to the text samples to train the text matching model, to obtain a preset text matching model, which can improve the accuracy of entity linking.

[0251] To better implement the text matching method provided by the embodiments of the present application, in one embodiment, a text matching device is further provided. The text matching device can be integrated into a computer device. The meanings of the nouns are the same as those in the above text matching method, and the specific implementation details can refer to the description in the method embodiments.

[0252] In one embodiment, a text matching device is provided. The text matching device can be specifically integrated in a computer device, such as Figure 6 shown. The text matching device includes: an acquisition unit 301, an encoding unit 302, a first attention feature extraction unit 303, a second attention feature extraction unit 304, and a screening unit 305, specifically as follows:

[0253] The acquisition unit 301 is configured to acquire text information and a knowledge graph. The text information includes entity objects, where the knowledge graph includes at least one reference entity object;

[0254] The encoding unit 302 is configured to encode the text information to obtain semantic features corresponding to the text information, and encode the knowledge graph to obtain semantic features corresponding to the knowledge graph;

[0255] The first attention feature extraction unit 303 is configured to extract attention features from the semantic features corresponding to the knowledge graph based on the semantic features corresponding to the text information, to obtain attention features corresponding to the knowledge graph;

[0256] The second attention feature extraction unit 304 is configured to extract attention features from the semantic features corresponding to the text information based on the semantic features corresponding to the knowledge graph, to obtain attention features corresponding to the text information;

[0257] A screening unit 305, configured to screen out a target reference entity object that matches the entity object in the text information from at least one reference entity object in the knowledge graph based on the attention features corresponding to the knowledge graph and the attention features corresponding to the text information.

[0258] In one embodiment, the first attention feature extraction unit 303 may include:

[0259] A first fully-connected mapping subunit, configured to perform a fully-connected mapping on the semantic features corresponding to the text information to obtain the fully-connected features corresponding to the text information;

[0260] A first normalization subunit, configured to perform a normalization process on the fully-connected features corresponding to the text information to obtain the normalized features corresponding to the text information;

[0261] A first attention mapping subunit, configured to perform an attention mapping on the semantic features corresponding to the knowledge graph by using the normalized features corresponding to the text information to obtain the attention features corresponding to the knowledge graph.

[0262] In one embodiment, the fully-connected mapping subunit may include:

[0263] A quantity determination module, configured to determine the quantity information of the reference entity objects in the knowledge graph;

[0264] An information generation module, configured to generate fully-connected mapping information and bias information based on the quantity information;

[0265] A multiplication operation module, configured to perform a multiplication operation on the semantic features corresponding to the text information and the fully-connected mapping information to obtain the initial fully-connected features of the text information;

[0266] An addition operation, configured to perform an addition operation on the initial fully-connected features of the text information and the bias information to obtain the fully-connected features of the text information.

[0267] In one embodiment, the attention mapping subunit may include:

[0268] A logical operation module, configured to perform a logical operation process on the semantic feature elements of the knowledge graph and the corresponding normalized feature elements of the text information to obtain attention feature elements;

[0269] An integration module, configured to integrate the attention feature elements to obtain the attention features corresponding to the knowledge graph.

[0270] In one embodiment, the second attention feature extraction unit 304 may include:

[0271] A statistical subunit, configured to perform statistical operations on the semantic features corresponding to the knowledge graph to obtain the statistical features corresponding to the knowledge graph;

[0272] A second fully-connected mapping subunit, configured to perform a fully-connected mapping on the statistical features of the knowledge graph to obtain the fully-connected features corresponding to the knowledge graph;

[0273] A second normalization subunit, configured to perform normalization processing on the fully-connected features of the knowledge graph to obtain the normalized features corresponding to the knowledge graph;

[0274] A second attention mapping subunit, configured to perform attention mapping on the semantic features corresponding to the text information by using the normalized features corresponding to the knowledge graph to obtain the attention features corresponding to the text information.

[0275] In one embodiment, the encoding unit 302 may include:

[0276] A feature extraction subunit, configured to extract features from the text information to obtain the initial features of the text information;

[0277] A feature mining subunit, configured to perform feature mining on the initial features of the text information to obtain the mined features of the text information;

[0278] A first mapping subunit, configured to map the mined features of the text information into a preset semantic space to obtain the semantic features corresponding to the text information.

[0279] In one embodiment, the encoding unit 302 may further include:

[0280] A knowledge graph recognition subunit, configured to recognize the knowledge graph to obtain the entity information and entity relationship information corresponding to the knowledge graph;

[0281] A spatial feature extraction subunit, configured to extract spatial features from the entity information and the entity relationship information of the knowledge graph to obtain the spatial features corresponding to the entity information and the spatial features corresponding to the entity relationship information;

[0282] A first feature fusion subunit, configured to fuse the spatial features corresponding to the entity information and the spatial features corresponding to the entity relationship information to obtain target spatial features;

[0283] A second mapping subunit, configured to map the target spatial features into the knowledge graph semantic space to obtain the semantic features corresponding to the knowledge graph.

[0284] In one embodiment, the screening unit 305 may include:

[0285] A second feature fusion subunit, configured to fuse the attention feature corresponding to the knowledge graph and the attention feature corresponding to the text information to obtain a fused attention feature;

[0286] A probability distribution mapping subunit, configured to perform probability distribution mapping on the fused attention feature to obtain a probability distribution mapping result;

[0287] A screening subunit, configured to screen out a target reference entity object that matches the entity object in the text information from at least one reference entity object in the knowledge graph based on the probability distribution mapping result.

[0288] In one embodiment, the text matching device proposed in the embodiments of the present application may further include:

[0289] An object determination unit, configured to determine an associated entity object that has an association relationship with the target reference entity object in the knowledge graph;

[0290] A cleaning unit, configured to collect the attribute information of the associated entity object and perform cleaning processing on the attribute information of the associated entity object to obtain the cleaned attribute information of the associated entity object;

[0291] A sending unit, configured to send the cleaned attribute information of the associated entity object.

[0292] Specifically in implementation, the above-mentioned each unit may be implemented as an independent entity, or may be combined arbitrarily to be implemented as the same or several entities. For the specific implementation of the above-mentioned each unit, reference may be made to the method embodiments described above, which will not be elaborated herein.

[0293] The accuracy of entity linking can be improved by the above-mentioned text matching device.

[0294] The embodiments of the present application further provide a computer device, which may include a terminal or a server. For example, the computer device may be used as a text matching terminal, and the terminal may be a mobile phone, a tablet computer, etc.; or for another example, the computer device may be a server, such as a text matching server, etc. As Figure 7 shown, it shows a schematic structural diagram of the terminal involved in the embodiments of the present application. Specifically:

[0295] The computer device may include a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a power supply 403, an input unit 404 and other components. Those skilled in the art can understand that Figure 7 the structural diagram of the computer device shown in does not constitute a limitation on the computer device, and may include more or fewer components than shown, or combine some components, or arrange different components. Among them:

[0296] The processor 401 is the control center of the computer device, connecting various parts of the entire computer device through various interfaces and circuits. By running or executing software programs and / or modules stored in the memory 402, and by invoking the data stored in the memory 402, it executes various functions of the computer device and processes data. Optionally, the processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor. Among them, the application processor mainly processes the operating system, user interfaces, and application programs, etc., and the modem processor mainly processes wireless communications. It can be understood that the above-mentioned modem processor may not be integrated into the processor 401 either.

[0297] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 mainly includes a program storage area and a data storage area. Among them, the program storage area can store the operating system, application programs required for at least one function (such as the sound playback function, the image playback function, etc.); the data storage area can store data created according to the use of the computer device. In addition, the memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices. Correspondingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.

[0298] The computer device further includes a power supply 403 for supplying power to each component. Preferably, the power supply 403 can be logically connected to the processor 401 through a power management system, so as to implement functions such as management of charging, discharging, and power consumption management through the power management system. The power supply 403 may also include any components such as one or more DC or AC power supplies, a recharge system, a power failure detection circuit, a power converter or an inverter, and a power status indicator.

[0299] The computer device may further include an input unit 404, which can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.

[0300] Although not shown, the computer device may also include a display unit, etc., which will not be elaborated here. Specifically, in this embodiment, the processor 401 in the computer device will load the executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 401 will run the application programs stored in the memory 402 to implement various functions as follows:

[0301] Obtain text information and a knowledge graph, where the text information includes entity objects, and the knowledge graph includes at least one reference entity object;

[0302] Perform encoding processing on the text information to obtain semantic features corresponding to the text information, and perform encoding processing on the knowledge graph to obtain semantic features corresponding to the knowledge graph;

[0303] Based on the semantic features corresponding to the text information, perform attention feature extraction on the semantic features corresponding to the knowledge graph to obtain attention features corresponding to the knowledge graph;

[0304] Based on the semantic features corresponding to the knowledge graph, perform attention feature extraction on the semantic features corresponding to the text information to obtain attention features corresponding to the text information;

[0305] Based on the attention features corresponding to the knowledge graph and the attention features corresponding to the text information, screen out target reference entity objects that match the entity objects in the text information among at least one reference entity object in the knowledge graph.

[0306] For the specific implementation of each of the above operations, reference may be made to the previous embodiments, which will not be elaborated here.

[0307] According to one aspect of the present application, there is provided a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in various alternative implementation manners in the above embodiments.

[0308] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by a computer program, or controlled by a computer program for related hardware. The computer program can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0309] Therefore, an embodiment of the present application further provides a storage medium, in which a computer program is stored, and the computer program can be loaded by a processor to execute the steps in any text matching method provided by the embodiment of the present application. For example, the computer program can execute the following steps:

[0310] Obtain text information and a knowledge graph, where the text information includes entity objects, and the knowledge graph includes at least one reference entity object;

[0311] Encode the text information to obtain the semantic features corresponding to the text information, and encode the knowledge graph to obtain the semantic features corresponding to the knowledge graph;

[0312] Based on the semantic features corresponding to the text information, extract attention features from the semantic features corresponding to the knowledge graph to obtain the attention features corresponding to the knowledge graph;

[0313] Based on the semantic features corresponding to the knowledge graph, extract attention features from the semantic features corresponding to the text information to obtain the attention features corresponding to the text information;

[0314] Based on the attention features corresponding to the knowledge graph and the attention features corresponding to the text information, screen out target reference entity objects that match the entity objects in the text information from at least one reference entity object in the knowledge graph.

[0315] For the specific implementation of each of the above operations, please refer to the previous embodiments and will not be elaborated here.

[0316] Since the computer program stored in this storage medium can execute the steps in any text matching method provided by the embodiments of the present application, the beneficial effects that can be achieved by any text matching method provided by the embodiments of the present application can be realized. For details, please refer to the previous embodiments and will not be elaborated here.

[0317] The above has introduced in detail a text matching method, device, computer device, and storage medium provided by the embodiments of the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.

Claims

1. A text matching method, characterized in that, Including: Obtain text information and a knowledge graph, where the text information includes entity objects, and the knowledge graph includes at least one reference entity object; Perform encoding processing on the text information to obtain semantic features corresponding to the text information, and perform encoding processing on the knowledge graph to obtain semantic features corresponding to the knowledge graph; Based on the semantic features corresponding to the text information, perform attention feature extraction on the semantic features corresponding to the knowledge graph to obtain attention features corresponding to the knowledge graph; Based on the semantic features corresponding to the knowledge graph, perform attention feature extraction on the semantic features corresponding to the text information to obtain attention features corresponding to the text information; Based on the attention features corresponding to the knowledge graph and the attention features corresponding to the text information, screen out target reference entity objects that match the entity objects in the text information among at least one reference entity object in the knowledge graph.

2. The method according to claim 1, characterized in that, The performing attention feature extraction on the semantic features corresponding to the knowledge graph based on the semantic features corresponding to the text information to obtain attention features corresponding to the knowledge graph includes: Perform a fully connected mapping on the semantic features corresponding to the text information to obtain fully connected features corresponding to the text information; Perform normalization processing on the fully connected features corresponding to the text information to obtain normalized features corresponding to the text information; Use the normalized features corresponding to the text information to perform attention mapping on the semantic features corresponding to the knowledge graph to obtain attention features corresponding to the knowledge graph.

3. The method according to claim 2, wherein The performing a fully connected mapping on the semantic features corresponding to the text information to obtain fully connected features corresponding to the text information includes: Determine the quantity information of reference entity objects in the knowledge graph; Based on the quantity information, generate fully connected mapping information and bias information; Perform a multiplication operation on the semantic features corresponding to the text information and the fully connected mapping information to obtain initial fully connected features of the text information; Perform an addition operation on the initial fully connected features of the text information and the bias information to obtain the fully connected features of the text information.

4. The method according to claim 2, characterized in that, The normalized features corresponding to the text information include multiple normalized feature elements; the semantic features of the knowledge graph include multiple semantic feature elements; the using the normalized features corresponding to the text information to perform attention mapping on the semantic features corresponding to the knowledge graph to obtain attention features corresponding to the knowledge graph includes: Perform a logical operation on the semantic feature elements of the knowledge graph and the corresponding normalized feature elements of the text information to obtain attention feature elements; Integrate the attention feature elements to obtain attention features corresponding to the knowledge graph.

5. The method according to claim 1, wherein The performing attention feature extraction on the semantic features corresponding to the text information based on the semantic features corresponding to the knowledge graph to obtain attention features corresponding to the text information includes: Perform a statistical operation on the semantic features corresponding to the knowledge graph to obtain statistical features corresponding to the knowledge graph; Perform a fully connected mapping on the statistical features of the knowledge graph to obtain fully connected features corresponding to the knowledge graph; Normalize the fully connected features of the knowledge graph to obtain the normalized features corresponding to the knowledge graph; Use the normalized features corresponding to the knowledge graph to perform attention mapping on the semantic features corresponding to the text information to obtain the attention features corresponding to the text information.

6. The method according to claim 1, wherein The encoding process of the text information to obtain the semantic features corresponding to the text information includes: Extract features from the text information to obtain the initial features of the text information; Mine the features of the initial features of the text information to obtain the mined features of the text information; Map the mined features of the text information to a preset semantic space to obtain the semantic features corresponding to the text information.

7. The method according to claim 1, characterized in that, The encoding process of the knowledge graph to obtain the semantic features corresponding to the knowledge graph includes: Identify the knowledge graph to obtain the entity information and entity relationship information corresponding to the knowledge graph; Extract spatial features from the entity information and the entity relationship information of the knowledge graph to obtain the spatial features corresponding to the entity information and the spatial features corresponding to the entity relationship information; Fuse the spatial features corresponding to the entity information and the spatial features corresponding to the entity relationship information to obtain the target spatial features; Map the target spatial features to the knowledge graph semantic space to obtain the semantic features corresponding to the knowledge graph.

8. The method according to claim 1, characterized in that The method of screening out the target reference entity objects that match the entity objects in the text information from at least one reference entity object in the knowledge graph based on the attention features corresponding to the knowledge graph and the attention features corresponding to the text information includes: Fuse the attention features corresponding to the knowledge graph and the attention features corresponding to the text information to obtain the fused attention features; Perform probability distribution mapping on the fused attention features to obtain the probability distribution mapping result; Based on the probability distribution mapping result, screen out the target reference entity objects that match the entity objects in the text information from at least one reference entity object in the knowledge graph.

9. The method according to claim 1, characterized in that The knowledge graph further includes the association relationships between different reference entity objects; the method further includes: Determine the associated entity objects that have association relationships with the target reference entity object in the knowledge graph; Collect the attribute information of the associated entity objects and perform cleaning processing on the attribute information of the associated entity objects to obtain the cleaned attribute information of the associated entity objects; Send the cleaned attribute information of the associated entity objects.

10. The method according to claim 1, characterized in that The encoding process of the text information to obtain the semantic features corresponding to the text information, and the encoding process of the knowledge graph to obtain the semantic features corresponding to the knowledge graph include: Use a preset text matching model to encode the text information to obtain the semantic features corresponding to the text information, and use the preset text matching model to encode the knowledge graph to obtain the semantic features corresponding to the knowledge graph; Performing attention feature extraction on the semantic features corresponding to the knowledge graph based on the semantic features corresponding to the text information to obtain the attention features corresponding to the knowledge graph, including: Using the preset text matching model to perform attention feature extraction on the semantic features corresponding to the knowledge graph based on the semantic features corresponding to the text information to obtain the attention features corresponding to the knowledge graph; Performing attention feature extraction on the semantic features corresponding to the text information based on the semantic features corresponding to the knowledge graph to obtain the attention features corresponding to the text information, including: Using the preset text matching model to perform attention feature extraction on the semantic features corresponding to the text information based on the semantic features corresponding to the knowledge graph to obtain the attention features corresponding to the text information; Selecting a target reference entity object that matches the entity object in the text information from at least one reference entity object in the knowledge graph based on the attention features corresponding to the knowledge graph and the attention features corresponding to the text information, including: Using the preset text matching model to select a target reference entity object that matches the entity object in the text information from at least one reference entity object in the knowledge graph based on the attention features corresponding to the knowledge graph and the attention features corresponding to the text information.

11. The method according to claim 10, wherein The method further includes: Obtaining a training sample and a text matching model, where the training sample includes a text sample and a knowledge graph sample; Using the text matching model to perform encoding processing on the text sample to obtain the semantic features corresponding to the text sample, and using the text matching model to perform encoding processing on the knowledge graph sample to obtain the semantic features corresponding to the knowledge graph sample; Using the text matching model to perform attention feature extraction on the semantic features corresponding to the knowledge graph sample based on the semantic features corresponding to the text sample to obtain the attention features corresponding to the knowledge graph sample; Using the text matching model to perform attention feature extraction on the semantic features corresponding to the text sample based on the semantic features corresponding to the knowledge graph sample to obtain the attention features corresponding to the text sample; Using the attention features corresponding to the knowledge graph sample and the attention features corresponding to the text sample to train the text matching model to obtain the preset text matching model.

12. A text matching device, characterized in that, Including: An acquisition unit for acquiring text information and a knowledge graph, where the text information includes an entity object, and the knowledge graph includes at least one reference entity object; An encoding unit for performing encoding processing on the text information to obtain the semantic features corresponding to the text information, and performing encoding processing on the knowledge graph to obtain the semantic features corresponding to the knowledge graph; A first attention feature extraction unit for performing attention feature extraction on the semantic features corresponding to the knowledge graph based on the semantic features corresponding to the text information to obtain the attention features corresponding to the knowledge graph; The second attention feature extraction unit is configured to perform attention feature extraction on the semantic features corresponding to the text information based on the semantic features corresponding to the knowledge graph, so as to obtain the attention features corresponding to the text information; The screening unit is configured to screen out target reference entity objects that match the entity objects in the text information from at least one reference entity object in the knowledge graph based on the attention features corresponding to the knowledge graph and the attention features corresponding to the text information.

13. A computer device, characterized in that, It includes a memory and a processor; the memory stores an application program, and the processor is configured to run the application program in the memory to execute the operations in the text matching method according to any one of claims 1 to 11.

14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores multiple instructions, and the instructions are suitable for being loaded by a processor to execute the steps in the text matching method according to any one of claims 1 to 11.

15. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instruction is executed by a processor, the steps in the text matching method according to any one of claims 1 to 11 are implemented.

Citation Information

Patent Citations

  • Knowledge graph representation learning method for integrating text semantic features based on attention mechanism

    CN110334219A

  • Entity linking method and device, equipment and storage medium

    CN111523326A