Entity matching method and device based on large language model and small model cooperation

Through the collaboration between the large language model and the small model, the small model first screens key key-value pairs, and then uses similar entity pairs to prompt the large language model, which solves the problems of insufficient accuracy and efficiency in entity matching in large data sets and achieves efficient and accurate entity matching.

CN119646206BActive Publication Date: 2025-10-17HONG KONG UNIV OF SCI & TECH (GUANGZHOU)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411677099.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-10-17
Estimated Expiration
2044-11-21

AI Technical Summary

Technical Problem

Existing technologies suffer from insufficient accuracy and efficiency in entity matching on large datasets, especially when using deep learning models due to high input scale and time complexity, and graph construction methods are difficult to apply to large-scale datasets.

Method used

Through the collaboration between the large language model and the small model, the small model first filters the key key-value pairs to reduce the input complexity, and then uses the small model to find similar demonstration entity pairs to prompt the large language model to perform entity matching.

Benefits of technology

It improves the accuracy and efficiency of entity matching of large data sets, can process large-scale data sets with limited resources, eliminate noise information, and improve prediction accuracy and generalization ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119646206B_ABST
    Figure CN119646206B_ABST
Patent Text Reader

Abstract

The application discloses an entity matching method and device based on cooperation of a large language model and a small model, and relates to the technical field of entity matching. The method comprises the following steps: acquiring a plurality of pairs of to-be-matched entities, wherein each to-be-matched entity in the pair of to-be-matched entities comprises a plurality of pairs of key-value pairs; inputting each pair of to-be-matched entities into a preset first small model, performing key-value pair screening on each pair of to-be-matched entities based on the first small model, and obtaining a plurality of corresponding pairs of to-be-matched simplified entities; inputting each pair of to-be-matched simplified entities into a preset second small model, performing similar entity retrieval based on the second small model, and obtaining a plurality of pairs of demonstration entities similar to each pair of to-be-matched simplified entities; and inputting each pair of to-be-matched simplified entities and the corresponding pair of demonstration entities into a preset large language model, and obtaining an entity matching result. The application has the effect of improving the accuracy and efficiency of entity matching of a large data set.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of entity matching technology, 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 is becoming increasingly prominent. Entity matching, as one of its core tasks, faces many challenges.

[0003] Among related technologies, DeepMatcher uses various deep learning models as encoders to build an end-to-end entity matching model. This model demonstrates greater robustness on unstructured data, but its accuracy still needs improvement. The open-source Ditto pre-trained model uses extensive expert knowledge and manual annotation methods for data augmentation. It inputs the data as a sequence into BERT (Bidirectional Encoder Representations from Transformers), a deep bidirectional learning model based on the Transformer model architecture. A fully connected layer classifier then analyzes text similarity, improving the accuracy of entity matching across all datasets. However, because this approach concatenates input data into the BERT model, it has high input size and time complexity. HierGAT (Hierarchical Graph Attention Transformation based on HHG) explicitly models the associations between record pairs by constructing a graph structure. In this graph, nodes represent record pairs and edges represent the strength of the association between them. Through the graph attention mechanism, HierGAT effectively captures the structural information in the graph, thereby considering the influence of other related record pairs when making matching decisions. However, this method's reliance on graph construction makes it 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 in 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, comprising:

[0006] 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;

[0007] Input each pair of entities to be matched into a preset first small model, and perform key-value pair screening on each pair of entities to be matched based on the first small model to obtain a number of corresponding simplified entity pairs to be matched;

[0008] inputting each of the pairs of the to-be-matched simplified entity pairs into a preset second small model, performing similar entity retrieval based on the second small model to obtain a plurality of pairs of demonstration entity pairs corresponding to each of the pairs of the to-be-matched simplified entity pairs, a plurality of pairs of candidate demonstration entity pairs being preset in the second small model, the pairs of demonstration entity pairs being used to prompt the large language model;

[0009] inputting each of the pairs of the to-be-matched simplified entity pairs and the corresponding pairs of demonstration entity pairs into a preset large language model to obtain an entity matching result.

[0010] According to the technical scheme of the embodiments of the present application, the to-be-matched entity pair refers to two entities to be matched, each entity including a plurality of pairs of key-value pairs, that is, each entity can be composed of a plurality of pairs of key-value pairs. In actual application, a large-scale data set usually includes a large number of to-be-matched entities, that is, the number of key-value pairs contained in the large-scale data set is very large. Some key-value pairs are important factors for determining whether the entities are matched, while some key-value pairs may be irrelevant noise. In the face of massive data and complex scenarios, direct matching based on complete entities is often inefficient and may introduce noise. Therefore, the first small model is used to select key-value pairs in advance, the lightweight characteristic of the first small model is used to quickly filter non-key value pairs, and the subset of key-value pairs most indicative of entity matching is extracted, thereby significantly reducing the input complexity, reducing the computational burden of the subsequent large language model, improving the processing speed, making the entity matching process more efficient, and being conducive to processing large-scale data sets under limited resources. At the same time, by identifying and retaining the key-value pairs that contribute most to the matching decision, the noise information of the input entity pair is eliminated, the model is more focused on key information, the prediction accuracy and generalization ability are improved, especially in scenarios where data quality is uneven or there is a large amount of irrelevant information. Then, the second small model is used to find a pair of demonstration entity pairs corresponding to the to-be-matched simplified entity pair. The pair of demonstration entity pairs is used to prompt the large language model, that is, the pair of demonstration entity pairs combined with the to-be-matched simplified entity pair can provide a correct entity matching example, so as to effectively inspire the large language model, help the large language model more accurately understand the entity matching task, and thus obtain the expected result, improving the accuracy of entity matching of large data sets.

