Method for determining degree of matching prediction model and related apparatus

By using a hybrid training method, sharing model parameters and distinguishing weights, the problem of low deployment efficiency of multiple matching degree prediction models is solved, and a single model can be efficiently deployed and trained to cover multiple relevance tasks.

WO2026037022A1PCT designated stage Publication Date: 2026-02-19TENCENT TECHNOLOGY (SHENZHEN) CO LTD

Patent Information

Application Number
PCT/CN2025/107679
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-08-12
Filing Date
2025-07-09
Publication Date
2026-02-19

AI Technical Summary

Technical Problem

In existing technologies, multiple matching degree prediction models need to be deployed for different types of relevance tasks, resulting in low deployment efficiency, high computational resource consumption, and high training costs.

Method used

By using a hybrid training method, the initial model is adjusted using training samples from two types of related tasks, sharing model parameters and distinguishing the weights of different types of tasks, resulting in a single matching degree prediction model that covers the two types of related tasks.

Benefits of technology

It improves the efficiency of model deployment, saves resource consumption, reduces model training costs, and enables a single model to cover multiple related tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025107679_19022026_PF_FP_ABST
    Figure CN2025107679_19022026_PF_FP_ABST
Patent Text Reader

Abstract

The present application discloses a method for determining a degree of matching prediction model and a related apparatus. For a target search scenario comprising two types of correlation tasks, hybrid training is performed on an initial model by using training samples from the two types of correlation tasks. In the hybrid training, model parameters are shared, and for the shared model parameters, weights are adjusted to distinguish different types of correlation tasks, so that the initial model can learn the shared model parameters so as to participate in prediction of a first type of correlation task using first weights and participate in prediction of a second type of correlation task using second weights. On this basis, in a finally obtained degree of matching prediction model, the shared model parameters have two sets of weights corresponding to the two types of correlation tasks, so as to be compatible with different requirements of semantic matching of different types of correlation tasks, so that a single model has a capability of covering the two types of correlation tasks. Accordingly, only one model needs to be deployed in the target search scenario, thereby improving the deployment efficiency of the model and reducing resource overhead.
Need to check novelty before this filing date? Find Prior Art

Description

Method for determining matching degree prediction model and related device

[0001] The present application claims priority to the Chinese patent application No. 202411105455X, filed on August 12, 2024, and entitled "Method for determining matching degree prediction model and related device", the whole content of which is incorporated herein by reference. TECHNICAL FIELD

[0002] The present application relates to the technical field of data processing, in particular to the determination of a matching degree prediction model. BACKGROUND

[0003] Based on the search function, a user can input search text to initiate a search and obtain the required information. Generally, the semantic matching between the text and the search text is evaluated first to filter out more matching texts to display to the user so that the user can obtain the information they want to see in this search.

[0004] In actual applications, a search scenario includes multiple types of relevance tasks. Based on the multiple types of relevance tasks, a user can obtain different information in one search, and the search experience is better. Generally, each type of relevance task is used to evaluate the semantic matching between two texts. However, each type of relevance task has different requirements for semantic matching, which makes the semantic matching between two texts in different types of relevance tasks exhibit certain differences. For example, whether the question text and the answer text are semantically matched, the answer text is more required to logically answer the doubts of the question text, and whether the question text and the question text are semantically matched, more attention is paid to the coincidence degree of the two texts at the text level.

[0005] Due to such differences, in the related art, a matching degree prediction model is deployed for each type of relevance task to better adapt to the requirements for semantic matching and improve the matching degree prediction accuracy. However, this approach results in the need to deploy multiple matching degree prediction models in one search scenario, which is low in deployment efficiency and requires a large amount of computing resources. SUMMARY

[0006] To solve the above technical problems, the present application provides a method for determining a matching degree prediction model and related device, which determines one matching degree prediction model covering two types of relevance tasks based on hybrid training, improves the deployment efficiency of the model, and saves the resource overhead caused by deploying multiple models.

[0007] The embodiments of the present application disclose the following technical solutions:

[0008] In one aspect, the embodiments of the present application provide a method for determining a matching degree prediction model, the method comprising:

[0009] obtain a first training sample from a first type of correlation task and a second training sample from a second type of correlation task, a first sample label being used to represent whether a first text pair included in the first training sample is semantically matched, a second sample label being used to represent whether a second text pair included in the second training sample is semantically matched, the first type of correlation task and the second type of correlation task both belong to a target search scenario, and the first type of correlation task and the second type of correlation task have different requirements for semantic matching;

[0010] determine, according to the first training sample, a first predicted matching degree of the first text pair by an initial model, and determine, according to the second training sample, a second predicted matching degree of the second text pair by the initial model;

[0011] determine a training loss according to a first difference between the first predicted matching degree and the first sample label and a second difference between the second predicted matching degree and the second sample label;

[0012] adjust shared model parameters in the initial model based on the training loss, adjust a first weight of the shared model parameters based on the first difference, and adjust a second weight of the shared model parameters based on the second difference, to obtain a matching degree prediction model, the first weight being used to represent an influence degree of the shared model parameters on determining the first predicted matching degree, the second weight being used to represent an influence degree of the shared model parameters on determining the second predicted matching degree, and the matching degree prediction model being used to determine a matching degree of a to-be-predicted text pair in the target search scenario.

[0013] In another aspect, an embodiment of the present application provides a determination apparatus of a matching degree prediction model, the apparatus comprising an obtaining unit, a determining unit and an adjusting unit:

[0014] The obtaining unit is configured to obtain a first training sample from a first type of correlation task and a second training sample from a second type of correlation task, a first sample label being used to represent whether a first text pair included in the first training sample is semantically matched, a second sample label being used to represent whether a second text pair included in the second training sample is semantically matched, the first type of correlation task and the second type of correlation task both belong to a target search scenario, and the first type of correlation task and the second type of correlation task have different requirements for semantic matching;

[0015] The determining unit is configured to determine, according to the first training sample, a first predicted matching degree of the first text pair by an initial model, and determine, according to the second training sample, a second predicted matching degree of the second text pair by the initial model;

[0016] The determining unit is further configured to determine a training loss according to a first difference between the first predicted matching degree and the first sample label, and a second difference between the second predicted matching degree and the second sample label.

[0017] The adjusting unit is configured to adjust a shared model parameter in the initial model based on the training loss, and adjust a first weight of the shared model parameter based on the first difference and a second weight of the shared model parameter based on the second difference, to obtain a matching degree prediction model, the first weight being used to represent an influence degree of the shared model parameter on determining the first predicted matching degree, the second weight being used to represent an influence degree of the shared model parameter on determining the second predicted matching degree, and the matching degree prediction model being used to determine a matching degree of a text pair to be predicted in the target search scenario.

[0018] In another aspect, an embodiment of the present application provides a computer device, which comprises a processor and a memory:

[0019] The memory is configured to store a computer program and transmit the computer program to the processor.

[0020] The processor is configured to execute the method according to the instructions in the computer program.

[0021] In another aspect, an embodiment of the present application provides a computer readable storage medium, which is configured to store a computer program, and the computer program, when executed by a computer device, causes the computer device to execute the method according to any one of the preceding aspects.

[0022] In another aspect, an embodiment of the present application provides a computer program product, which comprises a computer program, and the computer program, when executed by a computer device, causes the computer device to execute the method according to any one of the preceding aspects.

[0023] As can be seen from the above technical solution, for target search scenarios involving two types of relevance tasks, since both types of relevance tasks focus on semantic matching of text pairs, given this commonality, this application utilizes training samples from both types of relevance tasks to perform mixed training on the initial model, aiming to cover both types of relevance tasks with a single model. Specifically, the training loss is determined based on the first difference between the first predicted matching degree and the first sample label, and the second difference between the second predicted matching degree and the second sample label. Then, the shared model parameters in the initial model are adjusted based on the training loss, and the first weight of the shared model parameters is adjusted based on the first difference, and the second weight is adjusted based on the second difference. The first weight represents the degree of influence of the shared model parameters on determining the first predicted matching degree, and the second weight represents the degree of influence of the shared model parameters on determining the second predicted matching degree. It is evident that in mixed training, model parameters are shared. Simultaneously, for the shared model parameters, the weights are adjusted according to different types of relevance tasks, enabling the initial model to learn that the shared model parameters participate in the prediction of the first type of relevance task with the first weight and in the prediction of the second type of relevance task with the second weight during mixed training. Based on this, the final matching prediction model shares two sets of weights corresponding to the two types of relevance tasks. This accommodates the different semantic matching requirements of different types of relevance tasks, enabling the single model to cover both types of relevance tasks. Consequently, in target search scenarios, only this single matching prediction model needs to be deployed, which improves deployment efficiency and saves resource overhead associated with deploying multiple models. Furthermore, only one model needs to be trained, which, compared to training a model for each task, improves training efficiency. Attached Figure Description

[0024] Figure 1 is a schematic diagram of an application scenario for a method for determining a matching degree prediction model provided in an embodiment of this application;

[0025] Figure 2 is a flowchart of a method for determining a matching degree prediction model provided in an embodiment of this application;

[0026] Figure 3 is a schematic diagram of a target search scenario provided in an embodiment of this application;

[0027] Figure 4 is a schematic diagram of the model structure of an initial model provided in an embodiment of this application;

[0028] Figure 5 is a schematic diagram of another target search scenario provided by an embodiment of this application;

[0029] Figure 6 is a structural diagram of a matching degree prediction model determination device provided in an embodiment of this application;

[0030] FIG. 7 is a structural diagram of a terminal according to an embodiment of the present application;

[0031] FIG. 8 is a structural diagram of a server according to an embodiment of the present application. DETAILED DESCRIPTION

[0032] Embodiments of the present application will be described below with reference to the accompanying drawings.

