Semantic matching model construction method and data matching processing method and device

Through semantic coding and multi-core feature fusion processing, the problems of excessive resource consumption and inefficiency in traditional technologies are solved, and efficient semantic matching model construction and processing are achieved.

CN119066437APending Publication Date: 2024-12-03TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310626619.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-30
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

When building a "demand-result" matching mechanism, traditional machine learning models need to mine a large number of matching features in advance, resulting in excessive resource consumption and inefficient search matching processing.

Method used

By obtaining matching data pair samples, the two-sided semantic vectors are determined based on the semantic coding layer of the initial matching model, the feature fusion layer is used to perform multi-core feature fusion, and the semantic matching result is determined in combination with the semantic matching layer to realize the trained semantic matching model to improve search matching efficiency.

Benefits of technology

It reduces the cumbersome operations in the model construction process, improves the processing efficiency of the semantic matching model, and achieves efficient matching of requirements and results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119066437A_ABST
    Figure CN119066437A_ABST
Patent Text Reader

Abstract

The invention relates to a semantic matching model construction method, a data matching processing method and device, equipment and a storage medium. The method relates to artificial intelligence, and comprises the steps of obtaining matched data pair samples, determining bilateral semantic vectors corresponding to the matched data pair samples based on a semantic coding layer of an initial matching model, performing multi-core feature fusion processing on the bilateral semantic vectors according to a feature fusion layer of the initial matching model, obtaining fused feature vectors, and outputting the fused feature vectors. And based on a semantic matching layer of the initial matching model, determining a semantic matching result corresponding to the fusion feature vector. If it is determined that a model training ending condition is met according to the semantic matching result and the matching data pair sample, a trained semantic matching model is obtained, and target result data matched with the current demand data is determined according to the semantic matching model. By adopting the method, the construction efficiency based on the semantic matching model and the processing efficiency of semantic matching processing based on the semantic matching model are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a method for constructing a semantic matching model, a data matching processing method, device, computer equipment, storage medium and computer program product. Background Art

[0002] With the development of artificial intelligence technology and the promotion and application of various Internet applications and websites, in the actual promotion and application process, the accuracy requirements for search results or recommended results determined based on search needs and recommendation needs triggered by the user object are increasing. Among them, in the actual application process, for example, when the search needs triggered by the user object are detected, it is usually necessary to perform semantic understanding based on the search needs, such as intent recognition processing, to determine the search results that match the search needs from the existing pages or push information for display.

[0003] In traditional technology, when determining search results that match search requirements based on existing pages or pushed information, a machine learning model is usually used to construct a "requirement-result" matching mechanism. The "requirement-result" matching mechanism is used to determine the search results that match the search requirements, improve the matching degree between the search requirements and the search results, and obtain more accurate search results.

[0004] However, the traditional method of building a "demand-result" matching mechanism by constructing a machine learning model usually requires mining a large number of "demand-result" matching features in advance to train the machine learning model. This requires a lot of resources to mine matching features and construct feature engineering. There is still a problem of excessive resource consumption leading to inefficient search and matching processing. Summary of the invention

[0005] Based on this, it is necessary to provide a method for constructing a semantic matching model, a data matching processing method, device, computer equipment, storage medium and computer program product that can improve the efficiency of search and matching processing in response to the above technical problems.

[0006] In a first aspect, the present application provides a method for constructing a semantic matching model. The method comprises:

[0007] Acquire matching data pair samples, and determine the bilateral semantic vectors corresponding to each matching data pair sample based on the semantic coding layer of the initial matching model; the matching data pair samples include mutually matching requirement data samples and result data samples;

[0008] According to the feature fusion layer of the initial matching model, multi-core feature fusion processing is performed on each of the bilateral semantic vectors to obtain a fused feature vector;

[0009] Determining a semantic matching result corresponding to the fused feature vector based on the semantic matching layer of the initial matching model;

[0010] If the model training end conditions are determined to be met based on the semantic matching results and the matching data pair samples, a trained semantic matching model is obtained; the semantic matching model is used to determine the target result data that matches the current demand data based on the semantic matching results.

[0011] In a second aspect, the present application also provides a data matching processing method. The method comprises:

[0012] Receive a data matching request and obtain current demand data corresponding to the data matching request;

[0013] Based on the trained semantic matching model, the target result data matching the current demand data is determined and displayed; wherein the trained semantic matching model includes a semantic encoding layer, a feature fusion layer and a semantic matching layer; the semantic encoding layer is used to determine the demand semantic vector corresponding to the current demand data, and the result semantic vector corresponding to each candidate result data; the feature fusion layer is used to perform multi-core feature fusion processing on each demand semantic vector and the result semantic vector to obtain a fused feature vector; the semantic matching layer is used to determine the semantic matching result corresponding to the fused feature vector, and determine the target result data matching the current demand data based on the semantic matching result.

[0014] In a third aspect, the present application also provides a device for constructing a semantic matching model. The device comprises:

[0015] A bilateral semantic vector determination module is used to obtain matching data pair samples and determine the bilateral semantic vectors corresponding to each matching data pair sample based on the semantic coding layer of the initial matching model; the matching data pair samples include mutually matching demand data samples and result data samples;

[0016] A fused feature vector obtaining module, used to perform multi-core feature fusion processing on each of the bilateral semantic vectors according to the feature fusion layer of the initial matching model to obtain a fused feature vector;

[0017] A semantic matching result determination module, used to determine a semantic matching result corresponding to the fused feature vector based on the semantic matching layer of the initial matching model;

[0018] The semantic matching model acquisition module is used to obtain a trained semantic matching model if it is determined that the model training end conditions are met based on the semantic matching results and the matching data pair samples; the semantic matching model is used to determine the target result data that matches the current demand data based on the semantic matching results.

[0019] In a fourth aspect, the present application also provides a data matching processing device. The device comprises:

[0020] A current demand data acquisition module, used to receive a data matching request and acquire current demand data corresponding to the data matching request;

[0021] A target result data determination module is used to determine and display the target result data matching the current demand data based on a trained semantic matching model; wherein the trained semantic matching model includes a semantic encoding layer, a feature fusion layer and a semantic matching layer; the semantic encoding layer is used to determine the demand semantic vector corresponding to the current demand data, and the result semantic vector corresponding to each candidate result data; the feature fusion layer is used to perform multi-core feature fusion processing on each demand semantic vector and the result semantic vector to obtain a fused feature vector; the semantic matching layer is used to determine the semantic matching result corresponding to the fused feature vector, and determine the target result data matching the current demand data based on the semantic matching result.

[0022] In a fifth aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0023] Acquire matching data pair samples, and determine the bilateral semantic vectors corresponding to each matching data pair sample based on the semantic coding layer of the initial matching model; the matching data pair samples include mutually matching demand data samples and result data samples;

[0024] According to the feature fusion layer of the initial matching model, multi-core feature fusion processing is performed on each of the bilateral semantic vectors to obtain a fused feature vector;

[0025] Determining a semantic matching result corresponding to the fused feature vector based on the semantic matching layer of the initial matching model;

[0026] If the model training end conditions are determined to be met based on the semantic matching results and the matching data pair samples, a trained semantic matching model is obtained; the semantic matching model is used to determine the target result data that matches the current demand data based on the semantic matching results.

[0027] In a sixth aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0028] Receive a data matching request and obtain current demand data corresponding to the data matching request;

[0029] Based on the trained semantic matching model, the target result data matching the current demand data is determined and displayed; wherein the trained semantic matching model includes a semantic encoding layer, a feature fusion layer and a semantic matching layer; the semantic encoding layer is used to determine the demand semantic vector corresponding to the current demand data, and the result semantic vector corresponding to each candidate result data; the feature fusion layer is used to perform multi-core feature fusion processing on each demand semantic vector and the result semantic vector to obtain a fused feature vector; the semantic matching layer is used to determine the semantic matching result corresponding to the fused feature vector, and determine the target result data matching the current demand data based on the semantic matching result.

[0030] In a seventh aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0031] Acquire matching data pair samples, and determine the bilateral semantic vectors corresponding to each matching data pair sample based on the semantic coding layer of the initial matching model; the matching data pair samples include mutually matching demand data samples and result data samples;

[0032] According to the feature fusion layer of the initial matching model, multi-core feature fusion processing is performed on each of the bilateral semantic vectors to obtain a fused feature vector;

[0033] Determining a semantic matching result corresponding to the fused feature vector based on the semantic matching layer of the initial matching model;

[0034] If the model training end conditions are determined to be met based on the semantic matching results and the matching data pair samples, a trained semantic matching model is obtained; the semantic matching model is used to determine the target result data that matches the current demand data based on the semantic matching results.

[0035] In an eighth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0036] Receive a data matching request and obtain current demand data corresponding to the data matching request;

[0037] Based on the trained semantic matching model, the target result data matching the current demand data is determined and displayed; wherein the trained semantic matching model includes a semantic encoding layer, a feature fusion layer and a semantic matching layer; the semantic encoding layer is used to determine the demand semantic vector corresponding to the current demand data, and the result semantic vector corresponding to each candidate result data; the feature fusion layer is used to perform multi-core feature fusion processing on each demand semantic vector and the result semantic vector to obtain a fused feature vector; the semantic matching layer is used to determine the semantic matching result corresponding to the fused feature vector, and determine the target result data matching the current demand data based on the semantic matching result.

[0038] In a ninth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0039] Acquire matching data pair samples, and determine the bilateral semantic vectors corresponding to each matching data pair sample based on the semantic coding layer of the initial matching model; the matching data pair samples include mutually matching requirement data samples and result data samples;

[0040] According to the feature fusion layer of the initial matching model, multi-core feature fusion processing is performed on each of the bilateral semantic vectors to obtain a fused feature vector;

[0041] Determining a semantic matching result corresponding to the fused feature vector based on the semantic matching layer of the initial matching model;

[0042] If the model training end conditions are determined to be met based on the semantic matching results and the matching data pair samples, a trained semantic matching model is obtained; the semantic matching model is used to determine the target result data that matches the current demand data based on the semantic matching results.

[0043] In a tenth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0044] Receive a data matching request and obtain current demand data corresponding to the data matching request;

[0045] Based on the trained semantic matching model, the target result data matching the current demand data is determined and displayed; wherein the trained semantic matching model includes a semantic encoding layer, a feature fusion layer and a semantic matching layer; the semantic encoding layer is used to determine the demand semantic vector corresponding to the current demand data, and the result semantic vector corresponding to each candidate result data; the feature fusion layer is used to perform multi-core feature fusion processing on each demand semantic vector and the result semantic vector to obtain a fused feature vector; the semantic matching layer is used to determine the semantic matching result corresponding to the fused feature vector, and determine the target result data matching the current demand data based on the semantic matching result.

[0046] In the above-mentioned semantic matching model construction method, data matching processing method, device, computer equipment, storage medium and computer program product, by obtaining matching data pair samples including mutually matching demand data samples and result data samples, based on the semantic encoding layer of the initial matching model, the bilateral semantic vectors corresponding to each matching data pair sample are determined, and according to the feature fusion layer of the initial matching model, multi-core feature fusion processing is performed on each bilateral semantic vector to obtain a fused feature vector, thereby realizing multi-layer feature fusion processing of the demand and result bilateral semantic vectors, further improving the feature fusion effect between the demand and result sides, and strengthening the information interaction between the demand and result sides. Furthermore, based on the semantic matching layer of the initial matching model, the semantic matching result corresponding to the fused feature vector is determined, and if it is determined that the model training end condition is met based on the semantic matching result and the matching data pair sample, a trained semantic matching model is obtained to determine the target result data matching the current demand data through the semantic matching model. Since there is no need to pre-mine a large amount of matching features between demand data and result data, instead, semantic encoding and feature fusion of samples are performed based on the screened matching data, which reduces the tedious operations in the model building process and improves the model building efficiency. At the same time, it also improves the processing efficiency of semantic matching processing based on the semantic matching model based on multi-core feature fusion processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 It is an application environment diagram of a method for constructing a semantic matching model and a method for processing data matching in one embodiment;

