Item recommendation method, device, electronic device and storage medium

By extracting and integrating the long-term and short-term interest features of an account, the problem of insufficient long-term memory of the GRU model is solved, the accuracy of item recommendations is improved, and accurate recommendations based on the user's long-term and short-term interests are achieved.

CN113269612BActive Publication Date: 2025-10-03TSINGHUA UNIVERSITY +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110585850.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-27
Publication Date
2025-10-03
Estimated Expiration
2041-10-03

AI Technical Summary

Technical Problem

In existing item recommendation systems, the GRU model's long-term memory capacity is insufficient, resulting in the interest preference vector representation being closer to the user's short-term preferences. This makes it difficult to recommend items that meet the user's long-term preferences, reducing the accuracy of the recommendation.

Method used

By extracting and fusing the long-term and short-term interest features of an account, we obtain the target interest features. Combined with the embedded features of the target item, we determine whether to recommend the target item. Long-term interest features are global features across multiple items, while short-term interest features are local features that meet the target criteria. These features are weighted and pooled using encoders and weight parameters.

Benefits of technology

The accuracy of item recommendations has been improved, which can better integrate the long-term and short-term interest preferences of accounts and improve the accuracy of recommendations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113269612B_ABST
    Figure CN113269612B_ABST
Patent Text Reader

Abstract

The present disclosure relates to an item recommendation method, apparatus, electronic device, and storage medium, and belongs to the field of computer technology. The method comprises: obtaining an account's long-term and short-term interest characteristics based on multiple items with which the account interacted in historical interactions; fusing the long-term and short-term interest characteristics to obtain the account's target interest characteristics; and determining whether to recommend the target item to the account based on the target interest characteristics and the embedded features of the target item. The present disclosure improves the accuracy of target item recommendations by effectively integrating the account's long-term and short-term interest preferences into the target interest characteristics.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to an item recommendation method, device, electronic device, and storage medium. Background Art

[0002] With the development of computer technology and the diversification of terminal functions, users can browse various items (such as goods or services) through terminals anytime and anywhere. Therefore, how to recommend items to terminals has gradually become a hot topic.

[0003] In current recommendation systems, a sequence of items with which a user has previously interacted is typically used as input. The recommendation model then learns a vector representation of the user's interests and preferences and predicts the target items with which the user is likely to interact at the current moment. For example, the sequence of items is fed into a GRU (Gated Recurrent Unit) model, and the last latent vector from the GRU model is used as the vector representation of the user's interests and preferences. This vector representation of the user's interests and preferences, along with the vector representation of the target item, are then fed into an MLP (Multi-Layer Perceptron) model, which then predicts the final relevance score between the target item and the user.

[0004] In the above process, although the GRU model can extract a unified vector representation of the user's overall interest preferences, the long-term memory capacity of the GRU model is insufficient, resulting in the output vector representation of interest preferences being closer to the user's short-term preferences. For example, in the long run, the user prefers to browse items such as "mobile phones", but in the short term, the user has browsed items such as "food" many times. The vector representation of interest preferences output by the GRU model will have a higher correlation with "food", making it difficult to recommend items that meet the user's long-term preferences to the user, resulting in poor accuracy of item recommendations. Summary of the Invention

[0005] The present disclosure provides an item recommendation method, device, electronic device, and storage medium to at least improve the accuracy of item recommendations. The technical solutions of the present disclosure are as follows:

[0006] According to one aspect of an embodiment of the present disclosure, a method for recommending items is provided, comprising:

[0007] Based on multiple items that the account interacted with in historical interactive behaviors, the long-term interest features and short-term interest features of the account are obtained, where the long-term interest features are global features of the multiple items, and the short-term interest features are local features of some of the multiple items that meet the target conditions;

[0008] fusing the long-term interest feature and the short-term interest feature to obtain a target interest feature of the account;

[0009] Based on the target interest feature and the embedded feature of the target item, it is determined whether to recommend the target item to the account, where the embedded feature is used to characterize the inherent characteristics of the corresponding item.

[0010] In one possible implementation, obtaining the long-term interest characteristics of the account based on multiple items interacted with by the account in historical interactive behaviors includes:

[0011] Obtaining a plurality of embedded features corresponding to each of the plurality of objects;

[0012] Inputting the plurality of embedded features into a first encoder, and obtaining a plurality of first weight parameters corresponding to each of the plurality of embedded features based on the account features of the account;

[0013] Based on the multiple first weight parameters, the multiple embedded features are weighted respectively, the weighted multiple embedded features are fused, and the long-term interest feature is output.

[0014] In one possible implementation, obtaining the short-term interest characteristics of an account based on multiple items interacted with by the account in historical interactive behaviors includes:

[0015] Obtaining a plurality of embedded features corresponding to each of the plurality of objects;

[0016] The multiple embedded features are input into a second encoder, multiple time series features corresponding to each of the multiple embedded features are extracted, weighted pooling is performed on the multiple time series features, and the short-term interest feature is output.

[0017] In one possible implementation, extracting a plurality of time series features corresponding to each of the plurality of embedded features includes:

[0018] The multiple embedded features are input into a first sub-encoder in the second encoder, the multiple embedded features are encoded, and the multiple time series features are output.

[0019] In a possible implementation, performing weighted pooling on the multiple time series features to output the short-term interest feature includes:

[0020] inputting the plurality of embedded features into a second sub-encoder in the second encoder, and extracting feature change information between the plurality of embedded features;

[0021] The short-term interest feature is acquired based on the feature change information and the multiple time series features.

[0022] In a possible implementation manner, acquiring the short-term interest feature based on the feature change information and the multiple time series features includes:

[0023] Based on the feature change information, obtaining a plurality of second weight parameters corresponding to each of the plurality of time series features;

[0024] Based on the multiple second weight parameters, the multiple time series features are weighted respectively, and the weighted multiple time series features are fused to obtain the short-term interest feature.

[0025] In one possible implementation, the method further includes:

[0026] Based on multiple sample items interacted with by the sample account in historical interactive behaviors, obtaining multiple sample embedding features corresponding to each of the multiple sample items;

[0027] Inputting the plurality of sample embedding features into a first initial encoder and a second initial encoder respectively, and outputting a sample long-term interest feature and a sample short-term interest feature of the sample account;

[0028] Obtaining a loss function value for this iteration based on the sample long-term interest feature, the sample short-term interest feature, the standard long-term interest feature, and the standard short-term interest feature, wherein the standard long-term interest feature is the average value of the multiple sample embedding features, and the standard short-term interest feature is the average value of the sample embedding features of some items in the multiple sample items that meet the target condition;

[0029] The first initial encoder and the second initial encoder are iteratively trained until a stopping condition is met, thereby obtaining a first encoder and a second encoder, wherein the first encoder is used to extract long-term interest features of an account, and the second encoder is used to extract short-term interest features of an account.

[0030] In one possible implementation, obtaining the loss function value of this iterative process based on the sample long-term interest feature, the sample short-term interest feature, the standard long-term interest feature, and the standard short-term interest feature includes:

[0031] Obtaining a first similarity, a second similarity, a third similarity, and a fourth similarity, wherein the first similarity is the similarity between the sample long-term interest feature and the standard long-term interest feature, the second similarity is the similarity between the sample long-term interest feature and the standard short-term interest feature, the third similarity is the similarity between the sample short-term interest feature and the standard short-term interest feature, and the fourth similarity is the similarity between the sample short-term interest feature and the standard long-term interest feature;

[0032] Obtaining a first difference and a second difference, wherein the first difference is the difference between the first similarity and the second similarity, and the second difference is the difference between the third similarity and the fourth similarity;

[0033] The loss function value is obtained based on the first difference and the second difference.

[0034] In one possible implementation, fusing the long-term interest feature and the short-term interest feature to obtain the target interest feature of the account includes:

[0035] Obtaining a plurality of embedded features corresponding to each of the plurality of objects;

[0036] Obtaining a third weight parameter of the long-term interest feature and a fourth weight parameter of the short-term interest feature based on the multiple embedded features, the long-term interest feature, the short-term interest feature, and the embedded feature of the target item;

[0037] Based on the third weight parameter and the fourth weight parameter, the long-term interest feature and the short-term interest feature are weighted respectively, and the weighted long-term interest feature and the weighted short-term interest feature are fused to obtain the target interest feature.

[0038] In one possible implementation, obtaining a third weight parameter of the long-term interest feature and a fourth weight parameter of the short-term interest feature based on the multiple embedded features, the long-term interest feature, the short-term interest feature, and the embedded feature of the target item includes:

[0039] Obtaining a global encoding feature among the multiple embedded features, where the global encoding feature is used to represent global information after encoding the multiple embedded features;

[0040] The long-term interest feature, the short-term interest feature, the global coding feature, and the embedded feature of the target item are weighted to obtain the third weight parameter and the fourth weight parameter.

[0041] In one possible implementation, obtaining a global encoding feature among the multiple embedded features includes:

[0042] The multiple embedded features are input into a fusion encoder, the multiple embedded features are encoded to obtain a latent vector sequence, and the last latent vector in the latent vector sequence is obtained as the global encoding feature.

[0043] In one possible implementation, weighting the long-term interest feature, the short-term interest feature, the global coding feature, and the embedded feature of the target item to obtain the third weight parameter and the fourth weight parameter includes:

[0044] Splicing the long-term interest feature, the short-term interest feature, the global coding feature, and the embedded feature of the target item to obtain a spliced ​​feature;

[0045] The splicing feature is input into a weight prediction model, weighted processing is performed on the splicing feature, and the third weight parameter and the fourth weight parameter are output, where the sum of the third weight parameter and the fourth weight parameter is 1.

[0046] In one possible implementation, determining whether to recommend the target item to the account based on the target interest feature and the embedded feature of the target item includes:

[0047] The target interest feature, the embedded feature of the target item, and the context feature of the target item are fused to obtain a target fusion feature, where the context feature is used to characterize the interactive scene feature when the account interacts with the target item;

[0048] Inputting the target fusion feature into the recommendation model, weighting the target fusion feature, and outputting a recommendation probability parameter for the target item, wherein the recommendation probability parameter is used to represent the preference of the account for the target item;

[0049] In response to the recommendation probability parameter meeting a recommendation condition, determining to recommend the target item to the account;

[0050] In response to the recommendation probability parameter not meeting the recommendation condition, determining not to recommend the target item to the account.

[0051] In one possible implementation, the recommendation condition is that the recommendation probability parameter is greater than a recommendation probability threshold; or, the recommendation condition is that among multiple recommendation probability parameters of multiple target items sorted from large to small, the recommendation probability parameter of the target item is located at the front target position in the sorting.

[0052] According to another aspect of an embodiment of the present disclosure, there is provided an item recommendation device, comprising:

[0053] an acquisition unit configured to acquire, based on a plurality of items interacted with by an account in historical interactive behaviors, long-term interest features and short-term interest features of the account, wherein the long-term interest features are global features of the plurality of items, and the short-term interest features are local features of some of the plurality of items that meet target conditions;

[0054] a fusion unit configured to fuse the long-term interest feature and the short-term interest feature to obtain a target interest feature of the account;

[0055] A determination unit is configured to determine whether to recommend the target item to the account based on the target interest feature and the embedded feature of the target item, where the embedded feature is used to characterize the inherent characteristics of the corresponding item.

[0056] In one possible implementation, the acquiring unit includes:

[0057] A first acquiring subunit is configured to acquire a plurality of embedded features corresponding to each of the plurality of objects;

[0058] a second acquisition subunit configured to input the plurality of embedded features into a first encoder, and acquire a plurality of first weight parameters corresponding to each of the plurality of embedded features based on the account features of the account;

[0059] The first fusion subunit is configured to perform weighting on the multiple embedded features based on the multiple first weight parameters, fuse the weighted multiple embedded features, and output the long-term interest feature.

[0060] In one possible implementation, the acquiring unit includes:

[0061] A first acquiring subunit is configured to acquire a plurality of embedded features corresponding to each of the plurality of objects;

[0062] The extraction and pooling subunit is configured to input the multiple embedded features into the second encoder, extract multiple time series features corresponding to each of the multiple embedded features, perform weighted pooling on the multiple time series features, and output the short-term interest feature.

[0063] In one possible implementation, the extraction and pooling subunit includes:

[0064] The encoding sub-subunit is configured to execute a first sub-encoder that inputs the multiple embedded features into the second encoder, encodes the multiple embedded features, and outputs the multiple time series features.

[0065] In one possible implementation, the extraction and pooling subunit includes:

[0066] an extraction sub-subunit, configured to execute a second sub-encoder that inputs the plurality of embedded features into the second encoder, and extract feature change information between the plurality of embedded features;

[0067] The first acquisition sub-subunit is configured to acquire the short-term interest feature based on the feature change information and the multiple time series features.

[0068] In one possible implementation, the first acquiring sub-subunit is configured to execute:

[0069] Based on the feature change information, obtaining a plurality of second weight parameters corresponding to each of the plurality of time series features;

[0070] Based on the multiple second weight parameters, the multiple time series features are weighted respectively, and the weighted multiple time series features are fused to obtain the short-term interest feature.

[0071] In one possible implementation, the apparatus further includes a training unit, wherein the training unit includes:

[0072] A third acquisition subunit is configured to execute, based on a plurality of sample items interacted with by the sample account in historical interactive behaviors, acquiring a plurality of sample embedding features corresponding to each of the plurality of sample items;

[0073] An input-output subunit is configured to input the plurality of sample embedding features into a first initial encoder and a second initial encoder respectively, and output a sample long-term interest feature and a sample short-term interest feature of the sample account;

