Vector generation model determination method and related device

By calculating the similarity loss of the vector generation model and performing model training, the discrimination ability of the vector generation model is improved, the problem of poor recall effect in the existing technology is solved, and more accurate recall of related content is achieved.

CN120705389APending Publication Date: 2025-09-26TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410353900.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-25
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

Existing vector generation models are insufficient in their ability to distinguish content, resulting in poor recall and making it difficult to accurately search for related content.

Method used

The vector of the query sample content is determined through the initial generation model, the similarity loss between the vectors is calculated, and the model is trained based on the optimization goal of maximizing the first similarity and minimizing the second similarity to improve the model's ability to distinguish between related sample content and non-related sample content.

Benefits of technology

The probability of related content being recalled is increased, and the probability of non-related content being recalled is reduced, achieving better recall effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120705389A_ABST
    Figure CN120705389A_ABST
Patent Text Reader

Abstract

The invention discloses a method for determining a vector generation model and a related device, and the method comprises the steps: carrying out the model training of an initial generation model based on an optimization target of maximizing the first similarity between a query vector and an association vector, and minimizing the second similarity between the query vector and a non-association vector; the model learns the ability to distinguish between associated sample content and non-associated sample content. In this way, the distinction degree between the query vector determined through the vector generation model and the association vector is lower, and the distinction degree between the query vector and the non-association vector is higher. In the recall stage, the target vector of the query content and the to-be-determined vector of the to-be-determined content can be determined through the vector generation model, the discrimination degree of the vector of the associated content and the target vector is lower, and the discrimination degree of the vector of the non-associated content and the target vector is higher; therefore, the recall probability of the associated content can be improved, and the recall probability of the non-associated content can be reduced, so that the more accurate associated content can be determined, and a better recall effect can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a method for determining a vector generation model and related devices. Background Art

[0002] With the development of information technology, information retrieval (IR) has gained widespread application and research as a means of searching for desired content within a vast amount of content. For example, common search engines allow users to enter a query (such as text) and then automatically return relevant content to the user.

[0003] In practical applications, whether the returned content is truly relevant to the query can be used to evaluate the recall effect. Related technologies use vector-based search to implement information retrieval. Specifically, a vector generation model can be obtained based on model training, and the vector generation model can be used to determine the vector corresponding to the content. This vector can be used to reflect the content. During the recall phase, the vector generation model will also be used to determine the vector corresponding to the query content entered by the user, and then a search based on the vector will be performed to obtain related content.

[0004] However, the vector generation model in the related art lacks the ability to distinguish content. As a result, the vectors determined for different content may not be very different, which makes it difficult for the vector to accurately reflect the content, making it difficult to search for more accurate related content during the recall phase, resulting in poor recall effect. Summary of the Invention

[0005] In order to solve the above technical problems, the present application provides a method and related device for determining a vector generation model, which can increase the probability of related content being recalled and reduce the probability of non-related content being recalled, thereby determining more accurate related content from the pending content and achieving better recall effect.

[0006] The embodiments of this application disclose the following technical solutions:

[0007] In one aspect, an embodiment of the present application provides a method for determining a vector generation model, the method comprising:

[0008] Acquire training samples, where the training samples include query sample content, sample content associated with the query sample content, and sample content not associated with the query sample content;

[0009] Determining a query vector of the query sample content, an association vector of the associated sample content, and a non-association vector of the non-association sample content through an initial generation model;

[0010] determining a first similarity between the query vector and the associated vector, and determining a second similarity between the query vector and the non-associated vector;

[0011] determining a similarity loss according to the first similarity and the second similarity;

[0012] Using the similarity loss, training the initial generation model based on a first optimization objective to obtain a vector generation model, wherein the first optimization objective is used to indicate maximizing the first similarity and minimizing the second similarity;

[0013] In response to receiving the query content, the target vector of the query content is determined by the vector generation model. The target vector and the pending vector of the pending content are used to determine the associated content of the query content from the pending content. The pending vector is determined by the vector generation model.

[0014] In another aspect, an embodiment of the present application provides a device for determining a vector generation model, the device comprising an acquisition unit, a determination unit, and a training unit:

[0015] The acquiring unit is configured to acquire training samples, wherein the training samples include query sample content, sample content associated with the query sample content, and sample content not associated with the query sample content;

[0016] The determining unit is configured to determine the query vector of the query sample content, the association vector of the association sample content, and the non-association vector of the non-association sample content through an initial generation model;

[0017] The determining unit is further configured to determine a first similarity between the query vector and the associated vector, and to determine a second similarity between the query vector and the non-associated vector;

[0018] The determining unit is further configured to determine a similarity loss based on the first similarity and the second similarity;

[0019] The training unit is configured to perform model training on the initial generation model based on a first optimization objective using the similarity loss to obtain a vector generation model, wherein the first optimization objective is used to indicate maximizing the first similarity and minimizing the second similarity;

[0020] The determination unit is further used to determine the target vector of the query content through the vector generation model in response to receiving the query content, and the target vector and the pending vector of the pending content are used to determine the associated content of the query content from the pending content, and the pending vector is determined by the vector generation model.

[0021] In another aspect, an embodiment of the present application provides a computer device, comprising a processor and a memory.

[0022] The memory is used to store a computer program and transmit the computer program to the processor;

[0023] The processor is configured to execute the method described in any one of the preceding aspects according to instructions in the computer program.

[0024] On the other hand, an embodiment of the present application provides a computer-readable storage medium, which is used to store a computer program. When the computer program is executed by a computer device, the computer device executes the method described in any of the above aspects.

[0025] On the other hand, an embodiment of the present application provides a computer program product, including a computer program, which, when executed on a computer device, enables the computer device to execute the method described in any one of the aforementioned aspects.

[0026] It can be seen from the above technical solution that the query vector of the query sample content, the association vector of the associated sample content, and the non-association vector of the non-association sample content can be determined by the initial generation model. Then, the first similarity between the query vector and the association vector can be determined, and the second similarity between the query vector and the non-association vector can be determined. In addition, the similarity loss is determined based on the first similarity and the second similarity, and the initial generation model is trained based on the similarity loss and the first optimization goal of maximizing the first similarity and minimizing the second similarity, so that the model can learn to bring the query sample content and the associated sample content closer and push the query sample content and the non-association sample content further apart in one training, thereby improving the model's ability to distinguish between the associated sample content and the non-association sample content. In this way, the distinction between the query vector and the associated vector determined by the vector generation model is lower, and the distinction between the query vector and the non-association vector is higher, which also improves the distinction between the associated vector and the non-association vector. Correspondingly, in the recall stage, in response to receiving the query content, the target vector of the query content and the pending vector of the pending content can be determined through the vector generation model. Since the vector of the related content has a lower degree of distinction from the target vector and the vector of the non-related content has a higher degree of distinction from the target vector, when recalling based on the target vector and the pending vector, the probability of related content being recalled can be increased and the probability of non-related content being recalled can be reduced, thereby determining more accurate related content from the pending content and having a better recall effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technical members in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0028] Figure 1 A schematic diagram of an application scenario of a method for determining a vector generation model provided in an embodiment of the present application;

[0029] Figure 2 A flowchart of a method for determining a vector generation model provided in an embodiment of the present application;

[0030] Figure 3 A schematic diagram of an application flow of a method for determining a vector generation model provided in an embodiment of the present application;

[0031] Figure 4 A schematic diagram of a search scenario provided in an embodiment of the present application;

[0032] Figure 5 A structural diagram of a device for determining a vector generation model provided in an embodiment of the present application;

[0033] Figure 6 A structural diagram of a terminal provided in an embodiment of the present application;

[0034] Figure 7 A structural diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION

[0035] The embodiments of the present application are described below with reference to the accompanying drawings.

[0036] With the development of information technology, information retrieval methods have made it easier for people to search for the content they need from a large amount of content. For example, common search engines can achieve the above-mentioned information retrieval. Generally, information retrieval refers to the process of querying information, which involves information processing and retrieving a large amount of content. In practical applications, the process of searching for the required content from a large amount of content can be called retrieval recall, and whether the returned content is truly relevant to the query content can be used to evaluate the recall effect. It can be understood that the more relevant the returned content is to the query content, it indicates that the relevant content has been accurately searched from a large amount of content, the higher the recall effect, and the better the user experience after it is returned to the user.

[0037] In some scenarios, related technologies employ a recall method based on manual policy definition to search for relevant content within a large volume of content. Specifically, the recall scope is defined based on manually configured policies, such as keyword matching or rule engines. However, this approach relies on manually specified policies, resulting in low scalability and automation. Furthermore, manually specified policies are difficult to cover all search scenarios, limiting recall effectiveness.