[0011] According to some embodiments of the present application, the inputting each of the pairs of the to-be-matched entity pairs into a preset first small model, performing key-value pair screening on each of the pairs of the to-be-matched entity pairs based on the first small model to obtain a plurality of corresponding pairs of to-be-matched simplified entity pairs, includes:

[0012] input each pair of the to-be-matched entity pairs into a preset first small model, perform key-value pair enumeration on each to-be-matched entity in each pair of the to-be-matched entity pairs based on the first small model, and obtain a plurality of to-be-screened key-value pair subsets corresponding to each to-be-matched entity;

[0013] screen the plurality of to-be-screened key-value pair subsets of each to-be-matched entity, and obtain a simplified key-value pair corresponding to each to-be-matched entity;

[0014] based on the simplified key-value pair corresponding to each to-be-matched entity, obtain a plurality of to-be-matched simplified entity pairs.

[0015] According to some embodiments of the present application, the first small model is trained and optimized in the following manner:

[0016] obtain different preset entities from two different preset databases respectively, and obtain a preset entity pair;

[0017] perform key-value pair screening on each preset entity in the preset entity pair, and obtain a simplified entity pair corresponding to the preset entity pair;

[0018] encode the preset entity pair to obtain a first embedding, and encode the simplified entity pair to obtain a second embedding;

[0019] 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;

[0020] based on the first matching probability and the second matching probability, calculate a loss value of the first small model;

[0021] combine the loss value of the first small model, and optimize the first small model through a preset deep learning optimization algorithm.

[0022] According to some embodiments of the present application, the second matching probability between the two simplified entities is calculated according to the second embedding, comprising:

[0023] based on the simplified entity pair, perform numerical feature encoding to obtain a second feature vector;

[0024] aggregate the first embedding, the second embedding, and the second feature vector to obtain model comprehensive representation information;

[0025] based on the model comprehensive representation information, calculate a second matching probability between the two simplified entities.

[0026] According to some embodiments of the present application, the inputting each pair of the to-be-matched simplified entity pair into a preset second small model, performing similar entity retrieval based on the second small model, and obtaining a plurality of pairs of demonstration entity pairs corresponding to each pair of the to-be-matched simplified entity pair comprises:

[0027] The inputting each pair of the to-be-matched simplified entity pair into a preset second small model, performing pre-retrieval based on the second small model, and obtaining a plurality of pairs of pre-demonstration entity pairs, wherein one pair of the to-be-matched simplified entity pair corresponds to a plurality of pairs of the pre-demonstration entity pairs;

[0028] The encoding all the to-be-matched simplified entity pairs to obtain a plurality of to-be-matched simplified embeddings, and encoding all the pre-demonstration entity pairs to obtain a plurality of pre-demonstration embeddings, wherein one to-be-matched simplified embedding has a corresponding similar relationship with a plurality of pre-demonstration embeddings, and each to-be-matched simplified embedding has a plurality of pre-demonstration embeddings having a corresponding similar relationship;

[0029] The comparing each to-be-matched simplified embedding with all the pre-demonstration embeddings having a corresponding similar relationship, extracting the pre-demonstration entity pair corresponding to the pre-demonstration embedding having the highest similarity with the to-be-matched simplified embedding, and obtaining a plurality of pairs of demonstration entity pairs corresponding to each pair of the to-be-matched simplified entity pair.

[0030] According to some embodiments of the present application, the encoding all the to-be-matched simplified entity pairs to obtain a plurality of to-be-matched simplified embeddings, and encoding all the pre-demonstration entity pairs to obtain a plurality of pre-demonstration embeddings comprises:

[0031] The first-layer text encoding all the to-be-matched simplified entity pairs to obtain a plurality of first to-be-matched simplified embeddings, and the first-layer text encoding all the pre-demonstration entity pairs to obtain a plurality of first pre-demonstration embeddings;

[0032] The second-layer text encoding all the first to-be-matched simplified embeddings to obtain a plurality of to-be-matched simplified embeddings, and the second-layer text encoding all the first pre-demonstration embeddings to obtain a plurality of pre-demonstration embeddings.

[0033] According to some embodiments of the present application, the comparing each to-be-matched simplified embedding with all the pre-demonstration embeddings having a corresponding similar relationship, extracting the pre-demonstration entity pair corresponding to the pre-demonstration embedding having the highest similarity with the to-be-matched simplified embedding, and obtaining a plurality of pairs of demonstration entity pairs corresponding to each pair of the to-be-matched simplified entity pair comprises:

[0034] Calculate the cosine similarity of each of the to-be-matched simplified embeddings with all the pre-demonstration embeddings having a corresponding similar relationship respectively, extract the pre-demonstration entity pair corresponding to the pre-demonstration embedding with the highest cosine similarity with each of the to-be-matched simplified embeddings, and obtain several demonstration entity pairs similar to each of the to-be-matched simplified entity pairs.

[0035] In a second aspect, an embodiment of the present application provides a running control device, characterized by comprising 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 cooperation of a large language model and a small model in the first aspect.

[0036] In a third aspect, an embodiment of the present application provides an electronic device comprising the running control device in the second aspect.

[0037] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium storing computer executable instructions for causing a computer to execute the entity matching method based on cooperation of a large language model and a small model in the first aspect.

[0038] Other features and advantages of the present application will be set forth in the following description, and in part will become apparent from the description, or can be learned by practice of the present application. The objects and other advantages of the present application will be realized and achieved by means of the structures particularly pointed out in the description and claims. BRIEF DESCRIPTION OF DRAWINGS

