Commodity recall model training method, commodity recall method and computer equipment

By using multi-objective structure and large language models to process product information in the training of product recall model, the problem of low accuracy of BERT model when capturing key information is solved, and the effect and accuracy of product recall are improved.

CN119809764APending Publication Date: 2025-04-11广州商研网络科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411968815.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-28
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

When processing keywords entered by users, it is difficult to accurately capture key information, resulting in low accuracy of product recalls in e-commerce platforms.

Method used

By determining the training sample, using the preset large language model to process the input data, generate product compression information and product category information, and conducting multi-objective structure training based on this information, obtaining the product recall model.

Benefits of technology

It improves the training accuracy and recall effect of the product recall model, and enhances the ability to judge and recommend products in the e-commerce platform.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119809764A_ABST
    Figure CN119809764A_ABST
Patent Text Reader

Abstract

The invention provides a training method of a commodity recall model, a commodity recall method and computer equipment, the training method of the commodity recall model comprises the following steps: determining a training sample, the training sample comprising first input data and first output data; based on a preset prompt instruction, processing the first input data by using a preset large language model to obtain second output data, the second output data including commodity compression information and commodity category information; determining a first loss value based on the commodity compression information, and determining a second loss value based on the commodity category information and the first output data; and training the large language model based on the first loss value and the second loss value to obtain the commodity recall model. According to the invention, the commodity recall effect can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of artificial intelligence technology and relates to data processing technology, and in particular to a product recall model training method, a product recall method and a computer device. Background Art

[0002] E-commerce platforms can provide search services for information such as products. For example, when a user enters a keyword of the product to be found in the search box, the server of the website will search for the product based on the keyword to obtain the product search results, and sort and display the product search results.

[0003] In related technologies, the Bidirectional Encoder Representations from Transformers (BERT) model can be used to extract the keywords entered by users, capture their semantic features, and then use semantic similarity to recall products on e-commerce platforms. However, due to the diversity and complexity of keywords entered by users, the BERT model cannot accurately capture key information, resulting in low accuracy in judging products on e-commerce platforms, which affects the effect of product recall. Summary of the invention

[0004] The embodiments of the present application provide a product recall model training method, a product recall method and a computer device to solve the problem of poor product recall effect.

[0005] In a first aspect, an embodiment of the present application provides a method for training a product recall model, the training method comprising: determining a training sample, the training sample comprising first input data and first output data; based on a preset prompt instruction, processing the first input data using a preset large language model to obtain second output data, the second output data comprising product compression information and product category information; determining a first loss value based on the product compression information, and determining a second loss value based on the product category information and the first output data; training the large language model based on the first loss value and the second loss value to obtain the product recall model.

[0006] In some embodiments, determining the training samples includes: obtaining multiple product pairs; determining the similarity score corresponding to each product pair in response to user behavior; selecting product pair information corresponding to product pairs with a similarity score greater than or equal to a first threshold as positive samples, and selecting product pair information corresponding to product pairs with a similarity score less than the first threshold as negative samples; and combining the positive samples with the negative samples to obtain the training samples.

[0007] In some embodiments, the product pair includes a first product and a second product, the user behavior corresponding to the first product occurs earlier, and the response to the user behavior determines the similarity score corresponding to each product pair, including: determining the number of users who have user behaviors on both the first product and the second product; determining the number of interactive products corresponding to each user, the number of interactive products is used to indicate the number of products with user behaviors; determining the target weight corresponding to the second product; and determining the similarity score of each product pair based on the number of users, the number of interactive products and the target weight.

[0008] In some embodiments, determining the target weight corresponding to the second product includes: obtaining a user behavior corresponding to the second product; and determining the target weight corresponding to the second product based on a preset correspondence between the user behavior and the weight.

[0009] In some embodiments, determining the first loss value based on the product compression information includes: determining the first similarity corresponding to the positive sample based on the product compression information of two products of any product pair in the positive sample; determining the second similarity corresponding to any two products based on the product compression information of any two products in the training sample; determining the sample size of the training sample; and determining the first loss value based on the first similarity, the second similarity and the sample size.

[0010] In some embodiments, determining the second loss value based on the product category information and the first output data includes: determining a target product category based on the first output data; determining a target probability based on the target product category and the product category information, the target probability being used to indicate that the large language model generates a correct product category; determining the sample size of the training sample; and determining the second loss value based on the target probability and the sample size.

[0011] In some embodiments, the large language model is trained based on the first loss value and the second loss value to obtain the product recall model, including: determining a first weight corresponding to the first loss value, and determining a second weight corresponding to the second loss value; determining a target loss value based on the first loss value and the first weight, the second loss value and the second weight; and training the large language model based on the target loss value to obtain the product recall model.

[0012] In a second aspect, an embodiment of the present application provides a product recall method, which includes: obtaining product information of multiple products; based on a preset prompt instruction, processing the product information using a product recall model to obtain compressed product information of each product, wherein the product recall model is obtained by a training method of a product recall model as described in any one of the above items; based on the compressed product information, determining the product similarity between any two products; based on the product similarity, determining a set of products to be recalled corresponding to each product.

[0013] In some embodiments, if the plurality of commodities include a designated commodity, the method further includes: determining a commodity category corresponding to the designated commodity; and selecting a set of commodities to be recalled corresponding to the determined commodity category as the set of commodities to be recalled corresponding to the designated commodity.