[0074] a fourth acquisition subunit, configured to acquire a loss function value of this iterative process based on the sample long-term interest feature, the sample short-term interest feature, the standard long-term interest feature, and the standard short-term interest feature, wherein the standard long-term interest feature is an average value of the plurality of sample embedding features, and the standard short-term interest feature is an average value of the sample embedding features of some of the plurality of sample items that meet the target condition;

[0075] The iterative training subunit is configured to perform iterative training of the first initial encoder and the second initial encoder until a stopping condition is met, thereby obtaining a first encoder and a second encoder, wherein the first encoder is used to extract the long-term interest features of the account, and the second encoder is used to extract the short-term interest features of the account.

[0076] In one possible implementation, the fourth acquiring subunit is configured to execute:

[0077] Obtaining a first similarity, a second similarity, a third similarity, and a fourth similarity, wherein the first similarity is the similarity between the sample long-term interest feature and the standard long-term interest feature, the second similarity is the similarity between the sample long-term interest feature and the standard short-term interest feature, the third similarity is the similarity between the sample short-term interest feature and the standard short-term interest feature, and the fourth similarity is the similarity between the sample short-term interest feature and the standard long-term interest feature;

[0078] Obtaining a first difference and a second difference, wherein the first difference is the difference between the first similarity and the second similarity, and the second difference is the difference between the third similarity and the fourth similarity;

[0079] The loss function value is obtained based on the first difference and the second difference.

[0080] In one possible implementation, the fusion unit includes:

[0081] A first acquiring subunit is configured to acquire a plurality of embedded features corresponding to each of the plurality of objects;

[0082] a fifth acquiring subunit, configured to acquire a third weight parameter of the long-term interest feature and a fourth weight parameter of the short-term interest feature based on the multiple embedded features, the long-term interest feature, the short-term interest feature, and the embedded feature of the target item;

[0083] The second fusion subunit is configured to perform weighting on the long-term interest feature and the short-term interest feature based on the third weight parameter and the fourth weight parameter, respectively, and fuse the weighted long-term interest feature and the weighted short-term interest feature to obtain the target interest feature.

[0084] In one possible implementation, the fifth acquiring subunit includes:

[0085] A second acquisition sub-subunit is configured to acquire a global encoding feature among the multiple embedded features, where the global encoding feature is used to represent global information after encoding the multiple embedded features;

[0086] The weighting sub-subunit is configured to perform weighting on the long-term interest feature, the short-term interest feature, the global coding feature, and the embedded feature of the target item to obtain the third weight parameter and the fourth weight parameter.

[0087] In one possible implementation, the second acquiring sub-subunit is configured to execute:

[0088] The multiple embedded features are input into a fusion encoder, the multiple embedded features are encoded to obtain a latent vector sequence, and the last latent vector in the latent vector sequence is obtained as the global encoding feature.

[0089] In one possible implementation, the weighting sub-subunit is configured to perform:

[0090] Splicing the long-term interest feature, the short-term interest feature, the global coding feature, and the embedded feature of the target item to obtain a spliced ​​feature;

[0091] The splicing feature is input into a weight prediction model, weighted processing is performed on the splicing feature, and the third weight parameter and the fourth weight parameter are output, where the sum of the third weight parameter and the fourth weight parameter is 1.

[0092] In one possible implementation, the determining unit is configured to execute:

[0093] The target interest feature, the embedded feature of the target item, and the context feature of the target item are fused to obtain a target fusion feature, where the context feature is used to characterize the interactive scene feature when the account interacts with the target item;

[0094] Inputting the target fusion feature into the recommendation model, weighting the target fusion feature, and outputting a recommendation probability parameter for the target item, wherein the recommendation probability parameter is used to represent the preference of the account for the target item;

[0095] In response to the recommendation probability parameter meeting a recommendation condition, determining to recommend the target item to the account;

[0096] In response to the recommendation probability parameter not meeting the recommendation condition, determining not to recommend the target item to the account.

[0097] In one possible implementation, the recommendation condition is that the recommendation probability parameter is greater than a recommendation probability threshold; or, the recommendation condition is that among multiple recommendation probability parameters of multiple target items sorted from large to small, the recommendation probability parameter of the target item is located at the front target position in the sorting.

[0098] According to another aspect of the present disclosure, an electronic device is provided, including:

[0099] one or more processors;

[0100] one or more memories for storing the one or more processor-executable instructions;

[0101] The one or more processors are configured to execute the item recommendation method in any possible implementation of the above aspect.

[0102] According to another aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When at least one instruction in the computer-readable storage medium is executed by one or more processors of an electronic device, the electronic device is enabled to execute the item recommendation method in any possible implementation of the above-mentioned aspect.

[0103] According to another aspect of an embodiment of the present disclosure, a computer program product is provided, comprising one or more instructions, wherein the one or more instructions can be executed by one or more processors of an electronic device, so that the electronic device can execute the item recommendation method in any possible implementation of the above-mentioned aspect.

[0104] The technical solutions provided by the embodiments of the present disclosure bring at least the following beneficial effects:

[0105] By extracting long-term interest features and short-term interest features for an account separately, since the long-term interest features are global features of all items that the account has interacted with in historical interactive behaviors, they can reflect the account's long-term interest preferences that do not change with external factors, while the short-term interest features are local features of some items that meet the target conditions, so they can reflect the account's short-term interest preferences caused by external factors. This makes it possible to better integrate the two different types of interest preferences of the account, long-term and short-term, into the target interest features, thereby improving the accuracy of the target item recommendations when combining the target interest features for recommendation.

[0106] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0107] The accompanying drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute an improper limitation of the present disclosure.

[0108] Figure 1 is a schematic diagram of an implementation environment of an item recommendation method according to an exemplary embodiment;

[0109] Figure 2 is a flowchart of an item recommendation method according to an exemplary embodiment;

[0110] Figure 3 is a flowchart of an item recommendation method according to an exemplary embodiment;

[0111] Figure 4 This is a flow chart of obtaining short-term interest features provided by an embodiment of the present disclosure;

[0112] Figure 5 This is a schematic diagram of the principle of an item recommendation method provided in an embodiment of the present application;

[0113] Figure 6 This is a schematic diagram of the principle of an item recommendation method provided in an embodiment of the present application;

[0114] Figure 7This is a training flow chart of an item recommendation method provided in an embodiment of the present application;

[0115] Figure 8 is a logical structure block diagram of an item recommendation device according to an exemplary embodiment;

[0116] Figure 9 A structural block diagram of an electronic device provided by an exemplary embodiment of the present disclosure is shown;

[0117] Figure 10 It is a structural diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0118] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.

[0119] It should be noted that the terms "first," "second," and the like in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the numbers used in this manner are interchangeable where appropriate so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure as detailed in the appended claims.

[0120] The user information involved in this disclosure may be information authorized by the user or fully authorized by all parties.

[0121] Figure 1 is a schematic diagram of an implementation environment of an item recommendation method according to an exemplary embodiment. Figure 1 In this implementation environment, at least one terminal 101 and a server 102 may be included, as described in detail below:

[0122] The terminal 101 is used to browse a variety of items, which may include goods or services. An application may be installed on the terminal 101. The application may be any client that can provide an item browsing service. The user can browse the items by launching the application. The application may be at least one of a shopping application, a food delivery application, a travel application, a game application, or a social application. The items may include food, electronic products, clothes, daily necessities, skin care products, etc., and the embodiments of the present application do not specifically limit this.

[0123] Server 102 is an electronic device used to provide item recommendation services to terminal 101. Server 102 may include at least one of a single server, multiple servers, a cloud computing platform, or a virtualization center. Optionally, server 102 may perform primary computing tasks, while terminal 101 may perform secondary computing tasks; alternatively, server 102 may perform secondary computing tasks, while terminal 101 may perform primary computing tasks; alternatively, server 102 and terminal 101 may collaborate on computing tasks using a distributed computing architecture.

[0124] Optionally, the device type of terminal 101 may include at least one of a smartphone, a tablet computer, an in-vehicle terminal, a smart speaker, a smartwatch, an e-book reader, an MP3 (Moving Picture Experts Group Audio Layer III) player, an MP4 (Moving Picture Experts Group Audio Layer IV) player, a laptop computer, or a desktop computer. For example, any of the terminals may be a smartphone or other handheld portable electronic device. The following embodiments are exemplified by the example of terminal 101 including a smartphone.

[0125] Those skilled in the art will appreciate that the number of terminals 101 may be greater or less. For example, there may be only one terminal 101, or there may be dozens, hundreds, or even more terminals 101. The embodiments of this disclosure do not limit the number or device type of terminals 101.

[0126] Figure 2 is a flowchart of an item recommendation method according to an exemplary embodiment. Figure 2 ,This item recommendation method is applied to electronic devices, and is described below using the electronic device as a server as an example.

[0127] In step 201, based on multiple items that the account interacted with in historical interactive behaviors, the long-term interest features and short-term interest features of the account are obtained. The long-term interest features are global features of the multiple items, and the short-term interest features are local features of some of the multiple items that meet the target conditions.

[0128] In step 202, the long-term interest feature and the short-term interest feature are fused to obtain the target interest feature of the account.

[0129] In step 203, based on the target interest feature and the embedded feature of the target item, it is determined whether to recommend the target item to the account, where the embedded feature is used to characterize the inherent characteristics of the corresponding item.

[0130] The method provided by the embodiments of the present disclosure extracts long-term interest features and short-term interest features for an account respectively. Since the long-term interest features are global features of all items that the account has interacted with in historical interactive behaviors, they can reflect the long-term interest preferences of the account that do not change with external factors. The short-term interest features are local features of some items that meet the target conditions, and therefore can reflect the short-term interest preferences of the account caused by external factors. This makes it possible to better integrate the two different types of interest preferences of the account, long-term and short-term, into the target interest features, thereby improving the recommendation accuracy of the target items when combining the target interest features for recommendation.

[0131] In one possible implementation, obtaining the long-term interest characteristics of an account based on multiple items that the account interacted with in historical interactions includes:

[0132] Obtaining multiple embedded features corresponding to each of the multiple items;

[0133] Inputting the multiple embedded features into a first encoder, and obtaining multiple first weight parameters corresponding to each of the multiple embedded features based on the account features of the account;

[0134] Based on the multiple first weight parameters, the multiple embedded features are weighted respectively, the weighted multiple embedded features are fused, and the long-term interest feature is output.

[0135] In one possible implementation, obtaining the short-term interest characteristics of an account based on multiple items interacted with in historical interaction behaviors includes:

[0136] Obtaining multiple embedded features corresponding to each of the multiple items;

[0137] The multiple embedded features are input into the second encoder, multiple time series features corresponding to each of the multiple embedded features are extracted, the multiple time series features are weighted pooled, and the short-term interest feature is output.

[0138] In one possible implementation, extracting multiple time series features corresponding to each of the multiple embedded features includes:

[0139] The multiple embedded features are input into the first sub-encoder in the second encoder, the multiple embedded features are encoded, and the multiple time series features are output.

[0140] In one possible implementation, performing weighted pooling on the multiple time series features to output the short-term interest feature includes:

[0141] Inputting the plurality of embedded features into a second sub-encoder in the second encoder, and extracting feature change information between the plurality of embedded features;

[0142] The short-term interest feature is obtained based on the feature change information and the multiple time series features.

[0143] In one possible implementation, obtaining the short-term interest feature based on the feature change information and the multiple time series features includes:

[0144] Based on the feature change information, obtaining a plurality of second weight parameters corresponding to each of the plurality of time series features;

[0145] Based on the multiple second weight parameters, the multiple time series features are weighted respectively, and the weighted multiple time series features are fused to obtain the short-term interest feature.

[0146] In one possible implementation, the method further includes:

[0147] Based on multiple sample items interacted with by the sample account in historical interactive behaviors, obtain multiple sample embedding features corresponding to each of the multiple sample items;

[0148] Inputting the multiple sample embedding features into a first initial encoder and a second initial encoder respectively, and outputting a sample long-term interest feature and a sample short-term interest feature of the sample account;

[0149] Based on the long-term interest feature of the sample, the short-term interest feature of the sample, the standard long-term interest feature, and the standard short-term interest feature, the loss function value of this iteration process is obtained, where the standard long-term interest feature is the average value of the embedding features of the multiple samples, and the standard short-term interest feature is the average value of the embedding features of the samples of some items that meet the target conditions among the multiple sample items;

[0150] The first initial encoder and the second initial encoder are iteratively trained until a stopping condition is met, thereby obtaining a first encoder and a second encoder, wherein the first encoder is used to extract long-term interest features of an account, and the second encoder is used to extract short-term interest features of an account.

[0151] In one possible implementation, obtaining the loss function value of this iteration process based on the sample long-term interest feature, the sample short-term interest feature, the standard long-term interest feature, and the standard short-term interest feature includes:

[0152] Obtaining a first similarity, a second similarity, a third similarity, and a fourth similarity, wherein the first similarity is the similarity between the long-term interest feature of the sample and the standard long-term interest feature, the second similarity is the similarity between the long-term interest feature of the sample and the standard short-term interest feature, the third similarity is the similarity between the short-term interest feature of the sample and the standard short-term interest feature, and the fourth similarity is the similarity between the short-term interest feature of the sample and the standard long-term interest feature;

[0153] Obtaining a first difference and a second difference, the first difference being the difference between the first similarity and the second similarity, and the second difference being the difference between the third similarity and the fourth similarity;

[0154] Based on the first difference and the second difference, the loss function value is obtained.

[0155] In one possible implementation, the long-term interest feature and the short-term interest feature are integrated to obtain the target interest feature of the account, including:

[0156] Obtaining multiple embedded features corresponding to each of the multiple items;

[0157] Obtaining a third weight parameter of the long-term interest feature and a fourth weight parameter of the short-term interest feature based on the multiple embedded features, the long-term interest feature, the short-term interest feature, and the embedded feature of the target item;