[0033] For multiple relevance tasks included in a search scenario, since the requirements of semantic matching are different for each relevance task, whether two texts are semantically matched in different relevance tasks shows certain differences.

[0034] Due to such differences, in the related art, for each relevance task, a matching degree prediction model adapted to the relevance task is determined based on model training, so as to better adapt to the requirements of semantic matching in the relevance task and improve the matching degree prediction accuracy. However, this makes it necessary to deploy multiple matching degree prediction models in a search scenario, which is low in model deployment efficiency and occupies a large amount of computing resources for online inference of the models. Correspondingly, multiple matching degree prediction models also need to be trained separately, which is low in model training efficiency and high in model training cost.

[0035] To this end, embodiments of the present application provide a method for determining a matching degree prediction model and related apparatuses. For a target search scenario including two types of relevance tasks, since both of the two types of relevance tasks focus on semantic matching of text pairs, in view of such commonality, the present application performs mixed training on an initial model by using training samples from the two types of relevance tasks, so as to cover the two types of relevance tasks by using a single model. Specifically, in the mixed training, the model parameters of the initial model are shared, and meanwhile, the weights are adjusted for the shared model parameters to distinguish between the different types of relevance tasks, so that in the mixed training, the initial model can learn to participate in prediction of the first type of relevance task with a first weight and participate in prediction of the second type of relevance task with a second weight.

[0036] Based on this, in the finally obtained matching degree prediction model, the shared model parameters have two sets of weights corresponding to the two types of relevance tasks, so as to be compatible with the differences in requirements of semantic matching by different types of relevance tasks, thereby enabling the one model to have the ability to cover the two types of relevance tasks. Accordingly, in the target search scenario, only the one model of the matching degree prediction model needs to be deployed, which improves the model deployment efficiency and saves resource overhead. In addition, only one model needs to be trained, which is conducive to improving the model training efficiency, reducing the training cost, and the like, compared with the way of training one model for one task.

[0037] The determination method of the matching degree prediction model provided in the embodiments of the present application can be implemented by a computer device, which can be a terminal or a server. The server can be a physical server, a server cluster composed of multiple physical servers, a distributed system, or a cloud server providing cloud computing services. The terminal includes, but is not limited to, a smartphone, a computer, a smart voice interaction device, a smart home appliance, a vehicle-mounted terminal, and the like. The terminal and the server can be directly or indirectly connected through wired or wireless communication, which is not limited in the present application.

[0038] Specifically, the embodiments of the present application can be applied to various scenarios requiring matching degree prediction, for example, predicting the matching degree between two texts in a target search scenario. For example, a search box is provided in the target search scenario, and the user can input a search text in the search box. In this case, the matching degree needs to be predicted to filter the text to be fed back to the user. For another example, in the target search scenario, the user can read an electronic book, and during the reading process, the user can trigger a search by selecting (such as long-pressing to select) a certain text in the electronic book. At this time, the matching degree also needs to be predicted to filter the text to be fed back to the user.

[0039] It should be noted that in the specific embodiments of the present application, the process of determining the matching degree prediction model can involve user information and related data. When the above embodiments of the present application are applied to specific products or technologies, the individual consent or individual license of the user needs to be obtained, and the collection, use, and processing of related data need to comply with relevant laws, regulations, and standards of relevant countries and regions.

[0040] FIG. 1 shows an application scenario of the determination method of the matching degree prediction model provided in the embodiments of the present application. In the scenario shown in FIG. 1, the server 100 is taken as an example of the foregoing computer device for illustration:

[0041] For the target search scenario including two types of relevance tasks, since both types of relevance tasks focus on semantic matching of text pairs, in view of this commonality, the present application utilizes training samples from the two types of relevance tasks to perform mixed training on the initial model, so as to cover the two types of relevance tasks by using a single model. Specifically:

[0042] Firstly, the server 100 can obtain first training samples from the first type of relevance task and second training samples from the second type of relevance task. Then, the server 100 can input the first training samples into the initial model, output a first predicted matching degree through the initial model, and the server can input the second training samples into the initial model, output a second predicted matching degree through the initial model. Wherein, the first predicted matching degree is used to represent the matching degree between the first text pair included in the first training sample, and the second predicted matching degree is used to represent the matching degree between the second text pair included in the second training sample.

[0043] Then, the server 100 can determine a first difference between the first predicted matching degree and the first sample label, and determine a second difference between the second predicted matching degree and the second sample label, and determine a training loss based on the first difference and the second difference.

[0044] Finally, the server 100 can adjust the shared model parameters in the initial model according to the training loss, and adjust the first weight of the shared model parameters based on the first difference and adjust the second weight of the shared model parameters based on the second difference. Wherein, the first weight is used to represent the influence degree of the shared model parameters on determining the first predicted matching degree, and the second weight is used to represent the influence degree of the shared model parameters on determining the second predicted matching degree. It can be seen that in the mixed training, the model parameters are shared, and at the same time, for the shared model parameters, the weights are adjusted for different types of relevance tasks, so that in the mixed training, the initial model can learn that the shared model parameters participate in the prediction of the first type of relevance task with the first weight and participate in the prediction of the second type of relevance task with the second weight.

[0045] Based on this, in the finally obtained matching degree prediction model, the shared model parameters have two sets of weights corresponding to the two types of relevance tasks, so as to adapt to the difference that different types of relevance tasks have different requirements for semantic matching, so that this one model has the ability to cover the two types of relevance tasks.

[0046] Correspondingly in the target search scene, only one model of the matching degree prediction model needs to be deployed to predict the matching degree of the to-be-predicted text pair from the target search scene. For example, in the example of FIG. 1, the model application is indicated by a dashed box. For the to-be-predicted text pair from the target search scene, it can be input into the matching degree prediction model, and the matching degree of the to-be-predicted text pair can be output through the matching degree prediction model, so as to quickly determine the matching degree between the two texts in the to-be-predicted text pair.

[0047] Compared with the way of training one model for one task, by using the present application, it is beneficial to improve the deployment efficiency of the model and save the resource overhead caused by deploying multiple models. In addition, only one model needs to be trained, which is beneficial to improve the model training efficiency.

[0048] FIG. 2 is a flowchart of a method for determining a matching degree prediction model according to an embodiment of the present disclosure. The method is described by taking a server as an example of the foregoing computer device, and the method includes the following steps S201-S204:

[0049] S201: Obtain first training samples from a first type of relevance task and second training samples from a second type of relevance task.

[0050] The first sample label can be used to indicate whether a first text pair included in the first training sample is semantically matched, and the first text pair can be composed of two texts. The first sample label is used to indicate whether the two texts are semantically matched. Similarly, the second sample label can be used to indicate whether a second text pair included in the second training sample is semantically matched, and the second text pair can be composed of two texts. The second sample label is used to indicate whether the two texts are semantically matched.

[0051] In addition, the first type of relevance task and the second type of relevance task both belong to a target search scenario, and the first type of relevance task and the second type of relevance task have different requirements for semantic matching. That is, for a search scenario containing two types of relevance tasks, although the two types of relevance tasks have different requirements for semantic matching, both of them focus on the semantic matching of two texts. In view of this commonality, the present disclosure will use training samples from the two types of relevance tasks to perform mixed training on an initial model, so as to use a single model to cover the two types of relevance tasks, and to solve the problem that one type of relevance task requires one model.

[0052] It should be noted that the present disclosure does not make any limitation on the specific circumstances of the two types of relevance tasks. It can be understood that in different search scenarios, the search functions that can be provided for users can be different, which will also make the relevance tasks contained in the search scenario different. In order to facilitate understanding, the present disclosure provides the following examples for illustration:

[0053] In various search scenarios, a common search function can support a user to input a search text and then feed back a corresponding answer text to the user, wherein the search text input by the user is usually used to reflect the user's question, and the answer text fed back to the user is expected to solve the user's question. In addition, it can also support feeding back similar question methods to the user, so that the user can continue to search with a different question method, etc. Therefore, in a possible implementation manner, the foregoing first type of relevance task can be used to indicate that one text in the first text pair belongs to a question type, and the other text in the first text pair belongs to an answer type, and the second type of relevance task is used to indicate that both texts in the second text pair belong to a question type.

[0054] That is, the first type of relevance task focuses on giving a corresponding answer for the search text input by the user, and the second type of relevance task focuses on giving a similar question for the search text input by the user. Based on this, the two types of relevance tasks commonly seen in various search scenarios are modeled together, which is beneficial to obtain a matching degree prediction model that can cover multiple search scenarios and has a wider range of applications.

[0055] It can be understood that in addition to the two types of relevance tasks in the above examples, other types of relevance tasks can be jointly modeled together according to the actual situation in the search scenario, so as to realize a single model covering multiple types of relevance tasks, improve model deployment efficiency, improve model training efficiency, and reduce model training cost, etc. For example, in some search scenarios, in addition to the text of the answer type fed back to the user, the source of the answer will also be given, which can represent the reference literature according to which the answer is generated, so that the user can understand why there is this answer while obtaining the answer.

[0056] In this regard, a third type of relevance task can also be included, and third training samples from the third type of relevance task can be mixed with the first training samples and the second training samples to realize a single model that can cover the three types of relevance tasks. Among them, the third type of relevance task can be used to indicate that one of the third texts included in the third training samples belongs to the answer type, and the other text belongs to the source type.

[0057] S202: determining, according to the first training samples, a first predicted matching degree of the first text pair by the initial model, and determining, according to the second training samples, a second predicted matching degree of the second text pair by the initial model.

[0058] S203: determining a training loss according to a first difference between the first predicted matching degree and the first sample label, and a second difference between the second predicted matching degree and the second sample label.

