Search relevance model training method, search relevance determination method and apparatus

By using multiple processing modules in the search relevance model and training the model based on loss, the problem of insufficient interaction in the coarse ranking stage of existing models is solved, improving the processing efficiency and accuracy of the model and adapting to the task requirements of various application scenarios.

CN119646202BActive Publication Date: 2025-12-05BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411668300.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-20
Publication Date
2025-12-05
Estimated Expiration
2044-11-20

AI Technical Summary

Technical Problem

Existing search relevance models have insufficient interaction during the coarse-ranking stage, resulting in poor performance and high training resource and time costs, making it difficult to flexibly adapt to task requirements in different application scenarios.

Method used

The input information is processed using multiple processing modules in the pre-defined model. The model is trained using multiple loss functions to improve the performance of the search relevance model, and it is compatible with multiple processing modules, thereby reducing training resources and time costs.

Benefits of technology

It improves the processing efficiency and accuracy of the search relevance model, and can flexibly call processing modules in different application scenarios to meet various task requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119646202B_ABST
    Figure CN119646202B_ABST
Patent Text Reader

Abstract

The present disclosure provides a search relevance model training method, a search relevance determination method and device, relates to the technical field of artificial intelligence, in particular to the field of natural language processing and deep learning, and can be used in application scenarios such as generative search, document intelligent editing, intelligent assistants, virtual assistants, intelligent e-commerce and the like. The specific implementation scheme is: a plurality of processing modules in a preset model are used to process first input information to obtain a plurality of first output results corresponding to the plurality of processing modules respectively; based on the plurality of first output results, a plurality of losses corresponding to the plurality of processing modules are determined respectively; and the preset model is trained based on the plurality of losses to obtain a search relevance model. According to the embodiment of the present disclosure, the search relevance model can be compatible with the capabilities of the plurality of processing modules, thereby improving the performance of the search relevance model.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the field of artificial intelligence, in particular to the field of natural language processing and deep learning, which can be used in generative search, document intelligent editing, intelligent assistant, virtual assistant, intelligent e-commerce and other application scenarios. BACKGROUND

[0002] Search relevance refers to the degree of relevance between the query words input by the user and the search results in the field of information retrieval. By determining the search relevance, the search results that best match the query words can be provided. The search relevance model aims to quantify the matching degree between the candidate search results and the query words to support the screening and sorting of the candidate search results according to the relevance score. Search relevance discrimination is a crucial link in search engines, and therefore, how to improve the performance of the search relevance model needs to be considered. SUMMARY

[0003] The present disclosure provides a search relevance model training method, a search relevance determination method and device.

[0004] According to an aspect of the present disclosure, a search relevance model training method is provided, comprising:

[0005] processing the first input information using a plurality of processing modules in the preset model to obtain a plurality of first output results corresponding to the plurality of processing modules respectively; wherein the first input information at least includes first query information and first search information; each processing module in the plurality of processing modules is used to process information corresponding to the processing module in the first input information according to the information type; and the plurality of first output results are used to represent the search relevance between the first query information and the first search information;

[0006] determining a plurality of losses corresponding to the plurality of processing modules based on the plurality of first output results;

[0007] training the preset model based on the plurality of losses to obtain a search relevance model.

[0008] According to another aspect of the present disclosure, a search relevance determination method is provided, comprising:

[0009] obtaining second input information; wherein the second input information at least includes second query information and second search information;

[0010] determining a target module in the plurality of processing modules in the search relevance model according to the information type in the second input information;

[0011] The target module is used to process the second query information and the second search information, to obtain a second output result; the second output result is used to represent a search correlation between the second query information and the second search information.

[0012] According to another aspect of the present disclosure, a training device of a search correlation model is provided, comprising:

[0013] The model output module is configured to process the first input information by using a plurality of processing modules in the preset model, to obtain a plurality of first output results corresponding to the plurality of processing modules respectively; the first input information at least includes first query information and first search information; each processing module in the plurality of processing modules is configured to process information corresponding to the processing module in the first input information according to the information type; and the plurality of first output results are used to represent a search correlation between the first query information and the first search information.

[0014] The loss determination module is configured to determine a plurality of losses corresponding to the plurality of processing modules based on the plurality of first output results.

[0015] The model training module is configured to train the preset model based on the plurality of losses, to obtain the search correlation model.

[0016] According to another aspect of the present disclosure, a determination device of a search correlation is provided, comprising:

[0017] The acquisition module is configured to acquire second input information; the second input information at least includes second query information and second search information.

[0018] The determination module is configured to determine a target module in the plurality of processing modules in the search correlation model according to an information type in the second input information.

[0019] The processing module is configured to process the second query information and the second search information by using the target module, to obtain a second output result; the second output result is used to represent a search correlation between the second query information and the second search information.

[0020] According to another aspect of the present disclosure, an electronic device is provided, comprising:

[0021] at least one processor; and

[0022] a memory in communication with the at least one processor; wherein

[0023] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method of any of the embodiments of the present disclosure.

[0024] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause the computer to perform any of the methods according to embodiments of this disclosure.

[0025] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements any of the methods according to embodiments of this disclosure.

[0026] The technical solution of this disclosure embodiment includes a preset model with multiple processing modules for determining search relevance. By using multiple losses corresponding to the multiple processing modules to train the model, a search relevance model is obtained, which improves the performance of the search relevance model in determining search relevance. Furthermore, it can flexibly call different processing modules based on the information type of the input information, realizing the ability to be compatible with multiple processing modules in one model, and can more flexibly support the task requirements in different application scenarios.

[0027] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0028] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:

[0029] Figure 1 This is a schematic diagram of the twin-tower model;

[0030] Figure 2 This is a schematic diagram of the LLM attention mechanism;

[0031] Figure 3 This is a flowchart illustrating a training method for a search relevance model provided in an embodiment of this disclosure;

[0032] Figure 4 This is a schematic diagram of the attention mechanism in a search relevance model according to an embodiment of the present disclosure;

[0033] Figure 5 This is a schematic flowchart of a search relevance determination method provided in an embodiment of this disclosure;

[0034] Figure 6 This is a schematic block diagram of a training apparatus for a search relevance model provided in an embodiment of this disclosure;

[0035] Figure 7 This is a schematic block diagram of a training apparatus for a search relevance model provided in another embodiment of this disclosure;

[0036] Figure 8This is a schematic block diagram of a search relevance determination device provided in an embodiment of the present disclosure;

[0037] Figure 9 This is a block diagram of an electronic device used to implement the methods of the embodiments of this disclosure. Detailed Implementation

[0038] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0039] To facilitate understanding of the training of the search relevance model and the search relevance determination method provided in the embodiments of this disclosure, the relevant technologies of the embodiments of this disclosure are described below. The following relevant technologies are optional solutions and can be arbitrarily combined with the technical solutions of the embodiments of this disclosure, and they all fall within the protection scope of the embodiments of this disclosure.

[0040] The retrieval system is a multi-stage funnel of recall, coarse ranking, and fine ranking. In the coarse ranking stage, there are relatively many candidate search results and computational resources are relatively scarce, so a dual-tower model can be chosen as the model selection for the coarse ranking stage. In the fine ranking stage, there are relatively few candidate search results and computational resources are relatively abundant, so a single-tower model can be chosen.