[0039] The accompanying drawings are included to provide a further understanding of the technical scheme of the present application, and constitute a part of the specification, and are used together with the embodiments of the present application to explain the technical scheme of the present application, and do not constitute a limitation on the technical scheme of the present application.

[0040] The present application will be further described below in combination with the drawings and embodiments;

[0041] Figure 1 is a flowchart of the entity matching method based on cooperation of a large language model and a small model provided by an embodiment of the present application;

[0042] Figure 2 is a flowchart of the entity matching method based on cooperation of a large language model and a small model provided by another embodiment of the present application;

[0043] Figure 3 is a flowchart of the entity matching method based on cooperation of a large language model and a small model provided by another embodiment of the present application;

[0044] Figure 4is a flowchart of an entity matching method based on cooperation of a large language model and a small model provided by another embodiment of the present application;

[0045] Figure 5 is a flowchart of an entity matching method based on cooperation of a large language model and a small model provided by another embodiment of the present application;

[0046] Figure 6 is a flowchart of an entity matching method based on cooperation of a large language model and a small model provided by another embodiment of the present application;

[0047] Figure 7 is a flowchart of an entity matching method based on cooperation of a large language model and a small model provided by another embodiment of the present application;

[0048] Figure 8 is a schematic diagram of a running control device for executing an entity matching method based on cooperation of a large language model and a small model provided by an embodiment of the present application. DETAILED DESCRIPTION

[0049] This part will describe the specific embodiments of the present application in detail, and the preferred embodiments of the present application are shown in the drawings, and the drawings are used to supplement the description of the text part, so that people can intuitively and visually understand each technical feature and the overall technical scheme of the present application, but it cannot be understood as a limitation on the protection scope of the present application.

[0050] In the description of the present application, it should be understood that the orientation description, such as the orientation or position relationship indicated by up, down, front, back, left, right, etc. is based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present application and simplifying the description, and does not indicate or imply that the device or element indicated must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present application.

[0051] In the description of the present application, the meaning of several is one or more, the meaning of multiple is more than two, greater than, less than, more than, etc. are not included in the number, and the above, below, etc. are understood to include the number. If it is described as first, second, it is only used for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features or the sequence of indicated technical features

[0052] In the description of the present application, unless otherwise explicitly limited, the words such as setting, installing, connecting, etc. should be broadly understood, and the person skilled in the art can reasonably determine the specific meaning of the above words in the present application in combination with the specific content of the technical scheme.

[0053] The following will be described in combination with the drawings Figures 1-7Further elaboration is made on each embodiment of the entity matching method based on large language model and small model cooperation of the present application.

[0054] As shown in Figure 1 , Figure 1 is a flowchart of the entity matching method based on large language model and small model cooperation provided by an embodiment of the present application. The entity matching method based on large language model and small model cooperation can include but is not limited to step S110, step S120, step S130 and step S140.

[0055] Step S110, obtaining a plurality of pairs of entities to be matched, wherein each entity to be matched in the pair of entities to be matched includes a plurality of pairs of key-value pairs;

[0056] Step S120, inputting each pair of entities to be matched into a preset first small model, performing key-value pair screening on each pair of entities to be matched based on the first small model, and obtaining a plurality of corresponding pairs of simplified entities to be matched;

[0057] Step S130, inputting each pair of 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 similar pairs of demonstration entities corresponding to each pair of simplified entities to be matched, wherein a plurality of pairs of candidate demonstration entities are preset in the second small model, and the pairs of demonstration entities are used to prompt the large language model;

[0058] Step S140, inputting each pair of simplified entities to be matched and the corresponding pairs of demonstration entities into a preset large language model, and obtaining an entity matching result.

[0059] In this embodiment, each entity includes a plurality of pairs of key-value pairs, i.e., each entity can be composed of a plurality of pairs of key-value pairs, for example,

[0060] Entity 1 includes:

[0061] Beer Name: Arrow Point Amber;

[0062] Factory Name: Bainbridge Island Brewing Company;

[0063] Style: Amber Ale;

[0064] Entity 2 includes:

[0065] Beer Name: Bainbridge Island Arrow Point Amber;

[0066] Factory Name: Bainbridge Island Brewing Company;

[0067] Style: Amber Ale;

[0068] It can be understood that, when the large language model performs the entity matching task based on entity 1 and entity 2, the output result is not matched, because the values corresponding to the same key (Beer Name) in entity 1 and entity 2 are different.

[0069] It can be understood by those skilled in the art that, due to the massive data training background, the large language model can capture the subtle differences and complex structures of language, thereby learning deeper semantic features and patterns in rich contexts. At the same time, because the large language model is trained on a large amount of corpus, it has a large amount of external knowledge that cannot be learned from the training set, which can provide professional guidance for entity matching and strong support for accurate matching between entities. The small model can quickly input results due to its lightweight characteristics, thereby improving the efficiency of the work.

[0070] It can be understood that the entity matching method based on the cooperation of the large language model and the small model can perform entity matching on a pair of to-be-matched entity pairs, or simultaneously perform entity matching on multiple pairs of to-be-matched entity pairs. Those skilled in the art can understand the process of performing entity matching on a pair and simultaneously performing entity matching on multiple pairs of to-be-matched entity pairs without any doubt in combination with the specific content of the technical solution.