[0059] After determining the training samples, the server can determine, according to the first training samples, a first predicted matching degree by the initial model, and determine, according to the second training samples, a second predicted matching degree by the initial model. Among them, the first predicted matching degree can be used to indicate the semantic matching degree between the two texts in the first text pair, and the second predicted matching degree can be used to indicate the semantic matching degree between the two texts in the second text pair.

[0060] Then, the server can determine the training loss according to the first difference between the first predicted matching degree and the first sample label, and the second difference between the second predicted matching degree and the second sample label. The first difference can reflect the deviation of the initial model when predicting the first text pair, and the second difference can reflect the deviation of the initial model when predicting the second text pair. The training loss determined based on the two parts can reflect the overall deviation of the initial model when predicting the two types of relevance tasks. Subsequently, the initial model can be trained based on these deviations to enable the initial model to more accurately complete the prediction.

[0061] It should be noted that the application does not make any limitation on how to determine the first difference, the second difference and the training loss. For example, the cross-entropy loss function can be used to determine the first difference and the second difference, and then the first difference and the second difference are summed to determine the overall training loss.

[0062] S204: Adjust the shared model parameters in the initial model based on the training loss, and adjust the first weight of the shared model parameters based on the first difference and adjust the second weight of the shared model parameters based on the second difference, to obtain a matching degree prediction model.

[0063] The shared model parameters can refer to the model parameters in the initial model that participate in predicting the first text pair and the second text pair. Since the training loss is determined based on the two parts, it can reflect the overall deviation when predicting the two types of relevance tasks, so the server can adjust the shared model parameters based on the training loss. At the same time, the server can adjust the first weight of the shared model parameters based on the first difference, and adjust the second weight of the shared model parameters based on the second difference. The first weight is used to represent the influence degree of the shared model parameters on determining the first predicted matching degree, and the second weight is used to represent the influence degree of the shared model parameters on determining the second predicted matching degree.

[0064] It should be noted that the application does not make any limitation on the determination of the shared model parameters. In the actual model training process, the model learns the knowledge carried by the training sample and minimizes the overall training loss as the training target, and continuously adjusts the model parameters in the model and the first weight and the second weight. Generally, when the overall training loss is minimized, it is considered that the model training has reached convergence, and the model training can be ended, and the matching degree prediction model is obtained at this time.

[0065] It can be understood that in addition to the shared model parameters, there can also be non-shared model parameters, which refer to participating only in the processing of a certain type of correlation task and not participating in the processing of other types of correlation tasks. In this regard, it can also be considered that a certain non-zero weight is involved in the processing of a certain type of correlation task, and the weight of other types of correlation tasks is zero.

[0066] It can be seen that in the mixed training, the model parameters are shared. Due to the commonality between the two types of correlation tasks, under the mode of deploying one model for one task, there will be the same model parameters appearing in different models, or in other words, there will be the same part between the structures of different models. Therefore, compared with this mode of deploying one model for one task, the present application, through the mode of sharing model parameters, is beneficial to saving the resource overhead brought by deploying multiple models. At the same time, for the shared model parameters, not only the overall training loss is adjusted, but also the weights of different types of correlation tasks are adjusted, so that in the mixed training, the initial model can learn the shared model parameters to participate in the prediction of the first type of correlation task with the first weight and participate in the prediction of the second type of correlation task with the second weight. Based on this, in the final matching degree prediction model, the shared model parameters have two sets of weights corresponding to the two types of correlation tasks, so as to accommodate the difference that different types of correlation tasks have different requirements for semantic matching, so that this one model has the ability to cover the two types of correlation tasks.

[0067] In summary, considering the commonality between the two types of correlation tasks, the mixed training mode is set, and in the mixed training, the model parameters are shared, which is beneficial to saving resource overhead. At the same time, the weights are adjusted for different types of tasks to accommodate the differences between the two types of correlation tasks. Thus, the matching degree prediction model obtained under the mixed training can have good prediction accuracy for both types of correlation tasks, thus achieving the purpose of a single model covering multiple tasks.

[0068] Correspondingly, the matching degree prediction model can be deployed in a target search scene, and the matching degree prediction model can be used to determine the matching degree of a pair of to-be-predicted texts in the target search scene. Among them, the pair of to-be-predicted texts can be composed of two texts from the first type of correlation task, or composed of two texts from the second type of correlation task. That is, after deploying the matching degree prediction model in the target search scene, this one model is used to complete the prediction for the first type of correlation task and the second type of correlation task in the target search scene.

[0069] Based on this, only one model needs to be deployed in a search scenario, improving the deployment efficiency of the model and saving resource overhead caused by deploying multiple models. In addition, only one model needs to be trained after the present application is adopted, which is beneficial to improving the model training efficiency and reducing the model training cost compared with training one model for one task.

[0070] It should be noted that the present application does not make any limitation on the way of determining the first predicted matching degree and the second predicted matching degree by the initial model. It can be understood that the specific content included in the training sample will affect the way of predicting the training sample and outputting the predicted matching degree by the model. In order to facilitate understanding, the present application embodiment provides the following way as an example:

[0071] (I) Since there are differences between different types of correlation tasks, which will affect the model training effect. In order to improve the model training effect, in a possible implementation, the initial model can be explicitly informed that the current training sample is from which type of correlation task by adding a task identifier in the training sample, so that the initial model can better distinguish between the two types of correlation tasks, better compatible the differences between the two types of correlation tasks, and guarantee the model training effect.

[0072] Correspondingly, if the first training sample further includes a first task identifier corresponding to the first type of correlation task, and the second training sample further includes a second task identifier corresponding to the second type of correlation task, the foregoing S202 can determine the shared model parameters to process the first text pair with the first weight based on the first task identifier through the initial model to obtain the first predicted matching degree when the first training sample is input into the initial model, and determine the shared model parameters to process the second text pair with the second weight based on the second task identifier through the initial model to obtain the second predicted matching degree when the second training sample is input into the initial model. Based on this, by carrying the task identifier in the training sample, the initial model is explicitly informed in the model training stage that the current training sample is from which type of correlation task and should activate the shared model parameters with which weight to participate in processing the text pair.

[0073] With the aid of the task identifier, the initial model can accurately distinguish which type of relevance task for each training sample, so as to more accurately learn the relevant knowledge between the two texts in the training sample. Through model training, the initial model can learn the characteristics of the two texts with high matching degree, the characteristics of the two texts with low matching degree in the first type of relevance task, and the characteristics of the two texts with high matching degree, the characteristics of the two texts with low matching degree in the second type of relevance task. Of course, this learning result is embodied by model parameters and the weight of shared model parameters.

[0074] Based on this, the initial model can better distinguish between the two types of relevance tasks, better adapt to the differences between the two types of relevance tasks, ensure the model training effect, and enable the matching degree prediction model to have more accurate prediction ability.

[0075] The process of model training is essentially a process of backpropagating training loss to adjust model parameters based on training loss, and the training loss is the overall deviation obtained by mixed training based on training samples from two types of relevance tasks. Therefore, in order to better guide model training and enable the model to learn two sets of weights corresponding to two types of relevance tasks, in one possible implementation, the training loss can also carry the task identifier, and the task identifier can explicitly indicate the difference in the contribution of each type of relevance task in the overall training loss of the model, so as to adjust the weight accordingly.

[0076] Correspondingly, if the training loss carries the first task identifier and the second task identifier, in the process of backpropagating the training loss in the initial model, the server can determine the first difference included in the training loss according to the first task identifier carried in the training loss, and determine the second difference included in the training loss according to the second task identifier carried in the training loss. Then, the server can adjust the first weight based on the first difference, and adjust the second weight based on the second difference.

[0077] Based on this, by carrying the task identifier in the training loss, the differences in each part of the training loss can be distinguished based on the task identifier, so as to adjust the weight and better guide the model training. Based on this explicit distinction, the model can learn how to deal with the prediction of the first type of relevance task with a certain weight, and how to deal with the prediction of the second type of relevance task with a certain weight, thereby facilitating the improvement of the efficiency of model training.

[0078] After the model training is completed, the matching degree prediction model obtained by the training can be deployed in a target search scene, and subsequently the matching degree prediction model can be used to determine the matching degree of a to-be-predicted text pair in the target search scene. It should be noted that the application does not make any limitation on the manner of how to use the matching degree prediction model to determine the matching degree of the to-be-predicted text pair. In order to better understand, corresponding to the training manner in which the training sample carries the task identifier, the embodiment of the application provides an example of using the matching degree prediction model to determine the matching degree of the to-be-predicted text pair:

[0079] For the to-be-predicted text pair in the target search scene, if it is determined that the to-be-predicted text pair is from a target class relevance task, the target class relevance task is the first class relevance task or the second class relevance task, the server can first construct a to-be-predicted sample according to the target task identifier corresponding to the to-be-predicted text pair and the target class relevance task, that is, the to-be-predicted sample also carries a task identifier, to explicitly inform the matching degree prediction model that the current to-be-predicted text pair is from which class of relevance task, and to determine which weight should be used to activate the shared model parameter for processing. Specifically, after the server inputs the to-be-predicted sample into the matching degree prediction model, it can determine the shared model parameter to process the to-be-predicted text pair with the target weight based on the target task identifier through the matching degree prediction model, and obtain a target matching degree. Wherein, when the target class relevance task is the first class relevance task, the target task identifier is the first task identifier, and the target weight is the first weight, or when the target class relevance task is the second class relevance task, the target task identifier is the second task identifier, and the target weight is the second weight.

[0080] It can be seen that in the model application stage, the input of the model also carries a task identifier, so as to explicitly determine which class of relevance task the to-be-predicted text pair is from, and then activate the shared model parameter with a weight adapted to the class of relevance task to participate in the processing of the to-be-predicted text pair, so as to obtain a more accurate target matching degree and improve the prediction accuracy.