[0048] Figure 2 A flowchart of a method for constructing a semantic matching model in an embodiment;

[0049] Figure 3 A schematic diagram of a process for obtaining matching data pair samples in one embodiment;

[0050] Figure 4 A schematic diagram of a process for obtaining a trained semantic matching model in one embodiment;

[0051] Figure 5 A schematic diagram of a model architecture of a semantic matching model in an embodiment;

[0052] Figure 6 A flowchart of a method for constructing a semantic matching model according to another embodiment;

[0053] Figure 7 A schematic diagram of a flow chart of a data matching processing method in one embodiment;

[0054] Figure 8 A schematic diagram of a process of performing data matching based on current demand data to obtain target result data in one embodiment;

[0055] Fig. 9 is a structural block diagram of a device for constructing a semantic matching model in one embodiment;

[0056] Fig.10 is a structural block diagram of a data matching processing device in one embodiment;

[0057] Fig.11 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0058] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0059] The construction method of the semantic matching model and the data matching processing method provided in the embodiments of the present application are specifically related to artificial intelligence technology, which can be applied to various scenarios such as cloud technology, artificial intelligence, smart transportation, network media and assisted driving. Among them, artificial intelligence (AI) is the theory, method, technology and application system of using digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology of computer science, which attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that the machines have the functions of perception, reasoning and decision-making. Artificial intelligence technology is a comprehensive discipline involving a wide range of fields, including both hardware-level technology and software-level technology. Basic artificial intelligence technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0060] Among them, Natural Language Processing (NLP) is an important direction in the fields of computer science and artificial intelligence. It studies various theories and methods that can achieve effective communication between people and computers using natural language. Natural language processing is a science that integrates linguistics, computer science, and mathematics. Therefore, research in this field will involve natural language, that is, the language used by people in daily life, so it is closely related to the study of linguistics. Natural language processing technology usually includes technologies such as text processing, semantic understanding, machine translation, robot question answering, and knowledge graphs. Machine Learning (ML) is a multi-disciplinary cross-disciplinary subject involving probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. It is used to specifically study how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all fields of artificial intelligence. Machine learning and deep learning usually include technologies such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and inductive learning.

[0061] With the research and advancement of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned driving, automatic driving, drones, robots, smart medical care, smart customer service, etc. I believe that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.

[0062] The semantic matching model construction method and data matching processing method provided in the embodiments of the present application specifically involve computer vision, natural language processing and machine learning technologies in artificial intelligence technologies, and can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices, portable wearable devices, and aircraft, etc. The Internet of Things devices can be smart speakers, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be an independent physical server, or it can be a server cluster composed of multiple physical servers, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal 102 and the server 104 can be directly or indirectly connected by wired or wireless communication, which is not limited in the embodiments of the present application.

[0063] Among them, the terminal 102 and the server 104 can be used alone to execute the construction method of the semantic matching model and the data matching processing method provided in the embodiment of the present application, and the terminal 102 and the server 104 can also cooperate to execute the construction method of the semantic matching model and the data matching processing method provided in the embodiment of the present application. For example, taking the terminal 102 and the server 104 cooperating to execute the construction method of the semantic matching model provided in the embodiment of the present application as an example, the server 104 obtains the matching data pair samples, and based on the semantic coding layer of the initial matching model, determines the bilateral semantic vectors corresponding to each matching data pair sample, wherein the matching data pair samples specifically include mutually matching demand data samples and result data samples. Among them, the matching data pair samples can be stored in the cloud storage of the server 104, or in the data storage system, or in the local storage of the terminal 102, and when it is necessary to build a semantic matching model, it can be obtained from the server 104, or the data storage system, or the terminal 102. Furthermore, the server 104 performs multi-core feature fusion processing on each bilateral semantic vector according to the feature fusion layer of the initial matching model to obtain a fused feature vector, and determines the semantic matching result corresponding to the fused feature vector based on the semantic matching layer of the initial matching model. If the server 104 determines that the model training end condition is met based on the semantic matching result and the matching data pair sample, a trained semantic matching model is obtained. When a data matching request triggered by the terminal 102 is detected, the server 104 can determine the target result data that matches the current demand data based on the current demand data carried by the data matching request by calling the semantic matching model, and feed back the corresponding target data result to the terminal 102 for display for viewing by the user.

[0064] Similarly, taking the terminal 102 and the server 104 cooperating to execute the data matching processing method provided in the embodiment of the present application as an example, when the server 104 receives the data matching request triggered by the terminal 102, it obtains the current demand data corresponding to the data matching request, and based on the trained semantic matching model, determines the target result data that matches the current demand data, and feeds back the corresponding target data result to the terminal 102 for display for viewing by the user. Among them, the trained semantic matching model includes a semantic encoding layer, a feature fusion layer and a semantic matching layer. The semantic encoding layer is used to determine the demand semantic vector corresponding to the current demand data, and the result semantic vector corresponding to each candidate result data, and the feature fusion layer is used to perform multi-core feature fusion processing on each demand semantic vector and result semantic vector to obtain a fused feature vector. Among them, the semantic matching layer is used to determine the semantic matching result corresponding to the fused feature vector, and determine the target result data that matches the current demand data based on the semantic matching result.

[0065] In one embodiment, Figure 2As shown in FIG, a method for constructing a semantic matching model is provided, and the method is applied to Figure 1 The server in the example is used to illustrate the following steps:

[0066] Step S202, obtaining matching data pair samples, and determining the bilateral semantic vectors corresponding to each matching data pair sample based on the semantic coding layer of the initial matching model, wherein the matching data pair samples include mutually matching requirement data samples and result data samples.

[0067] The matching data pair samples include mutually matching demand data samples and result data samples, which can be specifically understood as demand-result data pair samples with the same keywords and a frequency of occurrence that meets the preset sample screening conditions. Specifically, each demand-result data pair with the same keyword is used as a data pair to be screened, and each demand-result data pair with the same keyword (i.e., a data pair to be screened) is further screened to obtain matching data pair samples with the same keyword and a frequency of occurrence of the data pair that meets the preset sample screening conditions.

[0068] The preset sample screening condition corresponds to the preset frequency threshold. Specifically, by comparing the frequency of occurrence of the demand-result data pair with the same keyword with the preset frequency threshold, it is determined whether the frequency of occurrence of each demand-result data pair meets the preset sample screening condition. If the frequency of occurrence of the demand-result data pair is greater than the preset frequency threshold, it indicates that the frequency of occurrence of the corresponding demand-result data pair meets the preset sample screening condition. On the contrary, if the frequency of occurrence of the demand-result data pair is less than the preset frequency threshold, it indicates that the frequency of occurrence of the corresponding demand-result data pair does not meet the preset sample screening condition.

[0069] Among them, in the actual application process of the application, platform, or web page, it is usually necessary to save the business query data involved in the application process in real time or according to a preset saving period, so as to obtain the business query log data of the actual application process. Specifically, the business query log data of the application, platform, or web page usually includes search operations, access operations, etc. triggered by the use object based on the application, platform, or web page, etc., as well as input data corresponding to the search operations and access operations.

[0070] Similarly, the business query log data also includes search results or recommended data associated with the input data corresponding to the search operation, and the corresponding search results or recommended data for the input data of the same search operation may usually include multiple. For example, if the input data corresponding to the search operation is "braised pork", then the search results or recommended data associated with the input data "braised pork" may specifically include "different ways to cook braised pork", "prices of braised pork in different regions", and "recommendations for delicious braised pork restaurants".

[0071] Specifically, by obtaining the business query log data of the actual application process, and filtering and screening the input data corresponding to the search operation and access operation included in the business query log data, as well as the search results or recommended data associated with the input data corresponding to the search operation, etc., a sample of demand-result data pairs with the same keywords and a frequency of occurrence that meets the preset sample screening conditions is obtained, that is, a sample of matching data pairs is obtained.

[0072] Furthermore, after obtaining the matching data pair samples, the semantic encoding layer of the initial matching model is used to perform semantic encoding processing on the matching data pair samples, thereby obtaining the bilateral semantic vectors corresponding to the matching data pair samples. The bilateral semantic vectors corresponding to the matching data pair samples specifically include the demand semantic vectors corresponding to the demand data samples and the result semantic vectors corresponding to the result data samples.

[0073] The semantic encoding layer of the initial matching model may specifically be an LSTM network layer (i.e., Long Short Term Memory, long short-term memory recursive network), that is, the matching data samples are semantically encoded by utilizing the LSTM network layer.

[0074] Specifically, for the demand data samples and result data samples that match each other in the matching data pair samples, corresponding LSTM network layers are set for the demand data samples and the result data samples, respectively, including a first encoding layer corresponding to the demand data samples and a second encoding layer corresponding to the result data samples. Specifically, the demand data samples are semantically encoded by the first encoding layer, and the result data samples are semantically encoded by the second encoding layer, so as to obtain the demand semantic vector corresponding to the demand data samples and the result semantic vector corresponding to the result data samples.

[0075] For example, if the demand data sample is represented by "Query = braised pork in red sauce", the first encoding layer corresponding to the demand data sample is represented by "Query-encoder", and the demand semantic vector is represented by "Q_embedding". Similarly, the result data sample is represented by "Doc1 = the common method of braised pork in red sauce", the second encoding layer corresponding to the result data sample is represented by "Doc-encoder", and the result semantic vector is represented by "D_embedding".

[0076] Specifically, the first encoding layer, namely "Query-encoder", is used to perform semantic encoding processing on the demand data sample, namely "Query = Braised Pork in Red Sauce", and the demand semantic vector, namely "Q_embedding", is obtained in the following manner: Q_embedding = LSTM (Query) = Query-encoder (Braised Pork in Red Sauce).

[0077] Similarly, the second encoding layer, namely "Doc-encoder", is used to perform semantic encoding processing on the result data sample, namely "Doc1 = Common methods of making braised pork in brown sauce", and the resulting semantic vector, namely "D_embedding", is obtained in the following manner: D_embedding = LSTM (Doc) = Doc-encoder (Common methods of making braised pork in brown sauce).

[0078] Step S204, performing multi-core feature fusion processing on each bilateral semantic vector according to the feature fusion layer of the initial matching model to obtain a fused feature vector.

[0079] Among them, the feature fusion layer of the initial matching model can be specifically understood as a feature fusion space including multiple tensor matrices, and each tensor matrix in the feature fusion space corresponds to a different feature vector dimension, and then the feature fusion layer is used to perform multi-core feature fusion processing on the bilateral semantic vectors, i.e., the demand semantic vector corresponding to the demand data sample, and the result semantic vector corresponding to the result data sample. Specifically, multiple tensor matrices are used to perform feature fusion processing on the demand semantic vector and the result semantic vector, respectively, so as to obtain a fused feature vector corresponding to the demand semantic vector and the result semantic vector.

