Object matching method, model training method, product matching method and storage medium

By combining adversarial training and contrastive learning, the pre-trained model is improved, which enhances the anti-interference ability and positive and negative sample discrimination ability of the semantic matching model, solves the problem of low semantic matching accuracy in the existing technology, and achieves higher recognition accuracy.

CN114860874BActive Publication Date: 2025-09-12ALIBABA (CHENGDU) SOFTWARE & TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210435314.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-24
Publication Date
2025-09-12
Estimated Expiration
2042-04-24

AI Technical Summary

Technical Problem

Existing Transformer-based pre-trained models cannot effectively identify subtle semantic differences when processing search text in the form of incomplete sentences input by users, resulting in inaccurate matching results.

Method used

By combining adversarial training and contrastive learning on the pre-trained model, using the first matching results of the training samples and the second matching results of the adversarial samples, neurons are discarded with different dropout rates to generate a semantic matching model, thereby improving the model's anti-interference ability for keyword-stacked text and its ability to distinguish between positive and negative samples.

Benefits of technology

The semantic matching model's ability to recognize subtle semantics and its robustness are improved, the model's recognition accuracy is improved, and the problem of low semantic matching accuracy in existing technologies is solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114860874B_ABST
    Figure CN114860874B_ABST
Patent Text Reader

Abstract

The present application discloses an object matching method, a model training method, a product matching method and a storage medium. Among them, the method includes: obtaining an object search request and description information of a target object; performing semantic matching on multiple retrieval keywords and description information using a semantic matching model to obtain a target matching result between the object search request and the target object. In the process of model training, the present application uses adversarial training to improve the model's anti-interference ability to redundant information of keyword stacked text. Moreover, in the process of adversarial training, contrastive learning is integrated to enhance the model's distinction between positive and negative samples, thereby improving the representation ability of the object search request and the description information of the target object, thereby achieving the goal of improving the semantic matching model's recognition ability for subtle semantics and improving robustness, thereby achieving the technical effect of improving the model's recognition accuracy, and solving the technical problem of low recognition accuracy of the semantic matching model in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of semantic recognition, and specifically, to an object matching method, a model training method, a product matching method, and a storage medium. Background Art

[0002] Semantic matching is an important part of the search field. It can ensure that each user's search results are relevant to the search text entered by the user. In order to achieve a better user search experience, a pre-trained model based on Transformer (Transformer is a model based on the attention mechanism) is usually used for semantic matching.

[0003] However, Transformer-based pre-trained models are typically trained on large-scale, general predictions and are not well suited for scenarios requiring subtle semantic differences. For example, in an online shopping scenario, if a user enters the search text "300ml fitness water cup," the search results will prioritize water cups of various capacities, regardless of whether the cup is 300ml. Furthermore, user search text is often not a complete sentence, but rather a combination of keywords. Variations in word order can cause the model to mismatch results.

[0004] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention

[0005] The embodiments of the present application provide an object matching method, a model training method, a product matching method and a storage medium to at least solve the technical problem of low semantic matching accuracy in related technologies.

[0006] According to one aspect of an embodiment of the present application, an object matching method is provided, including: obtaining an object search request and description information of a target object, wherein the object search request is generated by superimposing multiple retrieval keywords; using a semantic matching model to perform semantic matching on the multiple retrieval keywords and the description information to obtain a target matching result between the object search request and the target object, wherein the semantic matching model is obtained by training a pre-trained model through a first matching result of a training sample and a second matching result of an adversarial sample, the adversarial sample is generated by superimposing noise data on the training sample, the first matching result is obtained by processing the training sample with the first matching model, the second matching result is obtained by processing the adversarial sample with the second matching model, and the first matching model and the second matching model are respectively obtained by discarding some neurons in the pre-trained model using two different discard rates.

[0007] According to another aspect of an embodiment of the present application, an object matching method is also provided, including: a cloud server receives an object search request sent by a client, wherein the object search request is generated by superimposing multiple retrieval keywords; the cloud server obtains description information of the target object based on the object search request; the cloud server uses a semantic matching model to perform semantic matching on multiple retrieval keywords and description information to obtain a target matching result between the object search request and the target object, wherein the semantic matching model is obtained by training a pre-trained model through a first matching result of a training sample and a second matching result of an adversarial sample, the adversarial sample is generated by superimposing noise data on the training sample, the first matching result is obtained by processing the training sample through the first matching model, the second matching result is obtained by processing the adversarial sample through the second matching model, and the first matching model and the second matching model respectively use two different discard rates to discard some neurons in the pre-trained model; the cloud server outputs the target matching result to the client.

[0008] According to another aspect of an embodiment of the present application, a product matching method is also provided, including: obtaining a product search request and title information of a target product, wherein the product search request is generated by superimposing multiple retrieval keywords; using a semantic matching model to perform semantic matching on the multiple retrieval keywords and title information to obtain a target matching result between the product search request and the target product, wherein the semantic matching model is obtained by training a pre-trained model through the first matching result of the training sample and the second matching result of the adversarial sample, the adversarial sample is generated by superimposing noise data on the training sample, the first matching result is obtained by processing the training sample through the first matching model, and the second matching result is obtained by processing the adversarial sample through the second matching model, and the first matching model and the second matching model are respectively obtained by discarding some neurons in the pre-trained model using two different discard rates.

[0009] According to another aspect of an embodiment of the present application, a model training method is also provided, including: obtaining training samples, wherein the training samples include: a search request sample generated by superimposing multiple keywords, a description sample of a target object, and a preset matching result between the search request sample and the target object; superimposing noise data on the training samples to generate an adversarial sample; using two different discard rates to discard part of the neurons in the pre-trained model to obtain a first matching model and a second matching model; using the first matching model to process the training sample to obtain a first matching result, and using the second matching model to process the adversarial sample to obtain a second matching result; training the pre-trained model based on the first matching result, the second matching result and the preset matching result to obtain a semantic matching model.

[0010] According to another aspect of an embodiment of the present application, a storage medium is also provided, which includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute any one of the object matching methods, product matching methods, or model training methods in the above embodiments.

[0011] According to another aspect of an embodiment of the present application, a computer terminal is also provided, comprising: a memory and a processor, the processor being configured to run a program stored in the memory, wherein when the program is run, the object matching method, product matching method, or model training method of any one of the above claims is executed.

[0012] The solution provided in the above-mentioned embodiment of the present application is used to obtain an object search request and description information of the target object, wherein the object search request is generated by superimposing multiple search keywords; a semantic matching model is used to perform semantic matching on the multiple search keywords and description information to obtain a target matching result between the object search request and the target object, thereby achieving the purpose of semantic matching. It is easy to notice that since the semantic model is obtained by training the pre-trained model through the first matching result of the training sample and the second matching result of the adversarial sample, and the adversarial sample is generated by superimposing noise data on the training sample, the adversarial training is used in the model training process to improve the model's anti-interference ability to redundant information of keyword stacking text. Moreover, since the first matching result is obtained by processing the training sample by the first matching model, and the second matching result is obtained by processing the adversarial sample by the second matching model, the first matching model and the second matching model respectively use two different dropout rates to discard part of the neurons in the pre-trained model. Therefore, in the process of adversarial training, the contrastive learning enhancement model is integrated to distinguish between positive and negative samples, and the representation ability of the object search request and the descriptive information of the target object is improved, thereby achieving the technical effect of improving the semantic matching model's recognition ability of subtle semantics and improving robustness, thereby achieving the technical effect of improving the model recognition accuracy, and solving the technical problem of low recognition accuracy of the semantic matching model in the existing technology. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0014] Figure 1 It is a hardware structure block diagram of a computer terminal (or mobile device) for an object matching method according to the prior art;

[0015] Figure 2 is a flow chart of an object matching method according to an embodiment of the present application;

[0016] Figure 3 is a flow chart of an object matching method according to another embodiment of the present application;

