A method for training a commodity representation generation model and a method and device for identifying associated commodities
By generating a product representation model that combines the semantic information of the product with the user's behavior information, and calculating the residual vector and co-occurrence representation, the problem of ignoring product association relationships in existing technologies is solved, and more accurate identification of associated products is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING XIZHI INFORMATION TECHNOLOGY CO LTD
- Filing Date
- 2026-03-20
- Publication Date
- 2026-06-23
Smart Images

Figure CN122264890A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method for training a commodity representation generation model and a method and apparatus for identifying associated commodities. Background Technology
[0002] With the rapid development of internet technology, the e-commerce sector is increasingly moving towards intelligent development. To improve user experience, intelligent product recommendations are typically provided, offering users potentially related product data. A key issue is how to mine this related product data. Currently, the common approach is to mine data based on product co-occurrence information. This involves recording user behaviors such as browsing, adding to cart, and purchasing products chronologically as a single data point. All user behavior data constitutes a user behavior dataset, which can then be analyzed using machine learning algorithms to identify potential relationships between products and ultimately determine the associated products. However, this method only considers the impact of user behavior data on product relationships, neglecting the potential relationships between the products themselves, resulting in lower accuracy in identifying associated products. Summary of the Invention
[0003] In view of this, embodiments of the present invention provide a training method for a product representation generation model and a method and apparatus for identifying associated products, which can identify associated products through the generated accurate product representations, so as to perform accurate product recommendation operations in the future.
[0004] To achieve the above objectives, according to one aspect of the present invention, a method for training a commodity representation generation model is provided, comprising: The product representation generation model is invoked to calculate the residual vector of each sample product based on the semantic information of each sample product in the sample product set and a preset codebook, and the semantic representation of each sample product is determined based on the residual vector. The product representation generation model is invoked to determine the co-occurrence representation of each sample product based on the user behavior information corresponding to each sample product; The product representation generation model is trained based on the semantic representation and co-occurrence representation of each sample product.
[0005] Optionally, the step of calling the product representation generation model to calculate the residual vector of each sample product based on the semantic information of each sample product in the sample product set and a preset codebook includes: calling the product representation generation model to extract features based on the semantic information of each sample product to obtain the semantic features of each sample product; calling the product representation generation model to encode the semantic features of each sample product to obtain the first feature of each sample product, and calculating the residual vector at each level based on the first feature and the preset codebook to obtain the residual vector at each level of each sample product; The step of determining the semantic representation of the sample product based on the residual vector includes: determining the target vector in the preset codebook corresponding to the residual vector of each level of each sample product; summing the target vectors to obtain the semantic representation of each sample product.
[0006] Optionally, after summing the target vector to obtain the semantic representation of each sample item, the method further includes: decoding the semantic representation of each sample item to obtain a second feature of each sample item; calculating a feature loss based on the first feature and the second feature; calculating a vector proximity loss based on the residual vector and the target vector corresponding to the residual vector; and determining the semantic loss of each sample item based on the feature loss and the vector proximity loss. The step of training the product representation generation model based on the semantic representation and co-occurrence representation of each sample product includes: training the product representation generation model based on the semantic loss, the semantic representation and co-occurrence representation of each sample product.
[0007] Optionally, the step of invoking the product representation generation model to determine the co-occurrence representation of each sample product based on the user behavior information corresponding to each sample product includes: The product representation generation model is invoked to determine the product browsing order based on the user behavior information corresponding to each sample product, and a product link is generated based on the product browsing order. The product representation generation model is invoked to calculate the co-occurrence representation of each sample product based on the product link.
[0008] Optionally, after generating the product link based on the product browsing order, the method further includes: Based on the product link, determine the neighboring products corresponding to each sample product; Calculate the adjacency probability of the corresponding neighboring product based on each sample product and its corresponding neighboring product, and calculate the product probability loss based on the adjacency probability. The step of training the product representation generation model based on the semantic loss, the semantic representation of each sample product, and the co-occurrence representation includes: training the product representation generation model based on the semantic loss, the product probability loss, the semantic representation of each sample product, and the co-occurrence representation.
[0009] Optionally, training the product representation generation model based on the semantic loss, the product probability loss, and the semantic representation and co-occurrence representation of each sample product includes: Determine the positive and negative product samples for each sample product, and calculate the contrastive loss of the product representation generation model based on the positive and negative product samples; The product representation generation model is trained based on the semantic loss, the product probability loss, the contrast loss, and the semantic representation and co-occurrence representation of each sample product.
[0010] According to another aspect of the present invention, a method for identifying associated goods is provided, comprising: The data of the product to be identified is input into the product representation generation model to obtain the residual vector and product representation of the product to be identified output by the product representation generation model. The product representation includes semantic representation and / or co-occurrence representation. Based on the residual vector of the product to be identified, query multiple associated products related to the product to be identified; The correlation degree between the product to be identified and the associated product is calculated based on the product representation of the product to be identified and the product representation of the associated product, and the identification result of the associated product of the product to be identified is determined according to the correlation degree.
[0011] According to another aspect of the present invention, a training apparatus for a commodity representation generation model is provided, comprising: The first determining module is used to call the product representation generation model to calculate the residual vector of each sample product based on the semantic information of each sample product in the sample product set and a preset codebook, and to determine the semantic representation of each sample product based on the residual vector. The second determining module is used to call the product representation generation model to determine the co-occurrence representation of each sample product based on the user behavior information corresponding to each sample product. The training module is used to train the product representation generation model based on the semantic representation and co-occurrence representation of each sample product.
[0012] According to another aspect of the present invention, an apparatus for identifying associated goods is provided, comprising: The input module is used to input the data of the product to be identified into the product representation generation model to obtain the residual vector and product representation of the product to be identified output by the product representation generation model. The product representation includes semantic representation and / or co-occurrence representation. The query module is used to query multiple associated products related to the product to be identified based on the residual vector of the product to be identified; The identification module is used to calculate the correlation degree between the product to be identified and the related products based on the product characteristics of the product to be identified and the product characteristics of the related products, and to determine the identification result of the related products of the product to be identified based on the correlation degree.
[0013] According to another aspect of the present invention, an electronic device is provided, comprising: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the training method for the product representation generation model or the method for associated product identification provided in the embodiments of the present invention.
[0014] According to another aspect of the present invention, a computer-readable medium is provided having a computer program stored thereon, which, when executed by a processor, implements the training method for the commodity representation generation model or the method for associated commodity identification provided in the embodiments of the present invention.
[0015] According to another aspect of the present invention, a computer program product is provided, including a computer program that, when executed by a processor, implements the training method for the commodity representation generation model or the method for associated commodity identification provided in the embodiments of the present invention.
[0016] One embodiment of the above invention has the following advantages or beneficial effects: it can calculate residual vectors based on the semantic information of the product, and then generate accurate semantic representations based on the residual vectors. Simultaneously, it generates co-occurrence representations based on user behavior information. Finally, it combines the semantic representations and co-occurrence representations to train a product representation generation model, enabling it to output accurate product representations, thereby improving the accuracy of subsequent product association identification results based on the product representations. The generated product representations, containing both semantic information and user behavior information, accurately reflect product characteristics and facilitate the discovery of potential relationships between products.
[0017] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description
[0018] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein: Figure 1This is a schematic diagram illustrating the main steps of a training method for a commodity representation generation model according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the commodity representation generation model structure provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the main steps of the method for identifying associated goods according to an embodiment of the present invention; Figure 4 This is a schematic diagram of the main modules of a training device for a commodity representation generation model according to an embodiment of the present invention; Figure 5 This is a schematic diagram of the main modules of a device for identifying associated goods according to an embodiment of the present invention; Figure 6 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied; Figure 7 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers of the present invention. Detailed Implementation
[0019] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0020] It should be noted that the technical solutions disclosed in this invention, regarding the collection, updating, analysis, processing, use, transmission, and storage of user personal information, all comply with relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken to prevent unauthorized access to user personal information data and to safeguard user personal information security, network security, and national security.
[0021] It should be noted that the collection, use, storage, sharing and transfer of user personal information involved in the technical solution of the present invention all comply with the provisions of relevant laws and regulations, and require notification to users and obtaining their consent or authorization. When applicable, user personal information is subjected to de-identification and / or anonymization and / or encryption technical processing.
[0022] In the current e-commerce field, to improve the user shopping experience, recommended related products are usually provided to reduce the need for users to search. Among these, how to discover related products is a crucial issue. Existing association mining algorithms are basically based on the co-occurrence information of products. This involves recording a user's browsing, adding to cart, and purchasing behaviors for a product in chronological order over a period of time. All users constitute many such records, which can be directly used for frequent itemset mining using machine learning algorithms. Graph algorithms, on the other hand, treat products as nodes and user behavior links as edges (which can be directed or undirected), then use graph mining algorithms to discover frequent structures. Graph representation learning, such as graph convolutional networks, extends convolution operations from image or text data to graphs. It uses the representations of nodes themselves and their surroundings to achieve high-dimensional abstract representations, and then performs downstream tasks. In representation-only learning, the downstream task can be link prediction, i.e., predicting whether there are edges connecting nodes, and then backpropagating to optimize the node representations. As can be seen from the above, existing methods for identifying related products mainly rely on co-occurrence information, i.e., user behavior data, while neglecting the correlation between the products themselves. For example, similar products exhibit a certain degree of correlation, which is often related to the inherent information of the products, such as product type, price, and other basic product information. This affects the accuracy of the final identification of related products.
[0023] This invention fully considers the shortcomings of the above-mentioned methods and proposes a training method for a product representation generation model and a method for identifying associated products. This method can train the model based on the semantic information of the product and the corresponding user behavior data, enabling it to output accurate product representations for subsequent accurate identification of associated products. Specifically, the product representation method of this invention can utilize contrastive learning to align the two, enriching the representation and applying it to association mining scenarios.
[0024] Figure 1 This is a schematic diagram illustrating the main steps of a training method for a commodity representation generation model according to an embodiment of the present invention. Figure 1 As shown, the training method for the commodity representation generation model mainly includes steps S101 to S103.
[0025] Step S101: Call the product representation generation model to calculate the residual vector of each sample product based on the semantic information of each sample product in the sample product set and the preset codebook, and determine the semantic representation of each sample product based on the residual vector.
[0026] To enable the product representation generation model to generate more accurate product representations, this invention introduces semantic information of products during the model's training phase, allowing the model to ultimately generate product representations that include the semantic features of the products. Specifically, a sample product set is obtained, and the semantic information of all sample products is acquired from this set. This semantic information comprises various types of textual information about the products, including product titles, brands, brand characteristics, prices, and whether they are high-end or low-end. The semantic information of the sample products is then input into... Figure 2 In the product representation generation model structure shown, the semantic representation part, specifically input into the model, is modeled using RQ-VAE (Residual Quantized Variational Autoencoder). This part calculates the residual vector for each sample product based on semantic information and a pre-defined codebook, and further calculates the semantic representation of the sample product based on the residual vector. Specifically, for each sample product, its semantic representation is mainly obtained by summing its semantic information with the residual vectors obtained from the step-by-step calculation of each codebook within the pre-defined codebook.
[0027] Step S102: Invoke the product representation generation model to determine the co-occurrence representation of each sample product based on the user behavior information corresponding to each sample product.
[0028] In addition to calculating the semantic representation of the sample products, it is also necessary to calculate the co-occurrence representation of each sample product. This co-occurrence representation is calculated based on the user behavior data corresponding to the product. Specifically, user behavior information corresponding to the sample product over a certain period of time, such as user browsing behavior, is obtained and this information is input into... Figure 2 The Graph Embedding part of the product representation generation model structure shown in the figure obtains the co-occurrence representation of the output products.
[0029] Step S103: Train the product representation generation model based on the semantic representation and co-occurrence representation of each sample product.
[0030] After obtaining the semantic representation and co-occurrence representation of each sample item in the sample item set, the item representation generation model can be trained based on these two representations. Specifically, the model loss is calculated based on the semantic representation and co-occurrence representation, and the model parameters are adjusted based on the model loss to obtain the trained item representation generation model. During training, a contrastive learning approach can be used based on the sample items in the sample item set.
[0031] In one embodiment, the semantic representation and co-occurrence representation corresponding to each sample product can be pre-labeled, and the model loss can be calculated based on the labeled semantic representation, co-occurrence representation and the semantic representation and co-occurrence representation output by the model to complete the supervised model training operation.
[0032] The training method for the product representation generation model according to embodiments of the present invention can calculate residual vectors based on the semantic information of products, and then generate accurate semantic representations based on the residual vectors. Simultaneously, it generates co-occurrence representations based on user behavior information. Finally, it combines the semantic representations and co-occurrence representations to train the product representation generation model, enabling it to output accurate product representations. This improves the accuracy of subsequent product association identification results based on the product representations. The generated product representations, containing both semantic information and user behavior information, accurately reflect product characteristics and facilitate the discovery of potential relationships between products.
[0033] In one embodiment, the process of invoking a product representation generation model to calculate the residual vector of each sample product based on the semantic information of each sample product in the sample product set and a preset codebook includes: invoking the product representation generation model to extract features based on the semantic information of each sample product to obtain the semantic features of each sample product; invoking the product representation generation model to encode the semantic features of each sample product to obtain the first feature of each sample product, and calculating the residual vector at each level based on the first feature and the preset codebook to obtain the residual vector at each level of each sample product; and determining the semantic representation of the sample product based on the residual vector, including: determining the target vector in the preset codebook corresponding to the residual vector at each level of each sample product; and summing the target vectors to obtain the semantic representation of each sample product.
[0034] When calculating the residual vector for each sample item, the semantic information of the input sample items needs to be extracted first to obtain the semantic features corresponding to each sample item. This step can be achieved using a large model, such as an LLM (Large Language Model), to generate vector representations of the sample items. Specifically, the final hidden layer representation vector of the LLM model is used as the semantic features of the sample items, i.e., the embedding. The parameters of this LLM model are fixed and will not be adjusted during subsequent model training. After obtaining the semantic features, the embedding (e1, for example, a 768-dimensional vector) output by the large model is transformed into a low-dimensional embedding (e2, for example, a 32-dimensional vector) using a set DNN (Deep Neural Network) encoder, i.e., the first feature. The DNN encoder typically has 2-3 layers. The residual vector is calculated based on the first feature and a preset codebook. There are M preset codebooks, each of size N, containing N vectors, which can be randomly initialized vectors. When performing the progressive residual vector calculation, firstly, based on the input vector (the vector of the first feature), find the vector that is closest in distance within the first codebook. ), and the vector in the codebook ( Record the ID (identity card number) of the vector (e.g., the ID in the first password book is 3 (counting from the ID of the first vector in the password book is 0)), and then subtract the vector in the first password book from the input vector. ), to obtain the residual vector ( The resulting residual vector is used as the input vector in the second codebook. The process continues, finding the nearest vector, calculating the difference, and recording its ID. This process is repeated until all codebooks have been traversed, resulting in the residual vector for each level of each sample item set. The difference calculation is performed M-1 times; that is, after determining the nearest vector in the last codebook, there's no need to calculate the difference between the residual vector from the previous level and that vector again. For example, if the DNN encoder outputs vector a1, and the nearest vector to a1 in the first codebook is c1, then a1-c1 equals b1. In the second codebook, the nearest vector to b1 is c2, so b1-c2 equals b2. In the third codebook, the nearest vector to b2 is c3, and the calculation ends. When determining the semantic representation of the final sample item, the corresponding target vectors are determined, i.e., the nearest vectors in the codebook, such as c1, c2, and c3. Summing these target vectors yields the semantic representation of the sample item, for example, c1+c2+c3.
[0035] In one embodiment, a numerical ID for a sample product can be generated based on the ID of the target vector determined in different codebooks, for example, (3, 1, 4). Subsequently, similar products can be selected based on this ID (for example, products with the same first few digits of their IDs are identified as similar products).
[0036] The training method for the commodity representation generation model according to embodiments of the present invention can generate semantic representations of commodities based on rich semantic information of commodities, and combine them with co-occurrence representations of commodities for model training, so as to enable the model to output accurate commodity representations and improve the accuracy of subsequent associated commodity recognition results.
[0037] In one embodiment, after summing the target vector to obtain the semantic representation of each sample item, the method further includes: decoding the semantic representation of each sample item to obtain a second feature of each sample item; calculating a feature loss based on the first feature and the second feature; calculating a vector proximity loss based on the residual vector and the target vector corresponding to the residual vector; determining the semantic loss of each sample item based on the feature loss and the vector proximity loss; and training a product representation generation model based on the semantic representation and co-occurrence representation of each sample item, including: training the product representation generation model based on the semantic loss, the semantic representation of each sample item, and the co-occurrence representation.
[0038] After calculating the semantic representation of each sample item (which can be called the reconstructed feature e3), the semantic representation can be decoded to obtain the second feature of the sample item. The decoder structure is similar to the encoder. After decoding, the LLM large model output embedding (e4) is obtained. The feature loss can be calculated based on e1 and e4. Specifically, the distance can be calculated through reconstruction, and the calculation formula is as follows: In addition to feature loss, the vector proximity loss of the sample item in each codebook can also be calculated. The formula for calculating the vector proximity loss in each codebook is: + Since finding the nearest neighbor is not differentiable, there is no gradient. This indicates that gradient backpropagation is prevented; that is, it is calculated during the forward pass but omitted during the backward pass. The first term indicates that... Get closer The second term is the opposite. This allows for simultaneous training of the Encoder, Decoder, and Codebook. Each Codebook can have 256 entries; with four such Codebooks, over 4 billion items can be represented, ensuring a unique representation for each item. After calculating the feature loss and proximity loss, the two losses can be summed to obtain the semantic loss for the sample item. This semantic loss can then be incorporated into the model training.
[0039] In one embodiment, invoking a product representation generation model to determine the co-occurrence representation of each sample product based on user behavior information corresponding to each sample product includes: invoking the product representation generation model to determine the product browsing order based on user behavior information corresponding to each sample product, and generating a product link based on the product browsing order; and invoking the product representation generation model to calculate the co-occurrence representation of each sample product based on the product link.
[0040] RQ-VAE only utilizes the semantics of products, and its modeling method does not focus on the co-occurrence information of products. Therefore, in order to integrate different features, it is necessary to establish a co-occurrence representation generation process, specifically using Graph Embedding for modeling. For the input user behavior information, a graph network is first constructed, where nodes represent products, edges are directed edges pointing to the user's browsing order of products, and the edges have weights. The weight indicates how many times in the record A was browsed before B, forming a complete graph network. The browsing order of products is determined based on the graph network, and random exploration is performed according to this browsing order to generate product links. Since the edges are weighted, the probability of node i exploring node j is equal to the weight from node i to j. Divide by the sum of the weights of all adjacent nodes of i. Random walks essentially expand the amount of data without changing the distribution. Then, the co-occurrence representation of each item is trained using the Skip-Gram method from natural language processing. After generating the item link, the co-occurrence representation of each sample item can be calculated based on the link.
[0041] In one embodiment, the Skip-Gram training process is as follows: its input is the target node, and the prediction is of the nodes within the windows before and after the target node (the window is generally 2, i.e., the two nodes before and after). First, the target node is represented by one-hot encoding, and its node representation v is indexed from the dictionary matrix. Then, it is multiplied by the context vector (i.e., the two nodes before and after the target node, with the same size as the transpose of the dictionary matrix), and then passed through softmax (normalized exponential function). The result is the probability of other nodes appearing when the target node is the center node. Then, based on the combination of inputs, such as when the input is (B, ACDE), the probability of the target being ACDE is maximized. The loss between the two probabilities is denoted as . In the training process, the target node can be any node representing a product in the graph network, and the input combination is the combination determined by any link corresponding to that product. If n links are generated through random walks during training, training is required for each sample product in each link. That is, for a link, each node in that link is used as the target node, and the input combination corresponding to each target node is determined based on that link. The target node and the input combination are then used as input for sequential calculation, and so on, to complete the calculation for all links. Taking the ACBDE link as an example, when B is the center node, the input combination is (B, ACDE), and the prediction goal is to maximize the probability of ACDE occurring. When D is the center node, the input combination is (D, CBE), and the prediction goal is to maximize the probability of CBE occurring.
[0042] In one embodiment, user behavior information can be preprocessed during the construction of the graph network, i.e., removing impurity data, such as items with short dwell times being likely clicked accidentally.
[0043] In one embodiment, after generating a product link based on the product browsing order, the method further includes: determining the neighboring products corresponding to each sample product based on the product link; calculating the adjacency probability of the corresponding neighboring products based on each sample product and the corresponding neighboring products, and calculating the product probability loss based on the adjacency probability; and training a product representation generation model based on semantic loss, the semantic representation of each sample product, and the co-occurrence representation, including: training the product representation generation model based on semantic loss, product probability loss, the semantic representation of each sample product, and the co-occurrence representation.
[0044] After generating the product links, we can determine the neighboring products corresponding to the sample product in each product link, calculate the adjacency probability between the neighboring products and the sample product, and combine this with the probability output from the Skip-Gram training to calculate the product probability loss. In subsequent training of the product representation model, product probability loss can be combined with semantic loss for training.
[0045] In one embodiment, training a product representation generation model based on semantic loss, product probability loss, semantic representation of each sample product, and co-occurrence representation includes: determining positive and negative product samples for each sample product, and calculating the contrastive loss of the product representation generation model based on the positive and negative product samples; and training the product representation generation model based on semantic loss, product probability loss, contrastive loss, semantic representation of each sample product, and co-occurrence representation.
[0046] When training a product representation generation model, since the RQ-VAE and Graph Embedding components are used to generate semantic features and co-occurrence features respectively, contrastive learning can be used to fuse these two components and generate more accurate product representations. Specifically, it is necessary to determine the sample products and their corresponding positive and negative sample products. Two representations of the same item can be used as positive examples for contrastive learning within a batch, while negative examples come from representations of different items within the same batch. Alternatively, two labeled, related sample products can be used as each other's positive sample products, and other unrelated sample products as negative sample products. After determining the positive and negative examples, contrastive learning can be used for training. The formula for calculating the contrastive loss during training is as follows:
[0047] in, This represents the semantic representation and co-occurrence representation of the same item. It is a hyperparameter. This represents the similarity calculation. In this way, the entire model is trained together, and the training loss is the sum of the previously mentioned losses, i.e. This yields the semantic representation and co-occurrence representation of the Item.
[0048] In one embodiment, Figure 2This is a schematic diagram of the product representation generation model. The model mainly consists of three parts: 1. Semantic representation, modeled using RQ-VAE; 2. Co-occurrence representation, modeled using Graph Embedding; 3. Contrastive learning. In the semantic representation part, the semantic information of the product is input into the LLM model to obtain the output semantic features. These features are then processed by the encoding layer for dimensionality reduction. The processed feature vector is then compared with the codebook to calculate the residual vector, resulting in the semantic representation of the sample product. Simultaneously, a numerical ID for the product can be generated based on the target vector in the codebook. The semantic information of the product includes Title, Brand, and Price. This semantic representation can be used for feature reconstruction through the decoding layer to achieve autoregressive training. In the co-occurrence representation part, a product graph network (Item graph) is constructed based on user behavior information, and a product browsing path (Randomwalk) is generated from the graph network. Based on this browsing path, the co-occurrence representation of the sample product is generated.
[0049] The training method for the product representation generation model according to embodiments of the present invention can introduce semantic information of products and user behavior information into the model training process, and generate corresponding semantic representations and co-occurrence representations through different structural parts of the model. Finally, the semantic representations and co-occurrence representations are combined to train the product representation generation model, enabling the model to output accurate product representation data. The product representation includes not only user operation information on products, but also semantic information of the products. That is, the generated representation includes not only the relationships between products caused by user behavior, but also the relationships between products based on the inherent information of the products. The product representation obtained in this way can accurately reflect the characteristics of the products, which helps to generate accurate associated products based on the representation in the subsequent process.
[0050] Figure 3 This diagram illustrates the main steps of the method for identifying associated products provided in an embodiment of the present invention. Figure 3 As shown, the method for identifying associated products mainly includes steps S301 to S303.
[0051] Step S301: Input the data of the product to be identified into the product representation generation model to obtain the residual vector and product representation of the product to be identified output by the product representation generation model. The product representation includes semantic representation and / or co-occurrence representation.
[0052] To accurately identify associated products, the data of the product to be identified needs to be input into a product representation generation model to obtain an accurate product representation. The input data mainly consists of the product's semantic information, including product type and price. The product representation generation model outputs a residual vector and a product representation, which can be a semantic representation or a fusion of semantic and co-occurrence representations. The fusion representation can be obtained by concatenating semantic and co-occurrence representations.
[0053] Step S302: Query multiple associated products related to the product to be identified based on the residual vector of the product to be identified.
[0054] After obtaining the above output, you can query the associated products corresponding to the product to be identified. Specifically, you query the numeric ID of the product to be identified based on the residual vector, and then query the associated products based on the numeric ID of the product and the numeric IDs of other products. Associated products can be those whose numeric IDs have the same first few digits.
[0055] In one embodiment, the residual vector output by the product representation generation model can also be replaced with the numeric ID of the product to be identified; that is, the model outputs both the numeric ID and the product representation. Related products can be directly queried based on the numeric ID, for example, products with the same first few digits in their numeric IDs can be queried and identified as related products. The number of digits can be set according to actual needs.
[0056] Step S303: Calculate the correlation degree between the product to be identified and the related products based on the product representation of the product to be identified and the product representation of the related products, and determine the identification result of the related products of the product to be identified based on the correlation degree.
[0057] After retrieving multiple related products, the distance between the characteristics of the product to be identified and the characteristics of the related products can be calculated based on the product characteristics of each product; this distance is called the relevance. The relevance between each related product and the product to be identified is then determined based on the calculation results. The final output identification result can be either the product with the highest relevance to the current product to be identified, determined by the relevance, or multiple related products sorted from high to low relevance.
[0058] The method for identifying associated products according to embodiments of the present invention can input product data into a trained product representation generation model, enabling it to output accurate product representations and residual vectors. These product representations accurately reflect the characteristics of the products. The residual vectors allow for the retrieval of products associated with the current product, and the identification result of the current product can be determined by calculating the correlation between the associated products and the current product. This identification result can uncover the relationships between products based on their inherent information, significantly improving the accuracy of the identification.
[0059] Figure 4 This is a schematic diagram of the main modules of the training device for the commodity representation generation model provided in an embodiment of the present invention. Figure 4 As shown, the training device 400 for the commodity representation generation model mainly includes a first determining module 401, a second determining module 402, and a training module 403.
[0060] The first determining module 401 is used to call the commodity representation generation model to calculate the residual vector of each sample commodity based on the semantic information of each sample commodity in the sample commodity set and the preset codebook, and to determine the semantic representation of each sample commodity based on the residual vector. The second determining module 402 is used to call the product representation generation model to determine the co-occurrence representation of each sample product based on the user behavior information corresponding to each sample product. Training module 403 is used to train a product representation generation model based on the semantic representation and co-occurrence representation of each sample product.
[0061] The training apparatus for the product representation generation model according to an embodiment of the present invention can calculate residual vectors based on the semantic information of the product, and then generate accurate semantic representations based on the residual vectors. Simultaneously, it generates co-occurrence representations based on user behavior information. Finally, it combines the semantic representations and co-occurrence representations to train the product representation generation model, enabling it to output accurate product representations. This improves the accuracy of subsequent product association recognition results based on the product representations. The generated product representations, containing both semantic information and user behavior information, accurately reflect product characteristics and facilitate the discovery of potential relationships between products.
[0062] In one embodiment, the first determining module 401 is further configured to: invoke a commodity representation generation model to extract features based on the semantic information of each sample commodity to obtain the semantic features of each sample commodity; invoke a commodity representation generation model to encode the semantic features of each sample commodity to obtain the first feature of each sample commodity; and calculate the residual vector at each level based on the first feature and a preset codebook to obtain the residual vector at each level of each sample commodity. The first determining module 401 is also used to determine the target vector in the preset codebook corresponding to the residual vector of each level of each sample product; and to sum the target vectors to obtain the semantic representation of each sample product.
[0063] In one embodiment, the training device 400 for the commodity representation generation model further includes: a decoding module 404 (not shown in the figure), used to decode the semantic representation of each sample commodity to obtain a second feature of each sample commodity; and a first calculation module 405 (not shown in the figure), used to: calculate feature loss based on the first feature and the second feature; calculate vector proximity loss based on the residual vector and the target vector corresponding to the residual vector; and determine the semantic loss of each sample commodity based on the feature loss and the vector proximity loss. Training module 403 is also used to train a product representation generation model based on semantic loss, semantic representation of each sample product, and co-occurrence representation.
[0064] In one embodiment, the second determining module 402 is further configured to: invoke a product representation generation model to determine the product browsing order based on the user behavior information corresponding to each sample product, and generate a product link based on the product browsing order; invoke a product representation generation model to calculate the co-occurrence representation of each sample product based on the product link.
[0065] In one embodiment, the training device 400 for the commodity representation generation model further includes: a third determining module 406 (not shown in the figure), used to determine the neighboring commodities corresponding to each sample commodity based on the commodity link; and a second calculation module 407 (not shown in the figure), used to calculate the neighbor probability of the corresponding neighboring commodity based on each sample commodity and the corresponding neighboring commodity, and calculate the commodity probability loss based on the neighbor probability. Training module 403 is also used to train a product representation generation model based on semantic loss, product probability loss, semantic representation of each sample product, and co-occurrence representation.
[0066] In one embodiment, the training module 403 is further configured to: determine the positive and negative product samples for each sample product, and calculate the contrastive loss of the product representation generation model based on the positive and negative product samples; and train the product representation generation model based on the semantic loss, product probability loss, contrastive loss, semantic representation and co-occurrence representation of each sample product.
[0067] The training apparatus for the product representation generation model according to embodiments of the present invention can introduce semantic information of products and user behavior information during the model training process, and generate corresponding semantic representations and co-occurrence representations through different structural parts of the model. Finally, the semantic representations and co-occurrence representations are combined to train the product representation generation model, enabling the model to output accurate product representation data. The product representation includes not only user operation information on products, but also semantic information of the products. That is, the generated representation includes not only the relationships between products caused by user behavior, but also the relationships between products based on inherent product information. The product representation obtained in this way can accurately reflect the characteristics of the products, which helps to generate accurate associated products based on the representation in the subsequent process.
[0068] Figure 5 This is a schematic diagram of the main modules of the associated product identification device provided in an embodiment of the present invention. Figure 5 As shown, the associated product identification device 500 mainly includes an input module 501, a query module 502, and an identification module 503.
[0069] The input module 501 is used to input the data of the product to be identified into the product representation generation model to obtain the residual vector and product representation of the product to be identified output by the product representation generation model. The product representation includes semantic representation and / or co-occurrence representation. The query module 502 is used to query multiple associated products related to the product to be identified based on the residual vector of the product to be identified; The identification module 503 is used to calculate the correlation degree between the product to be identified and the related products based on the product representation of the product to be identified and the product representation of the related products, and to determine the identification result of the related products of the product to be identified based on the correlation degree.
[0070] The device for identifying associated products according to embodiments of the present invention can input product data into a trained product representation generation model, enabling it to output accurate product representations and residual vectors. These product representations accurately reflect the characteristics of the products. The residual vectors allow for the retrieval of products associated with the current product, and the identification result of the current product can be determined by calculating the correlation between the associated products and the current product. This identification result can uncover the correlations between products based on their inherent information, significantly improving the accuracy of the identification result.
[0071] Figure 6 An exemplary system architecture 600 is shown, in which the training method and associated product recognition method of the product representation generation model or the training apparatus and associated product recognition apparatus of the product representation generation model can be applied according to embodiments of the present invention.
[0072] like Figure 6As shown, system architecture 600 may include terminal devices 601, 602, and 603, a network 604, and a server 605. Network 604 serves as the medium for providing communication links between terminal devices 601, 602, and 603 and server 605. Network 604 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.
[0073] Users can use terminal devices 601, 602, and 603 to interact with server 605 via network 604 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 601, 602, and 603, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).
[0074] Terminal devices 601, 602, and 603 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0075] Server 605 can be a server that provides various services, such as a backend management server that supports shopping websites browsed by users using terminal devices 601, 602, and 603 (for example only). The backend management server can analyze and process data such as received training requests, and feed back the processing results (such as product representation generation models and recognition results—for example only) to the terminal devices.
[0076] It should be noted that the training method for the commodity representation generation model and the method for associated commodity recognition provided in the embodiments of the present invention are generally executed by the server 605. Correspondingly, the training device for the commodity representation generation model and the device for associated commodity recognition are generally set in the server 605.
[0077] It should be understood that Figure 6 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0078] The following is for reference. Figure 7 It shows a schematic diagram of the structure of a computer system 700 suitable for implementing terminal devices or servers of the present invention. Figure 7 The terminal device or server shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.
[0079] like Figure 7As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 702 or programs loaded from storage section 708 into random access memory (RAM) 703. The RAM 703 also stores various programs and data required for the operation of the system 700. The CPU 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0080] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, mouse, etc.; an output section 707 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 710 as needed so that computer programs read from it can be installed into the storage section 708 as needed.
[0081] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 709, and / or installed from removable medium 711. When the computer program is executed by central processing unit (CPU) 701, it performs the functions defined above in the system of this invention.
[0082] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0083] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0084] The units or modules described in the embodiments of the present invention can be implemented in software or hardware. The described units or modules can also be housed in a processor; for example, a processor may be described as including a first determining module, a second determining module, and a training module, or an input module, a query module, and a recognition module. The names of these units or modules do not necessarily limit the specific unit or module itself. For example, the first determining module may also be described as "a module for calling a commodity representation generation model to calculate the residual vector of each sample commodity based on the semantic information of each sample commodity in the sample commodity set and a preset codebook, and determining the semantic representation of each sample commodity based on the residual vector."
[0085] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs, which, when executed by the device, cause the device to include: The product representation generation model is invoked to calculate the residual vector of each sample product based on the semantic information of each sample product in the sample product set and a preset codebook, and the semantic representation of each sample product is determined based on the residual vector. The product representation generation model is invoked to determine the co-occurrence representation of each sample product based on the user behavior information corresponding to each sample product; The product representation generation model is trained based on the semantic representation and co-occurrence representation of each sample product.
[0086] or, The data of the product to be identified is input into the product representation generation model to obtain the residual vector and product representation of the product to be identified output by the product representation generation model. The product representation includes semantic representation and / or co-occurrence representation. Based on the residual vector of the product to be identified, query multiple associated products related to the product to be identified; The correlation between the product to be identified and the related products is calculated based on the product representation of the product to be identified and the product representation of the related products, and the identification result of the related products of the product to be identified is determined according to the correlation.
[0087] According to the technical solution of this invention, residual vectors can be calculated based on the semantic information of goods, and then accurate semantic representations can be generated based on the residual vectors. Simultaneously, co-occurrence representations can be generated based on user behavior information. Finally, the semantic representations and co-occurrence representations are combined to train a goods representation generation model, enabling it to output accurate goods representations. This improves the accuracy of subsequent related goods identification results based on the goods representations. The generated goods representations, containing both semantic information and user behavior information, accurately reflect the characteristics of the goods, facilitating the discovery of potential relationships between goods.
[0088] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A training method for a commodity representation generation model, characterized in that, include: The product representation generation model is invoked to calculate the residual vector of each sample product based on the semantic information of each sample product in the sample product set and a preset codebook, and the semantic representation of each sample product is determined based on the residual vector. The product representation generation model is invoked to determine the co-occurrence representation of each sample product based on the user behavior information corresponding to each sample product; The product representation generation model is trained based on the semantic representation and co-occurrence representation of each sample product.
2. The method according to claim 1, characterized in that, The step of calling the product representation generation model to calculate the residual vector of each sample product based on the semantic information of each sample product in the sample product set and a preset codebook includes: calling the product representation generation model to extract features based on the semantic information of each sample product to obtain the semantic features of each sample product; calling the product representation generation model to encode the semantic features of each sample product to obtain the first feature of each sample product; and calculating the residual vector at each level based on the first feature and the preset codebook to obtain the residual vector at each level of each sample product. The step of determining the semantic representation of the sample product based on the residual vector includes: determining the target vector in the preset codebook corresponding to the residual vector of each level of each sample product; summing the target vectors to obtain the semantic representation of each sample product.
3. The method according to claim 2, characterized in that, After summing the target vector to obtain the semantic representation of each sample item, the method further includes: decoding the semantic representation of each sample item to obtain a second feature of each sample item; calculating a feature loss based on the first feature and the second feature; calculating a vector proximity loss based on the residual vector and the target vector corresponding to the residual vector; and determining the semantic loss of each sample item based on the feature loss and the vector proximity loss. The step of training the product representation generation model based on the semantic representation and co-occurrence representation of each sample product includes: training the product representation generation model based on the semantic loss, the semantic representation and co-occurrence representation of each sample product.
4. The method according to claim 3, characterized in that, The step of calling the product representation generation model to determine the co-occurrence representation of each sample product based on the user behavior information corresponding to each sample product includes: The product representation generation model is invoked to determine the product browsing order based on the user behavior information corresponding to each sample product, and a product link is generated based on the product browsing order. The product representation generation model is invoked to calculate the co-occurrence representation of each sample product based on the product link.
5. The method according to claim 4, characterized in that, After generating the product link based on the product browsing order, the method further includes: Based on the product link, determine the neighboring products corresponding to each sample product; Calculate the adjacency probability of the corresponding neighboring product based on each sample product and its corresponding neighboring product, and calculate the product probability loss based on the adjacency probability. The step of training the product representation generation model based on the semantic loss, the semantic representation of each sample product, and the co-occurrence representation includes: training the product representation generation model based on the semantic loss, the product probability loss, the semantic representation of each sample product, and the co-occurrence representation.
6. The method according to claim 5, characterized in that, The process of training the product representation generation model based on the semantic loss, the product probability loss, and the semantic representation and co-occurrence representation of each sample product includes: Determine the positive and negative product samples for each sample product, and calculate the contrastive loss of the product representation generation model based on the positive and negative product samples; The product representation generation model is trained based on the semantic loss, the product probability loss, the contrast loss, and the semantic representation and co-occurrence representation of each sample product.
7. A method for identifying associated goods based on the goods representation generation model according to any one of claims 1-6, characterized in that, include: The data of the product to be identified is input into the product representation generation model to obtain the residual vector and product representation of the product to be identified output by the product representation generation model. The product representation includes semantic representation and / or co-occurrence representation. Based on the residual vector of the product to be identified, query multiple associated products related to the product to be identified; The correlation degree between the product to be identified and the associated product is calculated based on the product representation of the product to be identified and the product representation of the associated product, and the identification result of the associated product of the product to be identified is determined according to the correlation degree.
8. A training device for a commodity representation generation model, characterized in that, include: The first determining module is used to call the product representation generation model to calculate the residual vector of each sample product based on the semantic information of each sample product in the sample product set and a preset codebook, and to determine the semantic representation of each sample product based on the residual vector. The second determining module is used to call the product representation generation model to determine the co-occurrence representation of each sample product based on the user behavior information corresponding to each sample product. The training module is used to train the product representation generation model based on the semantic representation and co-occurrence representation of each sample product.
9. A device for identifying associated goods, characterized in that, include: The input module is used to input the data of the product to be identified into the product representation generation model to obtain the residual vector and product representation of the product to be identified output by the product representation generation model. The product representation includes semantic representation and / or co-occurrence representation. The query module is used to query multiple associated products related to the product to be identified based on the residual vector of the product to be identified; The identification module is used to calculate the correlation degree between the product to be identified and the related products based on the product characteristics of the product to be identified and the product characteristics of the related products, and to determine the identification result of the related products of the product to be identified based on the correlation degree.
10. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-7.
11. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-7.
12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-7.