[0081] It should be noted that the application does not make any limitation on the manner of how to determine that the target class relevance task is the first class relevance task or the second class relevance task. In order to facilitate understanding, the embodiment of the application takes the to-be-predicted text pair comprising a first to-be-predicted text and a second to-be-predicted text as an example, and provides the following manner as an example:

[0082] Generally, the target search scenario can include multiple businesses, in actual application, the to-be-predicted text can be generated in the process of business running, and the to-be-predicted texts generated by different businesses can be different, so that the to-be-predicted text formed can have differences in the correlation task to which it belongs. Therefore, in one possible implementation manner, the specific type of the target type correlation task can be determined based on the businesses generating the two to-be-predicted texts.

[0083] In specific implementation, the server can first determine a first business generating the first to-be-predicted text, and determine a second business generating the second to-be-predicted text, wherein the first business and the second business are both businesses in the target search scenario. Then, the server can determine, according to the first business and the second business, that the target type correlation task is a first type correlation task or a second type correlation task.

[0084] Based on this, in actual application stage, the corresponding correlation task category can be judged based on the business generating the to-be-predicted text, which is beneficial to determine a target matching degree that is more suitable for the business situation and improve the prediction accuracy.

[0085] The application does not make any limitation on how to determine the target type correlation task based on the business. For ease of understanding, the first type correlation task described above can be used to indicate that one text in the first text pair belongs to the question type and the other text in the first text pair belongs to the answer type, wherein the first type correlation task is used to determine the correlation between the text belonging to the question type and the text belonging to the answer type in the first text pair. And the second type correlation task is used to indicate that both texts in the second text pair belong to the question type, wherein the second type correlation task is used to determine the correlation between the two texts belonging to the question type in the second text pair.

[0086] Taking the above case as an example, the following examples are provided to illustrate the manner of determining the target type correlation task based on the business in the application stage:

[0087] For example, if the first business is a search box business, the first to-be-predicted text can be a text input by the user based on the search box business through the search box, so it is determined that the first to-be-predicted text belongs to the question type, and if the second business is an answer generation business, the second to-be-predicted text can be a text generated by the answer generation business, so it is determined that the second to-be-predicted text belongs to the answer type. Correspondingly, it can be determined that the target type correlation task is the first type correlation task.

[0088] For example, if the first business is still the search box business described above, and the second business is a question generation business, the second to-be-predicted text can be a text generated by the question generation business, so it is determined that the second to-be-predicted text belongs to the question type. Correspondingly, it can be determined that the target type correlation task is the second type correlation task.

[0089] It can be understood that other businesses can also be included in the target search scenario, and other types of relevance tasks can also be included. In actual applications, flexible settings can be made according to actual conditions.

[0090] (II) From the actual search business demand in the search scenario, when the user initiates a search, it is expected to search for reliable content. At the user side, high-confidence text is often considered more reliable. Since the background is based on the predicted matching degree determined by the model to evaluate whether it is reliable and whether it needs to be fed back to the user, in another possible implementation, in addition to the text pair in the training sample, an auxiliary text can also be added to the training sample to represent the confidence of the text based on the auxiliary text. Based on this, a matching degree prediction model that is more in line with the actual search business demand can be trained.

[0091] In a possible implementation, if the first text pair includes a first search text and a historical answer text, the first training sample further includes a first auxiliary text, the first auxiliary text is used to represent the confidence of the historical answer text, the second text pair includes a second search text and a third search text, and the second training sample further includes a second auxiliary text, the second auxiliary text is used to represent the confidence of the third search text. In the specific implementation of S202, the server can analyze the semantic relevance of the first search text and the historical answer text and the confidence of the historical answer text based on the first training sample through the initial model to obtain a first predicted matching degree, and the server can analyze the semantic relevance of the second search text and the third search text and the confidence of the third search text based on the second training sample through the initial model to obtain a second predicted matching degree.

[0092] It can be seen that the matching degree between two texts can be predicted by combining the two aspects of semantics and confidence. In this way, the initial model can learn the correlation between confidence and matching degree during model training. Generally, higher-confidence text is more likely to be adopted by users, so higher confidence corresponds to higher matching degree, and lower confidence corresponds to lower matching degree. Based on this, the obtained matching degree prediction model is more conducive to determining a matching degree that is more in line with the actual search business demand.

[0093] It should be noted that the first auxiliary text and the second auxiliary text are not limited by the present application. For ease of understanding, the following methods are provided by the embodiments of the present application as examples:

[0094] In actual search services, the search text input by the user is used to reflect the user's question, and the returned answer text is used to answer the user's question. The more reliable the text source of the answer text (such as from authoritative books and the like), the more likely the user will consider the answer text to be accurate and capable of answering the question. Conversely, the less reliable the text source, the more difficult it can be for the user to believe the answer text. Therefore, in order to make the matching degree more in line with the actual search service requirements, in a possible implementation manner, the foregoing first auxiliary text can be used to represent the text source of the historical answer text, that is, the confidence of the answer text is reflected by using the text source.

[0095] Correspondingly, in the model application stage, for a pair of to-be-predicted texts composed of the first to-be-predicted text (such as the search text input by the user) and the second to-be-predicted text (such as the to-be-determined answer text), the text source of the second to-be-predicted text can also be input into the matching degree prediction model as auxiliary text, so as to determine the matching degree between the first to-be-predicted text and the second to-be-predicted text in combination with the confidence, and make it possible to determine the target answer text that is more in line with the service requirements based on the matching degree.

[0096] In addition, in actual search services, the search text input by the user is used to reflect the user's question, and the returned similar question is used to facilitate the user to continue searching or search again for the question. It can be understood that if a search text is searched frequently in a search scenario, the user is more likely to continue searching based on the search text after the search text is returned to the user. Therefore, in a possible implementation manner, the confidence of the text can be represented based on the historical search times of the search text. Specifically, the foregoing second auxiliary text can be used to represent the historical search times of the third search text in the target search scenario.

[0097] Correspondingly, in the model application stage, for a pair of to-be-predicted texts composed of the first to-be-predicted text (such as the search text input by the user) and the second to-be-predicted text (such as the to-be-determined question text), the historical search times of the second to-be-predicted text in the target search scenario can also be input into the matching degree prediction model as auxiliary text, so as to determine the matching degree between the first to-be-predicted text and the second to-be-predicted text in combination with the confidence, and make it possible to determine the target question text that is more in line with the service requirements based on the matching degree.

[0098] In the embodiment in which the auxiliary text is also included in the training sample, it also needs to be explained that the application does not make any limitation on how to construct the training sample. In order to facilitate understanding, the following manner is provided as an example by the embodiment of the application:

[0099] To improve the model training efficiency, in a possible implementation, the training sample can also be marked to distinguish the answer text, the search text and the auxiliary text, so as to explicitly indicate the role of each part of the text in the training sample, thereby facilitating the model to understand each part of the text faster and improving the model training efficiency.

[0100] In implementation, for the construction of the first training sample, the server can sequentially splice the answer mark, the historical answer text, the first auxiliary mark and the first auxiliary text to obtain the first spliced text, and determine the first training sample according to the first search text and the first spliced text. The answer mark is used to indicate that the historical answer text spliced after the answer mark is used to explain the first search text, the first auxiliary mark is used to indicate that the first auxiliary text spliced after the first auxiliary mark is used to represent the confidence of the historical answer text before the first auxiliary mark.

[0101] In addition, for the construction of the second training sample, the server can sequentially splice the question mark, the third search text, the second auxiliary mark and the second auxiliary text to obtain the second spliced text, and determine the second training sample according to the second search text and the second spliced text. The question mark is used to indicate that the third search text spliced after the question mark is used as the extended search text of the second search text, the second auxiliary mark is used to indicate that the second auxiliary text spliced after the second auxiliary mark is used to represent the confidence of the third search text before the second auxiliary mark.

[0102] As can be seen, by adding marks (such as answer marks, question marks and auxiliary marks) to the training sample, the role of each part of the text in the training sample can be explicitly indicated, so that the model can process each part of the text faster and more accurately. Based on this, the model training can be accelerated and the model training efficiency can be improved.

[0103] Correspondingly, in the model application stage, for the construction of the to-be-predicted sample, the server can sequentially splice the text mark of the second to-be-predicted text, the second to-be-predicted text, the auxiliary mark and the auxiliary text to obtain the spliced text, and determine the to-be-predicted sample according to the first to-be-predicted text and the spliced text. Then input the to-be-predicted sample into the matching degree prediction model to determine the matching degree between the first to-be-predicted text and the second to-be-predicted text. If the second to-be-predicted text is an answer type, the text mark of the second to-be-predicted text is an answer mark, or if the second to-be-predicted text is a question type, the text mark of the second to-be-predicted text can be a question mark.

[0104] It can be understood that in actual application, the training samples can include both the task identifiers of the correlation tasks and the identifiers of the texts to improve the model training efficiency, etc. For example, the first training sample can be recorded as [first task identifier, first search text, [answer identifier - historical answer text - first auxiliary identifier - first auxiliary text]], and the second training sample can be recorded as [second task identifier, second search text, [question identifier - third search text - second auxiliary identifier - second auxiliary text]].

