Entity matching method and device based on cooperation of large language model and small model
By adopting the method of collaborating large language models and small models in entity matching in large data sets, using small models to filter key key-value pairs and find similar demonstration entity pairs, the problem of insufficient accuracy and efficiency of entity matching in large data sets is solved, and more efficient and accurate entity matching is achieved.
Patent Information
- Application Number
- CN202411677099.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-11-21
AI Technical Summary
The prior art has shortcomings in the accuracy and efficiency of entity matching in large data sets, especially when facing massive data and complex scenarios, matching directly based on complete entities is inefficient and may introduce noise.
The entity matching method based on the collaboration of large language model and small model is adopted. The first small model treats the matching entity pairs, and the most indicative subset of key-value pairs for the entity matching is extracted. The second small model is used to find a demonstration entity pair that corresponds to the thin entity pair to be matched. Combining this information, the large language model is input to obtain the entity matching result.
It significantly improves the accuracy and efficiency of entity matching of large data sets, and by reducing input complexity and eliminating noise information, the model focuses more on key information, thereby improving prediction accuracy and generalization capabilities.
Smart Images

Figure CN119646206A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of entity matching, and in particular to an entity matching method and device based on the collaboration of a large language model and a small model. Background Art
[0002] In the era of big data, the importance of data integration has become increasingly prominent, and entity matching, as one of its core tasks, faces many challenges.
[0003] In related technologies, DeepMatcher uses various deep learning models as encoders to build an end-to-end entity matching model, which shows greater robustness on unstructured data, but there is still room for improvement in accuracy. The Ditto open source pre-trained model uses a lot of expert knowledge and manual annotation methods for data enhancement, and inputs the data as a sequence into BERT (Bidirectional Encoder Representations from Transformers, a deep bidirectional learning model based on the Transformer model architecture), and then analyzes text similarity through a fully connected layer classifier, which improves the accuracy of entity matching in all data sets. However, since this method concatenates input data into the BERT model, the input scale and time complexity are high. HierGAT (Hierarchical Graph Attention Transformation Model Based on HHG) explicitly models the association relationship between record pairs by building a graph structure. In this graph, nodes represent record pairs and edges represent the strength of association between record pairs. Through the graph attention mechanism, HierGAT can effectively capture the structural information in the graph, so as to consider the influence of other related record pairs when making matching decisions. This method relies on the construction of the graph, so it is difficult to apply to large-scale datasets. Summary of the invention
[0004] The purpose of this application is to solve at least one of the technical problems existing in the prior art, and to provide an entity matching method and device based on the collaboration of a large language model and a small model, aiming to improve the accuracy and efficiency of entity matching of large data sets.
[0005] In a first aspect, an embodiment of the present application provides an entity matching method based on the collaboration of a large language model and a small model, including: Acquire a plurality of to-be-matched entity pairs, wherein each of the to-be-matched entity pairs includes a plurality of key-value pairs; Input each pair of the to-be-matched entities into a preset first small model, and perform key-value pair screening on each pair of the to-be-matched entities based on the first small model to obtain a number of corresponding to-be-matched simplified entity pairs; Input each pair of the simplified entities to be matched into a preset second small model, perform similar entity retrieval based on the second small model, and obtain a number of demonstration entity pairs similar to each pair of the simplified entities to be matched, wherein the second small model has a plurality of candidate demonstration entity pairs preset, and the demonstration entity pairs are used to prompt the large language model; Each pair of the to-be-matched simplified entity pair and the corresponding demonstration entity pair are input into a preset large language model to obtain an entity matching result.
[0006] According to the technical solution of the embodiment of the present application, at least the following beneficial effects are achieved: the to-be-matched entity pair refers to two entities to be matched, each entity includes multiple pairs of key-value pairs, that is, each entity can be composed of multiple key-value pairs; in practical applications, large-scale data sets usually include a large number of entities to be matched, that is, the number of key-value pairs contained in large-scale data sets is very large, some key-value pairs are important factors in determining whether an entity is matched, while some key-value pairs may be irrelevant noise. In the face of massive data and complex scenarios, matching directly based on complete entities is often inefficient and may introduce noise; therefore, the first small model is used to select key-value pairs first, and its lightweight characteristics are used to quickly filter out pairs without key-value pairs, and extract the most indicative subset of key-value pairs for entity matching, thereby significantly reducing the input complexity and thus alleviating the calculation of subsequent large language models. The burden is reduced, the processing speed is improved, the entity matching process is made more efficient, and it is conducive to processing large-scale data sets under limited resources. At the same time, by identifying and retaining those key-value pairs that contribute most to the matching decision, it helps to eliminate the noise information of the input entity pairs, so that the model can focus more on key information, thereby improving the prediction accuracy and generalization ability, especially in scenarios with uneven data quality or a large amount of irrelevant information. Subsequently, a demonstration entity pair similar to the streamlined entity pair to be matched is found through the second small model. The demonstration entity pair is used to prompt the large language model, that is, the demonstration entity pair combined with the streamlined entity pair to be matched can provide a correct entity matching example, so as to achieve effective inspiration for the large language model, help the large language model to understand the entity matching task more accurately, so as to obtain the expected results and improve the accuracy of entity matching of large data sets.
[0007] According to some embodiments of the present application, inputting each pair of the to-be-matched entities into a preset first small model, and performing key-value pair screening on each pair of the to-be-matched entities based on the first small model to obtain a number of corresponding to-be-matched simplified entity pairs, includes: Input each pair of entities to be matched into a preset first small model, and enumerate key-value pairs of each entity to be matched in each pair of entities to be matched based on the first small model to obtain a plurality of key-value pair subsets to be screened corresponding to each entity to be matched; Screening the plurality of to-be-screened key-value pair subsets of each to-be-matched entity to obtain a simplified key-value pair corresponding to each to-be-matched entity; Based on the simplified key-value pair corresponding to each of the entities to be matched, a plurality of simplified entity pairs to be matched are obtained.
[0008] According to some embodiments of the present application, the first small model is trained and optimized in the following manner: Obtain different preset entities from two different preset databases respectively to obtain preset entity pairs; Performing key-value pair screening on each of the preset entities in the preset entity pair to obtain a simplified entity pair corresponding to the preset entity pair; Encoding the preset entity pair to obtain a first embedding, and encoding the simplified entity pair to obtain a second embedding; Calculate a first matching probability between the two preset entities according to the first embedding, and calculate a second matching probability between the two simplified entities according to the second embedding; Calculating a loss value of the first small model based on the first matching probability and the second matching probability; Combined with the loss value of the first small model, the first small model is optimized using a preset deep learning optimization algorithm.
[0009] According to some embodiments of the present application, calculating a second matching probability between two of the simplified entities according to the second embedding includes: Performing numerical feature encoding based on the simplified entity pair to obtain a second feature vector; Aggregating the first embedding, the second embedding, and the second feature vector to obtain comprehensive model representation information; Based on the model comprehensive representation information, a second matching probability between the two simplified entities is calculated.
[0010] According to some embodiments of the present application, inputting each pair of the simplified entities to be matched into a preset second small model, performing similar entity retrieval based on the second small model, and obtaining a number of demonstration entity pairs similar to each pair of the simplified entities to be matched, includes: Input each pair of the simplified entity pairs to be matched into a preset second small model, perform a pre-search based on the second small model, and obtain multiple pairs of pre-demonstration entity pairs, wherein one pair of the simplified entity pairs to be matched is similar to the multiple pairs of the pre-demonstration entity pairs; Encode all the simplified entity pairs to be matched to obtain a plurality of simplified embeddings to be matched, and encode all the pre-demonstration entity pairs to obtain a plurality of pre-demonstration embeddings, wherein one simplified embedding to be matched has a corresponding similarity relationship with a plurality of pre-demonstration embeddings, and each simplified embedding to be matched has a plurality of pre-demonstration embeddings with a corresponding similarity relationship; Each of the simplified embeddings to be matched is compared with all the pre-demonstration embeddings having corresponding similarity relationships, and the pre-demonstration entity pairs corresponding to the pre-demonstration embeddings having the highest similarity to the simplified embeddings to be matched are extracted to obtain a number of demonstration entity pairs that are similar to each pair of the simplified entity pairs to be matched.
[0011] According to some embodiments of the present application, encoding all the simplified entity pairs to be matched to obtain a plurality of simplified embeddings to be matched, encoding all the pre-demonstration entity pairs to obtain a plurality of pre-demonstration embeddings, comprises: Performing first-layer text encoding on all the simplified entity pairs to be matched to obtain a plurality of first simplified embeddings to be matched, and performing first-layer text encoding on all the pre-demonstration entity pairs to obtain a plurality of first pre-demonstration embeddings; Perform a second layer of text encoding on all of the first simplified embeddings to be matched to obtain a number of simplified embeddings to be matched, and perform a second layer of text encoding on all of the first pre-demonstration embeddings to obtain a plurality of pre-demonstration embeddings.
[0012] According to some embodiments of the present application, the step of comparing each of the simplified embeddings to be matched with all the pre-demonstration embeddings having corresponding similarity relationships, extracting the pre-demonstration entity pairs corresponding to the pre-demonstration embeddings having the highest comparison similarity with the simplified embeddings to be matched, and obtaining a number of demonstration entity pairs corresponding to each pair of the simplified entity pairs to be matched similarly comprises: Calculate the cosine similarity of each of the simplified embeddings to be matched and all the pre-demonstration embeddings with corresponding similarity relationships, extract the pre-demonstration entity pairs corresponding to the pre-demonstration embeddings with the highest cosine similarity to each of the simplified embeddings to be matched, and obtain several demonstration entity pairs that are similar to each pair of the simplified entity pairs to be matched.
[0013] In a second aspect, an embodiment of the present application provides an operation control device, characterized in that it includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor executes the program to implement the entity matching method based on the collaboration of a large language model and a small model as described in the first aspect above.
[0014] In a third aspect, an embodiment of the present application provides an electronic device, comprising the operation control device of the second aspect mentioned above.
[0015] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to enable a computer to execute the entity matching method based on the collaboration of a large language model and a small model as described in the first aspect above.
[0016] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings are used to provide further understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.
[0018] The present application is further described below with reference to the accompanying drawings and embodiments; Figure 1 It is a flowchart of an entity matching method based on the collaboration of a large language model and a small model provided by an embodiment of the present application; Figure 2 is a flowchart of an entity matching method based on collaboration between a large language model and a small model provided by another embodiment of the present application; Figure 3 is a flowchart of an entity matching method based on collaboration between a large language model and a small model provided by another embodiment of the present application; Figure 4 is a flowchart of an entity matching method based on collaboration between a large language model and a small model provided by another embodiment of the present application; Figure 5 is a flowchart of an entity matching method based on collaboration between a large language model and a small model provided by another embodiment of the present application; Figure 6 is a flowchart of an entity matching method based on collaboration between a large language model and a small model provided by another embodiment of the present application; Figure 7 is a flowchart of an entity matching method based on collaboration between a large language model and a small model provided by another embodiment of the present application; Figure 8 It is a schematic diagram of an operation control device for executing an entity matching method based on the collaboration of a large language model and a small model provided by an embodiment of the present application. DETAILED DESCRIPTION
[0019] This section will describe in detail the specific embodiments of the present application. The preferred embodiments of the present application are shown in the accompanying drawings. The purpose of the accompanying drawings is to supplement the description of the text part of the specification with graphics, so that people can intuitively and vividly understand each technical feature and the overall technical solution of the present application, but it cannot be understood as a limitation on the scope of protection of the present application.
[0020] In the description of the present application, it should be understood that descriptions involving orientation, such as up, down, front, back, left, right, etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present application.
[0021] In the description of this application, "several" means one or more, "more" means more than two, "greater than", "less than", "exceed", etc. are understood to exclude the number itself, and "above", "below", "within", etc. are understood to include the number itself. If there is a description of "first" or "second", it is only used to distinguish the technical features, and cannot be understood as indicating or implying the relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features. In the description of this application, unless otherwise clearly defined, terms such as setting, installing, connecting, etc. should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meanings of the above terms in this application based on the specific content of the technical solution.
[0022] The following is combined with Figure 1-7 , the various embodiments of the entity matching method based on the collaboration of a large language model and a small model of the present application are further elaborated.
[0023] like Figure 1 As shown, Figure 1 This is a flowchart of an entity matching method based on the collaboration of a large language model and a small model provided by an embodiment of the present application. The entity matching method based on the collaboration of a large language model and a small model may include but is not limited to step S110, step S120, step S130 and step S140.
[0024] Step S110, obtaining a plurality of to-be-matched entity pairs, wherein each to-be-matched entity in the to-be-matched entity pairs includes a plurality of key-value pairs; Step S120: input each to-be-matched entity pair into a preset first small model, and perform key-value pair screening on each to-be-matched entity pair based on the first small model to obtain a number of corresponding to-be-matched simplified entity pairs; Step S130: input each pair of simplified entities to be matched into a preset second small model, perform similar entity retrieval based on the second small model, and obtain a number of demonstration entity pairs similar to each pair of simplified entities to be matched, wherein the second small model has a plurality of candidate pairs of demonstration entity pairs preset, and the demonstration entity pairs are used to prompt the large language model; Step S140: input each pair of simplified entities to be matched and the corresponding demonstration entity pair into a preset large language model to obtain entity matching results.
[0025] In this embodiment, each entity includes multiple key-value pairs, that is, each entity can be composed of multiple key-value pairs, for example, Entity 1 includes: Beer Name: Arrow Point Amber; Factory Name: Bainbridge Island Brewing Company; Style: Amber Ale; Entity 2 includes: Beer Name: Bainbridge Island Arrow Point Amber; Factory Name: Bainbridge Island Brewing Company; Style: Amber Ale; Among them, entity 1 includes the first key-value pair (Beer Name: Arrow Point Amber), the second key-value pair (Factory Name: Bainbridge Island Brewing Company), and the third key-value pair (Style: AmberAle), and entity 2 includes the first key-value pair (Beer Name: Bainbridge Island Arrow Point Amber), the second key-value pair (Factory Name: Bainbridge Island Brewing Company), and the third key-value pair (Style: Amber Ale). It can be understood that when the large language model performs entity matching tasks based on entity 1 and entity 2, the output result is mismatch, because the values corresponding to the same key (Beer Name) in entity 1 and entity 2 are different.
[0026] It can be understood by those skilled in the art that the large language model, with its massive data training background, can capture the subtle differences and complex structures of the language, and thus learn deeper semantic features and patterns in a rich context. At the same time, because the large language model is trained with a massive corpus, it has a large amount of external knowledge that cannot be learned from the training set, and can provide professional guidance for entity matching, providing strong support for accurate matching between entities. The small model, thanks to its lightweight characteristics, can quickly input results, thereby improving the efficiency of the operation.
[0027] It can be understood that the entity matching method based on the collaboration of a large language model and a small model can perform entity matching on one pair of entities to be matched, and can also perform entity matching on multiple pairs of entities to be matched simultaneously. Technicians in this technical field can undoubtedly understand the process of performing entity matching on one pair and on multiple pairs of entities to be matched simultaneously based on the specific content of the technical solution.
[0028] Specifically, a plurality of to-be-matched entity pairs are obtained, where the to-be-matched entity pairs refer to two entities to be matched, and a preset first small model is input into each to-be-matched entity pair, and the first small model is used to screen the key-value pairs in the two entities to be matched, so as to obtain entities including the key-value pairs that are most indicative of entity matching. The first small model can be a model trained based on the rules for entity matching of a large language model, or a model trained based on the characteristics between different entities. The training based on the rules for entity matching of a large language model can be to identify and extract the possible matching key-value pairs in the two entities of the standard format field in the entity through a regular expression, and the training based on the characteristics between different entities can be to compare the similarity between the attributes of the two entities, so that the first small model has the ability to screen key-value pairs; Therefore, when key-value pairs are filtered for each entity pair to be matched based on the first small model, for each entity to be matched in each entity pair to be matched, the first small model can be to filter each entity to be matched separately, and after each entity to be matched is filtered, it is merged into the entity pair corresponding to the entity pair before filtering, so as to obtain several corresponding filtered entity pairs to be matched, that is, the simplified entity pairs to be matched.
[0029] It can be understood that the first small model is used to provide refined information input for the subsequent large language model, that is, to provide the subsequent large language model with key-value pairs that contribute to the precise matching decision, and the key-value pairs in the entity pairs to be matched may all contribute to the entity matching decision of the large language model. Therefore, the simplified entity pairs to be matched after screening based on the first large model may be the same as the key-value pairs in the entity pairs to be matched, but it is more likely that the number of key-value pairs in the simplified entity pairs to be matched after screening based on the first large model is less than the number of key-value pairs in the entity pairs to be matched; In addition, when the subsequent large language model performs entity matching, the entity pair input used is the filtered entity pair input rather than the original entity pair to be matched. Therefore, it is necessary to ensure that the actual meaning of the streamlined entity pair to be matched is not different from the meaning of the original entity pair to be matched. When the first small model is trained, it can be put into use only after determining that the screening accuracy of the first small model meets the standard.
[0030] After completing the key-value pair screening, each to-be-matched streamlined entity pair is input into a preset second small model, and the second small model is a model for retrieving demonstration entity pairs similar to the to-be-matched streamlined entity pair from a preset demonstration entity database. The demonstration entity pairs similar to the to-be-matched streamlined entity pair can be demonstration entity pairs with the closest entity semantics, or demonstration entity pairs with the most similar entity contents; The preset demonstration entity database stores a large number of candidate demonstration entity pairs that have been manually matched. These candidate demonstration entity pairs have been manually screened, classified, and annotated to facilitate the rapid retrieval of similar demonstration entity pairs from the demonstration entity database. Demonstration entity pairs refer to those entity pairs in the preset demonstration entity database that have been accurately classified or annotated, and are used to serve as a bridge for understanding and matching entities. The combination of demonstration entity pairs and streamlined entity pairs to be matched can inspire the large language model to better understand and perform entity matching tasks through task examples. Therefore, based on the second small model for similar entity retrieval, the second small model can be respectively searched for each streamlined entity pair to be matched, so as to obtain a number of demonstration entity pairs with the same number as the streamlined entity pairs to be matched, and each streamlined entity pair to be matched has a corresponding similar pair of demonstration entity pairs.
[0031] It can be understood that when the second small model performs similar entity retrieval, it can first parse the input simplified entity pairs to be matched, extract key information such as the names, attributes, and categories of the simplified entity pairs to be matched; then extract features based on the parsed key information, and these features can be text, numerical, or structured, for example, using technologies such as bag-of-words models, TF-IDF, and Word Embedding; then, the second small model will match the extracted features with the features of the candidate demonstration entity pairs stored in the demonstration entity database, and the following matching methods can be used: a. Similarity calculation: Calculate the similarity between the input simplified entity pair features to be matched and the candidate demonstration entity pair features in the database. The algorithms that can be used include cosine similarity, Jaccard similarity, edit distance, etc. b. Vector search: If the simplified entity pairs to be matched are represented as high-dimensional vectors (for example, features extracted using a deep learning model), vector search algorithms (such as nearest neighbor search, locality sensitive hashing (LSH), etc.) can be used to find similar candidate demonstration entity pairs; Finally, the second small model extracts the candidate demonstration entity pairs that are most similar to each pair of matched streamlined entity pairs to obtain the corresponding candidate demonstration entity pairs.
[0032] After obtaining the demonstration entity pair, each pair of simplified entity pairs to be matched and the corresponding demonstration entity pairs are input into the preset large language model. According to the input format of the large language model, each pair of simplified entity pairs to be matched and the corresponding demonstration entity pairs can be converted into a specific format and then input into the large language model, for example, a text pair in a specific format; then, the large language model performs the task of entity matching, and then determines whether the two entities of the simplified entity pairs to be matched can be matched according to the result output by the large language model, and obtains the entity matching result. Before the large language model performs the task of entity matching, the large language model will first learn the association between the two entities of the demonstration entity pair, because the demonstration entity pair is provided to the large language model as a correct entity matching example, that is, the demonstration entity pair can be specially marked when input into the large language model, so that the large language model can understand the purpose of the demonstration entity pair and learn and understand the entity matching task; then, after the large language model completes the learning and understanding of the demonstration entity pair, it performs entity matching on the simplified entity pairs to be matched, thereby outputting the result on the degree of matching between the simplified entity pairs to be matched.
[0033] It can be understood that in this embodiment, the entity matching method based on the collaboration of a large language model and a small model can effectively improve the accuracy and efficiency of entity matching, and provides a new perspective and solution for solving the entity resolution problem in big data integration. The entity matching method based on the collaboration of a large language model and a small model can be applied to scenarios such as entity matching and data integration. For example, in the experimental results, the entity matching method based on the collaboration of a large language model and a small model achieved good performance in multiple entity matching large data sets, such as an F1 index of 93.81 on Walmart-Amazon.
[0034] like Figure 2 As shown, Figure 2 It is a flowchart of an entity matching method based on the collaboration of a large language model and a small model provided by another embodiment of the present application; regarding the above-mentioned step S120, it may include but is not limited to step S220, step S320 and step S420.
[0035] Step S220: input a preset first small model into each to-be-matched entity pair, and enumerate key-value pairs of each to-be-matched entity in each to-be-matched entity pair based on the first small model to obtain a plurality of to-be-screened key-value pair subsets corresponding to each to-be-matched entity; Step S320: Screen multiple to-be-screened key-value pair subsets of each to-be-matched entity to obtain a simplified key-value pair corresponding to each to-be-matched entity; Step S420: Based on the simplified key-value pair corresponding to each entity to be matched, a plurality of simplified entity pairs to be matched are obtained.
[0036] In this embodiment, before the first small model performs key-value pair screening on each to-be-matched entity in each to-be-matched entity pair, it first enumerates the key-value pairs of each to-be-matched entity in each to-be-matched entity pair, traverses all possible entity key-value pair selection methods by enumeration, and then determines the most appropriate key-value pair selection method, that is, after listing the possible entity key-value pair selection methods for each to-be-matched entity in each to-be-matched entity pair, screening is performed. For example, if an entity has 4 key-value pairs, then theoretically there are 16 different selection methods (including selecting 0, 1, 2, 3 and 4 key-value pairs), and each selection method corresponds to a key-value pair subset. In this way, multiple to-be-matched key-value pair subsets corresponding to each to-be-matched entity in each to-be-matched entity pair can be obtained.
[0037] After obtaining multiple subsets of key-value pairs to be screened corresponding to each entity to be matched, key-value pairs are screened based on the first small model, that is, the subset of key-value pairs that are most indicative of entity matching is screened and refined. For example, entity matching scores are performed on each subset of key-value pairs to be screened to determine the adaptability of each subset of key-value pairs to be screened for entity matching; then, based on the scores of each subset of key-value pairs to be screened, the subset of key-value pairs with the highest scores, that is, the subset of key-value pairs that are most indicative of entity matching, is screened out. The key-value pairs in this subset of key-value pairs that are most indicative of entity matching can be considered to be effective and important key-value pairs that can determine whether the entities are matched. Therefore, the key-value pairs in the subset of key-value pairs that are most indicative of entity matching in each entity to be matched are used as simplified key-value pairs, and other key-value pairs in each entity to be matched can be selected and filtered out. In this way, only simplified key-value pairs remain in the key-value pairs in each entity to be matched, thereby obtaining simplified entities corresponding to each entity to be matched, and simplified entity pairs to be matched corresponding to each pair of entities to be matched.
[0038] like Figure 3 As shown, Figure 3It is a flowchart of an entity matching method based on the collaboration of a large language model and a small model provided by another embodiment of the present application; the method for training and optimizing the first small model may include but is not limited to step S150, step S160, step S170, step S180, step S190 and step S1100.
[0039] Step S150: Obtain different preset entities from two different preset databases to obtain a preset entity pair; Step S160: screening each preset entity in the preset entity pair by key-value pairs to obtain a simplified entity pair corresponding to the preset entity pair; Step S170: Encode the preset entity pair to obtain a first embedding, and encode the simplified entity pair to obtain a second embedding; Step S180: calculating a first matching probability between two preset entities according to the first embedding, and calculating a second matching probability between two simplified entities according to the second embedding; Step S190, calculating the loss value of the first small model based on the first matching probability and the second matching probability; Step S1100: Combine the loss value of the first small model and optimize the first small model using a preset deep learning optimization algorithm.
[0040] It can be understood that the first small model is used to screen the key-value pairs in each to-be-matched entity in each pair of to-be-matched entities. Therefore, the first small model needs to be trained to improve the screening accuracy of the first small model.
[0041] It is understandable that two different databases pre-store a large number of different entities respectively, and the entities pre-stored in the two different databases may be completely different, that is, there is no entity in one database that is exactly the same as the entity in another database, and each entity in one database is different from each entity in another database. Therefore, different preset entities are obtained from two different preset databases to obtain a preset entity pair. One preset entity can be obtained from each of the two databases to obtain a preset entity pair consisting of two preset entities.
[0042] It can be understood that in order to train the accuracy of the first small model regarding key-value pair screening, after obtaining the preset entity pairs, key-value pairs are screened for each preset entity in the preset entity pairs based on the first small model to obtain simplified entity pairs corresponding to the preset entity pairs.
[0043] After obtaining the preset entity pair and the simplified entity pair, the two preset entities in the preset entity pair can be recorded as and , and the two simplified entities of the simplified entity pair after key-value pair filtering can be marked as and , at this time, the preset entity and Carries all the information needed for entity matching, although the simplified entity and The carefully selected key-value pair information is retained, but the preset entity and the simplified entity may still include many key-value pairs, which is not conducive to analyzing whether the screening of the simplified entity is accurate. Therefore, in order to effectively extract the entity meaning information called by the preset entity and the simplified entity, the preset entity pair is encoded to obtain the first embedding, and the simplified entity pair is encoded to obtain the second embedding; Different encoders can be used to encode preset entity pairs and simplified entity pairs, and the encoders are embedded in the first small model. In this embodiment, the pre-trained language model RoBERTa can be used for encoding. The pre-trained language model RoBERTa is used for encoding because the pre-trained language model RoBERTa is a widely used and high-performance text encoding model, and based on its outstanding performance in the field of natural language processing, especially its strong ability to understand complex contexts and long-distance dependencies, the pre-trained language model RoBERTa can be used as the encoder of the first small model to better extract the semantic information of entity pairs text; for the encoding of preset entities, RoBERTa can effectively abstract the deep semantic connection between entities, which is not limited to the similarity at the lexical level, but also covers multi-dimensional matching information such as syntactic structure and semantic roles. Such a vectorized representation provides the first small model with a powerful tool to evaluate the matching potential of two complete entities at a higher level of abstraction; Based on this, the pre-trained language model RoBERTa is used to encode the preset entity pairs to obtain the first embedding that reflects the text semantics of the preset entity pairs. ,
[0044] The pre-trained language model RoBERTa is used to encode the simplified entity pairs to obtain the second embedding that reflects the textual semantics of the simplified entity pairs. .
[0045]
[0046] It should be noted that the encoder for encoding the preset entity pairs and the encoder for encoding the streamlined entity pairs can be the same, or different encoders can be used to encode the preset entity pairs and the streamlined entity pairs respectively. For example, the first small model includes a first pre-trained language model RoBERTa and a second pre-trained language model RoBERTa. The first pre-trained language model RoBERTa is used to encode the preset entity pairs, and the second pre-trained language model RoBERTa is used to encode the streamlined entity pairs. This separate encoding strategy ensures the separate processing of key-value pair information and matching information, so that the first small model can consider the global matching and local key-value pair correlation of entities in parallel. The two complement each other and jointly promote the accuracy of the final matching decision.
[0047] In order to achieve training optimization of the first small model, the accuracy of the simplified entities currently screened by the first small model can be judged according to the difference between the matching degree of the two entities in the preset entity pair and the matching degree of the two entities in the simplified entity pair, and then the first small model is optimized according to the accuracy. Therefore, the first matching probability between the two preset entities is calculated according to the first embedding, and the second matching probability between the two simplified entities is calculated according to the second embedding.
[0048] It is understandable that a variety of different matching probability calculation tools can be used to calculate the first matching probability and the second matching probability. In this embodiment, a multilayer perceptron (MLP) structure can be used. The multilayer perceptron is a feedforward artificial neural network consisting of at least three layers of nodes: an input layer, one or more hidden layers, and an output layer. An activation function is usually used in the output layer to convert the output into a probability distribution. Therefore, the first embedding and the second embedding can be input into the multilayer perceptron respectively, and the multilayer perceptron can be used to transform the first embedding previously obtained. and the second embedding Perform deep key-value pair conversion and integration, calculate the first matching probability between two preset entities and the second matching probability between two streamlined entities, so as to refine the core matching information in the embedding and map it to a probability space.
[0049]
[0050] It is understandable that for the first embedding and the second embedding The purpose of deep key-value pair conversion and integration is to extract the matching information between two preset entities and the matching information between two streamlined entities. For example, the first embedding integration can be converted into a scalar value in the form of a dot product. This scalar value in the form of a dot product represents the degree of matching between the preset entities, and then the first matching probability is calculated through a multi-layer perceptron.
[0051] After obtaining the first matching probability and the second matching probability, in order to optimize the first small model through the first matching probability and the second matching probability, the loss value of the first small model can be calculated based on the first matching probability and the second matching probability, and then combined with the loss value of the first small model, the first small model can be optimized through a preset deep learning optimization algorithm. In this embodiment, the first loss based on the first matching probability and the second loss based on the second matching probability can be calculated respectively through a binary cross entropy loss function and a predefined matching label. After obtaining the first loss and the second loss, the loss value of the first small model is obtained by adding the first loss and the second loss, and then the first small model is optimized by combining the loss value of the first small model and the deep learning optimization algorithm Adam (Adaptive Moment Estimation).
[0052] Based on this, the first small model includes one or two pre-trained language models RoBERTa, a multi-layer perceptron and a deep learning optimization algorithm Adam. By repeatedly obtaining different preset entities from two different preset databases and performing training and optimization based on different preset entity pairs, the performance of the first small model can be greatly improved.
[0053] like Figure 4 As shown, Figure 4 It is a flowchart of an entity matching method based on the collaboration of a large language model and a small model provided by another embodiment of the present application; regarding step S180, it may include but is not limited to step S280, step S380 and step S480.
[0054] Step S280, performing numerical feature encoding based on the simplified entity pair to obtain a second feature vector; Step S380, aggregating the first embedding, the second embedding, and the second feature vector to obtain comprehensive model representation information; Step S480: Calculate the second matching probability between the two simplified entities based on the model comprehensive representation information.
[0055] Specifically, in order to comprehensively utilize the complete matching information of the preset entity and the key key-value pair information of the simplified entity, when calculating the second matching probability between two simplified entities, more information can be combined for calculation. Therefore, firstly, numerical feature encoding is performed based on the simplified entity pair to obtain the second feature vector , the second eigenvector Ability to represent key-value pair information of simplified entity pairs with more comprehensive information; Embed the first , the second embedding , the second eigenvector Aggregation to build a model rich in multi-dimensional information to comprehensively represent information ,This aggregation process not only integrates the relevant clues of the preset entity pairs and the ,simplified entity pairs, but also incorporates the key-value pair description of the ,simplified entity itself and its key-value pair filtering information, forming a ,comprehensive and high-dimensional key-value pair representation space; Then, the model is integrated to represent the information Input into a multi-layer perceptron, and use the multi-layer perceptron to infer the probability that the first small model predicts the correctness of the current instance , that is, the second matching probability between the two simplified entities.
[0056]
[0057] like Figure 5 As shown, Figure 5 It is a flowchart of an entity matching method based on the collaboration of a large language model and a small model provided by another embodiment of the present application; regarding step S130, it may include but is not limited to step S230, step S330 and step S430.
[0058] Step S230: input each pair of simplified entities to be matched into a preset second small model, perform a pre-search based on the second small model, and obtain multiple pairs of pre-demonstration entity pairs, wherein one pair of simplified entities to be matched is similar to the multiple pairs of pre-demonstration entity pairs; Step S330: Encode all pairs of simplified entities to be matched to obtain a number of simplified embeddings to be matched, and encode all pairs of pre-demonstration entities to obtain a plurality of pre-demonstration embeddings, wherein one simplified embedding to be matched has a corresponding similarity relationship with a plurality of pre-demonstration embeddings, and each simplified embedding to be matched has a plurality of pre-demonstration embeddings with a corresponding similarity relationship; Step S430, compare each simplified embedding to be matched with all pre-demonstration embeddings with corresponding similarity relationships, extract the pre-demonstration entity pairs corresponding to the pre-demonstration embeddings with the highest similarity to the simplified embedding to be matched, and obtain several demonstration entity pairs that are similar to each pair of simplified entity pairs to be matched.
[0059] It can be understood that the second small model is used to find a demonstration entity pair that is similar to the streamlined entity pair to be matched, so as to provide a correct entity matching example to effectively inspire the large language model and help the large language model understand the entity matching task more accurately.
[0060] Therefore, each pair of streamlined entities to be matched is input into the preset second small model, and a demonstration entity pair database is preset in the second small model. A plurality of candidate demonstration entity pairs are pre-stored in the demonstration entity pair database. The task of the second small model is to find the demonstration entity pair that is most similar to each streamlined entity pair to be matched in the demonstration entity pair database. However, due to the large number of candidate demonstration entity pairs pre-stored in the demonstration entity pair database, the conventional retrieval method will cause the retrieval to take a long time. Therefore, in order to improve the retrieval efficiency while ensuring the accuracy of the retrieval, a pre-retrieval can be performed first. The pre-retrieval can use an efficient and fast retrieval method to find potential demonstration entity pairs similar to each streamlined entity pair to be matched in the demonstration entity pair database, thereby obtaining a plurality of pre-demonstration entity pairs that have a certain degree of similarity with the streamlined entity pairs to be matched.
[0061] It should be noted that each pair of simplified entities to be matched has corresponding multiple pairs of pre-demonstration entity pairs, that is, a pair of simplified entities to be matched corresponds to multiple pairs of pre-demonstration entity pairs. In addition, the simplified entities to be matched have been screened by key-value pairs, and the candidate demonstration entity pairs in the demonstration entity pair database have also been screened by key-value pairs.
[0062] It is understandable that in the entity matching task, simple matching based on vocabulary or surface key-value pairs is often insufficient to capture the subtle semantic differences between entities, especially in complex text environments. Therefore, after obtaining the pre-demonstration entity pairs, all the simplified entity pairs to be matched are encoded separately to obtain several simplified embeddings to be matched, and all the pre-demonstration entity pairs are encoded separately to obtain multiple pre-demonstration embeddings, so as to deeply explore the contextual meaning of the entity and ensure that the matching process is not only based on the consistency of the entity name, but also takes into account their usage and implicit information in specific situations. In this embodiment, the pre-trained language model RoBERTa can be used for encoding.
[0063] It can be foreseen that if a pair of simplified entity pairs to be matched has corresponding similarities with multiple pairs of pre-demonstration entity pairs, then one simplified embedding to be matched has corresponding similarity relationships with multiple pre-demonstration embeddings, and each simplified entity pair to be matched has corresponding multiple pairs of pre-demonstration entity pairs, then each simplified embedding to be matched has multiple pre-demonstration embeddings with corresponding similarity relationships.
[0064] After obtaining the embeddings of all pairs of simplified entities to be matched and pre-demonstration entity pairs, each simplified embedding to be matched is compared with all pre-demonstration embeddings having corresponding similarity relationships, that is, one simplified embedding to be matched is compared with multiple pre-demonstration embeddings having corresponding similarity relationships, so that each simplified embedding to be matched is compared with multiple pre-demonstration embeddings having corresponding similarity relationships, and the comparison similarity between each simplified embedding to be matched and multiple pre-demonstration embeddings having corresponding similarity relationships is obtained; Then, based on the comparison similarity between each simplified embedding to be matched and multiple pre-demonstration embeddings with corresponding similarity relationships, the pre-demonstration entity pairs corresponding to the pre-demonstration embedding with the highest comparison similarity to the simplified embedding to be matched are extracted, thereby obtaining several pre-demonstration entity pairs corresponding to the pre-demonstration embedding with the highest comparison similarity to each simplified embedding to be matched, that is, several demonstration entity pairs that are similar to each pair of simplified entity pairs to be matched.
[0065] It is understandable that the method of comparing the similarity between the to-be-matched simplified embedding and the pre-demonstration embedding may include a cosine similarity calculation comparison or an inner product calculation comparison.
[0066] Based on this, the second small model includes one or two encoders and an embedded comparator, and the encoder in the second small model is different from the encoder in the first small model.
[0067] like Figure 6 As shown, Figure 6 It is a flowchart of an entity matching method based on the collaboration of a large language model and a small model provided by another embodiment of the present application; regarding step S330, it may include but is not limited to step S530 and step S630.
[0068] Step S530: Perform first-layer text encoding on all pairs of simplified entities to be matched to obtain a number of first simplified embeddings to be matched, and perform first-layer text encoding on all pairs of pre-demonstration entities to obtain a number of first pre-demonstration embeddings; Step S630: perform second-layer text encoding on all first simplified embeddings to be matched to obtain a number of simplified embeddings to be matched, and perform second-layer text encoding on all first pre-demonstration embeddings to obtain a plurality of pre-demonstration embeddings.
[0069] Specifically, in order to be able to more deeply explore the meaning of entities, the matching simplified entity pairs and pre-demonstration entity pairs can be re-encoded. After the first layer of text encoding is performed on all the matching simplified entity pairs and all the pre-demonstration entity pairs, the corresponding first matching simplified embeddings and multiple first pre-demonstration embeddings can be obtained. The pre-trained language model RoBERTa can be used for encoding. The two demonstration entities in the demonstration entity pair can be represented as and , the two to-be-matched simplified entities in the to-be-matched simplified entities are represented as and , and the first to-be-matched simplified embedding is represented as , the first pre-demonstration embedding is represented as ; After completing the first layer of encoding, the second layer of text encoding can be performed on all the first to-be-matched simplified embeddings and all the first pre-demonstration embeddings. All the first to-be-matched simplified embeddings and all the first pre-demonstration embeddings can be projected into a high-dimensional semantic space through a multi-layer perceptron to further mine the high-dimensional semantic information of the entity pairs to extract a more refined entity embedding representation, thereby obtaining a number of corresponding to-be-matched simplified embeddings and multiple pre-demonstration embeddings. The to-be-matched simplified embeddings can be represented as , the pre-demonstration embedding is represented as .
[0070]
[0071]
[0072] Based on this, the second small model can include one or two pre-trained language models RoBERTa, a multi-layer perceptron and an embedding comparator. The pre-trained language model RoBERTa and the multi-layer perceptron in the second small model are different from the pre-trained language model RoBERTa and the multi-layer perceptron in the first small model.
[0073] like Figure 7 As shown, Figure 7 It is a flowchart of an entity matching method based on the collaboration of a large language model and a small model provided by another embodiment of the present application; regarding step S430, it may include but is not limited to step S730.
[0074] Step S730, respectively calculate the cosine similarity between each simplified embedding to be matched and all pre-demonstration embeddings with corresponding similarity relationships, extract the pre-demonstration entity pairs corresponding to the pre-demonstration embeddings with the highest cosine similarity to each simplified embedding to be matched, and obtain several demonstration entity pairs that are similar to each pair of simplified entity pairs to be matched.
[0075] After obtaining the simplified embedding to be matched and the pre-demonstration embedding, cosine similarity can be used as a measurement standard. This is a method widely used in high-dimensional space to measure vector similarity. It can effectively eliminate the influence of vector length and focus on the similarity in direction. By calculating cosine similarity, it can accurately identify the entities with the closest semantics, thereby providing highly relevant instance references; therefore, in this embodiment, the method of comparing the similarity between the simplified embedding to be matched and the pre-demonstration embedding adopts the method of cosine similarity comparison. Specifically, the cosine similarity of each simplified embedding to be matched and all pre-demonstration embeddings with corresponding similarity relationships is calculated respectively. ,
[0076] In this way, after obtaining the cosine similarity between each simplified embedding to be matched and all pre-demonstration embeddings with corresponding similarity relationships, the pre-demonstration entity pairs corresponding to the pre-demonstration embeddings with the highest cosine similarity to each simplified embedding to be matched are extracted, and several demonstration entity pairs similar to each simplified entity pair to be matched are obtained, that is, a pair of simplified entity pairs to be matched has a corresponding pair of demonstration entity pairs, and each simplified entity pair to be matched has a corresponding pair of demonstration entity pairs.
[0077] Based on the entity matching method based on the collaboration of a large language model and a small model in the above-mentioned embodiments, various embodiments of the operation control device, electronic device, computer-readable storage medium and computer program product of the present application are respectively proposed below.
[0078] like Figure 8 As shown, Figure 8 800 is a schematic diagram of an operation control device for executing an entity matching method based on the collaboration of a large language model and a small model provided by an embodiment of the present application. The operation control device 800 implemented in the present application includes: a processor 820, a memory 810, and a computer program stored in the memory 810 and executable on the processor 820, wherein: Figure 8 In the figure, a processor 820 and a memory 810 are taken as an example.
[0079] The processor 820 and the memory 810 may be connected via a bus or other means. Figure 8 The example of connecting through bus is taken in the following.
[0080] The memory 810, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer executable programs. In addition, the memory 810 may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory 810 optionally includes a memory 810 remotely arranged relative to the processor 820, and these remote memories 810 can be connected to the operation control device 800 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0081] Those skilled in the art will understand that Figure 8 The device structure shown in the figure does not constitute a limitation on the operation control device 800, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0082] exist Figure 8In the operation control device 800 shown, the processor 820 can be used to call the control program stored in the memory 810, so as to implement the above-mentioned entity matching method based on the collaboration of the large language model and the small model. Specifically, the non-transient software program and instructions required to implement the entity matching method based on the collaboration of the large language model and the small model of the above-mentioned embodiment are stored in the memory 810, and when executed by the processor 820, the entity matching method based on the collaboration of the large language model and the small model of the above-mentioned embodiment is executed.
[0083] It is worth noting that since the operation control device 800 of the embodiment of the present application can execute the entity matching method based on the collaboration of the large language model and the small model in any of the above-mentioned embodiments, the specific implementation manner and technical effects of the operation control device 800 of the embodiment of the present application can refer to the specific implementation manner and technical effects of the entity matching method based on the collaboration of the large language model and the small model in any of the above-mentioned embodiments.
[0084] In addition, an embodiment of the present application further provides an electronic device, which includes the operation control device of the above embodiment.
[0085] It is worth noting that since the electronic device of the embodiment of the present application includes the operation control device of the above-mentioned embodiment, and the operation control device of the above-mentioned embodiment is capable of executing the entity matching method based on the collaboration of the large language model and the small model of any of the above-mentioned embodiments, the specific implementation manner and technical effects of the electronic device of the embodiment of the present application can refer to the specific implementation manner and technical effects of the entity matching method based on the collaboration of the large language model and the small model of any of the above-mentioned embodiments.
[0086] In addition, an embodiment of the present application further provides a computer-readable storage medium storing computer-executable instructions for executing the above-described entity matching method based on the collaboration of a large language model and a small model. Figures 1 to 7 The method steps in .
[0087] It is worth noting that since the computer-readable storage medium of the embodiment of the present application can execute the entity matching method based on the collaboration of a large language model and a small model in any of the above-mentioned embodiments, the specific implementation methods and technical effects of the computer-readable storage medium of the embodiment of the present application can refer to the specific implementation methods and technical effects of the entity matching method based on the collaboration of a large language model and a small model in any of the above-mentioned embodiments.
[0088] In addition, an embodiment of the present application further provides a computer program product, including a computer program or computer instructions, the computer program or computer instructions are stored in a computer-readable storage medium, a processor of a computer device reads the computer program or computer instructions from the computer-readable storage medium, and the processor executes the computer program or computer instructions, so that the computer device executes the above-mentioned entity matching method based on the collaboration of a large language model and a small model. Exemplarily, the above-described Figures 1 to 7 The method steps in .
[0089] It is worth noting that since the computer program product of the embodiments of the present application can execute the entity matching method based on the collaboration of a large language model and a small model in any of the above-mentioned embodiments, the specific implementation methods and technical effects of the computer program product of the embodiments of the present application can refer to the specific implementation methods and technical effects of the entity matching method based on the collaboration of a large language model and a small model in any of the above-mentioned embodiments.
[0090] It will be appreciated by those skilled in the art that all or some of the steps and systems in the disclosed methods above may be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium or a non-transitory medium and a communication medium or a temporary medium. As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information such as computer-readable instructions, data structures, program modules or other data. Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disk DVD or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that may be used to store desired information and may be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0091] In several embodiments provided in the present application, it should be understood that the disclosed systems, apparatuses and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of apparatuses or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the scheme of this embodiment.
[0092] It should also be understood that the various implementations provided in the embodiments of the present application can be combined arbitrarily to achieve different technical effects.
[0093] The embodiments of the present application are described in detail above in conjunction with the accompanying drawings, but the present application is not limited to the above embodiments, and various changes can be made within the knowledge scope of ordinary technicians in the technical field without departing from the purpose of the present application.
Claims
1. An entity matching method based on the collaboration of a large language model and a small model, characterized in that: include: Acquire a plurality of to-be-matched entity pairs, wherein each of the to-be-matched entity pairs includes a plurality of key-value pairs; Input each pair of the to-be-matched entities into a preset first small model, and perform key-value pair screening on each pair of the to-be-matched entities based on the first small model to obtain a number of corresponding to-be-matched simplified entity pairs; Input each pair of the simplified entities to be matched into a preset second small model, perform similar entity retrieval based on the second small model, and obtain a number of demonstration entity pairs similar to each pair of the simplified entities to be matched, wherein the second small model has a plurality of candidate demonstration entity pairs preset, and the demonstration entity pairs are used to prompt the large language model; Each pair of the to-be-matched simplified entity pair and the corresponding demonstration entity pair are input into a preset large language model to obtain an entity matching result.
2. The entity matching method based on the collaboration of a large language model and a small model according to claim 1, characterized in that: The step of inputting each pair of the to-be-matched entities into a preset first small model, and performing key-value pair screening on each pair of the to-be-matched entities based on the first small model to obtain a number of corresponding to-be-matched simplified entity pairs includes: Input each pair of entities to be matched into a preset first small model, and enumerate key-value pairs of each entity to be matched in each pair of entities to be matched based on the first small model to obtain a plurality of key-value pair subsets to be screened corresponding to each entity to be matched; Screening the plurality of to-be-screened key-value pair subsets of each to-be-matched entity to obtain a simplified key-value pair corresponding to each to-be-matched entity; Based on the simplified key-value pair corresponding to each of the entities to be matched, a plurality of simplified entity pairs to be matched are obtained.
3. The entity matching method based on the collaboration of a large language model and a small model according to claim 1, characterized in that: The first small model is trained and optimized in the following way: Obtain different preset entities from two different preset databases respectively to obtain preset entity pairs; Performing key-value pair screening on each of the preset entities in the preset entity pair to obtain a simplified entity pair corresponding to the preset entity pair; Encoding the preset entity pair to obtain a first embedding, and encoding the simplified entity pair to obtain a second embedding; Calculate a first matching probability between the two preset entities according to the first embedding, and calculate a second matching probability between the two simplified entities according to the second embedding; Calculating a loss value of the first small model based on the first matching probability and the second matching probability; Combined with the loss value of the first small model, the first small model is optimized using a preset deep learning optimization algorithm.
4. The entity matching method based on the collaboration of a large language model and a small model according to claim 3 is characterized in that: The calculating a second matching probability between the two simplified entities according to the second embedding includes: Performing numerical feature encoding based on the simplified entity pair to obtain a second feature vector; Aggregating the first embedding, the second embedding, and the second feature vector to obtain comprehensive model representation information; Based on the model comprehensive representation information, a second matching probability between the two simplified entities is calculated.
5. The entity matching method based on the collaboration of a large language model and a small model according to claim 1, characterized in that: The step of inputting each pair of the simplified entities to be matched into a preset second small model, performing similar entity retrieval based on the second small model, and obtaining a plurality of demonstration entity pairs similar to each pair of the simplified entities to be matched includes: Input each pair of the simplified entity pairs to be matched into a preset second small model, perform a pre-search based on the second small model, and obtain multiple pairs of pre-demonstration entity pairs, wherein one pair of the simplified entity pairs to be matched is similar to the multiple pairs of the pre-demonstration entity pairs; Encode all the simplified entity pairs to be matched to obtain a plurality of simplified embeddings to be matched, and encode all the pre-demonstration entity pairs to obtain a plurality of pre-demonstration embeddings, wherein one simplified embedding to be matched has a corresponding similarity relationship with a plurality of pre-demonstration embeddings, and each simplified embedding to be matched has a plurality of pre-demonstration embeddings with a corresponding similarity relationship; Each of the simplified embeddings to be matched is compared with all the pre-demonstration embeddings having corresponding similarity relationships, and the pre-demonstration entity pairs corresponding to the pre-demonstration embeddings having the highest similarity to the simplified embeddings to be matched are extracted to obtain a number of demonstration entity pairs that are similar to each pair of the simplified entity pairs to be matched.
6. The entity matching method based on the collaboration of a large language model and a small model according to claim 5, characterized in that: The step of encoding all the simplified entity pairs to be matched to obtain a plurality of simplified embeddings to be matched, and encoding all the pre-demonstration entity pairs to obtain a plurality of pre-demonstration embeddings, comprises: Performing first-layer text encoding on all the simplified entity pairs to be matched to obtain a plurality of first simplified embeddings to be matched, and performing first-layer text encoding on all the pre-demonstration entity pairs to obtain a plurality of first pre-demonstration embeddings; Perform a second layer of text encoding on all of the first simplified embeddings to be matched to obtain a number of simplified embeddings to be matched, and perform a second layer of text encoding on all of the first pre-demonstration embeddings to obtain a plurality of pre-demonstration embeddings.
7. The entity matching method based on the collaboration of a large language model and a small model according to claim 5, characterized in that: The step of comparing each of the simplified embeddings to be matched with all the pre-demonstration embeddings having corresponding similarity relationships, extracting the pre-demonstration entity pairs corresponding to the pre-demonstration embeddings having the highest comparison similarity with the simplified embeddings to be matched, and obtaining a number of demonstration entity pairs that are similar to each pair of the simplified entity pairs to be matched, comprises: Calculate the cosine similarity of each of the simplified embeddings to be matched and all the pre-demonstration embeddings with corresponding similarity relationships, extract the pre-demonstration entity pairs corresponding to the pre-demonstration embeddings with the highest cosine similarity to each of the simplified embeddings to be matched, and obtain several demonstration entity pairs that are similar to each pair of the simplified entity pairs to be matched.
8. An operation control device, characterized in that: It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the entity matching method based on the collaboration of a large language model and a small model as described in any one of claims 1 to 7.
9. An electronic device, characterized in that: Includes the operation control device as described in claim 8.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the entity matching method based on the collaboration of a large language model and a small model as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Auxiliary retrieval method fusing knowledge graph and large language model
CN117633252A
Entity matching method and system based on combination of multiple strategies and multiple large language models
CN118467606A