[0014] In a third aspect, an embodiment of the present application provides a computer device, comprising a controller and a memory, wherein the controller is used to implement a training method for a product recall model as described in any one of the above items, or the above-mentioned product recall method, when executing a computer program stored in the memory.

[0015] The embodiment of the present application provides a method for training a product recall model, which includes determining a training sample, wherein the training sample includes first input data and first output data; based on a preset prompt instruction, using a preset large language model to process the first input data to obtain second output data, wherein the second output data includes product compression information and product category information; determining a first loss value based on the product compression information, and determining a second loss value based on the product category information and the first output data; training the large language model based on the first loss value and the second loss value to obtain the product recall model. The above method sets the overall framework structure of the large language model as a multi-objective structure, uses product compression information for comparative learning, and uses product category information and the first output data for category learning. Through the design of a multi-objective structure, the accuracy of product recall model training can be improved, thereby improving the effect of product recall. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 This is an application scenario diagram of a product recall model training method provided in an embodiment of the present application.

[0017] Figure 2 It is a flowchart of a method for training a product recall model provided in an embodiment of the present application.

[0018] Figure 3 It is a flowchart of the training method of the product recall model provided in the embodiment of the present application.

[0019] Figure 4It is a flowchart of the training sample determination method provided in an embodiment of the present application.

[0020] Figure 5 It is a flow chart of the first loss value determination method provided in an embodiment of the present application.

[0021] Figure 6 It is a flow chart of the second loss value determination method provided in an embodiment of the present application.

[0022] Figure 7 It is a flowchart of the product recall method provided in the embodiment of the present application.

[0023] Figure 8 It is a structural schematic diagram of a training device for a product recall model provided in an embodiment of the present application.

[0024] Fig. 9 It is a structural schematic diagram of a product recall device provided in an embodiment of the present application.

[0025] Fig.10 This is a diagram of application equipment for the product recall model training method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0026] It should be noted that the terms "first" and "second" in the specification, claims and drawings of the present application are used to distinguish similar objects rather than to describe a specific order or sequence.

[0027] It should also be noted that the method disclosed in the embodiments of the present application or the method shown in the flowchart includes one or more steps for implementing the method. Without departing from the scope of the claims, the execution order of multiple steps can be interchangeable with each other, and some of the steps can also be deleted.

[0028] Some embodiments will be described below in conjunction with the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments may be combined with each other.

[0029] Figure 1 is an application scenario diagram of a method for training a product recall model provided in an embodiment of the present application. Figure 1 As shown, the application scenario includes a computer device 10 and a user terminal 20. As a feasible embodiment, the training method of the product recall model provided in the embodiment of the present application can be applied to the computer device 10. The computer device 10 can be as follows Figure 1The computer device 10 may be connected to the user terminal 20 via a network. The network is used to provide a medium for a communication link between the computer device 10 and the user terminal 20. The network may include various connection types, such as a wired communication link, a wireless communication link, etc., which is not limited in the embodiments of the present application.

[0030] Figure 1 The computer device 10, network and user terminal 20 are merely illustrative. The computer device 10 may be a physical server or a server cluster composed of multiple servers, and the user terminal 20 may be a mobile phone, a tablet, a desktop computer, a laptop computer, or other devices. As another example, the embodiment of the present application may also allow multiple user terminals 20 to access the computer device 10.

[0031] In some embodiments, the technical solution of the present application uses the operating environment of the e-commerce service platform as its application environment, and builds an e-commerce service platform in the computer device 10. The e-commerce service platform can be an e-commerce service platform that opens independent station services, such as a cross-border e-commerce service platform. An independent station refers to a new type of official website (website) established on a Software-as-a-Service (SaaS) technology platform, which has an independent domain name, private content, data, and rights and interests, independent business sovereignty and business entity responsibilities, supported by social cloud computing capabilities, and can independently and freely connect to third-party software tools, publicity and promotion media and channels. Usually, product sellers build and operate online stores on independent stations, allowing online stores to display their products on independent stations, and provide product buyers (i.e. users) with e-commerce services such as searching for products in online stores, adding shopping carts, settlement, logistics delivery, placing orders, after-sales service, and product combination recommendations.

[0032] In some embodiments, the user terminal 20 can access the online store in the computer device 10 by connecting to the computer device 10, and implement functions such as searching for products, adding shopping carts, and settlement in the online store. In some embodiments, the computer device 10 can train a large language model according to the training method of the product recall model provided in the embodiment of the present application to obtain a product recall model. When a user operates a product in an online store, the computer device 10 can determine a set of products with a high degree of similarity to the product in the online store according to the product recall method provided in the embodiment of the present application (for ease of description, the embodiment of the present application is referred to as the "set of products to be recalled"), and push the set of products to be recalled to the user terminal 20.

[0033] In the above-mentioned application scenario provided by the embodiment of the present application, the computer device 10 can train a large language model according to the training method of the product recall model provided by the embodiment of the present application, which can improve the accuracy of the product recall model training; and the computer device 10 pushes the set of products to be recalled to the user terminal 20 according to the product recall method provided by the embodiment of the present application, which can improve the effect of product recall.