[0041] Taking search advertising as an example, Figure 1 A schematic diagram of the twin-tower model is shown, as follows: Figure 1 As shown, the dual-tower model uses an encoder (e.g., a Transformer) to encode information from the query side and the ad (AD) side separately, obtaining query embedding (a vector embedding query information, simply called the query vector) and ad embedding (a vector embedding the ad, simply called the AD vector). Finally, at the top layer, a deep neural network (DNN) is used to perform a simple interaction between the query embedding and the AD embedding to obtain a predicted score for search relevance. In contrast, the single-tower model inputs query-side and ad-side information together into the encoder for joint encoding. Therefore, the query-side and ad-side information can interact fully in the single-tower model, so the single-tower model generally outperforms the dual-tower model.

[0042] Search relevance, in the field of information retrieval, measures the degree of relevance between query terms and search results, aiming to provide search results that best match the user's intent. Search relevance models quantify the degree of matching between search results and query terms, and filter and rank search results based on relevance probability scores.

[0043] Search relevance assessment is a crucial part of search engines. The search relevance model is used in the fine-grained and coarse-grained ranking stages of the system. Due to insufficient interaction between the two-tower model, the model capability in the coarse-grained ranking stage is significantly lower than that in the fine-grained ranking stage.

[0044] In the above method, supervised learning can be used to discriminate and score query terms and search results to obtain labeled data, and a scoring model can be trained on the labeled data.

[0045] Alternatively, another approach is to train the LLM (Large Language Model) using a fine-tuning instruction method based on generative approaches. Specifically, each sample is constructed as an input-output pair. The input is textual information (input text), which may include a task description (called an instruction), query terms, and search results. The output is the generation target, which may include relevance information and corresponding justifications. Attention mechanisms are commonly used in LLMs to generate the output content. Figure 2 A schematic diagram of the attention mechanism in LLM is shown, as follows. Figure 2 As shown, the LLM attention mechanism is divided into two parts. For the input text, a bidirectional attention mechanism is used, that is, the input text interacts with itself and also with the generation target, namely the relevance and the scoring reason. For the generation target, a unidirectional attention mechanism is used, that is, the relevance and the scoring reason only interact with themselves.

[0046] In the technical solution of this disclosure embodiment, multiple processing modules in a preset model can be used to process the first input information respectively. Then, based on multiple first output results, multiple losses corresponding to the multiple processing modules are determined. Finally, the preset model is trained based on the multiple losses to obtain a search relevance model. Compared with training multiple processing modules separately, this reduces the cost of training resources and time, effectively improving training efficiency. Furthermore, since the multiple processing modules in the preset model have the same task objective, they can mutually promote each other when training the preset model based on multiple losses, thereby improving the processing efficiency and accuracy of the trained search relevance model. When applying the search relevance model, different processing modules can be flexibly called according to the information type of the input information, realizing the ability to be compatible with multiple processing modules in one model, and more flexibly supporting the task requirements in different application scenarios.

[0047] The training method for the search relevance model provided in this disclosure can be applied to model training for search relevance in any domain. For example, in the field of advertising recommendation, the training method for the search relevance model can be applied to model training related to advertising recommendation, specifically, it can be applied to model training for judging the search relevance between candidate advertisements (i.e., candidate search results) and user-input query information.

[0048] Figure 3 This disclosure illustrates a method for training a search relevance model according to an embodiment. This method can be applied to a training apparatus for the search relevance model, which can be deployed in an electronic device. The electronic device can be a single-machine or multi-machine terminal, server, or other processing device. The terminal can be a mobile device, a personal digital assistant (PDA), a handheld device, a computing device, an in-vehicle device, a wearable device, or other user equipment (UE); the server can be a single-machine server or a server cluster. In some possible implementations, the method can also be implemented by a processor calling computer-readable instructions stored in memory. Figure 3 As shown, the method may include the following steps S310 to S330.

[0049] Step S310: Use multiple processing modules in the preset model to process the first input information to obtain multiple first output results corresponding to the multiple processing modules respectively.

[0050] The first input information includes at least the first query information and the first search information.

[0051] In this embodiment of the disclosure, the query information may include query terms used to initiate a search / retrieval, generally referred to as a query. The first query information can be understood as the query terms in the samples used during model training. Optionally, the query information may include one or more forms of information such as text, images, and speech, so that the model can be applied to scenarios where retrieval is performed using one or more forms such as text, images, and speech.

[0052] In this embodiment of the disclosure, the search information may include the information being searched / retrieved, or the information to be matched with the query information. In some application scenarios, information matching the query information can be searched in a specific database based on the query information, and any information in that database can be used as the search information. In other words, the search information may include candidate search results. The first search information can be understood as the search information in the samples used during model training. Optionally, the search information may include one or more forms of information such as text, images, and speech.

[0053] Each of the multiple processing modules is used to process information in the first input information whose information type corresponds to that processing module.

[0054] In this embodiment, the preset model can be understood as a model composed of multiple processing modules, where each processing module may have different functions and structures, and each processing module corresponds to a different information type. The first input information input into the preset model can include various types of information. Each processing module can process the information according to its corresponding information type and obtain a first output result. For example, the first input information includes first query information, first search information, and identifier A. The preset model includes processing module 1 corresponding to the query information and search information, and processing module 2 corresponding to the query information, search information, and identifier A. Therefore, processing module 1 processes the first query information and first search information, but does not process identifier A; processing module 2 processes the first query information, first search information, and identifier A. Processing module 1 and processing module 2 each obtain their respective first output results.

[0055] Multiple first output results are used to characterize the search relevance between the first query information and the first search information. Optionally, each of the multiple first output results can be used to characterize the search relevance between the first query information and the first search information. For example, the first output results may include a relevance score, i.e., a probability score indicating that the first search information and the first query information are related; the first output results may also include text (i.e., a textual description) used to describe the relevance between the first query information and the first search information. The first search results output by different processing modules may include content in different forms or content in the same form. Here, form can be understood as modality, such as score, text, image, voice, etc.

[0056] For example, the first output of processing module 1 may include a relevance score; the first output of processing module 2 may include a relevance score and / or text (e.g., text explaining the scoring reason). It is understood that, due to the different functions and structures of processing module 1 and processing module 2, there is no necessary correlation between the score obtained by processing module 1 and the score obtained by processing module 2; for example, the scores may be different.

[0057] Optionally, any processing module in the preset model can be a deep learning model, such as LLM, discriminative model, etc.

[0058] Step S320: Based on multiple first output results, determine multiple losses corresponding to multiple processing modules respectively.

[0059] Optionally, the expected output of each processing module can be set in advance for the first query information and the first search information, so as to determine the loss corresponding to each processing module according to the difference between the expected result and the actual first output result of the processing module.

[0060] For example, when the first output includes a relevance score, the expected result may include the expected score (e.g., a manually labeled score, also known as a labeled score), and the loss can be determined based on the difference between the relevance score and the expected score. When the first output includes a text description, the expected result may include the expected text (e.g., pre-labeled scoring reasons, also known as scoring reason text). Optionally, the loss can be determined based on the similarity between the text description in the first output and the expected text.