[0158] Based on the third weight parameter and the fourth weight parameter, the long-term interest feature and the short-term interest feature are weighted respectively, and the weighted long-term interest feature and the weighted short-term interest feature are fused to obtain the target interest feature.

[0159] In one possible implementation, obtaining a third weight parameter of the long-term interest feature and a fourth weight parameter of the short-term interest feature based on the multiple embedded features, the long-term interest feature, the short-term interest feature, and the embedded feature of the target item includes:

[0160] Obtaining a global encoding feature between the multiple embedded features, where the global encoding feature is used to represent global information after encoding the multiple embedded features;

[0161] The long-term interest feature, the short-term interest feature, the global coding feature, and the embedded feature of the target item are weighted to obtain the third weight parameter and the fourth weight parameter.

[0162] In one possible implementation, obtaining a global encoding feature among the multiple embedded features includes:

[0163] The multiple embedded features are input into a fusion encoder, the multiple embedded features are encoded to obtain a latent vector sequence, and the last latent vector in the latent vector sequence is obtained as the global encoding feature.

[0164] In one possible implementation, weighting the long-term interest feature, the short-term interest feature, the global coding feature, and the embedded feature of the target item to obtain the third weight parameter and the fourth weight parameter includes:

[0165] Splicing the long-term interest feature, the short-term interest feature, the global coding feature, and the embedded feature of the target object to obtain a spliced ​​feature;

[0166] The splicing feature is input into a weight prediction model, weighted processing is performed on the splicing feature, and the third weight parameter and the fourth weight parameter are output, where the sum of the third weight parameter and the fourth weight parameter is 1.

[0167] In one possible implementation, determining whether to recommend the target item to the account based on the target interest feature and the embedded feature of the target item includes:

[0168] The target interest feature, the embedded feature of the target item, and the context feature of the target item are fused to obtain a target fusion feature. The context feature is used to characterize the interactive scene feature when the account interacts with the target item.

[0169] The target fusion feature is input into the recommendation model, the target fusion feature is weighted, and a recommendation probability parameter of the target item is output. The recommendation probability parameter is used to represent the account's preference for the target item;

[0170] In response to the recommendation probability parameter meeting the recommendation condition, determining to recommend the target item to the account;

[0171] In response to the recommendation probability parameter not meeting the recommendation condition, it is determined that the target item is not recommended to the account.

[0172] In one possible implementation, the recommendation condition is that the recommendation probability parameter is greater than a recommendation probability threshold; or, the recommendation condition is that among multiple recommendation probability parameters of multiple target items sorted from large to small, the recommendation probability parameter of the target item is at the front target position in the sorting.

[0173] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present disclosure, and will not be described in detail here.

[0174] Figure 3 FIG. 1 is a flowchart of an item recommendation method according to an exemplary embodiment. Figure 3 As shown, the item recommendation method is applied to an electronic device. The following description is made by taking the electronic device as a server as an example. This embodiment includes the following steps.

[0175] In step 301, the server obtains a plurality of embedded features corresponding to each of the plurality of items based on the plurality of items that the account interacted with in historical interactive behaviors. The embedded features are used to characterize the inherent characteristics of the corresponding items.

[0176] The account refers to any account registered on the server. After registering an account through a terminal, the user can launch an application on the terminal and log in to the account. Then, the user can interact with items in the application. The server records each interactive behavior initiated by the account and the corresponding items, thereby confirming each item with which the account has interacted. These items can constitute the sequence of items that the account has interacted with in its historical interactive behaviors. Optionally, the interactive behavior includes but is not limited to browsing, clicking, collecting, consuming (i.e., purchasing), etc. The disclosed embodiments do not specifically limit the type of the interactive behavior.

[0177] In some embodiments, after confirming the multiple items, the server performs an embedding process on the item information of the multiple items to obtain multiple embedding vectors for the multiple items. These multiple embedding vectors are then used as multiple embedded features, enabling the item information to be converted into vector expressions that are easily processed by a computer. The embedded features are used to characterize the inherent characteristics of the corresponding items. In other words, the embedded features of each item are determined solely by the inherent characteristics of the item itself and do not change with other factors. Different items have different embedded features.

[0178] Optionally, the item information includes but is not limited to: item name, item price, item details, item picture, item identification (ID), item merchant name, item merchant details, item merchant identification, etc. The embodiment of the present disclosure does not specifically limit the content of the item information.

[0179] Optionally, in addition to using embedded features to represent the inherent characteristics of items, the server can also one-hot encode the item information of the multiple items to obtain multiple one-hot vectors of the multiple items, use these multiple one-hot vectors to represent the inherent characteristics of the items, and use the one-hot vectors to replace the embedding vectors in subsequent processing, which can also achieve a similar item recommendation process. In this case, compared with the embedding vectors, the computational complexity of obtaining the one-hot vectors is lower.

[0180] In step 302, the server inputs the multiple embedded features into a first encoder and outputs the long-term interest features of the account.

[0181] The first encoder is used to extract the long-term interest features of the account.

[0182] Among them, the long-term interest feature is used to characterize the global characteristics of the multiple items. It is precisely because the long-term interest feature represents the global characteristics of all items that have been interacted with in the entire historical interactive behavior, this global feature will not change with the influence of external factors in the short term. Therefore, it can reflect the interest preferences developed by the user corresponding to the account over a long period of time.

[0183] In some embodiments, when obtaining the long-term interest feature, the server may input the multiple embedded features into a first encoder, obtain multiple first weight parameters corresponding to each of the multiple embedded features based on the account features of the account, and weight the multiple embedded features based on the multiple first weight parameters, fuse the weighted multiple embedded features, and output the long-term interest feature. The first weight parameter refers to the weight parameter used when weighting each embedded feature.

[0184] Optionally, during the training process, the server can randomly initialize an account feature for each account, and modify the account features of each account as the training process iterates and adjusts the parameters. When the training is completed, the account features corresponding to each account can be trained. The server can then store the account features of each account in the database so that the account features of the account can be read from the database according to the account ID of the account during online prediction, which can save the amount of computation during online prediction.

[0185] Optionally, the account feature can be an embedding vector obtained by embedding the account information of the account, which can enable the account feature to more specifically reflect the characteristics of the account itself. Optionally, the account information includes but is not limited to: account ID, account nickname, registration time, user information bound to the account (user authorization required for use), daily account activity, weekly account activity, etc., which is not specifically limited in the present embodiment.

[0186] In some embodiments, when obtaining the first weight parameter, the server may obtain, for each embedded feature, the similarity between each embedded feature and the account feature, and use the similarity as the first weight parameter corresponding to each embedded feature. Optionally, the similarity includes, but is not limited to, cosine similarity, the inverse of the Euclidean distance, vector inner product, etc. This embodiment of the application does not specifically limit the form of this similarity.

[0187] In some embodiments, when obtaining the similarity, the server may also concatenate the account feature and each embedded feature for each embedded feature, and input the concatenated features into an MLP (Multi-Layer Perceptron) model. The MLP model performs weighted processing on the concatenated features, and sets the dimension of the output vector of the last hidden layer in the MLP model to 1, so that the last hidden layer can directly output the similarity between the account feature and each embedded feature.

[0188] Optionally, the first weight parameters of the above-mentioned embedded features can be normalized first weight parameters, that is, the value obtained by adding the first weight parameters of all embedded features is 1, which can avoid over-amplification or neglect of detail information in the embedded features due to the first weight parameter being too large or too small.

[0189] In some embodiments, when obtaining the long-term interest feature, the server can multiply the multiple embedded features with their respective corresponding first weight parameters to obtain multiple weighted embedded features, and add the multiple weighted embedded features element by element to obtain the long-term interest feature.

[0190] Optionally, in addition to element-wise addition, the server may also perform fusion operations such as element-wise multiplication, concat, and bilinear convergence on the weighted multiple embedded features, so that the weighted multiple embedded features can be aggregated into a single long-term interest feature, thereby achieving a pooling effect. The embodiment of the present disclosure does not specifically limit the fusion method of the weighted multiple embedded features.

[0191] In one exemplary scenario, the first encoder is an attention-based pooling model. The input of the first encoder includes the multiple embedded features and the account features of the account, and the output of the first encoder includes the long-term interest feature. After the server inputs the multiple embedded features and the account features into the first encoder, the first encoder obtains the similarity between each embedded feature and the account features as the first weight parameter of each embedded feature, and performs a weighted sum of the corresponding embedded features according to the first weight parameter (i.e., using an element-by-element fusion method), and outputs the summed long-term interest feature.

[0192] In the above process, after the first encoder calculates the first weight parameter for the embedded features of each item, the first weight parameter is used to weight the embedded features of each item, and the weighted embedded features are aggregated into a long-term interest feature, so that the long-term interest feature can not only reflect the embedded features of each item, but also introduce account features to provide a first weight parameter based on the attention mechanism when fusing the embedded features of each item, so that the long-term interest feature has better expressive ability.

[0193] In step 303, the server inputs the multiple embedded features into the second encoder, extracts multiple time series features corresponding to each of the multiple embedded features, performs weighted pooling on the multiple time series features, and outputs the short-term interest features of the account.

[0194] The second encoder is used to extract the short-term interest features of the account.

[0195] Among them, the short-term interest feature is used to characterize the local features of some items among the multiple items that meet the target conditions. Precisely because the short-term interest feature represents the local features of some items in the historical interactive behavior, this local feature will change with the influence of external factors in the short term. Therefore, it can reflect the temporary interest preferences of the user corresponding to the account under the influence of external factors.

[0196] Optionally, the target condition refers to the last K (K≥1) items in a sequence of items sorted in ascending order according to the timestamps of the interaction with the account, that is, the partial items that meet the target condition refer to the K items that have recently interacted with the account.

[0197] Optionally, the target condition may also refer to the time difference between the timestamp of the interaction behavior with the account and the current moment being less than the interaction sampling threshold, and the interaction sampling threshold is any value greater than 0. For example, when the interaction sampling threshold is 1 day, the partial items that meet the target condition refer to the various items that the account has interacted with in the past 1 day. The embodiment of the present disclosure does not specifically limit the target condition.

[0198] In some embodiments, the second encoder includes a first sub-encoder and a second sub-encoder, the first sub-encoder is used to extract the multiple temporal features, and the second sub-encoder is used to extract feature change information between the multiple embedded features.

[0199] Based on the architecture of the second encoder above, Figure 4 This is a flowchart of obtaining short-term interest features provided by the embodiment of the present disclosure. Please refer to Figure 4 When the server obtains the short-term interest feature, it can execute the following steps 3031-3034:

[0200] In step 3031, the server inputs the multiple embedded features into the first sub-encoder in the second encoder, encodes the multiple embedded features, and outputs the multiple time series features.

[0201] Optionally, the first sub-encoder can be any sequence to sequence (Seq2Seq) model with an encoder-decoder (Encoder-Decoder) structure, such as RNN (Recurrent Neural Network), GRU (Gated Recurrent Unit), LSTM (Long Short-Term Memory), BLSTM (Bidirectional Long Short-Term Memory), etc. The embodiment of the present disclosure does not specifically limit the structure of the first sub-encoder.

[0202] The following example uses an RNN model as the first sub-encoder. The RNN model includes at least one hidden layer, each containing at least one neuron. Not only are weighted connections established between hidden layers, but neurons within each hidden layer also have chained, intra-layer weighted connections. The input to the RNN model is an embedded feature sequence consisting of these multiple embedded features, and the output is a temporal feature sequence consisting of multiple temporal features obtained by encoding these multiple embedded features.

[0203] Optionally, for each neuron in each hidden layer of the RNN model, the output feature map of the previous neuron in the current hidden layer and the output feature map of the neuron at the corresponding position in the previous hidden layer are used as input, and the output feature map of this neuron is input to the next neuron in the current hidden layer and the neuron at the corresponding position in the next hidden layer, so as to facilitate the extraction of temporal correlation information between each embedded feature.

[0204] In some embodiments, for any neuron in any hidden layer, the server may use the weight matrix obtained during training to weight and fuse the output feature map of the previous neuron in the current hidden layer and the output feature map of the neuron at the corresponding position in the previous hidden layer, thereby obtaining the output feature map of the neuron. The server performs the above operation on each neuron in each hidden layer, and obtains the output feature map of each neuron in the last hidden layer as the multiple time series features.

[0205] Optionally, when each neuron weights the output feature map of the previous neuron in the current hidden layer and the output feature map of the neuron at the corresponding position in the previous hidden layer, it can adopt the same weight matrix for weighting based on the weight sharing mechanism, or it can adopt different weight matrices for weighting separately. The embodiments of the present disclosure do not specifically limit this.

[0206] It should be noted that in the embodiment of the present disclosure, only the first sub-encoder is an RNN model as an example for explanation, but the first sub-encoder can also be an LSTM model, a BLSTM model, etc., and the embodiment of the present disclosure does not specifically limit this.

[0207] In the above process, each embedded feature is encoded by the first sub-encoder, so that each output time series feature actually reflects the time series correlation information of each embedded feature in the encoding process, thereby improving the expression ability of each time series feature.

[0208] In step 3032, the server inputs the multiple embedded features into the second sub-encoder in the second encoder to extract feature change information between the multiple embedded features.

[0209] Optionally, the second sub-encoder can be any Seq2Seq model with a coding and decoding structure, such as GRU, RNN, LSTM, BLSTM, etc. The embodiment of the present disclosure does not specifically limit the structure of the second sub-encoder.