[0034] Figure 2 is a flowchart of a method for training a product recall model provided in an embodiment of the present application, wherein the method for training a product recall model is applied to a computer device (e.g., Figure 1 Computer device 10 in FIG. Figure 2 As shown, the training method of the product recall model may include the following steps S11-S14. According to different requirements, the order of the steps in the flowchart can be changed, and some can be omitted.

[0035] S11, determining a training sample, where the training sample includes first input data and first output data.

[0036] In at least one embodiment of the present application, the training sample may represent sample data for training a large language model (LLM). The training sample includes first input data and first output data, the first input data may represent input data of the large language model, and the second output data may represent output data of the large language model.

[0037] In some embodiments, the first input data may include multiple commodity pair information, and the commodity pair information may represent the commodity title and commodity description information of each commodity in the commodity pair, wherein each commodity in the commodity pair has a user behavior, and the user behavior may include click, add to cart, and purchase, etc. The commodity pair may include two commodities. The commodity title may include the core attributes of the commodity, for example, the commodity title may include one or more of the commodity brand, commodity model, commodity age, commodity style, commodity color, and commodity size. The commodity description information may include information such as detailed parameters, function introduction, instructions for use, and specification parameters of the commodity.

[0038] In some embodiments, the first output data may include the commodity category of each commodity in the commodity pair (for ease of description, referred to as "target commodity category" in this application), and the target commodity category may include a primary commodity category, a secondary commodity category, a tertiary commodity category, and a quaternary commodity category, etc., wherein the primary commodity category represents the highest level in the commodity classification, for example, the primary commodity category may include clothing, shoes, hats, beauty and skin care, digital products, home appliances, food and beverages, etc. The secondary commodity category is a subcategory further subdivided on the basis of the primary commodity category, and can be divided according to more specific attributes or uses of the commodity. Taking "clothing, shoes, hats" as an example, its secondary commodity category may include men's clothing, women's clothing, children's clothing, underwear, shoes, hats, etc. The tertiary commodity category is a subcategory further subdivided on the basis of the secondary commodity category, and more specific commodity options can be provided. The quaternary commodity category is a subcategory further subdivided on the basis of the tertiary commodity category, and more specific commodity options can be provided. Considering that the quaternary commodity category contains more key information of the commodity, the embodiment of the present application takes the first output data including the quaternary commodity category of each commodity in the commodity pair as an example for explanation. For example, the first output data may include “men's summer short-sleeved T-shirts”, “women's high-heeled shoes”, “children's sports shoes”, “fully automatic washing machine”, etc.

[0039] S12, based on a preset prompt instruction, using a preset large language model to process the first input data to obtain second output data, where the second output data includes commodity compression information and commodity category information.

[0040] In at least one embodiment of the present application, in order to make full use of the text information of the product (for example, the product title and product description information) and the rich text processing capability of the large language model, a prompt instruction is pre-set, and the prompt instruction may represent the instruction provided to the large language model when interacting with the large language model, which is used to guide the large language model to generate specific content. In some embodiments, the prompt instruction may include a prompt template, and the prompt template may include input data and output data of the large language model, wherein the input data may include the product title and product description information, and the output data may include product compression information and product category information. Based on the preset prompt instruction, the first input data including the product title and product description information is input into the preset large language model. The large language model is guided by the prompt instruction to perform data processing on the product title and product description information to obtain second output data, and the second output data includes product compression information and product category information.

[0041] In some embodiments, the product compression information may represent the hidden state output after the product title and product description information are compressed, and the product compression information may be represented in vector form. The product category information may represent the product category of the product, and the product category may include a primary product category, a secondary product category, a tertiary product category, and a quaternary product category. Considering that the quaternary product category contains more key information of the product, the more key information of the product, the better the product recall effect, the embodiment of the present application takes the quaternary product category of the product with the product category information as an example for explanation.

[0042] S13, determining a first loss value based on the commodity compression information, and determining a second loss value based on the commodity category information and the first output data.

[0043] In at least one embodiment of the present application, the large language model performs contrastive learning based on product compression information, and the purpose of contrastive learning is to learn the representation of data to capture the basic structure and relationship between different data points. This goal is achieved by maximizing the similarity between similar data points and minimizing the similarity between dissimilar data points. Based on this, the present application uses contrastive learning to make product pairs with high product similarity have high scores, while product pairs with low product similarity have low scores. In some embodiments, a loss function corresponding to contrastive learning is set (for ease of description, this application is referred to as the "first loss function"), and a first loss value can be obtained by using the first loss function and product compression information.

[0044] In some embodiments, the large language model performs category learning based on the commodity category information and the target commodity category in the first output data. Through category learning, the probability that the large language model generates the correct commodity category can be determined. For example, the more the commodity category information is the same as the target commodity category, the higher the probability that the large language model generates the correct commodity category; the fewer the commodity category information is the same as the target commodity category, the lower the probability that the large language model generates the correct commodity category. Based on this, according to the probability that the large language model generates the correct commodity category, a loss function (for ease of description, referred to as the "second loss function" in this application) is set, and the second loss function is used to process the commodity category information and the target commodity category to obtain a second loss value.

[0045] S14: Based on the first loss value and the second loss value, the large language model is trained to obtain the product recall model.

[0046] In at least one embodiment of the present application, based on the first loss function and the second loss function, the target loss function corresponding to the large language model can be determined. For example, a first weight is set for the first loss function, and a second weight is set for the second loss function. Based on the first loss function and the first weight, and the second loss function and the second weight, the target loss function can be determined. Among them, the first weight and the second weight can be set according to actual needs, and the sum of the first weight and the second weight is 1. Based on this, the large language model is trained based on the first loss value and the second loss value to obtain the product recall model, including: determining the first weight corresponding to the first loss value, and determining the second weight corresponding to the second loss value; determining the target loss value based on the first loss value and the first weight, the second loss value and the second weight; based on the target loss value, the large language model is trained to obtain the product recall model. Among them, the training of the large language model based on the loss value can refer to the relevant technology, which will not be repeated here.

[0047] Combination Figure 3 A flowchart of a training method for a product recall model provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, the training samples are input into the large language model, and the large language model processes the training samples based on the prompt instruction to obtain product compression information and product category information. The large language model performs comparative learning on the product compression information based on the first loss function to obtain a first loss value, and performs category learning on the first output data and the product category information based on the second loss function to obtain a second loss value. Based on the first loss value and the second loss value, the large language model is trained to obtain a product recall model.

[0048] In some embodiments, based on the trained product recall model, the product compression information of each product with user behavior in the e-commerce service platform can be obtained. Then, based on the product compression information, the product similarity between any two products can be determined, and the products with high product similarity can be grouped into a product set. Afterwards, when the user operates the product in the e-commerce service platform, the product set to be recalled can be selected from the product set, and the product set to be recalled can be recommended to the user to realize product recall. Through product recall, products with high product similarity can be displayed to increase the purchase rate of products. Among them, if there is at least one of click behavior, add-to-cart behavior and purchase behavior for the product, it is determined that the product has user behavior.

[0049] The embodiment of the present application provides a method for training a product recall model. By setting the overall framework structure of a large language model as a multi-objective structure, using product compression information for comparative learning, and using product category information and first output data for category learning, the accuracy of product recall model training can be improved through the design of a multi-objective structure, thereby improving the effect of product recall.

[0050] In at least one embodiment of the present application, in order to improve the quality of training samples, the training samples are screened and divided into positive samples and negative samples. Figure 4 is a flow chart of a training sample determination method provided in an embodiment of the present application, and the training sample determination method is applied to a computer device. Figure 4 As shown, the following steps are included: S21, obtaining multiple product pairs.

[0051] In at least one embodiment of the present application, each commodity in the commodity pair has a user behavior, and the user behavior may include clicking, adding to cart, and purchasing. The commodity pair may include two commodities.

[0052] In some embodiments, obtaining multiple product pairs includes: obtaining products for which user behavior exists in the e-commerce service platform; and randomly combining any two products to obtain product pairs.

[0053] S22, responding to the user behavior, determining a similarity score corresponding to each product pair.

[0054] In at least one embodiment of the present application, a product pair may include two products, namely a first product and a second product, wherein the user behavior corresponding to the first product occurs earlier. In some embodiments, the response to the user behavior to determine the similarity score corresponding to each product pair includes: determining the number of users who have user behaviors on both the first product and the second product; determining the number of interactive products corresponding to each user, the number of interactive products is used to indicate the number of products with user behaviors; determining the target weight corresponding to the second product; and determining the similarity score of each product pair information based on the number of users, the number of interactive products, and the target weight.

[0055] In some embodiments, the user behavior on both the first product and the second product may mean that the user behavior on the first product and the user behavior on the second product exist, and the user behavior on the first product and the second product may be the same or different. For example, the user may click on the first product and add the second product to the cart. For another example, the user may add the first product and the second product to the cart.

[0056] In some embodiments, determining the number of interactive products corresponding to each user includes: determining the number of products clicked by each user (for ease of description, referred to as the "first number" in this application); determining the number of products purchased by each user (for ease of description, referred to as the "second number" in this application); determining the number of products purchased by each user (for ease of description, referred to as the "third number" in this application); and taking the sum of the first number, the second number and the third number as the number of interactive products for each user.

[0057] In some embodiments, the determining the target weight corresponding to the second commodity includes: obtaining the user behavior corresponding to the second commodity; and determining the target weight corresponding to the second commodity based on the preset correspondence between the user behavior and the weight. The user behavior includes click, add to cart, and purchase. The weight corresponding to the click behavior is set to be the smallest, and the weight corresponding to the purchase behavior is set to be the largest. For example, if the user behavior is a click behavior, the weight is set to 1; if the user behavior is an add to cart behavior, the weight is set to 2; if the user behavior is a purchase behavior, the weight is set to 3.

[0058] In some embodiments, the similarity score is used to evaluate the similarity of two commodities. The higher the similarity score, the higher the similarity of the two commodities; the lower the similarity score, the lower the similarity of the two commodities. Exemplarily, the similarity score of each commodity pair information is determined using the following formula 1: Formula 1.

[0059] in, Indicates the similarity score between product A (i.e. the first product) and product B (i.e. the second product). Indicates the number of users who have user behaviors for both the first and second products. Indicates the number of interactive commodities corresponding to the user, and the number of interactive commodities is used to indicate the number of commodities with user behavior. Indicates the target weight corresponding to the second product.

[0060] S23, selecting product pair information corresponding to product pairs with similarity scores greater than or equal to a first threshold as positive samples, and selecting product pair information corresponding to product pairs with similarity scores less than the first threshold as negative samples.

[0061] In at least one embodiment of the present application, the product pair information may represent the product title and product description information of each product in the product pair, for example, the product pair information includes the product title and product description information of the first product, and the product title and product description information of the second product. The first threshold value may be set according to actual needs, for example, the first threshold value may be 0.9, 0.95, 0.98, etc. Exemplarily, taking the first threshold value of 0.9 as an example, there are product pairs 1, product pairs 2, product pairs 3 and product pairs 4, product pair 1 includes product A and product B, product pair 2 includes product A and product C, product pair 3 includes product B and product A, and product pair 4 includes product C and product D. Among them, the similarity score of product pair 1 is 0.8, the similarity score of product pair 2 is 0.95, the similarity score of product pair 3 is 0.9, and the similarity score of product pair 4 is 0.6. Based on this, the product pair information corresponding to product pair 1 and the product pair information corresponding to product pair 4 are used as negative samples, and the product pair information corresponding to product pair 2 and the product pair information corresponding to product pair 3 are used as positive samples.

[0062] S24, combining the positive sample and the negative sample to obtain the training sample.

[0063] In the training method of the product recall model provided in the embodiment of the present application, based on the user behavior data, the similarity score of each product to the information is determined, and the training samples are divided into positive samples and negative samples according to the similarity score. By utilizing the user behavior data, the above method can improve the quality of the training samples, improve the accuracy of the product recall model training, and then improve the accuracy of the product recall.

[0064] In at least one embodiment of the present application, the large language model performs contrastive learning based on the product compression information. Through contrastive learning, product pairs with high similarity have high scores, while product pairs with low similarity have low scores. Based on this, a first loss function corresponding to contrastive learning is set, and a first loss value can be obtained by using the first loss function and the product compression information. Figure 5 1 is a flow chart of a first loss value determination method provided in an embodiment of the present application, and the first loss value determination method is applied in a computer device. Figure 5 As shown, the following steps are included: S31, determining a first similarity corresponding to the positive sample based on the commodity compression information of two commodities of any commodity pair in the positive sample.

[0065] In at least one embodiment of the present application, a positive sample may represent a set of information about pairs of commodities with a similarity score greater than or equal to a first threshold. The method of determining the first similarity corresponding to the positive sample based on the commodity compression information of two commodities in any commodity pair in the positive sample includes: obtaining the commodity compression information of two commodities in any commodity pair in the positive sample; and using a preset similarity algorithm to process the commodity compression information of the two commodities to obtain the first similarity of each commodity pair in the positive sample. The similarity algorithm may include cosine similarity, Euclidean distance, Manlton distance, Pearson correlation coefficient, etc., which are not limited here.

[0066] S32: Determine a second similarity corresponding to any two commodities in the training sample based on the commodity compression information of the any two commodities.

[0067] In at least one embodiment of the present application, the training sample may represent a collection of commodity pair information, each commodity pair includes two commodities, based on which the training sample includes multiple commodities. Determining the second similarity corresponding to any two commodities based on the commodity compression information of the any two commodities in the training sample includes: obtaining the commodity compression information of any two commodities in the training sample; using a preset similarity algorithm to process the commodity compression information of any two commodities to obtain the second similarity corresponding to the any two commodities.

[0068] S33, determining the sample quantity of the training samples.

[0069] In at least one embodiment of the present application, the number of samples includes the sum of the number of positive samples and the number of negative samples.

[0070] S34: Determine the first loss value based on the first similarity, the second similarity, and the number of samples.

[0071] In at least one embodiment of the present application, based on the first similarity, the second similarity and the number of samples, the first loss value is determined using the following formula 2: Formula 2.

[0072] in, represents the first loss value, represents the number of samples, Display products Compression information of products, Display products Compression information of products, Display and products Compression information of the products that make up the positive samples, represents the first similarity, Indicates the second similarity.

[0073] In the training method of the product recall model provided in the embodiment of the present application, the product title and product description information of the product are compressed into product compressed information through the large language model's ability to understand natural language, and the product compressed information is used for comparative learning. This can make full use of the text information of the product, improve the accuracy of the product recall model training, and then improve the accuracy of the product recall.

[0074] In at least one embodiment of the present application, a second loss function is set based on the probability of generating a correct product category according to the large language model, and the second loss function is used to process the product category information and the target product category to obtain a second loss value. Figure 6 is a flow chart of a second loss value determination method provided in an embodiment of the present application, and the second loss value determination method is applied to a computer device. Figure 6 As shown, the following steps are included: S41: Determine a target product category according to the first output data.

[0075] In at least one embodiment of the present application, the first output data may include the commodity category of each commodity in the commodity pair, that is, the target commodity category.

[0076] S42: Determine a target probability based on the target product category and the product category information.

[0077] In at least one embodiment of the present application, based on the target product category and the product category information, the number of correct product categories generated by the large language model can be determined, wherein the number of products with the same product category information as the target product category is used as the number of correct product categories generated by the large language model. The target probability can represent the ratio of the number of correct product categories generated by the large language model to the number of target product categories, which is used to indicate the probability that the large language model generates the correct product category. Exemplarily, for the target product category I, the number of target product categories I in the first output data and the number of product categories I generated by the large language model are obtained, and the ratio of the number of product categories I generated by the large language model to the number of target product categories I in the first output data is used as the probability that the large language model generates the correct product category I.

[0078] S43, determining the sample quantity of the training samples.

[0079] In at least one embodiment of the present application, the number of samples includes the sum of the number of positive samples and the number of negative samples.

[0080] S44: Determine the second loss value based on the target probability and the sample quantity.

[0081] In at least one embodiment of the present application, based on the target probability and the number of samples, the second loss value is determined using Formula 3: Formula 3.

[0082] in, represents the second loss value, represents the number of samples, Indicates that the large language model generates the correct product category. Indicates the target product category. represents the target probability.

[0083] In the training method of the product recall model provided in the embodiment of the present application, by establishing a large language model to generate the task of product categories, the ability of the large language model to generate compressed product information can be improved, thereby improving the accuracy of product recall model training and the accuracy of product recall.

[0084] In at least one embodiment of the present application, based on a trained product recall model, product compression information of each product with user behavior in the e-commerce service platform can be obtained, and then the product recall can be performed based on the product compression information. Figure 7 is a flow chart of a product recall method provided in an embodiment of the present application, and the product recall method is applied to a computer device. Figure 7 As shown, the following steps are included: S51, obtaining product information of multiple products.

[0085] In at least one embodiment of the present application, the plurality of commodities may represent commodities for which user behaviors exist, and the user behaviors may include click, add to cart, purchase, etc. The commodity information may include commodity titles and commodity description information.

[0086] S52: Based on the preset prompt instruction, the product information is processed using the product recall model to obtain compressed product information of each product.

[0087] In at least one embodiment of the present application, product information is input into a preset large language model, and prompt instructions are used to guide the large language model to perform data processing on the product title and product description information in the product information, and output product compression information and product category information.

[0088] S53: Determine the commodity similarity between any two commodities based on the commodity compression information.

[0089] In at least one embodiment of the present application, the product compression information may represent the hidden state output after only compressing the product title and product description information, and the product compression information may be represented in vector form. The product similarity of any two products is calculated using a preset similarity algorithm, wherein the similarity algorithm may include cosine similarity, Euclidean distance, Manlton distance, Pearson correlation coefficient, etc., which are not limited here.

[0090] S54: Determine a set of products to be recalled corresponding to each product based on the product similarity.

[0091] In at least one embodiment of the present application, products with a product similarity higher than a second threshold are selected to form multiple product sets. When a user operates a product on an online store, for example, clicks on a product, adds a product to a cart, or purchases a product, the computer device can determine a product set to be recalled corresponding to the product from the multiple product sets corresponding to the online store, and push the product set to be recalled to the user terminal.

[0092] In the product recall method provided in the embodiment of the present application, the product recall model is used to process the product information of each product to obtain product compression information. The product similarity between any two products is determined based on the product compression information. Then, based on the product similarity, the set of products to be recalled corresponding to each product is determined to improve the accuracy of product recall.

[0093] In at least one embodiment of the present application, since the large language model has high requirements on computing power, and it is relatively time-consuming to calculate the product compression information of a large number of products online at the same time, based on this, the present application can determine the set of products to be recalled for all products offline. When a user operates a product in an online store, the set of products to be recalled for the product can be directly read. For a specified product, for example, if there is no user behavior for the product, it can be recalled based on the product category of the specified product. In some embodiments, the method further includes: determining the product category corresponding to the specified product; selecting the set of products to be recalled corresponding to the determined product category as the set of products to be recalled corresponding to the specified product.

[0094] In some embodiments, the commodity category corresponding to the designated commodity is determined, and the commodity category may include a primary commodity category, a secondary commodity category, a tertiary commodity category, and a quaternary commodity category, etc. The embodiment of the present application is described by taking the commodity category as a quaternary commodity category as an example. Commodities of the same commodity category as the commodity category are determined, and the commodity set to be recalled corresponding to the determined commodity is used as the commodity set to be recalled corresponding to the designated commodity.

[0095] In the product recall method provided in the embodiment of the present application, the set of products to be recalled of all products is determined in an offline manner, which can improve the efficiency of product recall; and for designated products for which there is no user behavior, product recall can be performed based on the product category corresponding to the designated product, thereby improving the accuracy of product recall of the designated product.

[0096] See also Figure 8 , Figure 8 1 is a schematic diagram of the structure of the training device for the product recall model provided in the embodiment of the present application. In some embodiments, the training device 100 for the product recall model may include multiple functional modules composed of computer program segments. The computer program of each program segment in the training device 100 for the product recall model may be stored in the memory of the computer device 10 and executed by at least one controller to execute (see Figure 2 Description) Function for training the product recall model.

[0097] In some embodiments, the training device 100 for the product recall model can be divided into multiple functional modules according to the functions performed. The functional modules may include: a sample determination module 101, a model processing module 102, a loss determination module 103, and a model training module 104. The module referred to in this application refers to a series of computer program segments that can be executed by at least one controller and can complete fixed functions, which are stored in a memory. In this embodiment, the functions of each module will be described in detail in subsequent embodiments.

[0098] The sample determination module 101 is used to determine a training sample, where the training sample includes first input data and first output data.

[0099] The model processing module 102 is used to process the first input data using a preset large language model based on a preset prompt instruction to obtain second output data, where the second output data includes commodity compression information and commodity category information.

[0100] The loss determination module 103 is used to determine a first loss value based on the commodity compression information, and to determine a second loss value based on the commodity category information and the first output data.

[0101] The model training module 104 is used to train the large language model based on the first loss value and the second loss value to obtain the product recall model.

[0102] In some embodiments, the sample determination module 101 also includes: a product pair acquisition submodule, used to acquire multiple product pairs; a score determination submodule, used to respond to user behavior and determine the similarity score corresponding to each product pair; a sample selection submodule, used to select product pair information corresponding to a product pair with a similarity score greater than or equal to a first threshold as a positive sample, and select product pair information corresponding to a product pair with a similarity score less than the first threshold as a negative sample; a sample combination submodule, used to combine the positive sample with the negative sample to obtain the training sample.

[0103] In some embodiments, the sample determination module 101 also includes: a user quantity determination submodule, used to determine the number of users who have user behaviors on both the first commodity and the second commodity; a commodity quantity determination submodule, used to determine the number of interactive commodities corresponding to each user, and the number of interactive commodities is used to indicate the number of commodities with user behaviors; a target weight determination submodule, used to determine the target weight corresponding to the second commodity; and a score determination submodule, further used to determine the similarity score of the information for each commodity based on the number of users, the number of interactive commodities and the target weight.

[0104] In some embodiments, the sample determination module 101 also includes: a user behavior determination submodule, used to obtain the user behavior corresponding to the second product; a target weight determination submodule, also used to determine the target weight corresponding to the second product based on the preset correspondence between user behavior and weight.

[0105] In some embodiments, the loss determination module 103 also includes: a first similarity determination submodule, which is used to determine the first similarity corresponding to the positive sample based on the product compression information of two products of any product pair in the positive sample; a second similarity determination submodule, which is used to determine the second similarity corresponding to any two products in the training sample based on the product compression information of any two products; a sample quantity determination submodule, which is used to determine the sample quantity of the training sample; and a first loss value determination submodule, which is used to determine the first loss value based on the first similarity, the second similarity and the sample quantity.

[0106] In some embodiments, the loss determination module 103 also includes: a product category determination submodule, which is used to determine the target product category based on the first output data; a probability determination submodule, which is used to determine the target probability based on the target product category and the product category information, and the target probability is used to instruct the large language model to generate the correct product category; a sample quantity determination submodule, which is used to determine the sample quantity of the training sample; and a second loss value determination submodule, which is used to determine the second loss value based on the target probability and the sample quantity.

[0107] In some embodiments, the loss determination module 103 also includes: a weight determination submodule, used to determine a first weight corresponding to the first loss value, and to determine a second weight corresponding to the second loss value; a target loss value determination submodule, used to determine a target loss value based on the first loss value and the first weight, and the second loss value and the second weight; and a large language model training submodule, used to train the large language model based on the target loss value to obtain the product recall model.

[0108] See also Fig. 9 , Fig. 9 2 is a schematic diagram of the structure of the product recall device provided in the embodiment of the present application. In some embodiments, the product recall device 200 may include multiple functional modules composed of computer program segments. The computer program of each program segment in the product recall device 200 may be stored in the memory of the computer device 10 and executed by at least one controller to execute (see Figure 7 Description) Product recall functionality.

[0109] In some embodiments, the product recall device 200 can be divided into multiple functional modules according to the functions it performs. The functional modules may include: a product information determination module 201, a compression information determination module 202, a product similarity determination module 203, and a product set determination module 204. The module referred to in this application refers to a series of computer program segments that can be executed by at least one controller and can complete fixed functions, which are stored in a memory. In this embodiment, the functions of each module will be described in detail in subsequent embodiments.

[0110] The commodity information determination module 201 is used to obtain commodity information of a plurality of commodities.

[0111] The compressed information determination module 202 is used to process the product information based on a preset prompt instruction using a product recall model to obtain compressed product information of each product.

[0112] The commodity similarity determination module 203 is used to determine the commodity similarity between any two commodities based on the commodity compression information.

[0113] The product set determination module 204 is configured to determine a product set to be recalled corresponding to each product based on the product similarity.

[0114] In some embodiments, the product set determination module 204 further includes: a product category determination submodule, used to determine the product category corresponding to the specified product; and a product set selection submodule, used to select the product set to be recalled corresponding to the determined product category as the product set to be recalled corresponding to the specified product.

[0115] It can be understood that the training device 100 for the product recall model and the training method for the product recall model in the above-mentioned embodiment belong to the same inventive concept, and the specific implementation method of each module of the training device 100 for the product recall model corresponds to the steps of the training method for the product recall model in the above-mentioned embodiment, which will not be repeated in this application.

[0116] The module division described above is a logical function division, and there may be other division methods in actual implementation. In addition, the functional modules in each embodiment of the present application may be integrated in the same processing unit, or each module may exist physically separately, or two or more modules may be integrated in the same unit. The above-mentioned integrated modules may be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0117] Fig.10 is an application device diagram of the training method of the product recall model provided in the embodiment of the present application, such as Fig.10 As shown, the computer device 10 includes a memory 11, at least one controller 12 and at least one communication bus 13. The controller 12 is used to implement a training method for a product recall model when executing a computer program stored in the memory 11. The at least one communication bus 13 is configured to implement connection and communication between the memory 11 and at least one controller 12.

