Search correlation model training method and search correlation determination method and device
By setting up multiple processing modules in the search correlation model and training based on loss, the shortcomings of the existing models in improving search correlation judgment performance and compatible with multiple information types are solved, and a more efficient, flexible and compatible search correlation model is achieved.
Patent Information
- Application Number
- CN202411668300.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-11-20
AI Technical Summary
The existing search correlation model has shortcomings in improving the performance of search correlation determination, especially when dealing with multiple information types and different application scenarios, the model is insufficient in flexibility and compatibility.
By setting up multiple processing modules in the preset model, using these modules to process the input information, generate multiple output results, and determine corresponding losses based on these output results. Finally, train the model through these losses to obtain an improved search correlation model. This model can flexibly call different processing modules through the information type of input information, realizing the ability to be compatible with multiple processing modules in one model.
It improves the judgment performance and processing efficiency of the search correlation model, reduces the cost of training resources and time, realizes flexible support in different application scenarios, and enhances the compatibility and adaptability of the model.
Smart Images

Figure CN119646202A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, in particular to the fields of natural language processing and deep learning, and can be used in application scenarios such as generative search, intelligent document editing, intelligent assistants, virtual assistants, and intelligent e-commerce. Background Art
[0002] Search relevance refers to the degree of relevance between the query terms entered by the user and the search results in the field of information retrieval. By determining the search relevance, it can help provide the search results that best match the query terms. The search relevance model aims to quantify the degree of match between candidate search results and query terms to support the screening and sorting of candidate search results based on the relevance score. Search relevance determination is a crucial part of search engines, so it is necessary to consider how to improve the performance of the search relevance model. Summary of the invention
[0003] The present disclosure provides a method for training a search relevance model, and a method and device for determining search relevance.
[0004] According to one aspect of the present disclosure, a method for training a search relevance model is provided, comprising:
[0005] The first input information is processed by using multiple processing modules in the preset model to obtain multiple first output results corresponding to the multiple processing modules respectively; wherein the first input information at least includes first query information and first search information; each of the multiple processing modules is used to process information corresponding to the information type in the first input information; and the multiple first output results are used to characterize the search correlation between the first query information and the first search information;
[0006] Based on the plurality of first output results, determining a plurality of losses respectively corresponding to the plurality of processing modules;
[0007] The preset model is trained based on multiple 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] Acquire second input information; wherein the second input information at least includes second query information and second search information;
[0010] Determining a target module among a plurality of processing modules in a search relevance model according to the information type in the second input information;
[0011] The second query information and the second search information are processed by the target module to obtain a second output result; wherein the second output result is used to characterize the search correlation between the second query information and the second search information.
[0012] According to another aspect of the present disclosure, there is provided a training device for a search relevance model, comprising:
[0013] A model output module, 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 at least includes 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 the processing module; and the multiple first output results are used to characterize the search correlation between the first query information and the first search information;
[0014] A loss determination module, configured to determine a plurality of losses corresponding to the plurality of processing modules respectively based on the plurality of first output results;
[0015] The model training module is used to train the preset model based on multiple losses to obtain a search relevance model.
[0016] According to another aspect of the present disclosure, a device for determining search relevance is provided, comprising:
[0017] An acquisition module, used to acquire second input information; wherein the second input information at least includes second query information and second search information;
[0018] A determination module, configured to determine a target module from among a plurality of processing modules in a search relevance model according to the information type in the second input information;
[0019] 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 correlation between the second query information and the second search information.
[0020] According to another aspect of the present disclosure, there is provided an electronic device, comprising:
[0021] at least one processor; and
[0022] a memory communicatively connected to the at least one processor; wherein,
[0023] The memory stores instructions that can be executed 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 any method in the embodiments of the present disclosure.
[0024] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute any method according to the embodiments of the present disclosure.
[0025] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, which implements any method according to the embodiments of the present disclosure when executed by a processor.
[0026] The technical solution of the disclosed embodiment is that a plurality of processing modules for determining search relevance are provided in a preset model, and a search relevance model is obtained by utilizing a plurality of loss training models corresponding to the plurality of processing modules, thereby improving the performance of the search relevance model in determining search relevance, and being able to flexibly call different processing modules according to the information type of the input information, thereby realizing the ability to be compatible with multiple processing modules in one model, and being able to more flexibly support task requirements in different application scenarios.
[0027] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0029] Figure 1 It is a structural diagram of the twin tower model;
[0030] Figure 2 This is a schematic diagram of the structure of the LLM attention mechanism;
[0031] Figure 3 It is a flowchart of a method for training a search relevance model provided by an embodiment of the present disclosure;
[0032] Figure 4 is a schematic diagram of an attention mechanism in a search relevance model in an embodiment of the present disclosure;
[0033] Figure 5 is a flowchart of a method for determining search relevance provided by an embodiment of the present disclosure;
[0034] Figure 6 is a schematic block diagram of a training device for a search relevance model provided by an embodiment of the present disclosure;
[0035] Figure 7 is a schematic block diagram of a training device for a search relevance model provided by another embodiment of the present disclosure;
[0036] Figure 8is a schematic block diagram of a search relevance determination device provided by an embodiment of the present disclosure;
[0037] Fig. 9 The block diagram is a block diagram of an electronic device for implementing the method of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0038] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0039] In order to facilitate understanding of the training of the search relevance model and the search relevance determination method provided by the embodiments of the present disclosure, the relevant technologies of the embodiments of the present disclosure are explained below. The following related technologies can be arbitrarily combined with the technical solutions of the embodiments of the present disclosure as optional solutions, and they all belong to the protection scope of the embodiments of the present disclosure.
[0040] The retrieval system is a multi-stage funnel in the form of recall-coarse sorting-fine sorting. In the coarse sorting stage of the system, there are relatively many candidate search results and the computing resources are relatively tight, so the dual-tower model can be selected as the model selection for the coarse sorting stage; in the fine sorting stage, there are relatively few candidate search results and the computing resources are relatively abundant, so the single-tower model can be selected.
[0041] Take the scenario of retrieving advertisements as an example. Figure 1 The schematic diagram of the double tower model is shown in FIG. Figure 1 As shown in the figure, in the dual-tower model, an encoder (such as Transformer) is used to encode the query side and AD (Advertisement) side information respectively, and query embedding (a vector embedded with query information, referred to as query vector) and AD embedding (a vector embedded with advertisement, referred to as AD vector) are obtained respectively. Finally, DNN (Deep Neural Networks) is used at the top layer to make a simple interaction between query embedding and AD embedding to obtain an estimated score of search relevance. In contrast, the single-tower model inputs the query side and AD side information into the encoder for joint encoding. Therefore, the query side and AD side information in the single-tower model can fully interact, so the single-tower model is generally better than the dual-tower model.
[0042] Search relevance refers to the degree of relevance between query terms and search results in the field of information retrieval, aiming to provide search results that best match user intent. The search relevance model aims to quantify the degree of match between search results and query terms, and to filter and sort search results based on the relevance probability score.
[0043] Search relevance determination is a crucial part of the search engine. The search relevance model acts on the fine and coarse ranking stages of the system. Due to the insufficient interaction of the dual-tower model, the model capability of the coarse ranking stage is much lower than that of the fine ranking stage.
[0044] In the above method, supervised learning can be used to discriminate and score query terms and search results, obtain labeled data, and train a scoring model on the labeled data.
[0045] In addition, in another way, the LLM (Large Language Model) can be trained using instruction fine-tuning based on the generation method. Specifically, each sample is constructed as a pair of input and output. The input is text information (input text), which can include a task description (called instruction) and query terms, search results, and the output is the generation target, which can include relevance and corresponding reasons. The attention mechanism is often used in LLM to generate output content. Figure 2 The structural diagram of the attention mechanism of LLM is shown as follows Figure 2 As shown in the figure, the LLM attention mechanism is divided into two parts. A bidirectional attention mechanism is used for the input text, that is, the input text interacts with the input text itself and also interacts with the generated target, that is, the relevance and scoring reasons; a unidirectional attention mechanism is used for the generated target, that is, the relevance and scoring reasons only interact with themselves.
[0046] In the technical solution of the embodiment of the present disclosure, multiple processing modules in the preset model can be used to process the first input information respectively, and then based on the multiple first output results, multiple losses corresponding to the multiple processing modules are determined, and finally the preset model is trained based on the multiple losses to obtain a search relevance model. Compared with training multiple processing modules separately, the cost of training resources and time is reduced, and the training efficiency is effectively improved. Furthermore, since the task objectives of the multiple processing modules in the preset model are consistent, when the preset model is trained 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. 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 being able to more flexibly support task requirements in different application scenarios.
[0047] The training method of the search relevance model provided in the embodiments of the present disclosure can be applied to the model training for search relevance in any field. For example, in the field of advertising recommendation, the training method of the search relevance model can be applied to the model training related to advertising recommendation, specifically, it can be applied to the model training for the search relevance discrimination between candidate advertisements (i.e., candidate search results) and the query information input by the user.
[0048] Figure 3 A method for training a search relevance model provided by an embodiment of the present disclosure is shown. The method can be applied to a training device for a search relevance model, and the device can be deployed in an electronic device. The electronic device is, for example, a single or multi-machine terminal, server, or other processing device. Among them, the terminal can be a user equipment (User Equipment, UE) such as a mobile device, a personal digital assistant (Personal Digital Assistant, PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc.; the server can be a stand-alone server or a server cluster. In some possible implementations, the method can also be implemented by a processor calling computer-readable instructions stored in a memory. For example Figure 3 As shown, the method may include the following steps S310 to S330.
[0049] Step S310: Process the first input information using multiple processing modules in the preset model to obtain multiple first output results corresponding to the multiple processing modules respectively.
[0050] The first input information at least includes first query information and first search information.
[0051] In the disclosed embodiments, the query information may include a query term used to initiate a search / retrieval, which may generally be referred to as a query. The first query information may be understood as a query term in a sample used in the model training process. Optionally, the query information may include information in one or more forms of text, image, and voice, so that the model can be applied to scenarios where retrieval is performed in one or more forms of text, image, and voice.
[0052] In the disclosed embodiments, the search information may include the information to be 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 the database can be used as the search information. In other words, the search information may include candidate search results. The first search information may be understood as the search information in the sample used in the model training process. Optionally, the search information may include information in one or more forms of text, image, and voice.
[0053] Each of the multiple processing modules is used to process information in the first input information whose information type corresponds to the processing module.
[0054] In the disclosed embodiment, the preset model can be understood as a model composed of multiple processing modules, wherein the function and structure of each processing module can be different, and each processing module corresponds to a different information type. The first input information input into the preset model can include multiple different types of information. The first input information is input into the preset model, and each processing module can process the corresponding information type to obtain the first output result respectively. For example, the first input information includes the first query information, the first search information and the identifier A. The preset model includes a processing module 1 corresponding to the query information and the search information, and a processing module 2 corresponding to the query information, the search information and the identifier A. Therefore, the processing module 1 processes the first query information and the first search information, and does not process the identifier A; the processing module 2 processes the first query information, the first search information and the identifier A. The processing module 1 and the processing module 2 respectively obtain their respective first output results.
[0055] Among them, multiple first output results are used to characterize the search correlation 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 correlation between the first query information and the first search information. For example, the first output result may include a correlation score, that is, a probability score for judging that the first search information is correlated with the first query information; the first output result may also include text (i.e., a text description) for describing the correlation 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, the form can be understood as a modality, such as a score, text, image, voice, etc.
[0056] For example, the first output result obtained by processing module 1 may include a relevance score; the first output result obtained by processing module 2 may include a relevance score and / or text (e.g., a scoring reason text). It is understandable that, since the functions and structures of processing module 1 and processing module 2 are different, 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, discriminant model, etc.
[0058] Step S320: Based on the multiple first output results, determine multiple losses corresponding to the multiple processing modules respectively.
[0059] Optionally, the expected result output by each processing module may be set in advance for the first query information and the first search information, so that the loss corresponding to each processing module may be determined respectively according to the difference between the expected result and the actual first output result of the processing module.
[0060] Exemplarily, when the first output result includes a relevance score, the expected result may include an expected score (e.g., a manually annotated score, which may also be referred to as an annotated score), and the loss may be determined based on the difference between the relevance score and the expected score. When the first output result includes a text description, the expected result may include an expected text (e.g., a pre-annotated scoring reason, which may be referred to as a scoring reason text). Optionally, the loss may be determined based on the similarity between the text description in the first output result and the expected text.
[0061] Step S330: training the preset model based on multiple losses to obtain a search relevance model.
[0062] In the embodiment of the present disclosure, training a preset model based on multiple losses may include: optimizing parameters in the preset model based on the multiple losses, and illustratively, the parameters of each processing module in the optimized preset model may be optimized separately. When the preset model converges, the preset model may be determined as a search relevance model, that is, compared with the preset model, the search relevance model may more accurately output information representing the search relevance between the query information and the 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 the weight corresponding to each loss 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, for example, using multiple samples, for multiple samples, obtaining multiple first output results corresponding to each processing module, and calculating the loss corresponding to each processing module, so as to update the parameters to reduce the loss. And the steps of running the processing module, calculating the loss and updating the parameters can be iterated multiple times so that the loss reaches the preset convergence condition, thereby further improving the accuracy of the search correlation model. Among them, the specific convergence condition can be set according to actual needs, for example, it can be set based on the number of iterations, the degree of loss convergence, or the model accuracy, for example, the loss no longer decreases or the loss is less than the preset value.
[0065] Optionally, the search relevance model can be used to determine the second output result based on the second query information and the second search information. The second query information may be a query term input by a user in an actual information retrieval scenario; the second search information may be a candidate search result for the second query information. That is, in the disclosed embodiment, 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 a text for commenting on the search relevance between the second query information and the second search information. Optionally, when the second output result meets a preset condition, such as when the relevance score is high, the second search information can be recommended to the user.
[0066] Optionally, there may be multiple second search information, and the search correlation between each second query information and the second search information is calculated through the search correlation model, so that the second search information with higher search correlation with the second search information can be recommended to the user.
[0067] In the technical solution of the disclosed embodiment, multiple processing modules in the preset model can be used to process the first input information respectively, and then based on the multiple first output results, multiple losses corresponding to the multiple processing modules are determined, and finally the preset model is trained based on the multiple losses to obtain a search relevance model. The search relevance model can be compatible with the capabilities of multiple processing modules, which improves the performance of the search relevance model, and compared with training multiple processing modules separately, it reduces the cost of training resources and time, and effectively improves the training efficiency. Furthermore, since the task objectives of the multiple processing modules in the preset model are consistent, when the preset model is trained 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 include a generation module. Optionally, the generation module can be implemented based on a generative model, for example, the generation module can adopt an LLM structure.
[0069] In the above embodiment, the first input information at least includes the first query information, the first search information and the scoring reason text. Optionally, the scoring reason text can be manually annotated according to the first query information and the first search information. Accordingly, the above-mentioned multiple losses include the generation loss corresponding to the generation module, and 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. Among them, 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 comment on the search relevance between the first query information and the first search information. For example, the first target text can be similar to the scoring reason, describing the reason whether there is a correlation between the first search information and the first query information and the degree of correlation.
[0070] Specifically, the above step S310 uses 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, including:
[0071] A generation module is used to generate first attention information based on the scoring reason text in the first input information, the first query information and the first search information, and a first target text is obtained based on the first attention information.
[0072] In the disclosed embodiment, the multiple processing modules in the preset model include a generation module, in which 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, and each element in the scoring reason text can also interact with itself, thereby obtaining the interaction result of the above-mentioned elements, which is the first attention information. Based on the first attention information, the generation module finally generates a first target text, which can comment on the search relevance between the first query information and the first search information.
[0073] Exemplarily, the first query information, the first search information, and the scoring reason text can be decomposed into multiple tokens (also known as tokens or marks, etc., which are equivalent to the above elements), and each token can correspond to a single word, character, word or special symbol, etc. Further, each token in the scoring reason text interacts with each token in the first query information, and each token in the scoring reason interacts with each token in the first search information, and each token in the scoring reason text interacts with other tokens in the scoring reason text and itself. Among them, the interaction can be understood as the fusion of information, such as multiplication, addition, multiplication after encoding, addition after encoding, etc. The interaction results obtained from the above various interactions are used as attention information. It can be understood that the attention information contains the calculation results corresponding to each token in the first input information, and the calculation results can be used to adjust the degree of attention of the encoder to each token in the generation module, and finally generate 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 the multiple losses can be determined, so as to obtain a search relevance model based on the generation loss training, so that the model is compatible with the generation capability.
[0075] According to the above embodiment, a generation module is set in the preset model, and a scoring reason text is added to the first input information. The first target text can be obtained through the generation module, and the first target text is included in multiple first output results, thereby improving the interpretability of the first output results. Furthermore, based on the first target text and the scoring reason text, the generation loss among multiple losses can be determined, and then the search relevance model obtained by training based on the generation loss can be compatible with the generation capability, which can further improve the performance of the search relevance model.
[0076] It can be understood that according to the above embodiment, 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 is consistent with the scoring reason text. Therefore, for the search relevance model obtained after training, when the information input into the model contains a text start symbol (generation identifier), the generation module will start to generate the first target text describing the scoring reasons based on the start symbol.
[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. Among them, the second attention information can be used to adjust the degree of attention 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 information, such as an identifier or a text, which can be used to describe the search relevance discrimination task to enhance the discrimination ability 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 above-mentioned multiple losses include a single tower discrimination loss corresponding to the single tower discrimination module, and 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. Among them, the first output result corresponding to the single tower discrimination module includes a first correlation score between the first query information and the first search information. Optionally, the higher the first correlation score, the higher the search correlation between the first query information and the first search text.
[0079] Specifically, the above step S310 uses 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, including:
[0080] Using a single tower identification module, 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, and a first relevance score is obtained based on the second attention information.
[0081] Furthermore, a single-tower loss among multiple losses can be determined based on the first correlation score and the labeling score corresponding to the first input information, so that the search correlation model trained based on the single-tower loss can be compatible with the single-tower discrimination capability.
[0082] According to the above embodiment, a first single tower identifier is added to the first input information, and a first correlation score can be obtained through a single tower discrimination module, and the first output results include the first correlation score, thereby accurately representing the search correlation score between the first query information and the first search information. Further, based on the first correlation score and the labeling score, a single tower loss among multiple losses can be determined, and then the search correlation model obtained by training based on the single tower loss can be compatible with the single tower discrimination capability, which can further improve the performance of the search correlation model, for example, improve the accuracy of the judgment.
[0083] It can be understood that according to the above embodiment, for the search relevance model obtained after training, when the information input into the model includes a single tower identification, the single tower identification module will process the input information and output a first relevance score.
[0084] In some embodiments, based on the first single tower identifier, the first query information, and the first search information in the first input information, generating the second attention information includes:
[0085] splicing the first query information and the first search information to obtain spliced information;
[0086] Based on the interaction between each element in the first single tower logo and each element in the splicing information, the second attention information is generated.
[0087] In the disclosed embodiment, the spliced information may be a splicing result of any one of the characters, special characters, tokens, or corresponding vectors and encoding information in the first query information and the first search information.
[0088] In the disclosed embodiment, each element in the first single tower identification can be understood as each word, special character, token in the first single tower identification, or one of the corresponding vectors and coding information. Similarly, each element in the splicing information can be understood as each word, special character, token in the splicing information, or one of the corresponding vectors and coding information.
[0089] Optionally, multiple tokens corresponding to the first query information and the first search information can be spliced to obtain spliced information. For each token or any token in the spliced information, interact with each token in the first single tower identification one by one to obtain the second attention information. It can be understood that the second attention information contains the calculation results corresponding to each token in the spliced information, and the calculation results can be used to adjust the attention of the encoder in the single tower discrimination module to each token.
[0090] According to the above embodiment, by splicing the first query information and the first search information, the single tower model can input the first query information and the first search information into the encoder for joint encoding, and the first query information and the first search information can fully interact, so as to accurately generate the second attention information.
[0091] In some embodiments, the plurality of 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 correlation score based on the encoding results of the two. The 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, the multiple losses include a dual-tower discriminant loss corresponding to the dual-tower discriminant module, the dual-tower discriminant loss is determined based on a first output result corresponding to the dual-tower discriminant module and a labeling score corresponding to the first input information; the first output result corresponding to the dual-tower discriminant module includes a second correlation score between the first query information and the first search information. Optionally, the higher the second correlation score, the higher the search correlation between the first query information and the first search text.
[0093] Specifically, the above step S310 uses 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, including:
[0094] Using the dual-tower discrimination module, 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 correlation score and the labeling score corresponding to the first input information, a dual-tower loss among multiple losses can be determined, so that the search correlation model trained based on the dual-tower loss can be compatible with the dual-tower discrimination capability.
[0096] According to the above embodiment, the second correlation score can be obtained through the dual-tower discrimination module, and the second correlation score is included in the multiple first output results, thereby accurately representing the search correlation between the first query information and the first search information. Further, based on the second correlation score and the labeling score, the dual-tower loss among the multiple losses can be determined, and then the search correlation model obtained based on the dual-tower loss training can be compatible with the dual-tower discrimination capability, which can further improve the performance of the search correlation model, for example, improve the efficiency of the determination.
[0097] It can be understood that according to the above embodiment, for the search relevance model obtained after training, when the information input into the model includes the first search information and the first query information, the dual-tower discrimination module will process the input information and output a second relevance score.
[0098] In some embodiments, generating third attention information based on the first query information and the first search information in the first input information includes:
[0099] Based on the interaction between the various elements in the first query information and the interaction between the various elements in the first search information, the third attention information is generated.
[0100] In the disclosed embodiment, each element in the first query information can be understood as each word in the first query information, a special character, a token in the first single tower identifier, or a corresponding vector, or one of the encoding information. Similarly, each element in the first search information can be understood as each word in the first search information, a special character, a token in the concatenated information, or a corresponding vector, or one of the encoding information.
[0101] Optionally, multiple tokens corresponding to the first query information and the first search information can be obtained based on the first query information and the first search information, respectively. Then, for each token of the first query information, interact with other tokens in the first query information and itself one by one; and for each token of the first search information, interact with other tokens in the first query information and itself one by one, and all interaction results are aggregated into the 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 attention level of the encoder to each token in the dual-tower discrimination module.
[0102] According to the above embodiment, the various elements in the first query information in the dual-tower model interact with each other, and the various elements in the first search information interact with each other, so that the third attention information can be generated, and the calculation complexity of the attention information can be reduced to improve efficiency.
[0103] It should be noted that the above embodiments can be implemented in combination, for example, the multiple processing modules can include two or three of the generation module, the single-tower discrimination module and the double-tower discrimination module. In this way, the search relevance model can have the performance of the two or three modules at the same time, and because the task objectives of the two or three modules are consistent, they can 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 preset model is trained based on the total loss to obtain the search relevance model.
[0107] In the disclosed embodiment, multiple losses can be calculated to obtain a total loss. By training the preset model based on the total loss, the loss information of each module can be effectively provided to a single module for parameter optimization, thereby enhancing the mutual promotion effect and effectively improving the processing efficiency and accuracy of the search relevance model obtained by training.
[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 examples of practical applications, 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 can be added together to obtain the total loss, and then the search relevance model trained based on the total loss has both dual-tower discrimination ability, single-tower discrimination ability, and generation ability.
[0110] In one embodiment, Figure 4 As shown, Figure 4 Schematic diagram of the attention mechanism in the search relevance model in one embodiment of the present disclosure.
[0111] When training the model, a single sample in the training data set is the first input information, including query information, search information, and single tower identification (an identification used to prompt single tower discrimination). Each sample is annotated with a scoring reason text and annotated score. When training the model, query information, search information, single tower identification, and scoring reason text are input into the model. After each piece of information is encoded, the attention mechanism is executed.
[0112] It can be seen that the attention mechanism in the model includes the third attention information 410, the second attention information 420, and the first attention information 430. Among them, the third attention information 410 is the attention information for the dual-tower discrimination module. It can be seen that the third attention information 410 includes the calculation results of the interaction between the query information and itself and the calculation results of the interaction between the search information and itself. The second attention information 420 is the attention information for the single-tower discrimination module. The query information and the search information are spliced in the single-tower discrimination module. It can be seen that the second attention information 420 includes the calculation results of the interaction between the single-tower identification and each element of the spliced information. The first attention information 430 is the attention information for the generation module. The generation module will generate each element in the target text based on the scoring reason text. Each time an element is generated, the element is interactively calculated with each generated element and each element in the spliced information. The obtained first attention information 430 includes the calculation results corresponding to each element in the generated target text. In this way, the improvement of the attention mechanism is achieved.
[0113] The single tower discriminant module, the double tower discriminant module and the generation module in the model perform encoding output based on the above attention information during the encoding process. The double tower discriminant module outputs the second relevance score, the single tower discriminant module outputs the first relevance score, and the generation module outputs the text T 0 …[EOS]. Based on the comparison of each output result with the annotation score and the scoring reason text, the corresponding loss is determined, and then the total loss is obtained to optimize the parameters of the entire model.
[0114] When the model is applied, the second input information can be input into the model, and the second input information at least includes query information and search information. Optionally, a single tower identification and a generation identification (text start symbol) can also be included. When the second input information includes the single tower identification, the single tower discrimination module and the double tower discrimination module will process the second input information, and the specific processing process can refer to the processing process of the single tower discrimination module and the double tower discrimination module in training. When the second input information includes the generation identification, the double tower discrimination module and the generation module will process the second input information, and the specific processing process can refer to the processing process of the double tower discrimination module and the generation module in training. When the second input information does not include the single tower identification and the generation identification, the double tower discrimination module will process the second input information, and the specific processing process can refer to the processing process of the double tower discrimination module in training.
[0115] It can be seen that through the above technical solution, since multiple processing modules are set in the model, it has the ability of multiple processing modules, and the task objectives corresponding to the multiple processing modules are consistent, so they are stored in each other during the training process to improve the performance of each processing module itself. Secondly, the model can be compatible with multiple capabilities and correspond to multiple modes. For example, the mode of using only the dual-tower discrimination module can improve the efficiency of correlation discrimination in scenarios requiring efficiency; for example, the mode of using the dual-tower discrimination module and the single-tower discrimination module can use the single-tower discrimination module to improve the performance of the dual-tower discrimination module; for example, the mode of using the dual-tower discrimination module and the generation module can use the generation module to output the generation reason at the same time; for example, the mode of using the dual-tower discrimination module, the single-tower discrimination module and the generation module can use the single-tower discrimination module to improve the performance of the dual-tower discrimination module and output the generation reason at the same time. That is, in one model, the dual-tower discrimination task, the single-tower discrimination task and the generation task are compatible, which can flexibly respond to the needs of different scenarios.
[0116] Figure 5A method for determining search relevance provided by an embodiment of the present disclosure is shown. The method can be applied to a device for determining search relevance, which can be deployed in an electronic device. The electronic device is, for example, a single or multi-machine terminal, server, or other processing device. The terminal can be a user device such as a mobile device, a PDA, a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc.; 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 a memory. For example Figure 5 As shown, the method may include the following steps S510 to S530.
[0117] Step S510: obtaining second input information; wherein the second input information at least includes second query information and second search information;
[0118] Step S520: determining a target module from among a plurality of processing modules in the search correlation model according to the information type in the second input information;
[0119] Step S530: Use the target module to process 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 correlation between the second query information and the second search information.
[0120] The search relevance determination method provided by the embodiment of the present disclosure can be applied to information retrieval in any field. For example, in the field of advertisement recommendation, the second query information may include query words for advertisement information, and the second search information may include advertisement information.
[0121] In the disclosed embodiment, the search relevance model obtained by the training method of the above-mentioned search relevance model can be applied in actual retrieval, and the second input information may include second query information and second search information (candidate search results), and the second query information may include query terms input by the user to initiate search / retrieval. The second query information may include information in one or more forms of text, image, and voice, that is, the above-mentioned method can be applied to scenarios in which retrieval is performed in one or more forms of text, image, voice, etc. The second search information may be any candidate search result in the database. Optionally, the second search information may include information in one or more forms of text, image, and voice. 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, and 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 the embodiment of the present disclosure, the second input information may include multiple information types, for example, the information type may include identification information input by the user. The information type is used to determine the module that performs the task, i.e., the target module, among multiple processing modules in the search relevance model. Different target modules can be determined to be called through different information types.
[0123] Optionally, there may be multiple target modules. When the second query information and the second search information are processed using multiple target modules, the task objectives of the multiple target modules are consistent, and they are all used to judge 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 result may be a correlation score and / or a text description, that is, the search correlation between the second query information and the second search information may be represented by the correlation score and / or the text description.
[0125] According to the above embodiment, the target module can be determined from the multiple processing modules in the search relevance model by the information type in the second input information, and the second query information and the second search information can be processed by the target module to obtain the second output result, so that the search relevance between the second query information and the second search information can be accurately determined. Different processing modules can be flexibly called by the information type of the input information, so that the ability to be compatible with multiple processing modules in one model is realized, and the task requirements in different application scenarios can be more flexibly supported.
[0126] In some embodiments, step S520, determining a target module from a plurality of processing modules in a search relevance model according to the information type in the second input information, includes:
[0127] When the second input information includes a generation identifier, a generation module among multiple processing modules is determined as a 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 comment on the search relevance between the second query information and the second search information.
[0128] In the embodiment of the present disclosure, a generation identifier is used to determine a generation module among multiple processing modules as a target module. Based on the second query information, the second search information and the elements generated one by one in the second input information, the fourth attention information can be determined, and based on the fourth attention information, a second output result corresponding to the generation module can be obtained. The second output result is the second target text, and the second target text can comment on 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, and the interaction can be started based on the starting token. Each token in the second query information and the second search information can be interacted in turn to generate the fourth attention information.
[0130] According to the above embodiment, the second query information, the second query information and the generation identifier can be processed by calling the generation module through the generation identifier, so that the generation module outputs the second target text, and the search relevance between the second query information and the second search information can be commented. For other technical details in the generation module, reference can be made to the processing process of the generation module in the aforementioned training method, which will not be repeated here.
[0131] In some embodiments, step S520, determining a target module from a plurality of processing modules in a search relevance model according to the information type in the second input information, includes:
[0132] When the second input information includes a single tower identification, a single tower identification module among multiple processing modules is determined as a target module; wherein the single tower identification module is used to determine a first correlation score between the second query information and the second search information based on the single tower identification, the second query information and the second search information.
[0133] In the disclosed embodiment, the single-tower identification is used to determine the single-tower discrimination module among multiple processing modules as a target module. Based on the single-tower identification in the second input information, the second query information and the second search information, the fifth attention information can be generated, and the 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 correlation score between the second query information and the second search information.
[0134] Furthermore, the second query information and the second search information may be spliced to obtain spliced information, and fifth attention information may be generated based on the interaction between each element in the single tower logo and each element in the spliced information.
[0135] According to the above embodiment, the single tower identification module can be called by the single tower identification to process the single tower identification, the second query information and the second search information, so that the single tower identification module outputs the second correlation score between the second query information and the second search information. For other technical details in the single tower identification module, reference can be made to the processing process of the single tower identification module in the aforementioned training method, which will not be described in detail here.
[0136] In some embodiments, step S520, determining a target module from a plurality of processing modules in a search relevance model according to the information type in the second input information, includes:
[0137] When the second input information does not include a pattern identifier, a dual-tower discrimination module among multiple processing modules is determined as a target module; wherein the dual-tower discrimination module is used to determine a second correlation score between the second query information and the second search information based on the second query information and the second search information.
[0138] In the disclosed embodiment, 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 the single tower identifier, the dual-tower discrimination module among the multiple processing modules may be determined as the target module, and the sixth attention information may 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 may be obtained based on the sixth attention information, and the second output result is the second correlation score between the second query information and the second search information.
[0139] Furthermore, the sixth attention information may be generated based on the interaction between the various elements in the second query information and the interaction between the various elements in the second search information.
[0140] According to the above embodiment, when the second input information does not include a pattern identifier, the dual-tower discrimination module can be called to process the second query information and the second search information, so that the dual-tower discrimination module outputs a second correlation score between the second query information and the second search information. For other technical details in the dual-tower discrimination module, reference can be made to the processing process of the dual-tower discrimination module in the aforementioned training method, which will not be described in detail here.
[0141] In some examples of practical applications, the second input information may include the second query information, the second search information, a generation 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, so that the second target text, the second relevance score, and the second relevance score can be obtained through the above target module, and the second target text, the second relevance score, and the second relevance score are displayed to the user. The second target text can provide a reason for scoring the second relevance score and 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 are displayed to the user.
[0142] In one example, the first query information may be: "a certain spoken language". The first search information may be: "study abroad planning, the study abroad planning team will evaluate your study abroad and help you choose an ideal study abroad school". The above second query information, second search information, generation identifier, and second single tower identifier may be used as the second input information, and the search relevance model may output the second target text, the second relevance score, and the second relevance score. Then, according to the second relevance score and the second relevance score, it can be obtained that the relevance score of the first query information and the first search information is 0. The reason (i.e., the second target text) is that the first query information "a certain spoken language" involves the oral part of a certain exam, while the search results mainly focus on study abroad planning and study abroad school selection, without mentioning content related to "a certain spoken language", and the relevance is low.
[0143] It can be seen that the method provided by the embodiment of the present disclosure utilizes multiple processing modules in a preset model to process the first input information respectively, and then determines multiple losses corresponding to the multiple processing modules based on multiple first output results, and finally trains the preset model based on the multiple losses to obtain a search relevance model. Compared with separately training multiple processing modules, the cost of training resources and time is reduced, and the training efficiency is effectively improved. Furthermore, since the task objectives of the multiple processing modules in the preset model are consistent, when the preset model is trained 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. 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 being able to more flexibly support task requirements in different application scenarios.
[0144] According to an embodiment of the present disclosure, the present disclosure also provides a training device for searching a correlation model. Figure 6 A schematic block diagram of a training device for a search relevance model provided by an embodiment of the present disclosure is shown. Figure 6 As shown, the device comprises:
[0145] The model output module 610 is used to process the first input information using multiple processing modules in the preset model to obtain multiple first output results corresponding to the multiple processing modules respectively; wherein the first input information at least includes 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 the processing module; and the multiple first output results are used to characterize the search correlation between the first query information and the first search information;
[0146] A loss determination module 620, configured to determine a plurality of losses corresponding to the plurality of processing modules respectively based on the plurality of first output results;
[0147] The model training module 630 is used to train the preset model based on multiple losses to obtain a search relevance model.
[0148] In some embodiments, the multiple losses include a generation loss corresponding to a generation module in the multiple processing modules, the generation loss is determined based on a first output result corresponding to the generation module and a scoring reason text in the first input information, and the first output result corresponding to the generation module includes a 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, the first query information and the first search information in the first input information using the generation module, and 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 in 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 labeling score corresponding to the first input information, the first output result corresponding to the single-tower discrimination module including a first correlation 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 identification, the first query information and the first search information in the first input information using the single tower identification module, and obtain a first relevance score based on the second attention information.
[0154] In some embodiments, the first score output module 720 is specifically configured to:
[0155] splicing the first query information and the first search information to obtain spliced information;
[0156] Based on the interaction between each element in the single tower logo and each element in the splicing information, the second attention information is generated.
[0157] In some embodiments, the multiple losses include a dual-tower discrimination loss corresponding to a dual-tower discrimination module in the multiple processing modules, the dual-tower discrimination loss is determined based on a first output result corresponding to the dual-tower discrimination module and a labeling score corresponding to the first input information, the first output result corresponding to the dual-tower discrimination module including a second correlation score between the first query information and the first search information;
[0158] like Figure 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 obtain a second relevance score based on the third attention information.
[0160] In some embodiments, the second score output module 730 is specifically configured to:
[0161] Based on the interactions between the various elements in the first query information and the interactions between the various elements in the first search information, third attention information is generated.
[0162] In some embodiments, the model training module 630 is specifically used to:
[0163] Based on multiple losses, determine the total loss;
[0164] The preset model is trained based on the total loss to obtain the search relevance model.
[0165] The training device for the search relevance model provided by the embodiment of the present disclosure can utilize multiple processing modules in the preset model to process the first input information respectively, and then determine multiple losses corresponding to the multiple processing modules respectively based on the multiple first output results, and finally train the preset model based on the multiple losses to obtain the search relevance model. Compared with separately training multiple processing modules, the cost of training resources and time is reduced, and the training efficiency is effectively improved. Furthermore, since the task objectives of the multiple processing modules in the preset model are consistent, when the preset model is trained 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. When the search relevance model is applied, 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 being able to more flexibly support task requirements in different application scenarios.
[0166] According to an embodiment of the present disclosure, the present disclosure also provides a search relevance determination device, Figure 8 A schematic block diagram of a search relevance determination device provided by an embodiment of the present disclosure is shown. Figure 8 As shown, the device comprises:
[0167] The acquisition module 810 is used to acquire second input information; wherein the second input information at least includes second query information and second search information;
[0168] A determination module 820, configured to determine a target module from among a plurality of processing modules in a search relevance model according to 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 correlation between the second query information and the second search information.
[0170] In some embodiments, the determination module 820 is specifically configured to:
[0171] When the second input information includes a generation identifier, a generation module among multiple processing modules is determined as a 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 comment on the search relevance between the second query information and the second search information.
[0172] In some embodiments, the determination module 820 is specifically configured to:
[0173] When the second input information includes a single tower identification, a single tower identification module among multiple processing modules is determined as a target module; wherein the single tower identification module is used to determine a first correlation score between the second query information and the second search information based on the single tower identification, the second query information and the second search information.
[0174] In some embodiments, the determination module 820 is specifically configured to:
[0175] When the second input information does not include a pattern identifier, a dual-tower discrimination module among multiple processing modules is determined as a target module; wherein the dual-tower discrimination module is used to determine a second correlation 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 the embodiment of the present disclosure can flexibly call different processing modules according to the information type of the input information, realizes the ability to be compatible with multiple processing modules in one model, and can more flexibly support task requirements in different application scenarios.
[0177] For the description of specific functions and examples of each module and submodule of the device in the embodiment of the present disclosure, reference can be made to the relevant description of the corresponding steps in the above method embodiment, which will not be repeated here.
[0178] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0179] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0180] Fig. 9A schematic block diagram of an example electronic device 900 that can be used to implement an embodiment 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 can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0181] like Fig. 9 As shown, the device 900 includes a computing unit 901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 902 or a computer program loaded from a storage unit 907 to a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the device 900 can also be stored. The computing unit 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0182] A number of components in the device 900 are connected to the I / O interface 905, including: an input unit 906, such as a keyboard, a mouse, etc.; an output unit 907, such as various types of displays, speakers, etc.; a storage unit 908, such as a disk, an optical disk, etc.; and a communication unit 909, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the device 900 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0183] The computing unit 901 may be a variety of general and / or special 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 dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSP), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 901 performs the various methods and processes described above, such as a training method for a search correlation model and / or a search correlation determination method. For example, in some embodiments, the training method for a search correlation model and / or the search correlation determination method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 908. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 900 via the ROM 902 and / or the communication unit 909. When the computer program is loaded into RAM 903 and executed by computing unit 901, one or more steps of the above-described search relevance model training method and / or search relevance determination method may be performed. Alternatively, in other embodiments, computing unit 901 may be configured to perform the search relevance model training method and / or search relevance determination method in any other appropriate manner (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 chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0185] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0186] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, 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 a liquid crystal display (LCD) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the 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 acoustic input, voice input, or tactile input).
[0188] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: Local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
[0189] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0190] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0191] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the principles of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A method for training a search relevance model, comprising: The first input information is processed by 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 the processing module; and the multiple first output results are used to characterize the search correlation between the first query information and the first search information; Based on the plurality of first output results, determining a plurality of losses respectively corresponding to the plurality of processing modules; 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 multiple losses include a generation loss corresponding to a generation module in the multiple processing modules, the generation loss is determined based on a first output result corresponding to the generation module and a scoring reason text in the first input information, and the first output result corresponding to the generation module includes a first target text; The method of processing the first input information using a plurality of processing modules in the preset model to obtain a plurality of first output results respectively corresponding to the plurality of processing modules includes: The generation module is used to generate first attention information based on the scoring reason text in the first input information, the first query information and the first search 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 multiple losses include a single-tower discrimination loss corresponding to a single-tower discrimination module in 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 labeling score corresponding to the first input information, the first output result corresponding to the single-tower discrimination module includes a first correlation score between the first query information and the first search information; The method of processing the first input information using a plurality of processing modules in the preset model to obtain a plurality of first output results respectively corresponding to the plurality of processing modules includes: Using the single tower identification module, second attention information is generated based on the single tower identifier in the first input information, the first query information and the first search information, and the first relevance score is obtained based on the second attention information.
4. The method according to claim 3, wherein: The generating second attention information based on the single tower identifier in the first input information, the first query information, and the first search information includes: splicing the first query information and the first search information to obtain spliced information; The second attention information is generated based on the interaction between each element in the single tower logo and each element in the splicing information.
5. The method according to any one of claims 1 to 4, wherein: The multiple losses include a dual-tower discrimination loss corresponding to a dual-tower discrimination module in the multiple processing modules, the dual-tower discrimination loss is determined based on a first output result corresponding to the dual-tower discrimination module and a labeling score corresponding to the first input information, the first output result corresponding to the dual-tower discrimination module includes a second correlation score between the first query information and the first search information; The method of processing the first input information using a plurality of processing modules in the preset model to obtain a plurality of first output results respectively corresponding to the plurality of processing modules includes: The dual-tower discrimination module is used to generate third attention information 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 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 interaction between the various elements in the first query information and the interaction between the various elements in the first search information.
7. The method according to any one of claims 1 to 6, wherein: The step of training the preset model based on the multiple losses to obtain a search relevance model includes: determining a total loss based on the plurality of losses; The preset model is trained based on the total loss to obtain the search relevance model.
8. A method for determining search relevance, comprising: Acquire second input information; wherein the second input information at least includes second query information and second search information; Determining a target module among a plurality of processing modules in a search relevance model according to the information type in the second input information; The second query information and the second search information are processed by the target module to obtain a second output result; wherein the second output result is used to characterize the search correlation between the second query information and the second search information.
9. The method according to claim 8, wherein: The step of determining a target module from among a plurality of processing modules in a search relevance model according to the information type in the second input information comprises: In the case where the second input information includes a generation identifier, a generation module among the multiple processing modules is determined as a 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 comment on 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 a target module from among a plurality of processing modules in a search relevance model according to the information type in the second input information comprises: In the case where the second input information includes a single tower identification, a single tower identification module among the multiple processing modules is determined as a target module; wherein the single tower identification module is used to determine a first correlation score between the second query information and the second search information based on the single tower identification, the second query information and the second search information.
11. The method according to any one of claims 8 to 10, wherein: The step of determining a target module from among a plurality of processing modules in a search relevance model according to the information type in the second input information comprises: When the second input information does not include a pattern identifier, a dual-tower discrimination module among the multiple processing modules is determined as a target module; wherein the dual-tower discrimination module is used to determine a second correlation 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: A model output module, 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 the processing module; and the multiple first output results are used to characterize the search correlation between the first query information and the first search information; a loss determination module, configured to determine a plurality of losses respectively corresponding to the plurality of processing modules based on the plurality of first output results; A model training module is used to train the preset model based on the multiple losses to obtain a search relevance model.
13. The device according to claim 12, wherein: The multiple losses include a generation loss corresponding to a generation module in the multiple processing modules, the generation loss is determined based on a first output result corresponding to the generation module and a scoring reason text in the first input information, and the first output result corresponding to the generation module includes a first target text; The model output module comprises: A text output module is used to use the generation module to generate first attention information based on the scoring reason text in the first input information, the first query information and the first search information, and obtain the first target text based on the first attention information.
14. The device according to claim 12 or 13, wherein: The multiple losses include a single-tower discrimination loss corresponding to a single-tower discrimination module in 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 labeling score corresponding to the first input information, the first output result corresponding to the single-tower discrimination module includes a first correlation score between the first query information and the first search information; The model output module comprises: The first score output module is used to generate second attention information based on the single tower identification in the first input information, the first query information and the first search information by using the single tower identification module, and obtain the first relevance score based on the second attention information.
15. The device according to claim 14, wherein: The first score output module is further used for: splicing the first query information and the first search information to obtain spliced information; The second attention information is generated based on the interaction between each element in the single tower logo and each element in the splicing information.
16. The device according to any one of claims 12 to 15, wherein: The multiple losses include a dual-tower discrimination loss corresponding to a dual-tower discrimination module in the multiple processing modules, the dual-tower discrimination loss is determined based on a first output result corresponding to the dual-tower discrimination module and a labeling score corresponding to the first input information, the first output result corresponding to the dual-tower discrimination module includes a second correlation score between the first query information and the first search information; The model output module comprises: The second score output module is used to generate third attention information based on the first query information and the first search information by using the dual-tower discrimination module, and obtain the second relevance score based on the third attention information.
17. The device according to claim 16, wherein: The second score output module is further used for: The third attention information is generated based on the interaction between the various elements in the first query information and the interaction between the various elements in the first search information.
18. The device according to any one of claims 12 to 17, wherein: The model training module is also used for: determining a total loss based on the plurality of losses; The preset model is trained based on the total loss to obtain the search relevance model.
19. A search relevance determination device, comprising: An acquisition module, configured to acquire second input information; wherein the second input information at least includes second query information and second search information; a determination module, configured to determine a target module from among a plurality of processing modules in a search relevance model according to the information type in the second input information; A processing module is used to use the target module to process 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 correlation between the second query information and the second search information.
20. The device according to claim 19, wherein The determining module is further used for: In the case where the second input information includes a generation identifier, a generation module among the multiple processing modules is determined as a 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 comment on the search relevance between the second query information and the second search information.
21. The device according to claim 19 or 20, wherein: The determining module is further used for: In the case where the second input information includes a single tower identification, a single tower identification module among the multiple processing modules is determined as a target module; wherein the single tower identification module is used to determine a first correlation score between the second query information and the second search information based on the single tower identification, the second query information and the second search information.
22. The device according to any one of claims 19 to 21, wherein: The determining module is further used for: When the second input information does not include a pattern identifier, a dual-tower discrimination module among the multiple processing modules is determined as a target module; wherein the dual-tower discrimination module is used to determine a second correlation 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, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 11.
24. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-11.
25. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 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
Data processing method and device, storage medium and equipment
CN114297353A
Multi-path recall model training method, multi-path recall method, multi-path recall device and electronic equipment
CN115374362A
Data retrieval method and device and related equipment
CN116069893A