[0210] The following is an example of the second sub-encoder being a GRU model. The GRU model is a variant of the LSTM model. Compared with the LSTM model, it has a simpler structure and better feature extraction effect, and can solve the long dependency problem and gradient disappearance problem in the RNN model. The input of the GRU model is still an embedded feature sequence (that is, a sequence formed by the multiple embedded features in time sequence), and the output of the GRU model is a latent vector sequence. Each element in the latent vector sequence is the latent vector obtained after encoding each embedded feature in the input embedded feature sequence. The embodiment of the present disclosure takes the last latent vector in the output latent vector sequence as the feature change information, which can simplify the process of obtaining the feature change information. In some embodiments, the average vector of each latent vector in the latent vector sequence can also be taken as the feature change information, and the embodiment of the present disclosure does not specifically limit this.

[0211] Optionally, the GRU model includes at least one hidden layer, each of which includes at least one memory unit. Each memory unit takes the output latent vector of the previous memory unit in the current hidden layer and the output latent vector of the memory unit at the corresponding position in the previous hidden layer as input, and simultaneously inputs the output latent vector of the current memory unit to the next memory unit in the current hidden layer and the memory unit at the corresponding position in the next hidden layer. In this way, when encoding the serialized input signal (embedded feature sequence), relevant information of the previous state can be introduced to facilitate the extraction of feature change information between all embedded features.

[0212] In some embodiments, for any memory unit in any hidden layer, the server can use the memory unit to weight and fuse the output latent vector of the previous memory unit in the current hidden layer and the output latent vector of the memory unit at the corresponding position in the previous hidden layer based on a gating mechanism to obtain the output latent vector of the memory unit. The server performs the above operation on each memory unit in each hidden layer and obtains the output latent vector of the last memory unit in the last hidden layer as the feature change information.

[0213] Optionally, in each memory unit of the GRU model, the above gating mechanism is implemented through a reset gate and an update gate. The reset gate is used to control the extent to which the output latent vector of the previous memory unit is updated to the candidate state of the current memory unit when calculating the output latent vector. In other words, the reset gate mainly determines how much past information needs to be forgotten. The update gate is used to control the extent to which the output latent vector of the previous memory unit is updated to the output latent vector of the current memory unit. In other words, the update gate is used to control how much past information needs to be passed into the future.

[0214] Optionally, both the reset gate and the update gate can be a Sigmoid function, and the inputs of both are the output latent vector of the previous memory unit in the current hidden layer and the output latent vector of the memory unit at the corresponding position in the previous hidden layer. However, due to the different parameters of the Sigmoid functions of the two, the reset gate and the update gate output different activation vectors. Next, the activation vector output by the reset gate can be element-wise multiplied with the output latent vector of the previous memory unit in the current hidden layer to obtain a Hadamard product vector. The Hadamard product vector is then element-wise added to the output latent vector of the memory unit at the corresponding position in the previous hidden layer to obtain an intermediate vector. The intermediate vector is input into the tanh function for activation, and the target activation vector is output. Next, obtain the first vector obtained by subtracting 1 from the activation vector output by the update gate, and multiply the first vector by the intermediate vector element-wise to obtain the second vector. In addition, multiply the activation vector output by the update gate by the output latent vector of the previous memory unit in the current hidden layer element-wise to obtain a third vector. Add the second vector and the third vector element-wise to obtain the output latent vector of the current memory unit.

[0215] It should be noted that in the embodiment of the present disclosure, only the second sub-encoder is described as a GRU model, but the second sub-encoder can also be an LSTM model, a BLSTM model, etc., and the embodiment of the present disclosure does not specifically limit this.

[0216] In step 3033, the server obtains multiple second weight parameters corresponding to each of the multiple time series features based on the feature change information.

[0217] In some embodiments, when obtaining the second weight parameter, the server may obtain the similarity between each time series feature and the feature change information for each time series feature, and use the similarity as the second weight parameter corresponding to each time series feature. Optionally, the similarity includes but is not limited to: cosine similarity, the inverse of the Euclidean distance, the vector inner product, etc. The embodiment of the present application does not specifically limit the form of the similarity. Among them, the second weight parameter refers to the weight parameter used when weighting each time series feature in the following step 3034.

[0218] In some embodiments, when obtaining the similarity, the server may also, for each time series feature, concatenate the feature change information and each time series feature, input the concatenated features into an MLP model, and have the MLP model perform weighted processing on the concatenated features, and set the dimension of the output vector of the last hidden layer in the MLP model to 1, so that the last hidden layer can directly output the similarity between the feature change information and each time series feature.

[0219] Optionally, the second weight parameters of the above-mentioned each timing feature can be a normalized second weight parameter, that is, the value obtained by adding the second weight parameters of all timing features is 1, which can avoid over-amplification or neglect of detailed information in the timing features due to the second weight parameter being too large or too small.

[0220] In step 3034, the server weights the multiple time series features respectively based on the multiple second weight parameters, and fuses the weighted multiple time series features to obtain the short-term interest feature.

[0221] In some embodiments, when obtaining short-term interest features, the server can multiply the multiple time series features with their respective corresponding second weight parameters to obtain multiple weighted time series features, and add the multiple weighted time series features element by element to obtain the short-term interest feature.

[0222] Optionally, in addition to element-by-element addition, the server can also perform fusion operations such as element-by-element multiplication, concatenation, bilinear merging, etc. on the weighted multiple time series features, so that the weighted multiple time series features can be aggregated into a single short-term interest feature, thereby achieving the pooling effect. The embodiment of the present disclosure does not specifically limit the fusion method of the weighted multiple time series features.

[0223] In the above steps 3033-3034, a possible implementation method for obtaining the short-term interest feature based on the feature change information and the multiple time series features is shown. That is, it is equivalent to inputting the feature change information and the multiple time series features into an attention-based pooling model, and using the attention-based pooling model to perform weighted pooling on the multiple time series features and output the short-term interest feature. In this way, the short-term interest feature can fully integrate the various time series features and their feature change information, greatly improving the expressive power of the short-term interest feature.

[0224] In the above process, since the temporal features and feature change information are modeled separately, that is, the first sub-encoder is used to extract the multiple temporal features, and the second sub-encoder is used to extract the feature change information, the temporal features and feature change information have stronger expressive power, and the short-term interest features have better representativeness, which is conducive to improving the accuracy of subsequent item recommendations.

[0225] In some embodiments, the server can also train an overall Seq2Seq model with a codec structure to extract the short-term interest feature on a macro scale, thereby simplifying the extraction process of the short-term interest feature. The embodiment of the present disclosure does not specifically limit the method of extracting the short-term interest feature.

[0226] In steps 301-303 above, a possible implementation method for obtaining the long-term interest characteristics and short-term interest characteristics of an account is shown for multiple items that the account interacted with in historical interactive behaviors. That is, the long-term interest characteristics are extracted using a first encoder, and the short-term interest characteristics are extracted using a second encoder. Because the first encoder and the second encoder each have strong targeted feature extraction capabilities, the extracted long-term interest characteristics can represent the account's long-term interest preferences for each item (the account's own interest preferences developed over a long period of time and not affected by external factors), while the extracted short-term interest characteristics can represent the account's short-term interest preferences for each item (the account's temporary interest preferences due to external factors).

[0227] In step 304, the server obtains a global encoding feature among the multiple embedded features, where the global encoding feature is used to represent global information after encoding the multiple embedded features.

[0228] In some embodiments, the server may extract the global encoding feature based on a fusion encoder, wherein the fusion encoder is used to extract the global encoding feature. Optionally, the fusion encoder can be any Seq2Seq model with a codec structure, such as GRU, RNN, LSTM, BLSTM, etc. The embodiment of the present disclosure does not specifically limit the structure of the fusion encoder.

[0229] The following uses the GRU model as an example to illustrate the fusion encoder. The input of the GRU model is the embedded feature sequence formed by the multiple embedded features in time sequence, and the output is a latent vector sequence. Each element in the latent vector sequence is the latent vector obtained by encoding each embedded feature in the input embedded feature sequence.

[0230] In some embodiments, the server inputs the multiple embedded features into the fusion encoder, encodes the multiple embedded features, and obtains a latent vector sequence. Optionally, the server obtains the last latent vector in the output latent vector sequence as the global encoding feature, which can simplify the process of obtaining the global encoding feature. In some embodiments, the average vector of each latent vector in the latent vector sequence can also be taken as the global encoding feature, which is not specifically limited in the embodiment of the present disclosure. Among them, the structure and function of the GRU model have been given a detailed introduction in the above step 3032. The fusion encoder and the second sub-encoder can have different parameters, so they are not repeated here.

[0231] It should be noted that in the embodiments of the present disclosure, only the fusion encoder is described as a GRU model as an example, but the fusion encoder can also be an LSTM model, a BLSTM model, etc., and the embodiments of the present disclosure do not specifically limit this.

[0232] In step 305, the server weights the long-term interest feature, the short-term interest feature, the global coding feature, and the embedded feature of the target item to obtain a third weight parameter of the long-term interest feature and a fourth weight parameter of the short-term interest feature.

[0233] The target item refers to the item to be recommended this time.

[0234] In some embodiments, the server may predict the third weight parameter and the fourth weight parameter based on a weight prediction model, wherein the weight prediction model is used to predict the third weight parameter and the fourth weight parameter.

[0235] In some embodiments, the server splices the long-term interest feature, the short-term interest feature, the global coding feature, and the embedded feature of the target item to obtain a spliced ​​feature, inputs the spliced ​​feature into the weight prediction model, performs weighted processing on the spliced ​​feature through the weight prediction model, and outputs the third weight parameter and the fourth weight parameter.

[0236] In the above process, the third weight parameter and the fourth weight parameter are obtained through the weight prediction model, so that the third weight parameter and the fourth weight parameter comprehensively consider the long-term interest characteristics, short-term interest characteristics and global coding characteristics of the account, and also consider the embedded characteristics of the target item. This means that even if recommendations are made for the same account, since the target items to be recommended are different, the third weight parameter and the fourth weight parameter will also be different, making the third weight parameter and the fourth weight parameter more accurate and intelligent. For example, for target items that are more in line with the long-term interest preferences of the account, the third weight parameter of the long-term interest characteristics will usually be given a larger value. Similarly, for target items that are more in line with the short-term interest preferences of the account, the fourth weight parameter of the short-term interest characteristics will usually be given a larger value.

[0237] Optionally, the sum of the third weight parameter and the fourth weight parameter is 1. In this case, the weight prediction model can output only one of the third weight parameter or the fourth weight parameter, and then subtract the parameter output by the model from 1 to obtain the value of the remaining item.

[0238] Optionally, in addition to using the splicing method, the server can also fuse the long-term interest feature, the short-term interest feature, the global coding feature and the embedded feature of the target item by element-by-element addition, element-by-element multiplication, bilinear merging, etc., and input the fused features into the weight prediction model. The embodiment of the present application does not specifically limit this.

[0239] Optionally, the weight prediction model may be any neural network model that can predict weight parameters, for example, the weight prediction model may be MLP, DNN (Deep Neural Network), Attention Network, etc.

[0240] The following uses the MLP model as an example to illustrate the weight prediction model. The MLP model includes an input layer, at least one hidden layer, and an output layer. Each hidden layer includes at least one neuron. In the MLP model, the input layer, each hidden layer, and the output layer are fully connected. Fully connected means that any neuron in the previous layer has a weighted connection with all neurons in the next layer. The input of the MLP model is the concatenated feature obtained by concatenating the long-term interest feature, the short-term interest feature, the global encoding feature, and the embedded feature of the target item. The output of the MLP model is the third weight parameter.

[0241] Optionally, for each neuron in each hidden layer in the MLP model, the output vector of all neurons in the previous hidden layer is used as input, and the output vector of this neuron is input to all neurons in the next hidden layer, so as to fully transmit the full amount of relevant information between layers, so as to improve the prediction accuracy of the weight prediction model for the third weight parameter.

[0242] In some embodiments, for any neuron in any hidden layer, the server may use the weight matrix obtained during training to weight and fuse the output vectors of all neurons in the previous hidden layer through the neuron to obtain the output vector of the neuron. The server performs the above operation for each neuron in each hidden layer, and sets the dimension of the output vector of the last hidden layer to 1 so that the last hidden layer can directly output the third weight parameter. Then, the value obtained by subtracting the third weight parameter from 1 is obtained as the fourth weight parameter.

[0243] It should be noted that here, only the example of MLP outputting the third weight parameter and obtaining the value obtained by subtracting the third weight parameter from 1 as the fourth weight parameter is used for explanation. In some embodiments, the MLP model can also output the fourth weight parameter, and obtain the value obtained by subtracting the fourth weight parameter from 1 as the third weight parameter. In other embodiments, the MLP model can also directly output the third weight parameter and the fourth weight parameter, and ensure that the value obtained by adding the third weight parameter and the fourth weight parameter is 1. The embodiments of the present disclosure do not specifically limit this.

[0244] In the above steps 304-305, a possible implementation method for obtaining the third weight parameter of the long-term interest feature and the fourth weight parameter of the short-term interest feature based on the multiple embedded features, the long-term interest feature, the short-term interest feature and the embedded features of the target item is shown. Since the third weight parameter and the fourth weight parameter are obtained by using a weight prediction model, the third weight parameter can be regarded as the attention coefficient of the long-term interest feature, and the fourth weight parameter can be regarded as the attention coefficient of the short-term interest feature, the weight prediction model can be regarded as an attention network (Attention Network), through which the attention coefficients of the long-term interest feature and the short-term interest feature can be accurately estimated, so that when the two are subsequently fused to obtain the target interest feature, their respective proportions can be better allocated.

[0245] In some embodiments, the multiple embedded features, the long-term interest feature, the short-term interest feature, and the embedded features of the target item can also be input into a single-layer fully connected network, and the third weight parameter can be predicted by the fully connected network, and the value obtained by subtracting the third weight parameter from 1 is obtained as the fourth weight parameter, thereby simplifying the process of obtaining the third weight parameter and the fourth weight parameter. The embodiments of the present application do not specifically limit this.