[0118] Fig.10 The structure of the computer device shown does not constitute a limitation on the embodiments of the present application. The computer device 10 may also include more or less other hardware or software than shown in the figure, or a different arrangement of components.

[0119] In some embodiments of the present application, the computer device 10 can also be connected to a client device, which includes but is not limited to any electronic product that can interact with a user through a keyboard, mouse, remote control, touchpad or voice control device, such as a personal computer, a tablet computer, a smart phone, a digital camera, etc.

[0120] It should be noted that the computer device 10 is only an example, and other existing or future electronic products that are suitable for the present application should also be included in the protection scope of the present application and included here by reference.

[0121] In some embodiments, the computer device 10 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.

[0122] In some embodiments, a computer program is stored in the memory 11, and when the computer program is executed by at least one controller 12, all or part of the steps in the training method of the product recall model are implemented. The memory 11 includes a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.

[0123] In some embodiments, the computer-readable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the computer device 10, etc.

[0124] In some embodiments, at least one controller 12 is the control core (ControlUnit) of the computer device 10, and uses various interfaces and lines to connect various components of the entire computer device 10, and executes various functions and processes data of the computer device 10 by running or executing programs or modules stored in the memory 11, and calling data stored in the memory 11. For example, when at least one controller 12 executes the computer program stored in the memory, it implements all or part of the steps of the training method of the product recall model in the embodiment of the present application; or implements all or part of the functions of the training device of the product recall model. At least one controller 12 can be composed of an integrated circuit, for example, it can be composed of a single packaged integrated circuit, or it can be composed of multiple integrated circuits with the same function or different functions, including one or more central controllers (Central Processing unit, CPU), microcontrollers, digital processing chips, graphic controllers and combinations of various control chips.

