Lightweight entity matching method based on multiple similarities
By constructing positive and negative samples and combining multiple similarity indicators and an improved MLP classifier, the robustness and computational efficiency issues of existing entity linking methods in ambiguous and complex context environments are solved, achieving efficient and accurate entity matching.
Patent Information
- Application Number
- CN202511477787.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-16
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2045-10-16
AI Technical Summary
Existing entity linking methods suffer from poor robustness, high computational cost, and insufficient domain adaptability when accurately identifying and linking entities in ambiguous, fuzzy, and complex contexts.
We employ a lightweight entity matching method based on multiple similarities. By constructing positive and negative samples, performing word segmentation and vectorization, and combining the Word2Vec model and average pooling, we calculate cosine similarity, BM25 keyword matching score, and Jaccard similarity. We then use an improved MLP classifier for entity matching and utilize ReLU activation and Dropout regularization to prevent overfitting.
While maintaining low computational overhead, it achieves efficient and accurate entity linking, making it suitable for scenarios requiring efficient and interpretable information processing, such as product information processing.
Smart Images

Figure CN120951001A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of natural language processing and knowledge graph technology, specifically a lightweight entity matching method based on multiple similarity levels. Background Technology
[0002] Entity linking is a key task in natural language processing and knowledge graph construction. Its core objective is to accurately match entities mentioned in text to corresponding entities in a knowledge base. In product information processing scenarios, entity linking needs to handle text data from various channels such as e-commerce, customer service, and public opinion monitoring. This text contains both structured attribute information (such as product model, brand, and specifications) and a large amount of unstructured descriptive information (such as user reviews, news reports, and forum discussions). Entity references are often highly ambiguous; for example, "apple" could refer to a fruit or Apple Inc. or its product line. Accurately identifying and linking entities in ambiguous, vague, and complex contexts is a challenging task.
[0003] Existing entity linking methods can be mainly divided into rule-based methods and machine learning-based methods. Rule-based methods rely on manually defined matching rules, such as keyword matching, string similarity, and regular expressions. They have the advantages of simple implementation and high running efficiency, but their robustness is poor when facing scenarios with diverse naming, spelling variations, and strong contextual dependencies. Traditional machine learning-based methods, such as using feature engineering combined with classification models (SVM, logistic regression, etc.) for entity matching, can utilize various textual and structural features, but require a large amount of manual feature design and have limitations in semantic understanding capabilities.
[0004] In recent years, the introduction of deep learning, especially pre-trained language models (such as BERT), has significantly improved the performance of entity linking. BERT can capture deep semantic information from the context, enabling the model to perform better when facing ambiguity and long-distance dependencies. However, single deep semantic modeling still has some shortcomings: in product entity linking within industry domains, the vocabulary, naming conventions, and contextual patterns vary greatly across different domains, and directly using a general language model can easily lead to insufficient domain adaptability; at the same time, performing full matching calculations on large-scale candidate entity sets results in low retrieval efficiency and high computational cost. Summary of the Invention
[0005] To address the shortcomings of existing technologies, the present invention aims to propose a lightweight entity matching method based on multiple similarity levels, including: Step 1: Obtain the existing industry knowledge graph and business text. Extract business product entities from the industry knowledge graph as candidate entities. Extract business product entities from the business text and use them as entities to be linked. At the same time, obtain the context of the entities to be linked. Step 2: Based on the entity to be linked, the candidate entity, the context of the entity to be linked, and the real label, construct multiple samples. The real label represents the probability that the entity to be linked and its context can be matched and connected with the candidate entity. Divide all samples into multiple batches. Step 3: For each sample in the same batch, convert the entities to be linked in the sample into entity vectors, convert the context of the entities to be linked into context vectors, and convert the candidate entities into candidate entity vectors. Step 4: Calculate the first similarity vector between the entity vector to be linked and the context vector, and simultaneously calculate the second similarity vector between the context vector and the candidate entity vector; Step 5: Calculate the cosine similarity, BM25 keyword matching score, and Jaccard similarity between the entity vector to be linked and the candidate entity vectors; Step 6: Convert the first similarity vector and the second similarity vector into scalars to obtain the first scalar and the second scalar. Normalize and concatenate the first scalar, the second scalar, the cosine similarity, the BM25 keyword matching score, and the Jaccard similarity to obtain the standardized feature vector. Step 7: Input the standardized feature vector into the improved MLP classifier to obtain the prediction probability. The prediction probability is the predicted value that the entity to be linked and its context can be matched and connected with the candidate entity. The improved MLP classifier introduces the ReLU activation function, Dropout regularization and Sigmoid function on the basis of the MLP classifier. Step 8: Based on the true labels and predicted probabilities, calculate the loss function, perform backpropagation based on the loss function, and iteratively adjust the weight matrix and bias terms of the improved MLP classifier multiple times to obtain the trained improved MLP classifier. Step 9: Obtain the entity to be linked, multiple candidate entities, and the context of the entity to be linked. Convert the entity to be linked, candidate entities, and the context of the entity to be linked into a vector of the entity to be linked, a vector of the candidate entities, and a vector of the context. Repeat steps 4 to 6 to obtain a standardized feature vector. Input the standardized feature vector into the trained improved MLP classifier to obtain the predicted probability of the candidate entities. Among all the predicted probabilities of the candidate entities, take the maximum value and use the candidate entity corresponding to it as the final matching result.
[0006] Optionally, all samples include positive samples and negative samples. In positive samples, the entity to be linked and its context can be matched and connected with the candidate entity, and the true label indicates that the probability of the entity to be linked and its context being matched and connected with the candidate entity is 1. In negative samples, the entity to be linked and its context cannot be matched and connected with the candidate entity, and the true label indicates that the probability of the entity to be linked and its context being matched and connected with the candidate entity is 0.
[0007] Optionally, step 3 specifically includes: For each sample in the same batch, the entity to be linked in the sample is segmented into words to obtain a word sequence. The word sequence is input into the Word2Vec model to obtain a transformed vector. The transformed vector is passed through an average pooling layer to obtain the entity vector to be linked. Similarly, the context and candidate entities of the entity to be linked are segmented into words, and then passed through the Word2Vec model and an average pooling layer to obtain the context vector and candidate entity vector.
[0008] Optionally, step 4 calculates the first similarity vector between the entity vector to be linked and the context vector, including: The dot product score between each word vector in the context vector and the entity vector to be linked is calculated using the following formula: ; in, Indicates the first i The dot product score of each word vector and the entity vector to be linked. This represents the transpose of the entity vector to be linked. Represents the first in the context vector i There are n word vectors, where n represents the total number of word vectors in the context vector; The dot product score is normalized using the softmax function to obtain the attention weights, specifically implemented using the following formula: ; in, Indicates the first i Attention weights between word vectors and entity vectors to be linked. Indicates the first j The dot product score of each word vector and the entity vector to be linked; The first similarity vector is obtained by weighted summation of the dot product score and the attention weight, specifically using the following formula: ; in, This represents the first similarity vector.
[0009] Optionally, step 4 calculates a second similarity vector between the context vector and the candidate entity vector, including: The dot product score between each word vector in the context vector and the candidate entity vector is calculated using the following formula: ; in, Indicates the first i The dot product score of each word vector and the candidate entity vector. This represents the transpose of the candidate entity vector. Represents the first in the context vector i There are n word vectors, where n represents the total number of word vectors in the context vector; The dot product score is normalized using the softmax function to obtain the attention weights, specifically implemented using the following formula: ; in, Indicates the first i Attention weights between word vectors and candidate entity vectors, Indicates the first j The dot product score of each word vector and the candidate entity vector; The second similarity vector is obtained by weighted summation of the dot product score and the attention weight, specifically using the following formula: ; in, This represents the second similarity vector.
[0010] Optionally, in step 6, the first similarity vector and the second similarity vector are converted into scalars to obtain the first scalar and the second scalar, which is specifically achieved through the following formula: ; ; in, Indicates the first scalar. Entity vector to be linked Indicates the second scalar. This represents the candidate entity vector.
[0011] Optionally, step 7 specifically includes: The standardized feature vector is passed sequentially through a fully connected layer, a ReLU activation function, another fully connected layer, a ReLU activation function, Dropout regularization, another fully connected layer, and a Sigmoid function to obtain the predicted probability.
[0012] Optionally, in step 8, the loss function is calculated based on the true label and the predicted probability, specifically using the following formula: ; in, Represents the loss function. N This indicates the total number of samples in the same batch. Indicates samples in the same batch m The true label, Indicates samples in the same batch m The predicted probability.
[0013] The beneficial effects of adopting the above technical solution are as follows: This invention constructs positive and negative samples, then performs word segmentation and vectorization; subsequently, average pooling is used to obtain vector representations of entities and context. During the feature calculation stage, the model introduces multi-dimensional metrics, including Word2Vec semantic similarity, BM25 bidirectional maximum similarity, and Jaccard similarity, and combines an attention mechanism to extract the most relevant information from the context to the candidate entity. The multi-dimensional similarity features are concatenated and input into a multilayer perceptron classifier, using ReLU activation and Dropout to prevent overfitting. Finally, the probability of a candidate entity being correctly linked is output through a sigmoid function. During training, binary cross-entropy loss is used, and backpropagation is used to continuously optimize the parameters. This invention can achieve high entity linking accuracy while maintaining low computational overhead, making it suitable for scenarios requiring efficient and interpretable matching, such as product information processing. Attached Figure Description
[0014] Figure 1 This is a schematic diagram of a lightweight entity matching method based on multiple similarities in an embodiment of the present invention; Figure 2 This is a schematic diagram of another lightweight entity matching method based on multiple similarities in an embodiment of the present invention. Figure 3 This is a schematic diagram illustrating the location of MLP optimization in this embodiment of the invention; Figure 4 This is a graph showing the accuracy change trend in an embodiment of the present invention. Detailed Implementation
[0015] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. The following examples are for illustrative purposes only and are not intended to limit the scope of the invention.
[0016] To address the problems existing in the prior art, this invention provides a lightweight entity matching method based on multiple similarity levels, combined with... Figure 1 and Figure 2 This may include the following steps: Step 1: Obtain the existing industry knowledge graph and business text. Extract business product entities from the industry knowledge graph as candidate entities. Extract business product entities from the business text and use them as entities to be linked. At the same time, obtain the context of the entities to be linked. To enrich the entity-related information that the model can learn, during the data processing stage, LLM generates relevant descriptive information for candidate entities with a word limit from multiple perspectives, such as type, application, and characteristics.
[0017] Based on this, 13 parent industry information categories were derived from the existing industry knowledge graph, namely manufacturing, agriculture, forestry, animal husbandry and fishery, wholesale and retail trade, information technology, real estate, mining, media and culture, social services, transportation, warehousing, production and supply of electricity, gas and water, finance, insurance, construction, clothing, production and supply of electricity, gas and water or manufacturing, and the corresponding industry category was matched for each candidate entity.
[0018] The business texts are derived from the main business of the listed company.
[0019] Step 2: Based on the entity to be linked, the candidate entity, the context of the entity to be linked, and the real label, construct multiple samples. The real label represents the probability that the entity to be linked and its context can be matched and connected with the candidate entity. Divide all samples into multiple batches. The samples include positive and negative samples. In positive samples, the entity to be linked and its context can be matched with the candidate entity, and the true label indicates that the probability of the entity to be linked and its context being matched with the candidate entity is 1. In negative samples, the entity to be linked and its context cannot be matched with the candidate entity, and the true label indicates that the probability of the entity to be linked and its context being matched with the candidate entity is 0.
[0020] Furthermore, positive and negative samples can be imported into a CSV file, and then read directly from the CSV file during subsequent training, avoiding repeated loading from the database.
[0021] set up For the set of entities to be linked, For a set of candidate entities, each entity is represented by a single string, and the context of the entities to be linked is described, given a pair of entities ( )∈ × In this case, how do we determine whether they refer to the same entity in reality?
[0022] To allow for a more intuitive understanding of the model's execution performance, and to design the model's input and output formats to be as simple and straightforward as possible, the input format in this invention is: an entity pair consisting of two entities. The three-tuple, consisting of the entity pair and the context of the entity to be connected, is used in the computation process to perform semantic analysis and feature extraction on the entity pair and the text, learn the linear relationship between them, and determine the probability that each candidate entity can be connected with the current entity to be connected.
[0023] Furthermore, the present invention can also determine the output binary label y based on whether the probability p is greater than a set threshold, as shown in the following formula: ; A binary label y of 0 indicates that the entity pair does not match, while a y value of 1 indicates that the entity pair matches and can be linked. Finally, the link probability and the binary label are combined as the output of the model, as shown in Table 1 below.
[0024] Table 1. Examples of model inputs and outputs; Input content text Output content <![CDATA[Apple Inc., Apple) ∈ ε (l) × ε (c) > I bought a new iPhone =1 <![CDATA[(Tencent Technology, Baidu) ∈ ε (l) × ε (c) > You'll know if you search it on Baidu. =0 Based on the above concept, the present invention includes the following steps: Step 3: For each sample in the same batch, convert the entities to be linked in the sample into entity vectors, convert the context of the entities to be linked into context vectors, and convert the candidate entities into candidate entity vectors. Specifically, for each sample in the same batch, in order to convert these strings into numerical representations, the entities to be linked in the samples are segmented to obtain word sequences. The word sequences are then input into the Word2Vec model to obtain transformed vectors. The transformed vectors are then passed through an average pooling layer to convert the length of the vectors to a fixed length, resulting in the entity vector to be linked. Similarly, the context and candidate entities of the entities to be linked are segmented separately, and then passed through the Word2Vec model and an average pooling layer to obtain the context vector and candidate entity vector.
[0025] Word2vec semantic vectors can map entities to a low-dimensional vector space and capture the relationships between entities. Therefore, Word2vec semantic vectors were chosen as one of the feature metrics at the semantic level. In the specific implementation process, each entity 'e' is first segmented into basic language units, resulting in a word sequence { , , … }, each of these They will all be mapped to a k-dimensional vector v( ∈ This vector is the key vector containing information such as the word's position in the semantic space. The average pooling method is used, which involves summing all word vectors and averaging them. This value is then used as the overall vector representation of the entity, denoted as v(e). The calculation of v(e) is shown in the following formula. This approach not only considers the semantic contribution of each word in the entity but also makes the entity vector both concise and semantically representative.
[0026] ; Therefore, it is possible to convert the context of the linked entity, candidate entity, and entity to be linked into the entity vector to be linked, the candidate entity vector, and the context vector.
[0027] To enhance the model's ability to perceive key semantic information within the context of entities to be linked, a dot-product-based attention mechanism is introduced during the similarity metric calculation. The core of this mechanism is to treat the semantic vectors of the two types of entities as query vectors, and then match and weight them one by one with the word vector sequence of the text to generate a sentence vector that reflects the relevance of the context to the current entity. This design allows the model to dynamically identify keywords in the current context that can help determine whether a candidate entity should be linked, even without candidate entity descriptions.
[0028] Step 4: Calculate the first similarity vector between the entity vector to be linked and the context vector, including: The dot product score between each word vector in the context vector and the entity vector to be linked is calculated using the following formula: ; in, Indicates the first i The dot product score of each word vector and the entity vector to be linked. This represents the transpose of the entity vector to be linked. Represents the first in the context vector i There are n word vectors, where n represents the total number of word vectors in the context vector; The dot product score is normalized using the softmax function to obtain the attention weights, specifically implemented using the following formula: ; in, Indicates the first i Attention weights between word vectors and entity vectors to be linked. Indicates the first j The dot product score of each word vector and the entity vector to be linked; The first similarity vector is obtained by weighted summation of the dot product score and the attention weight, specifically using the following formula: ; in, This represents the first similarity vector.
[0029] Simultaneously calculate the second similarity vector between the context vector and the candidate entity vector, including: The dot product score between each word vector in the context vector and the candidate entity vector is calculated using the following formula: ; in, Indicates the first i The dot product score of each word vector and the candidate entity vector. This represents the transpose of the candidate entity vector. Represents the first in the context vector i There are n word vectors, where n represents the total number of word vectors in the context vector; The dot product score is normalized using the softmax function to obtain the attention weights, specifically implemented using the following formula: ; in, Indicates the first i Attention weights between word vectors and candidate entity vectors, Indicates the first j The dot product score of each word vector and the candidate entity vector; The second similarity vector is obtained by weighted summation of the dot product score and the attention weight, specifically using the following formula: ; in, This represents the second similarity vector.
[0030] This attention mechanism relies solely on word vectors and static computation throughout the process. It does not require any trainable parameters for training, has no complex gradient propagation process, is lightweight, and is easy to deploy and interpret.
[0031] Step 5: Calculate the cosine similarity, BM25 keyword matching score, and Jaccard similarity between the entity vector to be linked and the candidate entity vectors; Specifically, cosine similarity is used to calculate the cosine of the angle between the entity vector to be linked and the candidate entity vector, measuring their similarity in direction. This similarity is used to represent the semantic similarity between the two entities. The calculation process is shown in the following formula; the closer the calculated value is to 1, the more semantically similar the two entities are.
[0032] ; in, Indicates the entity to be linked. Indicates candidate entities, This represents the entity vector to be linked. Represents a candidate entity vector; In this invention, the BM25 algorithm is used to determine the relevance of two entities at the keyword level. This algorithm measures the overlap of keywords, and its score calculation formula is shown in the following formula: ;
[0033] in, The entity to be linked , Candidate entity . It refers to word frequency, i.e., word vectors. exist The frequency of occurrence in; is the candidate entity length, and avgdl is the average candidate entity length. These two metrics are used to normalize the candidate entity length. and These are parameter tuning parameters. If you want to modify the effect of BM25, adjust these two parameters for optimization. In the calculation process of this model, the values of these two parameters are as follows: , In actual data, an asymmetry was found between entities that should be linked, such as electricity and electricity supply. Considering only one-way keyword matching is insufficient in such cases. Therefore, a bidirectional maximum value strategy was introduced at BM25, taking the maximum value from both directions as the final keyword matching score, calculated as follows: ;
[0034] This effectively avoids the problem of discrepancies arising from different descriptions between the entity to be linked and the candidate entity.
[0035] Jaccard similarity treats the word segmentation results of entities as a set and then examines the text overlap from the perspective of the set. A value of approximately 0.1 indicates that the compared texts are more similar in lexical composition. Therefore, it was chosen as the second metric when calculating text similarity. When calculating Jaccard similarity, the intersection and union of the two sets are first calculated, and then their ratio is calculated. The resulting values are all between [0,1]. The calculation formula is shown below. Representing entities The larger the ratio of the segmented word results, the greater the similarity.
[0036] ; Step 6: Convert the first similarity vector and the second similarity vector into scalars to obtain the first scalar and the second scalar. This is achieved through the following formula: ; ; in, Indicates the first scalar. Entity vector to be linked Indicates the second scalar. This represents the candidate entity vector. After transformation, these features are all represented by a single numerical value.
[0037] The first scalar, the second scalar, the cosine similarity, the BM25 keyword matching score, and the Jaccard similarity are normalized and concatenated to obtain a standardized feature vector; Specifically, the first scalar, the second scalar, the cosine similarity, the BM25 keyword matching score, and the Jaccard similarity are Z-score standardized using the following formula: ; in, It is one of the following: first scalar, second scalar, cosine similarity, BM25 keyword matching score, and Jaccard similarity. This represents the normalized vector. for The mean of samples in the same batch. for Standard deviation over the same batch of samples; By concatenating all the normalized vectors, we obtain the standardized feature vector.
[0038] Step 7: Input the standardized feature vector into the improved MLP classifier to obtain the predicted probability, which is the predicted value that the entity to be linked and its context can be matched and connected with the candidate entity.
[0039] The improved MLP classifier introduces ReLU activation function, Dropout regularization, and Sigmoid function on the basis of MLP classifier. The ReLU activation function is used to calculate non-linear relationships, Dropout regularization is used to prevent overfitting, and the Sigmoid function is used to output a probability value between 0 and 1 to represent the probability that the current candidate entity is the correct link result.
[0040] In this model, an MLP consisting of three fully connected layers is constructed to perform nonlinear modeling on the concatenated feature vector. The first layer is responsible for mapping the input features to a 256-dimensional hidden space. The second layer compresses the features to 64 dimensions to facilitate the extraction of higher-order semantic features. The third layer processes the output through the sigmoid function to produce a scalar value, which represents the probability that the current candidate entity is the correct link result.
[0041] Between the basic fully connected layers, all fully connected layers undergo linear transformations; regardless of how the network structure is stacked, it remains equivalent to a linear classifier. Therefore, the ReLU activation function is introduced after the first and second layers, such as... Figure 3 As shown, this allows MLP to capture non-linear feature combinations, such as "a high F1 and a low F3 are more likely to match an entity" or "the interaction of F6 and F7 indicates strong contextual relevance." At the same time, ReLU is simple to calculate, has a constant gradient, and is less prone to gradient vanishing problems, which helps to speed up the model training process and improve convergence stability.
[0042] To prevent overfitting in MLPs during training, Dropout regularization is introduced between hidden layers. The first layer primarily maps the input vector to a high-dimensional space; at this stage, the model hasn't fully learned the complex feature relationships, and adding Dropout here might lead to information loss. The third layer mainly outputs probability values, and adding Dropout might cause output instability. The second layer is primarily responsible for extracting semantic features, so Dropout is added after the ReLU activation function in the second layer to prevent overfitting. In each iteration, a portion of neurons are randomly "shut down" with a probability of 0.5, preventing them from participating in forward and backward propagation. The weights of these neurons are also frozen temporarily. This allows the network to learn under different substructures, reducing the model's dependence on specific paths without adding additional parameters or affecting inference speed. This approach maintains a lightweight design while improving the model's generalization ability and robustness.
[0043] Based on this, in this invention, the standardized feature vector is sequentially passed through a fully connected layer, a ReLU activation function, another fully connected layer, another ReLU activation function, Dropout regularization, another fully connected layer, and a Sigmoid function to obtain the predicted probability.
[0044] BCE Loss is suitable for the "whether it's linked" judgment logic in the current task, and it also has good convergence and stability. It works well with the Sigmoid activation function and is applicable to the probabilistic form of the model's last layer output, helping to improve the model's generalization ability and training efficiency. Therefore, in calculating the loss, the binary cross-entropy loss function is used as the loss calculation function for model training.
[0045] Step 8: Based on the true labels and predicted probabilities, calculate the loss function using the following formula: ; in, Represents the loss function. N This indicates the total number of samples in the same batch. Indicates samples in the same batch m The true label, Indicates samples in the same batch m The predicted probability.
[0046] Backpropagation is performed based on the loss function, and the weight matrix and bias terms of the improved MLP classifier are adjusted iteratively multiple times to obtain the trained improved MLP classifier. During training, this loss function not only measures the difference between the predicted probability output by the model and the true label, but its loss calculation result can also be used as a gradient signal in backpropagation to guide the update of the weight matrix and bias terms of the MLP layer. This allows the MLP to learn the complex relationships between different features, more accurately capture the semantic associations between the entity name to be linked, candidate entity names, and the context, and optimize the MLP through continuous iteration. It gradually identifies which feature combinations are more likely to represent the correct entity linking result, ultimately achieving higher entity linking accuracy. The specific changes in accuracy during training are shown in the figure below. Figure 4 .
[0047] Step 9: Obtain the entity to be linked, multiple candidate entities, and the context of the entity to be linked. Convert the entity to be linked, candidate entities, and the context of the entity to be linked into a vector of the entity to be linked, a vector of the candidate entities, and a vector of the context. Repeat steps 4 to 6 to obtain a standardized feature vector. Input the standardized feature vector into the trained improved MLP classifier to obtain the predicted probability of the candidate entities. Among all the predicted probabilities of the candidate entities, take the maximum value and use the candidate entity corresponding to it as the final matching result.
[0048] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the embodiments of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in the embodiments of this disclosure.
Claims
1. A lightweight entity matching method based on multiple similarity levels, characterized in that, include: Step 1: Obtain the existing industry knowledge graph and business text. Extract business product entities from the industry knowledge graph as candidate entities. Extract business product entities from the business text and use them as entities to be linked. At the same time, obtain the context of the entities to be linked. Step 2: Based on the entity to be linked, the candidate entity, the context of the entity to be linked, and the real label, construct multiple samples. The real label represents the probability that the entity to be linked and its context can be matched and connected with the candidate entity. Divide all samples into multiple batches. Step 3: For each sample in the same batch, convert the entities to be linked in the sample into entity vectors, convert the context of the entities to be linked into context vectors, and convert the candidate entities into candidate entity vectors. Step 4: Calculate the first similarity vector between the entity vector to be linked and the context vector, and simultaneously calculate the second similarity vector between the context vector and the candidate entity vector; Step 5: Calculate the cosine similarity, BM25 keyword matching score, and Jaccard similarity between the entity vector to be linked and the candidate entity vectors; Step 6: Convert the first similarity vector and the second similarity vector into scalars to obtain the first scalar and the second scalar. Normalize and concatenate the first scalar, the second scalar, the cosine similarity, the BM25 keyword matching score, and the Jaccard similarity to obtain the standardized feature vector. Step 7: Input the standardized feature vector into the improved MLP classifier to obtain the prediction probability. The prediction probability is the predicted value that the entity to be linked and its context can be matched and connected with the candidate entity. The improved MLP classifier introduces the ReLU activation function, Dropout regularization and Sigmoid function on the basis of the MLP classifier. Step 8: Based on the true labels and predicted probabilities, calculate the loss function, perform backpropagation based on the loss function, and iteratively adjust the weight matrix and bias terms of the improved MLP classifier multiple times to obtain the trained improved MLP classifier. Step 9: Obtain the entity to be linked, multiple candidate entities, and the context of the entity to be linked. Convert the entity to be linked, candidate entities, and the context of the entity to be linked into a vector of the entity to be linked, a vector of the candidate entities, and a vector of the context. Repeat steps 4 to 6 to obtain a standardized feature vector. Input the standardized feature vector into the trained improved MLP classifier to obtain the predicted probability of the candidate entities. Among all the predicted probabilities of the candidate entities, take the maximum value and use the candidate entity corresponding to it as the final matching result.
2. The lightweight entity matching method based on multiple similarities according to claim 1, characterized in that, All samples include positive samples and negative samples. In positive samples, the entity to be linked and its context can be matched and connected with the candidate entity, and the true label indicates that the probability of the entity to be linked and its context being matched and connected with the candidate entity is 1. In negative samples, the entity to be linked and its context cannot be matched and connected with the candidate entity, and the true label indicates that the probability of the entity to be linked and its context being matched and connected with the candidate entity is 0.
3. The lightweight entity matching method based on multiple similarities according to claim 1, characterized in that, Step 3 specifically includes: For each sample in the same batch, the entity to be linked in the sample is segmented into words to obtain a word sequence. The word sequence is input into the Word2Vec model to obtain a transformed vector. The transformed vector is passed through an average pooling layer to obtain the entity vector to be linked. Similarly, the context and candidate entities of the entity to be linked are segmented into words, and then passed through the Word2Vec model and an average pooling layer to obtain the context vector and candidate entity vector.
4. The lightweight entity matching method based on multiple similarities according to claim 1, characterized in that, Step 4 calculates the first similarity vector between the entity vector to be linked and the context vector, including: The dot product score between each word vector in the context vector and the entity vector to be linked is calculated using the following formula: ; in, Indicates the first i The dot product score of each word vector and the entity vector to be linked. This represents the transpose of the entity vector to be linked. Represents the first in the context vector i There are n word vectors, where n represents the total number of word vectors in the context vector; The dot product score is normalized using the softmax function to obtain the attention weights, specifically implemented using the following formula: ; in, Indicates the first i Attention weights between word vectors and entity vectors to be linked. Indicates the first j The dot product score of each word vector and the entity vector to be linked; The first similarity vector is obtained by weighted summation of the dot product score and the attention weight, specifically using the following formula: ; in, This represents the first similarity vector.
5. A lightweight entity matching method based on multiple similarities according to claim 1, characterized in that, Step 4 calculates the second similarity vector between the context vector and the candidate entity vector, including: The dot product score between each word vector in the context vector and the candidate entity vector is calculated using the following formula: ; in, Indicates the first i The dot product score of each word vector and the candidate entity vector. This represents the transpose of the candidate entity vector. Represents the first in the context vector i There are n word vectors, where n represents the total number of word vectors in the context vector; The dot product score is normalized using the softmax function to obtain the attention weights, specifically implemented using the following formula: ; in, Indicates the first i Attention weights between word vectors and candidate entity vectors, Indicates the first j The dot product score of each word vector and the candidate entity vector; The second similarity vector is obtained by weighted summation of the dot product score and the attention weight, specifically using the following formula: ; in, This represents the second similarity vector.
6. The lightweight entity matching method based on multiple similarities according to claim 1, characterized in that, In step 6, the first similarity vector and the second similarity vector are converted into scalars to obtain the first scalar and the second scalar. This is achieved through the following formula: ; ; in, Indicates the first scalar. Entity vector to be linked Indicates the second scalar. This represents the candidate entity vector.
7. A lightweight entity matching method based on multiple similarities according to claim 1, characterized in that, Step 7 details include: The standardized feature vector is passed sequentially through a fully connected layer, a ReLU activation function, another fully connected layer, a ReLU activation function, Dropout regularization, another fully connected layer, and a Sigmoid function to obtain the predicted probability.
8. A lightweight entity matching method based on multiple similarities according to claim 1, characterized in that, In step 8, the loss function is calculated based on the true label and the predicted probability, specifically using the following formula: ; in, Represents the loss function. N This indicates the total number of samples in the same batch. Indicates samples in the same batch m The true label, Indicates samples in the same batch m The predicted probability.
Citation Information
Patent Citations
Method and system for core process knowledge intelligent pushing based on multi-model fusion
CN108846050A
Industry knowledge base system and method based on entity link and relation extraction
CN117151220A
Apparatus for drilling ground
KR102329569B1
Entity linking method and apparatus, device, and nonvolatile readable storage medium
WO2023207096A1