A commodity recommendation method and system based on user relationship
By building a user relationship estimation model based on LightGBM and using historical transaction data between users and merchants to recommend products, the problem of ignoring the trust relationship between users and merchants in the existing technology is solved, and the accuracy of product recommendations and merchant profits are improved.
Patent Information
- Application Number
- CN202311074555.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-24
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2043-08-24
AI Technical Summary
Existing product recommendation service solutions mainly consider the relationship between users and users and users and products, but ignore the trust relationship between users and merchants, resulting in limited accuracy of recommendation services and limited merchant income.
By obtaining the historical transaction mutual evaluation record data between users and merchants, extracting positive, negative and neutral discourse words, building a LightGBM machine learning model, estimating user relationship tags, and recommending matching products based on tags, improving the accuracy of recommendation services and merchants income.
It realizes strategic product recommendation based on the trust relationship between users and merchants, improves the accuracy of product recommendation services and total merchant revenue, helps merchants maintain customer sentiment, and improves merchant stickiness.
Smart Images

Figure CN117114807B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of e-commerce, and in particular relates to a commodity recommendation method and system based on user relationships. Background Art
[0002] With the advent of the Internet era, people's living habits and shopping habits have also changed, and more and more consumers have begun to shop and consume online. With the development and application of e-commerce, and in order to facilitate merchants to make targeted recommendations to different users, many e-commerce companies have developed product recommendation service solutions based on big data analysis.
[0003] At present, the existing product recommendation service solutions mainly make statistical analysis on the purchase and browsing behaviors of the current user or other users who have intersections with the current user, and make product recommendations based on the analysis results. Since this product recommendation service solution mainly considers the relationship between users and / or the relationship between users and products, and ignores the trust relationship between users and merchants, the existing product recommendation service solutions are still at the tactical level. How to make strategic product recommendations based on the trust relationship between users and merchants, so as to improve the accuracy of product recommendation services and the total revenue of merchants, and then help merchants maintain customer relationships and improve the merchant stickiness of product recommendation service software, is a topic that technicians in this field urgently need to study. Summary of the invention
[0004] The purpose of the present invention is to provide a product recommendation method, system, computer device and computer-readable storage medium based on user relationships, so as to solve the problem that the existing product recommendation service solutions are still at the tactical level, resulting in limited accuracy of the product recommendation service, limited help in maintaining customer relationships for merchants, and limited total revenue for merchants.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions:
[0006] In a first aspect, a method for recommending products based on user relationships is provided, comprising:
[0007] Obtain historical transaction mutual evaluation record data and user relationship labels for multiple pairs of sample transaction parties in a historical unit period, wherein the sample transaction parties refer to sample users and sample merchants who have commodity transaction behaviors, and the user relationship labels are used to reflect the level of trust relationship between users and merchants, and are divided into no relationship, micro relationship, weak relationship, strong relationship and super strong relationship from shallow to deep;
[0008] For each pair of sample transaction parties in the plurality of sample transaction parties, extract a plurality of corresponding sample feature words from the corresponding historical transaction mutual evaluation record data, wherein the sample feature words include positive discourse words that are conducive to enhancing the trust relationship, negative discourse words that cause the trust relationship to decline, and neutral words;
[0009] Apply the multiple sample feature words of each pair of sample transaction parties and the user relationship labels to classify and train the LightGBM-based machine learning model to obtain a user relationship estimation model;
[0010] Acquire the recent transaction mutual evaluation record data of the target transaction parties in the recent unit period, wherein the target transaction parties refer to the target user and the target merchant of the commodity transaction to be carried out;
[0011] Extracting multiple target feature words of the target transaction parties from the recent transaction mutual evaluation record data, wherein the multiple target feature words have the same number of words as the multiple sample feature words, and the target feature words also include positive discourse words that are conducive to improving the trust relationship, negative discourse words that cause the trust relationship to decline, and neutral words;
[0012] Input the multiple target feature words of the target transaction parties into the user relationship estimation model, and output the user relationship labels of the target transaction parties in the most recent unit period or the probabilities of each user relationship label, wherein each user relationship label refers to the no relationship, the micro relationship, the weak relationship, the strong relationship, and the super strong relationship;
[0013] According to the user relationship tags of the target transaction parties in the most recent unit period or the probabilities of the user relationship tags, the target merchant is instructed to recommend matching commodities to the target user.
[0014] Based on the above invention content, a new scheme for training a user relationship estimation model based on historical transaction mutual evaluation record data and applying it to recommend products is provided, that is, after obtaining the historical transaction mutual evaluation record data and user relationship labels of multiple pairs of sample transaction parties, for each pair of sample transaction parties, corresponding multiple sample feature words are extracted from the corresponding historical transaction mutual evaluation record data, and then the multiple sample feature words of each pair of sample transaction parties and the user relationship labels are applied to classify and train a machine learning model based on LightGBM, so as to obtain a user relationship estimation model, and then multiple target feature words of the target transaction parties are input into the user relationship estimation model, so as to output the user relationship labels of the target transaction parties or the probabilities on each user relationship label, and finally, according to the output result, the target merchant is instructed to recommend matching products to the target user, so that strategic product recommendations can be made based on the trust relationship between the user and the merchant, thereby improving the accuracy of the product recommendation service and the total revenue of the merchant, thereby helping the merchant to maintain customer relations, and improving the merchant stickiness of the product recommendation service software, which is convenient for practical application and promotion.
[0015] In a possible design, for each pair of sample transaction parties among the plurality of sample transaction parties, a plurality of corresponding sample feature words are extracted from the corresponding historical transaction mutual evaluation record data, including:
[0016] For each pair of sample transaction parties among the plurality of sample transaction parties, convert the corresponding historical transaction mutual evaluation record data into text and perform word segmentation processing to obtain a corresponding historical word set;
[0017] For each pair of sample transaction parties, positive discourse words that are conducive to improving the trust relationship, negative discourse words that cause the trust relationship to decline, and neutral words are extracted from the corresponding historical discourse word set to obtain a corresponding historical discourse word set;
[0018] According to all the historical discourse word sets, the word frequency of each discourse word in the first discourse word total set in each of the historical discourse word sets is calculated using a word frequency-inverse document frequency TF-IDF statistical algorithm, wherein the first discourse word total set includes all discourse words in all of the historical discourse word sets;
[0019] The following method is adopted to select multiple sample feature words for each pair of sample transaction parties respectively: first, for each discourse word category, the first Round (w×M) discourse words belonging to the corresponding category and sorted in descending order according to the word frequency of the sample transaction parties are selected from the first discourse word total set as the corresponding selected feature words, and then the selected feature words of each discourse word category are summarized to obtain the multiple sample feature words, wherein the discourse word category includes positive discourse word category, negative discourse word type and neutral word type, the word frequency of the sample transaction parties refers to the word frequency of the discourse words in the historical discourse word set corresponding to the sample transaction parties, w represents the proportion of the discourse words of the corresponding category in the total discourse word set, M represents the total number of feature words selected, and Round() represents the rounding function.
[0020] In a possible design, multiple target feature words of the target transaction parties are extracted from the recent transaction mutual evaluation record data, including:
[0021] Convert the recent transaction review record data into text and perform word segmentation processing to obtain a recent word set;
[0022] Extracting positive discourse words that are conducive to improving the trust relationship, negative discourse words that cause the trust relationship to decrease, and neutral words from the recent discourse word set to obtain a recent discourse word set;
[0023] According to the recent utterance word set and all the historical utterance word sets, the word frequency of each utterance word in the second utterance word set in the recent utterance word set and each of the historical utterance word sets is calculated using a word frequency-inverse document frequency TF-IDF statistical algorithm, wherein the second utterance word set includes all the utterance words in the recent utterance word set and all of the historical utterance word sets;
[0024] The following method is used to select multiple target feature words for the target transaction parties: first, for each discourse word category, the first Round (w×M) discourse words belonging to the corresponding category and sorted in descending order according to the word frequency of the target transaction parties are selected from the second discourse word total set as corresponding selected feature words, and then the selected feature words of each discourse word category are summarized to obtain the multiple target feature words, wherein the word frequency of the target transaction parties refers to the word frequency of the discourse words in the most recent discourse word set corresponding to the target transaction parties.
[0025] In one possible design, during the classification training process of the machine learning model, a tree-structured Bayesian optimization algorithm is used to tune the model parameters.
[0026] In a possible design, according to the user relationship tags of the target transaction parties in the most recent unit period, instructing the target merchant to recommend matching commodities to the target user includes:
[0027] Determine a corresponding preset product recommendation strategy for the user relationship tags of the target transaction parties in the most recent unit period;
[0028] Instruct the target merchant to recommend commodities that meet the preset commodity recommendation strategy to the target user.
[0029] In a possible design, the corresponding preset product recommendation strategy is determined for the user relationship tags of the target transaction parties in the most recent unit period, including:
[0030] When the user relationship label of the target transaction parties in the most recent unit period is no relationship, determining that the preset product recommendation strategy corresponding to no relationship is to recommend the current hot-selling product;
[0031] When the user relationship label of the target transaction parties in the most recent unit period is a micro-relationship, determining that the preset product recommendation strategy corresponding to the micro-relationship is to recommend a gross profit product similar to the purchased product;
[0032] When the user relationship label of the target transaction parties in the most recent unit period is a weak relationship, determining the preset product recommendation strategy corresponding to the weak relationship to recommend image products similar to the purchased products;
[0033] When the user relationship label of the target transaction parties in the most recent unit period is a strong relationship, determining that the preset commodity recommendation strategy corresponding to the strong relationship is to recommend common commodities similar to the purchased commodities;
[0034] When the user relationship label of the target transaction parties in the most recent unit period is a super strong relationship, the preset product recommendation strategy corresponding to the super strong relationship is determined to recommend newly launched products similar to purchased products.
[0035] In a possible design, according to the probability of the target transaction parties in the most recent unit period and on each user relationship tag, instructing the target merchant to recommend matching commodities to the target user includes:
[0036] For each user relationship tag, a corresponding preset product recommendation strategy is determined, and the target merchant is instructed to recommend products that meet the preset product recommendation strategy to the target user. Products, including , Indicates the total number of recommended products. represents the probability of the target transaction parties being on the corresponding label in the most recent unit period, Represents the rounding function.
[0037] In the second aspect, a product recommendation system based on user relationships is provided, which includes a mutual evaluation data acquisition module, a feature word extraction module, a model training module, a user relationship estimation module and a product recommendation indication module;
[0038] The mutual evaluation data acquisition module is used to acquire historical transaction mutual evaluation record data and user relationship labels of multiple pairs of sample transaction parties in historical unit periods, and is also used to acquire recent transaction mutual evaluation record data of target transaction parties in recent unit periods, wherein the sample transaction parties refer to sample users and sample merchants who have commodity transaction behaviors, and the target transaction parties refer to target users and target merchants who are about to have commodity transaction behaviors. The user relationship label is used to reflect the level of trust relationship between users and merchants, and is divided into whether there is a relationship, micro relationship, weak relationship, strong relationship and super strong relationship from shallow to deep;
[0039] The feature word extraction module is communicatively connected to the mutual evaluation data acquisition module, and is used to extract a corresponding plurality of sample feature words from the corresponding historical transaction mutual evaluation record data for each pair of sample transaction parties among the plurality of sample transaction parties, and is also used to extract a plurality of target feature words of the target transaction parties from the most recent transaction mutual evaluation record data, wherein the sample feature words include positive discourse words that are conducive to improving the trust relationship, negative discourse words that cause the trust relationship to decline, and neutral words, and the plurality of target feature words have the same number of words as the plurality of sample feature words, and the target feature words also include positive discourse words that are conducive to improving the trust relationship, negative discourse words that cause the trust relationship to decline, and neutral words;
[0040] The model training module is communicatively connected to the feature word extraction module, and is used to apply the multiple sample feature words of each pair of sample transaction parties and the user relationship labels to classify and train the LightGBM-based machine learning model to obtain a user relationship estimation model;
[0041] The user relationship estimation module is respectively connected to the feature word extraction module and the model training module for inputting the multiple target feature words of the target transaction parties into the user relationship estimation model, and outputting the user relationship labels of the target transaction parties in the most recent unit period or the probabilities of each user relationship label, wherein each user relationship label refers to the no relationship, the micro relationship, the weak relationship, the strong relationship and the super strong relationship;
[0042] The commodity recommendation instruction module is communicatively connected to the user relationship estimation module, and is used to instruct the target merchant to recommend matching commodities to the target user based on the user relationship tags of the target transaction parties in the most recent unit period or the probabilities of the user relationship tags.
[0043] In a third aspect, the present invention provides a computer device comprising a memory, a processor and a transceiver which are communicatively connected in sequence, wherein the memory is used to store a computer program, the transceiver is used to send and receive messages, and the processor is used to read the computer program to execute the product recommendation method as described in the first aspect or any possible design of the first aspect.
[0044] In a fourth aspect, the present invention provides a computer-readable storage medium having instructions stored thereon, which, when executed on a computer, executes the product recommendation method as described in the first aspect or any possible design of the first aspect.
[0045] In a fifth aspect, the present invention provides a computer program product comprising instructions, which, when executed on a computer, causes the computer to execute the product recommendation method as described in the first aspect or any possible design of the first aspect.
[0046] Beneficial effects of the above scheme:
[0047] (1) The present invention creatively provides a new solution for training a user relationship estimation model based on historical transaction mutual evaluation record data and applying it to recommend products. That is, after obtaining the historical transaction mutual evaluation record data and user relationship labels of multiple pairs of sample transaction parties, a corresponding plurality of sample feature words are extracted from the corresponding historical transaction mutual evaluation record data for each pair of sample transaction parties, and then the plurality of sample feature words of each pair of sample transaction parties and the user relationship labels are used to perform classification training on a machine learning model based on LightGBM, so as to obtain a user relationship estimation model. Then, a plurality of target feature words of the target transaction parties are input into the user relationship estimation model, so as to output the user relationship labels of the target transaction parties or the probabilities on each user relationship label. Finally, according to the output result, the target merchant is instructed to recommend matching products to the target user. In this way, strategic product recommendations can be made based on the trust relationship between the user and the merchant, thereby improving the accuracy of the product recommendation service and the total revenue of the merchant, thereby helping the merchant to maintain customer relationships and improve the merchant stickiness of the product recommendation service software, so as to facilitate practical application and promotion. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0049] Figure 1 A flowchart of a method for recommending products based on user relationships provided in an embodiment of the present application.
[0050] Figure 2 A schematic diagram of the structure of a device for recommending products based on user relationships provided in an embodiment of the present application.
[0051] Figure 3 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the present invention will be briefly introduced below in combination with the drawings and the description of the embodiments or the prior art. Obviously, the following description of the structure of the drawings is only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. It should be noted that the description of these embodiments is used to help understand the present invention, but does not constitute a limitation of the present invention.
[0053] It should be understood that although the terms first and second, etc. may be used herein to describe various objects, these objects should not be limited by these terms. These terms are only used to distinguish one object from another object. For example, a first object can be referred to as a second object, and similarly, a second object can be referred to as a first object without departing from the scope of the exemplary embodiments of the present invention.
[0054] It should be understood that the term "and / or" that may appear in this article is merely a description of the association relationship of associated objects, indicating that there may be three relationships. For example, A and / or B can indicate three situations: A exists alone, B exists alone, or A and B exist at the same time. For another example, A, B and / or C can indicate the existence of any one of A, B and C or any combination of them. The term " / and" that may appear in this article describes another type of association object relationship, indicating that there may be two relationships. For example, A / and B can indicate two situations: A exists alone or A and B exist at the same time. In addition, the character " / " that may appear in this article generally indicates that the previous and next associated objects are in an "or" relationship.
[0055] Example:
[0056] like Figure 1 As shown, the commodity recommendation method based on user relationships provided in the first aspect of this embodiment can be, but is not limited to, executed by a computer device with certain computing resources, such as a platform server, a personal computer (PC, which refers to a multi-purpose computer with a size, price and performance suitable for personal use; desktops, laptops, small laptops, tablets and ultrabooks are all personal computers), smart phones, personal digital assistants (PDA) or wearable devices. Figure 1 As shown, the product recommendation method may include but is not limited to the following steps S1 to S7.
[0057] S1. Obtain historical transaction mutual evaluation record data and user relationship labels for multiple pairs of sample transaction parties in a historical unit period, wherein the sample transaction parties refer to sample users and sample merchants who engage in commodity trading activities, and the user relationship labels are used to reflect the level of trust relationship between users and merchants, and are divided into labels such as whether there is a relationship, micro relationship, weak relationship, strong relationship and super strong relationship from shallow to deep.
[0058] In step S1, the unit period may be specifically but not limited to a single week, two weeks, a single month or a single quarter. The historical transaction mutual evaluation record data may include but not limited to ratings and / or evaluation texts, and may be specifically but not limited to automatically collected through an e-commerce software APP (of course, these data also require the authorization of both parties to the sample transaction). The no relationship, the micro relationship, the weak relationship, the strong relationship and the super strong relationship are the result of a five-level division based on the degree of intimacy of the trust relationship between the user and the merchant.
[0059] S2. For each pair of sample transaction parties among the multiple pairs of sample transaction parties, extract a corresponding plurality of sample feature words from the corresponding historical transaction mutual evaluation record data, wherein the sample feature words include but are not limited to positive discourse words that are conducive to enhancing the trust relationship and negative discourse words that cause the trust relationship to decline.
[0060] In step S2, the positive words and negative words are used to reflect the characteristics of the attitude and tone of the user and / or merchant in the mutual evaluation; for example, the positive words may be, but not limited to, words such as thanks, recognition and praise, and the negative words may be, but not limited to, words such as ignore, ridicule and anger. Specifically, for each pair of sample transaction parties in the multiple pairs of sample transaction parties, extract a corresponding plurality of sample feature words from the corresponding historical transaction mutual evaluation record data, including but not limited to the following steps S21 to S24.
[0061] S21. For each pair of sample transaction parties among the plurality of sample transaction parties, convert the corresponding historical transaction mutual evaluation record data into text and perform word segmentation processing to obtain a corresponding historical word set.
[0062] In the step S21, the specific means of text conversion and word segmentation processing are existing technical means, such as converting the rating into the corresponding default evaluation text, and the word segmentation processing can be but not limited to using the jieba word segmentation tool.
[0063] S22. For each pair of sample transaction parties, positive discourse words that are conducive to enhancing the trust relationship, negative discourse words that cause the trust relationship to decline, and neutral words are extracted from the corresponding historical discourse word set to obtain a corresponding historical discourse word set.
[0064] In step S22, the specific means of word extraction are existing technical means, such as extracting positive discourse words belonging to the positive discourse dictionary from a historical word set according to a preset positive discourse dictionary, and extracting negative discourse words belonging to the negative discourse dictionary from a historical word set according to a preset negative discourse dictionary, and so on.
[0065] S23. Based on all the historical discourse word sets, the word frequency-inverse document frequency TF-IDF statistical algorithm is used to calculate the word frequency of each discourse word in the first total discourse word set in each of the historical discourse word sets, wherein the first total discourse word set includes all the discourse words in all the historical discourse word sets.
[0066] In the step S23, the term frequency-inverse document frequency TF-IDF (Term Frequency-Inverse Document Frequency) statistical algorithm is an existing algorithm.
[0067] S24. Select multiple sample feature words for each pair of sample transaction parties respectively in the following manner: first, for each discourse word category, select the first Round (w×M) discourse words belonging to the corresponding category and sorted in descending order according to the word frequency of the sample transaction parties from the first total discourse word set as the corresponding selected feature words, and then summarize the selected feature words of each discourse word category to obtain the multiple sample feature words, wherein the discourse word category includes positive discourse word category, negative discourse word type and neutral word type, the word frequency of the sample transaction parties refers to the word frequency of the discourse words in the historical discourse word set corresponding to the sample transaction parties, w represents the proportion of the discourse words of the corresponding category in the total discourse word set, M represents the total number of feature words selected, and Round() represents the rounding function.
[0068] In the step S24, for example, if the discourse words of the positive discourse word category account for 45% of the first total discourse word set, and the discourse words of the negative discourse word type account for 55% of the first total discourse word set, and there is a total number of feature words selected M=100, and there is a historical discourse word set A corresponding to the sample transaction party A, then for the positive discourse word category, the first 45 discourse words belonging to the corresponding category and sorted from high to low according to the word frequency of the sample transaction parties (that is, the word frequency of the discourse words in the historical discourse word set A) can be selected from the first total discourse word set as the corresponding selected feature words; for the negative discourse word type, the first 55 discourse words belonging to the corresponding category and sorted from high to low according to the word frequency of the sample transaction parties can be selected from the first total discourse word set as the corresponding selected feature words. Finally, the first 45 utterance words and the first 55 utterance words are summed up to obtain the multiple sample feature words of the sample transaction party A (i.e., 100 utterance words, ignoring the overlap of utterance words at this time). The aforementioned weight-based feature word selection method can avoid the following problems existing in the traditional selection method (i.e., directly selecting the first M feature words sorted in descending order of word frequency): when the data set is unbalanced, more feature words may be selected from the majority class of the word set, making the minority class underrepresented in the feature matrix returned based on TF-IDF.
[0069] S3. Apply the multiple sample feature words of each pair of sample transaction parties and the user relationship labels to perform classification training on the LightGBM-based machine learning model to obtain a user relationship estimation model.
[0070] In step S3, the LightGBM (Light Gradient Boosting Machine) is a framework for implementing the GBDT (Gradient Boosting Decision Tree) algorithm, which can support efficient parallel training, and has the advantages of faster training speed, lower memory consumption, better accuracy, support for distribution and rapid processing of massive data, so the machine learning model can be built based on existing knowledge. At the same time, since the multiple sample feature words of each pair of sample transaction parties can constitute a 2×M feature matrix to serve as model input data, and the user relationship labels of each sample transaction party can constitute a 1×1 verification matrix to serve as model output data, the user relationship estimation model can be obtained through conventional classification training methods. Preferably, in the classification training process of the machine learning model, the model parameters can be tuned by using, but not limited to, a Bayesian optimization algorithm based on a tree structure.
[0071] S4. Obtain the recent transaction mutual evaluation record data between the target transaction parties in the recent unit period, wherein the target transaction parties refer to the target user and the target merchant in which the commodity transaction behavior is to take place.
[0072] In step S4, the specific content of the recent transaction mutual evaluation record data is consistent with the historical transaction mutual evaluation record data, that is, it may also include but is not limited to the content such as ratings and / or evaluation texts; the recent transaction mutual evaluation record data can be uploaded by the target merchant among the target transaction parties, and can also be automatically collected through the e-commerce software APP (of course, these data also need to be authorized for use by the target transaction parties).
[0073] S5. Extract multiple target feature words of the target transaction parties from the recent transaction mutual evaluation record data, wherein the multiple target feature words have the same number of words as the multiple sample feature words, and the target feature words also include but are not limited to positive discourse words that are conducive to enhancing trust relationships and negative discourse words that cause trust relationships to decline.
[0074] In the step S5, referring to the aforementioned steps S21 to S24, specifically, multiple target feature words of the target transaction parties are extracted from the recent transaction mutual evaluation record data, including but not limited to the following steps S51 to S54: S51. Convert the recent transaction mutual evaluation record data into text and perform word segmentation processing to obtain a recent word set; S52. Extract positive discourse words that are conducive to improving trust relationships, negative discourse words that cause trust relationships to decline, and neutral words from the recent word set to obtain a recent discourse word set; S53. According to the recent discourse word set and all the historical discourse word sets, use the word frequency-inverse document frequency TF-IDF statistical algorithm to calculate the individual discourse words in the second discourse word total set in the recent discourse word set. A word set and the word frequency in each of the historical discourse word sets, wherein the second total discourse word set includes all discourse words in the recent discourse word set and all of the historical discourse word sets; S54. Select multiple target feature words for the target transaction parties in the following manner: first, for each discourse word category, select the first Round (w×M) discourse words belonging to the corresponding category from the second total discourse word set and sorted in descending order according to the word frequency of the target transaction parties as corresponding selected feature words, and then summarize the selected feature words of each discourse word category to obtain the multiple target feature words, wherein the word frequency of the target transaction parties refers to the word frequency of the discourse words in the recent discourse word set corresponding to the target transaction parties.
[0075] S6. Input the multiple target feature words of the target transaction parties into the user relationship estimation model, and output the user relationship labels of the target transaction parties in the most recent unit period or the probabilities of each user relationship label, wherein each user relationship label refers to the no relationship, the micro relationship, the weak relationship, the strong relationship and the super strong relationship.
[0076] S7. Instruct the target merchant to recommend matching merchandise to the target user based on the user relationship tags of the target transaction parties in the most recent unit period or the probabilities of the user relationship tags.
[0077] In the step S7, specifically, based on the user relationship tags of the target transaction parties in the most recent unit period, the target merchant is instructed to recommend matching products to the target user, including but not limited to: first determining a corresponding preset product recommendation strategy for the user relationship tags of the target transaction parties in the most recent unit period; and then instructing the target merchant to recommend products that meet the preset product recommendation strategy to the target user. The preset product recommendation strategy can be pre-formulated based on knowledge of economics, psychology, and interpersonal communication. For example, when the merchant and the user do not know each other, let alone understand each other, they have no relationship, which is the first level of trust relationship: no relationship; the key to upgrading from no relationship to micro relationship is the short, flat and fast transaction of goods, that is, micro relationship is for convenience, does not pay attention to brand loyalty, is a transaction behavior that tends to be cost-effective, and the goods are highly substitutable. Therefore, when merchants design hot products, they usually take low-profit behaviors in order to capture more new users. At this time, the hot product is assuming the function of facilitating the first transaction and upgrading the unrelated users to micro-relationship users. In this way, when the user relationship label of the target transaction parties in the most recent unit period is no relationship, it can be preferably determined that the preset product recommendation strategy corresponding to the no relationship is to recommend the drainage products that are currently hot products. For example, a micro-relationship means that a user may have bought a certain product but did not notice which brand it was or which company it belonged to. The difference between a weak relationship and a micro-relationship lies in repeat purchases, which are the starting point of a weak relationship. When a user has repeat purchases, it is considered that he has entered the stage of weak relationship with the company (the number "three" should be emphasized here. Buying once or twice may be accidental and coincidental. Only when buying the same product more than three times is it considered a true repeat purchase). In this way, when the user relationship label of the target transaction parties in the most recent unit period is a micro-relationship, it can be preferably determined that the preset product recommendation strategy corresponding to the micro-relationship is to recommend gross-profit products similar to purchased products. For another example, in the weak relationship stage, although users have trust in merchants, it is not high (or, weak relationship users are not so loyal to a single brand). At this time, although users begin to have brand awareness when choosing products, pay attention to and understand merchants, and accept brand stories, it does not mean that users only accept one brand in a certain category of products. Weak relationship users may accept multiple brands at the same time and switch them at will according to their mood, venue and activity. In this way, when the user relationship label of the target transaction parties in the most recent unit period is a weak relationship, it can be preferred to determine that the preset product recommendation strategy corresponding to the weak relationship is to recommend image products similar to the purchased products.Similarly, when the user relationship label of the target transaction parties in the most recent unit period is a strong relationship, the preset product recommendation strategy corresponding to the strong relationship can be preferably determined to recommend ordinary products similar to the purchased products; when the user relationship label of the target transaction parties in the most recent unit period is a super strong relationship, the preset product recommendation strategy corresponding to the super strong relationship can be preferably determined to recommend newly launched products similar to the purchased products. In addition, the aforementioned traffic-generating products, gross-profit products, and image products, as special sale products, together with the ordinary products (i.e., non-special sale products), build the merchant's product structure pyramid, among which the traffic-generating products are responsible for bringing in traffic, the gross-profit products are responsible for contributing profits, and the image products are responsible for raising the image. These three special sale products each play different roles and complete different tasks.
[0078] In step S7, specifically, according to the probability of the target transaction parties in the most recent unit period and on each user relationship tag, instructing the target merchant to recommend matching products to the target user, including but not limited to: determining a corresponding preset product recommendation strategy for each user relationship tag, and instructing the target merchant to recommend products that meet the preset product recommendation strategy to the target user. Products, including , Indicates the total number of recommended products. represents the probability of the target transaction parties being on the corresponding label in the most recent unit period, Represents a rounding function. For example, if the probabilities of the target transaction parties in the most recent unit period and on each user relationship label are: no relationship (10%), micro relationship (10%), weak relationship (50%), strong relationship (20%) and super strong relationship (10%), and the total number of recommended products is 10, then the target merchant can be instructed to recommend to the target user a current hot-selling product, a gross profit product similar to the purchased product, five image products similar to the purchased product, two ordinary products similar to the purchased product, and a newly launched product similar to the purchased product.
[0079] Therefore, based on the commodity recommendation method described in the aforementioned steps S1 to S7 and based on user relationships, a new scheme for training a user relationship estimation model based on historical transaction mutual evaluation record data and applying it for commodity recommendation is provided, that is, after obtaining the historical transaction mutual evaluation record data and user relationship labels of multiple pairs of sample transaction parties, for each pair of sample transaction parties, corresponding multiple sample feature words are extracted from the corresponding historical transaction mutual evaluation record data, and then the multiple sample feature words of each pair of sample transaction parties and the user relationship labels are applied to classify and train the machine learning model based on LightGBM, so as to obtain a user relationship estimation model, and then the multiple target feature words of the target transaction parties are input into the user relationship estimation model, so as to output the user relationship labels of the target transaction parties or the probabilities on each user relationship label, and finally, according to the output result, the target merchant is instructed to recommend matching commodities to the target user, so that strategic commodity recommendations can be made based on the trust relationship between the user and the merchant, thereby improving the accuracy of the commodity recommendation service and the total revenue of the merchant, thereby helping the merchant to maintain customer relations, and improving the merchant stickiness of the commodity recommendation service software, which is convenient for practical application and promotion.
[0080] like Figure 2 As shown, the second aspect of this embodiment provides a virtual system for implementing the commodity recommendation method described in the first aspect, including a mutual evaluation data acquisition module, a feature word extraction module, a model training module, a user relationship estimation module and a commodity recommendation indication module;
[0081] The mutual evaluation data acquisition module is used to acquire historical transaction mutual evaluation record data and user relationship labels of multiple pairs of sample transaction parties in historical unit periods, and is also used to acquire recent transaction mutual evaluation record data of target transaction parties in recent unit periods, wherein the sample transaction parties refer to sample users and sample merchants who have commodity transaction behaviors, and the target transaction parties refer to target users and target merchants who are about to have commodity transaction behaviors. The user relationship label is used to reflect the level of trust relationship between users and merchants, and is divided into whether there is a relationship, micro relationship, weak relationship, strong relationship and super strong relationship from shallow to deep;
[0082] The feature word extraction module is communicatively connected to the mutual evaluation data acquisition module, and is used to extract a corresponding plurality of sample feature words from the corresponding historical transaction mutual evaluation record data for each pair of sample transaction parties among the plurality of sample transaction parties, and is also used to extract a plurality of target feature words of the target transaction parties from the most recent transaction mutual evaluation record data, wherein the sample feature words include positive discourse words that are conducive to improving the trust relationship, negative discourse words that cause the trust relationship to decline, and neutral words, and the plurality of target feature words have the same number of words as the plurality of sample feature words, and the target feature words also include positive discourse words that are conducive to improving the trust relationship, negative discourse words that cause the trust relationship to decline, and neutral words;
[0083] The model training module is communicatively connected to the feature word extraction module, and is used to apply the multiple sample feature words of each pair of sample transaction parties and the user relationship labels to classify and train the LightGBM-based machine learning model to obtain a user relationship estimation model;
[0084] The user relationship estimation module is respectively connected to the feature word extraction module and the model training module for inputting the multiple target feature words of the target transaction parties into the user relationship estimation model, and outputting the user relationship labels of the target transaction parties in the most recent unit period or the probabilities of each user relationship label, wherein each user relationship label refers to the no relationship, the micro relationship, the weak relationship, the strong relationship and the super strong relationship;
[0085] The commodity recommendation instruction module is communicatively connected to the user relationship estimation module, and is used to instruct the target merchant to recommend matching commodities to the target user based on the user relationship tags of the target transaction parties in the most recent unit period or the probabilities of the user relationship tags.
[0086] The working process, working details and technical effects of the aforementioned system provided in the second aspect of this embodiment can be found in the product recommendation method described in the first aspect, and will not be repeated here.
[0087] like Figure 3As shown, the third aspect of this embodiment provides a computer device for executing the commodity recommendation method as described in the first aspect, including a memory, a processor and a transceiver that are sequentially connected in communication, wherein the memory is used to store a computer program, the transceiver is used to send and receive messages, and the processor is used to read the computer program to execute the commodity recommendation method as described in the first aspect. For example, the memory may include, but is not limited to, a random access memory (RAM), a read-only memory (ROM), a flash memory, a first-in-first-out memory (FIFO) and / or a first-in-last-out memory (FILO), etc.; the processor may include, but is not limited to, a microprocessor of the STM32F105 series. In addition, the computer device may also include, but is not limited to, a power module, a display screen and other necessary components.
[0088] The working process, working details and technical effects of the aforementioned computer device provided in the third aspect of this embodiment can be found in the commodity recommendation method described in the first aspect, and will not be described in detail here.
[0089] In a fourth aspect of this embodiment, there is provided a computer-readable storage medium storing instructions including the commodity recommendation method as described in the first aspect, that is, the computer-readable storage medium stores instructions, and when the instructions are executed on a computer, the commodity recommendation method as described in the first aspect is executed. The computer-readable storage medium refers to a carrier for storing data, which may include but is not limited to computer-readable storage media such as floppy disks, optical disks, hard disks, flash memories, USB flash drives, and / or memory sticks, and the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
[0090] The working process, working details and technical effects of the aforementioned computer-readable storage medium provided in the fourth aspect of this embodiment can be referred to the product recommendation method described in the first aspect, and will not be repeated here.
[0091] In a fifth aspect, the present embodiment provides a computer program product including instructions, which, when executed on a computer, causes the computer to execute the commodity recommendation method as described in the first aspect. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
[0092] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A commodity recommendation method based on user relationships, characterized in that: include: Obtain historical transaction mutual evaluation record data and user relationship labels for multiple pairs of sample transaction parties in historical unit periods, wherein the sample transaction parties refer to sample users and sample merchants who have commodity transaction behaviors, and the user relationship labels are used to reflect the level of trust relationship between users and merchants, and are divided into no relationship, micro relationship, weak relationship, strong relationship and super strong relationship from shallow to deep; For each pair of sample transaction parties among the multiple pairs of sample transaction parties, a corresponding plurality of sample feature words are extracted from the corresponding historical transaction mutual evaluation record data, specifically including: for each pair of sample transaction parties among the multiple pairs of sample transaction parties, the corresponding historical transaction mutual evaluation record data is converted into text and segmented to obtain a corresponding historical word set; for each pair of sample transaction parties, positive discourse words that are conducive to enhancing trust relationships, negative discourse words that cause trust relationships to decline, and neutral words are extracted from the corresponding historical word set to obtain a corresponding historical discourse word set; based on all the historical discourse word sets, the word frequency-inverse document frequency TF-IDF statistical algorithm is used to calculate the word frequency of each discourse word in the first total discourse word set in each of the historical discourse word sets, wherein the first total discourse word set contains all the discourse words in the total discourse word set. all the discourse words in the historical discourse word set; multiple sample feature words are selected for each pair of sample transaction parties respectively in the following manner: first, for each discourse word category, the first Round (w×M) discourse words belonging to the corresponding category and sorted in descending order according to the word frequency of the sample transaction parties are selected from the first discourse word total set as the corresponding selected feature words, and then the selected feature words of each discourse word category are summarized to obtain the multiple sample feature words, wherein the discourse word category includes positive discourse word category, negative discourse word type and neutral word type, the word frequency of the sample transaction parties refers to the word frequency of the discourse word in the historical discourse word set corresponding to the sample transaction parties, w represents the proportion of the discourse words of the corresponding category in the total discourse word set, M represents the total number of feature words selected, and Round() represents the rounding function; Apply the multiple sample feature words of each pair of sample transaction parties and the user relationship labels to classify and train the LightGBM-based machine learning model to obtain a user relationship estimation model; Acquire the recent transaction mutual evaluation record data of the target transaction parties in the recent unit period, wherein the target transaction parties refer to the target user and the target merchant of the commodity transaction behavior to be carried out; Extracting multiple target feature words of the target transaction parties from the recent transaction mutual evaluation record data, specifically including: converting the recent transaction mutual evaluation record data into text and performing word segmentation processing to obtain a recent word set; extracting positive discourse words that are conducive to improving trust relationships, negative discourse words that cause trust relationships to decline, and neutral words from the recent word set to obtain a recent discourse word set; according to the recent discourse word set and all the historical discourse word sets, using the word frequency-inverse document frequency TF-IDF statistical algorithm to calculate the word frequency of each discourse word in the second discourse word total set in the recent discourse word set and each of the historical discourse word sets, wherein , the second total set of discourse words includes all discourse words in the recent discourse word set and all the historical discourse word sets; multiple target feature words are selected for the target transaction parties in the following manner: first, for each discourse word category, the first Round (w×M) discourse words belonging to the corresponding category and sorted in descending order according to the word frequency of the target transaction parties are selected from the second total set of discourse words as corresponding selected feature words, and then the selected feature words of each discourse word category are summarized to obtain the multiple target feature words, wherein the word frequency of the target transaction parties refers to the word frequency of the discourse words in the recent discourse word set corresponding to the target transaction parties; Input the multiple target feature words of the target transaction parties into the user relationship estimation model, and output the user relationship labels of the target transaction parties in the most recent unit period or the probabilities of each user relationship label, wherein each user relationship label refers to the no relationship, the micro relationship, the weak relationship, the strong relationship, and the super strong relationship; According to the user relationship tags of the target transaction parties in the most recent unit period or the probabilities of the user relationship tags, the target merchant is instructed to recommend matching commodities to the target user.
2. The commodity recommendation method according to claim 1, characterized in that: During the classification training process of the machine learning model, a tree-structured Bayesian optimization algorithm is used to tune the model parameters.
3. The commodity recommendation method according to claim 1, characterized in that: Instructing the target merchant to recommend matching commodities to the target user according to the user relationship tags of the target transaction parties in the most recent unit period, including: Determine a corresponding preset product recommendation strategy for the user relationship tags of the target transaction parties in the most recent unit period; Instruct the target merchant to recommend commodities that meet the preset commodity recommendation strategy to the target user.
4. The commodity recommendation method according to claim 1, characterized in that: Determine a corresponding preset product recommendation strategy for the target transaction parties in the most recent unit period based on their user relationship tags, including: When the user relationship label of the target transaction parties in the most recent unit period is no relationship, determining that the preset product recommendation strategy corresponding to no relationship is to recommend the current hot-selling product; When the user relationship label of the target transaction parties in the most recent unit period is a micro-relationship, determining that the preset product recommendation strategy corresponding to the micro-relationship is to recommend a gross profit product similar to the purchased product; When the user relationship label of the target transaction parties in the most recent unit period is a weak relationship, determining the preset product recommendation strategy corresponding to the weak relationship to recommend image products similar to the purchased products; When the user relationship label of the target transaction parties in the most recent unit period is a strong relationship, determining that the preset commodity recommendation strategy corresponding to the strong relationship is to recommend common commodities similar to the purchased commodities; When the user relationship label of the target transaction parties in the most recent unit period is a super strong relationship, the preset product recommendation strategy corresponding to the super strong relationship is determined to recommend newly launched products similar to purchased products.
5. The commodity recommendation method according to claim 1, characterized in that: Instructing the target merchant to recommend matching commodities to the target user according to the probability of the target transaction parties in the most recent unit period and on each user relationship tag, including: For each user relationship tag, a corresponding preset product recommendation strategy is determined, and the target merchant is instructed to recommend products that meet the preset product recommendation strategy to the target user. Products, including , Indicates the total number of recommended products. represents the probability of the target transaction parties being on the corresponding label in the most recent unit period, Represents the rounding function.
6. A product recommendation system based on user relationships, characterized in that: It includes a mutual evaluation data acquisition module, a feature word extraction module, a model training module, a user relationship estimation module and a product recommendation indication module; The mutual evaluation data acquisition module is used to acquire historical transaction mutual evaluation record data and user relationship labels of multiple pairs of sample transaction parties in historical unit periods, and is also used to acquire recent transaction mutual evaluation record data of target transaction parties in recent unit periods, wherein the sample transaction parties refer to sample users and sample merchants who have commodity transaction behaviors, and the target transaction parties refer to target users and target merchants who are about to have commodity transaction behaviors. The user relationship label is used to reflect the level of trust relationship between users and merchants, and is divided into whether there is a relationship, micro relationship, weak relationship, strong relationship and super strong relationship from shallow to deep; The feature word extraction module is communicatively connected to the mutual evaluation data acquisition module, and is used to extract a plurality of corresponding sample feature words from the corresponding historical transaction mutual evaluation record data for each pair of sample transaction parties in the plurality of sample transaction parties, specifically including: for each pair of sample transaction parties in the plurality of sample transaction parties, converting the corresponding historical transaction mutual evaluation record data into text and performing word segmentation processing to obtain a corresponding historical word set; for each pair of sample transaction parties, extracting positive discourse words that are conducive to improving trust relationships, negative discourse words that cause trust relationships to decline, and neutral words from the corresponding historical word set to obtain a corresponding historical discourse word set; based on all the historical discourse word sets, using the word frequency-inverse document frequency TF-IDF statistical algorithm to calculate the word frequency of each discourse word in the first discourse word total set in each of the historical discourse word sets, wherein the first discourse word total set is the word frequency of each discourse word in the first discourse word total set. The total set of pragmatic words includes all the discourse words in all the historical discourse word sets; a plurality of sample feature words are selected for each pair of sample transaction parties respectively in the following manner: first, for each discourse word category, the first Round (w×M) discourse words belonging to the corresponding category and sorted in descending order according to the word frequency of the sample transaction parties are selected from the first total set of discourse words as corresponding selected feature words, and then the selected feature words of each discourse word category are summarized to obtain the plurality of sample feature words, wherein the discourse word category includes a positive discourse word category, a negative discourse word type and a neutral word type, the word frequency of the sample transaction parties refers to the word frequency of the discourse word in the historical discourse word set corresponding to the sample transaction parties, w represents the proportion of the discourse words of the corresponding category in the total set of discourse words, M represents the total number of feature words selected, and Round() represents a rounding function; The feature word extraction module is also used to extract multiple target feature words of the target transaction parties from the recent transaction mutual evaluation record data, specifically including: converting the recent transaction mutual evaluation record data into text and performing word segmentation processing to obtain a recent word set; extracting positive discourse words that are conducive to improving trust relationships, negative discourse words that cause trust relationships to decline, and neutral words from the recent word set to obtain a recent discourse word set; based on the recent discourse word set and all the historical discourse word sets, using the word frequency-inverse document frequency TF-IDF statistical algorithm to calculate the respective discourse words in the second discourse word total set in the recent discourse word set and each of the historical discourse word sets The word frequency of the second discourse word total set includes all the discourse words in the recent discourse word set and all the historical discourse word sets; multiple target feature words are selected for the target transaction parties in the following manner: first, for each discourse word category, the first Round (w×M) discourse words belonging to the corresponding category and sorted in descending order according to the word frequency of the target transaction parties are selected from the second discourse word total set as corresponding selected feature words, and then the selected feature words of each discourse word category are summarized to obtain the multiple target feature words, wherein the word frequency of the target transaction parties refers to the word frequency of the discourse words in the recent discourse word set corresponding to the target transaction parties; The model training module is communicatively connected to the feature word extraction module, and is used to apply the multiple sample feature words of each pair of sample transaction parties and the user relationship labels to classify and train the LightGBM-based machine learning model to obtain a user relationship estimation model; The user relationship estimation module is respectively connected to the feature word extraction module and the model training module for inputting the multiple target feature words of the target transaction parties into the user relationship estimation model, and outputting the user relationship labels of the target transaction parties in the most recent unit period or the probabilities of each user relationship label, wherein each user relationship label refers to the no relationship, the micro relationship, the weak relationship, the strong relationship and the super strong relationship; The commodity recommendation instruction module is communicatively connected to the user relationship estimation module, and is used to instruct the target merchant to recommend matching commodities to the target user based on the user relationship tags of the target transaction parties in the most recent unit period or the probabilities of the user relationship tags.
7. A computer device, characterized in that: It includes a memory, a processor and a transceiver which are communicatively connected in sequence, wherein the memory is used to store a computer program, the transceiver is used to send and receive messages, and the processor is used to read the computer program to execute the commodity recommendation method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores instructions, and when the instructions are executed on the computer, the product recommendation method as described in any one of claims 1 to 5 is executed.