[0125] The above-mentioned integrated unit implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a computer device, or a network device, etc.) or a controller (processor) to execute parts of the methods of various embodiments of the present application.

[0126] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules is only a logical function division, and there may be other division methods in actual implementation.

[0127] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, and may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0128] In addition, each functional module in each embodiment of the present application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0129] It is obvious to those skilled in the art that the present application is not limited to the details of the above exemplary embodiments, and that the present application can be implemented in other specific forms without departing from the spirit or basic features of the present application. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the present application is limited by the attached claims rather than the above description, so it is intended to include all changes that fall within the meaning and scope of the equivalent elements of the claims in the present application. Any figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the word "including" does not exclude other units or, and the singular does not exclude the plural. Multiple units or devices stated in the specification can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.

[0130] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present application and are not intended to limit it. Although the present application has been described in detail with reference to the preferred embodiments, a person of ordinary skill in the art should understand that the technical solution of the present application may be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present application.

Claims

1. A method for training a product recall model, characterized in that: The training method comprises: Determine a training sample, wherein the training sample includes first input data and first output data; Based on a preset prompt instruction, the first input data is processed using a preset large language model to obtain second output data, where the second output data includes commodity compression information and commodity category information; determining a first loss value based on the commodity compression information, and determining a second loss value based on the commodity category information and the first output data; Based on the first loss value and the second loss value, the large language model is trained to obtain the product recall model.