[0017] Figure 4A This is a schematic diagram of adversarial training according to an embodiment of the present application.

[0018] Figure 4B is a schematic diagram of comparative learning according to an embodiment of the present application;

[0019] Figure 5 is a flowchart of the object matching method according to Example 2 of the present application;

[0020] Figure 6 is a flow chart of the product matching method according to Example 3 of the present application;

[0021] Figure 7 is a flow chart of the model training method according to Example 4 of the present application;

[0022] Figure 8 is a schematic structural diagram of an object matching device according to Example 5 of the present application;

[0023] Figure 9 is a structural diagram of an object matching device according to Example 6 of the present application;

[0024] Figure 10 is a structural diagram of a product matching device according to Example 7 of the present application;

[0025] Figure 11 is a structural diagram of a model training device according to Example 8 of the present application;

[0026] Figure 12 This is a structural block diagram of a computer terminal according to an embodiment of the present application. DETAILED DESCRIPTION

[0027] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.

[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0029] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following interpretations:

[0030] Pre-trained models: These can be deep semantic models based on the Transformer architecture. Pre-trained using large-scale corpora and text self-supervision, they accurately model text semantics. Fine-tuning on downstream tasks can then yield excellent results for classification and ranking. Common open-source pre-trained models include BERT, RoBERT, and DeBERT.

[0031] NER (Named Entity Recognition) is an important foundational tool in natural language processing. It can be used to identify entities, attributes, and functional entities contained in text. For example, in the text "red dress for wedding," it can identify the attribute "red," the subject "dress," and the purpose of "wedding."

[0032] Adversarial Training: During the adversarial training process, a certain amount of perturbation is added to the embedding vector of each token to improve the robustness of the classifier to small approximate worst-case perturbations.

[0033] R-dropout: The similar but inconsistent output of the two dropouts can be used to train the model without changing the model.

[0034] KL divergence: also known as relative entropy, can be a way to quantify the difference between two probability distributions P and Q. It can be used to measure the amount of information lost when one distribution approximates another.

[0035] SimCSE: Simple Contrastive Learning of Sentence Embeddings, simple contrastive learning based on sentence embeddings, is a simple and effective sentence vector contrast learning method.

[0036] SimCLF: A Simple Framework for Contrastive Learning of Visual Representations, a simple framework for contrastive learning of visual representations, is a supervised learning method.

[0037] In related technologies, the final product ranking displayed to the user is determined based on the user-entered text query and the product's text information. The product's text information includes at least one of the following: title (tag information), keywords (keyword information), and user-entered attribute tags. If the product's text information is a title, the correlation between the query and title can be calculated using keyword correlation or semantic correlation using deep learning.

[0038] Based on keyword relevance, the method usually calculates the number of word matches between the query and title and determines the word relevance weight. Although this type of relevance matching has high accuracy, it cannot handle synonyms or misspellings, and has a technical problem of limited applicable scenarios.

[0039] Based on the semantic relevance of deep learning, queries and titles are typically represented as word vectors, and the final display ranking is determined by calculating their similarity. This similarity can be determined in two ways: first, the query and title are represented as word vectors, and then their cosine similarity is calculated; second, the query and title are segmented and input into a network model, allowing the model to learn and represent the similarity score between them. However, while the first method of calculating similarity is relatively intuitive and simple, it has low accuracy. The second method relies on the performance of the pre-trained deep learning model, but pre-trained models are typically trained on large-scale, general predictions and are not well adapted to scenarios that consider subtle semantic differences. Furthermore, queries and titles are not complete sentences, but rather a superposition of keywords. Some semantic variations can cause the pre-trained model to recognize errors. Furthermore, the pre-trained model has a poor ability to distinguish between terms such as subject, attribute, style, and function in the query and title. Therefore, the technical solutions of the above-mentioned related technologies suffer from low accuracy.

[0040] Example 1

[0041] According to an embodiment of the present application, an object matching method, or a product matching method, or a model training method embodiment is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0042] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal, a server, a cloud server or a similar computing device. Figure 1 The hardware structure block diagram of a computer terminal (or mobile device) for implementing an object matching method, a product matching method, or a model training method is shown. Figure 1 As shown, the computer terminal 10 (or mobile device 10) may include one or more (illustrated as 102a, 102b, ..., 102n) processors (the processor may include but is not limited to a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.

[0043] It should be noted that the one or more processors and / or other data processing circuits described above may generally be referred to herein as "data processing circuitry". The data processing circuitry may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuitry may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuitry serves as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0044] The memory 104 can be used to store software programs and modules of application software, such as the object matching method, product matching method, or model training method in the embodiment of the present application. The program instructions / data storage device corresponding to the processor executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, realizing the above-mentioned object matching method, product matching method, or model training method. The memory 104 may include a high-speed random access memory and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0045] The transmission device 106 is configured to receive or transmit data via a network. A specific example of the aforementioned network may include a wireless network provided by the communications provider of the computer terminal 10. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission device 106 may be a radio frequency (RF) module, which is configured to communicate with the Internet wirelessly.

[0046] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).

[0047] It should be noted that, in some optional embodiments, the above Figure 1 The computer device (or mobile device) shown may include hardware elements (including circuits), software elements (including computer code stored on a computer-readable medium), or a combination of hardware elements and software elements. Figure 1 This is merely one example of a particular embodiment and is intended to illustrate the types of components that may be present in the aforementioned computer device (or mobile device).

[0048] Under the above operating environment, this application provides Figure 2 The object matching method shown. Figure 2 This is a flow chart of an object matching method according to an embodiment of the present application. Figure 2 As shown, the method includes the following steps:

[0049] Step S202: obtaining an object search request and description information of a target object, wherein the object search request is generated by superimposing multiple search keywords.

[0050] The object in the above steps may be a target that the user wishes to search for, for example, a commodity in an online shopping scenario, or other users in a social scenario, but is not limited thereto.

[0051] The object search request in the above steps can be a request generated by the user's intention to search for any object, including multiple search keywords for describing the object to be searched, that is, the object search request is generated by the superposition of multiple search keywords. The above search keywords can all be entered by the user, or some can be entered by the user, and the rest can be selected by the user in the search platform. For example, in an online shopping scenario, when a user intends to buy a waterproof Bluetooth headset, the user can directly enter the search keyword: waterproof Bluetooth headset, and thus a responsive object search request "waterproof Bluetooth headset" can be generated.

[0052] The target object in the above steps can be the object that the user intends to search for when searching using the above object search request, or it can be any object provided to the user for search in the search platform, but the object may not be the object that the user intends to search for. The description information of the target object can be a text that can be obtained through the Internet and describes the target object. By performing semantic matching with the obtained object search request, it can be determined whether the target object is the object that the user intends to search for. For example, taking an online shopping scenario as an example, the description information can be the title information or product details information of the product provided by the merchant for the product; taking a social scenario as an example, the description information can be a description text or description tag set by the user for himself, but is not limited to this.

[0053] It should be noted that the description information of the target object can be generated by superimposing multiple attribute words of the target object.

[0054] In an optional embodiment, to facilitate users in searching for one or more objects, the client may provide the user with an interactive operation interface in which the user may enter the search keywords of the object to be searched in the input box, thereby generating an object search request based on the superposition of the above search keywords and sending it to a backend server (e.g., a cloud server). After receiving the object search request, the backend server may perform a semantic match between the object search request and the description information of each target object in the database, thereby determining the push object that successfully matches the object search request, that is, determining the object that the user intended to search for.

[0055] In another optional embodiment, to facilitate user searches for one or more objects, the mobile device may provide the user with an interactive interface in which the user may enter search keywords for the desired object in an input box, thereby generating an object search request based on the superposition of the search keywords. After receiving the object search request, the mobile device may semantically match the object search request with the locally stored description information of each target object to determine the push objects that successfully match the object search request, that is, the objects that the user intended to search for.