[0105] As can be seen from the above technical solutions, for the target search scene including two types of correlation tasks, since both types of correlation tasks focus on semantic matching of text pairs, and in view of this commonality, the present application utilizes training samples from the two types of correlation tasks to perform mixed training on the initial model, so as to cover the two types of correlation tasks by using a single model. Specifically, a training loss is determined according to a first difference between the first predicted matching degree and the first sample label, and a second difference between the second predicted matching degree and the second sample label. Then, the shared model parameters in the initial model are adjusted according to the training loss, and a first weight of the shared model parameters is adjusted based on the first difference, and a second weight of the shared model parameters is adjusted based on the second difference. The first weight is used to represent the influence degree of the shared model parameters on determining the first predicted matching degree, and the second weight is used to represent the influence degree of the shared model parameters on determining the second predicted matching degree. As can be seen, in the mixed training, the model parameters are shared, and for the shared model parameters, the weights are adjusted for different types of correlation tasks, so that in the mixed training, the initial model can learn that the shared model parameters participate in the prediction of the first type of correlation task with the first weight and participate in the prediction of the second type of correlation task with the second weight. Based on this, in the final matching degree prediction model, the shared model parameters have two sets of weights corresponding to the two types of correlation tasks, so as to accommodate the difference that different types of correlation tasks have different requirements for semantic matching, so that this one model has the ability to cover the two types of correlation tasks. Accordingly, in the target search scene, only this one model of the matching degree prediction model needs to be deployed, which is beneficial to improve the deployment efficiency of the model and save the resource overhead caused by deploying multiple models. In addition, only one model needs to be trained, which is beneficial to improve the model training efficiency compared with the way of training one model for one task.

[0106] The determination method of the matching degree prediction model provided in the present application is described in detail through the above embodiments. After obtaining the matching degree prediction model, the matching degree prediction model can be deployed in a target search scenario to determine the matching degrees of pairs of texts to be predicted in the target search scenario. For better understanding, the application examples of the matching degree prediction model will be further described with the first type of correlation task indicating that one of the first pair of texts belongs to the question type, the other of the first pair of texts belongs to the answer type, and the second type of correlation task indicating that both of the second pair of texts belong to the question type as an example.

[0107] In a possible implementation, when a user needs to use a search function, the user can input a search text in a target search scenario. Correspondingly, the server can first acquire a plurality of pending answer texts generated for the search text and a plurality of pending question texts generated for the search text in response to receiving the search text input in the target search scenario. The search text belongs to the question type, the pending answer texts belong to the answer type, and the pending question texts belong to the question type.

[0108] Then, the server can determine a first pair of texts to be predicted from the first type of correlation task according to the search text and the pending answer texts, and determine a second pair of texts to be predicted from the second type of correlation task according to the search text and the pending question texts.

[0109] Then, the server can determine a first matching degree of the first pair of texts to be predicted by the matching degree prediction model with the shared model parameters and a first weight, and determine a second matching degree of the second pair of texts to be predicted by the matching degree prediction model with the shared model parameters and a second weight. The first matching degree refers to the matching degree between the search text and the pending answer texts, and can reflect the degree to which the pending answer texts can answer the question represented by the search text. The second matching degree refers to the matching degree between the search text and the pending question texts, and can reflect the similarity or relevance between the search text and the pending question texts.

[0110] Finally, the server can determine a target answer text corresponding to the search text according to the first matching degrees respectively corresponding to the plurality of pending answer texts, and determine a target question text corresponding to the search text according to the second matching degrees respectively corresponding to the plurality of pending question texts. The server can display the target answer text and the target question text in the target search scenario.

[0111] Based on this, in the model application stage, for each pair of to-be-predicted texts from each type of relevance task, the shared model parameters are activated for prediction with the weight corresponding to the relevance task, ensuring the prediction accuracy of a single model when dealing with two types of relevance tasks. After the matching degree is determined, the target answer text and the target question text that need to be fed back to the user can be determined based on the matching degree, so that the user can directly obtain the answer and similar question method information after inputting the search text.

[0112] It can be seen that two pairs of to-be-predicted texts can be included in one search, corresponding to two types of relevance tasks, and the two pairs of to-be-predicted texts are for the same search text. Because of the association between the two types of relevance tasks in one search in actual application, and both focus on semantic matching, the two types of relevance tasks are mixed modeled, so that model training can be performed based on more abundant training samples, which is beneficial to improve the prediction effect of the matching degree prediction model. And experimental data also shows that mixed modeling of multiple types of relevance tasks can bring positive benefits to each other and improve model performance.

[0113] In addition, in actual application, the search function of the target search scenario can be provided to the user in the form of an interactive page. The user can input search text in the search box in the interactive page, and after the background performs search, recall, matching degree prediction, and screening of the target answer text and the target question text, the target answer text can be displayed in the answer area in the interactive page, and the target question text can be displayed in the question area in the interactive page. In this way, the user can intuitively obtain the answer, similar question method, and the like. Because of the association between the two types of relevance tasks in actual application, there are different matching degree prediction needs in the same interactive page. After deploying a single model to cover multiple types of relevance tasks in the target search scenario, only one model needs to be called to predict the matching degree in one search. In related technologies, one model is used for one type of task, so that multiple models need to be called in one search. Therefore, after adopting the present application, not only can the resource overhead caused by deploying multiple models be saved, but also the complexity of the background processing logic of the target search scenario can be reduced.

[0114] For example, FIG. 3 shows a schematic diagram of a target search scenario. The interactive page corresponding to the target search scenario is displayed on the terminal 300. The user can input search text in the search box, for example, input “A event when did it happen?”. Finally, the target answer text displayed in the answer area can include “A event refers to xxxx, which occurred at xxxx time.” and “At xxxx time, affected by xxx, A event broke out.”, and the target question text displayed in the question area can include “What is the reason for the outbreak of A event?” and “What impact did A event bring?”.

[0115] It should be noted that the application does not make any limitation on how to determine the target answer text and the target question text based on the matching degree. For the convenience of understanding, the application provides the following way as an example:

[0116] Generally, the higher the matching degree is, the more likely it is considered that the information is needed by the user this time. Therefore, in a possible implementation, the text with a high matching degree can be filtered. In specific implementation, the server can filter the pending answer text with a first matching degree greater than a first threshold value as the target answer text from the plurality of pending answer texts, and the server can filter the pending question text with a second matching degree greater than a second threshold value as the target question text from the plurality of pending question texts.

[0117] If the first matching degree is greater than the first threshold value, it is considered that the pending answer text can be used to answer the question in the search text, so it can be determined as the target answer text. Generally, the higher the first matching degree is, the more likely it is considered that the user's question can be solved after the feedback. Similarly, if the second matching degree is greater than the second threshold value, it is considered that the pending question text is similar to the search text and can be used as an extended search text of the search text, for example, the search text is an A question about xxx, and the pending question text can be a B question extended around xxx. Generally, the higher the second matching degree is, the more likely it is considered that the user can be solved, such as directly continuing to search based on the pending question text.

[0118] Therefore, by filtering the text with a high matching degree to feed back to the user, the user can obtain the information needed this time, and the user's search experience is improved.

[0119] The first threshold value and the second threshold value can be set according to actual conditions, and the application does not make any limitation thereon. Generally, the matching degree can be a value between 0 and 1, and the threshold value can be set to 0.6. Of course, the first threshold value and the second threshold value can be set to the same value or different values.

[0120] In actual application, the number of texts fed back to the user in different search scenarios is different. Therefore, in another possible implementation, the target answer text and the target question text can also be determined in combination with the number of answer displays and the number of question displays set in the target search scenario. In specific implementation, the pending answer text with the first matching degree ranked in the front of the number of answer display positions can be determined as the target answer text, and the pending question text with the second matching degree ranked in the front of the number of question display positions can be determined as the target question text. Based on this, it can be flexibly adapted to different search scenarios.

[0121] It should be noted that the present application does not make any limitation on how the multiple pending answer texts and the multiple pending question texts are generated. In actual applications, the multiple pending answer texts corresponding to the search text can be generated by an answer generation module, and the multiple pending question texts corresponding to the search text can be generated by a question generation module.

[0122] In addition, it should be noted that the present application does not make any limitation on the model structure. In order to facilitate understanding, the present application provides the following examples for illustration:

[0123] Since both types of relevance tasks in the target search scenario focus on the matching between two texts. Therefore, in one possible implementation, a pre-trained language representation model with better performance in semantic understanding of text can be selected. The pre-trained language representation model can be obtained by unsupervised pre-training on a large-scale pre-training corpus based on pre-trained language model technology, so as to improve the semantic understanding ability of the text. Then, the pre-trained language representation model can be used to construct the initial model, and further model training based on the training samples in the target search scenario can be performed to accelerate the model training and faster determine the matching degree prediction model that can adapt to the target search scenario.

[0124] In order to better understand, the present application also provides a model structure diagram of the initial model as shown in FIG. 4, which specifically includes a bidirectional encoder representation from transformers (BERT), a feedforward neural network (FNN), and a mapping function (such as a Softmax function), specifically:

[0125] BERT can be the aforementioned pre-trained language representation model, which has good performance in capturing and understanding language information in the text. The initial model is constructed based on BERT to improve the ability of the initial model in text understanding, which is conducive to accelerating the model training and obtaining the matching degree prediction model.

[0126] FNN is a basic artificial neural network model. In FNN, information can only be transmitted from the input layer to the output layer, and there is no backward transmission or cycle, so it is called feedforward neural network. FNN has the characteristics of simple network structure, easy to understand and implement, and is widely used in various machine learning tasks. Generally, FNN can be composed of multiple layers, such as input layer, hidden layer and output layer. The output of BERT is taken as the input of FNN, and the final prediction result is output after the processing of FNN.

[0127] The Softmax function is a special logistic function commonly used in multi-classification problems. It can map a set of input values to a set of output values, which can be interpreted as probabilities, specifically the probability of the input belonging to each class, and the sum of all output values is 1. Therefore, the Softmax function is very suitable for processing multi-classification problems.

[0128] For ease of understanding, in the example of FIG. 4, the first training sample is taken as an example to illustrate that the first training sample is input into the initial model, and after being processed by the initial model, the corresponding first prediction matching degree is output. For example, the input first training sample can be denoted as X, after inputting X into the initial model, the overall representation H of the first search text and the historical answer text can be determined based on BERT, i.e. H = BERT(X), and then the output Y of the initial model is determined by processing based on FFN and finally mapping by the Softmax function, i.e. Y = Softmax(FNN(H)). After using the Softmax function, the output first prediction matching degree can include two values, i.e. matching probability y1 and non-matching probability y2, i.e. the aforementioned Y can include y1 and y2, wherein y1 can represent the probability of matching between the first search text and the historical answer text, and y2 can represent the probability of non-matching between the first search text and the historical answer text. For example, y1 = 0.99 and y2 = 0.01.