[0071] Specifically, a plurality of to-be-matched entity pairs are obtained, the to-be-matched entity pair refers to two entities to be matched, each to-be-matched entity pair is input into a preset first small model, the first small model is used to screen key-value pairs in the two entities to be matched, and then an entity including key-value pairs most indicative of entity matching is obtained. The first small model can be a model trained based on a rule for entity matching of a large language model, or a model trained based on characteristics between different entities. Training based on a rule for entity matching of a large language model can be to identify and extract standard format fields in entities through a regular expression to obtain possible matching key-value pairs in the two entities. Training based on 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.

[0072] Therefore, when screening key-value pairs of each to-be-matched entity pair based on the first small model, the first small model can screen each to-be-matched entity in each to-be-matched entity pair respectively, and the to-be-matched entities are combined into the entity pair corresponding to the to-be-matched entity before screening after each to-be-matched entity is screened, so as to obtain a plurality of corresponding screened to-be-matched entity pairs, that is, to-be-matched simplified entity pairs.

[0073] 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 key-value pairs that contribute to the subsequent large language model. The key-value pairs in the to-be-matched entity pair may all contribute to the entity matching decision of the large language model. Therefore, the to-be-matched simplified entity pair screened based on the first large model may be the same as the key-value pairs in the to-be-matched entity pair, but more likely, the number of key-value pairs in the to-be-matched simplified entity pair screened based on the first large model is less than the number of key-value pairs in the to-be-matched entity pair.

[0074] In addition, when the subsequent large language model performs entity matching, the entity pair input used is the screened entity pair input rather than the original to-be-matched entity pair. Therefore, it is necessary to ensure that the actual meaning of the to-be-matched simplified entity pair used is not different from the meaning of the original to-be-matched entity pair. When the first small model is trained, the first small model can be put into use after it is determined that the screening accuracy of the first small model meets the standard.

[0075] After the key-value pair screening is completed, each to-be-matched simplified entity pair is input into a preset second small model, the second small model is used to retrieve a demonstration entity pair similar to the to-be-matched simplified entity pair from a preset demonstration entity database. The demonstration entity pair similar to the to-be-matched simplified entity pair can be a demonstration entity pair with the closest entity semantics, or a demonstration entity pair with the most similar entity content.

[0076] The preset demonstration entity database stores a large number of candidate demonstration entity pairs matched by humans, which are classified and annotated by humans to facilitate quick retrieval of similar demonstration entity pairs from the demonstration entity database. The demonstration entity pairs refer to those pairs of entities in the preset demonstration entity database that have been accurately classified or annotated, serving as a bridge for understanding and matching entities. The combination of demonstration entity pairs and the to-be-matched simplified entity pairs can enable the large language model to better understand and perform entity matching tasks through task instances.

[0077] Therefore, the second small model is used for similar entity retrieval. The second small model can be used for retrieval for each pair of to-be-matched simplified entity pairs respectively, thereby obtaining a number of demonstration entity pairs equal to the number of to-be-matched simplified entity pairs, each pair of to-be-matched simplified entity pairs having a corresponding similar pair of demonstration entity pairs.

[0078] It can be understood that when the second small model performs similar entity retrieval, it can first analyze the input to-be-matched simplified entity pairs and extract key information such as names, attributes, and categories of the to-be-matched simplified entity pairs. Then, features are extracted according to the parsed key information. These features can be textual, numerical, or structured, for example, using bag-of-words, TF-IDF, Word Embedding, and other techniques. Subsequently, the second small model matches the extracted features with the features of the candidate demonstration entity pairs stored in the demonstration entity database. The following matching methods can be used:

[0079] a. Similarity calculation: Calculate the similarity of the features of the input to-be-matched simplified entity pairs and the features of the candidate demonstration entity pairs in the database. Algorithms that can be used include cosine similarity, Jaccard similarity, edit distance, and the like;

[0080] b. Vector search: If the to-be-matched simplified entity pairs are represented as high-dimensional vectors (for example, features extracted using deep learning models), vector search algorithms (such as nearest neighbor search, local sensitive hashing LSH, and the like) can be used to find similar candidate demonstration entity pairs;

[0081] Finally, the second small model extracts the most similar candidate demonstration entity pairs for each pair of to-be-matched simplified entity pairs, obtaining the corresponding candidate demonstration entity pairs.

[0082] After obtaining the demonstration entity pair, input each pair of to-be-matched simplified entity pair and the corresponding demonstration entity pair into a preset large language model. The large language model can be input into the large language model after being converted into a specific format according to the input format of the large language model, for example, a text pair form in a specific format. Then, the large language model performs an entity matching task, and determines whether the two entities of the to-be-matched simplified entity pair can be matched according to the output result of the large language model, to obtain an entity matching result. Before the large language model performs the entity matching task, the large language model first learns the association between the two entities of the demonstration entity pair. The demonstration entity pair is provided to the large language model as a correct entity matching example, that is, the demonstration entity pair is specially marked when inputting 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, the large language model performs entity matching on the to-be-matched simplified entity pair, and thus outputs a result about the matching degree between the to-be-matched simplified entity pair.

[0083] It can be understood that, in the embodiment, the entity matching method based on the cooperation of the large language model and the 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 cooperation of the large language model and the small model can be applied to entity matching, data integration and other scenarios. For example, in the experimental results, the entity matching method based on the cooperation of the large language model and the small model achieves good performance on multiple entity matching big data sets, such as achieving an F1 index of 93.81 on Walmart-Amazon.

[0084] As shown in Figure 2 , the flowchart of the entity matching method based on the cooperation of the large language model and the small model provided by another embodiment of the present application is shown in Figure 2 . Regarding the above step S120, it can include but is not limited to step S220, step S320 and step S420.

[0085] Step S220, input each pair of to-be-matched entity pair into a preset first small model, and perform key-value pair enumeration on each to-be-matched entity in each pair of 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.