[0038] In some other scenarios of related technologies, a vector-based search method is used to achieve the purpose of searching for related content from a large amount of content. Specifically, a vector generation model can be obtained through model training based on artificial intelligence technology, and the vector corresponding to the content can be determined through the vector generation model. This vector can be used to reflect the content. In the recall stage, for the query content entered by the user, the vector generation model will also be used to determine the vector corresponding to the query content. Then, based on the vector of the query content and the vector of the content in the content library, a search is performed to screen the content corresponding to the vector close to the query content as related content, and the related content is recalled and returned to the user.

[0039] However, the vector generation models used in related technologies lack the ability to distinguish between different content. Consequently, the vectors generated for different pieces of content may differ slightly, making it difficult for the vectors to accurately reflect the content. This results in difficulty in accurately searching for more accurate related content during the recall phase, leading to poor recall effectiveness. For example, the vectors of two different pieces of content (one related content, the other unrelated content) may be similar to the vector of the query content, resulting in both being recalled or not being recalled. This makes it difficult to accurately recall related content, resulting in poor recall effectiveness.

[0040] To this end, an embodiment of the present application provides a method and related device for determining a vector generation model, which determines the vector corresponding to the content based on the initial generation model. In terms of model training, the similarity loss is determined based on the first similarity between the query vector and the associated vector, and the second similarity between the query vector and the non-associated vector. The initial generation model is trained based on the similarity loss with the optimization goal of maximizing the first similarity and minimizing the second similarity, so that the model can learn to bring the query sample content and the associated sample content closer and push the query sample content and the non-associated sample content further apart in one training, thereby improving the model's ability to distinguish between the associated sample content and the non-associated sample content. In this way, the distinction between the query vector and the associated vector is lower, and the distinction between the query vector and the non-associated vector is higher, thereby improving the distinction between the associated vector and the non-associated vector. When recalling the query sample content, the probability of the associated sample content being recalled is higher, and the probability of the non-associated sample content being recalled is lower, which is conducive to improving the recall effect.

[0041] Based on this, compared with the vector-based search method used in related technologies, the vector generation model in the embodiment of the present application has a better ability to distinguish content. Accordingly, in the recall stage, it can increase the probability of related content being recalled and reduce the probability of non-related content being recalled, thereby determining more accurate related content and having a better recall effect.

[0042] Furthermore, compared to the recall method based on manual policy delineation used in related technologies, the embodiments of the present application no longer rely on manually specified policies, are more scalable, and are applicable to more search scenarios, solving the problem of limited recall effectiveness due to the difficulty of policy coverage. During the recall phase, automatic recall can be implemented based on the query content, which has a higher degree of automation and is conducive to improving recall efficiency.

[0043] The method for determining the vector generation model provided in the embodiment of the present application can be implemented by a computer device, which can be a terminal or a server, wherein the server can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services. Terminals include but are not limited to smartphones, computers, intelligent voice interaction devices, smart home appliances, car terminals, etc. The terminal and the server can be directly or indirectly connected via wired or wireless communication, and this application does not limit this. The embodiments of the present application can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, audio and video, assisted driving, etc.

[0044] Specifically, the embodiments of the present application can be applied to various search scenarios that require retrieval and recall, such as video search scenarios, product search scenarios, document search scenarios, etc. For example, in a video search scenario, the associated content that needs to be retrieved and recalled may be videos; in a product search scenario, the associated content that needs to be retrieved and recalled may be products (specifically, for example, product introduction links); and in a document search scenario, the associated content that needs to be retrieved and recalled may be documents.

[0045] The method for determining the vector generation model provided in the embodiment of the present application may involve artificial intelligence technology. Artificial intelligence (AI) is a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. Among them, artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level technology and software-level technology. Basic artificial intelligence technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, and mechatronics. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing (NLP) technology, and machine learning / deep learning, autonomous driving, smart transportation and other major directions. For example, in the embodiment of the present application, machine learning can be used to train the initial generation model to obtain a vector generation model, so as to facilitate the use of the vector generation model to determine the vector of each content to achieve search recall based on vector retrieval. During model training, the model can understand and parse each content generated based on human language based on NPL, thereby generating corresponding vectors.

[0046] It should be noted that in the specific implementation of this application, the process of determining the vector generation model may involve relevant data such as user information. When the above embodiments of this application are applied to specific products or technologies, the user's separate consent or separate permission is required, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions.

[0047] Figure 1 The following is a schematic diagram showing an application scenario of the method for determining a vector generation model provided in an embodiment of the present application. Figure 1 In the illustrated scenario, the server 100 is used as an example of the aforementioned computer device for illustration:

[0048] First, the server 100 can obtain training samples. Figure 1 In this example, the training samples may include query sample content A, sample content B associated with query sample content A, and non-associated sample content C. The query sample content may refer to content entered by a user during a query, such as historical query content; the associated sample content may refer to content related to the query sample content, such as content retrieved during historical queries; and the non-associated sample content may refer to content unrelated to the query sample content, such as content not retrieved during historical queries.

[0049] Next, the server 100 can determine the vectors of each content using the initial generation model and use the vectors to represent the content. Specifically, the query vector a of the query sample content A, the association vector b of the association sample content B, and the non-association vector c of the non-association sample content C can be determined.

[0050] Furthermore, the server 100 may determine a first similarity S1 between the query vector a and the associated vector b, and a second similarity S2 between the query vector a and the non-associated vector c. The first similarity S1 may represent the degree of similarity between the query vector a and the associated vector b, and the second similarity S2 may represent the degree of similarity between the query vector a and the non-associated vector c.

[0051] Next, the server 100 can determine the similarity loss based on the first similarity S1 and the second similarity S2, and perform model training on the initial generation model based on the similarity loss and the optimization goals of maximizing S1 and minimizing S2. In this way, the model can learn to bring a and b closer and push a and c further apart in one training session, so that b and c with higher discrimination can be determined through the model, that is, the model's ability to distinguish between related sample content and non-related sample content is improved. Based on this, since the discrimination between a and b is lower and the discrimination between a and c is higher, when recalling A, the probability of B being recalled is increased and the probability of C being recalled is reduced, resulting in a better recall effect.

[0052] Based on this, compared with the vector-based search method used in related technologies, the vector generation model obtained in the embodiment of the present application has better discrimination ability. After completing the model training, the obtained vector generation model can be applied in the recall stage, specifically:

[0053] When a user needs to search, they can enter a query. Accordingly, server 100 can determine the target vector for the query and the pending vector for the pending content using a vector generation model in response to receiving the query. Because the vectors for related content have a lower degree of distinction from the target vector, and the vectors for non-related content have a higher degree of distinction from the target vector, when recalling content based on the target vector and the pending vector, the probability of recalling related content is increased, while the probability of recalling non-related content is reduced. This allows for more accurate determination of related content from the pending content, resulting in better recall results.

[0054] Figure 2 This is a flowchart of a method for determining a vector generation model provided in an embodiment of the present application, which is illustrated using a server as an example of the aforementioned computer device. The method includes S201-S206:

[0055] S201: Obtain training samples.

[0056] Training samples may include query sample content, sample content associated with the query sample content, and sample content not associated with the query sample content. Query sample content may refer to content entered during a query and may reflect query requirements, such as historical query content. Associated samples may refer to content related to the query sample content, such as content retrieved during historical queries. Non-associated sample content may refer to content unrelated to the query sample content, such as content not retrieved during historical queries.

[0057] It should be noted that this application does not impose any limitations on the form of content. In some embodiments, the form of content may be different for different search scenarios. For example, for the aforementioned video search scenario, the form of content may be video, and for the aforementioned document search scenario, the form of content may be document. In some other embodiments, for the same search scenario, the form of different content may also be different. For example, for the aforementioned video search scenario, the form of query sample content may be text, and the form of associated sample content and non-associated sample content may be video, etc. In actual applications, content in the form of video may also correspond to text describing the video content, etc.

[0058] S202: Determine a query vector of the query sample content, an associated vector of the associated sample content, and a non-associated vector of the non-associated sample content through an initial generation model.

[0059] Among them, the initial generation model can be used to determine the vector corresponding to the content. Specifically, the server can determine the query vector of the query sample content, the association vector of the association sample content, and the non-association vector of the non-association sample content through the initial generation model. Generally, content (such as text vocabulary) can be a discrete variable, while a vector is a continuous variable. Therefore, using vectors to represent content is conducive to computer equipment understanding and processing queries. In practical applications, embedding is a technology that converts discrete variables into continuous vectors, so the vector corresponding to the content can be determined based on embedding. In this way, the vector can be recorded as embedding.

[0060] S203: Determine a first similarity between the query vector and the associated vector, and determine a second similarity between the query vector and the non-associated vector.

[0061] The first similarity can be used to represent the degree of similarity between the query vector and the associated vector, thereby reflecting the degree of similarity between the query sample content and the associated sample content. Similarly, the second similarity can be used to represent the degree of similarity between the query vector and the non-associated vector, thereby reflecting the degree of similarity between the query sample content and the non-associated sample content.