[0129] In the example of FIG. 4, the first training sample can be denoted as [CLS] [first task identifier] [first search text] [SEP] [historical answer text] [SEP], and similarly, the second training sample can also be denoted as [CLS] [second task identifier] [second search text] [SEP] [third search text] [SEP].

[0130] Wherein, CLS and SEP are special markers commonly used in natural language processing when processing text. Specifically, the full name of CLS is Classification Token, and in the model structure of BERT, etc., the CLS marker is usually added at the beginning of the input sequence, which is used to represent the class or intention of the entire sequence. And, the full name of SEP is Separator Token, and in the model structure of BERT, etc., the SEP marker is usually used to separate two sentences or paragraphs in the input sequence, so that the model can distinguish them and understand the relationship between them, improving the model's ability to process complex text tasks.

[0131] The determination method of the matching degree prediction model provided in the present application is described in detail through the above various embodiments. In order to better understand, the present application takes the target search scenario as an example, which includes the aforementioned first type of relevance task, the second type of relevance task and the third type of relevance task, and provides the following example description:

[0132] The first type of relevance task is used to indicate that one text in the first text pair belongs to the question type and the other text in the first text pair belongs to the answer type, for example, in the first training sample from the first type of relevance task, the first text pair includes the first search text and the historical answer text. Generally, the search text input by the user is a relatively short sentence, while the answer text is a relatively long text, which can be regarded as a paragraph. Therefore, this type of relevance task can also be considered to model the matching degree between the search word and the paragraph, which can be denoted as [Question-Content], and the aforementioned first task identifier can be denoted as TASK token1=[TASK-Question-Content].

[0133] For example, the first training sample can be denoted as [CLS][TASK-Question-Content][When did the A event occur?][SEP][The A event refers to xxxx, which occurred at xxxx time.][SEP].

[0134] The second type of relevance task is used to indicate that both texts in the second text pair belong to the question type, for example, in the second training sample from the second type of relevance task, the second text pair includes the second search text and the third search text. Generally, the question is relatively short, that is, the second search text and the third search text can be considered as relatively short sentences, and in actual search business, the target question text fed back to the user is also expected to be directly used by the user to continue searching. Therefore, this type of relevance task can also be considered to model the matching degree between the search word and the search word, and the search word can specifically refer to the question, which can be denoted as [Question-Question], and the aforementioned second task identifier can be denoted as TASK token2=[TASK-Question-Question].

[0135] For example, the second training sample can be denoted as [CLS][TASK-Question-Question][When did the A event occur?][SEP][What effects did the A event bring?][SEP].

[0136] The third type of relevance task is used to indicate that one of the texts in the third text included in the third training sample belongs to the answer type, and the other text belongs to the source type, for example, in the third training sample from the third type of relevance task, the third text pair includes a historical answer text and a source text, and the third training sample has a third sample label, which can be used to represent whether the historical answer text and the source text are semantically matched. Generally, both the answer text and the source text belong to relatively long texts, which can be regarded as paragraphs, and can be denoted as [Content-Content], and the corresponding third task identifier can be denoted as TASK token3=[TASK-Content-Content].

[0137] For example, the third training sample can be denoted as [CLS][TASK-Content-Content][The event refers to xxxx, which occurred at xxxx time.][SEP][In <xxx>The book records that xxxxx.][SEP].

[0138] It can be understood that, similar to the first training sample and the second training sample, the third auxiliary text can also be included in the third training sample, such as the third auxiliary text can be the source of the source text, such as the book name, the journal name, the book introduction, the author introduction, etc. Correspondingly, the aforementioned third training sample can be written as [CLS][TASK-Content-Content][A event refers to xxx, which occurred at xxx time.][SEP][Book-name] <xxx>[Book-des] <xxx>is a book published by xx, written by xx, which tells the story of xxx.[In <xxx>Book-name can be an auxiliary identifier, used to indicate the following <xxx>is the book name, and Book-des is the auxiliary identifier, indicating that the text after it is the book introduction.

[0139] After the mixed training, the obtained matching degree prediction model is deployed in the target search scene. In a search, for the search text input by the user, the matching degree prediction model can be called to complete the matching degree prediction between the search text and the to-be-determined answer text, the matching degree prediction between the search text and the to-be-determined question text, and the matching degree prediction between the to-be-determined answer text and the to-be-determined source text. For ease of understanding, on the basis of the foregoing example of FIG. 3, another schematic diagram of a target search scene is shown in FIG. 5, and specifically:

[0140] The terminal 500 displays an interactive page of the target search scene. For details, refer to the foregoing description of the example of FIG. 3, which will not be repeated here. Finally, in the answer area, not only the target answer text but also the source corresponding to the target answer text can be displayed for the user's reference. For example, for the target answer text "A event refers to xxxx, which occurred in xxxx time.", the source text "from <xxxx>Book, at xxxx time, because xxx, led to the outbreak of A event, brought a series of changes.

[0141] Based on this, for the case that there are different matching degree prediction needs in the same interactive page, through the mixed training mode, after deploying a single model to cover multiple correlation tasks, only one model needs to be called to complete the prediction of multiple matching degrees to filter the text parts to be displayed. In this way, not only the resource overhead caused by deploying multiple models can be saved, but also the complexity of the background processing logic of the target search scene is reduced.

[0142] It should be noted that, on the basis of the implementation modes provided by the above aspects, further combinations can be made to provide more implementation modes.

[0143] Based on the determination method of the matching degree prediction model provided by the corresponding embodiment of FIG. 2, the embodiment of the present application further provides a determination device 600 of a matching degree prediction model, which comprises an acquisition unit 601, a determination unit 602 and an adjustment unit 603:

[0144] The acquisition unit 601 is configured to acquire a first training sample from a first correlation task and a second training sample from a second correlation task, a first sample label is used to indicate whether a first text pair included in the first training sample is semantically matched, and a second sample label is used to indicate whether a second text pair included in the second training sample is semantically matched, the first correlation task and the second correlation task both belong to a target search scene, and the first correlation task and the second correlation task have different requirements for semantic matching.

[0145] The determination unit 602 is configured to determine a first predicted matching degree of the first text pair by an initial model according to the first training sample, and determine a second predicted matching degree of the second text pair by the initial model according to the second training sample.

[0146] The determination unit 602 is further configured to determine a training loss according to a first difference between the first predicted matching degree and the first sample label, and a second difference between the second predicted matching degree and the second sample label.

[0147] The adjustment unit 603 is configured to adjust a shared model parameter in the initial model based on the training loss, adjust a first weight of the shared model parameter based on the first difference, and adjust a second weight of the shared model parameter based on the second difference, to obtain a matching degree prediction model, the first weight being used to represent an influence degree of the shared model parameter on determining the first predicted matching degree, the second weight being used to represent an influence degree of the shared model parameter on determining the second predicted matching degree, and the matching degree prediction model being used to determine a matching degree of a to-be-predicted text pair in the target search scene.

[0148] In a possible implementation, if the first training sample further includes a first task identifier corresponding to the first type of correlation task, and the second training sample further includes a second task identifier corresponding to the second type of correlation task, the determination unit is further configured to:

[0149] After inputting the first training sample into the initial model, the shared model parameter is determined by the initial model to process the first text pair with the first weight based on the first task identifier, to obtain the first predicted matching degree.

[0150] After inputting the second training sample into the initial model, the shared model parameter is determined by the initial model to process the second text pair with the second weight based on the second task identifier, to obtain the second predicted matching degree.

[0151] In a possible implementation, if the training loss carries the first task identifier and the second task identifier, the adjustment unit is further configured to:

[0152] In the process of backpropagating the training loss in the initial model, the first difference included in the training loss is determined according to the first task identifier carried in the training loss, and the second difference included in the training loss is determined according to the second task identifier carried in the training loss.

[0153] The first weight is adjusted based on the first difference, and the second weight is adjusted based on the second difference.

[0154] In a possible implementation, if it is determined that the to-be-predicted text pair is from a target type of correlation task, the determination unit is further configured to:

[0155] A to-be-predicted sample is constructed according to the to-be-predicted text pair and a target task identifier corresponding to the target type of correlation task.

[0156] After inputting the to-be-predicted sample into the matching degree prediction model, based on the target task identifier, the shared model parameter is determined by the matching degree prediction model to process the to-be-predicted text pair with a target weight, to obtain a target matching degree.

[0157] When the target correlation task is the first type of correlation task, the target task identifier is the first task identifier, and the target weight is the first weight, or when the target correlation task is the second type of correlation task, the target task identifier is the second task identifier, and the target weight is the second weight.

[0158] In a possible implementation, if the to-be-predicted text pair includes a first to-be-predicted text and a second to-be-predicted text, the determining unit is further configured to:

[0159] determine a first business that generates the first to-be-predicted text, and determine a second business that generates the second to-be-predicted text, the first business and the second business are both businesses in the target search scenario;

[0160] According to the first business and the second business, it is determined that the target correlation task is the first type of correlation task or the second type of correlation task.

[0161] In a possible implementation, the first type of correlation task is used to indicate the correlation of one text belonging to a question type and the other text belonging to an answer type in the first text pair, and the second type of correlation task is used to indicate the correlation of both texts belonging to a question type in the second text pair.

[0162] In a possible implementation, the determining unit is further configured to:

[0163] In response to receiving the answer type search text input in the target search scenario, a plurality of pending answer texts generated for the search text are obtained, and a plurality of pending question texts generated for the search text are obtained;

[0164] According to the search text and the pending answer text, a first to-be-predicted text pair from the first type of correlation task is determined, and according to the search text and the pending question text, a second to-be-predicted text pair from the second type of correlation task is determined;

[0165] The shared model parameter is determined by the matching degree prediction model to determine a first matching degree of the first to-be-predicted text pair with the first weight, and the shared model parameter is determined by the matching degree prediction model to determine a second matching degree of the second to-be-predicted text pair with the second weight.

[0166] determine the target answer text corresponding to the search text according to the first matching degrees respectively corresponding to the plurality of pending answer texts, and determine the target question text corresponding to the search text according to the second matching degrees respectively corresponding to the plurality of pending question texts;

[0167] display the target answer text and the target question text in the target search scene.

[0168] In a possible implementation, the determining unit is further configured to:

[0169] screen, from the plurality of pending answer texts, a pending answer text with a first matching degree greater than a first threshold value as the target answer text;

[0170] screen, from the plurality of pending question texts, a pending question text with a second matching degree greater than a second threshold value as the target question text.

[0171] In a possible implementation, if the first text pair includes a first search text and a historical answer text, the first training sample further includes a first auxiliary text, the first auxiliary text is used to represent a confidence degree of the historical answer text, the second text pair includes a second search text and a third search text, the second training sample further includes a second auxiliary text, the second auxiliary text is used to represent a confidence degree of the third search text, and the determining unit is further configured to:

[0172] perform semantic correlation analysis on the first search text and the historical answer text and perform confidence degree analysis on the historical answer text according to the first training sample by using the initial model, to obtain the first predicted matching degree;

[0173] perform semantic correlation analysis on the second search text and the third search text and perform confidence degree analysis on the third search text according to the second training sample by using the initial model, to obtain the second predicted matching degree.

[0174] In a possible implementation, the first auxiliary text is used to represent a text source of the historical answer text, and the second auxiliary text is used to represent a historical search frequency of the third search text in the target search scene.

[0175] In a possible implementation, the determining unit is further configured to:

[0176] The answer mark, the historical answer text, the first auxiliary mark and the first auxiliary text are spliced in sequence to obtain a first spliced text, the answer mark is used to indicate that the historical answer text spliced after the answer mark is used to explain the first search text, the first auxiliary mark is used to indicate the first auxiliary text spliced after the first auxiliary mark, and the confidence of the historical answer text spliced before the first auxiliary mark is represented.

[0177] The first training sample is determined according to the first search text and the first spliced text.

[0178] The question mark, the third search text, the second auxiliary mark and the second auxiliary text are spliced in sequence to obtain a second spliced text, the question mark is used to indicate that the third search text spliced after the question mark is used as extended search text of the second search text, the second auxiliary mark is used to indicate the second auxiliary text spliced after the second auxiliary mark, and the confidence of the third search text spliced before the second auxiliary mark is represented.

[0179] The second training sample is determined according to the second search text and the second spliced text.

[0180] According to the technical solution, for the target search scene including two types of relevance tasks, since both types of relevance tasks focus on semantic matching of text pairs, and in view of the commonality, the application utilizes training samples from the two types of relevance tasks to perform mixed training on the initial model, so as to cover the two types of relevance tasks by using a single model. Specifically, a training loss is determined according to a first difference between the first predicted matching degree and the first sample label and a second difference between the second predicted matching degree and the second sample label. Then, the shared model parameters in the initial model are adjusted according to the training loss, and a first weight of the shared model parameters is adjusted based on the first difference and a second weight of the shared model parameters is adjusted based on the second difference. The first weight is used to represent the influence degree of the shared model parameters on determining the first predicted matching degree, and the second weight is used to represent the influence degree of the shared model parameters on determining the second predicted matching degree. It can be seen that in the mixed training, the model parameters are shared, and for the shared model parameters, the weights are adjusted according to different types of relevance tasks, so that in the mixed training, the initial model can learn that the shared model parameters participate in the prediction of the first type of relevance task with the first weight and participate in the prediction of the second type of relevance task with the second weight. Based on this, in the final matching degree prediction model, the shared model parameters have two sets of weights corresponding to the two types of relevance tasks, so as to accommodate the difference that different types of relevance tasks have different requirements for semantic matching, so that this one model has the ability to cover the two types of relevance tasks. Accordingly, in the target search scene, only one model, i.e., the matching degree prediction model, needs to be deployed, which is beneficial to improve the deployment efficiency of the model and save the resource overhead caused by deploying multiple models. In addition, only one model needs to be trained, which is beneficial to improve the model training efficiency compared with the way of training one model for one task.

[0181] The embodiment of the application further provides a computer device, which can be a terminal, taking a smart phone as an example.

[0182] Figure 7 shows a block diagram of a part of the structure of the smart phone provided in the embodiments of the present application. Referring to Figure 7, the smart phone includes a radio frequency (RF) circuit 1110, a memory 1120, an input unit 1130, a display unit 1140, a sensor 1150, an audio circuit 1160, a wireless fidelity (WiFi) module 1170, a processor 1180, and a power supply 1190, etc. The input unit 1130 can include a touch panel 1131 and other input devices 1132, and the display unit 1140 can include a display panel 1141. The audio circuit 1160 can include a speaker 1161 and a microphone 1162. Those skilled in the art can understand that the structure of the smart phone shown in Figure 7 does not constitute a limitation on the smart phone, and the smart phone can include more or fewer components than those shown in the figure, or combine some components, or have a different arrangement of components.

[0183] The memory 1120 can be used to store software programs and modules, and the processor 1180 can execute various function applications and data processing of the smart phone by running the software programs and modules stored in the memory 1120. The memory 1120 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.), etc., and the data storage area can store data created according to the use of the smart phone (such as audio data, a phone book, etc.), etc. In addition, the memory 1120 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state memory device.