[0080] Specifically, according to the feature fusion layer of the initial matching model, that is, using each tensor matrix in the feature fusion space, feature fusion processing is performed on the demand semantic vector and the result semantic vector respectively to obtain multiple sub-fusion feature vectors. Further, based on each sub-fusion feature vector corresponding to the demand semantic vector and the result semantic vector, feature vector splicing processing is performed to obtain a fusion feature vector.

[0081] In one embodiment, according to the feature fusion layer of the initial matching model, multi-core feature fusion processing is performed on the demand semantic vector and the result semantic vector to obtain multiple sub-fusion feature vectors, including:

[0082] According to each tensor matrix in the feature fusion space, feature fusion processing is performed on the demand semantic vector and the result semantic vector respectively to obtain sub-fusion feature vectors of multiple different feature vector dimensions corresponding to the demand semantic vector and the result semantic vector; wherein each sub-fusion feature vector of the demand semantic vector and the result semantic vector corresponds to a tensor matrix respectively.

[0083] Specifically, the feature fusion layer of the initial matching model is a feature fusion space including multiple tensor matrices, and each tensor matrix in the feature fusion space corresponds to a different feature vector dimension. Specifically, each tensor matrix in the feature fusion space is used to perform feature fusion processing on the demand semantic vector and the result semantic vector respectively to obtain sub-fusion feature vectors in multiple different feature vector dimensions corresponding to the demand semantic vector and the result semantic vector.

[0084] Among them, each sub-fusion feature vector corresponding to the demand semantic vector and the result semantic vector corresponds to a tensor matrix respectively, that is, when the demand semantic vector and the result semantic vector are subjected to feature fusion processing through each tensor matrix, the sub-fusion feature vector under the feature vector dimension of the corresponding tensor matrix is ​​obtained.

[0085] In one embodiment, the feature fusion layer of the initial matching model, i.e., the multi-core tensor matrix, can be represented by k*W[1:i], and the multi-core tensor matrix can be used to enhance the fusion effect of the bilateral semantic vectors from different feature dimensions. Wherein, W[1:i] represents the matrix kernel (also called the second-order kernel, i.e., the tensor matrix is ​​a second-order tensor matrix) corresponding to a tensor matrix, k is the number of tensor matrices in the feature fusion layer, i.e., the number of matrix kernels in the feature fusion layer, and i is the dimension of the feature vector corresponding to the tensor matrix.

[0086] Specifically, the kernel matrix of each tensor matrix is ​​used to perform feature fusion on the demand semantic vector and the result semantic vector respectively, which includes feature fusion layers of k tensor matrices, that is, it is necessary to use the matrix kernel of each tensor matrix to perform feature fusion k times on the demand semantic vector and the result semantic vector respectively, that is, to perform feature fusion of k different feature dimensions to obtain k sub-fusion feature vectors, and obtain the total fusion feature vector by performing feature vector splicing processing on the k sub-fusion feature vectors.

[0087] Furthermore, the following formula (1) is specifically used to represent the sub-fusion feature vector obtained by performing feature fusion processing on the demand semantic vector and the result semantic vector using each tensor matrix in the feature fusion layer:

[0088] Fi=xi*W[1:i]*yi T (1)

[0089] Among them, Fi represents the sub-fusion feature vector, xi represents the i-th demand semantic vector, whose dimension is 1*a, yi Trepresents the transposed vector of the i-th result semantic vector, whose dimension is 1*b. W[1:i] represents the tensor matrix, whose dimension is a*b*i. The i in W[1:i] is used to represent the dimension of the feature vector corresponding to different tensor matrices. That is, according to the different values ​​of i, that is, using different tensor matrices, sub-fused feature vectors of different feature dimension vectors can be obtained.

[0090] In one embodiment, the process of performing feature fusion processing on the demand semantic vector and the result semantic vector using the tensor matrices in the feature fusion layer can be understood as the process of performing matrix-vector multiplication processing on the demand semantic vector and the result semantic vector according to the tensor matrices in the feature fusion layer.

[0091] Specifically, the dimension of the demand semantic vector is expressed as xi→1*a, and the dimension of the result semantic vector is expressed as yi T →1*b, and the dimension of the tensor matrix is ​​expressed as W[1:i]→a*b*i. Then, according to the tensor matrix, the matrix-vector multiplication of the demand semantic vector and the result semantic vector is performed, which can be expressed as xi*W[1:i]*yi T →i, that is, after the demand semantic vector and the result semantic vector are fused by using the tensor matrix, the dimension of the obtained sub-fusion feature vector is i.

[0092] Among them, the feature fusion layer (i.e., multi-core tensor matrix) usually includes multiple tensor matrices W[1:i], that is, k*W[1:i] is used to represent the feature fusion layer. Among them, through the feature fusion layer k*W[1:i], the demand semantic vector and the result semantic vector are subjected to multiple feature fusion processes respectively, and feature fusion can be realized from multiple dimensions respectively to obtain multiple sub-fusion feature vectors, thereby improving the fusion effect of the total fusion feature vector obtained, that is, strengthening the semantic fusion effect of the demand semantic vector and the result semantic vector in different dimensions.

[0093] Furthermore, the matrix core formed by the parameters in each tensor matrix can be used as a sub-feature fusion space. The feature fusion layer is the total feature fusion space constructed according to the corresponding sub-feature fusion spaces formed by the parameters of multiple tensor matrices. The feature fusion space including multiple matrix cores can be used to realize multi-core feature fusion processing of the demand semantic vector and the result semantic vector.

[0094] For example, taking the multi-core tensor matrix k*W[1:i] where k is 4 as an example, a specific explanation is given, that is, the feature fusion layer includes 4 tensor matrices, namely: the first tensor matrix W[1:m], the second tensor matrix W[1:n], the third tensor matrix W[1:d], and the fourth tensor matrix W[1:p], where m, n, d, and p are respectively used to represent the feature vector dimensions corresponding to different tensor matrices.

[0095] Among them, when the multi-core feature fusion processing of the demand semantic vector and the result semantic vector is performed using the multi-core tensor matrix composed of W[1:m], W[1:n], W[1:d] and W[1:p], specifically, the demand semantic vector and the result semantic vector are subjected to feature fusion processing through the first tensor matrix W[1:m] to obtain the first sub-fusion feature vector Fm, the demand semantic vector and the result semantic vector are subjected to feature fusion processing through the second tensor matrix W[1:n] to obtain the second sub-fusion feature vector Fn, the demand semantic vector and the result semantic vector are subjected to feature fusion processing through the third tensor matrix W[1:d] to obtain the third sub-fusion feature vector Fd, and the demand semantic vector and the result semantic vector are subjected to feature fusion processing through the fourth tensor matrix W[1:p] to obtain the fourth sub-fusion feature vector Fp.

[0096] Furthermore, the first sub-fusion feature vector Fm is specifically obtained by Fm=xi*W[1:m]*yi T It is represented by the feature vector dimension of m, and the second sub-fusion feature vector Fn is specifically expressed by Fn=xi*W[1:n]*yi T The feature vector dimension is n. Similarly, the third sub-fusion feature vector Fd is specifically expressed by Fd = xi*W[1:d]*yi T The feature vector dimension is d, and the fourth sub-fusion feature vector Fp is specifically expressed by Fp = xi*W[1:p]*yi T Represented by, its feature vector dimension is p.

[0097] Among them, after obtaining the first sub-fusion feature vector Fm, the second sub-fusion feature vector Fn, the third sub-fusion feature vector Fd, and the fourth sub-fusion feature vector Fp, by performing vector splicing processing on each sub-fusion feature vector, a fusion feature vector F = [Fm: Fn: Fd: Fp] can be obtained.

[0098] It can be understood that since the actual number of tensor matrices included in the feature fusion layer, that is, the value of k, can be adjusted and set according to actual business needs, and is not limited to the specific values ​​shown in this embodiment, the obtained fused feature vector can be represented by F = [Fm: Fn: Fd: Fp: ...], that is, the number of sub-fused feature vectors included in the fused feature vector, also corresponds to the actual business needs, and is not limited to the specific values ​​shown in the embodiments of the present application.

[0099] Step S206: Determine a semantic matching result corresponding to the fused feature vector based on the semantic matching layer of the initial matching model.

[0100] Specifically, based on the semantic matching layer of the initial matching model, the fused feature vector is semantically matched to obtain a semantic matching result corresponding to the fused feature vector. The semantic matching result corresponding to the fused feature vector obtained by the semantic matching layer includes a semantic match and a semantic mismatch result.

[0101] Furthermore, the semantic matching layer of the initial matching model can be understood as a classifier, which is used to classify the fused feature vector into different categories of semantic matching and semantic mismatch. Specifically, the semantic matching layer of the initial matching model can be a classifier for implementing binary classification, that is, the fused feature vector is classified into two categories of semantic matching and semantic mismatch through the classifier.

[0102] Step S208, if it is determined that the model training end condition is met based on the semantic matching results and the matching data pair samples, a trained semantic matching model is obtained. The semantic matching model is used to determine the target result data that matches the current demand data based on the semantic matching results.

[0103] Specifically, by obtaining the actual labels corresponding to the matching data pair samples, and according to the semantic matching results and the actual labels corresponding to the matching data pair samples, a model training loss function corresponding to the initial matching model is determined.

[0104] Furthermore, by judging whether the model training loss function satisfies the model training end condition, it is determined whether the model training needs to be continued. Specifically, if the model training loss function satisfies the model training end condition, the initial matching model at the end of the model training is determined as the trained semantic matching model. On the contrary, if the model training loss function does not satisfy the model training end condition, the initial matching model is continuously iterated until the model training end condition is met to obtain the trained semantic matching model.

[0105] The model training end condition may specifically be that the model training loss function value reaches a preset loss threshold, that is, by comparing the preset loss threshold corresponding to the model training end condition with the model training loss function value, if it is determined that the model training loss function value reaches the preset loss threshold, it indicates that the model training end condition is met, and if the model training loss function value does not reach the preset loss threshold, it indicates that the model training end condition is not met. The preset loss threshold can be adjusted and set according to actual business needs, and is not limited to a specific value.

[0106] In one embodiment, the model training termination condition may also be that the number of iterative training times for the initial matching model reaches a preset number threshold, that is, when it is determined that the number of training times reaches a preset number threshold during the process of training the initial matching model with samples using matching data, it indicates that the model training termination condition is met.

[0107] On the contrary, if during the process of training the initial matching model using the matching data for the sample, it is determined that the number of training times does not reach the preset number threshold, it indicates that the model training end condition is not met. The preset number threshold can be adjusted and set according to actual business needs and is not limited to a specific value.

[0108] In the method for constructing the above-mentioned semantic matching model, by obtaining matching data pair samples including mutually matching demand data samples and result data samples, based on the semantic encoding layer of the initial matching model, the bilateral semantic vectors corresponding to each matching data pair sample are determined, and according to the feature fusion layer of the initial matching model, the multi-core feature fusion processing is performed on each bilateral semantic vector to obtain the fused feature vector, thereby realizing the multi-layer feature fusion processing of the demand and result bilateral semantic vectors, further improving the feature fusion effect between the demand and result sides, and strengthening the information interaction between the demand and result sides. Further, based on the semantic matching layer of the initial matching model, the semantic matching result corresponding to the fused feature vector is determined, and if it is determined that the model training end condition is met according to the semantic matching result and the matching data pair sample, a trained semantic matching model is obtained to determine the target result data matching the current demand data through the semantic matching model. Since there is no need to pre-mine the matching features between a large amount of demand data and result data, but semantic encoding and feature fusion are performed on the selected matching data pair samples, the tedious operations in the model construction process are reduced, the model construction efficiency is improved, and at the same time, the processing efficiency of the semantic matching model based on the multi-core feature fusion processing for semantic matching is improved.