[0056] For example, taking the online shopping scenario as an example, assuming that the user needs to buy a water cup, the object search request input by the user can be "portable water bottle with straw", and the description information of the target object can be "Internet celebrity large-capacity, high-value, cute portable water bottle with straw", "with tea strainer, big belly, heat preservation, high-value, large-capacity, Internet celebrity 2022 latest health care model", etc., based on semantic matching of the object search request and the description information, products with successful semantic matching can be pushed to the user.

[0057] For example, let's take a social scenario as an example. Suppose a user needs to search for other users on a social platform that meet their social needs. The object search request entered by the user could be "exam supervision." The description of the target object could be, for example, "Male Beijing university student who likes playing PUBG and is looking for teammates to play with," "Shanghai looking for partners to supervise each other while taking exams," "Cooking and baking for food exchange," etc. By performing semantic matching between the object search request and the description, other users with successful semantic matches can be pushed to the user. Suppose a user needs to search for other users on an employment platform that meet their employment needs. The object search request entered by the user could be "Chef with extensive Sichuan cuisine experience and a health certificate." The description of the target object could be, for example, "Male with 10 years of experience specializing in Sichuan cuisine, located in Chongqing," "Female with 20 years of work experience specializing in noodle soup, located in Xi'an," etc. By performing semantic matching between the object search request and the description, employment users with successful semantic matches can be pushed to the user.

[0058] Step S204: Use a semantic matching model to perform semantic matching on multiple search keywords and description information to obtain a target matching result between the object search request and the target object, wherein the semantic matching model is obtained by training the pre-trained model through the first matching result of the training sample and the second matching result of the adversarial sample, the adversarial sample is generated by superimposing noise data on the training sample, the first matching result is obtained by processing the training sample through the first matching model, and the second matching result is obtained by processing the adversarial sample through the second matching model, and the first matching model and the second matching model are obtained by discarding some neurons in the pre-trained model using two different discard rates respectively.

[0059] In existing semantic matching technologies, pre-trained models are usually trained on large-scale general expectations and cannot be well adapted to scenarios that consider subtle semantic differences. In particular, when users search for objects, the object search request entered by the user is usually a superposition of keywords, and the word order will change compared to the sentence. Therefore, the model may match the wrong results. For example, still taking the online shopping scenario as an example, the object search request entered by the user is "bmxframe and fork", where bmx stands for BICYCLE MOTOCROSS. "High end bmxbike full chromoly frame and fork customized bmx bicycle" will appear, that is, "high end bmxbike full chromoly frame and fork customized bmx bicycle", that is, "high end bmxbike full chromoly frame and fork customized bmx bicycle", that is, the user wants to search for a bicycle frame and fork suitable for motocross, but the retrieved result is bmx bicycle, and the retrieval result is inconsistent with the user's search intention. It can be seen that common semantic models have the disadvantages of not being robust to fine-grained semantic matching and redundant information. Therefore, this application proposes a semantic matching optimization method based on the dual modes of contrastive learning and adversarial training.

[0060] The traditional combination of contrastive learning and adversarial training usually requires two forward calculations on the model to implement adversarial training, and then two forward calculations on the results of adversarial training to implement contrastive learning, resulting in at least four forward calculations.

[0061] In order to solve the above problems, the present application can use different dropout strategies in the two forward calculations of adversarial training, and then complete the training process based on the KL divergence of the two forward losses and the semantic matching accuracy, which can improve the anti-interference ability of the semantic matching model while improving the model's ability to distinguish between positive and negative samples. The specific training process is as follows: first, a dropout rate is used to discard some neurons in the pre-trained model to obtain a first matching model, and then the first matching model is used to process the training sample to obtain a first matching result, and then the pre-trained model is used for backpropagation to generate adversarial samples, and another dropout rate is used to discard some neurons in the pre-trained model to obtain a second matching model, and then the second matching model is used to process the adversarial sample to obtain a second matching result.

[0062] The pre-trained model in the above steps may be a pre-trained model based on Transformer, for example, a BERT (Bidirectional Encoder Representations from Transformer) model, but is not limited thereto.

[0063] The training samples in the above steps may come from open source datasets, from the Internet, or from search platforms, but are not limited thereto.

[0064] In an optional embodiment, the server can pre-train a semantic matching model through a dual-mode approach of adversarial training and contrastive learning, so that after receiving an object search request sent by the client, the description information of the target object in the database can be semantically matched with the object search request in turn, that is, the object search request and the description information are input into the semantic matching model, and the output result of the model is the target matching result, where if the object search request and the description information match successfully, the output result can be 1; if the object search request and the description information fail to match, the output result can be 0.

[0065] In another optional embodiment, the server can pre-train a semantic matching model using a dual-mode approach of adversarial training and contrastive learning, and deploy the model on the client. Thus, after receiving the generated object search request, the client can sequentially semantically match the locally stored description of the target object with the object search request. That is, the object search request and description are input into the semantic matching model, and the output of the model is the target matching result. If the object search request and description successfully match, the output result can be 1; if the object search request and description fail to match, the output result can be 0.

[0066] For example, taking the semantic matching model deployed on the server as an example, the user can generate an object search request on the mobile terminal and send the object search request to the server. The object search request can be "exam supervision". After receiving the object search request sent by the client, the server can match the description information of the target object in the database with the object search request in turn. The description information of the target object includes but is not limited to "Male Beijing college student who likes to eat chicken and is looking for teammates to play together", "Shanghai is looking for friends to study together and supervise each other", "Food cooking and baking exchange", "Exam supervision" and "Male Beijing college student who likes to eat chicken and is looking for teammates to play together" fail to match, and the output result can be 0, so this user will not be pushed to the user. "Exam supervision" and "Shanghai is looking for friends to study together and supervise each other" are matched successfully, and the output result can be 1. After all the description information of the target object is matched one by one, the relevant user with the output result of 1 is returned to the client, and the client pushes the above-mentioned relevant users to the customer.

[0067] Taking the semantic matching model deployed on the client as an example, the user can generate an object search request on the mobile terminal. The object search request can be "exam supervision", and semantic matching is performed based on the object search request and the description information of the target object. The description information of the target object can be "Male Beijing college student who likes to play chicken and is looking for teammates", "Shanghai is looking for friends to study together and supervise each other", "Food cooking and baking exchange", "Exam supervision" and "Male Beijing college student who likes to play chicken and is looking for teammates to play together" fail to match, and the output result can be 0, so this user will not be pushed to the user. "Exam supervision" and "Shanghai is looking for friends to study together and supervise each other" are matched successfully, and the output result can be 1. After all the description information of the target object is matched one by one, the relevant users with the output result of 1 are determined, and the client pushes the above-mentioned relevant users to the customer.

[0068] The solution provided in the above-mentioned embodiment of the present application is used to obtain an object search request and description information of the target object, wherein the object search request is generated by superimposing multiple search keywords; a semantic matching model is used to perform semantic matching on the multiple search keywords and description information to obtain a target matching result between the object search request and the target object, thereby achieving the purpose of semantic matching. It is easy to notice that since the semantic model is obtained by training the pre-trained model through the first matching result of the training sample and the second matching result of the adversarial sample, and the adversarial sample is generated by superimposing noise data on the training sample, the adversarial training is used in the model training process to improve the model's anti-interference ability to redundant information of keyword stacking text. Moreover, since the first matching result is obtained by processing the training sample by the first matching model, and the second matching result is obtained by processing the adversarial sample by the second matching model, the first matching model and the second matching model respectively use two different dropout rates to discard part of the neurons in the pre-trained model. Therefore, in the process of adversarial training, the contrastive learning enhancement model is integrated to distinguish between positive and negative samples, and the representation ability of the object search request and the descriptive information of the target object is improved, thereby achieving the technical effect of improving the semantic matching model's recognition ability of subtle semantics and improving robustness, thereby achieving the technical effect of improving the model recognition accuracy, and solving the technical problem of low recognition accuracy of the semantic matching model in the existing technology.