[0061] Step S330: Train the preset model based on multiple losses to obtain the search relevance model.

[0062] In this embodiment of the disclosure, training a preset model based on multiple losses can include: optimizing the parameters in the preset model based on multiple losses. For example, the parameters of each processing module in the preset model can be optimized separately. When the preset model converges, it can be determined as a search relevance model, that is, compared with the preset model, the search relevance model can more accurately output information representing the search relevance between query information and search information.

[0063] Optionally, different weights can be pre-set for each loss, and the preset model can be trained based on each loss and its corresponding weight to obtain a search relevance model, which can provide users with more personalized and accurate services.

[0064] Optionally, the number of first input information can be multiple, such as using multiple samples. For each sample, multiple first output results corresponding to each processing module are obtained, and the loss corresponding to each processing module is calculated, thereby updating the parameters to reduce the loss. Furthermore, the steps of running the processing modules, calculating the loss, and updating the parameters can be iterated multiple times to ensure that the loss reaches a preset convergence condition, thereby further improving the accuracy of the search relevance model. The specific convergence condition can be set according to actual needs, such as based on the number of iterations, the degree of loss convergence, or the model accuracy. For example, it could be that the loss no longer decreases or the loss is less than a preset value.

[0065] Optionally, the search relevance model can be used to determine a second output result based on the second query information and the second search information. The second query information can be a query term entered by the user in an actual information retrieval scenario; the second search information can be candidate search results for the second query information. That is, in this embodiment of the disclosure, the search relevance model can be applied in actual retrieval. The second output result is used to characterize the search relevance between the second query information and the second search information. For example, the second output result may include a relevance score between the second query information and the second search information, or text used to evaluate the search relevance between the second query information and the second search information. Optionally, if the second output result meets preset conditions, such as a high relevance score, the second search information can be recommended to the user.

[0066] Optionally, there can be multiple second search information. The search relevance between each second query information and the second search information is calculated using a search relevance model, so that the second search information with a high search relevance to the second search information can be recommended to the user.

[0067] In the technical solution of this disclosure embodiment, multiple processing modules in a preset model can be used to process the first input information respectively. Then, based on multiple first output results, multiple losses corresponding to the multiple processing modules are determined. Finally, the preset model is trained based on the multiple losses to obtain a search relevance model. The search relevance model can accommodate the capabilities of multiple processing modules, improving the performance of the search relevance model. Compared with training multiple processing modules separately, it reduces the cost of training resources and time, effectively improving training efficiency. Furthermore, since the multiple processing modules in the preset model have the same task objective, when training the preset model based on multiple losses, the multiple processing modules can promote each other, thereby improving the processing efficiency and accuracy of the trained search relevance model.

[0068] In some embodiments, the plurality of processing modules in the preset model includes a generation module. Optionally, the generation module may be implemented based on a generative model, for example, the generation module may adopt an LLM structure.

[0069] In the above embodiments, the first input information includes at least first query information, first search information, and scoring reason text. Optionally, the scoring reason text can be manually annotated based on the first query information and the first search information. Correspondingly, the above-mentioned multiple losses include the generation loss corresponding to the generation module, which is determined based on the first output result corresponding to the generation module and the scoring reason text in the first input information. The first output result corresponding to the generation module includes the first target text, that is, the first output result corresponding to the generation module includes information in text form. Optionally, the first target text can be used to evaluate the search relevance between the first query information and the first search information. For example, the first target text can be similar to a scoring reason, describing the reasons and degree of relevance between the first search information and the first query information.

[0070] Specifically, step S310 above involves processing the first input information using multiple processing modules in a preset model to obtain multiple first output results corresponding to the multiple processing modules, including:

[0071] Using the generation module, first attention information is generated based on the scoring reason text, first query information, and first search information in the first input information, and the first target text is obtained based on the first attention information.

[0072] In this embodiment of the disclosure, the multiple processing modules in the preset model include a generation module. In the generation module, each element in the scoring reason text can interact with each element in the first query information and each element in the first search information. Furthermore, each element in the scoring reason text can also interact with itself, thereby obtaining the interaction results of the aforementioned elements. This interaction result is the first attention information. Based on the first attention information, the generation module finally generates the first target text, which can evaluate the search relevance between the first query information and the first search information.

[0073] For example, the first query information, the first search information, and the scoring reason text can each be decomposed into multiple tokens (also known as tokens or marks, equivalent to the elements mentioned above), each token corresponding to a single character, word, or special symbol. Further, each token in the scoring reason text interacts with each token in the first query information, and each token in the scoring reason text interacts with each token in the first search information, as well as with other tokens in the scoring reason text and itself. This interaction can be understood as information fusion, such as multiplication, addition, multiplication after encoding, and addition after encoding. The interaction results obtained from these various interactions are used as attention information. This attention information contains the calculation results corresponding to each token in the first input information, and these calculation results can be used to adjust the encoder's attention level to each token in the generation module, ultimately generating the first target text.

[0074] Furthermore, based on the first target text and the scoring reason text in the first input information, the generation loss among multiple losses can be determined, thereby training a search relevance model based on the generation loss, so that the model is compatible with generation capabilities.

[0075] According to the above embodiments, a generation module is set in the preset model. Scoring reason text is added to the first input information, and the generation module can obtain the first target text. Multiple first output results include the first target text, improving the interpretability of the first output results. Furthermore, based on the first target text and the scoring reason text, a generation loss can be determined among multiple losses. Therefore, the search relevance model trained based on the generation loss can be compatible with generation capabilities, further improving the performance of the search relevance model.

[0076] It is understood that, according to the above embodiments, the generation loss corresponding to the generation module is determined based on the generated first target text and the scoring reason text. That is, the generation target of the generation module is the scoring reason text, or in other words, the generation target is that the first target text and the scoring reason text tend to be consistent. Therefore, for the search relevance model obtained after training, when the information input to the model contains a text start character (generation identifier), the generation module will start generating the first target text describing the scoring reason based on the start character.

[0077] In some embodiments, multiple processing modules include a single-tower discrimination module. The single-tower discrimination module can be implemented based on a single-tower model. For example, the single-tower discrimination module is used to jointly encode the first query information and the first search information in the first input information and output a relevance score. Second attention information can be used to adjust the degree of attention paid to each element in the first input information during the joint encoding process. For the single-tower discrimination module, a first single-tower identifier can be added to the first input information. The first single-tower identifier can be a fixed piece of information, such as an identifier or a piece of text, which can be used to describe the search relevance discrimination task to improve the discrimination capability of the single-tower discrimination module. The first single-tower identifier can be used to interact with the first query information and the first search information to obtain attention information.

[0078] Accordingly, the aforementioned multiple losses include the single-tower discrimination loss corresponding to the single-tower discrimination module. The single-tower discrimination loss is determined based on the first output result corresponding to the single-tower discrimination module and the annotation score corresponding to the first input information. Specifically, the first output result corresponding to the single-tower discrimination module includes a first relevance score between the first query information and the first search information. Optionally, a higher first relevance score indicates a higher search relevance between the first query information and the first search text.