[0246] In step 306, the server weights the long-term interest feature and the short-term interest feature based on the third weight parameter and the fourth weight parameter, respectively, and fuses the weighted long-term interest feature and the weighted short-term interest feature to obtain the target interest feature of the account.

[0247] In some embodiments, the server may multiply the third weight coefficient by the long-term interest feature to obtain a weighted long-term interest feature, multiply the fourth weight parameter by the short-term interest feature to obtain a weighted short-term interest feature, and add the weighted long-term interest feature and the weighted short-term interest feature element-wise to obtain the target interest feature.

[0248] Optionally, element-wise addition is only one possible implementation method for fusing the weighted long-term interest features and the weighted short-term interest features. In addition, fusion can also be performed by element-wise multiplication, splicing, bilinear merging, etc., and the embodiments of the present disclosure do not specifically limit this.

[0249] In the above steps 304-306, the server fuses the long-term interest feature and the short-term interest feature to obtain a possible implementation method of the target interest feature of the account, so that the target interest feature can not only introduce the account's own long-term interest preferences through the long-term interest feature, but also introduce the account's interest preferences generated by external factors in the short term through the short-term interest feature. Moreover, since the embedded features of the target item are used as an input item of the weight prediction model when calculating the third weight parameter and the fourth weight parameter, the third weight parameter and the fourth weight parameter that match different target items can be adaptively adjusted, thereby greatly improving the expression ability of the target interest feature, which is conducive to improving the accuracy of subsequent item recommendations.

[0250] In an exemplary scenario, assuming that the multiple items that the account interacted with in historical interactive behaviors include: mobile phone A, mobile phone B, clothes C, mobile phone D, mobile phone E, food F, and food G. It can be seen that "mobile phone" represents the long-term interest preference of the account, and "food" represents the short-term interest preference of the account. Assuming that the target item to be recommended is a mobile phone, then the long-term interest features that characterize the long-term interest preferences of the account should be given a higher weight, that is, the third weight parameter should be at least greater than the fourth weight parameter at this time. Conversely, if the target item to be recommended is food, then the short-term interest features that characterize the short-term interest preferences of the account should be given a higher weight, that is, the fourth weight parameter should be at least greater than the third weight parameter at this time.

[0251] In step 307 , the server fuses the target interest feature, the embedded feature of the target item, and the context feature of the target item to obtain a target fused feature.

[0252] The context feature is used to characterize the interactive scene feature when the account interacts with the target item.

[0253] Optionally, the server performs embedding processing on the context information of the account and obtains the processed embedding vector as the context feature. For example, the context information includes but is not limited to: the date, time, geographic location, etc. when the account interacts with the target item. The embodiment of the present disclosure does not specifically limit the context information.

[0254] In some embodiments, the server may concatenate the target interest feature, the embedded feature of the target item, and the context feature to obtain the target fusion feature, thereby simplifying the computational complexity in obtaining the target fusion feature.

[0255] In some embodiments, the server may perform element-wise addition, element-wise multiplication, or bilinear confluence of the target interest feature, the embedded feature of the target item, and the context feature to obtain the target fusion feature. The embodiments of the present disclosure do not specifically limit the method for obtaining the target fusion feature.

[0256] In step 308, the server inputs the target fusion feature into the recommendation model, weights the target fusion feature, and outputs a recommendation probability parameter for the target item.

[0257] Among them, the recommendation probability parameter is used to characterize the account's preference for the target item. This preference is a probability parameter predicted by combining the account's long-term preference and short-term preference.

[0258] Optionally, the server inputs the target fusion feature into the recommendation model, performs weighted processing on the target fusion feature through the recommendation model, and outputs the recommendation probability parameter. Optionally, the recommendation model can be any neural network model capable of predicting probability parameters, for example, the recommendation model can be an MLP, DNN, attention network, etc. The embodiment of this disclosure does not specifically limit the recommendation model type.

[0259] The following description uses the MLP model as an example. The structure of the MLP model has been described in detail in step 305 above, so it will not be repeated here. The input of the recommendation model is the target fusion feature, and the output of the recommendation model is the recommendation probability parameter.

[0260] Optionally, for each neuron in each hidden layer in the MLP model, the output vector of all neurons in the previous hidden layer is used as input, and the output vector of this neuron is input to all neurons in the next hidden layer, so as to fully transmit the full amount of relevant information between layers, so as to improve the prediction accuracy of the recommendation model for the recommendation probability parameters.

[0261] In some embodiments, for any neuron in any hidden layer, the server may use the weight matrix obtained during training to weight and fuse the output vectors of all neurons in the previous hidden layer, thereby obtaining the output vector of that neuron. The server performs the above operation for each neuron in each hidden layer and sets the dimension of the output vector of the last hidden layer to 1, so that the last hidden layer can directly output the recommendation probability parameter.

[0262] In step 309 , in response to the recommendation probability parameter meeting the recommendation condition, the server determines to recommend the target item to the account.

[0263] Optionally, the recommendation condition is that the recommendation probability parameter is greater than a recommendation probability threshold; or, the recommendation condition is that, in a descending order of recommendation probability parameters for a plurality of target items, the recommendation probability parameter of the target item is at the top of the order. The recommendation probability threshold is any value greater than or equal to 0 and less than or equal to 1.

[0264] In some embodiments, in response to the recommendation probability parameter being greater than the recommendation probability threshold, the server recommends the target item to the account. Specifically, the server sends the target item's item information to the terminal logged into the account, causing the terminal to display the target item's item information. The aforementioned recommendation condition determined based on the recommendation probability threshold reduces computational complexity during the recommendation condition determination process, accelerating the rate at which items are recommended.

[0265] In some embodiments, for multiple different target items, the server repeatedly executes steps 301-308 to obtain multiple recommendation probability parameters for the multiple target items. Then, the multiple recommendation probability parameters are sorted in descending order. If the recommendation probability parameter of the target item is in the top target position of the sort (e.g., the top N positions, N ≥ 1), the target item is recommended to the account. That is, the server sends the item information of the target item to the terminal logged in by the account, so that the terminal displays the item information of the target item. The recommendation conditions determined by the ranking of the recommendation probability parameters above enable macro-control of the number of target items recommended to the terminal each time, making the number of recommended items relatively more controllable.

[0266] The above step 309 only shows the processing logic of the server when the recommendation probability parameter meets the recommendation condition. In some embodiments, the server determines not to recommend the target item to the account in response to the recommendation probability parameter not meeting the recommendation condition. In this case, the server can return to step 301 and repeat the execution for the next target item until a target item that meets the recommendation condition is found, and recommend the target item to the account. The embodiment of the present disclosure does not specifically limit this.

[0267] In steps 307-309, the server determines whether to recommend the target item to the account based on the target interest feature and the embedded features of the target item. In this process, the recommendation model not only combines the target interest feature and the embedded features of the target item to recommend items, but also incorporates the contextual features of the target item, making the recommendation process more accurate. In some embodiments, the contextual features can be omitted, and the target interest feature and the embedded features of the target item can be directly fused to obtain a target fused feature. The target fused feature is then input into the recommendation model to predict the recommendation probability parameter, thereby simplifying the computational complexity of the recommendation model.

[0268] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present disclosure, and will not be described in detail here.

[0269] The method provided by the embodiments of the present disclosure extracts long-term interest features and short-term interest features for an account respectively. Since the long-term interest features are global features of all items that the account has interacted with in historical interactive behaviors, they can reflect the long-term interest preferences of the account that do not change with external factors. The short-term interest features are local features of some items that meet the target conditions, and therefore can reflect the short-term interest preferences of the account caused by external factors. This makes it possible to better integrate the two different types of interest preferences of the account, long-term and short-term, into the target interest features, thereby improving the recommendation accuracy of the target items when combining the target interest features for recommendation.

[0270] Figure 5 This is a schematic diagram of the principle of an item recommendation method provided in the embodiment of this application. Please refer to Figure 5 , shows the causal learning framework of the item recommendation method, where U represents User (user, that is, the account corresponding to the user), U l Represents the user's long-term interest preference (i.e., the long-term interest characteristics of the account), U s represents the user's short-term interest preference (i.e., the short-term interest feature of the account), t represents the timestamp, V represents the target item, and Y represents the interaction feature between the user, the user's long-term interest preference, the user's short-term interest preference, and the target item. Y is the target interest feature of the account.

[0271] It can be seen that for time t, the user's long-term interest preference U l It is the relatively stable part of user interest, so it is determined by the user U itself (not related to the time sequence), that is, the long-term interest characteristics depend on the account characteristics; the user's short-term interest preference U s It is the more dynamic part of user interest, so the short-term interest of the user at time t The user U himself and the user's short-term interests at the last moment And the interaction feature Y at the previous moment (t-1) Jointly determined, that is, short-term interest features depend on the feature change information between each embedded feature; the user's interactive feature Y is the user's long-term interest preference U l , short-term interest preference U s And the matching process between the target item V, so the user's interaction feature Y at time t (t) The user U himself and the user's long-term interest preference U l, the user's short-term interest at time t And the target item V at time t (t) Jointly determined, that is, the target interest characteristics are determined by long-term interest characteristics, short-term interest characteristics, and the embedded characteristics of the target item. By analyzing the influencing factors of long-term interest preferences, short-term interest preferences, and interaction characteristics, we can clarify the evolution of user interests, characterize the relationship between users' long-term interest preferences, short-term interest preferences, and interaction characteristics, and describe the difference between users' long-term and short-term interest preferences.

[0272] Figure 6 This is a schematic diagram of the principle of an item recommendation method provided in the embodiment of this application. Please refer to Figure 6 The recommendation system includes: a first encoder 601, a second encoder 602, a fusion prediction GRU model 603 (i.e., a fusion encoder), an attention network 604 (i.e., a weight prediction model), and an MLP model 605 (i.e., a recommendation model). The second encoder 602 includes an RNN model 6021 (i.e., a first sub-encoder) and an evolved GRU model 6022 (i.e., a second sub-encoder).

[0273] On this basis, for the embedded feature sequence t represents the time, u represents the user corresponding to the account, and two independent encoders 601 and 602 are used to extract long-term interest features respectively and short-term interest characteristics Long-term interest characteristics Used to represent the long-term interest preferences and short-term interest characteristics of the user corresponding to the account Used to represent the short-term interest preferences of the user corresponding to the account.

[0274] The first encoder 601 adopts an attention-based pooling model, using the account feature U l To embed feature sequences Perform weighted pooling to output long-term interest features

[0275] The second encoder 602 includes an RNN model 6021 and an evolutionary GRU model 6022. That is, based on the RNN model 6021, an independent evolutionary GRU model 6022 is used to model the evolution information of the user's short-term interests. (i.e., feature change information), the RNN model 6021 is used to embed feature sequences Encoding is performed to obtain a temporal feature sequence. In addition, an attention-based pooling model is superimposed to obtain the feature change information based on the Perform weighted pooling on the temporal feature sequence output by RNN model 6021 to output short-term interest features

[0276] The fusion prediction GRU model 603 is a separate GRU model for embedding feature sequences. The global coding feature is extracted from the fusion prediction GRU model 603, which is the latent vector representation of the final moment of the output.

[0277] Then, the global coding features and the long-term interest features output by the first encoder 601 are combined The short-term interest feature output by the second encoder 602 The embedded features of the target object are fused, and the fused features are input into the attention network 604. The attention network 604 is an MLP model, which outputs a third weight parameter α and a fourth weight parameter 1-α.

[0278] Then, the third weight parameter α and the fourth weight parameter 1-α are used to adjust the long-term interest feature and short-term interest characteristics Performing weighted summation to obtain the target interest feature is equivalent to fusing the user's long-term interest preference and short-term interest preference, and the weight during fusion is the value predicted by the attention network 604 (a value between 0 and 1).

[0279] Finally, the recommendation probability parameters of the target item will be fused through the target interest features, the embedded features of the target item and the context features, and the fused target fusion features will be input into the MLP model 605, which will predict the recommendation probability parameters of the target item.

[0280] In an embodiment of the present application, through the first encoder 601 and the second encoder 602, a disentangled representation feature can be learned for the user's long-term interest preferences and the user's short-term interest preferences, that is, the long-term interest feature models the long-term interest preference without highlighting the local information of the short-term interest preference, and the short-term interest feature models the short-term interest preference without highlighting the global information of the long-term interest preference. In addition, taking into account the embedded feature sequence and the target item at the same time, the importance of the long-term interest preference (the third weight parameter) and the importance of the short-term interest preference (the fourth weight parameter) are adaptively determined through the attention network 604, so that the fusion process of long-term and short-term interest preferences has higher accuracy, and on this basis, a recommendation system for the user's long-term and short-term interest preferences is modeled, so that the recommendation system can not only recommend target items that meet the short-term interest preferences to the user's corresponding account, but also recommend target items that meet the long-term interest preferences to the user's corresponding account, thereby greatly improving the accuracy of item recommendations.

[0281] also, Figure 6The figure also shows the loss function used when training the first encoder 601 and the second encoder 602. That is, during the training process, the embedded feature sequence includes multiple sample embedded features of multiple sample items. Since the long-term interest preference represents the general interest of the user, the mean of all sample embedded features in the entire embedded feature sequence can be taken as the standard value output by the first encoder 601. (i.e., standard long-term interest features). Since short-term interest preferences represent the dynamic changes in the user's interests in short-term interactions, the average of the k (k ≥ 1) sample embedding features closest to time t-1 in the embedding feature sequence can be taken as the standard value output by the second encoder 602. (i.e., standard short-term interest features). Furthermore, a self-supervised approach can be used to learn the model parameters of each model in the recommendation system. For example, the sample long-term interest features and the standard long-term interest features output by the first encoder 601, and the sample short-term interest features and the standard short-term interest features output by the second encoder 602 are subjected to similarity comparison learning, and the loss function value (i.e., comparative loss) of each iterative process is obtained. If the loss function value does not meet the stopping condition, the model parameters of each model in the recommendation system are adjusted, and training is performed iteratively. The parameter function value of the next iterative process is obtained until the loss function value meets the stopping condition, and the training is stopped. The comparative learning method will be described in detail in the next embodiment.