[0069] In the above embodiment of the present application, the method also includes: obtaining a preset matching result of the training sample; generating a first loss function based on the second matching result and the preset matching result; generating a second loss function based on the first matching result and the second matching result; and training the pre-trained model based on the first loss function and the second loss function to obtain a semantic matching model.

[0070] The training samples in the above steps may include: object search samples, object description samples and preset matching results, wherein the preset matching results may be semantic matching results for the object search samples and object description samples in advance, and the annotation information may be manually annotated. For example, if the semantic matching of the object search sample and the object description sample is successful, the preset matching result may be 1; if the semantic matching of the object search sample and the object description sample fails, the preset matching result may be 0.

[0071] In an optional embodiment, assuming an e-commerce scenario, the above-mentioned training samples can be derived from historical data in the e-commerce system, the object search samples can be historical search records, the object description samples can be historical product information, and the preset matching results can be historical matching results.

[0072] In an optional embodiment, assuming that in a social platform, the above-mentioned training samples can come from historical search records in the social platform, the object search samples can be the user's historical search text on the social platform, the object description text can be other historical description information, such as the user's introduction information and friend information, etc., and the preset matching results can be historical matching results.

[0073] To ensure the semantic matching accuracy of the semantic matching model, a loss function can be constructed based on the first matching result and the preset matching result, but not based on the second matching result and the preset matching result. Because adversarial samples are generated by superimposing noise data on training samples, in this embodiment of the application, only the first loss function constructed based on the second matching result and the preset matching result is used to represent the semantic matching accuracy.

[0074] In order to ensure the performance of the semantic matching model in distinguishing positive and negative samples, based on the principle of contrastive learning, a second loss function can be constructed according to the KL divergence of the first matching result and the second matching result.

[0075] In an optional embodiment, the first loss function and the second loss function can be weightedly summed to obtain the total loss function of the pre-trained model, and then the total loss function can be compared with a preset threshold. If the total loss function is greater than the preset threshold, it indicates that the pre-trained model at this time does not meet the training requirements and needs to continue training through training samples; if the total loss function is less than the preset threshold, it indicates that the pre-trained model at this time meets the training requirements and does not need to continue training, so that a trained semantic matching model can be obtained.

[0076] For example, the first loss function can be min-logP(y|x+r adv ;θ).

[0077] Among them, r adv represents disturbance, x represents input sequence, y represents output sequence, and θ represents model operation parameters.

[0078] In the above embodiment of the present application, generating the second loss function based on the first matching result and the second matching result includes: obtaining the relative entropy of the first matching result and the second matching result; and generating the second loss function based on the relative entropy.

[0079] Specifically, the second loss function may be formed based on the KL divergence of the first matching result and the second matching result.

[0080] In an optional embodiment, the second loss function may be directly composed of the above-mentioned KL divergence, or may be a loss function generated after processing the above-mentioned KL divergence.

[0081] KL divergence can be calculated using the following formula:

[0082] Here, x represents the input sequence, P(x) can be the actual distribution of x, and Q(x) can be the theoretical distribution of x.

[0083] For example, the second loss function can be

[0084] The second loss function is constrained to:

[0085] Among them, x is the input sequence, y is the output sequence, nω and ε are model calculation parameters.

[0086] It should be noted that constraining the KL divergence of any two substructures can limit the degrees of freedom of the neural network parameters. Therefore, the problem of the above-mentioned constrained loss function is equivalent to seeking a model that can achieve the loss by minimizing the degrees of freedom of each parameter. This can prevent overfitting and improve the robustness of the semantic matching model.

[0087] In an optional embodiment, the adversarial training paradigm can use SimCSE and SimCLR.

[0088] In the above embodiment of the present application, the method further includes: obtaining a target gradient of the pre-trained model; and generating noise data based on the target gradient.

[0089] The target gradient of the pre-trained model in the above training step can be the gradient of the pre-trained model loss function with respect to the input. After determining the target gradient, the perturbation that maximizes the loss function can be determined based on the target gradient, and then noise data can be generated based on the perturbation.

[0090] In an optional embodiment, the target gradient g is calculated by the following formula: Among them, x represents the input sequence, y represents the output sequence, θ represents the model operation parameter, and the noise data r is calculated. adv The formula is as follows:

[0091] In the above embodiment of the present application, a semantic matching model is used to perform semantic matching on multiple search keywords and description information to obtain a target matching result between the object search request and the target object, including: splicing multiple search keywords and description information to generate a target text; and using the semantic matching model to process the target text to obtain a target matching result.

[0092] In an optional embodiment, when the semantic matching model matches multiple search keywords and description information, it is first necessary to splice the multiple search keywords and description information to generate a target text, and then use the semantic matching model to process the target text to obtain a target matching result.

[0093] In the above embodiment of the present application, multiple search keywords and description information are spliced ​​together to generate a target text, including: splicing multiple search keywords and description information to obtain the original text; performing word segmentation on the original text target text to obtain multiple fields; performing named entity recognition on the multiple fields to obtain attributes corresponding to the multiple fields; obtaining a target field whose attributes are preset attributes from the multiple fields; and splicing the target fields to obtain the target text.

[0094] In an optional embodiment, the input target text is first segmented to obtain multiple fields, and then named entity recognition is used to determine the attributes of the fields. Due to the limitations of the segmentation process, a whole phrase may be divided into multiple fields. Therefore, the target fields with preset attributes can be spliced ​​to obtain the target text.

[0095] It should be noted that in the embodiments of the present application, existing word segmentation technology can be used for word segmentation processing, and the present application does not make specific limitations on this. The attributes of the above fields can also be determined by manual extraction.

[0096] After using NER to extract six key attributes, the model pays different attention to subject words, styles, functions, etc., and uses the processed target text as the one-dimensional input of the semantic matching model to focus on attribute words, thereby achieving the technical effect of improving matching accuracy.

[0097] For example, the preset attributes may include, but are not limited to, material, function, user, specifications, style, and core product terms. "matr" is used to represent the material, and its id is set to 1; "func" represents the function, and its id is set to 2; "usg" represents the use, and its id is set to 3; "spec" represents the specifications, and its id is set to 4; "styl" represents the style; and "prd_c" represents the core product term, and its id is set to 5. Suppose the original text is "animage of a fresh watermelon." After token segmentation, it becomes "an," "image," "of," "a," "fresh," "water," and "##melon." Each token has its own token_id. Then, NER is used to identify these tokens and determine their corresponding NER attributes and NER_ids. For example, if the NER attribute for "image" is "prd_c," and the NER attributes for "water" and "##melon" are also "prd_c," they are merged to obtain "watermelon." And Token_id and NER_id are aligned, that is, the Token_id of the corresponding word segmentation corresponds to the NER_id of the word segmentation. After the recognition is completed, the text that meets the preset attributes is spliced ​​to obtain the target text "image watermelon".

[0098] In the above embodiment of the present application, the target object includes at least one original object, and the target matching result includes the matching result of at least one original object. The method also includes: obtaining an original object whose matching result is greater than a preset result in at least one original object to obtain a pushed object; and outputting the pushed object.

[0099] The original object may be an object stored in a database used by the user to retrieve information, the matching result may be the degree of match between the original object and the object retrieval request, the preset result may be a threshold for the degree of match between the original object and the object retrieval request, and the pushed object may be the original object that is pushed and displayed to the user. A matching result is determined based on the matching degree of the original object, and a pushed object is determined based on the matching result. The pushed object is then displayed to the user.