[0109] In one embodiment, Figure 3 As shown, the steps of obtaining matching data pair samples specifically include:

[0110] Step S302: Perform business data filtering based on the business query log data to obtain demand data and result data with the same keyword, and determine them as data pairs to be filtered with the same keyword.

[0111] Among them, in the actual application process of the application, platform, or web page, it is usually necessary to save the business query data involved in the application process in real time or according to a preset saving period, so as to obtain the business query log data of the actual application process. Specifically, the business query log data of the application, platform, or web page usually includes search operations, access operations, etc. triggered by the use object based on the application, platform, or web page, etc., as well as input data corresponding to the search operations and access operations.

[0112] Similarly, the business query log data also includes search results or recommended data associated with the input data corresponding to the search operation, and the corresponding search results or recommended data for the input data of the same search operation may usually include multiple. For example, if the input data corresponding to the search operation is "braised pork", then the search results or recommended data corresponding to the input data "braised pork" may specifically include "different ways to cook braised pork", "prices of braised pork in different regions", and "recommendations for delicious braised pork restaurants".

[0113] Specifically, by obtaining business query log data of the actual application process, and filtering and selecting the input data corresponding to the search operation and access operation included in the business query log data, as well as the search results or recommended data associated with the input data corresponding to the search operation, etc., the demand data and result data with the same keywords are obtained.

[0114] Furthermore, when business data filtering is performed on input data corresponding to search operations and access operations, and search results (or recommended data) associated with input data corresponding to search operations, etc., keyword detection is performed on the input data and search results to obtain keywords corresponding to the input data and search results, and further filtering is performed based on the keywords to obtain demand data and result data with the same keywords, and determine them as data pairs to be filtered with the same keywords.

[0115] For example, if the input data corresponding to the search operation is "Red Braised Pork XXX", then when the input data is subjected to keyword detection processing, the keyword corresponding to the input data is obtained as "Red Braised Pork". Similarly, the search results associated with the input data corresponding to the search operation, etc. specifically include: "Different ways of cooking red braised pork", "Prices of red braised pork in different regions", and "Recommendations for delicious red braised pork restaurants", etc., and the keyword of these search results is also "Red Braised Pork". Then "Red Braised Pork XXX"-"Different ways of cooking red braised pork", "Red Braised Pork XXX"-"Prices of red braised pork in different regions", and "Red Braised Pork XXX"-"Recommendations for delicious red braised pork restaurants" can all be used as data pairs to be screened with the same keywords.

[0116] Step S304, performing occurrence frequency statistics processing on the data pairs to be screened with the same keywords to obtain the occurrence frequency of each data pair to be screened.

[0117] Specifically, the frequency of occurrence of the data pairs to be screened with the same keywords, that is, the demand-result data pairs with the same keywords, is statistically processed, that is, the frequency of occurrence of each demand-result data pair with the same keyword is counted to obtain the frequency of occurrence of each demand-result data pair with the same keyword.

[0118] For instance, taking the keyword "braised pork" as an example, the data pairs to be screened with the same keyword include: "braised pork XXX"-"different ways of cooking braised pork", "braised pork XXX"-"prices of braised pork in different regions", and "braised pork XXX"-"recommendations of delicious braised pork restaurants", etc., and specifically, by performing statistical processing on the frequency of occurrence of each data pair, the corresponding frequencies of occurrence of the data pairs to be screened, namely, "braised pork XXX"-"different ways of cooking braised pork", "braised pork XXX"-"prices of braised pork in different regions", and "braised pork XXX"-"recommendations of delicious braised pork restaurants", are obtained.

[0119] Step S306 , performing sample screening processing on the data pairs to be screened with the same keywords according to the occurrence frequency of the data pairs to be screened and the preset sample screening conditions, to obtain matching data pair samples.

[0120] Among them, the preset sample screening condition corresponds to the preset occurrence frequency threshold. Specifically, the occurrence frequency of the demand-result data pairs with the same keywords, that is, the data pairs to be screened, is compared with the preset occurrence frequency threshold to determine whether the occurrence frequency of each demand-result data pair meets the preset sample screening condition.

[0121] Specifically, by obtaining a preset frequency threshold corresponding to the preset sample screening condition, the frequency of occurrence of the data pairs to be screened with the same keyword is compared with the preset frequency threshold. If the frequency of occurrence of the demand-result data pair, i.e., the data pair to be screened, is greater than the preset frequency threshold, it indicates that the frequency of occurrence of the corresponding demand-result data pair meets the preset sample screening condition. On the contrary, if the frequency of occurrence of the demand-result data pair, i.e., the data pair to be screened, is less than the preset frequency threshold, it indicates that the frequency of occurrence of the corresponding demand-result data pair does not meet the preset sample screening condition.

[0122] Furthermore, the requirement-result data pairs (i.e., the data pairs to be screened) whose occurrence frequencies meet the preset sample screening conditions are determined as matching data pair samples.

[0123] For example, taking a certain demand-result data pair, i.e., a certain data pair to be screened, specifically "Query = 'red-braised pork'" - "Doc = 'how to make red-braised pork'", as an example, a specific description is given. For the demand-result data pair, i.e., the data pair to be screened, with the same keywords, the occurrence frequency of the data pair to be screened is counted, and according to the preset occurrence frequency threshold, whether the data pair to be screened meets the preset sample screening condition is judged, which is specifically achieved in the following way:

[0124] {Query = 'Braised Pork'

[0125] Doc='How to make braised pork'

[0126] Label1 = 1 (QD co-occurrence times greater than 10)}

[0127] Among them, for the demand data Query = 'braised pork' and the result data Doc = 'how to make braised pork', the co-occurrence times of QD are counted, that is, the frequency of occurrence of the demand-result data pairs with the same keywords is counted, and it is determined whether the frequency of occurrence of the demand-result data pairs with the same keywords meets the preset sample screening conditions.

[0128] Furthermore, in an embodiment of the present application, the preset occurrence frequency threshold corresponding to the preset sample screening condition may be specifically 10 times, that is, by judging whether the QD co-occurrence times are greater than 10 times, the occurrence frequency of the demand-result data pairs of the same keyword is determined to determine whether it meets the preset sample screening condition.

[0129] Specifically, if the number of QD co-occurrences is greater than 10 times, it indicates that the preset sample screening condition is met, and if the number of QD co-occurrences is less than 10 times, it indicates that the preset sample screening condition is not met. Among them, the preset occurrence frequency threshold can be adjusted and set according to actual business needs, and is not limited to the specific value in the embodiment of the present application, for example, it can also be 15, 18, 20 and other different values.

[0130] If it is determined that the preset sample screening condition is met, a label "Label1=1" is added to the demand-result data pair of the same keyword, wherein the number "1" in "Label1" is used to indicate that the label is the number of the label added to the current demand-result data pair, and different demand-result data pairs are added with labels of different numbers, such as "Label2", "Label3", etc. When Label is 1, it means that the demand-result data pair of the same keyword meets the preset sample screening condition and can be used as a matching data pair sample. If Label is 0, it means that the demand-result data pair of the same keyword meets the preset sample screening condition and cannot be used as a matching data pair sample.

[0131] In this embodiment, based on the business query log data, business data filtering processing is performed to obtain demand data and result data with the same keywords, which are determined as pairs of data to be screened with the same keywords, and the frequency of occurrence statistics is performed on the pairs of data to be screened with the same keywords, so as to obtain the frequency of occurrence of each pair of data to be screened, without the need to pre-mine the matching features between a large amount of demand data and result data, thereby reducing the tedious operations in the process of obtaining samples (i.e., matching data pair samples), and improving the efficiency of sample acquisition. Further, according to the frequency of occurrence of the pairs of data to be screened and the preset sample screening conditions, the pairs of data to be screened with the same keywords are subjected to sample screening processing to obtain matching data pair samples, so that secondary screening can be further performed based on the frequency of occurrence on the basis of the same keywords, avoiding the use of data pairs with low frequency of occurrence and poor correlation as matching data pair samples, thereby improving the accuracy of the obtained matching data pair samples.

[0132] In one embodiment, Figure 4 As shown, the step of obtaining the trained semantic matching model, that is, if the model training end condition is determined to be met according to the semantic matching result and the matching data pair sample, the step of obtaining the trained semantic matching model specifically includes:

[0133] Step S402, obtaining the actual label corresponding to the matching data pair sample.

[0134] Specifically, the actual labels corresponding to the screened matching data pair samples are obtained, that is, the annotated labels corresponding to the mutually matching requirement data samples and result data samples are obtained, such as "Label1=1", that is, the annotated labels corresponding to the mutually matching requirement data samples and result data samples are 1.

[0135] Step S404, based on the semantic matching result and the actual label of the matching data pair sample, determine the model training loss function corresponding to the initial matching model.

[0136] Specifically, by obtaining the semantic matching result, that is, according to the semantic matching layer of the initial matching model, the semantic matching result corresponding to the fused feature vector is determined, including the semantic matching between the required data sample and the result data sample, and the semantic mismatch between the required data sample and the result data sample.

[0137] Furthermore, the semantic matching result includes a semantic matching category and a semantic mismatch category, wherein the semantic matching category is set to 1 and the semantic mismatch category is set to 0. Specifically, the model training loss function corresponding to the initial matching model is determined based on the category of the semantic matching result and the category to which the matching data pair sample belongs represented by the actual label of the matching data pair sample.

[0138] In one embodiment, the process of determining the semantic matching result corresponding to the fused feature vector can be understood as dividing the fused feature vector into two categories: semantic match and semantic mismatch through the semantic matching layer of the initial matching model, i.e., the classifier used to implement binary classification.

[0139] Among them, in the binary classification process, the semantic matching category is set to 1, and the semantic mismatch category is set to 0. Then, according to the classifier, when the fused feature vector is divided into the two categories of semantic matching and semantic mismatch, it is specifically determined whether it can be classified into the semantic matching category based on the predicted probability that the output result of the classifier is 1.

[0140] Specifically, if the prediction probability of the output result of the classifier is 1, which is greater than the preset prediction probability threshold, it indicates that the fused feature vector can be classified into the semantic matching category, and if the prediction probability of the output result of the classifier is 1, which is less than the preset prediction probability threshold, it indicates that the fused feature vector is classified into the semantic mismatch category. Among them, the preset prediction probability threshold can be adjusted and set according to actual business needs, and is not limited to one or some specific values, and can be different values ​​within the range of (0,1), such as 0.7, 0.8, 0.9, 0.95, etc.

[0141] In one embodiment, the following formula (2) is specifically used to determine the model training loss function corresponding to the initial matching model:

[0142]

[0143] Among them, loss represents the model training loss function corresponding to the initial matching model, n represents the number of matching data pair samples obtained by screening, and p i represents the actual label of the i-th matching data pair sample (i.e. the actual Label), a i It represents the probability that the semantic matching result of the i-th matching data pair sample is 1 (that is, the semantic matching result specifically belongs to the semantic matching category).