[0086] Step S320, screen 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.

[0087] Step S420, based on the simplified key-value pair corresponding to each to-be-matched entity, obtain a plurality of to-be-matched simplified entity pairs.

[0088] 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.

[0089] After obtaining multiple subsets of key-value pairs to be filtered corresponding to each entity to be matched, key-value pairs are filtered based on the first small model, that is, the subset of key-value pairs that are most indicative of entity matching is filtered out. For example, an entity matching score is performed on each subset of key-value pairs to be filtered, and the adaptability of each subset of key-value pairs to be filtered for entity matching is judged; then, based on the score of each subset of key-value pairs to be filtered, the subset of key-value pairs with the highest score, that is, the subset of key-value pairs that are most indicative of entity matching is filtered 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 entity is 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 a simplified entity corresponding to each entity to be matched, and a simplified entity pair to be matched corresponding to each pair of entities to be matched.

[0090] like Figure 3 As shown, Figure 3 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; 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.

[0091] Step S150: Obtain different preset entities from two different preset databases to obtain a preset entity pair;

[0092] Step S160: Filter the key-value pairs of each preset entity in the preset entity pair to obtain a simplified entity pair corresponding to the preset entity pair;

[0093] Step S170, encoding the preset entity pair to obtain a first embedding, and encoding the simplified entity pair to obtain a second embedding;

[0094] Step S180, calculating a first matching probability between the two preset entities according to the first embedding, and calculating a second matching probability between the two simplified entities according to the second embedding;

[0095] Step S190, calculating a loss value of the first small model based on the first matching probability and the second matching probability;

[0096] Step S1100, combining the loss value of the first small model, and optimizing the first small model through a preset deep learning optimization algorithm.

[0097] It can be understood that the first small model is used to screen the key-value pair in each of the to-be-matched entities in each to-be-matched entity pair, and therefore, the first small model needs to be trained to improve the screening accuracy of the first small model.

[0098] It can be understood that the two different databases respectively prestore a large number of different entities, and the entities pre-stored in the two different databases can be completely different, that is, there is no entity in one database that is completely the same as the entity in the other database, and each entity in one database is different from each entity in the other database, and therefore, different preset entities are obtained from the two different preset databases respectively, and a preset entity pair is obtained, that is, one preset entity is obtained from each of the two databases, so as to obtain the preset entity pair composed of the two preset entities.

[0099] It can be understood that in order to train the first small model on the accuracy of key-value pair screening, after obtaining the preset entity pair, the first small model is used to screen the key-value pair in each preset entity in the preset entity pair, and a simplified entity pair corresponding to the preset entity pair is obtained.

[0100] After obtaining the preset entity pair and the simplified entity pair, the two preset entities in the preset entity pair can be denoted as and and the two simplified entities in the simplified entity pair after the key-value pair screening processing can be denoted as and At this time, the preset entities and carry all the information required for entity matching, and although the simplified entities and The key-value pair information is reserved, but many key-value pairs in the preset entity and the simplified entity may still be included, 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 of the preset entity and the simplified entity, the preset entity pair is encoded to obtain a first embedding, and the simplified entity pair is encoded to obtain a second embedding;

[0101] The preset entity pair and the simplified entity pair can be encoded by different encoders, which 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 excellent text encoding model, and based on its excellent performance in the field of natural language processing, especially its strong ability to understand complex context and long-distance dependency, the pre-trained language model RoBERTa can be used as the encoder of the first small model to better extract the semantic information of the entity pair text. For the encoding of the preset entity, RoBERTa can effectively abstract the deep semantic relationship 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 role. Such vectorization provides a powerful tool for the first small model to evaluate the matching potential of two complete entities at a higher abstraction level.

[0102] Therefore, the pre-trained language model RoBERTa is used to encode the preset entity pair to obtain the first embedding reflecting the text semantics of the preset entity pair ,

[0103]

[0104] The pre-trained language model RoBERTa is used to encode the simplified entity pair to obtain the second embedding reflecting the text semantics of the simplified entity pair .

[0105]

[0106] It should be noted that the encoder for encoding the preset entity pair and the encoder for encoding the simplified entity pair can be the same, or different encoders can be used to encode the preset entity pair and the simplified entity pair, 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 pair, and the second pre-trained language model RoBERTa is used to encode the simplified entity pair. The strategy of separating the encoding ensures the differentiated processing of the key-value pair information and the matching information, so that the first small model can consider the global matching of the entity and the local key-value pair correlation in parallel, which complement each other and jointly promote the accuracy of the final matching decision.

[0107] In order to realize the training optimization of the first small model, the accuracy of the simplified entity 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.

[0108] It can be understood that the calculation of the first matching probability and the second matching probability can be realized by using a plurality of different matching probability calculation tools. In the embodiment, a multilayer perceptron (MLP) structure can be used to realize it, which is a kind of feedforward artificial neural network, composed of at least three layers of nodes: input layer, one or more hidden layers and output layer, and 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 is used to perform deep key-value pair conversion and integration on the previously obtained first embedding and second embedding to calculate the first matching probability between the two preset entities and the second matching probability between the two simplified entities, so as to extract the core matching information in the embedding and map it to a probability space,

[0109]

[0110]

[0111] It can be understood that 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.

[0112] After obtaining the first matching probability and the second matching probability, in order to optimize the first small model using the first matching probability and the second matching probability, a 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 to optimize the first small model using a preset deep learning optimization algorithm. In this embodiment, a first loss based on the first matching probability and a second loss based on the second matching probability can be calculated using 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 using the loss value of the first small model and the deep learning optimization algorithm Adam (Adaptive Moment Estimation).