[0100] In a preferred embodiment, Figure 3As shown in the figure, the object search request Query is "waterproof blueboothheadset", and the description information Title of the target object is "xiaomi high-quality waterproof Bluetoothheadset". Then, after processing the Title and Query using NER, the target text is obtained. The number "0" shown in the figure is used to indicate that this field does not belong to the preset attribute, and the number "1" is used to indicate that the corresponding field belongs to the preset attribute. In response to the attribute of the field being the preset attribute, the fields are spliced ​​to obtain the target text. Figure 4A Input training samples (w1, w2, w3, ..., w n ), Figure 4A The process represented by the solid line and solid arrows indicates that the training sample is processed using the first matching model to obtain the first matching result. Then, as shown in FIG. Figure 4A The dotted line represents the direction of the arrow, and the adversarial sample is generated by back propagation through the pre-trained model And use another dropout rate to drop some neurons in the pre-trained model to get the second matching model, then, as Figure 4A As shown in the direction of the arrow indicated by the solid hollow arrow, x' represents the adversarial sample, and the adversarial sample is processed using the second matching model to obtain the second matching result. Then, as Figure 4B As shown, Figure 4B The left side shows the existing technology approach, which first performs two forward calculations on the model to achieve adversarial training, and then performs two forward calculations on the results of adversarial training to achieve contrastive learning. As a result, at least four forward calculations are required to calculate the loss function based on KL divergence. Figure 4B The right side shows the comparative learning method used in this application. Figure 4B The dotted circle in the middle represents the discarded neurons, and x represents the input sequence, that is, the training sample. In this application, different discard rates are used to process the pre-trained model to obtain a first matching model and a second matching model. Then, the training sample is used to train the first matching model and the second matching model to obtain a first matching result and a second matching result. Then, the first matching result, the second matching result and the preset matching result are used to train the pre-trained model to obtain a semantic matching model.

[0101] Example 2

[0102] This application provides Figure 5 The object matching method shown, Figure 5 Flowchart of the object matching method according to embodiment 2 of the present application, comprising the following steps:

[0103] In step S502, the cloud server receives an object search request sent by the client, wherein the object search request is generated by superimposing multiple search keywords.

[0104] Step S504: The cloud server obtains description information of the target object based on the object search request.

[0105] In step S506, the cloud server uses a semantic matching model to perform semantic matching on multiple search keywords and description information to obtain a target matching result between the object search request and the target object, wherein the semantic matching model is obtained by training the pre-trained model through the first matching result of the training sample and the second matching result of the adversarial sample, the adversarial sample is generated by superimposing noise data on the training sample, the first matching result is obtained by processing the training sample through the first matching model, and the second matching result is obtained by processing the adversarial sample through the second matching model, and the first matching model and the second matching model are obtained by discarding some neurons in the pre-trained model using two different discard rates respectively.

[0106] Step S508: The cloud server outputs the target matching result to the client.

[0107] In the above embodiment of the present application, the method also includes: the cloud server obtains a preset matching result of the training sample; the cloud server generates a first loss function based on the second matching result and the preset matching result; the cloud server generates a second loss function based on the first matching result and the second matching result; the cloud server trains the pre-trained model based on the first loss function and the second loss function to obtain a semantic matching model.

[0108] In the above embodiment of the present application, the cloud server generates a second loss function based on the first matching result and the second matching result, including: the cloud server obtains the relative entropy of the first matching result and the second matching result; and the cloud server generates the second loss function based on the relative entropy.

[0109] In the above embodiment of the present application, the method also includes: the cloud server obtains the target gradient of the pre-trained model; and the cloud server generates noise data based on the target gradient.

[0110] In the above embodiment of the present application, the cloud server splices multiple search keywords and description information to generate a target text, including: the cloud server splices multiple search keywords and description information to obtain the original text; the cloud server performs word segmentation on the original text target text to obtain multiple fields; the cloud server performs named entity recognition on the multiple fields to obtain attributes corresponding to the multiple fields; the cloud server obtains the target field whose attributes are preset attributes from the multiple fields; the cloud server splices the target fields to obtain the target text.

[0111] In the above embodiment of the present application, the target object includes at least one original object, and the target matching result includes the matching result of at least one original object. The method also includes: the cloud server obtains the original object whose matching result is greater than the preset result in at least one original object to obtain a push object; the cloud server outputs the push object.

[0112] Example 3

[0113] This application provides Figure 6 The object matching method shown, Figure 6 3 is a flowchart of a product matching method according to Example 3 of the present application, comprising the following steps:

[0114] Step S602: Obtain a product search request and title information of a target product, wherein the product search request is generated by superimposing multiple search keywords.

[0115] Step S604: Use the semantic matching model to perform semantic matching on multiple search keywords and title information to obtain the target matching result between the product search request and the target product, wherein the semantic matching model is obtained by training the pre-trained model through the first matching result of the training sample and the second matching result of the adversarial sample. The adversarial sample is generated by superimposing noise data on the training sample. The first matching result is obtained by processing the training sample with the first matching model, and the second matching result is obtained by processing the adversarial sample with the second matching model. The first matching model and the second matching model are respectively obtained by discarding some neurons in the pre-trained model using two different discard rates.

[0116] In the above embodiment of the present application, the method also includes: obtaining a preset matching result of the training sample; generating a first loss function based on the second matching result and the preset matching result; generating a second loss function based on the first matching result and the second matching result; and training the pre-trained model based on the first loss function and the second loss function to obtain a semantic matching model.

[0117] In the above embodiment of the present application, generating the second loss function based on the first matching result and the second matching result includes: obtaining the relative entropy of the first matching result and the second matching result; and generating the second loss function based on the relative entropy.

[0118] In the above embodiment of the present application, the method further includes: obtaining a target gradient of the pre-trained model; and generating noise data based on the target gradient.

[0119] In the above embodiment of the present application, multiple search keywords and title information are spliced ​​together to generate a target text, including: splicing multiple search keywords and description information to obtain the original text; performing word segmentation on the original text to obtain multiple fields; performing named entity recognition on the multiple fields to obtain attributes corresponding to the multiple fields; obtaining a target field whose attributes are preset attributes from the multiple fields; and splicing the target fields to obtain the target text.

[0120] In the above embodiment of the present application, the target product includes at least one original product, and the target matching result includes the matching result of at least one original product. The method also includes: obtaining an original product whose matching result is greater than a preset result in at least one original product to obtain a pushed product; and outputting the pushed product.

[0121] Example 4

[0122] This application provides Figure 7 The model training method shown, Figure 7 4 is a flow chart of a model training method according to Example 4 of the present application, comprising the following steps:

[0123] Step S701 : obtaining training samples, wherein the training samples include: a search request sample generated by superimposing multiple keywords, a description sample of a target object, and a preset matching result between the search request sample and the target object.

[0124] Step S702: superimpose noise data on the training sample to generate an adversarial sample.

[0125] Step S703 : using two different dropout rates to drop part of the neurons in the pre-trained model to obtain a first matching model and a second matching model.

[0126] Step S704: Process the training sample using the first matching model to obtain a first matching result, and process the adversarial sample using the second matching model to obtain a second matching result.

[0127] Step S705: training the pre-trained model based on the first matching result, the second matching result, and the preset matching result to obtain a semantic matching model.

[0128] In the above embodiment of the present application, the method also includes: obtaining a preset matching result of the training sample; generating a first loss function based on the second matching result and the preset matching result; generating a second loss function based on the first matching result and the second matching result; and training the pre-trained model based on the first loss function and the second loss function to obtain a semantic matching model.

[0129] In the above embodiment of the present application, generating the second loss function based on the first matching result and the second matching result includes: obtaining the relative entropy of the first matching result and the second matching result; and generating the second loss function based on the relative entropy.

[0130] In the above embodiment of the present application, the method further includes: obtaining a target gradient of the pre-trained model; and generating noise data based on the target gradient.

[0131] Example 5

[0132] According to an embodiment of the present application, an object matching device for implementing the above object matching method is also provided. Figure 8 As shown, the device 800 includes: a first acquisition module 802 and a semantic matching module 804.