[0079] Specifically, step S310 above involves processing the first input information using multiple processing modules in a preset model to obtain multiple first output results corresponding to the multiple processing modules, including:

[0080] Using the single-tower discrimination module, second attention information is generated based on the first single-tower identifier, first query information, and first search information in the first input information, and a first relevance score is obtained based on the second attention information.

[0081] Furthermore, based on the first relevance score and the labeled score corresponding to the first input information, the single-tower loss among multiple losses can be determined, so that the search relevance model trained based on the single-tower loss can be compatible with the single-tower discrimination capability.

[0082] According to the above embodiments, by adding a first single-tower identifier to the first input information, a first relevance score can be obtained through the single-tower discrimination module. The first relevance score is included in multiple first output results, thereby accurately representing the search relevance score between the first query information and the first search information. Furthermore, based on the first relevance score and the labeled score, a single-tower loss can be determined among multiple losses. Therefore, the search relevance model trained based on the single-tower loss can be compatible with single-tower discrimination capabilities, further improving the performance of the search relevance model, such as increasing the accuracy of the judgment.

[0083] It is understood that, according to the above embodiments, for the search relevance model obtained after training, when the information input to the model contains a single-tower identifier, the single-tower discrimination module will process the input information and output the first relevance score.

[0084] In some embodiments, second attention information is generated based on the first single-tower identifier, the first query information, and the first search information in the first input information, including:

[0085] The first query information and the first search information are concatenated to obtain the concatenated information;

[0086] Second attention information is generated based on the interaction between each element in the first single-tower identifier and each element in the spliced ​​information.

[0087] In this embodiment of the disclosure, the splicing information can be the splicing result of any one of the following: text, special characters, token, or corresponding vector or encoded information in the first query information and the first search information.

[0088] In this embodiment of the disclosure, each element in the first single-tower identifier can be understood as one of the following: each character in the first single-tower identifier, a special character, a token in the first single-tower identifier, or a corresponding vector or encoded information. Similarly, each element in the concatenation information can be understood as one of the following: each character in the concatenation information, a special character, a token in the concatenation information, or a corresponding vector or encoded information.

[0089] Optionally, multiple tokens corresponding to the first query information and the first search information can be concatenated to obtain concatenated information. For each token in the concatenated information, or any token, it is interacted with each token in the first single-tower identifier to obtain second attention information. It can be understood that the second attention information contains the calculation result corresponding to each token in the concatenated information, and the degree of attention of the encoder in the single-tower discrimination module to each token can be adjusted using this calculation result.

[0090] According to the above embodiments, by concatenating the first query information and the first search information, the single-tower model can input the first query information and the first search information together into the encoder for joint encoding. The first query information and the first search information can interact fully, thereby accurately generating the second attention information.

[0091] In some embodiments, the multiple processing modules include a dual-tower discrimination module. The dual-tower discrimination module can be implemented based on a dual-tower model. For example, the dual-tower discrimination module is used to encode the first query information and the first search information in the first input information respectively, and then determine the relevance score based on the encoding results of the two. Third attention information can be used to adjust the degree of attention paid to each element in the first input information during the encoding process.

[0092] Accordingly, multiple losses include the dual-tower discrimination loss corresponding to the dual-tower discrimination module, which is determined based on the first output result corresponding to the dual-tower discrimination module and the annotation score corresponding to the first input information; the first output result corresponding to the dual-tower discrimination module includes a second relevance score between the first query information and the first search information. Optionally, the higher the second relevance score, the higher the search relevance between the first query information and the first search text can be considered.

[0093] Specifically, step S310 above involves processing the first input information using multiple processing modules in a preset model to obtain multiple first output results corresponding to the multiple processing modules, including:

[0094] Using the dual-tower discrimination module, a third attention information is generated based on the first query information and the first search information in the first input information, and a second relevance score is obtained based on the third attention information.

[0095] Furthermore, based on the second relevance score and the labeled score corresponding to the first input information, the dual-tower loss among multiple losses can be determined, so that the search relevance model trained based on the dual-tower loss can be compatible with the dual-tower discrimination capability.

[0096] According to the above embodiments, a second relevance score can be obtained through the dual-tower discrimination module, and the second relevance score is included in multiple first output results, thereby accurately representing the search relevance between the first query information and the first search information. Furthermore, based on the second relevance score and the labeled score, a dual-tower loss can be determined among multiple losses. Therefore, the search relevance model trained based on the dual-tower loss can be compatible with dual-tower discrimination capabilities, which can further improve the performance of the search relevance model, such as improving the efficiency of the determination.

[0097] It is understood that, according to the above embodiments, for the search relevance model obtained after training, when the information input to the model includes the first search information and the first query information, the dual-tower discrimination module will process the input information and output the second relevance score.

[0098] In some embodiments, third attention information is generated based on the first query information and the first search information in the first input information, including:

[0099] Based on the interactions between the elements in the first query information and the interactions between the elements in the first search information, third attention information is generated.

[0100] In this embodiment of the disclosure, each element in the first query information can be understood as one of the following: each character in the first query information, a special character, a token in the first single-tower identifier, or a corresponding vector or encoded information. Similarly, each element in the first search information can be understood as one of the following: each character in the first search information, a special character, a token in the concatenated information, or a corresponding vector or encoded information.

[0101] Optionally, multiple tokens corresponding to the first query information and the first search information can be obtained respectively. Then, for each token in the first query information, it interacts with other tokens in the first query information and itself one by one; and for each token in the first search information, it interacts with other tokens in the first query information and itself one by one. All interaction results are aggregated into third attention information. It can be understood that the second attention information contains the calculation results corresponding to each token in the first query information and the first search information, and the calculation results can be used to adjust the degree of attention of the encoder in the dual-tower discrimination module to each token.

[0102] According to the above embodiments, the elements in the first query information and the elements in the first search information in the dual-tower model interact with each other, thereby generating third attention information, reducing the computational complexity of attention information, and improving efficiency.

[0103] It should be noted that the above embodiments can be implemented in combination. For example, multiple processing modules may include two or three of the generation module, single-tower discrimination module, and dual-tower discrimination module. In this way, the search relevance model can simultaneously possess the performance of the two or three modules. Furthermore, since the two or three modules have the same task objective, they can mutually promote each other during training, thereby improving the processing efficiency and accuracy of the trained search relevance model.

[0104] In some embodiments, step S330, training a preset model based on multiple losses to obtain a search relevance model, includes:

[0105] Determine the total loss based on multiple losses;

[0106] The search relevance model is obtained by training the preset model based on the total loss.

[0107] In this embodiment, multiple losses can be calculated to obtain a total loss. Training a preset model based on the total loss can effectively provide the loss information from each module to a single module for parameter optimization, thereby enhancing the mutual promotion effect and effectively improving the processing efficiency and accuracy of the trained search relevance model.

[0108] The specific calculation method can be set according to actual needs. For example, multiple losses can be added together to obtain the total loss.

[0109] In some practical applications, the total loss can be obtained by adding the dual-tower discrimination loss corresponding to the dual-tower discrimination module, the single-tower discrimination loss corresponding to the single-tower discrimination module, and the generation loss corresponding to the generation module. The search relevance model trained based on the total loss has dual-tower discrimination capability, single-tower discrimination capability, and generation capability.