2. The method for training a product recall model according to claim 1, wherein: The determining of the training samples comprises: Get multiple product pairs; Respond to user behavior and determine the similarity score for each product pair; Selecting product pair information corresponding to product pairs with similarity scores greater than or equal to a first threshold as positive samples, and selecting product pair information corresponding to product pairs with similarity scores less than the first threshold as negative samples; The positive sample and the negative sample are combined to obtain the training sample.

3. The method for training a product recall model according to claim 2, wherein: The commodity pair includes a first commodity and a second commodity, the user behavior corresponding to the first commodity occurs earlier, and the responding user behavior to determine the similarity score corresponding to each commodity pair includes: Determine the number of users who have user behaviors for both the first product and the second product; Determine the number of interactive commodities corresponding to each user, where the number of interactive commodities is used to indicate the number of commodities with which the user behavior exists; determining a target weight corresponding to the second commodity; Based on the number of users, the number of interactive commodities and the target weight, a similarity score of each commodity pair is determined.

4. The method for training a product recall model according to claim 3, wherein: The determining the target weight corresponding to the second commodity includes: Obtaining a user behavior corresponding to the second product; Based on a preset correspondence between user behavior and weight, a target weight corresponding to the second commodity is determined.

5. The method for training a product recall model according to claim 2, wherein: The determining the first loss value based on the commodity compression information includes: Determining a first similarity corresponding to the positive sample based on the product compression information of two products of any product pair in the positive sample; Determining a second similarity corresponding to any two commodities in the training sample based on the commodity compression information of the any two commodities; Determining the sample quantity of the training samples; The first loss value is determined based on the first similarity, the second similarity, and the number of samples.