[0184] The processor 1180 is the control center of the smart phone, and connects all parts of the smart phone through various interfaces and lines, and executes various functions and processes data of the smart phone by running or executing the software programs and / or modules stored in the memory 1120 and calling the data stored in the memory 1120. Optionally, the processor 1180 can include one or more processing units; preferably, the processor 1180 can integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and an application program, etc., and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor can also not be integrated into the processor 1180.

[0185] In the embodiments, the steps performed by the processor 1180 in the smart phone can be implemented based on the structure shown in Figure 7.

[0186] The computer device provided in the embodiments of the present application can also be a server. Referring to FIG. 8, FIG. 8 is a structural diagram of a server 1200 provided in the embodiments of the present application. The server 1200 can be quite different due to different configurations or performances. The server 1200 can include one or more processors, for example, a central processing unit (CPU) 1222, and a memory 1232, and one or more storage media 1230 (for example, one or more mass storage devices) storing application programs 1242 or data 1244. The memory 1232 and the storage media 1230 can be temporary storage or persistent storage. The programs stored in the storage media 1230 can include one or more modules (not shown in the figure), and each module can include a series of instruction operations in the server. Further, the central processing unit 1222 can be configured to communicate with the storage media 1230 and execute the series of instruction operations in the storage media 1230 on the server 1200.

[0187] The server 1200 can also include one or more power supplies 1226, one or more wired or wireless network interfaces 1250, one or more input and output interfaces 1258, and / or one or more operating systems 1241, for example, Windows Server TM , Mac OS X TM , Unix TM , Linux TM , FreeBSD TM , and the like.

[0188] In the embodiments, the central processing unit 1222 in the server 1200 can perform the following steps:

[0189] obtain a first training sample from a first type of relevance task and a second training sample from a second type of relevance task, a first sample label is used to represent whether a first text pair included in the first training sample is semantically matched, and a second sample label is used to represent whether a second text pair included in the second training sample is semantically matched, the first type of relevance task and the second type of relevance task both belong to a target search scenario, and the first type of relevance task and the second type of relevance task have different requirements for semantic matching;

[0190] determine, according to the first training sample, a first predicted matching degree of the first text pair by an initial model, and determine, according to the second training sample, a second predicted matching degree of the second text pair by the initial model;

[0191] determine a training loss according to a first difference between the first predicted matching degree and the first sample label, and a second difference between the second predicted matching degree and the second sample label;

[0192] adjust the shared model parameters in the initial model based on the training loss, and adjust a first weight of the shared model parameters based on the first difference and adjust a second weight of the shared model parameters based on the second difference, to obtain a matching degree prediction model, the first weight being used to represent an influence degree of the shared model parameters on determining the first predicted matching degree, the second weight being used to represent an influence degree of the shared model parameters on determining the second predicted matching degree, the matching degree prediction model being used to determine a matching degree of a text pair to be predicted in the target search scenario.

[0193] According to an aspect of the present application, a computer readable storage medium is provided, the computer readable storage medium is used to store a computer program, the computer program is run by a computer device, so that the computer device executes the determination method of the matching degree prediction model provided in each of the foregoing embodiments.

[0194] According to an aspect of the present application, a computer program product is provided, the computer program product includes a computer program stored in a computer readable storage medium. A processor of a computer device reads the computer program from the computer readable storage medium, and the processor executes the computer program, so that the computer device executes the method provided in various optional implementation manners of the above embodiments.

[0195] The description of the flow or structure corresponding to each of the above figures has its own emphasis, and the part not described in detail in a certain flow or structure can be referred to the related description of other flows or structures.

[0196] The terms "first", "second", "third", "fourth" and the like in the description of the present application and the above drawings, if any, are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily limit to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

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

[0198] The units described as separated components can or can not be physically separated, and the components displayed as units can or can not be physical units, i.e., can be located in one place, or can be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purposes of the embodiments of the present application.

[0199] In addition, each functional unit in the embodiments of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be implemented in the form of hardware, or in the form of software functional units.