[0282] Figure 7 This is a training flow chart of an item recommendation method provided in an embodiment of the present application. Please refer to Figure 7 This embodiment is applied to an electronic device and is described by taking the electronic device as a server as an example. This embodiment includes:

[0283] In step 701, the server obtains a plurality of sample embedding features corresponding to each of the plurality of sample items based on the plurality of sample items that the sample account interacted with in historical interactive behaviors.

[0284] The above step 701 is similar to the above step 301 and will not be described in detail here.

[0285] In step 702, the server obtains a standard long-term interest feature and a standard short-term interest feature, where the standard long-term interest feature is the average value of the multiple sample embedded features, and the standard short-term interest feature is the average value of the sample embedded features of some items in the multiple sample items that meet the target conditions.

[0286] Optionally, the server obtains an average value of the multiple sample embedded features as the standard long-term interest feature.

[0287] Optionally, the server obtains an average value of the sample embedded features of some items that meet the target condition among the multiple sample items as the standard short-term interest feature.

[0288] Optionally, the target condition refers to the last K (K≥1) items in a sequence of items sorted in ascending order according to the timestamps of the interaction with the account, that is, the partial items that meet the target condition refer to the K items that have recently interacted with the account.

[0289] Optionally, the target condition may also refer to the time difference between the timestamp of the interaction behavior with the account and the current moment being less than the interaction sampling threshold, and the interaction sampling threshold is any value greater than 0. For example, when the interaction sampling threshold is 1 day, the partial items that meet the target condition refer to the various items that the account has interacted with in the past 1 day. The embodiment of the present disclosure does not specifically limit the target condition.

[0290] In step 703, the server inputs the multiple sample embedding features into the first initial encoder and the second initial encoder respectively, and outputs the sample long-term interest features and the sample short-term interest features of the sample account.

[0291] Optionally, the server inputs the multiple sample embedded features into the first initial encoder and outputs the sample long-term interest features of the sample account. The process of obtaining the sample long-term interest features is similar to the above step 302 and will not be repeated here.

[0292] Optionally, the server inputs the multiple sample embedding features into the second initial encoder, extracts multiple sample time series features corresponding to each of the multiple sample embedding features, performs weighted pooling on the multiple sample time series features, and outputs the sample short-term interest features of the sample account. The process of obtaining the sample short-term interest features is similar to step 303 above and is not further described here.

[0293] In step 704 , the server obtains a first similarity, a second similarity, a third similarity, and a fourth similarity.

[0294] Among them, the first similarity is the similarity between the long-term interest characteristics of the sample and the long-term interest characteristics of the standard. The larger the first similarity, the more similar the long-term interest characteristics of the sample are to the long-term interest characteristics of the standard. The smaller the first similarity, the greater the difference between the long-term interest characteristics of the sample and the long-term interest characteristics of the standard.

[0295] Optionally, the server obtains the vector inner product between the sample long-term interest feature and the standard long-term interest feature as the first similarity.

[0296] Optionally, the server obtains the cosine similarity between the sample long-term interest feature and the standard long-term interest feature as the first similarity.

[0297] Optionally, the server obtains the inverse of the Euclidean distance between the sample long-term interest feature and the standard long-term interest feature as the first similarity.

[0298] Optionally, the server concatenates the sample long-term interest feature with the standard long-term interest feature, inputs the concatenated feature into an MLP model, performs weighted processing on the concatenated feature through the MLP model, and sets the dimension of the output vector of the last hidden layer to 1, so that the last hidden layer can directly output the first similarity.

[0299] Among them, the second similarity is the similarity between the long-term interest characteristics of the sample and the standard short-term interest characteristics. The larger the second similarity, the more similar the long-term interest characteristics of the sample are to the standard short-term interest characteristics. The smaller the second similarity, the greater the difference between the long-term interest characteristics of the sample and the standard short-term interest characteristics.

[0300] Optionally, the server obtains the vector inner product between the sample long-term interest feature and the standard short-term interest feature as the second similarity.

[0301] Optionally, the server obtains the cosine similarity between the sample long-term interest feature and the standard short-term interest feature as the second similarity.

[0302] Optionally, the server obtains the inverse of the Euclidean distance between the sample long-term interest feature and the standard short-term interest feature as the second similarity.

[0303] Optionally, the server concatenates the long-term interest feature of the sample with the standard short-term interest feature, inputs the concatenated feature into an MLP model, performs weighted processing on the concatenated feature through the MLP model, and sets the dimension of the output vector of the last hidden layer to 1, so that the last hidden layer can directly output the second similarity.

[0304] Among them, the third similarity is the similarity between the sample short-term interest characteristics and the standard short-term interest characteristics. The larger the third similarity, the more similar the sample short-term interest characteristics are to the standard short-term interest characteristics. The smaller the third similarity, the greater the difference between the sample short-term interest characteristics and the standard short-term interest characteristics.

[0305] Optionally, the server obtains the vector inner product between the sample short-term interest feature and the standard short-term interest feature as the third similarity.

[0306] Optionally, the server obtains the cosine similarity between the sample short-term interest feature and the standard short-term interest feature as the third similarity.

[0307] Optionally, the server obtains the inverse of the Euclidean distance between the sample short-term interest feature and the standard short-term interest feature as the third similarity.

[0308] Optionally, the server concatenates the sample short-term interest feature with the standard short-term interest feature, inputs the concatenated feature into an MLP model, performs weighted processing on the concatenated feature through the MLP model, and sets the dimension of the output vector of the last hidden layer to 1, so that the last hidden layer can directly output the third similarity.

[0309] Among them, the fourth similarity is the similarity between the short-term interest characteristics of the sample and the long-term interest characteristics of the standard. The larger the fourth similarity, the more similar the short-term interest characteristics of the sample are to the long-term interest characteristics of the standard. The smaller the fourth similarity, the greater the difference between the short-term interest characteristics of the sample and the long-term interest characteristics of the standard.

[0310] Optionally, the server obtains the vector inner product between the sample short-term interest feature and the standard long-term interest feature as the fourth similarity.

[0311] Optionally, the server obtains the cosine similarity between the sample short-term interest feature and the standard long-term interest feature as the fourth similarity.

[0312] Optionally, the server obtains the inverse of the Euclidean distance between the sample short-term interest feature and the standard long-term interest feature as the fourth similarity.

[0313] Optionally, the server concatenates the sample short-term interest feature with the standard long-term interest feature, inputs the concatenated feature into an MLP model, performs weighted processing on the concatenated feature through the MLP model, and sets the dimension of the output vector of the last hidden layer to 1, so that the last hidden layer can directly output the fourth similarity.

[0314] In step 705 , the server obtains a first difference and a second difference, where the first difference is the difference between the first similarity and the second similarity, and the second difference is the difference between the third similarity and the fourth similarity.

[0315] In some embodiments, the server subtracts the first similarity from the second similarity to obtain the first difference; and subtracts the third similarity from the fourth similarity to obtain the second difference.

[0316] In step 706, the server obtains the loss function value of this iterative process based on the first difference and the second difference.

[0317] Optionally, a value obtained by adding the first difference and the second difference is obtained as the loss function value of this iterative process.

[0318] In the above steps 704-706, the server obtains the loss function value of this iteration process based on the sample long-term interest feature, the sample short-term interest feature, the standard long-term interest feature and the standard short-term interest feature, which can improve the accuracy of the loss function value.

[0319] In some embodiments, the server may also add the first similarity and the third similarity to obtain the loss function value; or, the server may also add the second similarity and the fourth similarity to obtain the loss function value. The embodiment of the present disclosure does not specifically limit the method for obtaining the loss function value.

[0320] In step 707, the server iteratively trains the first initial encoder and the second initial encoder until a stop condition is met, thereby obtaining a first encoder and a second encoder.

[0321] The first encoder is used to extract the long-term interest features of the account, and the second encoder is used to extract the short-term interest features of the account.

[0322] Optionally, if the loss function value does not meet the stopping condition, the server adjusts the model parameters of the first initial encoder and the second initial encoder (or can also adjust the fusion encoder, the weight prediction model and the recommendation model at the same time), and repeats the process of extracting long-term interest features, short-term interest features, and obtaining the loss function value until any loss function value meets the stopping condition, stops training, and obtains the first encoder and the second encoder.

[0323] Optionally, the stopping condition may be that the number of iterations exceeds a target number, and the target number may be any number greater than or equal to 1.

[0324] Optionally, when the loss function value is the sum of the first difference and the second difference, the stopping condition may be that the loss function value is negative and is less than the loss threshold, or the stopping condition may be that the loss function value is logarithmized and then negative and is less than the loss threshold, wherein the loss threshold may be any value greater than or equal to 0. The embodiments of the present disclosure do not specifically limit the content of the stopping condition.

[0325] Optionally, when the loss function value is the sum of the first similarity and the third similarity, the stopping condition may be that the loss function value is negated and is less than the loss threshold, or the stopping condition may be that the loss function value is logarithmized and then negated and is less than the loss threshold, wherein the loss threshold may be any value greater than or equal to 0. The embodiment of the present disclosure does not specifically limit the content of the stopping condition.

[0326] Optionally, when the loss function value is the sum of the second similarity and the fourth similarity, the stopping condition may be that the loss function value is less than a loss threshold, where the loss threshold may be any value greater than or equal to 0. The embodiment of the present disclosure does not specifically limit the content of the stopping condition.

[0327] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present disclosure, and will not be described in detail here.

[0328] The method provided in the embodiment of the present application trains the first encoder and the second encoder in a self-supervised manner, so that the long-term interest features extracted by the first encoder can accurately represent the user's long-term interest preferences without highlighting the local information of the short-term interest preferences, and the short-term interest features extracted by the second encoder can accurately represent the user's short-term interest preferences without highlighting the global information of the long-term interest preferences, thereby constructing a de-entangled feature extraction method, so that the subsequent item recommendation process has higher accuracy.

[0329] Table 1 shows the test results of the item recommendation method provided in an embodiment of the present application and traditional recommendation systems 1 and 2 on dataset A, where recommendation system 1 refers to session-based recommendations based on the RNN model (Session-Based Recommendations with Recurrent Neural Networks), and recommendation system 2 refers to constructing a new RNN structure to model user sequences and using the attention mechanism to fuse long- and short-term interests to achieve personalized recommendations (Adaptive User Modeling with Long and Short-Term Preferences for Personalized Recommendation).

[0330] Table 1

[0331] AUC GAUC MRR NDCG Recommender System 1 0.8635 0.8680 0.3993 0.3422 Recommender System 2 0.8664 0.8669 0.3617 0.2971 This application 0.8953 0.8936 0.4372 0.3788

[0332] Table 1 uses four different recommendation system performance indicators: AUC (Area Under ROC, which refers to the area formed by the ROC curve and the coordinate axis), GAUC (Group AUC, group AUC), MRR (Mean Reciprocal Rank, average ranking reciprocal), and NDCG (Normalized Discounted Cumulative Gain, normalized discounted cumulative gain). Among them, the ROC curve refers to the Receiver Operating Characteristic curve.

[0333] Table 2 shows the test results of the above-mentioned recommendation systems 1 and 2 on dataset B for the item recommendation method provided in the embodiments of the present application, using the same four performance indicators.

[0334] Table 2

[0335] AUC GAUC MRR NDCG Recommender System 1 0.8193 0.8298 0.9166 0.9384 Recommender System 2 0.7978 0.8128 0.9075 0.9318 This application 0.8302 0.8405 0.9262 0.9455

[0336] It can be seen from Tables 1 and 2 that, regardless of dataset A or dataset B, the item recommendation method provided in the embodiment of the present application has significant performance improvements in four different performance indicators compared to traditional recommendation systems 1 and 2. The degree of improvement in the accuracy of the recommendation results can be seen from the AUC indicator. The item recommendation method provided in the embodiment of the present application has an AUC indicator on dataset A that is improved by 0.03, and an NDCG indicator that is improved by more than 10%. The AUC indicator on dataset B is improved by 0.02, and the NDCG indicator is improved by more than 1%.

[0337] Figure 8 FIG. 1 is a logical structure diagram of an item recommendation device according to an exemplary embodiment. Figure 8 , the device comprises:

[0338] An acquisition unit 801 is configured to acquire a long-term interest feature and a short-term interest feature of an account based on multiple items interacted with in historical interactive behaviors, wherein the long-term interest feature is a global feature of the multiple items, and the short-term interest feature is a local feature of some items in the multiple items that meet a target condition;

[0339] A fusion unit 802 is configured to fuse the long-term interest feature and the short-term interest feature to obtain a target interest feature of the account;

[0340] The determination unit 803 is configured to determine whether to recommend the target item to the account based on the target interest feature and the embedded feature of the target item, where the embedded feature is used to characterize the inherent characteristics of the corresponding item.

[0341] The device provided by the embodiment of the present disclosure extracts long-term interest features and short-term interest features for an account respectively. Since the long-term interest features are global features of all items that the account has interacted with in historical interactive behaviors, they can reflect the long-term interest preferences of the account that do not change with external factors. The short-term interest features are local features of some items that meet the target conditions, and therefore can reflect the short-term interest preferences of the account caused by external factors. This makes it possible to better integrate the two different types of interest preferences of the account, long-term and short-term, into the target interest features, thereby improving the recommendation accuracy of the target items when combining the target interest features for recommendation.