[0062] It should be noted that this application does not impose any restrictions on how to determine the first similarity and how to determine the second similarity. For ease of understanding, the embodiments of this application provide the following methods as examples:

[0063] In one possible implementation, the similarity between vectors can be measured based on the cosine similarity between the vectors. That is, the aforementioned first similarity and second similarity can be determined based on the cosine similarity between the vectors. For ease of understanding, taking the determination of the first similarity as an example, the following method is provided as an example:

[0064] The cosine similarity between the query vector and the associated vector can be used as the first similarity. In specific implementation, it can be determined by the following formula:

[0065]

[0066] In the above formula, e q It can represent the query vector, e d+ It can represent the correlation vector, sim(e q ,e d+ ) can represent the first similarity.

[0067] Similarly, for determining the second similarity, the above example can be referred to for implementation. In practical applications, the second similarity can be recorded as sim(e q ,e d- ).

[0068] S204: Determine a similarity loss according to the first similarity and the second similarity.

[0069] S205: Performing model training on the initial generation model based on the first optimization objective through similarity loss to obtain a vector generation model.

[0070] After determining the first similarity and the second similarity, the server may determine a similarity loss based on the first similarity and the second similarity, and use the similarity loss to train the initial generation model with a first optimization objective, wherein the first optimization objective is used to indicate maximizing the first similarity and minimizing the second similarity.

[0071] It can be seen that the similarity loss constructed by considering the first similarity and the second similarity together is constructed, and the model training is performed based on this. In this way, the model can learn the knowledge of three types of vectors, namely query vectors, associated vectors, and non-associated vectors, in one training. Specifically, since the first optimization goal indicates to maximize the first similarity and minimize the second similarity, the model can learn to bring the query vector and the associated vector closer and push the query vector and the non-associated vector further apart in one training, thereby improving the discrimination between the associated vector and the non-associated vector. In this way, for the associated sample content and the non-associated sample content, the model can determine the associated vector and the non-associated vector with higher discrimination, that is, based on this, the model training can improve the model's ability to distinguish between the associated sample content and the non-associated sample content.

[0072] Based on this, since the discrimination between the query vector and the associated vector is lower and the discrimination between the query vector and the non-associated vector is higher, when recalling the query sample content, the probability of associated content being recalled is increased and the probability of non-associated content being recalled is reduced, resulting in a better recall effect.

[0073] It should be noted that this application does not impose any restrictions on how to determine the similarity loss and how to perform model training based on the first optimization goal. For ease of understanding, the embodiments of this application provide the following examples for one-by-one explanation:

[0074] (1) Regarding how to determine the similarity loss, the embodiment of the present application provides the following method as an example:

[0075] In a search scenario, for any query content, the number of related content is usually much smaller than the number of non-related content. Therefore, based on this characteristic, it can be determined that in a training sample of a single training session, the number of related sample content is smaller than the number of non-related sample content. For example, the number of related sample content is one, and the number of non-related sample content is multiple. Based on this, the model can learn to distinguish between one related sample content and multiple non-related sample content in a single training session, which is conducive to improving the efficiency of model training. Taking this as an example, the following example illustrates the determination of similarity loss:

[0076] In a specific implementation, the server can determine the non-correlated group similarity based on the second similarities between the multiple non-correlated vectors and the target query vector. The multiple non-correlated vectors correspond to multiple non-correlated sample contents, the target query vector corresponds to the target query sample content, and the target query sample content is one of the query sample contents. That is, multiple non-correlated sample contents correspond to the same query sample content. In this case, the non-correlated group similarity can be determined first. The non-correlated group similarity can indicate the degree of similarity between the target query vector and the multiple non-correlated vectors. Next, the server can determine the similarity loss based on the first similarity between the target query vector and the relevant vector and the non-correlated group similarity.

[0077] Based on this, a method is provided for situations where a query sample corresponds to multiple unrelated sample contents: first determining the unrelated group similarity and then determining the similarity loss. In this method, the aforementioned first optimization objective can be used to indicate maximizing the first similarity and minimizing the unrelated group similarity. This allows for a single training run to separate the target query vector from multiple unrelated vectors, accelerating model training and improving its efficiency.

[0078] It should be noted that this application does not limit the method of determining the non-correlated group similarity. For example, the second similarities between multiple non-correlated vectors and the target query vector can be summed or averaged to determine the non-correlated group similarity. It can be understood that the method of determining the non-correlated group similarity based on summation is more conducive to the model to push the target further.

[0079] When training a model, the similarity loss can be used to determine a first optimization goal, such as determining to maximize the first similarity and minimize the similarity of non-correlated groups. In practical applications, a mathematical expression for the similarity loss can be determined to better indicate the optimization goal. For ease of understanding, the embodiment of the present application provides the following formula as an example of a mathematical expression for the similarity loss:

[0080] In this embodiment, the aforementioned target query sample content, multiple non-related sample contents, and one related sample content are used as examples for illustration. Specifically, the aforementioned similarity loss can be determined by the following formula:

[0081]

[0082] In the above formula, q can represent the target query sample content, d + It can represent an associated sample content, N can represent the number of non-associated sample content, d - Can represent a non-associated sample content, {d -} can represent a set of N non-correlated sample contents, e q It can represent the target query vector, e d+ It can represent the correlation vector, e d- Can represent non-associated vectors, sim(e q ,e d+ ) can represent the first similarity, sim(e q ,e d- ) can represent the second similarity, It can represent the similarity of non-correlated groups, exp can represent the exponential function with e as the base, and τ can represent the temperature parameter, which can be used to adjust the smoothness of the similarity distribution. It can usually be set according to the actual situation. For example, τ can be set to a real number less than 1. L1(q,d + ,{d -}) can represent similarity loss.

[0083] Based on the similarity loss example above, when training the model, minimize L1(q,d + ,{d -}), the first optimization goal of maximizing the first similarity and minimizing the similarity of non-associated groups can be achieved.