[0110] In one embodiment, such as Figure 4 As shown, Figure 4 This is a schematic diagram of the attention mechanism in a search relevance model according to an embodiment of the present disclosure.

[0111] During model training, a single sample from the training dataset serves as the first input, including query information, search information, and single-tower identifiers (identifiers used to prompt for single-tower discrimination). Each sample is labeled with a scoring reason text and a score. During model training, the query information, search information, single-tower identifiers, and scoring reason text are input into the model. After each piece of information is encoded, an attention mechanism is executed.

[0112] As can be seen, the attention mechanism in the model includes third attention information 410, second attention information 420, and first attention information 430. Third attention information 410 is used for the dual-tower discrimination module, and it includes the calculation results of the interaction between the query information and itself, as well as the calculation results of the interaction between the search information and itself. Second attention information 420 is used for the single-tower discrimination module, which concatenates the query and search information. It includes the calculation results of the interaction between the single-tower identifier and each element of the concatenated information. First attention information 430 is used for the generation module, which generates element-by-element data from the target text based on the scoring reason text. For each generated element, it performs interaction calculations with each previously generated element and each element in the concatenated information. The resulting first attention information 430 includes the calculation results corresponding to each element in the generated target text. This achieves an improvement in the attention mechanism.

[0113] The single-tower discrimination module, dual-tower discrimination module, and generation module in the model encode outputs based on the aforementioned attention information during the encoding process. The dual-tower discrimination module outputs the second relevance score, the single-tower discrimination module outputs the first relevance score, and the generation module outputs the text T0…[EOS]. Each output result is compared with the labeled score and the text explaining the scoring to determine the corresponding loss, and then the total loss is obtained for parameter optimization of the entire model.

[0114] When applying the model, a second input information can be input into the model. This second input information includes at least query information and search information. Optionally, it may also include a single-tower identifier and a generation identifier (text start character). When the second input information includes a single-tower identifier, the single-tower discrimination module and the dual-tower discrimination module will process the second input information; the specific processing procedure can be found in the training process of the single-tower discrimination module and the dual-tower discrimination module. When the second input information includes a generation identifier, the dual-tower discrimination module and the generation module will process the second input information; the specific processing procedure can be found in the training process of the dual-tower discrimination module and the generation module. When the second input information does not include either a single-tower identifier or a generation identifier, the dual-tower discrimination module will process the second input information; the specific processing procedure can be found in the training process of the dual-tower discrimination module.

[0115] As can be seen, through the above technical solution, because the model has multiple processing modules, it possesses the capabilities of multiple processing modules. Since the task objectives of these multiple processing modules are consistent, they mutually support each other during training, improving the performance of each individual processing module. Secondly, the model can be compatible with multiple capabilities and correspond to multiple modes. For example, using only the dual-tower discrimination module can improve relevance discrimination efficiency in scenarios requiring high efficiency; using both dual-tower and single-tower discrimination modules can leverage the single-tower module to enhance the performance of the dual-tower discrimination module; using both dual-tower discrimination and generation modules can utilize the generation module to simultaneously output generation reasons; and using a combination of dual-tower, single-tower, and generation modules can leverage the single-tower discrimination module to enhance the performance of the dual-tower discrimination module while simultaneously outputting generation reasons. In short, a single model is compatible with dual-tower discrimination, single-tower discrimination, and generation tasks, flexibly addressing the needs of different scenarios.

[0116] Figure 5This disclosure illustrates a method for determining search relevance according to an embodiment of the present disclosure. This method can be applied to a search relevance determination apparatus, which can be deployed in an electronic device. The electronic device may be a single-machine or multi-machine terminal, server, or other processing device. The terminal may be a mobile device, PDA, handheld device, computing device, vehicle-mounted device, wearable device, or other user device; the server may be a single-machine server or a server cluster. In some possible implementations, the method can also be implemented by a processor calling computer-readable instructions stored in memory. Figure 5 As shown, the method may include the following steps S510 to S530.

[0117] Step S510: Obtain second input information; wherein, the second input information includes at least second query information and second search information;

[0118] Step S520: Based on the information type in the second input information, determine the target module among multiple processing modules in the search relevance model;

[0119] Step S530: Process the second query information and the second search information using the target module to obtain the second output result; wherein, the second output result is used to characterize the search relevance between the second query information and the second search information.

[0120] The search relevance determination method provided in this disclosure can be applied to information retrieval in any field. For example, in the field of advertising recommendation, the second query information may include query terms targeting advertising information, and the second search information may include advertising information.

[0121] In this embodiment, the search relevance model obtained by the training method of the above-described search relevance model can be applied in actual retrieval. The second input information may include second query information and second search information (candidate search results). The second query information may include query terms input by the user to initiate a search / retrieval. The second query information may include one or more forms of information such as text, images, and speech, that is, the above method can be applied to scenarios where retrieval is performed using one or more forms such as text, images, and speech. The second search information can be any candidate search result in the database. Optionally, the second search information may include one or more forms of information such as text, images, and speech. By processing the second query information and the second search information through the target module in the search relevance model, a second output result can be obtained. The second output result can characterize the search relevance between the second query information and the second search information. When the search relevance is high, the second search information can be recommended to the user.

[0122] In this embodiment of the disclosure, the second input information may include multiple information types, such as user-inputted identification information. The information type is used to determine the module responsible for performing the task, i.e., the target module, among multiple processing modules in the search relevance model; different information types can be used to determine which target module to invoke.

[0123] Optionally, there can be multiple target modules. When multiple target modules are used to process the second query information and the second search information, the task objectives of the multiple target modules are consistent. They are all used to evaluate the search relevance between the second query information and the second search information. Therefore, the multiple target modules can promote each other, thereby improving the efficiency and accuracy of obtaining the second output result.

[0124] Optionally, the second output can be a relevance score and / or a textual description, that is, the search relevance between the second query information and the second search information can be characterized by the relevance score and / or textual description.

[0125] According to the above embodiments, the target module can be determined from multiple processing modules in the search relevance model based on the information type in the second input information. The target module then processes the second query information and the second search information to obtain the second output result, thereby accurately determining the search relevance between the second query information and the second search information. By flexibly calling different processing modules based on the information type of the input information, the model achieves compatibility with multiple processing modules, enabling more flexible support for task requirements in different application scenarios.

[0126] In some embodiments, step S520, determining the target module among multiple processing modules in the search relevance model based on the information type in the second input information, includes:

[0127] When the second input information includes a generation identifier, the generation module among the multiple processing modules is identified as the target module; wherein, the generation module is used to generate a second target text based on the generation identifier, and the second target text is used to evaluate the search relevance between the second query information and the second search information.

[0128] In this embodiment of the disclosure, the generation identifier is used to determine the generation module among multiple processing modules as the target module. The fourth attention information can be determined based on the second query information, the second search information and the generated elements in the second input information, and the second output result corresponding to the generation module can be obtained based on the fourth attention information. The second output result is the second target text, which can evaluate the search relevance between the second query information and the second search information.