6. The method for training a product recall model according to claim 1, wherein: The determining a second loss value based on the commodity category information and the first output data includes: Determining a target commodity category according to the first output data; Determine a target probability based on the target commodity category and the commodity category information, wherein the target probability is used to indicate a probability that the large language model generates a correct commodity category; Determining the sample quantity of the training samples; Based on the target probability and the sample size, the second loss value is determined.

7. The method for training a product recall model according to claim 1, wherein: The step of training the large language model based on the first loss value and the second loss value to obtain the product recall model includes: Determine a first weight corresponding to the first loss value, and determine a second weight corresponding to the second loss value; Determine a target loss value based on the first loss value and the first weight, and the second loss value and the second weight; Based on the target loss value, the large language model is trained to obtain the product recall model.

8. A product recall method, characterized in that: The product recall method includes: Get product information for multiple products; Based on a preset prompt instruction, the product information is processed using a product recall model to obtain compressed product information of each product, wherein the product recall model is obtained by the training method of the product recall model as described in any one of claims 1 to 7 above; Based on the product compression information, determine the product similarity between any two products; Based on the commodity similarities, a commodity set to be recalled corresponding to each commodity is determined.

9. The product recall method according to claim 8, characterized in that: If the plurality of commodities include a designated commodity, the method further includes: Determine the commodity category corresponding to the designated commodity; The set of products to be recalled corresponding to the determined product category is selected as the set of products to be recalled corresponding to the designated product.

10. A computer device, characterized in that: The computer device includes a controller and a memory, and the controller is used to implement the product recall model training method as described in any one of claims 1 to 7, or the product recall method as described in claim 8 or 9 when executing the computer program stored in the memory.