[0144] Step S406: If it is determined that the model training loss function meets the model training end condition, a trained semantic matching model is obtained.

[0145] Specifically, it is determined whether the model training needs to be continued by judging whether the model training loss function satisfies the model training end condition. Specifically, if the model training loss function satisfies the model training end condition, the initial matching model at the end of the model training is determined as the trained semantic matching model. On the contrary, if the model training loss function does not satisfy the model training end condition, the initial matching model is continued to be iteratively trained until the model training end condition is met to obtain a trained semantic matching model.

[0146] The model training end condition may specifically be that the model training loss function value reaches a preset loss threshold, that is, by comparing the preset loss threshold corresponding to the model training end condition with the model training loss function value, if it is determined that the model training loss function value reaches the preset loss threshold, it indicates that the model training end condition is met, and if the model training loss function value does not reach the preset loss threshold, it indicates that the model training end condition is not met. The preset loss threshold can be adjusted and set according to actual business needs, and is not limited to a specific value.

[0147] In one embodiment, the model training termination condition may also be that the number of training times of iterative training of the initial matching model reaches a preset number threshold, that is, when the number of training times reaches the preset number threshold in the process of training the initial matching model with the matching data, it indicates that the model training termination condition is met. On the contrary, if the number of training times does not reach the preset number threshold in the process of training the initial matching model with the matching data, it indicates that the model training termination condition is not met. The preset number threshold can be adjusted and set according to actual business needs and is not limited to a specific value.

[0148] In one embodiment, Figure 5 As shown, a model architecture of a semantic matching model is provided. Figure 5 It can be seen that the trained semantic matching model specifically includes a semantic encoding layer 502, a feature fusion layer 504 and a semantic matching layer 506. Among them:

[0149] The semantic encoding layer 502 specifically includes a first encoding layer corresponding to the demand data, which is represented by "Query-encoder", and a second encoding layer corresponding to the result data, which is represented by "Doc-encoder", wherein the first encoding layer and the second encoding layer are both LSTM network layers (i.e., Long Short Term Memory, long short-term memory recursive network), that is, the matching data samples are semantically encoded by using the LSTM network layer.

[0150] Specifically, refer to Figure 5It can be seen that, taking the demand data sample represented by "Query = braised pork in red sauce" as an example, the first encoding layer corresponding to the demand data sample is represented by "Query-encoder", and the demand semantic vector is represented by "Q_embedding". Similarly, the result data sample is represented by "Doc1 = the common method of braised pork in red sauce", the second encoding layer corresponding to the result data sample is represented by "Doc-encoder", and the result semantic vector is represented by "D_embedding".

[0151] Specifically, the first encoding layer, i.e., "Query-encoder", is used to perform semantic encoding processing on the demand data sample, i.e., "Query = braised pork in red", and the method of obtaining the demand semantic vector, i.e., "Q_embedding", is as follows: Q_embedding = LSTM (Query) = Query-encoder (braised pork in red). Similarly, the second encoding layer, i.e., "Doc-encoder", is used to perform semantic encoding processing on the result data sample, i.e., "Doc1 = the common method of braised pork in red", and the method of obtaining the result semantic vector, i.e., "D_embedding", is as follows: D_embedding = LSTM (Doc) = Doc-encoder (the common method of braised pork in red).

[0152] The feature fusion layer 504 can be specifically understood as a feature fusion space including multiple tensor matrices, and each tensor matrix in the feature fusion space corresponds to a different feature vector dimension. Specifically, refer to Figure 5 It can be seen that the feature fusion layer (i.e., bilinear net, understood as a bilinear network, which is used to perform multi-core feature fusion processing on the semantic vectors on both sides, i.e., the demand semantic vector corresponding to the demand data sample, and the result semantic vector corresponding to the result data sample) can specifically include 4 tensor matrices, namely: the first tensor matrix W[1:m], the second tensor matrix W[1:n], the third tensor matrix W[1:d], and the fourth tensor matrix W[1:p], where m, n, d, and p are respectively used to represent the feature vector dimensions corresponding to different tensor matrices.

[0153] Specifically, when the multi-core feature fusion processing of the demand semantic vector and the result semantic vector is performed by using the feature fusion layer 504, that is, the feature fusion space including multiple tensor matrices W[1:m], W[1:n], W[1:d] and W[1:p], the feature fusion processing of the demand semantic vector and the result semantic vector is performed by the first tensor matrix W[1:m] to obtain the first sub-fusion feature vector Fm, the feature fusion processing of the demand semantic vector and the result semantic vector is performed by the second tensor matrix W[1:n] to obtain the second sub-fusion feature vector Fn, the feature fusion processing of the demand semantic vector and the result semantic vector is performed by the third tensor matrix W[1:d] to obtain the third sub-fusion feature vector Fd, and the feature fusion processing of the demand semantic vector and the result semantic vector is performed by the fourth tensor matrix W[1:p] to obtain the fourth sub-fusion feature vector Fp.

[0154] Furthermore, the first sub-fusion feature vector Fm is specifically obtained by Fm=xi*W[1:m]*yi T It is represented by the feature vector dimension of m, and the second sub-fusion feature vector Fn is specifically expressed by Fn=xi*W[1:n]*yi T The feature vector dimension is n. Similarly, the third sub-fusion feature vector Fd is specifically expressed by Fd = xi*W[1:d]*yi T The feature vector dimension is d, and the fourth sub-fusion feature vector Fp is specifically expressed by Fp = xi*W[1:p]*yi T Represented by, its feature vector dimension is p.

[0155] Among them, after obtaining the first sub-fusion feature vector Fm, the second sub-fusion feature vector Fn, the third sub-fusion feature vector Fd, and the fourth sub-fusion feature vector Fp, by performing vector splicing processing on each sub-fusion feature vector, a fusion feature vector F = [Fm: Fn: Fd: Fp] can be obtained.

[0156] The semantic matching layer 506 can be understood as a classifier, which is used to classify the fused feature vector into different categories of semantic matching and semantic mismatch. The semantic matching layer of the initial matching model can be a classifier for implementing binary classification, that is, the fused feature vector is divided into two categories of semantic matching and semantic mismatch through the classifier.

[0157] Among them, in the binary classification process, the semantic matching category is set to 1, and the semantic mismatch category is set to 0. Then, according to the classifier, when the fused feature vector is divided into the two categories of semantic matching and semantic mismatch, it is specifically determined whether it can be classified into the semantic matching category based on the predicted probability that the output result of the classifier is 1.

[0158] In this embodiment, by obtaining the actual labels corresponding to the matching data pair samples, and based on the semantic matching results and the actual labels of the matching data pair samples, the model training loss function corresponding to the initial matching model is determined. During the model training process, the actual labels and semantic matching results corresponding to the matching data pair samples are simultaneously considered to determine the model training loss function so that the obtained semantic matching results are closer to the actual labels. Therefore, during the model training process, the model learning can continuously match the data features of the data pair samples, and the model parameters can be updated in real time. When it is determined that the model training loss function meets the model training end conditions, a trained semantic matching model can be obtained, thereby reducing the tedious operations in the model construction process and improving the model construction efficiency.

[0159] In one embodiment, Figure 6 As shown, a method for constructing a semantic matching model is provided, which specifically includes the following steps:

[0160] Step S601 , based on the business query log data, business data filtering processing is performed to obtain demand data and result data with the same keywords, and determine them as data pairs to be filtered with the same keywords.

[0161] Specifically, by obtaining business query log data of the actual application process, and filtering and selecting the input data corresponding to the search operation and access operation included in the business query log data, as well as the search results or recommended data associated with the input data corresponding to the search operation, etc., the demand data and result data with the same keywords are obtained.

[0162] Furthermore, when business data filtering is performed on input data corresponding to search operations and access operations, and search results (or recommended data) associated with input data corresponding to search operations, etc., keyword detection is performed on the input data and search results to obtain keywords corresponding to the input data and search results, and further filtering is performed based on the keywords to obtain demand data and result data with the same keywords, and determine them as data pairs to be filtered with the same keywords.

[0163] For example, if the input data corresponding to the search operation is "Red Braised Pork XXX", then when the input data is subjected to keyword detection processing, the keyword corresponding to the input data is obtained as "Red Braised Pork". Similarly, the search results associated with the input data corresponding to the search operation, etc. specifically include: "Different ways of cooking red braised pork", "Prices of red braised pork in different regions", and "Recommendations for delicious red braised pork restaurants", etc., and the keyword of these search results is also "Red Braised Pork". Then "Red Braised Pork XXX"-"Different ways of cooking red braised pork", "Red Braised Pork XXX"-"Prices of red braised pork in different regions", and "Red Braised Pork XXX"-"Recommendations for delicious red braised pork restaurants" can all be used as data pairs to be screened with the same keywords.

[0164] Step S602: Perform frequency statistics on the data pairs to be screened that have the same keywords to obtain the frequency of occurrence of each data pair to be screened.

[0165] Specifically, the frequency of occurrence of the data pairs to be screened with the same keywords, that is, the demand-result data pairs with the same keywords, is statistically processed, that is, the frequency of occurrence of each demand-result data pair with the same keyword is counted to obtain the frequency of occurrence of each demand-result data pair with the same keyword.

[0166] For instance, taking the keyword "braised pork" as an example, the data pairs to be screened with the same keyword include: "braised pork XXX"-"different ways of cooking braised pork", "braised pork XXX"-"prices of braised pork in different regions", and "braised pork XXX"-"recommendations of delicious braised pork restaurants", etc., and specifically, by performing statistical processing on the frequency of occurrence of each data pair, the corresponding frequencies of occurrence of the data pairs to be screened, namely, "braised pork XXX"-"different ways of cooking braised pork", "braised pork XXX"-"prices of braised pork in different regions", and "braised pork XXX"-"recommendations of delicious braised pork restaurants", are obtained.

[0167] Step S603, based on the occurrence frequency of the data pairs to be screened and the preset sample screening conditions, sample screening processing is performed on the data pairs to be screened with the same keywords to obtain matching data pair samples, which include mutually matching demand data samples and result data samples.

[0168] Specifically, the preset sample screening condition corresponds to a preset occurrence frequency threshold value, and the preset occurrence frequency threshold value corresponding to the preset sample screening condition is obtained, and the occurrence frequency of the to-be-screened data pairs with the same keyword is compared with the preset occurrence frequency threshold value.

[0169] Among them, if the occurrence frequency of the data pair to be screened (i.e., the demand-result data pair) is greater than the preset occurrence frequency threshold, it indicates that the occurrence frequency of the corresponding data pair to be screened meets the preset sample screening condition. On the contrary, if the occurrence frequency of the data pair to be screened (i.e., the demand-result data pair) is less than the preset occurrence frequency threshold, it indicates that the occurrence frequency of the corresponding data pair to be screened does not meet the preset sample screening condition. Further, the data pair to be screened whose occurrence frequency meets the preset sample screening condition is determined as a matching data pair sample.

[0170] For example, the demand-result data pair is the data pair to be screened, specifically "Query = 'Red Braised Pork'" - "Doc = 'How to Make Red Braised Pork'". For the demand data Query = 'Red Braised Pork' and the result data Doc = 'How to Make Red Braised Pork', the co-occurrence times of QD are counted, that is, the frequency of occurrence of the demand-result data pairs with the same keywords is counted, and it is determined whether the frequency of occurrence of the demand-result data pairs with the same keywords meets the preset sample screening conditions.

