A lightweight entity matching method based on multiple similarities
By constructing lightweight entity matching methods with multiple similarity levels, and combining Word2Vec and an improved MLP classifier, the robustness and computational efficiency issues of entity links 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
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-16
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2045-10-16
AI Technical Summary
Existing entity linking methods suffer from poor robustness and low computational efficiency when accurately identifying and linking entities in ambiguous, fuzzy, and complex contexts, especially in terms of insufficient domain adaptability when linking product entities in different domains.
We construct a lightweight entity matching method with multiple similarity levels. By acquiring industry knowledge graphs and business texts, we use the Word2Vec model for word segmentation and vectorization. We combine cosine similarity, BM25 keyword matching, and Jaccard similarity, introduce an attention mechanism and an improved MLP classifier for entity matching, use ReLU activation and Dropout regularization to prevent overfitting, and use binary cross-entropy loss for training.
It improves the accuracy of entity linking with low computational overhead, making it suitable for scenarios requiring efficient and interpretable data processing, such as product information processing, and enhancing the robustness and generalization ability of the model.
Smart Images

Figure CN120951001B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of natural language processing and knowledge graph, in particular to a lightweight entity matching method based on multiple similarities. BACKGROUND
[0002] Entity Linking is a key task in natural language processing and knowledge graph construction, whose core goal is to accurately match the entities mentioned in the text to the corresponding entities in the knowledge base. In the product information processing scene, entity linking needs to process text data from various channels such as e-commerce, customer service, and public opinion monitoring. These texts contain 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). The reference of an entity often has a high degree of ambiguity, for example, "apple" may refer to a fruit, Apple Inc., or its product series. How to accurately identify and link entities in a multi-meaning, ambiguous, and context-dependent environment 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 set matching rules, such as keyword matching, string similarity, and regular expressions, which have the advantages of simple implementation and high running efficiency, but are less robust in the face of naming diversification, spelling variations, and strong context dependence. Traditional machine learning-based methods, such as using feature engineering combined with classification models (SVM, logistic regression, etc.) for entity matching, can utilize various text and structural features, but require a large amount of manual feature design and have limitations in semantic understanding.
[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 of the context, making the model perform better in the face of ambiguity and long-distance dependence. However, single deep semantic modeling still has some shortcomings: in the industry domain product entity linking, the vocabulary, naming habits, and context patterns of different domains differ greatly, and direct use of general language models may not be suitable for the domain; at the same time, full matching calculation in a large-scale candidate entity set is inefficient and costly. SUMMARY
[0005] To overcome the shortcomings of the prior art, the present application provides a lightweight entity matching method based on multiple similarities, which comprises:
[0006] Step 1: Obtain an existing industry knowledge graph and business text, extract business product entities as candidate entities in the industry knowledge graph, extract business product entities from the business text, obtain business product entities as to-be-linked entities, and obtain the context of the to-be-linked entities;
[0007] Step 2: Based on the to-be-linked entity, the candidate entity and the context of the to-be-linked entity, and the real label, a plurality of samples are constructed, the real label represents the probability that the to-be-linked entity and the context of the to-be-linked entity can be matched and connected with the candidate entity, and all samples are divided into a plurality of batches;
[0008] Step 3: For each sample in the same batch, convert the to-be-linked entity in the sample into a to-be-linked entity vector, convert the context of the to-be-linked entity into a context vector, and convert the candidate entity into a candidate entity vector;
[0009] Step 4: Calculate the first similarity vector of the to-be-linked entity vector and the context vector, and calculate the second similarity vector of the context vector and the candidate entity vector;
[0010] Step 5: Calculate the cosine similarity between the to-be-linked entity vector and the candidate entity vector, the BM25 keyword matching score and the Jaccard similarity;
[0011] 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 splice the first scalar, the second scalar, the cosine similarity, the BM25 keyword matching score and the Jaccard similarity to obtain a standardized feature vector;
[0012] Step 7: Input the standardized feature vector into the improved MLP classifier to obtain a prediction probability, the prediction probability is a predicted value that the to-be-linked entity and the context of the to-be-linked entity can be matched and connected with the candidate entity, and the improved MLP classifier introduces a ReLU activation function, a Dropout regularization and a Sigmoid function based on the MLP classifier;
[0013] Step 8: Based on the real label and the prediction probability, calculate the loss function, perform back propagation according to the loss function, and perform multiple iteration adjustments on the weight matrix and the bias term of the improved MLP classifier to obtain a trained improved MLP classifier;
[0014] 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.
[0015] 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.
[0016] Optionally, step 3 specifically includes:
[0017] 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.
[0018] Optionally, step 4 calculates the first similarity vector between the entity vector to be linked and the context vector, including:
[0019] 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:
[0020] ;
[0021] 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;
[0022] The dot product score is normalized using the softmax function to obtain the attention weights, specifically implemented using the following formula:
[0023] ;
[0024] wherein, denotes the attention weight of the i-th word vector and the candidate entity vector, i denotes the dot product score of the i-th word vector and the candidate entity vector; j
[0025] The dot product score and the attention weight are weighted and summed to obtain a first similarity vector, which is specifically realized by the following formula:
[0026] ;
[0027] wherein, denotes the first similarity vector.
[0028] Optionally, the second similarity vector of the context vector and the candidate entity vector in step 4 is calculated, comprising:
[0029] The dot product score of each word vector in the context vector and the candidate entity vector is calculated, which is specifically realized by the following formula:
[0030] ;
[0031] wherein, denotes the dot product score of the i-th word vector and the candidate entity vector, i denotes the transpose of the candidate entity vector, denotes the i-th word vector in the context vector, and n denotes the total number of word vectors in the context vector; i The dot product score is normalized by a softmax function to obtain an attention weight, which is specifically realized by the following formula:
[0032]
[0033] ;
[0034] wherein, denotes the attention weight of the i-th word vector and the candidate entity vector, i denotes the dot product score of the i-th word vector and the candidate entity vector; j The dot product score and the attention weight are weighted and summed to obtain a second similarity vector, which is specifically realized by the following formula:
[0035]
[0036] ;
[0037] wherein, The second similarity vector is represented.
[0038] Optionally, the first similarity vector and the second similarity vector are converted into scalars in step 6 to obtain a first scalar and a second scalar, and the conversion is implemented by the following formula:
[0039] ;
[0040] ;
[0041] wherein, the first scalar is represented by, the to-be-linked entity vector, the second scalar is represented by, the candidate entity vector is represented by.
[0042] Optionally, step 7 specifically includes:
[0043] The standardized feature vector sequentially passes through a full connection layer, a ReLU activation function, a full connection layer, a ReLU activation function, a Dropout regularization, a full connection layer, and a Sigmoid function to obtain a prediction probability.
[0044] Optionally, a loss function is calculated based on the real label and the prediction probability in step 8, and the calculation is implemented by the following formula:
[0045] ;
[0046] wherein, the loss function is represented by, N the total number of samples in the same batch is represented by, the real label of the sample in the same batch is represented by, m the prediction probability of the sample in the same batch is represented by. m
[0047] The beneficial effects produced by the above technical solutions are as follows:
[0048] The present application constructs positive and negative samples, and then performs word segmentation and vectorization processing; subsequently, the vector representation of entities and context is obtained through average pooling. The model introduces multi-dimensional indicators in the feature calculation stage, including Word2Vec semantic similarity, BM25 bidirectional maximum similarity, Jaccard similarity, and extracts the most relevant information in the context with the candidate entity by combining the attention mechanism. After splicing the multi-dimensional similarity features, input them into the multi-layer perception classifier, use ReLU activation and Dropout to prevent overfitting, and finally output the probability of the candidate entity being correctly linked through the Sigmoid function. During the training process, the binary classification cross-entropy loss is used, and the parameters are continuously optimized through back propagation. The present application can realize high entity linking accuracy while keeping low computational overhead, and is suitable for product information processing and other scenarios that require efficient and interpretable matching. BRIEF DESCRIPTION OF DRAWINGS
[0049] Figure 1 A flowchart of a lightweight entity matching method based on multiple similarities in an embodiment of the present application;
[0050] Figure 2 A flowchart of another lightweight entity matching method based on multiple similarities in an embodiment of the present application;
[0051] Figure 3 An introduction position diagram of MLP optimization in an embodiment of the present application;
[0052] Figure 4 An accuracy trend graph in an embodiment of the present application. DETAILED DESCRIPTION
[0053] The specific embodiments of the present application will be further described in detail below in conjunction with the drawings and examples. The following examples are used to illustrate the present application, but are not used to limit the scope of the present application.
[0054] In view of the problems existing in the prior art, the present application provides a lightweight entity matching method based on multiple similarities, which combines Figure 1 and Figure 2 may include the following steps:
[0055] Step 1: Obtain an existing industry knowledge graph and business text, extract business product entities as candidate entities in the industry knowledge graph, extract business product entities from the business text, obtain business product entities as to-be-linked entities, and obtain the context of the to-be-linked entities;
[0056] In order to enrich the entity-related information that the model can learn, the LLM generates relevant description information with a limited number of words from multiple perspectives such as category, application, and characteristics during the data processing stage.
[0057] On this basis, 13 kinds of parent industry information are derived in the existing industry knowledge graph, which are manufacturing, agriculture, forestry, animal husbandry, fishery, wholesale and retail trade, information technology industry, real estate industry, mining industry, communication and culture industry, social service industry, transportation and warehousing industry, power, coal gas and water production and supply industry, finance, insurance industry, construction industry, clothing, power, coal gas and water production and supply industry or manufacturing industry, and each candidate entity is matched with the corresponding industry category.
[0058] Among them, the business text is derived from the main business of the listed company.
[0059] Step 2: Based on the to-be-linked entity, the candidate entity and the context of the to-be-linked entity, and the true label, a plurality of samples are constructed, the true label represents the probability that the to-be-linked entity and the context of the to-be-linked entity can be matched and connected with the candidate entity, and all samples are divided into a plurality of batches;
[0060] Among them, all samples include positive samples and negative samples, the to-be-linked entity and the context of the to-be-linked entity in the positive sample can be matched and connected with the candidate entity, and the true label represents the probability that the to-be-linked entity and the context of the to-be-linked entity can be matched and connected with the candidate entity, which is 1, and the to-be-linked entity and the context of the to-be-linked entity in the negative sample cannot be matched and connected with the candidate entity, and the true label represents the probability that the to-be-linked entity and the context of the to-be-linked entity can be matched and connected with the candidate entity, which is 0.
[0061] Further, the positive and negative samples can be imported into a near csv file, and in the subsequent training process, the csv file is directly read, so that repeated loading from the database is avoided.
[0062] Let be a set of to-be-linked entities, be a set of candidate entities, each entity is represented by a single string, and the context of the to-be-linked entity is described as, when given an entity pair ( )∈ × , how to judge whether they point to the same entity in reality.
[0063] Considering that it is hoped that the execution effect of the model can be more intuitively seen, the input and output forms of the model are designed to be simple and intuitive, so in the present application, the form of input is: an entity pair composed of two entities and the context of the to-be-connected entity jointly constitute a triple, in the calculation process, semantic analysis and feature extraction are performed on the entity pair and the text respectively, the linear relationship between them is learned, and the probability that each candidate entity can be connected with the current to-be-linked entity is judged.
[0064] Further, the application can also determine the result of the output binary label y according to whether the probability p is greater than a set threshold, as shown in the following formula:
[0065] ;
[0066] The binary label y is 0, indicating that the entity pair does not match, and the value of y is 1, indicating that the entity pair matches and can be linked. Finally, the linking probability and the binary label are combined as the output of the model, as shown in Table 1 below.
[0067] Table 1: Model input and output example
[0068] Input content Text Output content Apple Inc., Apple ε (l) x ε (c) ]]> Bought a new Apple phone =1 [Qqke.com, Baidu) ∈ ε (l) × ε (c) ]]> Baidu, you know =0
[0069] Based on the above concept, the application designs the following steps:
[0070] Step 3: For each sample in the same batch, convert the to-be-linked entity in the sample into a to-be-linked entity vector, convert the context of the to-be-linked entity into a context vector, and convert the candidate entity into a candidate entity vector;
[0071] Specifically, for each sample in the same batch, in order to convert these strings into numerical representations, the to-be-linked entity in the sample is segmented to obtain a word sequence, the word sequence is input into the Word2Vec model to obtain a converted vector, and the converted vector is passed through an average pooling layer to convert the length of the vector into a fixed length to obtain a to-be-linked entity vector. Similarly, the context of the to-be-linked entity and the candidate entity are segmented, and then passed through the Word2Vec model and the average pooling layer to obtain the context vector and the candidate entity vector.
[0072] Wherein, the word2vec semantic vector can map the entity itself to a low-dimensional vector space, and then capture the relevance between entities, so the Word2Vec semantic vector is selected as one of the feature indicators at the semantic level. In the specific implementation process, each entity e will be segmented into basic language units, and after segmentation, the word sequence { , , … } is obtained, each will 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.
[0073] ;
[0074] 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.
[0075] 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.
[0076] Step 4: Calculate the first similarity vector between the entity vector to be linked and the context vector, including:
[0077] 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:
[0078] ;
[0079] 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;
[0080] The dot product score is normalized using the softmax function to obtain the attention weights, specifically implemented using the following formula:
[0081] ;
[0082] in, Indicates the first i Attention weights between word vectors and entity vectors to be linked. Indicates the first jThe dot product score of each word vector and the entity vector to be linked;
[0083] The first similarity vector is obtained by weighted summation of the dot product score and the attention weight, specifically using the following formula:
[0084] ;
[0085] in, This represents the first similarity vector.
[0086] Simultaneously calculate the second similarity vector between the context vector and the candidate entity vector, including:
[0087] The dot product score between each word vector in the context vector and the candidate entity vector is calculated using the following formula:
[0088] ;
[0089] 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;
[0090] The dot product score is normalized using the softmax function to obtain the attention weights, specifically implemented using the following formula:
[0091] ;
[0092] 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;
[0093] The second similarity vector is obtained by weighted summation of the dot product score and the attention weight, specifically using the following formula:
[0094] ;
[0095] in, This represents the second similarity vector.
[0096] 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.
[0097] Step 5: calculate the cosine similarity, BM25 keyword matching score and Jaccard similarity between the to-be-linked entity vector and the candidate entity vector;
[0098] Specifically, the cosine similarity is used to calculate the cosine value of the angle between the to-be-linked entity vector and the candidate entity vector, measure the similarity in direction, and use the similarity to represent the semantic similarity of the two entities. The calculation process is shown in the following formula, and the closer the calculated value is to 1, the more similar the semantics of the two entities.
[0099] ;
[0100] wherein, represents the to-be-linked entity, represents the candidate entity, represents the to-be-linked entity vector, represents the candidate entity vector;
[0101] In the present application, when judging the relevance of two entities at the keyword level, the BM25 algorithm is used to measure the coincidence degree of the keywords, and the score calculation formula is shown in the following formula:
[0102] ;
[0103] wherein, is the to-be-linked entity , is the candidate entity . is the word frequency, that is, the frequency of the word vector appearing in ; is the length of the candidate entity, and avgdl is the average length of the candidate entity, which is used to normalize the length of the candidate entity. and are tuning parameters, and if it is desired to modify the effect of BM25, the two parameters are adjusted for optimization. In the calculation process of the present model, the values of the two parameters are: , In actual data, it is found that there is asymmetry between entities that should be linked, such as power and power supply. If only one-way keyword matching is considered, it is not comprehensive enough, so a bidirectional maximum value strategy is introduced in BM25, and the maximum value in bidirectional calculation is taken as the final keyword matching score, which is calculated as shown in the following formula:
[0104] ;
[0105] In this way, the problem of deviation caused by different expressions between the to-be-linked entity and the candidate entity can be effectively avoided.
[0106] The Jaccard similarity regards the segmentation result of the entity as a set, and then regards the overlapping degree of the text from the perspective of the set. The value is about to indicate that the more similar the compared texts are in vocabulary composition, the greater the similarity is. Therefore, the second index is selected when calculating the text similarity. When calculating the Jaccard similarity, the intersection size and the union size of the two sets are calculated first, and then the ratio of the two is calculated. The result obtained in this way is between 0 and 1. The calculation formula is shown in the following formula, wherein denotes the segmentation result set of the entity The greater the ratio obtained is, the greater the similarity is.
[0107] ;
[0108] Step 6: converting the first similarity vector and the second similarity vector into scalars to obtain a first scalar and a second scalar, which is realized by the following formula:
[0109] ;
[0110] ;
[0111] wherein, denotes the first scalar, the to-be-linked entity vector, denotes the second scalar, denotes the candidate entity vector. At this time, the features after transformation are represented by a numerical value.
[0112] The first scalar, the second scalar, the cosine similarity, the BM25 keyword matching score and the Jaccard similarity are normalized and spliced to obtain a standardized feature vector;
[0113] Specifically, the first scalar, the second scalar, the cosine similarity, the BM25 keyword matching score and the Jaccard similarity are Z-Score standardized, which is realized by the following formula:
[0114] ;
[0115] wherein, is one of the first scalar, the second scalar, the cosine similarity, the BM25 keyword matching score and the Jaccard similarity, denotes the normalized vector, is the mean value on the same batch of samples, is Standard deviation on the same batch of samples;
[0116] All normalized vectors are spliced to obtain a normalized feature vector.
[0117] Step 7: input the normalized feature vector into the improved MLP classifier to obtain a prediction probability, which is a prediction value of the ability of the to-be-linked entity and the context of the to-be-linked entity to be matched and connected with the candidate entity.
[0118] Among them, the improved MLP classifier introduces ReLU activation function, Dropout regularization and Sigmoid function on the basis of MLP classifier, uses ReLU activation function to calculate nonlinear relationship, prevents overfitting through Dropout regularization, and uses Sigmoid function to output a probability value between 0 and 1, which is used to represent the probability of the current candidate entity being the correct linking result.
[0119] In this model, an MLP composed of three fully connected layers is constructed to perform nonlinear modeling on the spliced 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 high-order semantic features, and the third layer processes the output through the Sigmoid function to output a scalar value, which is used to represent the probability of the current candidate entity being the correct linking result.
[0120] Between the basic fully connected layers, all fully connected layers are linear transformations, and regardless of how the network structure is stacked, the whole is still equivalent to a linear classifier. Therefore, ReLU activation functions are introduced after the first and second layers, as shown in Figure 3 The MLP can capture nonlinear feature combinations, such as: "F1 is high and F3 is low, which is more likely to match an entity" or "F6 and F7 are associated, which represents strong context relevance", and ReLU calculation is simple, with constant gradient and no gradient vanishing problem, which helps to speed up the model training process and improve convergence stability.
[0121] In the training process, in order to prevent the MLP from overfitting, the Dropout regularization method is introduced between the hidden layers, because the first connection layer is mainly used to map the input vector to a high-dimensional space, at this time the model has not completely learned the volatile feature relationship, and adding Dropout here may cause information loss, the third layer is mainly responsible for outputting probability values, and adding Dropout may cause unstable output, and the second layer is mainly responsible for extracting semantic features, therefore, after the ReLu activation function in the second layer is selected, Dropout is added to prevent overfitting, in each iteration, a part of neurons are randomly 'turned off' according to the probability of 0.5, and do not participate in the forward and backward propagation, and the weights of the neurons are also frozen and not used temporarily, so that the network can learn under different substructures, reduce the dependence of the model on a specific path, without increasing additional parameters, and the inference speed is not affected, and the generalization ability and robustness of the model can be improved while the lightweight design is preserved.
[0122] Based on this, in the application, the standardized feature vector sequentially passes through a full connection layer, a ReLU activation function, a full connection layer, a ReLU activation function, a Dropout regularization, a full connection layer and a Sigmoid function to obtain a prediction probability.
[0123] The BCE Loss is suitable for the judgment logic of 'whether to link' in the current task, has good convergence and stability, is well matched with the Sigmoid activation function, is suitable for the probability form of the output of the last layer of the model, and is helpful to improve the generalization ability and training efficiency of the model. Therefore, in the calculation of the loss, a binary cross-entropy loss function is used as the loss calculation function of the model training.
[0124] Step 8: Based on the real label and the prediction probability, the loss function is calculated, and the calculation is performed through the following formula:
[0125] ;
[0126] Wherein, represents the loss function, N represents the total number of samples in the same batch, represents the real label of the sample m in the same batch, represents the prediction probability of the sample m in the same batch.
[0127] According to the loss function, the weight matrix and the bias term of the improved MLP classifier are adjusted for multiple iterations to obtain the trained improved MLP classifier.
[0128] In the training process, the loss function not only measures the difference between the predicted probability of the model output and the true label, but also uses the loss calculation result as a gradient signal to guide the update of the weight matrix and bias term of the MLP layer in backpropagation, so that the MLP learns the complex relationship between different features, more accurately captures the semantic association between the entity name to be linked, the candidate entity name and the context, optimizes the MLP in continuous iteration, gradually identifies which feature combination is more inclined to represent the correct entity linking result, and finally achieves higher entity linking accuracy. The change of accuracy Accuracy in the specific training process is as follows: Figure 4 .
[0129] Step 9: Obtain the entity to be linked, the plurality of candidate entities and the context of the entity to be linked, convert the entity to be linked, the candidate entities and the context of the entity to be linked into the entity vector, the candidate entity vector and the context vector, re-execute steps 4 to 6 to obtain the standardized feature vector, input the standardized feature vector into the trained improved MLP classifier to obtain the predicted probability of the candidate entity, obtain the maximum value in the predicted probability of all candidate entities, and take the corresponding candidate entity as the final matching result.
[0130] The above description is only the preferred embodiments of the present disclosure and the explanation of the applied technical principles. Those skilled in the art should understand that the scope of the application involved in the embodiments of the present disclosure is not limited to the technical solutions formed by the specific combinations of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above inventive concept. For example, the above features are replaced with the technical features disclosed in the embodiments of the present disclosure (but not limited to) having similar functions to form technical solutions.
Claims
1. A lightweight entity matching method based on multiple similarities, characterized in that, The method comprises the following steps: Step 1: Obtain an existing industry knowledge graph and business text, extract business product entities as candidate entities from the industry knowledge graph, extract business product entities from the business text, obtain business product entities as to-be-linked entities, and obtain the context of the to-be-linked entities; Step 2: Based on the to-be-linked entities, candidate entities and the context of the to-be-linked entities, and the real label, a plurality of samples are constructed, the real label represents the probability that the to-be-linked entities and the context of the to-be-linked entities can be matched and connected with the candidate entities, and all samples are divided into a plurality of batches; Step 3: For each sample in the same batch, the to-be-linked entity in the sample is converted into a to-be-linked entity vector, the context of the to-be-linked entity is converted into a context vector, and the candidate entity is converted into a candidate entity vector; Step 4: Calculate the first similarity vector of the to-be-linked entity vector and the context vector, and calculate the second similarity vector of the context vector and the candidate entity vector; Step 5: Calculate the cosine similarity, BM25 keyword matching score and Jaccard similarity between the to-be-linked entity vector and the candidate entity vector; 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 splice the first scalar, the second scalar, the cosine similarity, the BM25 keyword matching score and the Jaccard similarity to obtain a standardized feature vector; Step 7: Input the standardized feature vector into the improved MLP classifier to obtain a prediction probability, the prediction probability is a predicted value that the to-be-linked entities and the context of the to-be-linked entities can be matched and connected with the candidate entities, and the improved MLP classifier introduces a ReLU activation function, a Dropout regularization and a Sigmoid function based on the MLP classifier; Step 8: Based on the real label and the prediction probability, a loss function is calculated, the loss function is back propagated, the weight matrix and the bias term of the improved MLP classifier are iteratively adjusted for multiple times to obtain a trained improved MLP classifier; Step 9: Obtain the to-be-linked entity, a plurality of candidate entities and the context of the to-be-linked entity, convert the to-be-linked entity, the candidate entity and the context of the to-be-linked entity into a to-be-linked entity vector, a candidate entity vector and a context vector, re-execute steps 4 to 6 to obtain a standardized feature vector, input the standardized feature vector into the trained improved MLP classifier to obtain a prediction probability of the candidate entity, obtain the maximum value in all prediction probabilities of the candidate entity, and take the candidate entity corresponding to the maximum value as the final matching result. 2.The lightweight entity matching method based on multiple similarities according to claim 1, wherein, The all samples include positive samples and negative samples, the to-be-linked entity and the context of the to-be-linked entity in the positive samples can be matched and connected with the candidate entity, and the real label represents the probability that the to-be-linked entity and the context of the to-be-linked entity can be matched and connected with the candidate entity is 1, the to-be-linked entity and the context of the to-be-linked entity in the negative samples cannot be matched and connected with the candidate entity, and the real label represents the probability that the to-be-linked entity and the context of the to-be-linked entity can be matched and connected with the candidate entity is 0. 3.The lightweight entity matching method based on multiple similarities of claim 1, wherein, Step 3 specifically includes: For each sample in the same batch, the to-be-linked entity in the sample is segmented to obtain a word sequence, the word sequence is input into the Word2Vec model to obtain a converted vector, and the converted vector is subjected to an average pooling layer to obtain a to-be-linked entity vector. Similarly, the context of the to-be-linked entity and the candidate entity are segmented and then subjected to the Word2Vec model and the average pooling layer to obtain a context vector and a candidate entity vector. 4.The lightweight entity matching method based on multiple similarities of claim 1, wherein, The first similarity vector of the to-be-linked entity vector and the context vector in step 4 includes: The dot product score of each word vector in the context vector and the to-be-linked entity vector is calculated, which is specifically realized by the following formula: ; wherein, denotes the dot product score of the i th word vector of the context vector and the entity vector to be linked, denotes the transpose of the entity vector to be linked, denotes the i th word vector of the context vector, n denotes the total number of word vectors in the context vector; The dot product score is normalized by a softmax function to obtain an attention weight, which is specifically realized by the following formula: ; wherein, denotes the attention weight of the i th word vector to the entity vector to be linked, denotes the dot product score of the j th word vector to the entity vector to be linked. The dot product score and the attention weight are weighted and summed to obtain the first similarity vector, which is specifically realized by the following formula: ; wherein, denotes the first similarity vector.
5. The lightweight entity matching method based on multiple similarities according to claim 1, wherein, The second similarity vector of the context vector and the candidate entity vector in step 4 includes: The dot product score of each word vector in the context vector and the candidate entity vector is calculated, which is specifically realized by the following formula: ; wherein, denotes the dot product score of the i th word vector and the candidate entity vector, denotes the transpose of the candidate entity vector, denotes the i th word vector in the context vector, n denotes the total number of word vectors in the context vector; The dot product score is normalized by a softmax function to obtain an attention weight, which is specifically realized by the following formula: ; wherein, denotes the attention weight of the i th word vector to the candidate entity vector, denotes the dot product score of the j th word vector to the candidate entity vector; The dot product score and the attention weight are weighted and summed to obtain the second similarity vector, which is specifically realized by the following formula: ; wherein, denotes a second similarity vector.
6. The lightweight entity matching method based on multiple similarities according to claim 1, wherein, In step 6, the first similarity vector and the second similarity vector are converted into scalars to obtain a first scalar and a second scalar, which are specifically realized by the following formula: ; ; wherein, denotes a first scalar, a vector of entities to be linked, denotes a second scalar, denotes a candidate entity vector.
7. The lightweight entity matching method based on multiple similarities according to claim 1, characterized in that, Step 7 specifically includes: The standardized feature vector sequentially passes through a fully connected layer, a ReLU activation function, a fully connected layer, a ReLU activation function, a Dropout regularization, a fully connected layer, and a Sigmoid function to obtain a prediction probability. 8.The lightweight entity matching method based on multiple similarities of claim 1, wherein, In step 8, based on the real label and the prediction probability, a loss function is calculated, which is specifically calculated by the following formula: ; wherein, represents a loss function, N represents the total number of samples in the same batch, represents the true label of the sample in the same batch m represents the predicted probability of the sample in the same batch m .
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