[0129] In the above process, the starting token in the second query information and the second search information can be determined by generating an identifier. Interaction can be started based on the starting token, and each token in the second query information and the second search information can be interacted with in turn to generate the fourth attention information.

[0130] According to the above embodiments, the generation module can be invoked by generating an identifier to process the second query information, the second query information, and the generation identifier, thereby generating the second target text and evaluating the search relevance between the second query information and the second search information. For other technical details in the generation module, please refer to the processing procedure of the generation module in the aforementioned training method; these will not be elaborated upon here.

[0131] In some embodiments, step S520, determining the target module among multiple processing modules in the search relevance model based on the information type in the second input information, includes:

[0132] When the second input information includes a single-tower identifier, the single-tower discrimination module among the multiple processing modules is identified as the target module; wherein, the single-tower discrimination module is used to determine the first relevance score between the second query information and the second search information based on the single-tower identifier, the second query information, and the second search information.

[0133] In this embodiment of the disclosure, the single-tower identifier is used to determine the single-tower discrimination module among multiple processing modules as the target module. Based on the single-tower identifier, the second query information, and the second search information in the second input information, a fifth attention information can be generated, and a second output result corresponding to the single-tower discrimination module can be obtained based on the fifth attention information. The second output result is the first relevance score between the second query information and the second search information.

[0134] Furthermore, the second query information and the second search information can be concatenated to obtain concatenated information. Based on the interaction between each element in the single tower identifier and each element in the concatenated information, the fifth attention information is generated.

[0135] According to the above embodiments, the single-tower identifier can be used to call the single-tower discrimination module to process the single-tower identifier, the second query information, and the second search information, thereby outputting a second relevance score between the second query information and the second search information. For other technical details in the single-tower discrimination module, please refer to the processing procedure of the single-tower discrimination module in the aforementioned training method; these will not be elaborated upon here.

[0136] In some embodiments, step S520, determining the target module among multiple processing modules in the search relevance model based on the information type in the second input information, includes:

[0137] If the second input information does not include a pattern identifier, the dual-tower discrimination module among the multiple processing modules is identified as the target module; wherein, the dual-tower discrimination module is used to determine the second relevance score between the second query information and the second search information based on the second query information and the second search information.

[0138] In this embodiment of the disclosure, the pattern identifier may include the above-mentioned generation identifier and / or single-tower identifier. That is, when the second input information does not include the generation identifier and / or single-tower identifier, the dual-tower discrimination module among the multiple processing modules can be determined as the target module. The sixth attention information can be generated based on the second query information and the second search information in the second input information, and the second output result corresponding to the dual-tower discrimination module can be obtained based on the sixth attention information. The second output result is the second relevance score between the second query information and the second search information.

[0139] Furthermore, a sixth attention information can be generated based on the interactions between the elements in the second query information and the interactions between the elements in the second search information.

[0140] According to the above embodiments, even when the second input information does not include a pattern identifier, the dual-tower discrimination module can be invoked to process the second query information and the second search information, thereby outputting a second relevance score between the second query information and the second search information. For other technical details in the dual-tower discrimination module, please refer to the processing procedure of the dual-tower discrimination module in the aforementioned training method; these will not be elaborated upon here.

[0141] In some practical applications, the second input information may include second query information, second search information, a generated identifier, and a second single-tower identifier. The target module in the corresponding search relevance model may include a generation module, a single-tower discrimination module, and a dual-discrimination module. Through these target modules, the second target text, the second relevance score, and the second relevance score can be obtained and displayed to the user. The second target text can provide the reasoning for the second relevance score. Furthermore, the average of the second relevance score and the second relevance score can be determined as the relevance score between the second query information and the second search information, and the relevance score and the second target text can be displayed to the user.

[0142] In one example, the first query could be "a certain spoken English." The first search could be "Study abroad planning, study abroad planning team provides study abroad assessment, helps you choose your ideal university." The second query, second search, generated identifier, and second single-tower identifier can be used as the second input information. The search relevance model outputs the second target text, the second relevance score, and the second relevance score. Based on the second relevance score and the second relevance score, the relevance score between the first query and the first search is determined to be 0. The reason (i.e., the second target text) is that the first query "a certain spoken English" relates to the spoken English section of a certain exam, while the search results mainly focus on study abroad planning and university selection, without mentioning content related to "a certain spoken English," resulting in low relevance.

[0143] As can be seen, the method provided in this embodiment utilizes multiple processing modules in a preset model to process the first input information, then determines multiple losses corresponding to each processing module based on multiple first output results, and finally trains the preset model based on these multiple losses to obtain a search relevance model. Compared to training multiple processing modules separately, this reduces the cost in terms of training resources and time, effectively improving training efficiency. Furthermore, since the multiple processing modules in the preset model have the same task objective, they can mutually promote each other when training the preset model based on multiple losses, thereby improving the processing efficiency and accuracy of the trained search relevance model. When applying the search relevance model, different processing modules can be flexibly invoked based on the type of input information, realizing the ability to be compatible with multiple processing modules in one model, and more flexibly supporting the task requirements in different application scenarios.

[0144] According to embodiments of this disclosure, this disclosure also provides a training apparatus for a search relevance model. Figure 6 A schematic block diagram of a training apparatus for a search relevance model provided in an embodiment of this disclosure is shown, such as... Figure 6 As shown, the device includes:

[0145] The model output module 610 is used to process the first input information using multiple processing modules in a preset model to obtain multiple first output results corresponding to the multiple processing modules respectively; wherein, the first input information includes at least first query information and first search information; each of the multiple processing modules is used to process the information in the first input information whose information type corresponds to that processing module; the multiple first output results are used to characterize the search relevance between the first query information and the first search information;

[0146] The loss determination module 620 is used to determine multiple losses corresponding to multiple processing modules based on multiple first output results;

[0147] The model training module 630 is used to train a preset model based on multiple losses to obtain a search relevance model.

[0148] In some embodiments, the multiple losses include generation loss corresponding to the generation module in the multiple processing modules. The generation loss is determined based on the first output result corresponding to the generation module and the scoring reason text in the first input information. The first output result corresponding to the generation module includes the first target text.

[0149] like Figure 7 As shown, the model output module 610 includes:

[0150] The text output module 710 is used to generate first attention information based on the scoring reason text, first query information and first search information in the first input information using the generation module, and to obtain the first target text based on the first attention information.

[0151] In some embodiments, the multiple losses include a single-tower discrimination loss corresponding to a single-tower discrimination module among the multiple processing modules. The single-tower discrimination loss is determined based on a first output result corresponding to the single-tower discrimination module and a labeled score corresponding to the first input information. The first output result corresponding to the single-tower discrimination module includes a first relevance score between the first query information and the first search information.

[0152] like Figure 7 As shown, the model output module 610 includes:

[0153] The first score output module 720 is used to generate second attention information based on the single-tower identifier, first query information and first search information in the first input information using the single-tower discrimination module, and to obtain the first relevance score based on the second attention information.

[0154] In some embodiments, the first score output module 720 is specifically used for:

[0155] The first query information and the first search information are concatenated to obtain the concatenated information;

[0156] Second attention information is generated based on the interaction between each element in the single-tower identifier and each element in the spliced ​​information.