[0171] The preset frequency threshold corresponding to the preset sample screening condition may be 10 times, that is, by judging whether the number of QD co-occurrences is greater than 10 times, the frequency of occurrence of the demand-result data pair of the same keyword is determined to determine whether the preset sample screening condition is met. Specifically, if the number of QD co-occurrences is greater than 10 times, it indicates that the preset sample screening condition is met, and if the number of QD co-occurrences is less than 10 times, it indicates that the preset sample screening condition is not met.

[0172] Step S604: Based on the semantic coding layer of the initial matching model, determine the bilateral semantic vectors corresponding to each matching data pair sample, where the bilateral semantic vectors include a demand semantic vector and a result semantic vector.

[0173] Specifically, after obtaining the matching data pair sample, the semantic encoding layer of the initial matching model is used to perform semantic encoding processing on the matching data pair sample, thereby obtaining a bilateral semantic vector corresponding to the matching data pair sample. The bilateral semantic vector corresponding to the matching data pair sample specifically includes a demand semantic vector corresponding to the demand data sample and a result semantic vector corresponding to the result data sample.

[0174] The semantic encoding layer of the initial matching model may specifically be an LSTM network layer (i.e., Long Short Term Memory, long short-term memory recursive network), that is, the matching data samples are semantically encoded by utilizing the LSTM network layer.

[0175] Specifically, for the demand data samples and result data samples that match each other in the matching data pair samples, corresponding LSTM network layers are set for the demand data samples and the result data samples, respectively, including a first encoding layer corresponding to the demand data samples and a second encoding layer corresponding to the result data samples. Specifically, the demand data samples are semantically encoded by the first encoding layer, and the result data samples are semantically encoded by the second encoding layer, so as to obtain the demand semantic vector corresponding to the demand data samples and the result semantic vector corresponding to the result data samples.

[0176] For example, if the demand data sample is represented by "Query = braised pork in red sauce", the first encoding layer corresponding to the demand data sample is represented by "Query-encoder", and the demand semantic vector is represented by "Q_embedding". Similarly, the result data sample is represented by "Doc1 = the common method of braised pork in red sauce", the second encoding layer corresponding to the result data sample is represented by "Doc-encoder", and the result semantic vector is represented by "D_embedding".

[0177] Specifically, the first encoding layer, i.e., "Query-encoder", is used to perform semantic encoding processing on the demand data sample, i.e., "Query = braised pork in red", and the method of obtaining the demand semantic vector, i.e., "Q_embedding", is as follows: Q_embedding = LSTM (Query) = Query-encoder (braised pork in red). Similarly, the second encoding layer, i.e., "Doc-encoder", is used to perform semantic encoding processing on the result data sample, i.e., "Doc1 = the common method of braised pork in red", and the method of obtaining the result semantic vector, i.e., "D_embedding", is as follows: D_embedding = LSTM (Doc) = Doc-encoder (the common method of braised pork in red).

[0178] Step S605: The feature fusion layer of the initial matching model is a feature fusion space including multiple tensor matrices. According to each tensor matrix in the feature fusion space, feature fusion processing is performed on the demand semantic vector and the result semantic vector respectively to obtain sub-fusion feature vectors of multiple feature vector dimensions corresponding to the demand semantic vector and the result semantic vector.

[0179] Among them, the feature fusion layer of the initial matching model can be specifically understood as a feature fusion space including multiple tensor matrices, and each tensor matrix in the feature fusion space corresponds to a different feature vector dimension, and then the feature fusion layer is used to perform multi-core feature fusion processing on the bilateral semantic vectors, i.e., the demand semantic vector corresponding to the demand data sample, and the result semantic vector corresponding to the result data sample. Specifically, multiple tensor matrices are used to perform feature fusion processing on the demand semantic vector and the result semantic vector, respectively, so as to obtain a fused feature vector corresponding to the demand semantic vector and the result semantic vector.

[0180] Specifically, the feature fusion layer of the initial matching model is a feature fusion space including multiple tensor matrices, and each tensor matrix in the feature fusion space corresponds to a different feature vector dimension. Specifically, each tensor matrix in the feature fusion space is used to perform feature fusion processing on the demand semantic vector and the result semantic vector respectively to obtain sub-fusion feature vectors in multiple different feature vector dimensions corresponding to the demand semantic vector and the result semantic vector.

[0181] Among them, each sub-fusion feature vector corresponding to the demand semantic vector and the result semantic vector corresponds to a tensor matrix respectively, that is, when the demand semantic vector and the result semantic vector are subjected to feature fusion processing through each tensor matrix, the sub-fusion feature vector under the feature vector dimension of the corresponding tensor matrix is ​​obtained.

[0182] Step S606: Based on each sub-fusion feature vector, perform feature vector concatenation processing to obtain a fusion feature vector.

[0183] Specifically, the kernel matrix of each tensor matrix is ​​used to perform feature fusion on the demand semantic vector and the result semantic vector respectively, which includes feature fusion layers of k tensor matrices, that is, the matrix kernel of each tensor matrix is ​​used to perform feature fusion k times on the demand semantic vector and the result semantic vector respectively, that is, feature fusion of k different feature dimensions is performed to obtain k sub-fusion feature vectors, and the total fusion feature vector is obtained by concatenating the k sub-fusion feature vectors.

[0184] Step S607: Determine a semantic matching result corresponding to the fused feature vector based on the semantic matching layer of the initial matching model.

[0185] Specifically, based on the semantic matching layer of the initial matching model, the fused feature vector is semantically matched to obtain a semantic matching result corresponding to the fused feature vector. The semantic matching result corresponding to the fused feature vector obtained by the semantic matching layer includes a semantic match and a semantic mismatch result.

[0186] Furthermore, the semantic matching layer of the initial matching model can be understood as a classifier, which is used to classify the fused feature vector into different categories of semantic matching and semantic mismatch. Specifically, the semantic matching layer of the initial matching model can be a classifier for implementing binary classification, that is, the fused feature vector is classified into two categories of semantic matching and semantic mismatch through the classifier.

[0187] Among them, in the binary classification process, the semantic matching category is set to 1, and the semantic mismatch category is set to 0. Then, according to the classifier, when the fused feature vector is divided into the two categories of semantic matching and semantic mismatch, it is specifically determined whether it can be classified into the semantic matching category based on the predicted probability that the output result of the classifier is 1.

[0188] Specifically, if the output result of the classifier classifier is a prediction probability of 1, which is greater than the preset prediction probability threshold, it indicates that the fused feature vector can be classified into a semantically matching category. If the output result of the classifier classifier is a prediction probability of 1, which is less than the preset prediction probability threshold, it indicates that the fused feature vector is classified into a semantically mismatching category.

[0189] Step S608, obtaining the actual label corresponding to the matching data pair sample, and determining the model training loss function corresponding to the initial matching model based on the semantic matching result and the actual label of the matching data pair sample.

[0190] Specifically, by obtaining the actual labels corresponding to the samples of the filtered matching data pairs, that is, obtaining the annotated labels corresponding to the mutually matching demand data samples and result data samples, such as "Label1=1", and obtaining the semantic matching results, that is, the semantic matching between the demand data samples and the result data samples, and the semantic mismatch between the demand data samples and the result data samples.

[0191] Furthermore, according to the category of the semantic matching results (including the category of semantic matching and the category of semantic mismatch) and the category to which the matching data pair samples belong represented by the actual labels of the matching data pair samples, the model training loss function corresponding to the initial matching model is determined.

[0192] Step S609, if it is determined that the model training loss function meets the model training end condition, a trained semantic matching model is obtained, and the semantic matching model is used to determine the target result data that matches the current demand data based on the semantic matching result.

[0193] Specifically, if the model training loss function meets the model training end condition, the initial matching model at the end of the model training is determined as the trained semantic matching model. On the contrary, if the model training loss function does not meet the model training end condition, the initial matching model is iteratively trained until the model training end condition is met to obtain the trained semantic matching model.

[0194] The model training end condition may specifically be that the model training loss function value reaches a preset loss threshold, that is, by comparing the preset loss threshold corresponding to the model training end condition with the model training loss function value, if it is determined that the model training loss function value reaches the preset loss threshold, it indicates that the model training end condition is met, and if the model training loss function value does not reach the preset loss threshold, it indicates that the model training end condition is not met. The preset loss threshold can be adjusted and set according to actual business needs, and is not limited to a specific value.

[0195] In one embodiment, the model training termination condition may also be that the number of iterative training times for the initial matching model reaches a preset number threshold, that is, when it is determined that the number of training times reaches a preset number threshold during the process of training the initial matching model with samples using matching data, it indicates that the model training termination condition is met.

[0196] In the method for constructing the above-mentioned semantic matching model, by obtaining matching data pair samples including mutually matching demand data samples and result data samples, based on the semantic encoding layer of the initial matching model, the bilateral semantic vectors corresponding to each matching data pair sample are determined, and according to the feature fusion layer of the initial matching model, the multi-core feature fusion processing is performed on each bilateral semantic vector to obtain the fused feature vector, thereby realizing the multi-layer feature fusion processing of the demand and result bilateral semantic vectors, further improving the feature fusion effect between the demand and result sides, and strengthening the information interaction between the demand and result sides. Further, based on the semantic matching layer of the initial matching model, the semantic matching result corresponding to the fused feature vector is determined, and if it is determined that the model training end condition is met according to the semantic matching result and the matching data pair sample, a trained semantic matching model is obtained to determine the target result data matching the current demand data through the semantic matching model. Since there is no need to pre-mine the matching features between a large amount of demand data and result data, but semantic encoding and feature fusion are performed on the selected matching data pair samples, the tedious operations in the model construction process are reduced, the model construction efficiency is improved, and at the same time, the processing efficiency of the semantic matching model based on the multi-core feature fusion processing for semantic matching is improved.

[0197] In one embodiment, Figure 7 As shown, a data matching processing method is provided, which is applied to Figure 1The server in the example is used to illustrate the following steps:

[0198] Step S702: receiving a data matching request and acquiring current required data corresponding to the data matching request.

[0199] Specifically, if a data matching request triggered by a usage object is detected, that is, if a search operation triggered by a usage object based on an application platform (or application, or website) is detected, the input data corresponding to the search operation is obtained, that is, the current demand data corresponding to the data matching request is obtained.

[0200] Among them, the input data corresponding to the search operation can specifically be query data input by the user based on the application platform, and can include query data for different businesses and products, such as "how to make braised pork", "when will the XX music festival be held", "where to buy XX products", "what are the special foods in the XX area", etc., and can be query data involving products and businesses in different fields such as entertainment, finance, commerce, and life.

[0201] Step S704, based on the trained semantic matching model, determine and display the target result data matching the current demand data. The trained semantic matching model includes a semantic encoding layer, a feature fusion layer and a semantic matching layer. The semantic encoding layer is used to determine the demand semantic vector corresponding to the current demand data and the result semantic vector corresponding to each candidate result data. The feature fusion layer is used to perform multi-core feature fusion processing on each demand semantic vector and the result semantic vector to obtain a fused feature vector. The semantic matching layer is used to determine the semantic matching result corresponding to the fused feature vector, and determine the target result data matching the current demand data based on the semantic matching result.

[0202] Specifically, by using the trained semantic matching model, semantic encoding processing is performed on the current demand data and each candidate result data to obtain a demand semantic vector corresponding to the current demand data and a result semantic vector corresponding to each candidate result data, and further multi-core feature fusion processing is performed on the demand semantic vector and the result semantic vector to obtain a fused feature vector, so as to determine the semantic matching result corresponding to the fused feature vector, and finally the target result data matching the current demand data can be determined based on the semantic matching result.