[0084] In practical applications, L1(q,d + ,{d - The loss is called Noise Contrastive Estimation Loss (NCELoss). During model training, the associated vectors are compared with the non-associated vectors to optimize the model's ability to learn vectors with higher discrimination.

[0085] (2) Regarding how to perform model training based on the first optimization objective, the present application provides the following methods as examples:

[0086] In one possible implementation, model training can be performed directly based on the first optimization objective, which is beneficial to improving the efficiency of model training.

[0087] In practical applications, the methods of measuring the similarity between two vectors may be different, and different methods may be to evaluate the similarity between vectors from different dimensions. Therefore, in another possible implementation method, if the aforementioned first similarity and second similarity focus on the similarity in a certain dimension, then on the basis of the first optimization goal, the model training can also be combined with the second optimization goal, and the second optimization goal can be determined based on the similarity in other different dimensions. In this way, it is beneficial to improve the distinguishing ability of the model. For ease of understanding, the embodiments of the present application provide the following methods as examples:

[0088] In one possible implementation, if the aforementioned first similarity is used to represent the directional similarity between the query vector and the associated vector in the vector space, and the second similarity is used to represent the directional similarity between the query vector and the non-associated vector in the vector space, for example, the first similarity and the second similarity can be determined based on the aforementioned cosine similarity. That is, the first similarity and the second similarity focus on the degree of similarity in the dimension of the direction of the vector. Then, the server can also determine the first distance between the positions of the query vector and the associated vector in the vector space, and determine the second distance between the positions of the query vector and the non-associated vector in the vector space. It can be seen that the first distance and the second distance focus on the degree of similarity between the positions of the vectors. Correspondingly, the server can determine the distance loss based on the first distance and the second distance. Based on this, the similarity loss focuses on the direction dimension, and the distance loss focuses on the position dimension.

[0089] During model training, the server can train the initial generative model using a similarity loss and a distance loss, based on a first optimization objective and a second optimization objective, to obtain a vector generation model. The second optimization objective is used to ensure that the first distance is smaller than the second distance. This allows the model to learn to distinguish between relevant and irrelevant vectors based on both direction and position, improving the model's discriminative capabilities and recall.

[0090] For example, if vectors a and b, or vectors a and c, have the same directional similarity (e.g., the angle between a and b is equal to the angle between a and c), but vectors b and c actually represent different things, the above approach can differentiate them based on their position. This helps the model identify vectors with higher discrimination.

[0091] It should be noted that this application does not impose any restrictions on how to determine the first distance, the second distance, and how to determine the distance loss. For ease of understanding, the embodiments of this application provide the following methods as examples:

[0092] ① Regarding how to determine the first distance and the second distance, the following example is provided, taking the determination of the first distance as an example:

[0093] The first distance refers to the distance between the positions of the query vector and the associated vector in vector space. Therefore, in one approach, the coordinates of the query vector and the associated vector in vector space can be obtained and the first distance can be determined based on these coordinates. For example, a distance calculation method such as Euclidean distance or Manhattan distance can be used to determine the first distance using coordinates.

[0094] Similarly, the method for determining the second distance can be referred to the above example and will not be repeated here.

[0095] ② The following examples illustrate how to determine distance loss:

[0096] When training the model, the second optimization goal is used to indicate that the first distance is smaller than the second distance. It can be understood that the smaller the first distance is than the second distance and the larger the gap between the two, the higher the degree of differentiation between the associated vector and the non-associated vector in the position dimension. In order to improve the distinguishing ability of the model, we hope that the first distance is smaller than the second distance and the larger the gap between the two, to this end, in one possible implementation, a second optimization goal can be set to indicate that the first distance is smaller than the second distance by at least a distance threshold. The distance threshold can be a real number greater than zero, which can be set according to actual conditions. For example, a reasonable distance threshold can be set according to the model parameters of the initial generation model.

[0097] Based on this, in the position dimension, the degree of similarity between the query vector and the associated vector can be made greater than the degree of similarity between the query vector and the non-associated vector by at least a certain degree. Therefore, it can be ensured that there is at least a certain degree of distinction between the associated vector and the non-associated vector in the position dimension, which is conducive to improving the model's distinguishing ability.

[0098] In practical applications, distance loss can be used to indicate the second optimization target. To better indicate the second optimization target, a mathematical expression for distance loss can be determined to intuitively indicate the second optimization target. For ease of understanding, the embodiment of the present application uses the aforementioned second optimization target to indicate that the first distance is less than the second distance by at least a distance threshold as an example, and provides the following formula as an example of a data expression for distance loss:

[0099] L2(q,d + ,d - )=max(0,f(e q ,e d+ )-f(e q ,e d- )+margin)

[0100] In the above formula, q can represent the query sample content, d + Can represent the associated sample content, d - Can represent non-associated sample content, e q It can represent the query vector, e d+ It can represent the correlation vector, e d- Can represent non-associated vectors, f(e q ,e d+ ) can represent the first distance, f(e q ,e d- ) can represent the second distance, margin can represent the distance threshold, L2(q,d+ ,d - ) can represent distance loss.

[0101] It should be noted that the above formula is only an example and does not limit anything. For better understanding, in actual application, when there are multiple non-correlated sample contents in the above embodiment, the final distance loss can also be determined by taking the average value. In this case, the distance loss can be recorded as L2(q,d + ,{d -}), where {d -} can represent a set of N non-related sample contents.

[0102] Based on the above distance loss example, when training the model, minimize L2(q,d + ,d - ) direction, the second optimization goal of the first distance being less than the second distance by at least the distance threshold can be achieved.

[0103] In practical applications, based on the expression of distance loss in the above example, distance loss can also be called triplet loss (Triplet Loss), where Triplet Loss is a commonly used metric learning loss function, which is mainly used to learn and optimize the relative distance of vectors in vector space. Its purpose is to make the first distance less than the second distance by at least a distance threshold, thereby ensuring that the model can better distinguish between related sample content and non-related sample content.

[0104] Through the above embodiments, the implementation method of the present application combining similarity loss and distance loss, based on the first optimization goal and the second optimization goal, to improve the distinguishing ability of the model from two dimensions is illustrated. Taking the aforementioned NCELoss indicating the first optimization goal and Triplet Loss indicating the second optimization goal as an example, usually, the similarity in NCE Loss can be understood as the probability of predicting that a content is related content, so it can also be considered that NCELoss is more concerned with distinguishing the relative probability of related sample content and non-related sample content, that is, it is more concerned with the relative probability of positive and negative samples, while Triplet Loss is more concerned with the distance difference between vectors. Model training based on this can enable the vector generation model to focus not only on the relative probability of positive and negative samples when applied to the recall stage, but also on the distance difference between them, so as to recall more accurate content and improve the recall effect.

[0105] It should also be noted that this application does not impose any restrictions on how to perform model training based on the first optimization objective and the second optimization objective. For ease of understanding, the embodiments of this application provide the following methods as examples:

[0106] In one possible implementation, the similarity loss and distance loss can be combined to guide the model training process. In specific implementation, it can be determined by the following formula:

[0107] L joint =α*L1+β*L2

[0108] In the above formula, L joint It can represent the joint loss, L1 can represent the similarity loss, L2 can represent the distance loss, α can represent the training weight of the similarity loss, and β can represent the training weight of the distance loss.

[0109] In specific implementations, the above training weights can be set according to actual needs, thereby adjusting the contribution of similarity loss and distance loss to the joint loss to balance the depth of model learning in two different dimensions. It should be noted that this application does not impose any restrictions on how to set the training weights of the two.

[0110] For ease of understanding, the present application provides the following examples:

[0111] In one possible implementation, α and β can be used as hyperparameters and continuously adjusted during model training to find the most suitable loss function combination for the recall task during model training.

[0112] Generally, the larger the angle between two vectors, the greater the distance between their positions in vector space. Therefore, in another possible implementation, during model training, the training weight for similarity loss can be set to be greater than the training weight for distance loss. This allows the model to learn more about distinguishing related from unrelated vectors in terms of direction. This allows it to more quickly learn how to distinguish related from unrelated content, accelerating model training convergence and improving training efficiency.

[0113] After determining the joint loss, we can use it to guide model training. Taking the joint loss expression in the example above as an example, by minimizing the joint loss, we can achieve the first and second optimization objectives, completing model training.

[0114] S206: In response to receiving the query content, determine a target vector of the query content using a vector generation model.

[0115] After obtaining the vector generation model, it can be applied to the recall stage. Specifically, when a user has a query requirement, he can enter the query content (for example, enter the query content in the search box) to initiate the query. Accordingly, in response to receiving the query content, the server can determine the target vector of the query content through the vector generation model. The target vector and the pending vector of the pending content can be used to determine the associated content of the query content from the pending content. Among them, the pending vector is generated by the vector generation model, and the determined associated content can refer to the part that needs to be recalled from the pending content.

[0116] Since the vector of the associated content has a lower degree of distinction from the target vector, and the vector of the unassociated content has a higher degree of distinction from the target vector, when recalling based on the target vector and the pending vector, the probability of associated content being recalled can be increased and the probability of unassociated content being recalled can be reduced, thereby determining more accurate associated content from the pending content and achieving a better recall effect.

[0117] It should be noted that this application does not impose any restrictions on how to determine the associated content. For ease of understanding, the embodiments of this application provide the following methods as examples:

[0118] It is understandable that the methods for model training vary, such as the two different methods provided in the aforementioned embodiments, namely, model training based on the first optimization objective and model training based on the first optimization objective and the second optimization objective. After obtaining the vector generation model, the methods for determining the associated content in the recall phase may vary. To facilitate understanding, the embodiments of this application use the method of model training based on the first optimization objective and the second optimization objective as an example to illustrate the method for determining the associated content in the recall phase:

[0119] In a specific implementation, the server may determine the directional similarity between the target vector and the pending vector in vector space, as well as the target distance between the positions of the target vector and the pending vector in vector space. The server may then determine the recall similarity between the target vector and the pending vector based on the directional similarity and the target distance, and determine related content from the pending content based on the recall similarity.

[0120] Based on this, the recall similarity determined by combining the two dimensions can more accurately reflect the degree of similarity between the pending vector and the target vector, and therefore more accurately reflect the degree of relevance between the pending content and the query content. This helps to determine more accurate related content. Therefore, after recalling related content, it can achieve a higher recall effect.

[0121] Among them, this application does not impose any restrictions on how to determine the recall similarity based on the directional similarity and the target distance. For example, the directional similarity can be adjusted based on the target distance, and the adjusted directional similarity can be used as the recall similarity. For example, the larger the target distance, the less similar it is, so the directional similarity can be adjusted downward. The smaller the target distance, the more similar it is, so the directional similarity can be adjusted upward. For another example, the similarity in the position dimension can be determined based on the target distance, and then the final recall similarity can be determined based on this similarity and the directional similarity.

[0122] In addition to the method of determining related content based on recall similarity provided in the above embodiment, in some scenarios, other methods can be used to determine related content, such as using the Approximate Nearest Neighbor (ANN) algorithm, the Locality-Sensetive Hashing (LSH) method, etc., to determine related content from the pending content. In actual applications, different methods can be flexibly selected based on the search scenario.

[0123] In the recall phase, the search is performed based on the vectors (target vector and pending vector) to determine the associated content. In this regard, it should be noted that this application does not impose any restrictions on the timing of determining the pending vector through the vector generation model. For ease of understanding, the embodiments of this application provide the following methods as examples:

[0124] In practical applications, the recall phase involves retrieving a small amount of relevant content from a large pool of pending content. To speed up recall, one possible implementation involves pre-determining the pending vectors before responding to a query. This allows us to determine only the target vector before starting vector-based search, which helps improve recall speed.

[0125] In a specific implementation, the step of determining the pending vector can be performed after obtaining the vector generation model. Specifically, in response to obtaining the vector generation model, the server can obtain the pending content. The server can then use the vector generation model to determine the pending vector corresponding to the pending content. Based on this, once the vector generation model is obtained, the pending vector can be determined. This allows query responses to be performed only by determining the target vector, eliminating the need for determining the pending vector. This allows online searches to begin more quickly, significantly reducing response time and improving recall speed.

[0126] Typically, user queries are initiated online. Therefore, the process of invoking the vector generation model to determine the target vector in response to a query is called online inference of the vector generation model. The process of invoking the vector generation model to determine the target vector is called offline inference of the vector generation model. Determining the target vector offline improves recall speed during online queries.

[0127] It can be seen from the above technical solution that the query vector of the query sample content, the association vector of the associated sample content, and the non-association vector of the non-association sample content can be determined by the initial generation model. Then, the first similarity between the query vector and the association vector can be determined, and the second similarity between the query vector and the non-association vector can be determined. In addition, the similarity loss is determined based on the first similarity and the second similarity, and the initial generation model is trained based on the similarity loss and the first optimization goal of maximizing the first similarity and minimizing the second similarity, so that the model can learn to bring the query sample content and the associated sample content closer and push the query sample content and the non-association sample content further apart in one training, thereby improving the model's ability to distinguish between the associated sample content and the non-association sample content. In this way, the distinction between the query vector and the associated vector determined by the vector generation model is lower, and the distinction between the query vector and the non-association vector is higher, which also improves the distinction between the associated vector and the non-association vector. Correspondingly, in the recall stage, in response to receiving the query content, the target vector of the query content and the pending vector of the pending content can be determined through the vector generation model. Since the vector of the related content has a lower degree of distinction from the target vector and the vector of the non-related content has a higher degree of distinction from the target vector, when recalling based on the target vector and the pending vector, the probability of related content being recalled can be increased and the probability of non-related content being recalled can be reduced, thereby determining more accurate related content from the pending content and having a better recall effect.

[0128] The above embodiments have described in detail the method for determining the vector generation model provided by this application. It is understandable that the condition of the training sample will affect the model training effect. In order to better understand this application, this embodiment will further introduce the construction of the training sample.

[0129] In actual applications, the associated content corresponding to different query contents is different. Therefore, in one possible implementation method, the associated sample content of other query sample contents can be used as the non-associated sample content of the current query sample content. Based on this, after determining the associated sample content of each query sample content, the non-associated sample content of each query sample content can be quickly determined, which is conducive to improving the efficiency of model training.

[0130] In a specific implementation, if there are multiple query sample contents, then for a first query sample content among the multiple query sample contents, the server can determine non-associated sample content for the first query sample content from the associated sample content of a second query sample content among the multiple query sample contents. The first query sample content and the second query sample content are different. This allows for rapid determination of non-associated sample content for each query sample content, which is beneficial for improving model training efficiency.

[0131] It should be noted that this application does not impose any restrictions on the number of the first query sample content and the second query sample content. For example, in some embodiments, taking the training samples of a training session belonging to a group (batch) as an example, for any query sample content in this batch, the associated sample content corresponding to other query sample contents in the batch can be taken as the non-associated sample content of the query sample content. In this way, multiple non-associated sample contents of the query sample content can be quickly determined. This method of determining non-associated sample content can also be called a random negative sampling method. Based on this method, after determining the associated sample content, the non-associated sample content can be sampled by defining a random negative sampling strategy within the batch, which is beneficial to reducing computing costs. In particular, when processing large-scale data sets, it can greatly reduce the demand for computing resources and help save computing resources.

[0132] In actual applications, some non-related content may be similar to the related content. If the two parts cannot be distinguished well, the non-related content that is relatively close to the related content will be recalled, affecting the recall effect. For example, in a document-based search scenario, documents that are semantically similar to the query document and therefore recalled, but the user did not choose to view them, can be considered difficult to distinguish from true related documents. Therefore, in another possible implementation, when constructing training samples, some non-related content that is relatively close to the related content can be screened so that the model can better learn the more complex and subtle distinguishing features between related and non-related content, thereby improving the distinguishing ability.

[0133] Typically, the recalled content is exposed to users, who can then access the desired content by performing actions on the content (e.g., clicking to view, sharing to view, commenting, adding to favorites, etc.). It is understood that user actions on the content can reflect the user's assessment of whether the content is relevant to the query. Therefore, in one possible implementation, such non-relevant content, which is difficult to distinguish, can be identified based on user actions.

[0134] In a specific implementation, the aforementioned query sample content may be historical query content, for example, it may be the text entered by the user during a historical query. Then, the server may obtain the historical recall content corresponding to the historical query content, and obtain the historical operation information corresponding to the historical recall content. Among them, the historical recall content may refer to the determined related content, the historical operation information may be used to indicate the historical operations corresponding to the historical recall content after the recall, and the historical operations may refer to the operations performed by the user on the historical recall content, such as the aforementioned click-to-view operation, favorite operation, etc. For example, a time window may be set (such as set to one week) to obtain the historical query content, historical recall content, and historical operations during this period within the time window.

[0135] If the target content in the historical recall content is determined to meet the non-relevance condition based on historical operation information, this indicates that although it has been recalled, the user's response to the content is not truly relevant content. Therefore, it can be considered that the target content is indistinguishable from truly relevant content. Therefore, the target content can be identified as non-relevance sample content. This helps the model learn to distinguish between relevant content and non-relevance content that is similar to relevant content during model training, ensuring recall effectiveness.

[0136] The present application does not impose any limitation on the setting of non-association conditions. In practical applications, corresponding non-association conditions can be set according to historical operations. For ease of understanding, the present application provides the following examples:

[0137] For example, if the historical action is the aforementioned click-to-view action, then after the historical recalled content is opened based on the click-to-view action, the corresponding open time of the historical recalled content can reflect the user's viewing of the historical recalled content. Generally, the longer the open time, the more likely it is the content the user needs, that is, the relevant content for the current query. If it is closed quickly after opening, it is less likely to be the content the user needs, that is, the non-relevant content for the current query. Therefore, in some scenarios, the non-relevant condition can be set to have an open time of less than a preset time.

[0138] For example, the history operation is the aforementioned collection operation. Generally, the content collected by the user is more likely to be the content the user needs, and the content not collected is more likely not the content the user needs. Therefore, in some scenarios, the content that meets the non-association condition can be set as not collected.

[0139] In another possible implementation, the initial generative model can be a vector generation model already applied to historical queries. That is, the vectors of the historical recall content and the historical query content can be determined using the initial generative model. Because the historical recall content can reveal deficiencies in the initial generative model, the initial generative model can be purposefully trained based on the historical recall content, thereby further improving the model's recall performance.

[0140] In specific implementations, the server can classify the target recall content into true difficult negative sample content and false difficult negative sample content based on the degree of operation indicated by the historical operation information of the target recall content. The degree of operation can reflect the user's evaluation of whether the recall content is truly relevant to the current query. Therefore, it can be considered to be a measure of whether the target recall content is true and difficult to distinguish from related content based on the user's degree of operation. In actual applications, the greater the degree of operation, the easier it is for the target recall content to attract users to operate on it. However, it is essentially non-related content. Therefore, the degree of operation of the aforementioned true difficult negative sample content is greater than that of the false difficult negative sample content. The true difficult negative sample content is true and difficult to distinguish from related content. In contrast, the false difficult negative sample is easy to distinguish from related content.

[0141] It's understandable that the ratio of true and false negatives can reveal whether the initial generative model's poor recall performance stems from the model's difficulty distinguishing true and false negatives or its difficulty distinguishing true and false negatives. Therefore, based on the ratio of true and false negatives, the proportion of true and false negatives in non-correlated sample content can be adjusted. This allows for targeted training of the initial generative model to address its shortcomings and improve recall.

[0142] In practical applications, the ratio of true hard negative content to false hard negative content, and the ratio of true hard negative content to non-correlated content, can be positively correlated. Therefore, if the initial generative model is poor at distinguishing true hard negative content, providing sufficient true hard negative content in the training samples allows the model to fully learn this type of content, which was originally difficult to distinguish, thereby improving its ability to distinguish.

[0143] Among them, it should be noted that this application does not impose any restrictions on how to adjust the quantitative ratio of true and difficult negative sample content in non-associated sample content based on the quantitative ratio of true and difficult negative sample content and false and difficult negative sample content. In one possible implementation method, the quantitative ratio of true and difficult negative sample content in the training sample can be controlled by adjusting the sampling strategy, for example, first sampling the expected quantitative ratio of true and difficult negative sample content. In another possible implementation method, the quantitative ratio of difficult negative sample content in the sample library composed of all data can also be adjusted, so that when randomly sampling to determine the training sample, the expected quantitative ratio of true and difficult negative sample content can be sampled.

[0144] In addition to the above-mentioned examples, in some other possible implementation methods, methods such as distillation learning labeling and scoring based on scoring models can be used to determine the associated sample content and non-associated sample content of the query sample content. This has a higher degree of automation, which is conducive to improving the efficiency of determining training samples, while avoiding the subjective bias of manual labeling, which is conducive to improving accuracy.

[0145] Among them, distillation learning, also known as knowledge distillation, is a model compression technology, in which the knowledge of a large model (called the teacher model) is used to train a smaller model (called the student model). This process can be regarded as a soft labeling method. Specifically, the output of the teacher model is used as the target for training the student model in order to obtain a lightweight model for use. In practical applications, the content is mostly in the form of documents, so a language model such as GPT-4 can be selected as a teacher model for better understanding. In this example, the query sample content can be recorded as query, and the content in the database can be recorded as doc. Among them, query can refer to the query text entered by the user when initiating a query (such as the query term entered in the search engine), and doc can refer to the content in the database, which is an abbreviation of document.

[0146] When determining the training sample, the text of (query, doc) can be pieced together and input into the GPT-4 model to determine the correlation between the two. The GPT-4 model interface is used to output the similarity score of the query-doc pair, and a threshold is set according to the score to divide the positive and negative samples. For example, a similarity score greater than 0.8 is considered a positive sample, that is, the aforementioned associated sample content, and a similarity score less than 0.15 is considered a difficult negative sample, that is, the aforementioned non-associated sample content. In this way, some existing models can be used to quickly mark and determine the associated sample content and non-associated sample content, especially for scenarios with relatively large amounts of data, which is conducive to improving efficiency.

[0147] In addition, you can also choose other pre-trained models (such as RoBERTa, T5, etc.) to calculate correlation, or use unsupervised clustering algorithms (such as K-means, DBSCAN, etc.) to group the content in the database to screen positive and negative samples.

[0148] For scenarios requiring a large number of non-correlated sample content for model training, the aforementioned random negative sampling and labeling methods can quickly determine the required number of non-correlated sample content, thus being referred to as a large-scale negative sampling strategy. Compared to manual labeling to determine positive and negative samples, the aforementioned sampling strategy can be automated, improving efficiency, reducing labor costs, avoiding subjective bias, and increasing accuracy.

[0149] Through the above embodiments, the method of optimizing the effect of model training by determining training samples in this application is described in detail. For better understanding, the embodiments of this application will illustrate the aforementioned initial generation model and how to determine vectors (such as the aforementioned query vector, associated vector, non-associated vector, etc.) through the model, so as to better understand this application, such as better understanding the implementation of the aforementioned S202.

[0150] In practical applications, this application does not impose any restrictions on the setting of the initial generation model. For ease of understanding, taking the aforementioned text as an example, this application embodiment provides the following method as an example:

[0151] Typically, text can be composed of multiple words, and the order of these words is crucial for understanding the semantics of the text. Therefore, text can also be considered a form of serialized data. Therefore, in one possible implementation, the initial generative model can be a neural network based on the Transformer architecture. The Transformer is a deep learning model architecture primarily designed for processing serialized data. This facilitates the determination of the vector corresponding to the text.

[0152] In different search scenarios, the content may vary greatly. In order to obtain a vector generation model that is applicable to more search scenarios, in another possible implementation method, the initial generation model can also be set to a large language model (LLM). Generally, LLM has a large number of network parameters and is trained on a large amount of text data, so it can better understand the content in different search scenarios, which is conducive to improving the generalization of the vector generation model and making it applicable to more search scenarios. When processing new fields or new types of queries, the vector generation model can adapt to and recall high-quality related content more quickly, which is conducive to ensuring the recall accuracy.

[0153] In practical applications, compared to methods like the bag-of-words model and the word frequency-inverse text frequency index model, the LLM-based vector generation model can better capture the deep semantic information of documents, thereby determining vectors that more accurately reflect the document content. This is especially true for long-tail terms and synonyms in search scenarios. This improves the quality of the vectors, thereby increasing the relevance of the retrieved results to the query and ensuring effective recall.

[0154] It should also be noted that this application does not impose any restrictions on how to determine the vectors of each content through the initial generation model. For ease of understanding, this application embodiment takes the associated sample content as a document as an example, and the initial generation model as an LLM based on the Transformer architecture as an example, and provides the following methods as examples for how to determine the associated vectors of the associated sample content:

[0155] In one possible implementation, an initial generative model can be set based on the encoder architecture. For example, the initial generative model can be set to a Transformer Decoder-only LLM. Because the Transformer Decoder-only LLM only focuses on the preceding context when processing serialized data, the output of the last Transformer layer corresponding to the last token in the last associated sample content can be used as the association vector. The associated sample content can be composed of multiple tokens arranged in linguistic order. This helps improve processing efficiency.

[0156] In LLM, the text generation process can be viewed as a sequence-to-sequence prediction problem, that is, the model predicts the probability distribution of the next token based on the previous text information. For example, for the associated sample content, the corresponding input sequence can be recorded as X = {x1, x2, ..., x n}, where x n It can represent the nth token. The goal of LLM is to maximize the price adjustment probability P(x i+1 |x1,x2,…,x i ), where i = 1, 2, …, n-1. During this process, LLM learns from the previous context through multiple layers of Transformers and maps each token into a vector space. Because the last token (usually a special end-of-sentence symbol, such as "[EOS]") at the output of the last Transformer layer captures the context of the entire non-associative sample, the last token generated by LLM at the output of the last Transformer layer can be selected as the association vector for the entire associated sample content.

[0157] Corresponding to this method, the vector corresponding to the content can be determined by the following formula:

[0158] e D =h last (x n )

[0159] In the above formula, D can represent any content (such as the aforementioned query sample content, associated sample content, etc.), e D It can represent the vector corresponding to the content, h last It can represent the output function of the last layer Transformer, x n It can represent the last token of content D.

[0160] In addition to the above examples, you can also choose to take the average or weighted average of the output vectors corresponding to the last layer of Transformer of all tokens as the vector representing the entire content, so that the vector can more accurately reflect the content.

[0161] For better understanding, the present application provides Figure 3 Example, Figure 3 A schematic diagram of the application flow of a method for determining a vector generation model is shown. Figure 3 In this example, the application process can include three stages: the first stage is model training, the second stage is offline model reasoning, and the third stage is online model reasoning. Specifically:

[0162] In the first stage, that is, the model training stage, the purpose of this stage is to perform model training on the initial generation model to obtain the aforementioned vector generation model. In specific implementation, the initial generation model can be selected first, for example, the aforementioned LLM base model can be selected as the initial generation model, and then the initial generation model can be trained based on the training sample. During the model training process, it can be based on a multi-task learning method so that the model learns to distinguish between positive samples (i.e., the aforementioned associated sample content) and negative samples (i.e., the aforementioned non-associated sample content) in the training sample, thereby distinguishing between valid query results and invalid query results. Among them, multi-task learning can refer to the aforementioned model training based on the first optimization goal and the second optimization goal, so that the ability to distinguish can be learned from multiple dimensions. In practical applications, in addition to the multi-task learning method illustrated in the aforementioned embodiment, other learning methods can also be integrated, such as using self-supervised learning to perform pre-training on unlabeled data.

[0163] After completing the model training, the vector generation model is obtained. After that, we can enter the second stage, which is the offline reasoning of the model. The purpose of this stage is to pre-generate the vector of the document in order to improve the recall speed of the third stage. Figure 3In this example, let's take the aforementioned pending content, which is a document (doc), as an example. A large number of docs are stored in the doc database. These are fed into the vector generation model, which maps the docs into pending vectors, denoted as emb_doc, and stores these vectors in the emb_doc vector library. This pre-converts a large number of docs into vectors before responding to queries. This allows queries to be searched directly based on the vectors in the emb_doc vector library, saving response time and improving recall speed.

[0164] In the third stage, the online reasoning of the model, the purpose of this stage is to respond to queries and complete recall. Figure 3 In the example, taking the aforementioned query content as query, when the query input by the user is received, the query can be input into the vector generation model, and the query can be mapped into a target vector through the vector generation model, which can be recorded as emb_q. Then, emb_q can be compared with emb_doc in the emb_doc vector library (such as performing similarity score calculation, etc.) to find matching documents. For example, the top K documents with the highest similarity score can be selected as the Top K matching results, that is, the top K docs (i.e., the aforementioned related content) are recalled. Among them, K is a positive integer, which can usually be flexibly set according to the needs of the search scenario. For example, in the document search scenario, K=300 can be set.

[0165] In the field of information retrieval, to help users quickly access the content they need, documents are typically sorted after retrieval, prioritizing the most relevant content to the query. Therefore, after obtaining the top K matching results, these K documents can be fed into a ranking model for further processing (e.g., rough or refined ranking). Finally, based on the ranking model's output, the most relevant documents can be displayed front-end, for example, within a search engine when a user enters a query, for easy access.

[0166] For further understanding, the present application also provides Figure 4 Example, Figure 4 A schematic diagram of a search scenario is shown. Figure 4 In this example, the user can enter a query in the search box and then click the search button on the right side of the search box to initiate a query. Accordingly, the terminal 400 (such as a smart phone) can respond to the query by executing Figure 3 The steps of the third stage in the example. Correspondingly, Figure 3 The results of the front-end display in the example can be seen in Figure 4 The parts marked by the dotted box in the example, for example, Figure 4In this example, there are five documents: doc1, doc2, doc3, doc4, and doc5. In practice, users can view the details of a doc by clicking on it.

[0167] Through the above examples, the determination method and application of the vector generation model provided by this application are described in detail. After testing, after adopting this application, due to the improved ability of the model to distinguish between relevant content and non-relevant content, higher-quality vectors can be obtained. Therefore, after determining the recalled content based on vector retrieval, more accurate and relevant content can be recalled, and the appearance of irrelevant content can be reduced. This directly improves the user's satisfaction and search experience during the search. In addition, some recall indicators related to the recall effect (such as recall speed and other indicators) have also been significantly improved.

[0168] In addition to the aforementioned vector retrieval-based method and the manual strategy-based recall method, in some scenarios, the related technology also uses a direct inverted index (Inverted Index) method for recall, which is a text retrieval method that maps each word in the document to a list of documents containing the word by building an index. In the recall stage, a candidate set is generated by calculating the intersection of the query term and the document list, and the candidate set includes the recalled documents. However, this method is too strict in matching the query terms, and may confuse synonyms, near-synonyms, and other words with similar semantics but different essences, resulting in poor recall effect. Compared with this method, the present application maps documents to vectors, so that the semantic information of the document can be fully utilized, thereby supplementing the shortcomings of strictly matching query terms and improving the recall effect.

[0169] It should be noted that, based on the implementation methods provided in the above aspects, this application can also be further combined to provide more implementation methods.

[0170] based on Figure 2 Corresponding to the method for determining a vector generation model provided in the embodiment, the embodiment of the present application further provides a device 500 for determining a vector generation model, which can be found in Figure 5 As shown, the vector generation model determination device 500 includes an acquisition unit 501, a determination unit 502 and a training unit 503:

[0171] The acquisition unit 501 is configured to acquire training samples, where the training samples include query sample content, sample content associated with the query sample content, and sample content not associated with the query sample content;

[0172] The determining unit 502 is configured to determine the query vector of the query sample content, the association vector of the associated sample content, and the non-association vector of the non-association sample content through an initial generation model;

[0173] The determining unit 502 is further configured to determine a first similarity between the query vector and the associated vector, and a second similarity between the query vector and the non-associated vector;

[0174] The determining unit 502 is further configured to determine a similarity loss based on the first similarity and the second similarity;

[0175] The training unit 503 is configured to perform model training on the initial generation model based on a first optimization objective using the similarity loss to obtain a vector generation model, wherein the first optimization objective is used to indicate maximizing the first similarity and minimizing the second similarity;

[0176] The determination unit 502 is also used to determine the target vector of the query content through the vector generation model in response to receiving the query content, and the target vector and the pending vector of the pending content are used to determine the associated content of the query content from the pending content, and the pending vector is determined by the vector generation model.

[0177] In a possible implementation, if there are multiple non-associated sample contents, the determining unit is further configured to:

[0178] determining a non-correlated group similarity based on second similarities between a plurality of non-correlated vectors and a target query vector, wherein the plurality of non-correlated vectors correspond to a plurality of non-correlated sample contents, the target query vector corresponds to a target query sample content, and the target query sample content is one of the query sample contents;

[0179] determining the similarity loss based on a first similarity between the target query vector and the associated vector and the non-associated group similarity;

[0180] The first optimization objective is used to indicate maximizing the first similarity and minimizing the non-associated group similarity.

[0181] In a possible implementation, if the first similarity is used to represent the directional similarity between the query vector and the associated vector in the vector space, and the second similarity is used to represent the directional similarity between the query vector and the non-associated vector in the vector space, the determining unit is further configured to:

[0182] determining a first distance between the query vector and a position of the associated vector in the vector space, and determining a second distance between the query vector and a position of the non-associated vector in the vector space;

[0183] determining a range loss based on the first distance and the second distance;

[0184] The training unit is further used to perform model training on the initial generation model based on the first optimization objective and the second optimization objective through the similarity loss and the distance loss to obtain the vector generation model, wherein the second optimization objective is used to indicate that the first distance is less than the second distance.

[0185] In a possible implementation, during model training, the training weight of the similarity loss is greater than the training weight of the distance loss.

[0186] In a possible implementation, the second optimization objective is used to indicate that the first distance is smaller than the second distance by at least a distance threshold.

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

[0188] Determining a directional similarity between the target vector and the undetermined vector in the vector space, and determining a target distance between the positions of the target vector and the undetermined vector in the vector space;

[0189] Determining a recall similarity between the target vector and the undetermined vector according to the direction similarity and the target distance;

[0190] The associated content is determined from the pending content according to the recalled similarity.

[0191] In a possible implementation, if the query sample content is historical query content, the determining unit is further configured to:

[0192] Acquire historical recalled content corresponding to the historical query content, and acquire historical operation information corresponding to the historical recalled content, wherein the historical operation information is used to indicate the historical operation corresponding to the historical recalled content after the recall;

[0193] If it is determined based on the historical operation information that the target recalled content in the historical recalled content meets the non-association condition, the target recalled content is determined as the non-association sample content.

[0194] In a possible implementation, if the vector of the historical recalled content and the vector of the historical query content are determined by the initial generation model, the determining unit is further configured to:

[0195] Classifying the target recalled content into true difficult negative sample content and false difficult negative sample content according to the operation degree indicated by the historical operation information of the target recalled content, wherein the operation degree of the true difficult negative sample content is greater than the operation degree of the false difficult negative sample content;

[0196] According to the ratio of the true difficult negative sample content to the false difficult negative sample content, the ratio of the true difficult negative sample content in the non-related sample content is adjusted.

[0197] In a possible implementation, if there are multiple query sample contents, the determining unit is further configured to:

[0198] For a first query sample content among the plurality of query sample contents, non-associated sample content of the first query sample content is determined from associated sample content of a second query sample content among the plurality of query sample contents.

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

[0200] In response to obtaining the vector generation model, acquiring the pending content;

[0201] The undetermined vector corresponding to the undetermined content is determined by the vector generation model.

[0202] It can be seen from the above technical solution that the query vector of the query sample content, the association vector of the associated sample content, and the non-association vector of the non-association sample content can be determined by the initial generation model. Then, the first similarity between the query vector and the association vector can be determined, and the second similarity between the query vector and the non-association vector can be determined. In addition, the similarity loss is determined based on the first similarity and the second similarity, and the initial generation model is trained based on the similarity loss and the first optimization goal of maximizing the first similarity and minimizing the second similarity, so that the model can learn to bring the query sample content and the associated sample content closer and push the query sample content and the non-association sample content further apart in one training, thereby improving the model's ability to distinguish between the associated sample content and the non-association sample content. In this way, the distinction between the query vector and the associated vector determined by the vector generation model is lower, and the distinction between the query vector and the non-association vector is higher, which also improves the distinction between the associated vector and the non-association vector. Correspondingly, in the recall stage, in response to receiving the query content, the target vector of the query content and the pending vector of the pending content can be determined through the vector generation model. Since the vector of the related content has a lower degree of distinction from the target vector and the vector of the non-related content has a higher degree of distinction from the target vector, when recalling based on the target vector and the pending vector, the probability of related content being recalled can be increased and the probability of non-related content being recalled can be reduced, thereby determining more accurate related content from the pending content and having a better recall effect.

[0203] The present application also provides a computer device, which may be a terminal. For example, a smartphone is used as the terminal.

[0204] Figure 6 The block diagram shows a partial structure of a smart phone provided by an embodiment of the present application. Figure 6 The smartphone includes components such as 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. The input unit 1130 may include a touch panel 1131 and other input devices 1132, the display unit 1140 may include a display panel 1141, and the audio circuit 1160 may include a speaker 1161 and a microphone 1162. Those skilled in the art will appreciate that Figure 6 The structure of the smartphone shown in the figure does not constitute a limitation on the smartphone, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

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

[0206] Processor 1180 is the control center of the smartphone, connecting all components of the smartphone using various interfaces and circuits. It executes software programs and / or modules stored in memory 1120 and accesses data stored in memory 1120 to perform various smartphone functions and process data. Optionally, processor 1180 may include one or more processing units. Preferably, processor 1180 integrates an application processor and a modem processor. The application processor primarily handles the operating system, user interface, and application programs, while the modem processor primarily handles wireless communications. It is understood that the modem processor may not be integrated into processor 1180.

[0207] In this embodiment, the steps performed by the processor 1180 in the smartphone may be based on Figure 6 The structure shown is implemented.

[0208] The computer device provided in the embodiment of the present application may also be a server, see Figure 7 As shown, Figure 7 The structural diagram of the server 1200 provided in the embodiment of the present application, the server 1200 may have relatively large differences due to different configurations or performances, and may include one or more processors, such as a central processing unit (CPU) 1222, and a memory 1232, one or more storage media 1230 (such as one or more massive storage devices) for storing application programs 1242 or data 1244. Among them, the memory 1232 and the storage medium 1230 can be temporary storage or permanent storage. The program stored in the storage medium 1230 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processing unit 1222 can be configured to communicate with the storage medium 1230 to execute a series of instruction operations in the storage medium 1230 on the server 1200.

[0209] The server 1200 may 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, such as Windows Server 200. TM , Mac OS X TM , Unix TM ,Linux TM , FreeBSD TM etc.

[0210] In this embodiment, the central processing unit 1222 in the server 1200 may perform the following steps:

[0211] Acquire training samples, where the training samples include query sample content, sample content associated with the query sample content, and sample content not associated with the query sample content;

[0212] Determining a query vector of the query sample content, an association vector of the associated sample content, and a non-association vector of the non-association sample content through an initial generation model;

[0213] determining a first similarity between the query vector and the associated vector, and determining a second similarity between the query vector and the non-associated vector;

[0214] determining a similarity loss according to the first similarity and the second similarity;

[0215] Using the similarity loss, training the initial generation model based on a first optimization objective to obtain a vector generation model, wherein the first optimization objective is used to indicate maximizing the first similarity and minimizing the second similarity;

[0216] In response to receiving the query content, the target vector of the query content is determined by the vector generation model. The target vector and the pending vector of the pending content are used to determine the associated content of the query content from the pending content. The pending vector is determined by the vector generation model.

[0217] According to one aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium is used to store a computer program. When the computer program is executed by a computer device, the computer device executes the method for determining the vector generation model described in each of the aforementioned embodiments.

[0218] According to one aspect of the present application, a computer program product is provided, comprising 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 executes the computer program, causing the computer device to perform the methods provided in various optional implementations of the above-described embodiments.

[0219] The descriptions of the processes or structures corresponding to the above figures have different emphases. For parts that are not described in detail in a certain process or structure, please refer to the relevant descriptions of other processes or structures.

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

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

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

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

[0224] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the relevant technology, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling 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 method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0225] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a 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 part of an overall module or unit that includes the function of the module or unit.

[0226] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, ordinary technical members in this field should understand that they can still modify the technical solutions recorded in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for determining a vector generation model, characterized in that: The method comprises: Acquire training samples, where the training samples include query sample content, sample content associated with the query sample content, and sample content not associated with the query sample content; Determining a query vector of the query sample content, an association vector of the associated sample content, and a non-association vector of the non-association sample content through an initial generation model; determining a first similarity between the query vector and the associated vector, and determining a second similarity between the query vector and the non-associated vector; determining a similarity loss according to the first similarity and the second similarity; Using the similarity loss, training the initial generation model based on a first optimization objective to obtain a vector generation model, wherein the first optimization objective is used to indicate maximizing the first similarity and minimizing the second similarity; In response to receiving the query content, the target vector of the query content is determined by the vector generation model. The target vector and the pending vector of the pending content are used to determine the associated content of the query content from the pending content. The pending vector is determined by the vector generation model.

2. The method according to claim 1, characterized in that If there are multiple non-related sample contents, determining the similarity loss according to the first similarity and the second similarity includes: determining a non-correlated group similarity based on second similarities between a plurality of non-correlated vectors and a target query vector, wherein the plurality of non-correlated vectors correspond to a plurality of non-correlated sample contents, the target query vector corresponds to a target query sample content, and the target query sample content is one of the query sample contents; determining the similarity loss based on a first similarity between the target query vector and the associated vector and the non-associated group similarity; The first optimization objective is used to indicate maximizing the first similarity and minimizing the non-associated group similarity.

3. The method according to claim 1, characterized in that If the first similarity is used to represent the directional similarity between the query vector and the associated vector in the vector space, and the second similarity is used to represent the directional similarity between the query vector and the non-associated vector in the vector space, the method further includes: determining a first distance between the query vector and a position of the associated vector in the vector space, and determining a second distance between the query vector and a position of the non-associated vector in the vector space; determining a range loss based on the first distance and the second distance; The method of performing model training on the initial generation model based on the first optimization objective by using the similarity loss to obtain a vector generation model includes: The initial generation model is trained based on the first optimization objective and the second optimization objective using the similarity loss and the distance loss to obtain the vector generation model, where the second optimization objective is used to indicate that the first distance is smaller than the second distance.

4. The method according to claim 3, characterized in that During the model training process, the training weight of the similarity loss is greater than the training weight of the distance loss.

5. The method according to claim 3, characterized in that The second optimization objective is used to indicate that the first distance is smaller than the second distance by at least a distance threshold.

6. The method according to claim 3, characterized in that The method further comprises: Determining a directional similarity between the target vector and the undetermined vector in the vector space, and determining a target distance between the positions of the target vector and the undetermined vector in the vector space; Determining a recall similarity between the target vector and the undetermined vector according to the direction similarity and the target distance; The associated content is determined from the pending content according to the recalled similarity.

7. The method according to claim 1, characterized in that If the query sample content is historical query content, the method further includes: Acquire historical recalled content corresponding to the historical query content, and acquire historical operation information corresponding to the historical recalled content, wherein the historical operation information is used to indicate the historical operation corresponding to the historical recalled content after the recall; If it is determined based on the historical operation information that the target recalled content in the historical recalled content meets the non-association condition, the target recalled content is determined as the non-association sample content.

8. The method according to claim 7, characterized in that If the vector of the historical recalled content and the vector of the historical query content are determined by the initial generation model, the method further includes: Classifying the target recalled content into true difficult negative sample content and false difficult negative sample content according to the operation degree indicated by the historical operation information of the target recalled content, wherein the operation degree of the true difficult negative sample content is greater than the operation degree of the false difficult negative sample content; According to the ratio of the true difficult negative sample content to the false difficult negative sample content, the ratio of the true difficult negative sample content in the non-related sample content is adjusted.

9. The method according to any one of claims 1 to 8, characterized in that If there are multiple query sample contents, the method further includes: For a first query sample content among the plurality of query sample contents, non-associated sample content of the first query sample content is determined from associated sample content of a second query sample content among the plurality of query sample contents.

10. The method according to any one of claims 1 to 8, characterized in that The method further comprises: In response to obtaining the vector generation model, acquiring the pending content; The undetermined vector corresponding to the undetermined content is determined by the vector generation model.

11. A device for determining a vector generation model, characterized in that: The device includes an acquisition unit, a determination unit and a training unit: The acquiring unit is configured to acquire training samples, wherein the training samples include query sample content, sample content associated with the query sample content, and sample content not associated with the query sample content; The determining unit is configured to determine the query vector of the query sample content, the association vector of the association sample content, and the non-association vector of the non-association sample content through an initial generation model; The determining unit is further configured to determine a first similarity between the query vector and the associated vector, and to determine a second similarity between the query vector and the non-associated vector; The determining unit is further configured to determine a similarity loss based on the first similarity and the second similarity; The training unit is configured to perform model training on the initial generation model based on a first optimization objective using the similarity loss to obtain a vector generation model, wherein the first optimization objective is used to indicate maximizing the first similarity and minimizing the second similarity; The determination unit is further used to determine the target vector of the query content through the vector generation model in response to receiving the query content, and the target vector and the pending vector of the pending content are used to determine the associated content of the query content from the pending content, and the pending vector is determined by the vector generation model.

12. A computer device, characterized in that: The computer device includes a processor and a memory: The memory is used to store a computer program and transmit the computer program to the processor; The processor is configured to execute the method according to any one of claims 1 to 10 according to instructions in the computer program.

13. A computer-readable storage medium, characterized in that The computer-readable storage medium is used to store a computer program, and when the computer program is executed by a computer device, the computer device executes the method according to any one of claims 1 to 10.

14. A computer program product comprising a computer program, characterized in that When the method is executed on a computer device, the computer device is enabled to execute the method according to any one of claims 1 to 10.