[0133] The first acquisition module 802 is used to acquire an object search request and description information of a target object, wherein the object search request is generated by superimposing multiple search keywords.

[0134] The semantic matching module 804 is used to use a semantic matching model to perform semantic matching on multiple search keywords and description information to obtain a target matching result between the object search request and the target object, wherein the semantic matching model is obtained by training the pre-trained model through the first matching result of the training sample and the second matching result of the adversarial sample, the adversarial sample is generated by superimposing noise data on the training sample, the first matching result is obtained by processing the training sample with the first matching model, and the second matching result is obtained by processing the adversarial sample with the second matching model, and the first matching model and the second matching model are obtained by discarding some neurons in the pre-trained model using two different discard rates respectively.

[0135] It should be noted that the first acquisition module 802 and the semantic matching module 804 correspond to steps S202 to S204 in Example 1. The examples and application scenarios implemented by the two modules and the corresponding steps are the same, but are not limited to the contents disclosed in Example 1. It should be noted that the above modules, as part of the device, can be run in the computer terminal 10 provided in Example 1.

[0136] In the above embodiment of the present application, the device also includes: a second acquisition module, used to obtain a preset matching result of the training sample; a first generation module, used to generate a first loss function based on the second matching result and the preset matching result; a second generation module, used to generate a second loss function based on the first matching result and the second matching result; a training module, used to train the pre-trained model based on the first loss function and the second loss function to obtain a semantic matching model.

[0137] In the above embodiment of the present application, the second generation module includes: a first acquisition unit and a first generation unit, wherein the first acquisition unit is used to obtain the relative entropy of the first matching result and the second matching result; the first generation unit is used to generate a second loss function based on the relative entropy.

[0138] In the above embodiment of the present application, the device also includes a third acquisition module and a third generation module, wherein the third acquisition module is used to obtain the target gradient of the pre-trained model; the third generation module is used to generate noise data based on the target gradient.

[0139] In the above embodiment of the present application, the semantic matching module 802 includes a second generation unit and a processing unit, wherein the second generation unit is used to splice multiple search keywords and description information to generate a target text; the processing unit is used to process the target text using a semantic matching model to obtain a target matching result.

[0140] In the above-mentioned embodiment of the application, the processing unit includes a first splicing subunit, a word segmentation subunit, an identification subunit, an acquisition subunit and a second splicing subunit, wherein the first splicing subunit is used to splice multiple search keywords and description information to obtain the original text; the word segmentation subunit is used to perform word segmentation processing on the target text to obtain multiple fields; the identification subunit is used to perform named entity recognition on multiple fields to obtain attributes corresponding to multiple fields; the acquisition subunit is used to obtain a target field whose attributes are preset attributes among multiple fields; the second splicing subunit is used to splice the target fields to obtain the target text.

[0141] In the above embodiment of the present application, the target object includes at least one original object, the target matching result includes the matching result of at least one original object, and the device also includes a fourth acquisition module and an output module, wherein the fourth acquisition module is used to obtain the original object whose matching result is greater than the preset result in at least one original object to obtain a pushed object; and the output module is used to output the pushed object.

[0142] Example 6

[0143] According to an embodiment of the present application, an object matching device for implementing the above object matching method is also provided. Figure 9 As shown, the apparatus 900 includes: a receiving module 902 , a first acquiring module 904 , a semantic matching module 906 and an output module 908 .

[0144] The receiving module 902 is applied to the cloud server to receive an object search request sent by a client, wherein the object search request is generated by superimposing multiple search keywords.

[0145] The first acquisition module 904 is used by the cloud server to acquire description information of the target object based on the object search request.

[0146] The semantic matching module 906 is used for the cloud server to perform semantic matching on multiple search keywords and description information using a semantic matching model to obtain a target matching result between the object search request and the target object, wherein the semantic matching model is obtained by training the pre-trained model through the first matching result of the training sample and the second matching result of the adversarial sample, the adversarial sample is generated by superimposing noise data on the training sample, the first matching result is obtained by processing the training sample through the first matching model, and the second matching result is obtained by processing the adversarial sample through the second matching model, and the first matching model and the second matching model are obtained by discarding some neurons in the pre-trained model using two different discard rates respectively.

[0147] The output module 908 is used by the cloud server to output the target matching result to the client.

[0148] It should be noted that the receiving module 902, the first acquisition module 904, the semantic matching module 906, and the output module 908 correspond to steps S502 to S508 in Example 2. The examples and application scenarios implemented by the two modules and the corresponding steps are the same, but are not limited to the contents disclosed in Example 1. It should be noted that the above modules, as part of the device, can be run in the computer terminal 10 provided in Example 1.

[0149] In the above embodiment of the present application, the device also includes: a second acquisition module, which is used by the cloud server to obtain the preset matching result of the training sample; a first generation module, which is used by the cloud server to generate a first loss function based on the second matching result and the preset matching result; a second generation module, which is used by the cloud server to generate a second loss function based on the first matching result and the second matching result; and a training module, which is used by the cloud server to train the pre-trained model based on the first loss function and the second loss function to obtain a semantic matching model.

[0150] In the above embodiment of the present application, the second generation module includes: a first acquisition unit and a first generation unit, wherein the first acquisition unit is used by the cloud server to obtain the relative entropy of the first matching result and the second matching result; the first generation unit is used by the cloud server to generate a second loss function based on the relative entropy.

[0151] In the above embodiment of the present application, the device also includes a third acquisition module and a third generation module, wherein the third acquisition module is used by the cloud server to obtain the target gradient of the pre-trained model; the third generation module is used by the cloud server to generate noise data based on the target gradient.

[0152] In the above embodiment of the present application, the semantic matching module 904 includes a second generation unit and a processing unit, wherein the second generation unit is used by the cloud server to splice multiple search keywords and description information to generate a target text; the processing unit is used by the cloud server to process the target text using a semantic matching model to obtain a target matching result.

[0153] In the above embodiment of the present application, the processing unit includes a first splicing subunit, a word segmentation subunit, an identification subunit, an acquisition subunit and a second splicing subunit, wherein the first splicing subunit is used to splice multiple search keywords and description information to obtain the original text; the word segmentation subunit is used to perform word segmentation processing on the original text to obtain multiple fields; the identification subunit is used to perform named entity recognition on multiple fields to obtain attributes corresponding to multiple fields; the acquisition subunit is used to obtain a target field whose attributes are preset attributes in multiple fields; the splicing subunit is used to splice the target fields to obtain the target text.

[0154] In the above embodiment of the present application, the target object includes at least one original object, the target matching result includes the matching result of at least one original object, and the device also includes a fourth acquisition module and an output module, wherein the fourth acquisition module is used to obtain the original object whose matching result is greater than the preset result in at least one original object to obtain a pushed object; and the output module is used to output the pushed object.

[0155] Example 7

[0156] According to an embodiment of the present application, a product matching device for implementing the above product matching method is also provided. Figure 10 As shown, the device 1000 includes: a first acquisition module 1002 and a semantic matching module 1004.

[0157] The first acquisition module 1002 is used to acquire a product search request and title information of a target product, wherein the product search request is generated by superimposing multiple search keywords.

[0158] The semantic matching module 1004 is used to use a semantic matching model to perform semantic matching on multiple search keywords and title information to obtain a target matching result between the product search request and the target product, wherein the semantic matching model is obtained by training the pre-trained model through the first matching result of the training sample and the second matching result of the adversarial sample, the adversarial sample is generated by superimposing noise data on the training sample, the first matching result is obtained by processing the training sample through the first matching model, and the second matching result is obtained by processing the adversarial sample through the second matching model, and the first matching model and the second matching model are obtained by discarding some neurons in the pre-trained model using two different discard rates respectively.