[0203] Among them, the semantic coding layer of the semantic matching model is used to perform semantic coding processing on the current demand data and each candidate result data to obtain the demand semantic vector corresponding to the current demand data and the result semantic vector corresponding to each candidate result data. Among them, the candidate result data can be understood as multiple candidate results associated with the current demand data. It is necessary to determine the target result data with the highest matching degree (or the greatest correlation) with the current demand data from the multiple candidate results according to the semantic matching model.

[0204] Furthermore, the semantic encoding layer can specifically be an LSTM network layer (i.e., Long Short Term Memory, long short-term memory recursive network), that is, by utilizing the LSTM network layer, including a first encoding layer corresponding to the demand data, and a second encoding layer corresponding to the candidate result data, semantic encoding processing is performed on the current demand data and each candidate result data respectively, so as to obtain a demand semantic vector corresponding to the demand data, and a result semantic vector corresponding to the candidate result data.

[0205] Among them, the feature fusion layer of the semantic matching model is used to perform multi-core feature fusion processing on each requirement semantic vector and the result semantic vector to obtain a fused feature vector.

[0206] Specifically, the feature fusion layer can be understood as a feature fusion space including multiple tensor matrices, and each tensor matrix in the feature fusion space corresponds to a different feature vector dimension. Then, the feature fusion layer is used to perform multi-core feature fusion processing on the demand semantic vector corresponding to the demand data and the result semantic vector corresponding to the candidate result data. Specifically, multiple tensor matrices are used to perform feature fusion processing on the demand semantic vector and the result semantic vector, respectively, so as to obtain a fused feature vector corresponding to the demand semantic vector and the result semantic vector.

[0207] Further, according to the feature fusion layer, that is, using each tensor matrix in the feature fusion space, feature fusion processing is performed on the demand semantic vector and the result semantic vector respectively to obtain multiple sub-fusion feature vectors. Further, based on each sub-fusion feature vector corresponding to the demand semantic vector and the result semantic vector, feature vector splicing processing is performed to obtain a fusion feature vector.

[0208] The semantic matching layer of the semantic matching model is used to determine the semantic matching result corresponding to the fused feature vector, and determine the target result data matching the current demand data according to the semantic matching result. The semantic matching result corresponding to the fused feature vector obtained by the semantic matching layer includes semantic matching and semantic mismatching results.

[0209] Specifically, the semantic matching layer can be understood as a classifier, which is used to classify the fused feature vector into different categories of semantic matching and semantic mismatch. Specifically, the semantic matching layer can be a classifier for implementing binary classification, that is, the fused feature vector is classified into two categories of semantic matching and semantic mismatch through the classifier.

[0210] Among them, in the binary classification process, the category of semantic matching is set to 1, and the category of semantic mismatch is set to 0. Then, according to the classifier, when the fused feature vector is divided into the two categories of semantic matching and semantic mismatch, it is specifically determined whether it can be divided into the category of semantic matching based on the predicted probability of 1 when the output result of the classifier is 1. It can be understood that if the predicted probability of 1 when the output result of the classifier is 1 is greater than the preset predicted probability threshold, it indicates that the fused feature vector can be divided into the category of semantic matching, and if the predicted probability of 1 when the output result of the classifier is 1 is less than the preset predicted probability threshold, it indicates that the fused feature vector is divided into the category of semantic mismatch.

[0211] Furthermore, when determining the target result data matching the current demand data according to the semantic matching result, specifically, the candidate result data whose semantic matching result belongs to the category of semantic matching is determined as the target result data matching the current demand data.

[0212] For example, if the current demand data corresponding to the data matching request is "braised pork XXX", the candidate result data associated with the current input data "braised pork XXX" may specifically include "different ways of cooking braised pork", "prices of braised pork in different regions", and "recommendations for delicious braised pork restaurants", etc., and then by utilizing the trained semantic matching model, the target result data with the highest match (or the greatest correlation) with the current demand data is determined from multiple candidate results, such as the determined target result data "different ways of cooking braised pork".

[0213] Specifically, the semantic matching results between the current demand data and each candidate result data can be determined, and based on the semantic matching results (including semantic matching and semantic mismatching results), the candidate result data corresponding to the semantic matching category can be determined as the target result data that matches the current demand data.

[0214] In one embodiment, Figure 8 As shown, a process of performing data matching based on current demand data to obtain target result data is provided. If a search operation is detected to be triggered based on a certain application platform, input data corresponding to the search operation is obtained, and data matching processing is performed based on the input data to obtain candidate result data that matches the current input data (i.e., current demand data), and from each candidate result data, the candidate result data corresponding to the category whose semantic matching result is a semantic match is determined as the target result data that matches the current demand data.

[0215] Specifically, refer to Figure 8It can be seen that if the input data detected is "Query = Braised Pork XXX", then by further screening and matching the candidate result data that can be provided by the application platform, the following can be obtained: Figure 8 The target result data shown in the table include "How to make braised pork in a healthy kitchen", "A complete list of braised pork recipes", "Sharing with everyone the authentic method of making braised pork without adding water or salt", "The braised pork at XX restaurant that you never get tired of", and "A wonderful way to eat braised pork with rice".

[0216] Among them, for each determined target result data, each target result data can be sorted and then displayed according to different angles such as the relevance of keywords, publication channels, click volume, and collection volume.

[0217] For example, when re-sorting the target result data information according to the degree of relevance of keywords, for example, in the current demand data, i.e., "Query=Red Braised Pork XXX", in addition to "Red Braised Pork", it also includes keywords such as "production method" and "recipe". Then, when sorting the target result data according to keywords, the display order of target result data related to production or recipes, such as "Red Braised Pork Production in a Healthy Kitchen", "Red Braised Pork Recipe Collection", "Authentic Red Braised Pork Production Method without Adding Water or Salt Shared with Everyone", etc., can be adjusted forward, and the display order of target result data such as "XX Restaurant's Never Tiresome Red Braised Pork" and "Amazing Ways to Eat Red Braised Pork with Rice" can be adjusted backward.

[0218] For example, when re-sorting the target result data information based on the number of clicks or collections of each target result data, the number of clicks or collections of each target result data is counted and sorted from large to small to obtain a sorted target result data sequence. When displaying on the platform or program, it is displayed according to the sorted target result sequence.

[0219] In the above data matching processing method, by receiving a data matching request, the current demand data corresponding to the data matching request is obtained, and the demand semantic vector corresponding to the current demand data and the result semantic vector corresponding to each candidate result data are determined through the semantic encoding layer of the trained semantic matching model, and the multi-core feature fusion processing is performed on each demand semantic vector and the result semantic vector through the feature fusion layer of the trained semantic matching model to obtain a fused feature vector. Furthermore, the semantic matching result corresponding to the fused feature vector is determined through the semantic matching layer of the trained semantic matching model, and the target result data matching the current demand data is determined based on the semantic matching result for display, thereby improving the accuracy of the obtained target result data, realizing accurate data feedback and recommendation, and further improving the positive benefits of the platform or application.

[0220] In one embodiment, a data matching processing method is provided, which specifically includes the following steps:

[0221] Based on the business query log data, business data filtering is performed to obtain demand data and result data with the same keywords, and data pairs to be filtered with the same keywords are determined.

[0222] For the data pairs to be screened with the same keywords, the occurrence frequency statistics processing is performed to obtain the occurrence frequency of each data pair to be screened.

[0223] According to the occurrence frequency of the data pairs to be screened and the preset sample screening conditions, sample screening processing is performed on the data pairs to be screened with the same keywords to obtain matching data pair samples, which include mutually matching demand data samples and result data samples.

[0224] Based on the semantic encoding layer of the initial matching model, a bilateral semantic vector corresponding to each matching data pair sample is determined, and the bilateral semantic vector includes a demand semantic vector and a result semantic vector.

[0225] The feature fusion layer of the initial matching model is a feature fusion space including multiple tensor matrices. According to each tensor matrix in the feature fusion space, feature fusion processing is performed on the demand semantic vector and the result semantic vector respectively to obtain sub-fusion feature vectors of multiple feature vector dimensions corresponding to the demand semantic vector and the result semantic vector.

[0226] Based on each sub-fusion feature vector, feature vector splicing processing is performed to obtain a fusion feature vector.

[0227] Based on the semantic matching layer of the initial matching model, a semantic matching result corresponding to the fused feature vector is determined.

[0228] The actual labels corresponding to the matching data pair samples are obtained, and based on the semantic matching results and the actual labels of the matching data pair samples, a model training loss function corresponding to the initial matching model is determined.

[0229] If it is determined that the model training loss function meets the model training end condition, a trained semantic matching model is obtained.

[0230] Receive a data matching request and obtain the current required data corresponding to the data matching request.

[0231] According to the semantic coding layer of the trained semantic matching model, semantic coding is performed on the current demand data and each candidate result data to obtain a demand semantic vector corresponding to the current demand data and a result semantic vector corresponding to each candidate result data.

[0232] According to the feature fusion layer of the trained semantic matching model, multi-core feature fusion processing is performed on each demand semantic vector and result semantic vector to obtain a fused feature vector.

[0233] According to the semantic matching layer of the semantic matching model, a semantic matching result corresponding to the fused feature vector is determined, and target result data matching the current demand data is determined according to the semantic matching result.

[0234] The above-mentioned data matching processing method obtains matching data pair samples including mutually matching demand data samples and result data samples, determines the bilateral semantic vectors corresponding to each matching data pair sample based on the semantic encoding layer of the initial matching model, and performs multi-core feature fusion processing on each bilateral semantic vector according to the feature fusion layer of the initial matching model to obtain a fused feature vector, thereby realizing multi-layer feature fusion processing of the demand and result bilateral semantic vectors, further improving the feature fusion effect between the demand and result sides, and strengthening the information interaction between the demand and result sides. Furthermore, based on the semantic matching layer of the initial matching model, the semantic matching result corresponding to the fused feature vector is determined, and if it is determined that the model training end condition is met based on the semantic matching result and the matching data pair sample, a trained semantic matching model is obtained. Since there is no need to pre-mine a large amount of matching features between the demand data and the result data, but semantic encoding and feature fusion are performed based on the selected matching data pair samples, the tedious operations in the model construction process are reduced, and the model construction efficiency is improved. Furthermore, through the semantic encoding layer of the trained semantic matching model, the demand semantic vector corresponding to the current demand data and the result semantic vector corresponding to each candidate result data are determined, and through the feature fusion layer of the trained semantic matching model, multi-core feature fusion processing is performed on each demand semantic vector and result semantic vector to obtain a fused feature vector, and through the semantic matching layer of the trained semantic matching model, the semantic matching result corresponding to the fused feature vector is determined, and based on the semantic matching result, the target result data matching the current demand data is determined for display, thereby improving the accuracy of the obtained target result data, realizing accurate data feedback and recommendation, and further enhancing the positive benefits of the platform or application.

[0235] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0236] Based on the same inventive concept, the embodiment of the present application also provides a semantic matching model construction method and a semantic matching model construction device and a data matching processing device for implementing the above-mentioned semantic matching model construction method and data matching processing method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in the embodiments of the one or more semantic matching model construction devices and data matching processing devices provided below can be referred to the limitations of the semantic matching model construction method and data matching processing method in the above text, and will not be repeated here.