[0157] In some embodiments, the multiple losses include a dual-tower discrimination loss corresponding to a dual-tower discrimination module in a plurality of processing modules. The dual-tower discrimination loss is determined based on a first output result corresponding to the dual-tower discrimination module and a labeled score corresponding to the first input information. The first output result corresponding to the dual-tower discrimination module includes a second relevance score between the first query information and the first search information.

[0158] likeFigure 7 As shown, the model output module 610 includes:

[0159] The second score output module 730 is used to generate third attention information based on the first query information and the first search information using the dual-tower discrimination module, and to obtain a second relevance score based on the third attention information.

[0160] In some embodiments, the second score output module 730 is specifically used for:

[0161] Based on the interactions between the elements in the first query information and the interactions between the elements in the first search information, third attention information is generated.

[0162] In some embodiments, the model training module 630 is specifically used for:

[0163] Determine the total loss based on multiple losses;

[0164] The search relevance model is obtained by training the preset model based on the total loss.

[0165] The training apparatus for the search relevance model provided in this disclosure can process the first input information using multiple processing modules in a preset model, then determine multiple losses corresponding to each processing module based on multiple first output results, and finally train the preset model based on the multiple losses to obtain the search relevance model. Compared with training multiple processing modules separately, this reduces the cost of training resources and time, effectively improving training efficiency. Furthermore, since the multiple processing modules in the preset model have the same task objective, they can mutually promote each other when training the preset model based on multiple losses, thereby improving the processing efficiency and accuracy of the trained search relevance model. When applied, this search relevance model can flexibly call different processing modules according to the information type of the input information, realizing the ability to be compatible with multiple processing modules in one model, and can more flexibly support the task requirements in different application scenarios.

[0166] According to embodiments of this disclosure, this disclosure also provides a search relevance determination apparatus. Figure 8 A schematic block diagram of a search relevance determination apparatus provided in an embodiment of this disclosure is shown, such as... Figure 8 As shown, the device includes:

[0167] The acquisition module 810 is used to acquire second input information; wherein, the second input information includes at least second query information and second search information;

[0168] The determination module 820 is used to determine the target module among multiple processing modules in the search relevance model based on the information type in the second input information.

[0169] The processing module 830 is used to process the second query information and the second search information using the target module to obtain a second output result; wherein the second output result is used to characterize the search relevance between the second query information and the second search information.

[0170] In some embodiments, the determining module 820 is specifically used for:

[0171] When the second input information includes a generation identifier, the generation module among the multiple processing modules is identified as the target module; wherein, the generation module is used to generate a second target text based on the generation identifier, and the second target text is used to evaluate the search relevance between the second query information and the second search information.

[0172] In some embodiments, the determining module 820 is specifically used for:

[0173] When the second input information includes a single-tower identifier, the single-tower discrimination module among the multiple processing modules is identified as the target module; wherein, the single-tower discrimination module is used to determine the first relevance score between the second query information and the second search information based on the single-tower identifier, the second query information, and the second search information.

[0174] In some embodiments, the determining module 820 is specifically used for:

[0175] If the second input information does not include a pattern identifier, the dual-tower discrimination module among the multiple processing modules is identified as the target module; wherein, the dual-tower discrimination module is used to determine the second relevance score between the second query information and the second search information based on the second query information and the second search information.

[0176] The search relevance determination device provided in this disclosure can flexibly call different processing modules based on the information type of the input information, realizing the ability to be compatible with multiple processing modules in one model, and can more flexibly support the task requirements in different application scenarios.

[0177] The specific functions and examples of each module and submodule of the apparatus in this disclosure can be found in the relevant descriptions of the corresponding steps in the above method embodiments, and will not be repeated here.

[0178] The acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0179] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0180] Figure 9A schematic block diagram of an example electronic device 900 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0181] like Figure 9 As shown, device 900 includes a computing unit 901, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 902 or loaded from storage unit 907 into random access memory (RAM) 903. RAM 903 may also store various programs and data required for the operation of device 900. The computing unit 901, ROM 902, and RAM 903 are interconnected via bus 904. Input / output (I / O) interface 905 is also connected to bus 904.

[0182] Multiple components in device 900 are connected to I / O interface 905, including: input unit 906, such as keyboard, mouse, etc.; output unit 907, such as various types of monitors, speakers, etc.; storage unit 908, such as disk, optical disk, etc.; and communication unit 909, such as network card, modem, wireless transceiver, etc. Communication unit 909 allows device 900 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0183] The computing unit 901 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. The computing unit 901 performs the various methods and processes described above, such as methods for training a search relevance model and / or methods for determining search relevance. For example, in some embodiments, the methods for training a search relevance model and / or methods for determining search relevance may be implemented as computer software programs tangibly contained in a machine-readable medium, such as storage unit 908. In some embodiments, part or all of the computer program may be loaded and / or installed on device 900 via ROM 902 and / or communication unit 909. When the computer program is loaded into RAM 903 and executed by computing unit 901, one or more steps of the search relevance model training method and / or search relevance determination method described above can be performed. Alternatively, in other embodiments, computing unit 901 can be configured to perform the search relevance model training method and / or search relevance determination method by any other suitable means (e.g., by means of firmware).

[0184] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0185] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0186] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory (EPROM), flash memory, optical fiber, compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0187] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a cathode ray tube (CRT) or liquid crystal display (LCD) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0188] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0189] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0190] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0191] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A method for training a search relevance model, comprising: The first input information is processed using multiple processing modules in a preset model to obtain multiple first output results corresponding to each of the multiple processing modules. The first input information includes at least first query information and first search information. Each of the multiple processing modules processes information in the first input information whose information type corresponds to that module. The multiple first output results characterize the search relevance between the first query information and the first search information. The processing modules include a generation module, a single-tower discrimination module, and a dual-tower discrimination module. The first output result corresponding to the generation module includes a first target text. The first output result corresponding to the single-tower discrimination module includes a first relevance score between the first query information and the first search information. The first output result corresponding to the dual-tower discrimination module includes a second relevance score between the first query information and the first search information. Based on the plurality of first output results, a plurality of losses corresponding to the plurality of processing modules are determined; wherein, the plurality of losses include the generation loss corresponding to the generation module, the single-tower discrimination loss corresponding to the single-tower discrimination module, and the dual-tower discrimination loss corresponding to the dual-tower discrimination module. The generation loss is determined based on the first output result corresponding to the generation module and the scoring reason text in the first input information. The single-tower discrimination loss is determined based on the first output result corresponding to the single-tower discrimination module and the labeled score corresponding to the first input information. The dual-tower discrimination loss is determined based on the first output result corresponding to the dual-tower discrimination module and the labeled score corresponding to the first input information. The preset model is trained based on the multiple losses to obtain a search relevance model.

2. The method according to claim 1, wherein, The first input information is processed using multiple processing modules in a preset model to obtain multiple first output results corresponding to the multiple processing modules, including: Using the generation module, first attention information is generated based on the scoring reason text, the first query information, and the first search information in the first input information, and the first target text is obtained based on the first attention information.