[0342] In one possible implementation, based on Figure 8 The acquisition unit 801 includes:

[0343] A first acquiring subunit is configured to acquire a plurality of embedded features corresponding to each of the plurality of objects;

[0344] A second acquisition subunit is configured to input the plurality of embedded features into the first encoder, and acquire a plurality of first weight parameters corresponding to each of the plurality of embedded features based on the account features of the account;

[0345] The first fusion subunit is configured to respectively weight the multiple embedded features based on the multiple first weight parameters, fuse the weighted multiple embedded features, and output the long-term interest feature.

[0346] In one possible implementation, based on Figure 8 The acquisition unit 801 includes:

[0347] A first acquiring subunit is configured to acquire a plurality of embedded features corresponding to each of the plurality of objects;

[0348] The extraction and pooling subunit is configured to input the multiple embedded features into the second encoder, extract multiple time series features corresponding to each of the multiple embedded features, perform weighted pooling on the multiple time series features, and output the short-term interest feature.

[0349] In one possible implementation, based on Figure 8 The extraction and pooling subunit comprises:

[0350] The encoding sub-subunit is configured to execute a first sub-encoder that inputs the multiple embedded features into the second encoder, encode the multiple embedded features, and output the multiple time series features.

[0351] In one possible implementation, based on Figure 8 The extraction and pooling subunit comprises:

[0352] an extraction sub-subunit, configured to execute a second sub-encoder inputting the plurality of embedded features into the second encoder, and extract feature change information between the plurality of embedded features;

[0353] The first acquisition sub-subunit is configured to acquire the short-term interest feature based on the feature change information and the multiple time series features.

[0354] In one possible implementation, the first acquisition sub-subunit is configured to execute:

[0355] Based on the feature change information, obtaining a plurality of second weight parameters corresponding to each of the plurality of time series features;

[0356] Based on the multiple second weight parameters, the multiple time series features are weighted respectively, and the weighted multiple time series features are fused to obtain the short-term interest feature.

[0357] In one possible implementation, based on Figure 8 The device further comprises a training unit, which includes:

[0358] A third acquisition subunit is configured to execute, based on a plurality of sample items interacted with by the sample account in historical interactive behaviors, to acquire a plurality of sample embedding features corresponding to each of the plurality of sample items;

[0359] An input-output subunit is configured to input the multiple sample embedding features into a first initial encoder and a second initial encoder respectively, and output a sample long-term interest feature and a sample short-term interest feature of the sample account;

[0360] a fourth acquisition subunit configured to acquire a loss function value of this iteration process based on the sample long-term interest feature, the sample short-term interest feature, the standard long-term interest feature, and the standard short-term interest feature, wherein the standard long-term interest feature is an average value of the multiple sample embedding features, and the standard short-term interest feature is an average value of the sample embedding features of some items in the multiple sample items that meet the target condition;

[0361] The iterative training subunit is configured to perform iterative training on the first initial encoder and the second initial encoder until a stopping condition is met, thereby obtaining a first encoder and a second encoder, wherein the first encoder is used to extract the long-term interest features of the account, and the second encoder is used to extract the short-term interest features of the account.

[0362] In one possible implementation, the fourth acquiring subunit is configured to execute:

[0363] Obtaining a first similarity, a second similarity, a third similarity, and a fourth similarity, wherein the first similarity is the similarity between the long-term interest feature of the sample and the standard long-term interest feature, the second similarity is the similarity between the long-term interest feature of the sample and the standard short-term interest feature, the third similarity is the similarity between the short-term interest feature of the sample and the standard short-term interest feature, and the fourth similarity is the similarity between the short-term interest feature of the sample and the standard long-term interest feature;

[0364] Obtaining a first difference and a second difference, the first difference being the difference between the first similarity and the second similarity, and the second difference being the difference between the third similarity and the fourth similarity;

[0365] Based on the first difference and the second difference, the loss function value is obtained.

[0366] In one possible implementation, based on Figure 8 The fusion unit 802 includes:

[0367] A first acquiring subunit is configured to acquire a plurality of embedded features corresponding to each of the plurality of objects;

[0368] a fifth acquiring subunit, configured to acquire a third weight parameter of the long-term interest feature and a fourth weight parameter of the short-term interest feature based on the multiple embedded features, the long-term interest feature, the short-term interest feature, and the embedded feature of the target item;

[0369] The second fusion subunit is configured to perform weighting on the long-term interest feature and the short-term interest feature based on the third weight parameter and the fourth weight parameter, respectively, and fuse the weighted long-term interest feature and the weighted short-term interest feature to obtain the target interest feature.

[0370] In one possible implementation, based on Figure 8 The fifth acquisition subunit includes:

[0371] A second acquisition sub-subunit is configured to acquire a global encoding feature between the multiple embedded features, where the global encoding feature is used to represent global information after encoding the multiple embedded features;

[0372] The weighting sub-subunit is configured to perform weighting on the long-term interest feature, the short-term interest feature, the global coding feature and the embedded feature of the target item to obtain the third weight parameter and the fourth weight parameter.

[0373] In one possible implementation, the second acquisition sub-subunit is configured to execute:

[0374] The multiple embedded features are input into a fusion encoder, the multiple embedded features are encoded to obtain a latent vector sequence, and the last latent vector in the latent vector sequence is obtained as the global encoding feature.

[0375] In one possible implementation, the weighting sub-subunit is configured to perform:

[0376] Splicing the long-term interest feature, the short-term interest feature, the global coding feature, and the embedded feature of the target object to obtain a spliced ​​feature;

[0377] The splicing feature is input into a weight prediction model, weighted processing is performed on the splicing feature, and the third weight parameter and the fourth weight parameter are output, where the sum of the third weight parameter and the fourth weight parameter is 1.

[0378] In one possible implementation, the determining unit 803 is configured to execute:

[0379] The target interest feature, the embedded feature of the target item, and the context feature of the target item are fused to obtain a target fusion feature. The context feature is used to characterize the interactive scene feature when the account interacts with the target item.

[0380] The target fusion feature is input into the recommendation model, the target fusion feature is weighted, and a recommendation probability parameter of the target item is output. The recommendation probability parameter is used to represent the account's preference for the target item;

[0381] In response to the recommendation probability parameter meeting the recommendation condition, determining to recommend the target item to the account;

[0382] In response to the recommendation probability parameter not meeting the recommendation condition, it is determined that the target item is not recommended to the account.

[0383] In one possible implementation, the recommendation condition is that the recommendation probability parameter is greater than a recommendation probability threshold; or, the recommendation condition is that among multiple recommendation probability parameters of multiple target items sorted from large to small, the recommendation probability parameter of the target item is at the front target position in the sorting.

[0384] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present disclosure, and will not be described in detail here.

[0385] Regarding the device in the above embodiment, the specific manner in which each unit performs operations has been described in detail in the embodiment of the item recommendation method and will not be elaborated here.

[0386] Figure 9 The following is a block diagram of an electronic device provided by an exemplary embodiment of the present disclosure, using terminal 900 as an example. Terminal 900 may be a smartphone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 player (Moving Picture Experts Group Audio Layer IV), a laptop computer, or a desktop computer. Terminal 900 may also be referred to as user equipment, a portable terminal, a laptop terminal, a desktop terminal, or other similar names.

[0387] Typically, the terminal 900 includes a processor 901 and a memory 902 .

[0388] The processor 901 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 901 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor 901 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 901 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 901 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0389] Memory 902 may include one or more computer-readable storage media, which may be non-transitory. Memory 902 may also include high-speed random access memory and non-volatile memory, such as one or more magnetic disk storage devices or flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in memory 902 is used to store at least one instruction, which is executed by processor 901 to implement the item recommendation method provided in various embodiments of the present disclosure.

[0390] In some embodiments, terminal 900 may optionally include a peripheral device interface 903 and at least one peripheral device. The processor 901, memory 902, and peripheral device interface 903 may be connected via a bus or signal lines. Each peripheral device may be connected to peripheral device interface 903 via a bus, signal lines, or circuit boards. Specifically, the peripheral device may include at least one of a radio frequency circuit 904, a touchscreen display 905, a camera assembly 906, an audio circuit 907, a positioning assembly 908, and a power supply 909.

[0391] The peripheral device interface 903 can be used to connect at least one I / O (Input / Output)-related peripheral device to the processor 901 and the memory 902. In some embodiments, the processor 901, the memory 902, and the peripheral device interface 903 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 901, the memory 902, and the peripheral device interface 903 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.

[0392] The RF circuit 904 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 904 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 904 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the RF circuit 904 includes an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. The RF circuit 904 can communicate with other terminals via at least one wireless communication protocol. Such wireless communication protocols include, but are not limited to, metropolitan area networks, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 904 may also include circuits related to NFC (Near Field Communication), which is not limited in this disclosure.

[0393] Display screen 905 is used to display a user interface (UI). This UI can include graphics, text, icons, videos, or any combination thereof. When display screen 905 is a touchscreen display, it can also capture touch signals on or above the surface of display screen 905. These touch signals can be input as control signals to processor 901 for processing. Display screen 905 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there can be a single display screen 905, located on the front panel of terminal 900. In other embodiments, there can be at least two display screens 905, located on different surfaces of terminal 900 or in a foldable design. In still other embodiments, display screen 905 can be a flexible display, located on a curved or foldable surface of terminal 900. Display screen 905 can also be configured as a non-rectangular, irregular shape, i.e., a special-shaped screen. Display screen 905 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).

[0394] The camera assembly 906 is used to capture images or videos. Optionally, the camera assembly 906 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 906 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.

[0395] The audio circuit 907 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals to be input into the processor 901 for processing, or input into the radio frequency circuit 904 to achieve voice communication. For the purpose of stereo sound collection or noise reduction, there may be multiple microphones, each located in different parts of the terminal 900. The microphone may also be an array microphone or an omnidirectional collection microphone. The speaker is used to convert electrical signals from the processor 901 or the radio frequency circuit 904 into sound waves. The speaker may be a traditional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert electrical signals into sound waves audible to humans, but also convert electrical signals into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 907 may also include a headphone jack.

[0396] Positioning component 908 is used to locate the current geographic location of terminal 900 to implement navigation or LBS (Location Based Service). Positioning component 908 can be based on the US GPS (Global Positioning System), China's Beidou system, Russia's Greninja system, or the European Union's Galileo system.

[0397] Power supply 909 is used to power various components in terminal 900. Power supply 909 can be AC ​​power, DC power, disposable batteries, or rechargeable batteries. When power supply 909 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.

[0398] In some embodiments, the terminal 900 further includes one or more sensors 910 , including but not limited to: an acceleration sensor 911 , a gyroscope sensor 912 , a pressure sensor 913 , a fingerprint sensor 914 , an optical sensor 915 , and a proximity sensor 916 .

[0399] The accelerometer 911 can detect the magnitude of acceleration along the three coordinate axes of the coordinate system established by the terminal 900. For example, the accelerometer 911 can be used to detect the components of gravity acceleration along the three coordinate axes. The processor 901 can control the touch screen display 905 to display the user interface in a landscape or portrait view based on the gravity acceleration signal collected by the accelerometer 911. The accelerometer 911 can also be used to collect game or user motion data.

[0400] The gyroscope sensor 912 can detect the orientation and rotation angle of the terminal 900. It can work with the accelerometer 911 to collect the user's 3D movements on the terminal 900. Based on the data collected by the gyroscope sensor 912, the processor 901 can implement the following functions: motion sensing (for example, changing the UI based on the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.

[0401] The pressure sensor 913 can be set on the side frame of the terminal 900 and / or the lower layer of the touch screen display 905. When the pressure sensor 913 is set on the side frame of the terminal 900, it can detect the user's grip signal of the terminal 900, and the processor 901 performs left and right hand recognition or shortcut operations based on the grip signal collected by the pressure sensor 913. When the pressure sensor 913 is set on the lower layer of the touch screen display 905, the processor 901 controls the operable controls on the UI interface based on the user's pressure operation on the touch screen display 905. The operable controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.

[0402] The fingerprint sensor 914 is used to collect the user's fingerprint. The processor 901 identifies the user's identity based on the fingerprint collected by the fingerprint sensor 914, or the fingerprint sensor 914 identifies the user's identity based on the collected fingerprint. When the user's identity is identified as a trusted identity, the processor 901 authorizes the user to perform relevant sensitive operations, such as unlocking the screen, viewing encrypted information, downloading software, making payments, and changing settings. The fingerprint sensor 914 can be set on the front, back, or side of the terminal 900. When a physical button or manufacturer logo is set on the terminal 900, the fingerprint sensor 914 can be integrated with the physical button or manufacturer logo.

[0403] The optical sensor 915 is used to detect ambient light intensity. In one embodiment, the processor 901 can control the display brightness of the touchscreen display 905 based on the ambient light intensity detected by the optical sensor 915. Specifically, when the ambient light intensity is high, the display brightness of the touchscreen display 905 is increased; when the ambient light intensity is low, the display brightness of the touchscreen display 905 is decreased. In another embodiment, the processor 901 can also dynamically adjust the shooting parameters of the camera assembly 906 based on the ambient light intensity detected by the optical sensor 915.

[0404] Proximity sensor 916, also known as a distance sensor, is typically located on the front panel of terminal 900. Proximity sensor 916 is used to detect the distance between the user and the front of terminal 900. In one embodiment, when proximity sensor 916 detects that the distance between the user and the front of terminal 900 is gradually decreasing, processor 901 controls touchscreen display 905 to switch from the screen-on state to the screen-off state. When proximity sensor 916 detects that the distance between the user and the front of terminal 900 is gradually increasing, processor 901 controls touchscreen display 905 to switch from the screen-off state to the screen-on state.

[0405] Those skilled in the art will understand that Figure 9 The structure shown in the figure does not constitute a limitation on the terminal 900, and the terminal 900 may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.