[0200] When the integrated unit is implemented in the form of software functional units and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on such an understanding, the technical solutions of the present application essentially or the part that makes a contribution to the related art, or all or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a plurality of instructions for causing a computer device (which can be a computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various other media that can store program codes.

[0201] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined target, and can be implemented entirely or partially by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, one processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of an integral module or unit that includes the functions of the module or unit.

[0202] The above-described embodiments are merely used to illustrate the technical solutions of the present application, but not limit the present application; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.< / xxxx> < / xxx> < / xxx> < / xxx> < / xxx> < / xxx>

Claims

1. A method for determining a matching degree prediction model, the method being performed by a computer device, and comprising: obtaining first training samples from a first correlation task and second training samples from a second correlation task, a first sample label being used to represent whether a first text pair included in the first training samples is semantically matched, and a second sample label being used to represent whether a second text pair included in the second training samples is semantically matched, the first correlation task and the second correlation task both belonging to a target search scenario, and the first correlation task and the second correlation task having different requirements for semantic matching; determining, according to the first training samples, a first predicted matching degree of the first text pair by an initial model, and determining, according to the second training samples, a second predicted matching degree of the second text pair by the initial model; determining a training loss according to a first difference between the first predicted matching degree and the first sample label, and a second difference between the second predicted matching degree and the second sample label; adjusting shared model parameters in the initial model based on the training loss, adjusting a first weight of the shared model parameters based on the first difference, and adjusting a second weight of the shared model parameters based on the second difference, to obtain a matching degree prediction model, the first weight being used to represent an influence degree of the shared model parameters on determining the first predicted matching degree, the second weight being used to represent an influence degree of the shared model parameters on determining the second predicted matching degree, and the matching degree prediction model being used to determine a matching degree of a to-be-predicted text pair in the target search scenario.

2. The method of claim 1, if the first training samples further include a first task identifier corresponding to the first correlation task, and the second training samples further include a second task identifier corresponding to the second correlation task, the determining, according to the first training samples, a first predicted matching degree of the first text pair by an initial model comprises: after inputting the first training samples into the initial model, determining, based on the first task identifier, that the shared model parameters process the first text pair with the first weight by the initial model, to obtain the first predicted matching degree; and the determining, according to the second training samples, a second predicted matching degree of the second text pair by the initial model comprises: after inputting the second training samples into the initial model, determining, based on the second task identifier, that the shared model parameters process the second text pair with the second weight by the initial model, to obtain the second predicted matching degree.

3. The method of claim 2, if the training loss carries the first task identifier and the second task identifier, the adjusting, based on the first difference, a first weight of the shared model parameters, and the adjusting, based on the second difference, a second weight of the shared model parameters, comprises: ​ ​ ​ ​ ​ ​ ​ In the process of back propagation of the training loss in the initial model, the first difference included in the training loss is determined according to the first task identifier carried in the training loss, and the second difference included in the training loss is determined according to the second task identifier carried in the training loss; The first weight is adjusted based on the first difference, and the second weight is adjusted based on the second difference.

4. The method of claim 2, if it is determined that the to-be-predicted text pair is from a target class correlation task, the method further comprises: constructing a to-be-predicted sample according to a target task identifier corresponding to the to-be-predicted text pair and the target class correlation task; after inputting the to-be-predicted sample into the matching degree prediction model, determining, by the matching degree prediction model, that the shared model parameters process the to-be-predicted text pair with a target weight based on the target task identifier, to obtain a target matching degree; wherein, when the target class correlation task is the first class correlation task, the target task identifier is the first task identifier, and the target weight is the first weight, or when the target class correlation task is the second class correlation task, the target task identifier is the second task identifier, and the target weight is the second weight.

5. The method of claim 4, if the to-be-predicted text pair includes a first to-be-predicted text and a second to-be-predicted text, the method further comprises: determining a first business that generates the first to-be-predicted text, and determining a second business that generates the second to-be-predicted text, the first business and the second business being businesses in the target search scenario; determining, according to the first business and the second business, that the target class correlation task is the first class correlation task or the second class correlation task.

6. The method of claim 1, wherein the first class correlation task is used to indicate the correlation between a text belonging to a question type and a text belonging to an answer type in the first text pair, and the second class correlation task is used to indicate the correlation between two texts belonging to the question type in the second text pair.

7. The method of claim 6, the method further comprising: in response to receiving a search text of the question type input in the target search scenario, obtaining a plurality of pending answer texts generated for the search text, and obtaining a plurality of pending question texts generated for the search text; determining, according to the search text and the pending answer text, a first to-be-predicted text pair from the first class correlation task, and determining, according to the search text and the pending question text, a second to-be-predicted text pair from the second class correlation task; determining, by the matching degree prediction model, a first matching degree of the first to-be-predicted text pair with the first weight, and determining, by the matching degree prediction model, a second matching degree of the second to-be-predicted text pair with the second weight. determine the target answer text corresponding to the search text according to the first matching degrees respectively corresponding to the plurality of pending answer texts, and determine the target question text corresponding to the search text according to the second matching degrees respectively corresponding to the plurality of pending question texts; display the target answer text and the target question text in the target search scene.

8. The method of claim 7, wherein the determining the target answer text corresponding to the search text according to the first matching degrees respectively corresponding to the plurality of pending answer texts comprises: screening, from the plurality of pending answer texts, a pending answer text with a first matching degree greater than a first threshold value as the target answer text. The determining the target question text corresponding to the search text according to the second matching degrees respectively corresponding to the plurality of pending question texts comprises: screening, from the plurality of pending question texts, a pending question text with a second matching degree greater than a second threshold value as the target question text.

9. The method of claim 1, wherein if the first text pair comprises a first search text and a historical answer text, the first training sample further comprises a first auxiliary text, the first auxiliary text being used to represent a confidence degree of the historical answer text, the second text pair comprises a second search text and a third search text, and the second training sample further comprises a second auxiliary text, the second auxiliary text being used to represent a confidence degree of the third search text, the determining, according to the first training sample, of the first predicted matching degree of the first text pair by the initial model comprises: performing semantic correlation analysis on the first search text and the historical answer text and confidence degree analysis on the historical answer text by the initial model according to the first training sample to obtain the first predicted matching degree. The determining, according to the second training sample, of the second predicted matching degree of the second text pair by the initial model comprises: performing semantic correlation analysis on the second search text and the third search text and confidence degree analysis on the third search text by the initial model according to the second training sample to obtain the second predicted matching degree.

10. The method of claim 9, wherein the first auxiliary text is used to represent a text source of the historical answer text, and the second auxiliary text is used to represent a historical search frequency of the third search text in the target search scene.

11. The method of claim 9, further comprising: splicing, in sequence, an answer identifier, the historical answer text, a first auxiliary identifier, and the first auxiliary text to obtain a first spliced text, the answer identifier being used to indicate that the historical answer text spliced after the answer identifier is used to explain the first search text, and the first auxiliary identifier being used to indicate the first auxiliary text spliced after the first auxiliary identifier, which is used to represent the confidence degree of the historical answer text spliced before the first auxiliary identifier; determining the first training sample according to the first search text and the first spliced text. The question mark, the third search text, the second auxiliary mark and the second auxiliary text are sequentially spliced to obtain a second spliced text, the question mark is used to indicate that the third search text spliced after the question mark is used as an extended search text of the second search text, the second auxiliary mark is used to indicate the second auxiliary text spliced after the second auxiliary mark, and the confidence degree of the third search text spliced before the second auxiliary mark is represented; According to the second search text and the second spliced text, the second training sample is determined.

12. A determination apparatus of a matching degree prediction model, the apparatus comprising an acquisition unit, a determination unit and an adjustment unit: The acquisition unit is configured to acquire a first training sample from a first correlation task and a second training sample from a second correlation task, a first sample label is used to represent whether a first text pair included in the first training sample is semantically matched, a second sample label is used to represent whether a second text pair included in the second training sample is semantically matched, the first correlation task and the second correlation task both belong to a target search scene, and the first correlation task and the second correlation task have different requirements for semantic matching; The determination unit is configured to determine a first predicted matching degree of the first text pair by an initial model according to the first training sample, and determine a second predicted matching degree of the second text pair by the initial model according to the second training sample; The determination unit is further configured to determine a training loss according to a first difference between the first predicted matching degree and the first sample label, and a second difference between the second predicted matching degree and the second sample label; The adjustment unit is configured to adjust a shared model parameter in the initial model based on the training loss, adjust a first weight of the shared model parameter based on the first difference, and adjust a second weight of the shared model parameter based on the second difference, to obtain a matching degree prediction model, the first weight is used to represent an influence degree of the shared model parameter on determining the first predicted matching degree, the second weight is used to represent an influence degree of the shared model parameter on determining the second predicted matching degree, and the matching degree prediction model is used to determine a matching degree of a to-be-predicted text pair in the target search scene.

13. A computer device, comprising a processor and a memory: The memory is configured to store a computer program and transmit the computer program to the processor; The processor is configured to execute the method in any one of claims 1-11 according to instructions in the computer program.

14. A computer readable storage medium, configured to store a computer program, the computer program being run by a computer device to cause the computer device to execute the method in any one of claims 1-11.

15. A computer program product comprising a computer program which, when run on a computer device, causes the computer device to perform the method of any one of claims 1-11.

Citation Information

Patent Citations

  • Method and device for generating semantic matching model

    CN111666416A

  • Semantic matching model training method and text matching method

    CN115511073A

  • Extraction-generation type answer generation model and method based on pre-training

    CN117932066A

  • Method and device for training target model

    CN118395184A

  • Network structure construction method and apparatus for use in multi-task scenario

    WO2021114625A1

Cited By

  • Data processing method and system for tailing pond phytoremediation

    CN121810128A

  • Model scheduling methods, devices, and equipment based on capability vector matching

    CN122309750A