[0113] 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 obtaining different preset entities from two different preset databases multiple times and performing training and optimization based on different preset entity pairs, the performance of the first small model can be greatly improved.

[0114] like Figure 4 As shown, Figure 4 This 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.

[0115] Step S280: Perform numerical feature encoding based on the simplified entity pair to obtain a second feature vector;

[0116] Step S380: Aggregate the first embedding, the second embedding, and the second eigenvector to obtain comprehensive model representation information;

[0117] Step S480: Calculate a second matching probability between the two simplified entities based on the model comprehensive representation information.

[0118] Specifically, in order to comprehensively utilize the complete matching information of the preset entity and the key-value pair information of the simplified entity, more information can be combined for calculation when calculating the second matching probability between two simplified entities, therefore, first, numerical feature encoding is performed based on the simplified entity pair to obtain a second feature vector This second feature vector can represent the key-value pair information of the simplified entity pair with more comprehensive information;

[0119] The first embedding , the second embedding , the second feature vector are aggregated to construct a model comprehensive representation information rich in multi-dimensional information This aggregation process not only integrates the relevant clues of the preset entity pair and the simplified entity pair, but also incorporates the key-value pair description of the simplified entity itself and its key-value pair screening information, forming a comprehensive and high-dimensional key-value pair representation space;

[0120] Subsequently, the model comprehensive representation information is input into a multi-layer perceptron, and the multi-layer perceptron infers the probability that the first small model predicts correctly for the current instance , that is, the second matching probability between the two simplified entities.

[0121]

[0122] As shown in Figure 5 , the flowchart of the entity matching method based on the cooperation of the large language model and the small model provided by another embodiment of the present application is shown in Figure 5 . Regarding step S130, it can include but is not limited to step S230, step S330 and step S430.

[0123] Step S230, input each pair of to-be-matched simplified entity pairs into a preset second small model, perform pre-retrieval based on the second small model, and obtain a plurality of pairs of pre-demonstration entity pairs, wherein one pair of to-be-matched simplified entity pairs corresponds to a plurality of pairs of pre-demonstration entity pairs.

[0124] Step S330, encode all to-be-matched simplified entity pairs to obtain a plurality of to-be-matched simplified embeddings, and encode all pre-demonstration entity pairs to obtain a plurality of pre-demonstration embeddings, wherein one to-be-matched simplified embedding has a corresponding similar relationship with a plurality of pre-demonstration embeddings, and each to-be-matched simplified embedding has a plurality of pre-demonstration embeddings with a corresponding similar relationship.

[0125] Step S430, compare each to-be-matched simplified embedding with all pre-demonstration embeddings having corresponding similar relationships respectively, extract the pre-demonstration entity pair corresponding to the pre-demonstration embedding with the highest similarity in the comparison of the to-be-matched simplified embedding, and obtain a plurality of demonstration entity pairs similar to each to-be-matched simplified entity pair.

[0126] It can be understood that the second small model is used to find a demonstration entity pair similar to the to-be-matched simplified entity pair, so as to provide a correct entity matching example, which can effectively guide the large language model and help the large language model to more accurately understand the entity matching task.

[0127] Therefore, each pair of to-be-matched simplified entity pairs is input into the preset second small model, the demonstration entity pair database is preset in the second small model, a plurality of pairs of candidate demonstration entity pairs are pre-stored in the demonstration entity pair database, and the task of the second small model is to find the demonstration entity pair most similar to each pair of to-be-matched simplified entity pairs 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 long retrieval 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 pair of to-be-matched simplified entity pairs in the demonstration entity pair database, thereby obtaining a plurality of pairs of pre-demonstration entity pairs having a certain similarity with the to-be-matched simplified entity pairs.

[0128] It should be noted that each pair of to-be-matched simplified entity pairs has a plurality of pairs of pre-demonstration entity pairs corresponding thereto, that is, one pair of to-be-matched simplified entity pairs is similar to a plurality of pairs of pre-demonstration entity pairs. In addition, the to-be-matched simplified entity has been screened by key-value pairs, and the candidate demonstration entity pairs in the demonstration entity pair database are also screened by key-value pairs.

[0129] It can be understood that, in the entity matching task, simple matching based on vocabulary or surface key-value pairs is often insufficient to capture subtle semantic differences between entities, especially in complex text environments. Therefore, after obtaining the pre-demonstration entity pairs, all to-be-matched simplified entity pairs are encoded respectively to obtain a plurality of to-be-matched simplified embeddings, and all pre-demonstration entity pairs are encoded respectively to obtain a plurality of pre-demonstration embeddings. In this way, the context meaning of the entity is deeply mined, and the matching process is not only based on the consistency of the entity name, but also considers the usage mode and implicit information in the specific context. In this embodiment, the pre-trained language model RoBERTa can be used for encoding.

[0130] It can be foreseen that if a pair of simplified entities to be matched has corresponding similarities with multiple pairs of pre-demonstration entity pairs, then one simplified embedding to be matched has corresponding similarities with multiple pre-demonstration embeddings. If 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 similarities.

[0131] 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, thereby comparing each simplified embedding to be matched with multiple pre-demonstration embeddings having corresponding similarity relationships, and obtaining the comparison similarity between each simplified embedding to be matched and multiple pre-demonstration embeddings having corresponding similarity relationships;

[0132] Then, based on the comparative 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 comparative 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 comparative similarity to each simplified embedding to be matched, that is, several demonstration entity pairs that are similar to each pair of simplified entities to be matched.