[0159] It should be noted that the first acquisition module 1002 and the semantic matching module 1004 correspond to steps S602 to 604 in Example 3. The examples and application scenarios implemented by the two modules and the corresponding steps are the same, but are not limited to the contents disclosed in Example 1. It should be noted that the above modules, as part of the device, can be run in the computer terminal 12 provided in Example 1.

[0160] In the above embodiment of the present application, the device also includes: a second acquisition module, used to obtain a preset matching result of the training sample; a first generation module, used to generate a first loss function based on the second matching result and the preset matching result; a second generation module, used to generate a second loss function based on the first matching result and the second matching result; a training module, used to train the pre-trained model based on the first loss function and the second loss function to obtain a semantic matching model.

[0161] In the above embodiment of the present application, the second generation module includes: a first acquisition unit and a first generation unit, wherein the first acquisition unit is used to obtain the relative entropy of the first matching result and the second matching result; the first generation unit is used to generate a second loss function based on the relative entropy.

[0162] In the above embodiment of the present application, the device also includes a third acquisition module and a third generation module, wherein the third acquisition module is used to obtain the target gradient of the pre-trained model; the third generation module is used to generate noise data based on the target gradient.

[0163] In the above embodiment of the present application, the semantic matching module includes a second generation unit and a processing unit, wherein the second generation unit is used to splice multiple search keywords and title information to generate a target text; the processing unit is used to process the target text using a semantic matching model to obtain a target matching result.

[0164] In the above-mentioned embodiment of the application, the processing unit includes a first splicing subunit, a word segmentation subunit, an identification subunit, an acquisition subunit and a second splicing subunit, wherein the first splicing subunit is used to splice multiple search keywords and description information to obtain the original text; the word segmentation subunit is used to perform word segmentation processing on the original text to obtain multiple fields; the identification subunit is used to perform named entity recognition on multiple fields to obtain attributes corresponding to multiple fields; the acquisition subunit is used to obtain a target field whose attributes are preset attributes among multiple fields; the second splicing subunit is used to splice the target fields to obtain the target text.

[0165] In the above embodiment of the present application, the target product includes at least one original product, the target matching result includes the matching result of at least one original product, and the device also includes a fourth acquisition module and an output module, wherein the fourth acquisition module is used to obtain the original product whose matching result is greater than the preset result in at least one original product to obtain the pushed product; the output module is used to output the pushed product.

[0166] Example 8

[0167] According to an embodiment of the present application, a model training device for implementing the above-mentioned model training method is also provided. Figure 11 As shown, the device 1100 includes: a first acquisition module 1101, a superposition module 1102, a discarding module 1103, a processing module 1104 and a training module 1105.

[0168] The first acquisition module 1101 is used to acquire training samples, wherein the training samples include: a search request sample generated by superimposing multiple keywords, a description sample of a target object, and a preset matching result between the search request sample and the target object.

[0169] The superposition module 1102 is used to superimpose noise data on the training samples to generate adversarial samples.

[0170] The discarding module 1103 is used to discard some neurons in the pre-trained model using two different discarding rates to obtain a first matching model and a second matching model.

[0171] The processing module 1104 is configured to process the training sample using the first matching model to obtain a first matching result, and to process the adversarial sample using the second matching model to obtain a second matching result.

[0172] The training module 1105 is used to train the pre-trained model based on the first matching result, the second matching result and the preset matching result to obtain a semantic matching model.

[0173] In the above embodiment of the present application, the device also includes: a first acquisition module, used to obtain a preset matching result of the training sample; a first generation module, used to generate a first loss function based on the second matching result and the preset matching result; a second generation module, used to generate a second loss function based on the first matching result and the second matching result; a training module, used to train the pre-trained model based on the first loss function and the second loss function to obtain a semantic matching model.

[0174] In the above embodiment of the present application, the second generation module includes: a first acquisition unit and a first generation unit, wherein the first acquisition unit is used to obtain the relative entropy of the first matching result and the second matching result; the first generation unit is used to generate a second loss function based on the relative entropy.

[0175] It should be noted that the first acquisition module 1101, superposition module 1102, discarding module 1103, processing module 1104, and training module 1105 correspond to steps S701 to 705 in Example 4. The examples and application scenarios implemented by the two modules and the corresponding steps are the same, but are not limited to the contents disclosed in Example 1. It should be noted that the above modules, as part of the device, can be run in the computer terminal 10 provided in Example 1.

[0176] Example 9

[0177] The embodiment of the present application can provide a computer terminal, which can be any computer terminal device in a computer terminal group. In the above embodiment of the present application, in this embodiment, the above computer terminal can also be replaced by a terminal device such as a mobile terminal.

[0178] In the above embodiment of the present application, in this embodiment, the above computer terminal may be located in at least one network device among a plurality of network devices of a computer network.

[0179] In this embodiment, the above-mentioned computer terminal can execute the program code of the following steps in the object matching method: obtaining an object search request and description information of the target object, wherein the object search request is generated by superimposing multiple search keywords; using a semantic matching model to semantically match multiple search keywords and description information to obtain a target matching result between the object search request and the target object, wherein the semantic matching model is obtained by training a pre-trained model through the first matching result of the training sample and the second matching result of the adversarial sample, the adversarial sample is generated by superimposing noise data on the training sample, the first matching result is obtained by processing the training sample with the first matching model, the second matching result is obtained by processing the adversarial sample with the second matching model, and the first matching model and the second matching model are respectively obtained by discarding some neurons in the pre-trained model using two different discard rates. In the above-mentioned embodiment of the present application, Figure 12 This is a structural block diagram of a computer terminal according to an embodiment of the present application. Figure 12 As shown, the computer terminal 1200 may include: one or more (only one is shown in the figure) processors 122 and a memory 124.

[0180] Among them, the memory 124 can be used to store software programs and modules, such as the program instructions / modules corresponding to the object matching method and device in the embodiments of the present application. The processor 122 executes various functional applications and data processing by running the software programs and modules stored in the memory 124, that is, implementing the above-mentioned object matching method. The memory 124 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 124 may further include a memory remotely located relative to the processor 122, and these remote memories may be connected to the terminal 1200 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0181] The processor 122 can call the information and application stored in the memory 124 through the transmission device to perform the following steps: obtain an object search request and description information of the target object, wherein the object search request is generated by superimposing multiple search keywords; use a semantic matching model to semantically match the multiple search keywords and description information to obtain a target matching result between the object search request and the target object, wherein the semantic matching model is obtained by training the pre-trained model through the first matching result of the training sample and the second matching result of the adversarial sample, the adversarial sample is generated by superimposing noise data on the training sample, the first matching result is obtained by processing the training sample with the first matching model, and the second matching result is obtained by processing the adversarial sample with the second matching model, and the first matching model and the second matching model are respectively obtained by discarding some neurons in the pre-trained model using two different discard rates.

[0182] Optionally, the processor may further execute program code for the following steps: generating a first loss function based on the second matching result and a preset matching result; generating a second loss function based on the first matching result and the second matching result; and training a pre-trained model based on the first loss function and the second loss function to obtain a semantic matching model. Optionally, the processor may further execute program code for the following steps: generating a second loss function based on the first matching result and the second matching result includes: obtaining relative entropy between the first matching result and the second matching result; and generating the second loss function based on the relative entropy.

[0183] Optionally, the processor may further execute program code of the following steps: obtaining a target gradient of a pre-trained model; and generating noise data based on the target gradient.

[0184] Optionally, the above-mentioned processor can also execute the program code of the following steps: using the semantic matching model to perform semantic matching on multiple search keywords and description information to obtain the target matching result between the object search request and the target object, including: splicing multiple search keywords and description information to generate a target text; using the semantic matching model to process the target text to obtain the target matching result.