[0237] In one embodiment, Fig. 9 As shown, a device for constructing a semantic matching model is provided, including: a bilateral semantic vector determination module 902, a fusion feature vector acquisition module 904, a semantic matching result determination module 906 and a semantic matching model acquisition module 908, wherein:

[0238] A bilateral semantic vector determination module 902 is used to obtain matching data pair samples and determine the bilateral semantic vectors corresponding to each matching data pair sample based on the semantic coding layer of the initial matching model, where the matching data pair samples include mutually matching requirement data samples and result data samples;

[0239] A fused feature vector obtaining module 904 is used to perform multi-core feature fusion processing on each bilateral semantic vector according to the feature fusion layer of the initial matching model to obtain a fused feature vector;

[0240] A semantic matching result determination module 906, configured to determine a semantic matching result corresponding to the fused feature vector based on the semantic matching layer of the initial matching model;

[0241] The semantic matching model acquisition module 908 is used to obtain a trained semantic matching model if the model training end conditions are determined based on the semantic matching results and the matching data pair samples; the semantic matching model is used to determine the target result data that matches the current demand data based on the semantic matching results.

[0242] In the device for constructing the above-mentioned semantic matching model, by obtaining matching data pair samples including mutually matching demand data samples and result data samples, based on the semantic encoding layer of the initial matching model, the bilateral semantic vectors corresponding to each matching data pair sample are determined, and according to the feature fusion layer of the initial matching model, the multi-core feature fusion processing is performed on each bilateral semantic vector to obtain the fused feature vector, thereby realizing the multi-layer feature fusion processing of the demand and result bilateral semantic vectors, further improving the feature fusion effect between the demand and result sides, and strengthening the information interaction between the demand and result sides. Further, based on the semantic matching layer of the initial matching model, the semantic matching result corresponding to the fused feature vector is determined, and if it is determined that the model training end condition is met according to the semantic matching result and the matching data pair sample, a trained semantic matching model is obtained to determine the target result data matching the current demand data through the semantic matching model. Since there is no need to pre-mine the matching features between a large amount of demand data and result data, but semantic encoding and feature fusion are performed on the selected matching data pair samples, the tedious operations in the model construction process are reduced, the model construction efficiency is improved, and at the same time, the processing efficiency of the semantic matching model based on the multi-core feature fusion processing for semantic matching is improved.

[0243] In one embodiment, the bilateral semantic vector determination module is also used to: perform business data filtering processing based on business query log data to obtain demand data and result data with the same keywords, and determine them as data pairs to be screened with the same keywords; perform frequency of occurrence statistical processing on the data pairs to be screened with the same keywords to obtain the frequency of occurrence of each data pair to be screened; perform sample screening processing on the data pairs to be screened with the same keywords according to the frequency of occurrence of the data pairs to be screened and preset sample screening conditions to obtain matching data pair samples.

[0244] In one embodiment, the bilateral semantic vector includes a demand semantic vector and a result semantic vector; the fused feature vector acquisition module is further used to: perform multi-core feature fusion processing on the demand semantic vector and the result semantic vector according to the feature fusion layer of the initial matching model to obtain multiple sub-fused feature vectors; based on each sub-fused feature vector, perform feature vector splicing processing to obtain a fused feature vector.

[0245] In one embodiment, the feature fusion layer is a feature fusion space including multiple tensor matrices, each tensor matrix corresponds to a different feature vector dimension; the fused feature vector acquisition module is also used to: perform feature fusion processing on the demand semantic vector and the result semantic vector according to each tensor matrix in the feature fusion space, and obtain sub-fused feature vectors of multiple different feature vector dimensions corresponding to the demand semantic vector and the result semantic vector; wherein each sub-fused feature vector of the demand semantic vector and the result semantic vector corresponds to a tensor matrix respectively.

[0246] In one embodiment, the semantic matching model acquisition module is also used to: obtain the actual labels corresponding to the matching data pair samples; determine the model training loss function corresponding to the initial matching model based on the semantic matching results and the actual labels of the matching data pair samples; if it is determined that the model training loss function meets the model training end conditions, obtain the trained semantic matching model.

[0247] In one embodiment, Fig.10 As shown, a data matching processing device is provided, comprising:

[0248] The current demand data acquisition module 1002 is used to receive a data matching request and acquire the current demand data corresponding to the data matching request;

[0249] The target result data determination module 1004 is used to determine and display the target result data matching the current demand data based on the trained semantic matching model. The trained semantic matching model includes a semantic encoding layer, a feature fusion layer and a semantic matching layer; the semantic encoding layer is used to determine the demand semantic vector corresponding to the current demand data, and the result semantic vector corresponding to each candidate result data; the feature fusion layer is used to perform multi-core feature fusion processing on each demand semantic vector and the result semantic vector to obtain a fused feature vector; the semantic matching layer is used to determine the semantic matching result corresponding to the fused feature vector, and determine the target result data matching the current demand data based on the semantic matching result.

[0250] In the above-mentioned data matching processing device, by receiving a data matching request, the current demand data corresponding to the data matching request is obtained, and the demand semantic vector corresponding to the current demand data and the result semantic vector corresponding to each candidate result data are determined through the semantic encoding layer of the trained semantic matching model, and the multi-core feature fusion processing is performed on each demand semantic vector and the result semantic vector through the feature fusion layer of the trained semantic matching model to obtain a fused feature vector. Furthermore, the semantic matching result corresponding to the fused feature vector is determined through the semantic matching layer of the trained semantic matching model, and the target result data matching the current demand data is determined based on the semantic matching result for display, thereby improving the accuracy of the obtained target result data, realizing accurate data feedback and recommendation, and further improving the positive benefits of the platform or application.

[0251] Each module in the above-mentioned semantic matching model construction device and data matching processing device can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0252] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.11 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store matching data pair samples, bilateral semantic vectors corresponding to the matching data pair samples, fused feature vectors, semantic matching results, trained semantic matching models, current demand data corresponding to data matching requests, target result data matching the current demand data and other data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for constructing a semantic matching model and a data matching processing method are implemented.

[0253] Those skilled in the art will understand that Fig.11The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0254] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0255] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0256] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0257] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0258] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0259] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0260] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for constructing a semantic matching model. It is characterized in that The method comprises: Acquire matching data pair samples, and determine the bilateral semantic vectors corresponding to each matching data pair sample based on the semantic coding layer of the initial matching model; the matching data pair samples include mutually matching requirement data samples and result data samples; According to the feature fusion layer of the initial matching model, multi-core feature fusion processing is performed on each of the bilateral semantic vectors to obtain a fused feature vector; Determining a semantic matching result corresponding to the fused feature vector based on the semantic matching layer of the initial matching model; If the model training end conditions are determined to be met based on the semantic matching results and the matching data pair samples, a trained semantic matching model is obtained; the semantic matching model is used to determine the target result data that matches the current demand data based on the semantic matching results.

2. The method according to claim 1, It is characterized in that Get a sample of matching data pairs, including: Based on the business query log data, business data filtering is performed to obtain the demand data and result data with the same keywords, and the data pairs to be screened with the same keywords are determined; For the data pairs to be screened with the same keyword, the occurrence frequency statistics processing is performed to obtain the occurrence frequency of each data pair to be screened; According to the occurrence frequency of the data pairs to be screened and the preset sample screening conditions, sample screening processing is performed on the data pairs to be screened with the same keywords to obtain matching data pair samples.

3. The method according to claim 1, It is characterized in that The bilateral semantic vectors include a demand semantic vector and a result semantic vector; the feature fusion layer according to the initial matching model performs multi-core feature fusion processing on each of the bilateral semantic vectors to obtain a fused feature vector, including: According to the feature fusion layer of the initial matching model, multi-core feature fusion processing is performed on the demand semantic vector and the result semantic vector to obtain multiple sub-fusion feature vectors; Based on each of the sub-fusion feature vectors, feature vector splicing processing is performed to obtain a fusion feature vector.

4. The method according to claim 3, It is characterized in that The feature fusion layer is a feature fusion space including a plurality of tensor matrices, each of which corresponds to a different feature vector dimension; the feature fusion layer according to the initial matching model performs multi-core feature fusion processing on the demand semantic vector and the result semantic vector to obtain a plurality of sub-fusion feature vectors, including: According to each of the tensor matrices in the feature fusion space, feature fusion processing is performed on the requirement semantic vector and the result semantic vector respectively to obtain sub-fusion feature vectors of multiple different feature vector dimensions corresponding to the requirement semantic vector and the result semantic vector; wherein each of the sub-fusion feature vectors of the requirement semantic vector and the result semantic vector corresponds to a tensor matrix respectively.

5. The method according to any one of claims 1 to 4, It is characterized in that If it is determined that the model training end condition is met according to the semantic matching result and the matching data pair sample, a trained semantic matching model is obtained, including: Obtaining actual labels corresponding to the matching data pair samples; Determine a model training loss function corresponding to the initial matching model based on the semantic matching result and the actual label of the matching data pair sample; If it is determined that the model training loss function meets the model training end condition, a trained semantic matching model is obtained.

6. A data matching processing method, It is characterized in that The method comprises: Receive a data matching request and obtain current demand data corresponding to the data matching request; Based on the trained semantic matching model, determine and display the target result data matching the current demand data; Among them, the trained semantic matching model includes a semantic encoding layer, a feature fusion layer and a semantic matching layer; the semantic encoding layer is used to determine the demand semantic vector corresponding to the current demand data, and the result semantic vector corresponding to each candidate result data; the feature fusion layer is used to perform multi-core feature fusion processing on each demand semantic vector and result semantic vector to obtain a fused feature vector; the semantic matching layer is used to determine the semantic matching result corresponding to the fused feature vector, and determine the target result data matching the current demand data based on the semantic matching result.

7. A device for constructing a semantic matching model, It is characterized in that The device comprises: A bilateral semantic vector determination module is used to obtain matching data pair samples and determine the bilateral semantic vectors corresponding to each matching data pair sample based on the semantic coding layer of the initial matching model; the matching data pair samples include mutually matching demand data samples and result data samples; A fused feature vector obtaining module, used to perform multi-core feature fusion processing on each of the bilateral semantic vectors according to the feature fusion layer of the initial matching model to obtain a fused feature vector; A semantic matching result determination module, used to determine a semantic matching result corresponding to the fused feature vector based on the semantic matching layer of the initial matching model; The semantic matching model acquisition module is used to obtain a trained semantic matching model if it is determined that the model training end conditions are met based on the semantic matching results and the matching data pair samples; the semantic matching model is used to determine the target result data that matches the current demand data based on the semantic matching results.

8. A data matching processing device, It is characterized in that The device comprises: A current demand data acquisition module, used to receive a data matching request and acquire current demand data corresponding to the data matching request; A target result data determination module is used to determine and display the target result data matching the current demand data based on a trained semantic matching model; wherein the trained semantic matching model includes a semantic encoding layer, a feature fusion layer and a semantic matching layer; the semantic encoding layer is used to determine the demand semantic vector corresponding to the current demand data, and the result semantic vector corresponding to each candidate result data; the feature fusion layer is used to perform multi-core feature fusion processing on each demand semantic vector and the result semantic vector to obtain a fused feature vector; the semantic matching layer is used to determine the semantic matching result corresponding to the fused feature vector, and determine the target result data matching the current demand data based on the semantic matching result.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

11. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.