3. The method according to claim 1 or 2, wherein, The first input information is processed using multiple processing modules in a preset model to obtain multiple first output results corresponding to the multiple processing modules, including: Using the single-tower discrimination module, second attention information is generated based on the single-tower identifier, the first query information, and the first search information in the first input information, and the first relevance score is obtained based on the second attention information.

4. The method according to claim 3, wherein, The step of generating second attention information based on the single-tower identifier, the first query information, and the first search information in the first input information includes: The first query information and the first search information are concatenated to obtain concatenated information; The second attention information is generated based on the interaction between each element in the single tower identifier and each element in the splicing information.

5. The method according to claim 1 or 2, wherein, The first input information is processed using multiple processing modules in a preset model to obtain multiple first output results corresponding to the multiple processing modules, including: Using the dual-tower discrimination module, a third attention information is generated based on the first query information and the first search information, and the second relevance score is obtained based on the third attention information.

6. The method according to claim 5, wherein, The step of generating third attention information based on the first query information and the first search information includes: The third attention information is generated based on the interactions between the elements in the first query information and the interactions between the elements in the first search information.

7. The method according to claim 1 or 2, wherein, The step of training the preset model based on the multiple losses to obtain the search relevance model includes: Based on the aforementioned multiple losses, determine the total loss; The preset model is trained based on the total loss to obtain the search relevance model.

8. A method for determining search relevance, comprising: Obtain second input information; wherein, the second input information includes at least second query information and second search information; Based on the information type in the second input information, a target module is determined from multiple processing modules in the search relevance model; wherein, the search relevance model is obtained by the method according to any one of claims 1-7; The target module processes the second query information and the second search information to obtain a second output result; wherein the second output result is used to characterize the search relevance between the second query information and the second search information.

9. The method according to claim 8, wherein, The step of determining the target module among multiple processing modules in the search relevance model based on the information type in the second input information includes: When the second input information includes a generation identifier, the generation module among the plurality of processing modules is determined as the target module; wherein, the generation module is used to generate a second target text based on the generation identifier, and the second target text is used to evaluate the search relevance between the second query information and the second search information.

10. The method according to claim 8 or 9, wherein, The step of determining the target module among multiple processing modules in the search relevance model based on the information type in the second input information includes: When the second input information includes a single-tower identifier, the single-tower discrimination module among the plurality of processing modules is identified as the target module; wherein, the single-tower discrimination module is used to determine a first relevance score between the second query information and the second search information based on the single-tower identifier, the second query information, and the second search information.

11. The method according to claim 8 or 9, wherein, The step of determining the target module among multiple processing modules in the search relevance model based on the information type in the second input information includes: If the second input information does not include a pattern identifier, the dual-tower discrimination module among the plurality of processing modules is identified as the target module; wherein, the dual-tower discrimination module is used to determine a second relevance score between the second query information and the second search information based on the second query information and the second search information.

12. A training device for a search relevance model, comprising: The model output module is used to process the first input information using multiple processing modules in a preset model to obtain multiple first output results corresponding to the multiple processing modules respectively; wherein, the first input information includes at least first query information and first search information; each of the multiple processing modules is used to process information in the first input information whose information type corresponds to that processing module; the multiple first output results are used to characterize the search relevance between the first query information and the first search information; the processing module includes a generation module, a single-tower discrimination module, and a dual-tower discrimination module, wherein the first output result corresponding to the generation module includes a first target text, the first output result corresponding to the single-tower discrimination module includes a first relevance score between the first query information and the first search information, and the first output result corresponding to the dual-tower discrimination module includes a second relevance score between the first query information and the first search information; A loss determination module is used to determine multiple losses corresponding to the multiple processing modules based on the multiple first output results; wherein, the multiple losses include a generation loss corresponding to the generation module, a single-tower discrimination loss corresponding to the single-tower discrimination module, and a dual-tower discrimination loss corresponding to the dual-tower discrimination module. The generation loss is determined based on the first output result corresponding to the generation module and the scoring reason text in the first input information. The single-tower discrimination loss is determined based on the first output result corresponding to the single-tower discrimination module and the labeled score corresponding to the first input information. The dual-tower discrimination loss is determined based on the first output result corresponding to the dual-tower discrimination module and the labeled score corresponding to the first input information. The model training module is used to train the preset model based on the multiple losses to obtain a search relevance model.

13. The apparatus according to claim 12, wherein, The model output module includes: The text output module is used to generate first attention information based on the scoring reason text, the first query information, and the first search information in the first input information, using the generation module, and to obtain the first target text based on the first attention information.

14. The apparatus according to claim 12 or 13, wherein, The model output module includes: The first score output module is used to generate second attention information based on the single-tower identifier, the first query information, and the first search information in the first input information using the single-tower discrimination module, and to obtain the first relevance score based on the second attention information.

15. The apparatus according to claim 14, wherein, The first score output module is also used for: The first query information and the first search information are concatenated to obtain concatenated information; The second attention information is generated based on the interaction between each element in the single tower identifier and each element in the splicing information.

16. The apparatus according to claim 12 or 13, wherein, The model output module includes: The second score output module is used to generate third attention information based on the first query information and the first search information using the dual-tower discrimination module, and to obtain the second relevance score based on the third attention information.

17. The apparatus according to claim 16, wherein, The second score output module is also used for: The third attention information is generated based on the interactions between the elements in the first query information and the interactions between the elements in the first search information.

18. The apparatus according to claim 12 or 13, wherein, The model training module is also used for: Based on the aforementioned multiple losses, determine the total loss; The preset model is trained based on the total loss to obtain the search relevance model.

19. A search relevance determination device, comprising: The acquisition module is used to acquire second input information; wherein the second input information includes at least second query information and second search information; A determining module is configured to determine a target module among multiple processing modules in a search relevance model based on the information type in the second input information; wherein the search relevance model is obtained by the method according to any one of claims 1-7; The processing module is used to process the second query information and the second search information using the target module to obtain a second output result; wherein the second output result is used to characterize the search relevance between the second query information and the second search information.

20. The apparatus according to claim 19, wherein, The determining module is further configured to: When the second input information includes a generation identifier, the generation module among the plurality of processing modules is determined as the target module; wherein, the generation module is used to generate a second target text based on the generation identifier, and the second target text is used to evaluate the search relevance between the second query information and the second search information.

21. The apparatus according to claim 19 or 20, wherein, The determining module is further configured to: When the second input information includes a single-tower identifier, the single-tower discrimination module among the plurality of processing modules is identified as the target module; wherein, the single-tower discrimination module is used to determine a first relevance score between the second query information and the second search information based on the single-tower identifier, the second query information, and the second search information.

22. The apparatus according to claim 19 or 20, wherein, The determining module is further configured to: If the second input information does not include a pattern identifier, the dual-tower discrimination module among the plurality of processing modules is identified as the target module; wherein, the dual-tower discrimination module is used to determine a second relevance score between the second query information and the second search information based on the second query information and the second search information.

23. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-11.

24. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-11.

25. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-11.

Citation Information

Patent Citations

  • Recommendation reason generation method and device, electronic equipment and storage medium

    CN111046138A

  • Semantic retrieval network training method and device, electronic equipment and storage medium

    CN113988157A