Commodity recommendation method and device based on commodity subdivision and classification and medium
Through the method based on product segmentation and classification, users can obtain browsing history and product information, and predict the segmentation and weight of the next product, it solves the problem of users' difficulty in selecting a large number of products, and improves the accuracy and user experience of recommendations.
Patent Information
- Application Number
- CN202410124277.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-29
- Publication Date
- 2025-03-18
AI Technical Summary
In an e-commerce platform, it takes a lot of time to choose the products they want to buy from a large number of products, resulting in a decline in user experience.
The product recommendation method based on product segmentation classification is adopted. By obtaining the segmentation classification and weight of the current and previous product browsed by the target user, combining the information of the product itself and the browsing chain, the segmentation classification and weight of the next product are predicted and recommended.
It realizes accurate matching of user browsing interests, improves the accuracy and user experience of product recommendations, and is especially suitable for situations where the same product may belong to multiple sub-categories.
Smart Images

Figure CN119648320A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of electronic marketing technology, and in particular to a commodity recommendation method, device and medium based on commodity subdivision classification. Background Art
[0002] As the scale of e-commerce continues to expand, the number and categories of goods in online commodity platforms (such as shopping websites, apps, etc.) continue to increase. When users select goods, they usually need to spend a lot of time to select the goods they want to buy from a large number of goods, which leads to a decline in user experience.
[0003] In view of this, the present invention is proposed. Summary of the invention
[0004] The embodiments of the present invention provide a commodity recommendation method, device and medium based on commodity subdivision classification, which can accurately recommend commodities based on commodity subdivision classification.
[0005] In a first aspect, an embodiment of the present invention provides a commodity recommendation method based on commodity subdivision classification, comprising:
[0006] Obtain the current product browsed by the target user, as well as multiple subcategories and weights of the previous product browsed by the target user;
[0007] Determine the multiple subcategories and weights to which the current product belongs based on the classification label queue and product description of the current product; determine the multiple subcategories and weights to which the previous product belongs based on the multiple subcategories and weights, as well as the time correlation between all subcategories; merge the two sets of determination results based on the target user's stay time on the previous product to obtain the multiple subcategories and weights to which the current product ultimately belongs;
[0008] According to the multiple subcategories and weights to which the current product ultimately belongs, and the time correlation between all the subcategories, predict the multiple subcategories and weights to which the next product browsed by the user belongs; the multiple subcategories and weights to which the current product ultimately belongs are arranged and combined with the multiple subcategories and weights to which the next product belongs, respectively, to form multiple category pairs, wherein each category pair includes a subcategories and weight to which the current product ultimately belongs, and a subcategories and weight to which the next product belongs;
[0009] For two classification pairs with the same subdivision classification, a group of recommended products and their weights are determined according to the similarity of products under the same subdivision classification and the two weights in the classification pair, wherein the classification information of the products is suppressed when calculating the product similarity; For two classification pairs with different subdivision classifications, the user similarity is calculated according to the subdivision classification corresponding to the next product, and another group of recommended products and their weights are determined according to the user similarity and the two weights in the classification pair, wherein the subdivision classification information of the products is strengthened when calculating the user similarity;
[0010] The products with the highest weights in the two groups of recommended products are recommended as the next products to be browsed by the target user.
[0011] In a second aspect, an embodiment of the present invention provides an electronic device, the electronic device comprising:
[0012] one or more processors;
[0013] a memory for storing one or more programs,
[0014] When the one or more programs are executed by the one or more processors, the one or more processors implement the commodity recommendation method based on commodity subdivision classification described in any embodiment.
[0015] In a third aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the commodity recommendation method based on commodity subdivision classification as described in any embodiment.
[0016] The embodiment of the present invention provides a method for recommending products based on product subdivision classification, which makes accurate product recommendations based on product subdivision classification, and is particularly suitable for situations where the same product may belong to multiple subdivision classifications. Specifically, after the user determines the current product, the method comprehensively and accurately evaluates the subdivision classification and its weight to which the current product belongs from the perspective of the product itself (static attributes) and the product browsing chain (dynamic association), and uses the transfer matrix to continue to predict the subdivision classification and weight of the next product; then, according to whether the subdivision classification of the current product and the previous product is the same or different, different methods are used to recommend products, and when calculating product similarity and user similarity, the existing prior information is fully used, and the calculation component of the subdivision classification is especially suppressed or enhanced, so that the recommended products can better match the browsing interests of users under specific subdivision classifications. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 is a flow chart of a commodity recommendation method based on commodity subdivision classification provided by an embodiment of the present invention;
[0019] Figure 2 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0020] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be described clearly and completely below. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.
[0021] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0022] In the description of the present invention, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0023] Figure 1 1 is a flowchart of a method for recommending products based on product classification provided by an embodiment of the present invention. The method is applicable to the case where the e-commerce platform has multi-level classification of products and is executed by an electronic device. Figure 1 As shown, the method specifically includes:
[0024] S110: Acquire the current product browsed by the target user and multiple subcategories and weights to which the last product browsed by the target user belongs.
[0025] The target user refers to a specific user. The method of this embodiment aims to obtain information about the products currently browsed by the user and the products browsed in the previous step, recommend new products to the user in real time, and expect the user to select the product to browse next from the recommended products.
[0026] Specifically, many e-commerce platforms currently have multi-level classifications for goods, and the multi-level classification information includes at least major categories and sub-categories. For example, the major categories include: women's and men's clothing, sports and outdoor, maternal and child products, etc. Among them, the women's and men's clothing category includes trendy women's clothing, fashionable men's clothing, down jackets, autumn jackets, jackets and tops and other sub-categories, the sports and outdoor category includes outdoor wear, yoga dance, sports jackets and other sub-categories, and the maternal and child products category includes parent-child shoes and clothing, maternity clothing, children's clothing and other sub-categories. Therefore, the same product may belong to multiple sub-categories at the same time. For example, a women's coat belongs to the four sub-categories of autumn coats, jackets and tops, yoga dance and maternity clothing, and this women's coat can be found in each sub-category.
[0027] Based on the above characteristics, this embodiment sets corresponding weights for the multiple sub-categories to which each product belongs. The larger the weight, the greater the possibility that the product belongs to the corresponding sub-categories. This step first obtains the current product browsed by the target user, as well as the multiple sub-categories and weights of the product browsed by the target user in the previous step, as prior information for recommending to the user the product to be browsed next. Optionally, a sub-categories vector can be constructed for each product, which is specifically used to represent the multiple sub-categories and weights to which the same product belongs. The vector uses all sub-categories as dimensions, and the vector elements are the weights of the corresponding sub-categories of the product. Exemplarily, if the product platform has a total of N sub-categories, the sub-categories vector is a 1×N vector, and the sub-categories vector of the previous product can be denoted as V -1 =[v -11 ,v -12 ,…,v -1N ], each element v of the vector -1i (i=1,2,…N) corresponds to the ith product subdivision category, element v -1i The value of represents the weight of the previous product belonging to the ith subdivision category. The vector may be preset or calculated by the method provided in this embodiment when browsing the previous product (the specific calculation process will be described in detail in S120), and this embodiment does not make any specific limitation.
[0028] S120. Determine the multiple subcategories and weights to which the current product belongs based on the classification label queue and product description of the current product; determine the multiple subcategories and weights to which the current product belongs based on the multiple subcategories and weights to which the previous product belonged, as well as the time correlation between all subcategories; and merge the two sets of determination results based on the target user's stay time on the previous product to obtain the multiple subcategories and weights to which the current product ultimately belongs.
[0029] As mentioned above, the same product may belong to multiple subcategories at the same time. This step comprehensively determines the multiple subcategories to which the current product belongs and their weights from two perspectives: the product itself (static attributes) and the product browsing chain (dynamic association).
[0030] Among them, from the perspective of the product itself, the multiple subdivisions and weights to which the current product belongs can be determined based on the classification label queue and product description of the current product. In a specific embodiment, the product platform constructs a corresponding classification label queue for each product so that when the user clicks the corresponding classification index, the corresponding product can be extracted according to the classification label of the product. The queue may include multiple classification labels, including major classification labels and subdivision classification labels. The closer the position of a classification label in the queue is, the closer the label is to the general public's understanding of the classification of the product. Exemplarily, a loose yoga suit, the general public's understanding of its subdivision classification is yoga dance, but in a specific usage scenario, the product may also have other classification labels, such as in the maternal and child scenario, it may have a subdivision classification label for maternity clothing, and in the parent-child scenario, it may also have a subdivision classification label for parent-child shoes and clothing, then yoga dance is used as the first label in the product classification label queue, and maternity clothing and parent-child shoes and clothing are used as the second and third labels. Optionally, each label in the queue can be manually labeled by the merchant or operator when the product is put on the shelf, or it can be automatically assigned by the background according to preset rules, and this embodiment does not impose specific restrictions. Based on such a label queue, when determining the subdivision classification vector of the current product, you can first construct a subdivision classification vector of all 0s; then, according to the classification label queue of the current product traversed in order, perform the following operations on each classification label: If the current classification label is a subdivision classification, add 1 to the vector elements corresponding to the subdivision classification and other non-0 elements in the vector; if the current classification label is a large category classification, add 1 to the vector elements corresponding to all subdivision classifications under the large category classification and other non-0 elements in the vector. In this way, it can be ensured that the vector elements corresponding to the classification labels in the front are always greater than the vector elements corresponding to the labels behind, which is consistent with the original intention of the labeling in the label queue.
[0031] Then, the name and / or description of the current product is segmented. If a synonym of a subdivision appears in each segmentation, the vector element corresponding to the subdivision is increased by 1; if a synonym of a large category appears in each segmentation, the vector elements corresponding to all subdivisions under the large category are increased by 1. Based on the classification label queue, this step further considers the product name and description, and further identifies the subdivision classification weight through mature segmentation technology and synonym library. Finally, each vector element is normalized to obtain the final subdivision classification vector X=[x 01 ,x 02 ,…,x 0N ], each element x of the vector 0i (i=1,2,…N) corresponds to the ith product subdivision category, element x 0i The value of represents the weight of the current product belonging to the i-th sub-category.
[0032] From the perspective of the product browsing chain, there is a certain regularity in the user's transfer from one subdivided classification product to another. For example, the products that users browse continuously usually have a certain connection. Large jumps are rare but do exist. This embodiment uses time correlation to describe this regularity. Optionally, a transfer matrix can be used to express the time correlation between subdivided classifications. The transfer matrix has all subdivided classifications of the e-commerce platform as rows and columns, and the matrix elements are the probabilities of transferring from the subdivided classification product in the row where the element is located to the subdivided classification product in the column where the element is located. For example, the probability of a user transferring from outdoor wear to outerwear is relatively high, so it is believed that outdoor wear and outerwear have a strong time correlation, while the probability of transferring from outdoor wear to decorative building materials is relatively low, so it is believed that outdoor wear and decorative building materials have a low time correlation. Optionally, still taking the example of a product platform with a total of N subdivided classifications, the transfer matrix can be an N×N matrix, recorded as Each row and each category of the matrix corresponds to a subdivision category, and the element t in the i-th row and j-th column is ij is the probability of a user transferring from the ith sub-category to the jth sub-category. The sum of the elements in each row and the sum of the elements in each column of the matrix are both 1. Furthermore, the matrix can be directly set by the operator according to the rules of the products, or calculated by the electronic device according to the browsing data of historical users. This embodiment does not impose any specific restrictions. In a specific implementation, when each product has its own classification label queue, the first sub-category label in the queue can be used as the main sub-category of the product. By recording the main sub-category of each product browsed by the user, the probability of the user transferring from the main sub-category to the jth sub-category can be calculated. i The goods are transferred to the main sub-category A jFor example, in the historical browsing data of users, the number of times the main sub-category of the current browsed product is outdoor wear is N1, and the number of times the main sub-category of the next browsed product is yoga dance is N2, then the probability of switching from outdoor wear to yoga dance is N2 / N1; the number of times the main sub-category of the next browsed product is decoration building materials is N3, then the probability of switching from outdoor wear to decoration building materials is N3 / N1.
[0033] Furthermore, in another specific implementation, considering that some large e-commerce platforms have users visiting from many countries and even all over the world, there are often multiple servers in the background for responding to user visits. Since the consumption habits of users in different regions may be different, for example, there may be obvious differences in the consumption habits of users in Northeast my country and Southwest China, each server can serve users in a certain region separately to record the user behavior habits in different regions. Accordingly, each server can also calculate a transfer matrix based on the user data within the service scope, and recommend suitable products to users within the service scope based on the transfer matrix, thereby realizing differentiated services between different regions or different servers. In other words, the transfer matrix in each region or server is different. In this case, according to the scale of historical user data accumulated by each server, the construction process of the above transfer matrix can also include the following two optional implementations:
[0034] In a first optional implementation, when the number of historical users responded by a server reaches a certain scale (for example, reaches a set number), the above method can be used to record the main sub-categories of each commodity browsed by the historical users, and calculate the user's main sub-categories as A. i The goods are transferred to the main sub-category A j The probability of the commodity is determined, and the transfer matrix of the server is constructed with each probability as an element.
[0035] The second optional implementation method is that when the number of historical users responded by a server does not reach a certain scale, for example, a new regional market is opened, or a server in a certain region is added, since the historical users in the server have not yet accumulated to a certain number, the transfer probability calculated by the first optional implementation method is inevitably inaccurate. At this time, the Gaussian distribution satisfied by each element can be fitted according to the value of each element of the transfer matrix in other servers; multiple value combinations are extracted from each Gaussian distribution to obtain multiple transfer matrices; and the optimal transfer matrix is determined with the constraint that the sum of each row element and column element is equal to 1. This method takes into account the connection between the same matrix elements in different regions / servers through random effects on the basis of considering the differences between regions / servers. That is, although different regions / servers have different transfer probability values for each matrix element, the same transfer probability value of all regions / servers should satisfy a certain distribution. Optionally, the distribution can be a Gaussian distribution, and the above process can include the following steps: First, for each element t in the transfer matrix, ij , calculate the mean and mean square error of the element in all servers with a certain number of historical users, and use the mean and mean square error as the mean and mean square error of the Gaussian distribution to fit a Gaussian distribution. This is the element t in all regions / servers ij The Gaussian distribution should be satisfied. Get each matrix element t ij The corresponding Gaussian distribution G ij Then, from each Gaussian distribution G ij Each value is used as the matrix element t ijThe value of , thereby forming a transfer matrix; after multiple extractions, multiple transfer matrices can be formed. Since the sum of each row element and column element in the transfer matrix is equal to 1, and the randomly extracted value combination should not necessarily meet the constraint condition, the sum of each row element and the sum of the column element in each transfer matrix can be calculated, and these sum values are added and compared with 2×N (ideal case), and a transfer matrix closest to 2×N is selected, and the values of individual elements in the matrix are adjusted to make it the optimal matrix that meets the constraint condition. This adjustment method can ensure that the number of adjusted elements is as small as possible, and that each parameter value conforms to the natural law of Gaussian distribution as much as possible. Of course, the mean and variance of each Gaussian distribution can also be pre-set according to the overall law, and this embodiment does not make specific restrictions. With the continuous accumulation of user data, when the user data of the region / server reaches a certain scale, the first optional implementation method can be used to update the transfer matrix in the server. In general, the second optional implementation method takes into account the differences and connections between different regions or servers through random effects, and can determine the transfer matrix of regions or servers that have not yet formed a scale based on the historical user data of regions or servers with mature scale. Compared with simply determining the transition probability through a small amount of user data, it utilizes richer user prior information and can provide more accurate probability estimates.
[0036] After the transfer matrix is determined, the subdivision classification vector V of the previous product is used -1 By multiplying it with the transfer matrix T, we can get another subdivision classification vector Y of the current product. Each element in the vector represents the weight of the current product belonging to a certain subdivision classification predicted from the perspective of time correlation:
[0037]
[0038] For the sake of distinction and description, in this embodiment, the segmentation classification vector X predicted from the perspective of the product itself is called the first segmentation classification vector of the current product, and the segmentation classification vector Y predicted from the perspective of time correlation is called the second segmentation classification vector of the current product. The two vectors evaluate the segmentation classification and weights of the current product from different perspectives. In order to comprehensively consider the static attributes of the product itself and the dynamic association between products, this embodiment integrates the two. In a specific implementation, the second segmentation classification vector can be weighted according to the target user's stay time t on the previous product, and the weighted vector is added to the first segmentation classification vector to obtain the final segmentation classification vector of the current product, that is:
[0039]
[0040] The longer the target user stays on the previous product, the stronger the user's attention to the subdivision category to which the previous product belongs, and a heavier weight is assigned to the second subdivision category vector calculated for the previous product. Optionally, in order to ensure the consistency of data dimensions, the average stay time t0 of historical users on a single product can be determined based on the historical user browsing data used when calculating the matrix T, and the ratio of the stay time to t and t0 is used as a weighting coefficient to multiply the second subdivision category vector, and the above formula becomes:
[0041]
[0042] Under this weighting method, the default user's stay time on the current product is the average stay time t0. This can reflect the difference in user attention to the previous product and the current product. Optionally, the fusion weights of X and Y are also pre-set based on experience, which also falls within the scope of protection of this application. After weighted fusion, the weighted result is processed by softmax to obtain the final subdivision classification vector V0 of the current product: V0 = softmax(Z) = [v 01 ,v 02 ,…,v 0N ], each element v of the vector 0i (i=1,2,…N) corresponds to the i-th product sub-category, and the value of element v0 represents the weight of the current product belonging to the i-th sub-category.
[0043] S130. Predict the multiple subcategories and weights to which the current product ultimately belongs, and the time correlation between all the subcategories, to which the next product browsed by the user belongs; arrange and combine the multiple subcategories and weights to which the current product ultimately belongs with the multiple subcategories and weights to which the next product belongs, to form multiple category pairs, wherein each category pair includes a subcategories and weight to which the current product ultimately belongs, and a subcategories and weight to which the next product belongs.
[0044] This step firstly calculates the subdivision classification vector V0=[v 01 ,v 02 ,…,v 0N ] and the transfer matrix T, continue to predict the next commodity segmentation vector V1 = [v 11 ,v 12 ,…,v 1N ], optionally, according to the definition of the transfer matrix, V1 = V0 × T. Then, each weight v in V0 0i With each weight v in V1 1j and their corresponding subdivisions are arranged and combined to form multiple classification pairs, which are used as the processing objects for subsequent operations. ijInclude weight v 0i Corresponding subdivision classification, weight v 0i , and weight v 1j Corresponding subdivision classification, weight v 1j , wherein i, j = 1, 2, ..., N, i and j may be the same or different, and this embodiment does not impose any particular limitation.
[0045] S140. For two classification pairs with the same subdivision classification, a group of recommended products and their weights are determined according to the product similarity under the same subdivision classification and the two weights in the classification pair, wherein the classification information of the products is suppressed when calculating the product similarity; for two classification pairs with different subdivision classifications, the user similarity is calculated according to the subdivision classification corresponding to the next product, and another group of recommended products and their weights are determined according to the user similarity and the two weights in the classification pair, wherein the subdivision classification information of the products is strengthened when calculating the user similarity.
[0046] This embodiment adopts different commodity recommendation methods according to whether the subdivision classification of the next commodity is the same as or different from the subdivision classification of the current commodity. Specifically, if the subdivision classification of the next commodity is the same as that of the current commodity, it means that the user has a high degree of attention to the subdivision classification, and this information is fully utilized to recommend similar commodities under the classification; but since this situation itself limits the same subdivision classification, the classification information should be suppressed when calculating the commodity similarity, and the attributes of the commodity in other aspects should be highlighted. If the subdivision classification of the next commodity is different from that of the current commodity, it means that the user has a diverse demand for commodities, and commodities purchased by similar users can be recommended under the subdivision classification of the next commodity; similarly, since the method itself limits the subdivision classification of the next commodity, when selecting similar users, more attention should be paid to the similarity of users under the subdivision classification, so that the recommended commodities can better meet the attention interests of the target user under the subdivision classification, and avoid interference of users' high similarity in other aspects on commodity recommendation. For example, if the subdivision classification of the next commodity is yoga dance, other users who have similar interests with the target user in yoga dance should be found. If a user is very similar to the target user in decoration building materials, then his browsing behavior in yoga dance may not have a clear reference value for the target user.
[0047] Based on the above principles, this embodiment provides the following two optional implementations for each classification pair:
[0048] The first optional implementation method is to classify D ij If the two subdivision categories in the same, then according to the similarity of the products under the subdivision category and the two weights v in the category pair 0i and v 1j, determine multiple recommended products and their weights, wherein the classification information of the products is suppressed when calculating the similarity of the products. Optionally, the classification labels of the products can be used to extract multiple products (excluding the current product) belonging to the subdivided classification in the classification pair; then, from the information of each product and the current product, the major classification information and the subdivided classification information are removed; and the similarity S of each product and the current product is calculated based on the remaining information mn . For example, a product vector can be constructed based on the remaining information of the product. The vector has removed the components of the major classification information and the detailed classification information. The product similarity calculated based on the vector can better reflect the information differences of the products in other aspects, and avoid two products with the same classification but different other aspects still having a high similarity after calculation, which will interfere with the product recommendation. The specific product vector construction method is an existing technology and will not be repeated here. Based on the above similarity, S mn Multiple products with a similarity greater than the set threshold are used as multiple recommended products, and the weight of each recommended product is the product of each similarity and the two weights in the classification pair, that is, the weight of each recommended product is S mn ×v 0i ×v 1j , the weight includes the current product's subdivision category A i , the next product is classified as A j The weight v 0i ×v 1j , and in sub-category A j The weight S of recommending a similar product under mn , reflecting the complete product recommendation process.
[0049] After performing the above operation on each pair of categories with the same two sub-categories, each pair of categories will obtain multiple recommended products and their weights as described above, and all these recommended products can be taken as a union to form a group of recommended products. Optionally, if there is a product in the union corresponding to multiple weights, the multiple weights are added as the final weight of the product, or the largest weight among the multiple weights is taken as the final weight of the product.
[0050] The second optional implementation method is to classify D ij If the two subdivisions in are different, then first extract D ij The subdivision category A corresponding to the next product j , and then classify each user according to the segment A j relevance of the target user to the segment category A jThe correlation between each user and the target user under the subdivided classification is determined, thereby determining similar users. Optionally, the correlation can be determined by the historical interaction records between multiple users and multiple commodities, wherein the multiple users include the target user. In a specific embodiment, the interaction record includes a series of operation behaviors performed by the user on the browsed commodities when browsing commodities, such as searching for commodities on a web page, browsing commodities, clicking on commodity icons with a mouse to click on commodities for detailed viewing, collecting commodities, adding commodities to a shopping cart, purchasing commodities, commenting on commodities, rating commodities, forwarding or recommending commodity links, etc., and an interaction matrix between the multiple users and multiple commodities can be constructed based on these interaction information, wherein each row of the matrix corresponds to a user, each column corresponds to a commodity, and the matrix elements represent the interaction information between users and commodities. Since the matrix elements will have non-zero values only when the system only records the explicit feedback of users, the interaction matrix is a highly sparse matrix, and the collaborative filtering method can be used to deeply decompose the interaction matrix to obtain the latent vectors of each user and each commodity. Specifically, the matrix decomposition method decomposes the interaction matrix into smaller user feature matrices and product feature matrices. Each row in the user feature matrix corresponds to a low-dimensional latent vector e of a user. c (c=1,2,…,number of users), each column in the product feature matrix corresponds to a low-dimensional latent vector e of a product p (p=1,2,…,number of goods), and e c The column dimension of e p The row dimension of is the same as that of . The specific process of matrix decomposition is a prior art and will not be described here. After obtaining the latent vector, the correlation (e.g., preference) between each user and each product under the subdivided category can be calculated based on the latent vector of each user and the latent vector of each product under the subdivided category. For example, the latent vector (row vector) of any user and the latent vector of the subdivided category A can be calculated. j The product of the latent vector (column vector) of any product in the subdivision category is taken as the correlation between the user and the product. Then, the latent vectors of each product in the subdivision category can be combined into the latent vector of the subdivision category; and the correlation between each user and the subdivision category is calculated based on the latent vector of the subdivision category and the latent vector of each user. For example, subdivision category A j The latent vectors of all commodities are weighted averaged to obtain the subdivision classification A j The hidden vector of , where the weighted weight can be preset, or it can be used in the first subdivision of the product and the subdivision category A j Corresponding weights; then, calculate the latent vector (row vector) of any user and the segmentation category A jIn addition to using latent vectors to calculate correlation, we can also directly multiply the user feature matrix and the product feature matrix to obtain a full-rank interaction matrix, which includes the interaction data of each user for each product. j The average of all the interaction data of the products under the above conditions is calculated, or the interaction data of the first sub-category of each product with the sub-category A is calculated. j The corresponding weights are weighted and averaged to obtain the value of the user and the subdivision category A. j After determining the relevance between a user and a subdivision category based on any of the above methods, if a user is related to a subdivision category A j relevance to target users and segmentation A j If the correlation difference Δs is within a certain positive and negative interval [-S, S] (S>0), it is considered that the user and the target user are in the subdivision category A. j The correlation under is similar, and they can be regarded as similar users of the target user. According to the maximum value of |Δs| max|Δs| (corresponding to the user with the largest |Δs| of the target user), |Δs| is normalized to Will As the specific value of user similarity. In this way, the subdivision classification A j The importance of similar users in the selection of similar users is that only when the behavioral data of two users under this subdivision classification are similar, they are considered to be similar users required by this embodiment. It is worth mentioning that the similar users selected in this way include the target user itself. The essence of recommending products based on the similar users is to use the matrix decomposition method to complete the target user’s interaction data on all products to recommend products, and the value of the positive and negative intervals must satisfy the requirement that there are multiple similar users finally screened out, that is, not only the target user itself, but also other similar users, thereby expanding the scope of product recommendations. In addition, when the interaction matrix cannot be obtained, the traditional user portrait can also be used to determine similar users. As a supplement to the above method, the enhanced subdivision classification A can be ignored when using the user portrait method. j The weight can also be increased by adding user portrait tags and subdivision categories A j The proportion of related tags to enhance the subdivision classification A j The weight is not specifically limited in this embodiment.
[0051] Finally, the similarity between each similar user and the target user in the subdivision category is calculated. The correlation between each similar user and each product in the subdivision category Multiply them together, and use the products whose products rank in the top several places as multiple recommended products. The weight of each recommended product is the product of each product and the two weights in the classification pair, that is, the weight of the recommended product is The weight also includes the current product's subdivision category A i , the next product is classified as A j The weight v 0i ×v 1j , according to the subdivision classification A j The weight of similar users recommending products to the target user And the weight of recommending a product that similar users are interested in It reflects the complete product recommendation process. Optional, is the normalized correlation. During normalization, we can determine the correlation between any similar user and the subdivided category A. j The relevance of all products under c The maximum value max(f c ), using max(f c ) for f c Normalize to get At the same time, you can also only The above operation is performed on the products whose values are greater than the corresponding threshold (such as 0.01), and the remaining products can be skipped directly to improve data processing efficiency.
[0052] After performing the above operation on each classification pair with different subdivisions, each classification pair will obtain multiple recommended products and their weights as described above, and all these recommended products can be taken as a union to form another group of recommended products. Optionally, if there is a product in the union corresponding to multiple weights, the multiple weights are added as the final weight of the product, or the largest weight among the multiple weights is taken as the final weight of the product.
[0053] In addition, it can be seen from the weight calculation formula of each recommended product that when any weight (v 0i or v 1j ) is 0, the final recommended product weight is 0, so in S130, v 0i and v 1j The subdivision categories and weights that are all non-zero are arranged and combined, and the operations of the above two optional implementation modes are performed through S140, and the other v 0i and v 1j It can be skipped directly; it is also possible to remove v values less than a certain threshold (such as 0.01) in S130. 0i and v 1j , for the remaining v 0i 、v 1j The subdivision classifications and weights are arranged and combined, and the operations of the above two optional implementation modes are performed through S140 to improve processing efficiency.
[0054] S150: recommending the products ranked in the top several weights in the two groups of recommended products as the next products to be browsed by the target user.
[0055] This step selects the products that are finally displayed to the user from the above two groups of recommended products. Optionally, this process can also include the following two optional implementations:
[0056] In the first optional implementation, since the weight calculation paths of the two groups of recommended products are different, the range of weight values may be quite different (for example, one group has a weight of S mn ×v 0i ×v 1j , and the other set of weights is In extreme cases, the two may differ by an order of magnitude), but the weights of the same group of recommended products are comparable. You can compare the two groups of recommended products separately, and take the products with the highest weights in each group as the final recommended products. This method is conducive to taking into account the important role of the two categories in product recommendations and maintaining product diversity.
[0057] In the second optional implementation, although the weight calculation paths of the two groups of recommended products are different, if the weight values of the two groups of recommended products are distributed evenly or do not show obvious order of magnitude differences (for example, the positive and negative intervals [-S, S] used to determine similar users are small, In the example above, if there are more values distributed around 1, so that the two groups of weights are of the same magnitude, the weights of the two groups of recommended products can be compared together, and the products with the highest weights can be recommended to the target user's browsing page. This method pays more attention to the meaning of each weight representation, and the product recommendation process is finely divided according to the meaning of each weight.
[0058] The two optional methods in the above formula each have their own characteristics and can be flexibly selected according to needs in practical applications. This embodiment does not impose any specific restrictions.
[0059] Optionally, recommended products can be displayed at the bottom of the browsing page. When the target user clicks on the product to be browsed, or when the user pulls up the current product page, the method of this embodiment can be run to determine the next recommended product, and the recommended product can be displayed when the user pulls the current page to the bottom.
[0060] Furthermore, the main steps of S110-S150 can be executed once or multiple times in a loop. When a user clicks on a certain product from among many recommended products, the product becomes the new current product, and the subdivision classification vector V0 becomes the subdivision classification vector of the new previous product. Then, S110 can be returned to enter the next loop, and the new next product can be recommended based on the subdivision classification vector V0 of the new current product and the new previous product. It should be noted that the first subdivision classification vector of the product, the average residence time of the product page, the transfer matrix, the product similarity with subdivision classification information suppressed, the interaction matrix, the full-rank interaction matrix, and the correlation between each user and each product under the two interaction matrices, the correlation between each user and each subdivision classification, and the user similarity under each subdivision classification, etc., used in the above method, can be reused; some or all of them can be pre-calculated before executing one or more loops, and directly called in each loop, or stored after being calculated in one loop for continued use in subsequent loops. At the same time, if the calculation time of one cycle exceeds the average stay time of the user on a certain page, the number of cycles of this method can also be reduced to avoid affecting the user experience due to the time-consuming product recommendation. For example, after determining multiple recommended products through one cycle, these products can be displayed in batches in multiple subsequent product browsing pages, and then enter the next cycle after the display is completed. At this time, the subdivision classification vector of the previous product in S110 can be determined by the classification label queue and product description of the product (that is, the determination process of the first subdivision classification vector recorded in S120). When the amount of platform data is too large, in order to improve the recommendation efficiency, all product subdivisions, all products, all users, etc. of the product platform can also be managed in groups. Each time the method of this embodiment is run, it is only performed on a group of product categories, a group of products, and a group of users, thereby avoiding the time lag caused by processing massive data.
[0061] In summary, this embodiment provides a method for recommending products based on product subdivision classification, which conducts accurate product recommendations based on product subdivision classification, and is particularly suitable for situations where the same product may belong to multiple subdivision classifications. Specifically, after the user determines the current product, this method conducts a comprehensive and accurate evaluation of the subdivision classification and its weight to which the current product belongs from the perspective of the product itself (static attributes) and the product browsing chain (dynamic association), and uses the transfer matrix to continue to predict the subdivision classification and weight of the next product; then, according to whether the subdivision classification of the current product and the previous product is the same or different, different methods are used to recommend products, and when calculating product similarity and user similarity, the existing prior information is fully utilized, and the calculation component of the subdivision classification is particularly suppressed or enhanced, so that the recommended products can better match the browsing interests of users under specific subdivision classifications.
[0062] In particular, when determining the transfer matrix, this embodiment selects different historical user data to determine each transfer probability according to the response range of the server to reflect the differences in user habits in different regions or different servers. When the local user data of a server does not reach a certain scale, the Gaussian distribution of each probability value is fitted using the transfer probability data of other servers, so that the values of different regions or servers at the same probability meet the Gaussian distribution, which not only conforms to the natural law of parameter value selection, but also makes full use of the existing user data, which is conducive to improving the accuracy of probability estimation.
[0063] In addition, when determining user similarity, this embodiment uses the characteristic that the user latent vector and the product latent vector in matrix decomposition have the same dimension to calculate the correlation between each user and a specific subdivision classification, and then uses the correlation to determine similar users, thereby achieving the purpose of enhancing the subdivision classification component when calculating user similarity. Compared with traditional user similarity calculation, this embodiment can filter out features in user information that are irrelevant to the target subdivision classification, which is more conducive to capturing the user's interest tendency under a specific subdivision classification and improving the accuracy of product recommendations.
[0064] Figure 2 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention is shown in FIG. Figure 2 As shown, the device includes a processor 60, a memory 61, an input device 62 and an output device 63; the number of processors 60 in the device can be one or more. Figure 2 A processor 60 is taken as an example; the processor 60, the memory 61, the input device 62 and the output device 63 in the device can be connected by a bus or other means. Figure 2 The example of connecting through bus is taken in the following.
[0065] The memory 61 is a computer-readable storage medium that can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the commodity recommendation method based on commodity subdivision classification in the embodiment of the present invention. The processor 60 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 61, that is, realizing the above-mentioned commodity recommendation method based on commodity subdivision classification.
[0066] The memory 61 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 61 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 61 may further include a memory remotely arranged relative to the processor 60, and these remote memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0067] The input device 62 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the device. The output device 63 may include a display device such as a display screen.
[0068] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the commodity recommendation method based on commodity subdivision classification of any embodiment.
[0069] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, a device or a device or used in combination with it.
[0070] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0071] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0072] Computer program code for performing the operations of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as C or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0073] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the technical solutions of the embodiments of the present invention.
Claims
1. A commodity recommendation method based on commodity subdivision classification, characterized in that: include: Obtain the current product browsed by the target user, as well as multiple subcategories and weights of the previous product browsed by the target user; According to the classification label queue and product description of the current product, determine the multiple subcategories and weights to which the current product belongs; Determine the multiple sub-categories and weights to which the current product belongs based on the multiple sub-categories and weights to which the previous product belongs and the time correlation between all the sub-categories; The two sets of determination results are merged according to the target user's stay time on the previous product to obtain the multiple sub-categories and weights to which the current product ultimately belongs; Based on the multiple subcategories and weights to which the current product ultimately belongs, as well as the time correlation between all subcategories, predict the multiple subcategories and weights to which the next product that the user browses belongs; Arrange and combine the multiple sub-categories and weights to which the current product ultimately belongs with the multiple sub-categories and weights to which the next product belongs, respectively, to form multiple category pairs, wherein each category pair includes a sub-categories and weight to which the current product ultimately belongs, and a sub-categories and weight to which the next product belongs; For two classification pairs with the same subdivision classification, a group of recommended products and their weights are determined according to the similarity of products under the same subdivision classification and the two weights in the classification pair, wherein the classification information of the products is suppressed when calculating the product similarity; For two classification pairs with different subdivision classifications, the user similarity is calculated according to the subdivision classification corresponding to the next product, and another group of recommended products and their weights are determined according to the user similarity and the two weights in the classification pair, wherein the subdivision classification information of the products is strengthened when calculating the user similarity; The products with the highest weights in the two groups of recommended products are recommended as the next products to be browsed by the target user.
2. The method according to claim 1, characterized in that: The multiple subdivisions and weights to which the product belongs are represented as a subdivision vector of the product, where the vector has all subdivisions as dimensions, and the vector elements are the weights of the product belonging to the corresponding subdivisions; The step of determining the multiple subcategories and weights to which the current product belongs based on the category label queue and product description of the current product includes: Using all subdivision categories as dimensions, construct an all-0 subdivision category vector for the current product browsed by the target user; Traverse the classification label queue of the current product. If the current classification label is a detailed classification, add 1 to the vector element corresponding to the detailed classification and other non-0 vector elements; if the current classification label is a large category, add 1 to the vector elements and other non-0 vector elements corresponding to all detailed classifications under the large category; the earlier the classification label is in the queue, the more universal its description of the product is; Segment the name and description of the current product. If a synonym of a subdivided classification appears in each segmented word, add 1 to the vector element corresponding to the subdivided classification. If a synonym of a large classification appears in each segmented word, add 1 to the vector elements corresponding to all subdivided classifications under the large classification. Normalize each vector element to obtain the first subdivision classification vector of the current product.
3. The method according to claim 1, characterized in that The multiple subdivisions and weights to which the product belongs are represented as a subdivision vector of the product, where the vector has all subdivisions as dimensions, and the vector elements are the weights of the product belonging to the corresponding subdivisions; The temporal correlation between all subdivisions is expressed as a transfer matrix, wherein all subdivisions are rows and columns, and the matrix elements are the probabilities of transferring from the subdivision commodity in the row to the subdivision commodity in the column; Accordingly, the determining of the multiple subdivision categories and weights to which the current commodity belongs according to the classification label queue and the commodity description of the current commodity includes: determining a first subdivision classification vector of the current commodity according to the classification label queue and the commodity description of the current commodity; Determining the multiple subdivision categories and weights to which the current product belongs based on the multiple subdivision categories and weights to which the previous product belongs and the time correlation between all the subdivision categories includes: multiplying the subdivision category vector of the previous product by the transfer matrix to obtain a second subdivision category vector of the current product; The two groups of determination results are merged according to the target user's stay time at the previous product to obtain multiple subdivision categories and weights to which the current product ultimately belongs, including: weighting the second subdivision category vector according to the target user's stay time at the previous product, adding the weighted vector to the first subdivision category vector, and obtaining the final subdivision category vector of the current product.
4. The method according to claim 3, characterized in that Before the subdividing classification vector of the previous commodity is multiplied by the transfer matrix to determine the second subdividing classification vector of the current commodity, the method further includes: Based on historical user browsing data, the probability of users transferring from products in each sub-category in all sub-categories to products in other sub-categories is determined, and a transfer matrix is constructed with each probability as an element.
5. The method according to claim 4, characterized in that User access in different regions is responded to by different servers, corresponding to different transfer matrices; The method determines the probability of users transferring from commodities in each subdivision category to commodities in other subdivision categories according to the historical browsing data of users, and constructs a transfer matrix with each probability as an element, including: When the number of historical users responded by a server reaches a certain scale, the probability of users transferring from commodities in each subdivision category to commodities in other subdivision categories in all subdivision categories is determined based on the browsing data of historical users, and a transfer matrix of the server is constructed with each probability as an element; When the number of historical users responded by a server does not reach a certain scale, the Gaussian distributions satisfied by each element are fitted according to the values of each element of the transfer matrix in other servers; multiple value combinations are extracted from each Gaussian distribution to obtain multiple transfer matrices; and the optimal transfer matrix is determined with the constraint that the sum of each row element and column element is equal to 1.
6. The method according to claim 1, characterized in that For two classification pairs with the same subdivision classification, determining a group of recommended products and their weights according to the similarity of products under the same subdivision classification and two weights in the classification pair, wherein the classification information of the products is suppressed when calculating the similarity of the products, comprises: For each pair of categories where the two subdivision categories are the same, perform the following operations: S1-1, extracting each product belonging to a sub-category in the current category pair according to the category label of the product; S1-2. Remove the major classification information and the sub-classification information from the information of each product and the current product; S1-3, calculating the similarity between each product and the current product based on the remaining information; S1-4, taking multiple commodities with similarities greater than a set threshold as multiple recommended commodities, and taking the product of each similarity and the two weights in the classification pair as the weight of each recommended commodity; The plurality of recommended products obtained for each category are combined to form a group of recommended products.
7. The method according to claim 1, characterized in that For two classification pairs with different subdivisions, the user similarity is calculated according to the subdivision corresponding to the next product, and another group of recommended products and their weights are determined according to the user similarity and two weights in the classification pair, wherein the subdivision information of the product is strengthened when calculating the user similarity, including: For each pair of categories with different subdivision categories, perform the following operations: S2-1, extracting the sub-category corresponding to the next commodity in the current category pair; S2-2, determining the similarity between each user and the target user under the subdivided classification according to the relevance between each user and the subdivided classification, and the relevance between the target user and the subdivided classification; S2-3, multiplying the similarity between each user and the target user in the subdivided classification with the relevance between each user and each product in the subdivided classification, taking a plurality of products whose products rank first as a plurality of recommended products, and taking the product of each product and the two weights in the classification pair as the weight of each recommended product; The plurality of recommended products obtained for each category are combined to form another group of recommended products.
8. The method according to claim 7, characterized in that Before determining the similarity between each user and the target user under the segmented classification according to the correlation between each user and the segmented classification and the correlation between the target user and the segmented classification, the method includes: constructing an interaction matrix between a plurality of users and a plurality of commodities according to historical interaction records between the plurality of users and the plurality of commodities, wherein the plurality of users include a target user; The interaction matrix is deeply decomposed by using collaborative filtering method to obtain latent vectors of each user and each product; Calculate the correlation between each user and each commodity under the subdivided category according to the latent vector of each user and the latent vector of each commodity under the subdivided category; The latent vectors of the commodities under the subdivided classification are synthesized into the latent vector of the subdivided classification; and the correlation between each user and the subdivided classification is calculated according to the latent vector of the subdivided classification and the latent vector of each user.
9. An electronic device, characterized in that: include: one or more processors; a memory 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 commodity recommendation method based on commodity subdivision classification as described in any one of claims 1-8.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the program is executed by a processor, the method for recommending commodities based on commodity subdivision classification as described in any one of claims 1 to 8 is implemented.