[0185] Optionally, the above-mentioned processor can also execute the program code of the following steps: splicing multiple search keywords and description information to obtain the original text; performing word segmentation on the original text to obtain multiple fields; performing named entity recognition on multiple fields to obtain attributes corresponding to multiple fields; obtaining the target field whose attributes are preset attributes among multiple fields; splicing the target fields to obtain the target text.

[0186] Optionally, the processor may also execute program code of the following steps: the target object includes at least one original object, the target matching result includes the matching result of at least one original object, and the method further includes: obtaining an original object whose matching result is greater than a preset result in at least one original object to obtain a push object; and outputting the push object.

[0187] It can be understood by those skilled in the art that Figure 12 The structure shown is for illustration only, and the computer terminal may also be a smart phone (eg, tablet computer, PDA, or mobile internet device (MID), PAD, or other terminal device. Figure 12 It does not limit the structure of the above electronic device. For example, the computer terminal 12 may also include Figure 12 More or fewer components (such as network interfaces, display devices, etc.) shown in, or with Figure 12 Different configurations shown.

[0188] A person skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0189] Example 11

[0190] The embodiment of the present application further provides a storage medium. In the above embodiment of the present application, in this embodiment, the above storage medium can be used to store the program code executed by the object matching method provided in the above embodiment 1.

[0191] In the above embodiment of the present application, in this embodiment, the above storage medium can be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.

[0192] In the above embodiment of the present application, in this embodiment, the storage medium is configured to store program codes for executing the following steps: obtaining an object search request and description information of a target object, wherein the object search request is generated by superimposing multiple retrieval keywords; performing semantic matching on the multiple retrieval keywords and description information using a semantic matching model to obtain a target matching result between the object search request and the target object, wherein the semantic matching model is obtained by training a pre-trained model through the first matching result of the training sample and the second matching result of the adversarial sample, the adversarial sample is generated by superimposing noise data on the training sample, the first matching result is obtained by processing the training sample through the first matching model, the second matching result is obtained by processing the adversarial sample through the second matching model, and the first matching model and the second matching model are obtained by discarding some neurons in the pre-trained model using two different discard rates respectively.

[0193] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0194] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0195] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0196] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0197] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0198] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0199] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. An object matching method, characterized in that: include: Obtaining an object search request and description information of a target object, wherein the object search request is generated by superimposing multiple search keywords; A semantic matching model is used to obtain a pre-trained model trained based on a first loss function and a second loss function, and semantic matching is performed on the multiple retrieval keywords and the description information to obtain a target matching result between the object search request and the target object, wherein the semantic matching model is obtained by training the pre-trained model through the first matching result of the training sample and the second matching result of the adversarial sample, the first loss function is generated based on the second matching result and the preset matching result of the training sample, the second loss function is generated based on the first matching result and the second matching result, the adversarial sample is generated by superimposing noise data on the training sample, the first matching result is obtained by processing the training sample through the first matching model, the second matching result is obtained by processing the adversarial sample through the second matching model, and the first matching model and the second matching model are obtained by discarding some neurons in the pre-trained model using two different discard rates respectively.

2. The method according to claim 1, characterized in that The method further comprises: Obtaining a preset matching result of the training sample; Generating a first loss function based on the second matching result and the preset matching result; generating a second loss function based on the first matching result and the second matching result; Based on the first loss function and the second loss function, the pre-trained model is trained to obtain the semantic matching model.

3. The method according to claim 2, characterized in that Generating a second loss function based on the first matching result and the second matching result includes: Obtaining relative entropy of the first matching result and the second matching result; The second loss function is generated based on the relative entropy.

4. The method according to claim 1, wherein The method further comprises: Obtaining the target gradient of the pre-trained model; The noise data is generated based on the target gradient.

5. The method according to claim 1, wherein Performing semantic matching on the multiple search keywords and the description information using a semantic matching model to obtain a target matching result between the object search request and the target object includes: Splicing the multiple search keywords and the description information to generate a target text; The target text is processed using the semantic matching model to obtain the target matching result.

6. The method according to claim 5, characterized in that Splicing the multiple search keywords and the description information to generate a target text includes: splicing the multiple search keywords and the description information to obtain an original text; Performing word segmentation on the original text to obtain multiple fields; Performing named entity recognition on the multiple fields to obtain attributes corresponding to the multiple fields; Acquire a target field whose attribute is a preset attribute among the multiple fields; The target fields are concatenated to obtain the target text.

7. The method according to any one of claims 1 to 6, characterized in that The target object includes at least one original object, the target matching result includes a matching result of the at least one original object, and the method further includes: Obtaining an original object whose matching result is greater than a preset result from the at least one original object, and obtaining a pushed object; Output the pushed object.

8. An object matching method, characterized in that: include: The cloud server receives an object search request sent by a client, wherein the object search request is generated by superimposing multiple search keywords; The cloud server obtains description information of the target object based on the object search request; The cloud server uses a semantic matching model obtained by training a pre-trained model based on a first loss function and a second loss function to perform semantic matching on the multiple retrieval keywords and the description information to obtain a target matching result between the object search request and the target object, wherein the semantic matching model is obtained by training the pre-trained model through the first matching result of the training sample and the second matching result of the adversarial sample, the first loss function is generated based on the second matching result and the preset matching result of the training sample, the second loss function is generated based on the first matching result and the second matching result, the adversarial sample is generated by superimposing noise data on the training sample, the first matching result is obtained by processing the training sample through the first matching model, and the second matching result is obtained by processing the adversarial sample through the second matching model, and the first matching model and the second matching model are respectively obtained by discarding some neurons in the pre-trained model using two different discard rates; The cloud server outputs the target matching result to the client.

9. A product matching method, characterized in that: include: Obtaining a product search request and title information of a target product, wherein the product search request is generated by superimposing multiple search keywords; A semantic matching model obtained by training a pre-trained model based on a first loss function and a second loss function is used to perform semantic matching on the multiple retrieval keywords and the title information to obtain a target matching result between the product search request and the target product, wherein the semantic matching model is obtained by training the pre-trained model through the first matching result of the training sample and the second matching result of the adversarial sample, the first loss function is generated based on the second matching result and the preset matching result of the training sample, the second loss function is generated based on the first matching result and the second matching result, the adversarial sample is generated by superimposing noise data on the training sample, the first matching result is obtained by processing the training sample through the first matching model, the second matching result is obtained by processing the adversarial sample through the second matching model, and the first matching model and the second matching model are obtained by discarding some neurons in the pre-trained model using two different discard rates respectively.

10. A model training method, characterized in that: include: Acquire a training sample, wherein the training sample includes: a search request sample generated by superimposing multiple keywords, a description sample of a target object, and a preset matching result between the search request sample and the target object; Superimposing noise data on the training sample to generate an adversarial sample; Two different dropout rates are used to drop some neurons in the pre-trained model to obtain the first matching model and the second matching model; Processing the training sample using the first matching model to obtain a first matching result, and processing the adversarial sample using the second matching model to obtain a second matching result; The pre-trained model is trained based on the first matching result, the second matching result and the preset matching result to obtain a semantic matching model, wherein the semantic matching model can also be obtained by training the pre-trained model based on a first loss function and a second loss function, the first loss function is generated based on the second matching result and the preset matching result, and the second loss function is generated based on the first matching result and the second matching result.

11. A storage medium, characterized in that: The storage medium includes a stored program, wherein, when the program is running, the device where the storage medium is located is controlled to execute the object matching method described in any one of claims 1 to 8, or the product matching method described in claim 9, or the model training method described in claim 10.

12. A computer terminal, characterized in that: include: A memory and a processor, the processor being configured to run a program stored in the memory, wherein the program, when running, executes the object matching method described in any one of claims 1 to 8, or the product matching method described in claim 9, or the model training method described in claim 10.

Citation Information

Patent Citations

  • Generalized zero-sample image recognition method based on conditional adversarial automatic encoder

    CN112580722A

  • Generalized zero sample learning method based on multiple-input multiple-output fusion network

    CN112766386A