[0133] 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.

[0134] 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.

[0135] like Figure 6 As shown, Figure 6 This 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.

[0136] Step S530: Perform first-layer text encoding on all pairs of simplified entities to be matched to obtain a plurality of first simplified embeddings to be matched, and perform first-layer text encoding on all pairs of pre-demonstration entities to obtain a plurality of first pre-demonstration embeddings;

[0137] 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.

[0138] Specifically, in order to be able to dig deeper into the meaning of the entity, the second encoding can be performed on the to-be-matched simplified entity pair and the pre-demonstration entity pair. After the first layer of text encoding is performed on all to-be-matched simplified entity pairs and all pre-demonstration entity pairs, a plurality of first to-be-matched simplified embeddings and a plurality of first pre-demonstration embeddings are 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 entity pair can be represented as and The first to-be-matched simplified embedding can be represented as The first pre-demonstration embedding can be represented as ;

[0139] After the first layer of encoding is completed, the second layer of text encoding can be performed on all first to-be-matched simplified embeddings and all first pre-demonstration embeddings. The multilayer perceptron can be used to project all first to-be-matched simplified embeddings and all first pre-demonstration embeddings to a high-dimensional semantic space, further dig into the high-dimensional semantic information of the entity pair, and extract more refined entity embedding representations, so as to obtain a plurality of to-be-matched simplified embeddings and a plurality of pre-demonstration embeddings. The to-be-matched simplified embedding can be represented as The pre-demonstration embedding can be represented as .

[0140]

[0141]

[0142] Based on this, in the second small model, one or two pre-trained language models RoBERTa, multilayer perceptrons and embedding comparators can be included. The pre-trained language models RoBERTa and the multilayer perceptrons in the second small model are different from the pre-trained language models RoBERTa and the multilayer perceptrons in the first small model.

[0143] As shown in Figure 7 , the flowchart of the entity matching method based on the cooperation of the large language model and the small model provided by another embodiment of the present application is shown in Figure 7 Step S430 can include but is not limited to step S730.

[0144] Step S730, respectively calculating the cosine similarity of each to-be-matched simplified embedding and all pre-demonstration embeddings with corresponding similar relationships, extracting the pre-demonstration entity pair corresponding to the pre-demonstration embedding with the highest cosine similarity of each to-be-matched simplified embedding, and obtaining a plurality of demonstration entity pairs corresponding to each to-be-matched simplified entity pair.

[0145] After obtaining the to-be-matched simplified embedding and the pre-demonstration embedding, cosine similarity can be used as a measure, which is a method widely used in high-dimensional space to measure the similarity of vectors, which can effectively exclude the influence of vector length and focus on the similarity in direction. By calculating the cosine similarity, the entity with the closest semantics can be accurately identified, thereby providing highly relevant example references. Therefore, in this embodiment, the similarity comparison between the to-be-matched simplified embedding and the pre-demonstration embedding is performed by using the cosine similarity comparison method. Specifically, the cosine similarity between each to-be-matched simplified embedding and all pre-demonstration embeddings having a corresponding similar relationship is calculated ,

[0146]

[0147] In this way, after obtaining the cosine similarity between each to-be-matched simplified embedding and all pre-demonstration embeddings having a corresponding similar relationship, the pre-demonstration entity pair corresponding to the pre-demonstration embedding with the highest cosine similarity of each to-be-matched simplified embedding is extracted, and a plurality of demonstration entity pairs similar to each pair of to-be-matched simplified entity pairs are obtained, that is, each pair of to-be-matched simplified entity pairs has a corresponding pair of demonstration entity pairs, and each pair of to-be-matched simplified entity pairs has a corresponding pair of demonstration entity pairs.

[0148] Based on the above various embodiments of the entity matching method based on the cooperation of the large language model and the small model, the following respectively proposes various embodiments of the running control device, the electronic equipment, the computer readable storage medium and the computer program product of the present application.

[0149] As shown in Figure 8 , Figure 8 is a schematic diagram of a running control device for executing the entity matching method based on the cooperation of the large language model and the small model provided by an embodiment of the present application. The running control device 800 implemented by 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 which one processor 820 and one memory 810 are taken as an example.

[0150] The processor 820 and the memory 810 can be connected by a bus or other means, Figure 8 in which a bus connection is taken as an example.

[0151] 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 can include a high-speed random access memory, and can also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state memory device. In some embodiments, the memory 810 can optionally include a memory 810 disposed remotely with respect to the processor 820, which can be connected to the operation control device 800 through 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 a combination thereof.

[0152] Those skilled in the art can understand that, Figure 8 The device structure shown in the above-mentioned embodiments does not constitute a limitation on the operation control device 800, and can include more or fewer components than those shown, or combine certain components, or different component arrangements.

[0153] In Figure 8 In the operation control device 800 shown in the above-mentioned embodiments, 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 cooperation of the large language model and the small model. Specifically, the non-transitory software programs and instructions required for implementing the above-mentioned embodiment of the entity matching method based on the cooperation of the large language model and the small model are stored in the memory 810, and when executed by the processor 820, the entity matching method based on the cooperation of the large language model and the small model of the above-mentioned embodiment is executed.

[0154] It is worth noting that since the operation control device 800 of the embodiments of the present application can execute the entity matching method based on the cooperation of the large language model and the small model of any of the above-mentioned embodiments, the specific implementation and technical effects of the operation control device 800 of the embodiments of the present application can refer to the specific implementation and technical effects of the entity matching method based on the cooperation of the large language model and the small model of any of the above-mentioned embodiments.