[0406] Figure 10 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. The electronic device 1000 may have relatively large differences due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 1001 and one or more memories 1002, wherein the memory 1002 stores at least one program code, and the at least one program code is loaded and executed by the processor 1001 to implement the item recommendation method provided by each of the above embodiments. Of course, the electronic device 1000 may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output. The electronic device 1000 may also include other components for implementing device functions, which will not be described here.

[0407] In an exemplary embodiment, a computer-readable storage medium including at least one instruction is further provided, such as a memory including at least one instruction. The at least one instruction can be executed by a processor in an electronic device to perform the item recommendation method in the above embodiment. Optionally, the computer-readable storage medium can be a non-transitory computer-readable storage medium. For example, the non-transitory computer-readable storage medium can include ROM (Read-Only Memory), RAM (Random-Access Memory), CD-ROM (Compact Disc Read-Only Memory), magnetic tape, floppy disk, optical data storage device, etc.

[0408] In an exemplary embodiment, a computer program product is also provided, including one or more instructions, which can be executed by a processor of an electronic device to implement the item recommendation method provided by each of the above embodiments.

[0409] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the following claims.

[0410] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. An item recommendation method, characterized in that: include: Based on multiple items that the account interacted with in historical interactive behaviors, multiple embedded features corresponding to each of the multiple items are obtained, and the long-term interest features and short-term interest features of the account are obtained. The long-term interest features are global features of the multiple items, and the short-term interest features are local features of some of the multiple items that meet the target conditions; Obtaining a global encoding feature among the multiple embedded features, where the global encoding feature is used to represent global information after encoding the multiple embedded features; splicing the long-term interest feature, the short-term interest feature, the global coding feature, and the embedded feature of the target object to obtain a spliced ​​feature; Inputting the splicing features into a weight prediction model, performing weighted processing on the splicing features, and outputting a third weight parameter of the long-term interest feature and a fourth weight parameter of the short-term interest feature, wherein the target item refers to the item to be recommended this time, and the sum of the third weight parameter and the fourth weight parameter is 1; Based on the third weight parameter and the fourth weight parameter, weighting the long-term interest feature and the short-term interest feature respectively, and fusing the weighted long-term interest feature and the weighted short-term interest feature to obtain a target interest feature; Based on the target interest feature and the embedded feature of the target item, it is determined whether to recommend the target item to the account, where the embedded feature is used to characterize the inherent characteristics of the corresponding item.

2. The method according to claim 1, characterized in that The acquiring of the long-term interest characteristics of the account includes: Inputting the plurality of embedded features into a first encoder, and obtaining a plurality of first weight parameters corresponding to each of the plurality of embedded features based on the account features of the account; Based on the multiple first weight parameters, the multiple embedded features are weighted respectively, the weighted multiple embedded features are fused, and the long-term interest feature is output.

3. The method according to claim 1, characterized in that The acquiring of the short-term interest characteristics of the account includes: The multiple embedded features are input into a second encoder, multiple time series features corresponding to each of the multiple embedded features are extracted, weighted pooling is performed on the multiple time series features, and the short-term interest feature is output.

4. The method according to claim 3, characterized in that Extracting a plurality of time series features corresponding to each of the plurality of embedded features comprises: The multiple embedded features are input into a first sub-encoder in the second encoder, the multiple embedded features are encoded, and the multiple time series features are output.

5. The method according to claim 3, characterized in that The performing weighted pooling on the multiple time series features to output the short-term interest feature includes: inputting the plurality of embedded features into a second sub-encoder in the second encoder, and extracting feature change information between the plurality of embedded features; The short-term interest feature is acquired based on the feature change information and the multiple time series features.

6. The method according to claim 5, characterized in that The acquiring the short-term interest feature based on the feature change information and the multiple time series features includes: Based on the feature change information, obtaining a plurality of second weight parameters corresponding to each of the plurality of time series features; Based on the multiple second weight parameters, the multiple time series features are weighted respectively, and the weighted multiple time series features are fused to obtain the short-term interest feature.

7. The method according to claim 1, characterized in that The method further comprises: Based on multiple sample items interacted with by the sample account in historical interactive behaviors, obtaining multiple sample embedding features corresponding to each of the multiple sample items; Inputting the plurality of sample embedding features into a first initial encoder and a second initial encoder respectively, and outputting a sample long-term interest feature and a sample short-term interest feature of the sample account; Obtaining a loss function value for this iteration based on the sample long-term interest feature, the sample short-term interest feature, the standard long-term interest feature, and the standard short-term interest feature, wherein the standard long-term interest feature is the average value of the multiple sample embedding features, and the standard short-term interest feature is the average value of the sample embedding features of some items in the multiple sample items that meet the target condition; The first initial encoder and the second initial encoder are iteratively trained until a stopping condition is met, thereby obtaining a first encoder and a second encoder, wherein the first encoder is used to extract long-term interest features of an account, and the second encoder is used to extract short-term interest features of an account.

8. The method according to claim 7, characterized in that The acquiring of the loss function value of this iteration process based on the sample long-term interest feature, the sample short-term interest feature, the standard long-term interest feature, and the standard short-term interest feature includes: Obtaining a first similarity, a second similarity, a third similarity, and a fourth similarity, wherein the first similarity is the similarity between the sample long-term interest feature and the standard long-term interest feature, the second similarity is the similarity between the sample long-term interest feature and the standard short-term interest feature, the third similarity is the similarity between the sample short-term interest feature and the standard short-term interest feature, and the fourth similarity is the similarity between the sample short-term interest feature and the standard long-term interest feature; Obtaining a first difference and a second difference, wherein the first difference is the difference between the first similarity and the second similarity, and the second difference is the difference between the third similarity and the fourth similarity; The loss function value is obtained based on the first difference and the second difference.

9. The method according to claim 1, characterized in that The obtaining of the global encoding feature among the multiple embedded features comprises: The multiple embedded features are input into a fusion encoder, the multiple embedded features are encoded to obtain a latent vector sequence, and the last latent vector in the latent vector sequence is obtained as the global encoding feature.

10. The method according to claim 1, characterized in that The determining whether to recommend the target item to the account based on the target interest feature and the embedded feature of the target item includes: The target interest feature, the embedded feature of the target item, and the context feature of the target item are fused to obtain a target fusion feature, where the context feature is used to characterize the interactive scene feature when the account interacts with the target item; Inputting the target fusion feature into the recommendation model, weighting the target fusion feature, and outputting a recommendation probability parameter for the target item, wherein the recommendation probability parameter is used to represent the preference of the account for the target item; In response to the recommendation probability parameter meeting a recommendation condition, determining to recommend the target item to the account; In response to the recommendation probability parameter not meeting the recommendation condition, determining not to recommend the target item to the account.

11. The method according to claim 10, characterized in that The recommendation condition is that the recommendation probability parameter is greater than the recommendation probability threshold; or, the recommendation condition is that among the multiple recommendation probability parameters of multiple target items sorted from large to small, the recommendation probability parameter of the target item is at the front target position in the sorting.

12. An item recommendation device, characterized in that: include: an acquisition unit configured to acquire, based on a plurality of items interacted with by an account in historical interactive behaviors, a plurality of embedded features corresponding to each of the plurality of items, and acquire a long-term interest feature and a short-term interest feature of the account, wherein the long-term interest feature is a global feature of the plurality of items, and the short-term interest feature is a local feature of some of the plurality of items that meet a target condition; The fusion unit includes a fifth acquisition subunit and a second fusion subunit, the fifth acquisition subunit includes a second acquisition subunit and a weighting subunit, the second acquisition subunit is configured to execute acquisition of a global coding feature between the multiple embedded features, the global coding feature is used to represent the global information after encoding the multiple embedded features; the weighting subunit is configured to execute splicing of the long-term interest feature, the short-term interest feature, the global coding feature and the embedded feature of the target item to obtain a spliced ​​feature; the spliced ​​feature is input into a weight prediction model, the spliced ​​feature is weighted, and a third weight parameter of the long-term interest feature and a fourth weight parameter of the short-term interest feature are output, the target item refers to the item to be recommended this time, and the sum of the third weight parameter and the fourth weight parameter is 1; the second fusion subunit is configured to execute weighting of the long-term interest feature and the short-term interest feature based on the third weight parameter and the fourth weight parameter, respectively, and fuse the weighted long-term interest feature and the weighted short-term interest feature to obtain a target interest feature; A determination unit is configured to determine whether to recommend the target item to the account based on the target interest feature and the embedded feature of the target item, where the embedded feature is used to characterize the inherent characteristics of the corresponding item.

13. The device according to claim 12, characterized in that The acquisition unit includes: a second acquisition subunit configured to input the plurality of embedded features into a first encoder, and acquire a plurality of first weight parameters corresponding to each of the plurality of embedded features based on the account features of the account; The first fusion subunit is configured to perform weighting on the multiple embedded features based on the multiple first weight parameters, fuse the weighted multiple embedded features, and output the long-term interest feature.

14. The device according to claim 13, characterized in that The acquisition unit includes: The extraction and pooling subunit is configured to input the multiple embedded features into the second encoder, extract multiple time series features corresponding to each of the multiple embedded features, perform weighted pooling on the multiple time series features, and output the short-term interest feature.

15. The device according to claim 14, characterized in that The extraction pooling subunit includes: The encoding sub-subunit is configured to execute a first sub-encoder that inputs the multiple embedded features into the second encoder, encodes the multiple embedded features, and outputs the multiple time series features.

16. The device according to claim 14, characterized in that The extraction pooling subunit includes: an extraction sub-subunit, configured to execute a second sub-encoder that inputs the plurality of embedded features into the second encoder, and extract feature change information between the plurality of embedded features; The first acquisition sub-subunit is configured to acquire the short-term interest feature based on the feature change information and the multiple time series features.

17. The device according to claim 16, characterized in that The first acquisition sub-subunit is configured to execute: Based on the feature change information, obtaining a plurality of second weight parameters corresponding to each of the plurality of time series features; Based on the multiple second weight parameters, the multiple time series features are weighted respectively, and the weighted multiple time series features are fused to obtain the short-term interest feature.

18. The device according to claim 12, characterized in that The apparatus further comprises a training unit, wherein the training unit comprises: A third acquisition subunit is configured to execute, based on a plurality of sample items interacted with by the sample account in historical interactive behaviors, acquiring a plurality of sample embedding features corresponding to each of the plurality of sample items; An input-output subunit is configured to input the plurality of sample embedding features into a first initial encoder and a second initial encoder respectively, and output a sample long-term interest feature and a sample short-term interest feature of the sample account; a fourth acquisition subunit, configured to acquire a loss function value of this iterative process based on the sample long-term interest feature, the sample short-term interest feature, the standard long-term interest feature, and the standard short-term interest feature, wherein the standard long-term interest feature is an average value of the plurality of sample embedding features, and the standard short-term interest feature is an average value of the sample embedding features of some of the plurality of sample items that meet the target condition; The iterative training subunit is configured to perform iterative training of the first initial encoder and the second initial encoder until a stopping condition is met, thereby obtaining a first encoder and a second encoder, wherein the first encoder is used to extract the long-term interest features of the account, and the second encoder is used to extract the short-term interest features of the account.

19. The device according to claim 18, characterized in that The fourth acquiring subunit is configured to execute: Obtaining a first similarity, a second similarity, a third similarity, and a fourth similarity, wherein the first similarity is the similarity between the sample long-term interest feature and the standard long-term interest feature, the second similarity is the similarity between the sample long-term interest feature and the standard short-term interest feature, the third similarity is the similarity between the sample short-term interest feature and the standard short-term interest feature, and the fourth similarity is the similarity between the sample short-term interest feature and the standard long-term interest feature; Obtaining a first difference and a second difference, wherein the first difference is the difference between the first similarity and the second similarity, and the second difference is the difference between the third similarity and the fourth similarity; The loss function value is obtained based on the first difference and the second difference.

20. The device according to claim 12, characterized in that The second acquisition sub-subunit is configured to execute: The multiple embedded features are input into a fusion encoder, the multiple embedded features are encoded to obtain a latent vector sequence, and the last latent vector in the latent vector sequence is obtained as the global encoding feature.

21. The device according to claim 12, characterized in that The determining unit is configured to perform: The target interest feature, the embedded feature of the target item, and the context feature of the target item are fused to obtain a target fusion feature, where the context feature is used to characterize the interactive scene feature when the account interacts with the target item; Inputting the target fusion feature into the recommendation model, weighting the target fusion feature, and outputting a recommendation probability parameter for the target item, wherein the recommendation probability parameter is used to represent the preference of the account for the target item; In response to the recommendation probability parameter meeting a recommendation condition, determining to recommend the target item to the account; In response to the recommendation probability parameter not meeting the recommendation condition, determining not to recommend the target item to the account.

22. The device according to claim 21, characterized in that The recommendation condition is that the recommendation probability parameter is greater than the recommendation probability threshold; or, the recommendation condition is that among the multiple recommendation probability parameters of multiple target items sorted from large to small, the recommendation probability parameter of the target item is at the front target position in the sorting.

23. An electronic device, characterized in that: include: one or more processors; one or more memories for storing the one or more processor-executable instructions; The one or more processors are configured to execute the instructions to implement the item recommendation method according to any one of claims 1 to 11.

24. A computer-readable storage medium, characterized in that When at least one instruction in the computer-readable storage medium is executed by one or more processors of an electronic device, the electronic device is enabled to perform the item recommendation method according to any one of claims 1 to 11.

25. A computer program product, characterized in that The method comprises one or more instructions, wherein the one or more instructions are executed by one or more processors of an electronic device, so that the electronic device can execute the item recommendation method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Personalized recommendation system based on user memory network and deep model with tree structure

    CN110851694A