[0155] In addition, one embodiment of the present application also provides an electronic device, which includes the operation control device of the above-mentioned embodiments.

[0156] It is worth noting that since the electronic device of the embodiments of the present application includes the operation control device of the above-mentioned embodiments, and the operation control device of the above-mentioned embodiments can execute the entity matching method based on the cooperation of the large language model and the small model of any of the above-mentioned embodiments, the specific implementation and technical effects of the electronic device of the embodiments of the present application can refer to the specific implementation and technical effects of the entity matching method based on the cooperation of the large language model and the small model of any of the above-mentioned embodiments.

[0157] Further, an embodiment of the present application also provides a computer readable storage medium, which stores computer executable instructions for performing the entity matching method based on cooperation of a large language model and a small model described above. Illustratively, the method steps in the above description are performed. Figures 1 to 7

[0158] It is worth noting that since the computer readable storage medium of the embodiment of the present application can perform the entity matching method based on cooperation of a large language model and a small model of any of the above embodiments, the specific implementation and technical effects of the computer readable storage medium of the embodiment of the present application can refer to the specific implementation and technical effects of the entity matching method based on cooperation of a large language model and a small model of any of the above embodiments.

[0159] Further, an embodiment of the present application also provides a computer program product, which includes a computer program or computer instructions stored in a computer readable storage medium, and 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 performs the entity matching method based on cooperation of a large language model and a small model described above. Illustratively, the method steps in the above description are performed. Figures 1 to 7

[0160] It is worth noting that since the computer program product of the embodiment of the present application can perform the entity matching method based on cooperation of a large language model and a small model of any of the above embodiments, the specific implementation and technical effects of the computer program product of the embodiment of the present application can refer to the specific implementation and technical effects of the entity matching method based on cooperation of a large language model and a small model of any of the above embodiments.

[0161] ​​Those of ordinary skill in the art will appreciate that all or some steps, systems of the above-disclosed methods can be implemented as software, firmware, hardware, or any suitable combination thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on computer readable media, which can comprise computer storage media or non-transitory media and communication media or transitory media. As is well known to those of ordinary skill in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of 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 technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer. Further, as is well known to those of ordinary skill in the art, 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 includes any information delivery media.

[0162] In several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method can be implemented in other manners. For example, the apparatus embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There can be another division manner for the actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, apparatuses or units, and can be in electrical, mechanical or other forms.

[0163] It should also be understood that the various embodiments provided in the present application can be combined arbitrarily to achieve different technical effects.

[0164] The embodiments of the present application are described in detail above with reference to the accompanying drawings, but the present application is not limited to the above embodiments, and various changes can be made within the knowledge of those skilled in the art without departing from the spirit 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 entities to be matched into a preset first small model, and perform key-value pair screening on each pair of entities to be matched based on the first small model to obtain a number of corresponding simplified entity pairs to be matched; 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 is preset with multiple pairs of candidate demonstration entity pairs, and the demonstration entity pairs are used to prompt the large language model; Inputting each pair of the to-be-matched simplified entity pairs and the corresponding demonstration entity pairs into a preset large language model to obtain entity matching results; The step of inputting each pair of entities to be matched into a preset first small model, and performing key-value pair screening on each pair of entities to be matched based on the first small model to obtain a number of corresponding simplified entity pairs to be matched 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 subsets of key-value pairs to be screened corresponding to each entity to be matched; Filtering the plurality of to-be-filtered 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; 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 comprises: Inputting each pair of the to-be-matched simplified entity pairs into a preset second small model, performing a pre-search based on the second small model, and obtaining a plurality of pairs of pre-demonstration entity pairs, wherein a pair of the to-be-matched simplified entity pairs corresponds similarly to the plurality of pairs of the pre-demonstration entity pairs; Encoding all of the to-be-matched simplified entity pairs to obtain a plurality of to-be-matched simplified embeddings, and encoding all of the pre-demonstration entity pairs to obtain a plurality of pre-demonstration embeddings, wherein one to-be-matched simplified embedding has a corresponding similarity relationship with a plurality of the pre-demonstration embeddings, and each to-be-matched simplified embedding has a plurality of the pre-demonstration embeddings having 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 with the highest similarity to the simplified embeddings to be matched are extracted, and several demonstration entity pairs similar to each pair of the simplified entities to be matched are obtained.

2. The entity matching method based on collaboration between 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 to obtain preset entity pairs; Performing key-value pair screening on each of the preset entities in the preset entity pairs 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; Calculating a first matching probability between the two preset entities according to the first embedding, and calculating 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 through a preset deep learning optimization algorithm.

3. The entity matching method based on collaboration between a large language model and a small model according to claim 2, characterized in that: 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.

4. The entity matching method based on collaboration between a large language model and a small model according to claim 1, characterized in that: The encoding of all the simplified entity pairs to be matched to obtain a plurality of simplified embeddings to be matched, and encoding of 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; Performing second-layer text encoding on all the first simplified embeddings to be matched to obtain a number of simplified embeddings to be matched, and performing second-layer text encoding on all the first pre-demonstration embeddings to obtain a plurality of pre-demonstration embeddings.

5. The entity matching method based on collaboration between a large language model and a small model according to claim 1, 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 pair corresponding to the pre-demonstration embedding having the highest comparison similarity with the simplified embedding to be matched, and obtaining a number of demonstration entity pairs corresponding to each pair of the simplified entity pairs to be matched includes: Calculate the cosine similarity between 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.

6. An operation control device, characterized in that: The method comprises 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 5.

7. An electronic device, characterized in that: Includes the operation control device according to claim 6.

8. 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 5.

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