A ranking recommendation method based on long-term user preferences and related devices thereof
By combining a long-term preference prediction model and a ranking recommendation model, and by incorporating both long-term and real-time user behavior sequences, the problem of insufficient long-term preference learning in medical insurance recommendation systems is addressed, resulting in more accurate and personalized recommendation outcomes.
Patent Information
- Application Number
- CN202310778282.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-29
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2043-06-29
AI Technical Summary
Existing medical insurance recommendation systems are unable to effectively learn users' long-term preferences, resulting in inaccurate recommendation results and affecting user experience.
A ranking and recommendation method based on long-term user preferences is adopted. By combining a long-term preference prediction model and a ranking and recommendation model with long-term user behavior sequences and real-time behavior sequences, a comprehensive recommendation is made, and location-sensitive information is used to adjust the recommendation results.
The personalization and accuracy of recommendations are improved, ensuring that the recommendation results are more in line with users' long-term interests and real-time preferences, and reducing the impact of location bias.
Smart Images

Figure CN116861079B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of artificial intelligence technology and medical property insurance, and specifically relates to a ranking recommendation method, device, computer equipment and storage medium based on user long-term preferences. Background Art
[0002] Medical insurance is an essential part of people's lives. Recommending appropriate insurance products tailored to individual medical needs and providing a better user experience is a pressing challenge facing health insurance companies. In current recommendation scenarios, attracting more users and providing content of genuine interest requires exploring user preferences. To better characterize user preferences, the industry is constantly experimenting with various approaches. Currently, a common approach is to directly input user behavior sequences (ID sequences) into a ranking model, allowing the model to learn user preferences.
[0003] However, these methods all have some problems that need to be addressed. First, due to model performance limitations, many current machine learning and deep learning models can only process behavior sequences of limited length. If the user's behavior sequence is too long, training and inference will face great difficulties. Therefore, in general, the choice is to intercept recent user behavior sequences to process user behavior sequences while ensuring model performance. However, users' short-term preferences may change with changes in hot spots, while users' long-term preferences often reflect a person's preferences more deeply. However, this current method may not be able to fully learn users' long-term preferences, losing the characteristics of users' long-term behavior data, resulting in deviations in recommendation results, seriously affecting the user experience. Summary of the Invention
[0004] The purpose of the embodiments of the present application is to propose a ranking recommendation method, device, computer equipment and storage medium based on user long-term preferences, so as to solve the technical problem that the recommendation results of existing medical insurance product recommendation schemes are inaccurate and seriously affect the user experience.
[0005] To solve the above technical problems, the present application provides a ranking recommendation method based on user long-term preferences, which adopts the following technical solutions:
[0006] A ranking recommendation method based on user long-term preferences, including:
[0007] Receive recommendation instructions and obtain user data and long-term behavior sequences of the user to be recommended;
[0008] Inputting the user's long-term behavior sequence into a pre-trained long-term preference prediction model to obtain the user's long-term behavior preference;
[0009] obtaining a candidate recommended content, and calculating a similarity between the user long-term behavior preference and the candidate recommended content;
[0010] obtaining a user real-time behavior sequence, and dynamically weighting user behaviors in the user real-time behavior sequence to obtain a weighted behavior sequence;
[0011] inputting the user data, the candidate recommended content, the similarity and the weighted behavior sequence into a pre-trained ranking recommendation model to obtain a ranking recommendation result.
[0012] Further, before the inputting the user long-term behavior sequence into the pre-trained long-term preference prediction model to obtain the user long-term behavior preference, further comprising:
[0013] collecting historical behavior data, and performing data set division on the historical behavior data to obtain a training data set and a verification data set, wherein the historical behavior data includes a user historical long-term behavior sequence and a user historical short-term behavior sequence;
[0014] based on the training data set, performing model training on a pre-set initial prediction model to obtain a trained long-term preference prediction model;
[0015] based on the verification data set, performing model verification on the trained long-term preference prediction model, and outputting the long-term preference prediction model that passes the model verification.
[0016] Further, the pre-set initial prediction model is a double tower model, the double tower model is composed of two parallel neural networks, and the model training on the pre-set initial prediction model based on the training data set to obtain the trained long-term preference prediction model specifically includes:
[0017] inputting the user historical long-term behavior sequence in the training data set into a first neural network of the initial prediction model to obtain a historical long-term behavior feature;
[0018] inputting the user historical short-term behavior sequence in the training data set into a second neural network of the initial prediction model to obtain a historical short-term behavior feature;
[0019] calculating a similarity between the historical long-term behavior feature and the historical short-term behavior feature to obtain a historical long-term and short-term behavior feature similarity;
[0020] based on the historical long-term and short-term behavior feature similarity, fitting the historical long-term behavior feature and the historical short-term behavior feature to obtain a behavior feature fitting result;
[0021] Iteratively update the initial prediction model based on the behavior feature fitting result until model fitting, to obtain a trained long-term preference prediction model.
[0022] Further, the long-term behavior preference of the user output by the long-term preference prediction model is a long-term behavior preference feature vector, the candidate recommended content is obtained, and the similarity between the long-term behavior preference of the user and the candidate recommended content is calculated, specifically including:
[0023] Obtain the candidate recommended content, and perform feature representation on the candidate recommended content to obtain a candidate content feature vector;
[0024] Map the long-term behavior preference feature vector and the candidate content feature vector to the same feature space;
[0025] Calculate the cosine similarity of the long-term behavior preference feature vector and the candidate content feature vector in the feature space to obtain the similarity between the long-term behavior preference of the user and the candidate recommended content.
[0026] Further, the user real-time behavior sequence is obtained, and the user behaviors in the user real-time behavior sequence are dynamically weighted to obtain a weighted behavior sequence, specifically including:
[0027] Parse the user real-time behavior sequence to obtain the user behavior ID in the user real-time behavior sequence;
[0028] Determine the order information of the user behavior ID in the user real-time behavior sequence;
[0029] Input the user behavior ID and the order information of the user behavior ID in the user real-time behavior sequence into a preset transformer network;
[0030] Based on the transformer network, the user behaviors in the user real-time behavior sequence are weighted to obtain the weighted behavior sequence.
[0031] Further, the order information of the user behavior ID in the user real-time behavior sequence is determined, specifically including:
[0032] Determine the trigger time of the user behavior corresponding to the user behavior ID to obtain a first time;
[0033] Obtain the current system time to obtain a second time;
[0034] Calculate the time difference between the first time and the second time, and take the time difference as the order information of the user behavior ID in the user real-time behavior sequence.
[0035] Further, after the user data, the candidate recommended content, the similarity and the weighted behavior sequence are input into the pre-trained ranking recommendation model to obtain a ranking recommendation result, the method further includes:
[0036] Accessing a user terminal based on the user data, and obtaining location sensitive information of the user terminal, wherein the location sensitive information affects a display position of the candidate recommended content on a display of the user terminal;
[0037] Importing the location sensitive information into a preset shallow network, and calculating a position bias of the candidate recommended content by using the shallow network based on the location sensitive information;
[0038] Adjusting the candidate recommended content in the ranking recommendation result based on the position bias to obtain a final recommendation result.
[0039] To solve the above technical problems, the embodiment of the present application further provides a ranking recommendation device based on user long-term preferences, which adopts the technical scheme as follows:
[0040] A ranking recommendation device based on user long-term preferences, comprising:
[0041] A data acquisition module configured to receive a recommendation instruction, and acquire user data of a user to be recommended and a user long-term behavior sequence;
[0042] A preference prediction module configured to input the user long-term behavior sequence into a pre-trained long-term preference prediction model to obtain a user long-term behavior preference;
[0043] A similarity calculation module configured to acquire a candidate recommended content, and calculate a similarity between the user long-term behavior preference and the candidate recommended content;
[0044] A dynamic weighting module configured to acquire a user real-time behavior sequence, and dynamically weight user behaviors in the user real-time behavior sequence to obtain a weighted behavior sequence;
[0045] A ranking recommendation module configured to input the user data, the candidate recommended content, the similarity and the weighted behavior sequence into a pre-trained ranking recommendation model to obtain a ranking recommendation result.
[0046] To solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the technical scheme as follows:
[0047] A computer device comprises a memory and a processor, the memory stores computer readable instructions, and the processor executes the computer readable instructions to implement the steps of the ranking recommendation method based on long-term preference of a user according to any one of the above.
[0048] To solve the above technical problems, the embodiment of the application further provides a computer readable storage medium, which adopts the technical scheme as follows:
[0049] A computer readable storage medium stores computer readable instructions, and the computer readable instructions are executed by a processor to implement the steps of the ranking recommendation method based on long-term preference of a user according to any one of the above.
[0050] Compared with the prior art, the embodiment of the application has the following beneficial effects:
[0051] The application discloses a ranking recommendation method based on long-term preference of a user and a related device, and belongs to the fields of artificial intelligence and medical insurance. The application receives a recommendation instruction, obtains user data and a long-term behavior sequence of a user to be recommended, inputs the long-term behavior sequence of the user into a pre-trained long-term preference prediction model, obtains a long-term behavior preference of the user, obtains candidate recommendation content, calculates a similarity between the long-term behavior preference of the user and the candidate recommendation content, obtains a real-time behavior sequence of the user, dynamically weights user behaviors in the real-time behavior sequence of the user to obtain a weighted behavior sequence, inputs the user data, the candidate recommendation content, the similarity and the weighted behavior sequence into a pre-trained ranking recommendation model, and obtains a ranking recommendation result. The application uses the long-term preference prediction model and the ranking recommendation model, combines the features of the long-term behavior preference of the user and weights real-time behaviors to realize comprehensive recommendation, so as to provide a recommendation result that is more in line with the interests and preferences of the user. By considering the long-term preferences and real-time behaviors of the user, the individuality and accuracy of recommendation can be improved. In addition, the application further calculates a position deviation of the candidate recommendation content in a user terminal by using position sensitive information, further adjusts the recommendation result based on the position deviation, and further improves the individuality and accuracy of recommendation. BRIEF DESCRIPTION OF DRAWINGS
[0052] In order to more clearly illustrate the schemes in the application, the drawings needed in the description of the embodiments of the application will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor.
[0053] Figure 1 An exemplary system architecture diagram in which the application can be applied is shown;
[0054] Figure 2 A flow chart of one embodiment of the ranking recommendation method based on long-term preference of a user according to the present application is shown;
[0055] Figure 3 A structural schematic diagram of one embodiment of the ranking recommendation device based on long-term preference of a user according to the present application is shown;
[0056] Figure 4 A structural schematic diagram of one embodiment of the computer device according to the present application is shown. DETAILED DESCRIPTION
[0057] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description herein is for describing particular embodiments only and is not intended to be limiting of the application; the present application will be described with reference to the drawings in which is shown by way of illustration various embodiments of the application. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The use of the terms "including," "comprising," or "having" and variations thereof herein is intended to be broad and encompass the terms "consisting of" and "consisting essentially of," and variations thereof. The use of the terms "first," "second," and the like does not imply a limitation on the number of objects that can comprise the elements, but rather the order in which the objects are described.
[0058] Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase "in one embodiment" in various places in the specification are not necessarily all referring to the same embodiment, nor are they necessarily all directed to the same embodiment, or to one or more group of alternative embodiments. It is expressly understood that any of the embodiments described herein can be combined with any of the other embodiments unless specifically noted otherwise.
[0059] In order to make the technical personnel in the art better understand the scheme of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings.
[0060] As shown in Figure 1 The system architecture 100 can include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used to provide a communication link medium between the terminal devices 101, 102, 103 and the server 105. The network 104 can include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0061] The user can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 101, 102, 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0062] The terminal devices 101, 102, and 103 can be various electronic devices with a display screen and supporting web browsing, including but not limited to a smartphone, a tablet computer, an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 player (Moving Picture Experts Group Audio Layer IV), a laptop computer, a desktop computer, and the like.
[0063] The server 105 can be a server providing various services, for example, a background server providing support for a page displayed on the terminal devices 101, 102, and 103. The server can be a standalone server or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and basic cloud computing services such as big data and artificial intelligence platforms.
[0064] It should be noted that the ranking recommendation method based on long-term preferences of a user provided in the embodiments of the present application is generally executed by a server, and accordingly, the ranking recommendation device based on long-term preferences of a user is generally arranged in a server.
[0065] It should be understood that Figure 1 The number of terminal devices, networks, and servers in
[0066] With reference to Figure 2 , a flowchart of one embodiment of the ranking recommendation method based on long-term preferences of a user according to the present application is shown. The embodiments of the present application can acquire and process related data based on artificial intelligence technology. Artificial intelligence (AI) is a theory, method, technology, and application system for simulating, extending, and expanding human intelligence using a digital computer or a machine controlled by a digital computer, perceiving an environment, acquiring knowledge, and using the knowledge to obtain optimal results.
[0067] The artificial intelligence basic technology generally includes technologies such as sensors, special artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction system, mechatronics, etc. The artificial intelligence software technology mainly includes computer vision technology, robot technology, biometric identification technology, speech processing technology, natural language processing technology, and machine learning / deep learning, etc.
[0068] In the content recommendation scenario, due to the performance of the model, many machine learning models and deep learning models can only process behavior sequences of limited length at present. If the behavior sequence of a user is too long, training and inference will face great difficulties. Therefore, generally, the recent user behavior sequence is intercepted to ensure the model performance under the premise of processing the user behavior sequence, but the short-term preference of the user may change with the change of the hot spot, and the long-term preference of the user often reflects the preference of a person in depth, and the interception of the recent user behavior sequence may not be able to learn the long-term preference of the user sufficiently, the long-term behavior data features of the user are lost, the recommended result is deviated, and the user experience is seriously affected.
[0069] In order to solve the above technical problems, the application discloses a ranking recommendation method based on user long-term preference and related equipment thereof, which belongs to the fields of artificial intelligence and medical insurance, and uses a long-term preference prediction model and a ranking recommendation model to obtain the long-term behavior preference of the user by fitting the long-term behavior sequence and the short-term behavior sequence of the user. Compared with the interception of the recent user behavior sequence, the method can avoid the loss of user behavior features, realize comprehensive recommendation by combining the features of the long-term behavior preference of the user and weighting the real-time behavior, provide recommended results more in line with the interests and preferences of the user, and improve the individuality and accuracy of the recommendation by considering the long-term preference and real-time behavior of the user.
[0070] Meanwhile, considering that there are some typical deviations in the recommendation scenario, such as position deviation, that is, the user tends to select the items with a relatively high position in the display list for interaction, the application further calculates the position deviation of the candidate recommended content in the user terminal by using position sensitive information, further adjusts the recommended result based on the position deviation, and further improves the individuality and accuracy of the recommendation.
[0071] The ranking recommendation method based on the long-term preference of the user comprises the following steps:
[0072] S201, receiving a recommendation instruction, obtaining user data and a long-term behavior sequence of a user to be recommended.
[0073] In this embodiment, when the server receives the recommendation instruction, it determines the user to be recommended corresponding to the recommendation instruction and obtains the user data and long-term behavior sequence of the user to be recommended. The user data includes user basic information such as user ID, user name, gender, age, etc. The long-term behavior sequence of the user refers to the behavior records of the user to be recommended within a period of time, which can include the user's browsing, purchasing, commenting, collecting and other operations. These behavior records reflect the user's interests, preferences and behavior habits, and can be used to infer the user's long-term behavior preferences.
[0074] For example, assume that a user has used an e-commerce platform for the past year. His long-term behavior sequence can include the following behavior records:
[0075] Browsing records: The user browsed the detail pages of multiple products on the e-commerce platform, such as mobile phones, televisions, clothes, etc.
[0076] Purchase records: The user purchased some products on the e-commerce platform, such as a mobile phone, a television, and several pieces of clothing.
[0077] Collection records: The user collected some products on the e-commerce platform, such as several mobile phones and televisions.
[0078] Comment records: The user commented on the products purchased on the e-commerce platform, such as evaluating and providing feedback on the mobile phone and television.
[0079] The above behavior records constitute the user's long-term behavior sequence. By analyzing these behavior records, the user's preferences and interests for different types of products can be inferred. For example, if the user frequently browses mobile phone-related pages, purchases multiple mobile phones, and comments on mobile phones, it can be inferred that the user has a high long-term behavior preference for mobile phones. These inferences can be used for personalized recommendations to provide users with more personalized recommendations that meet their long-term interests.
[0080] S202, input the long-term behavior sequence of the user into the pre-trained long-term preference prediction model to obtain the long-term behavior preference of the user.
[0081] The pre-trained long-term preference prediction model is a double-tower model, which is composed of two parallel neural networks, each tower receives different types of input sequences, one side of the tower receives the user's long-term behavior sequence as input, and the other side of the tower receives the user's short-term behavior sequence as input. In each tower, the input sequence is extracted by using a suitable neural network structure (such as a recurrent neural network, a convolutional neural network, etc.), and through a multi-layer network structure, the model can learn the time dependence and context information in the user behavior sequence. The goal of the double-tower model is to model the user's long-term behavior sequence and short-term behavior sequence separately, so that the user's long-term behavior sequence is as close as possible to the short-term behavior sequence, and the user's long-term behavior sequence is as far as possible from the short-term behavior sequence of other users. Through the above goal, the double-tower model is continuously iterated, and when the double-tower model is completed, the long-term preference prediction capability is obtained, that is, the long-term preference prediction model is trained.
[0082] In the embodiment, the short-term behavior sequence of the user to be recommended is obtained, the user's long-term behavior sequence and short-term behavior sequence are respectively input into the two sides of the pre-trained long-term preference prediction model, and the user's long-term behavior preference output by the long-term preference prediction model is obtained, wherein the user's long-term behavior preference output by the long-term preference prediction model is a long-term behavior preference feature vector embedding.
[0083] It should be noted that the user's short-term behavior sequence is the user's latest K behavior set, and the user's long-term behavior sequence is the set of behaviors other than the K short-term behaviors for users with fewer behaviors. For users with more behaviors, the set of behaviors other than the K short-term behaviors is sampled according to the behavior residence time, and the sampled behavior sequence is used as the long-term behavior sequence of the user. At the same time, considering that the influence of various behaviors of the user on their preferences is different, for example, compared to clicks and stays, behaviors such as collecting, adding to the shopping cart or purchasing often represent the user's deeper preferences, so the user's further behaviors, such as purchasing, are preferentially added to the above-mentioned user long-term preference sequence as the user's final long-term preference sequence.
[0084] In specific embodiments of the present application, the long-term preference prediction model periodically processes the user's long-term behavior sequence and short-term behavior sequence at a predetermined time, such as daily updates, etc., which can realize offline daily updating of the user's long-term preference embedding, which can be stored in related storage elements such as redis. In this way, the user's long-term preference is abstracted into a low-dimensional embedding, and the offline storage of the user's embedding is not limited to real-time speculation, and greatly improves the performance of online prediction.
[0085] Further, before inputting the user long-term behavior sequence into the pre-trained long-term preference prediction model to obtain the user long-term behavior preference, further comprising:
[0086] Collect historical behavior data, and perform dataset division on the historical behavior data to obtain a training dataset and a validation dataset, wherein the historical behavior data includes a user historical long-term behavior sequence and a user historical short-term behavior sequence;
[0087] Based on the training dataset, the initial prediction model is trained to obtain a trained long-term preference prediction model;
[0088] Based on the validation dataset, the trained long-term preference prediction model is verified, and a long-term preference prediction model that passes the model verification is output.
[0089] In this embodiment, first, the historical behavior data of the user needs to be collected, including a long-term behavior sequence and a short-term behavior sequence. The long-term behavior sequence refers to the user's behavior records in the past period of time, such as browsing history, purchase records, etc. The short-term behavior sequence refers to the user's recent behavior records, which can reflect the user's current interests and preferences.
[0090] The collected historical behavior data is divided into a dataset according to a preset data ratio, such as a 9:1 ratio. Generally, the dataset is divided into a training dataset and a validation dataset. The training dataset is used for training the long-term preference prediction model, and the validation dataset is used for verifying the long-term preference prediction model. Dividing the dataset can ensure the generalization ability of the model and prevent overfitting.
[0091] The training dataset is input into the preset initial prediction model, and the model is trained through the training dataset to obtain a trained long-term preference prediction model. In the training process, the user's long-term behavior sequence and short-term behavior sequence are modeled respectively to make the user's long-term behavior sequence as close as possible to the short-term behavior sequence, and the user's long-term behavior sequence as far as possible from other users' short-term behavior sequences, so as to improve the long-term preference prediction accuracy.
[0092] By inputting the validation dataset into the model and comparing and evaluating the prediction results of the model, the performance and accuracy of the model can be evaluated. Through model verification, the optimal long-term preference prediction model can be selected for subsequent user long-term preference prediction.
[0093] Further, the preset initial prediction model is a double tower model, which is composed of two parallel neural networks. Based on the training dataset, the initial prediction model is trained to obtain a trained long-term preference prediction model, which specifically includes:
[0094] inputting a user historical long-term behavior sequence in a training data set into a first neural network of an initial prediction model to obtain a historical long-term behavior feature;
[0095] inputting a user historical short-term behavior sequence in the training data set into a second neural network of the initial prediction model to obtain a historical short-term behavior feature;
[0096] calculating a similarity between the historical long-term behavior feature and the historical short-term behavior feature to obtain a historical long-short term behavior feature similarity;
[0097] fitting the historical long-term behavior feature and the historical short-term behavior feature based on the historical long-short term behavior feature similarity to obtain a behavior feature fitting result;
[0098] iteratively updating the initial prediction model based on the behavior feature fitting result until the model is fitted to obtain a trained long-term preference prediction model.
[0099] The dual tower model is a common model architecture for the relationship between user long-term behavior sequences and short-term behavior sequences for user long-term preference prediction, which consists of two similar towers, namely a long-term behavior processing tower and a short-term behavior processing tower. The long-term behavior processing tower and the short-term behavior processing tower are symmetrical in structure, and they both consist of multiple levels of neural networks, which can be fully connected neural networks, convolutional neural networks (CNN) or recurrent neural networks (RNN), depending on the actual application scenario and data characteristics.
[0100] In the dual tower model, the user's long-term behavior sequence and short-term behavior sequence are mapped into a feature space, and cosine similarity, Euclidean distance, etc. can be used to measure the similarity between the user's long-term behavior sequence and short-term behavior sequence, as well as the difference between the user's long-term behavior sequence and other users' short-term behavior sequences.
[0101] In order to train the dual tower model, an appropriate loss function needs to be defined. In a specific embodiment of the present application, a common loss function is the contrastive loss function, in which the positive sample is the user's long-term behavior sequence and short-term behavior sequence, and the negative sample is the user's long-term behavior sequence and other users' short-term behavior sequence. By minimizing the distance between positive samples and maximizing the distance between negative samples, the model can learn the user's long-term preference.
[0102] In the embodiment, the user historical long-term behavior sequence in the training data set is input into the first neural network of the initial prediction model to obtain a historical long-term behavior feature, the user historical short-term behavior sequence in the training data set is input into the second neural network of the initial prediction model to obtain a historical short-term behavior feature, the cosine similarity of the historical long-term behavior feature and the historical short-term behavior feature is calculated to obtain a historical long-short term behavior feature similarity, the historical long-term behavior feature and the historical short-term behavior feature are fitted based on the historical long-short term behavior feature similarity to obtain a behavior feature fitting result, and the initial prediction model is iteratively updated based on the behavior feature fitting result until the model fitting is completed to obtain the trained long-term preference prediction model.
[0103] In S203, the candidate recommended content is obtained, and the similarity between the user long-term behavior preference and the candidate recommended content is calculated.
[0104] In the embodiment, the user long-term behavior preference output by the long-term preference prediction model is a long-term behavior preference feature vector embedding. After the preference feature vector embedding is obtained, the candidate recommended content is obtained, and the embedding of each candidate recommended content, i.e., a candidate content feature vector embedding, is generated by the pre-trained bert. The cosine similarity between the long-term behavior preference feature vector embedding and the candidate content feature vector embedding is calculated, and the cosine similarity is taken as an input of the ranking recommendation model to predict the ranking of the candidate recommended content.
[0105] It should be noted that the embedding of all candidate recommended content can also be obtained in advance by an offline manner and stored in redis. When the ranking recommendation prediction is performed, the embedding of the content can be obtained in redis according to the candidate recommended content id, and input into the ranking recommendation model for subsequent ranking prediction.
[0106] Further, the user long-term behavior preference output by the long-term preference prediction model is a long-term behavior preference feature vector. The candidate recommended content is obtained, and the similarity between the user long-term behavior preference and the candidate recommended content is calculated. Specifically, the method comprises the following steps.
[0107] The candidate recommended content is obtained, and a feature representation of the candidate recommended content is performed to obtain a candidate content feature vector.
[0108] The long-term behavior preference feature vector and the candidate content feature vector are mapped to the same feature space.
[0109] The cosine similarity of the long-term behavior preference feature vector and the candidate content feature vector in the feature space is calculated to obtain the similarity between the user long-term behavior preference and the candidate recommended content.
[0110] In the embodiment, the candidate recommended content is acquired, the pre-trained bert model is used to perform feature representation on the candidate recommended content to obtain a candidate content feature vector embedding, the long-term behavior preference feature vector embedding and the candidate content feature vector embedding are mapped to the same feature space, the cosine similarity of the long-term behavior preference feature vector embedding and the candidate content feature vector embedding is calculated in the feature space, the similarity between the long-term behavior preference of the user and the candidate recommended content, i.e. the cosine similarity, is obtained, and the cosine similarity is taken as one input of the ranking recommendation model.
[0111] In the embodiment, the candidate recommended content is acquired, the pre-trained bert model is used to perform feature representation on the candidate recommended content to obtain a candidate content feature vector embedding, the long-term behavior preference feature vector embedding and the candidate content feature vector embedding are mapped to the same feature space, the cosine similarity of the long-term behavior preference feature vector embedding and the candidate content feature vector embedding is calculated in the feature space, the similarity between the long-term behavior preference of the user and the candidate recommended content, i.e. the cosine similarity, is obtained, and the cosine similarity is taken as one input of the ranking recommendation model.
[0112] In the embodiment, the candidate recommended content is acquired, the pre-trained bert model is used to perform feature representation on the candidate recommended content to obtain a candidate content feature vector embedding, the long-term behavior preference feature vector embedding and the candidate content feature vector embedding are mapped to the same feature space, the cosine similarity of the long-term behavior preference feature vector embedding and the candidate content feature vector embedding is calculated in the feature space, the similarity between the long-term behavior preference of the user and the candidate recommended content, i.e. the cosine similarity, is obtained, and the cosine similarity is taken as one input of the ranking recommendation model.
[0113] Further, the user real-time behavior sequence is acquired, and the user behaviors in the user real-time behavior sequence are dynamically weighted to obtain a weighted behavior sequence, which specifically comprises:
[0114] The user real-time behavior sequence is parsed to obtain the user behavior ID in the user real-time behavior sequence;
[0115] The order information of the user behavior ID in the user real-time behavior sequence is determined;
[0116] The user behavior ID and the order information of the user behavior ID in the user real-time behavior sequence are input into a preset transformer network;
[0117] The user behaviors in the user real-time behavior sequence are weighted based on the transformer network to obtain the weighted behavior sequence.
[0118] The dynamic weighting process can be realized by the transformer network. The Transformer model is composed of multiple attention mechanisms and feedforward neural networks. The encoder part of the Transformer can be used. The attention mechanism can dynamically weight different behaviors in the behavior sequence and capture the relationship and importance between behaviors.
[0119] The input of the transformer layer is the ID feature of each user behavior in the real-time behavior sequence and the order information corresponding to each user behavior. Each user behavior has a unique identifier (ID) for distinguishing different behaviors. In the real-time behavior sequence, the ID feature represents the identifier of the corresponding content of the behavior, for example, a click behavior may correspond to the ID of an article, and a purchase behavior may correspond to the ID of a product. In the real-time behavior sequence, the order information represents the relative order or time interval of the behavior occurrence. A common representation method is to use the timestamp to calculate the time difference between adjacent behaviors. The order information can help the model understand the time order and interval of the behavior, so as to dynamically weight the behavior sequence.
[0120] In the embodiment, the ID feature embedding and the order information feature embedding are spliced, and the spliced embedding is input into the preset transformer network. The user behaviors in the user real-time behavior sequence are weighted based on the attention mechanism and the feedforward neural network of the transformer, and a weighted behavior sequence is obtained.
[0121] It should be noted that the sequence information in the application corresponds to the position information in the Transformer model. The Transformer model is a self-attention model that completely uses Attention to realize data processing, so the position encoding (Positional Encoding) in the Transformer model is very important. It is necessary to add the word order signal to the content vector to help the Transformer model learn these information. Therefore, in the above processing process, the order information of the user behavior ID in the user real-time behavior sequence needs to be determined, and the order information is input as one of the inputs of the transformer layer.
[0122] Further, the order information of the user behavior ID in the user real-time behavior sequence is determined, specifically including:
[0123] The trigger time of the user behavior corresponding to the user behavior ID is determined, and a first time is obtained.
[0124] The current system time is obtained, and a second time is obtained.
[0125] The time difference between the first time and the second time is calculated, and the time difference is used as the order information of the user behavior ID in the user real-time behavior sequence.
[0126] In the embodiment, the server can find the corresponding user behavior from the user real-time behavior sequence through the user behavior ID, and then determine the trigger time of the user behavior, i.e., the first time, obtain the current time of the system, i.e., the second time, and calculate the time difference between the first time and the second time. Common time difference calculation methods can be used to achieve this, such as using the functions provided in the date time library. The time difference value can be used as the sequence information to determine the relative order of the user behavior ID in the user real-time behavior sequence, indicating the time interval or time sequence of the behavior, and providing dynamic weighting information about the behavior sequence.
[0127] S205, input the user data, candidate recommendation content, similarity and weighted behavior sequence into the pre-trained ranking recommendation model to obtain a ranking recommendation result.
[0128] In the embodiment, the pre-trained ranking recommendation model adopts the architecture of a DNN deep neural network. The ranking recommendation model has four inputs, which are user data, candidate recommendation content, similarity and weighted behavior sequence, respectively. The DNN deep neural network learns and calculates the four input data respectively to generate a content recommendation result and sort the content recommendation result according to the possible interest degree of the user.
[0129] In the above embodiment, the application discloses a ranking recommendation method based on user long-term preference, which belongs to the fields of artificial intelligence technology and medical insurance. The application receives a recommendation instruction, obtains user data and a user long-term behavior sequence of a user to be recommended, inputs the user long-term behavior sequence into a pre-trained long-term preference prediction model to obtain a user long-term behavior preference, obtains candidate recommendation content, calculates the similarity between the user long-term behavior preference and the candidate recommendation content, obtains a user real-time behavior sequence, dynamically weights the user behaviors in the user real-time behavior sequence to obtain a weighted behavior sequence, inputs the user data, candidate recommendation content, similarity and weighted behavior sequence into a pre-trained ranking recommendation model to obtain a ranking recommendation result. The application uses the long-term preference prediction model and the ranking recommendation model, combines the features of the user long-term behavior preference and weights the real-time behavior to achieve comprehensive recommendation, so as to provide a recommendation result that is more in line with the user's interest and preference. By considering the user's long-term preference and real-time behavior, the individuality and accuracy of the recommendation can be improved.
[0130] Further, after inputting the user data, candidate recommendation content, similarity and weighted behavior sequence into the pre-trained ranking recommendation model to obtain a ranking recommendation result, the application further includes:
[0131] Access the user terminal based on the user data, and obtain location sensitive information of the user terminal, wherein the location sensitive information affects the display position of the candidate recommendation content on the display of the user terminal.
[0132] The position-sensitive information is introduced into a preset shallow network, and a position bias of the candidate recommended content is calculated by using the shallow network based on the position-sensitive information;
[0133] The candidate recommended content in the ranking recommendation result is adjusted based on the position bias to obtain a final recommendation result.
[0134] In a recommendation scenario, the position bias refers to a behavior that a user tends to select an item in a display list with a relatively high position to interact. Since the arrangement order of the display list can affect the click behavior of the user, the position bias can cause the recommendation result to be inaccurate, and the item with the high position is more likely to be clicked, and the content in the rear position is ignored.
[0135] To reduce the influence of the position bias, the application learns the position bias information by using a two-layer MLP shallow network, and uses the position bias information as a bias term in the final prediction of a main model. The bias term is used in the output layer of the ranking recommendation model to further adjust the candidate recommended content in the ranking recommendation result, so as to obtain the final recommendation result.
[0136] In the embodiment, the user terminal is accessed based on the user data, and position-sensitive information of the user terminal is obtained. The position-sensitive information affects the display position of the candidate recommended content on the display of the user terminal, such as a display index (that is, the position of the content in the display list), a mobile phone system (iOS or Android), a mobile phone model (different models can have different numbers and positions of display), and the like. The position-sensitive information is introduced into a preset shallow network, and a position bias of the candidate recommended content is calculated by using the shallow network based on the position-sensitive information. The shallow network outputs an estimated value of the position bias. According to the estimated value of the position bias, the items in the ranking result are adjusted, so that the items with the rear position have a chance to obtain a higher weight in the final recommendation result.
[0137] In the above embodiment, the position bias of the candidate recommended content in the user terminal is calculated by using the position-sensitive information. By learning and using the position bias information, the recommendation result can be more accurately adjusted, the bias caused by the position can be reduced, the accuracy of the recommendation can be improved, the recommendation system can pay more attention to the content quality and the user preference itself, and is not limited to the influence of the position. The recommendation result is further adjusted based on the position bias, and the individuality and accuracy of the recommendation are further improved.
[0138] In the embodiment, an electronic device (for example, a server) on which a ranking recommendation method based on long-term preference of a user runs is provided. Figure 1The server (e.g., the server shown in FIG. 1) can receive instructions or obtain data through wired or wireless connections. It should be noted that the wireless connections can include, but are not limited to, 3G / 4G connections, WiFi connections, Bluetooth connections, WiMAX connections, Zigbee connections, UWB (ultra wideband) connections, and other now known or later developed wireless connections.
[0139] It should be emphasized that, in order to further ensure the privacy and security of the user data visit, the user data visit can also be stored in a node of a blockchain.
[0140] The blockchain referred to in the present application is a new application mode of distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, and other computer technologies. The blockchain is essentially a decentralized database, which is a series of data blocks associated using cryptographic methods, each data block containing information of a batch of network transactions, for verifying the validity (anti-fake) of the information and generating the next block. The blockchain can include a blockchain underlying platform, a platform product service layer, and an application service layer, etc.
[0141] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by computer readable instructions instructing related hardware, which can be stored in a computer readable storage medium. When the computer readable instructions are executed, the processes of the above-mentioned embodiments can be included. The storage medium can be a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0142] It should be understood that, although each step in the flowchart of the accompanying drawings is shown in sequence according to the direction of the arrow, these steps are not necessarily executed in sequence according to the direction of the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and they can be executed in other orders. Moreover, at least part of the steps in the flowchart of the accompanying drawings can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence is not necessarily sequential, but can be executed in rotation or alternation with at least part of other steps or sub-steps or stages of other steps.
[0143] Further reference is made to Figure 3 , as to the above Figure 2To implement the method, the application provides an embodiment of a ranking recommendation device based on user long-term preferences, which is implemented in the method embodiment Figure 2 The device can be applied to various electronic devices.
[0144] As Figure 3 The ranking recommendation device 300 based on user long-term preferences comprises:
[0145] A data acquisition module 301 is configured to receive a recommendation instruction, acquire user data of a user to be recommended and a user long-term behavior sequence.
[0146] A preference prediction module 302 is configured to input the user long-term behavior sequence into a pre-trained long-term preference prediction model to obtain a user long-term behavior preference.
[0147] A similarity calculation module 303 is configured to acquire candidate recommendation content and calculate a similarity between the user long-term behavior preference and the candidate recommendation content.
[0148] A dynamic weighting module 304 is configured to acquire a user real-time behavior sequence and dynamically weight user behaviors in the user real-time behavior sequence to obtain a weighted behavior sequence.
[0149] A ranking recommendation module 305 is configured to input the user data, the candidate recommendation content, the similarity and the weighted behavior sequence into a pre-trained ranking recommendation model to obtain a ranking recommendation result.
[0150] Further, the ranking recommendation device 300 based on user long-term preferences further comprises:
[0151] A data set division module is configured to collect historical behavior data, divide the historical behavior data into a training data set and a verification data set, wherein the historical behavior data comprises a user historical long-term behavior sequence and a user historical short-term behavior sequence.
[0152] A model training module is configured to train a preset initial prediction model based on the training data set to obtain a trained long-term preference prediction model.
[0153] A model verification module is configured to verify the trained long-term preference prediction model based on the verification data set and output a long-term preference prediction model that passes the model verification.
[0154] Further, the preset initial prediction model is a double-tower model, the double-tower model is composed of two parallel neural networks, and the model training module specifically comprises:
[0155] a long-term behavior feature unit configured to input a user historical long-term behavior sequence in a training data set into a first neural network of an initial prediction model to obtain historical long-term behavior features;
[0156] a short-term behavior feature unit configured to input a user historical short-term behavior sequence in the training data set into a second neural network of the initial prediction model to obtain historical short-term behavior features;
[0157] a feature similarity unit configured to calculate a similarity between the historical long-term behavior features and the historical short-term behavior features to obtain historical long-short term behavior feature similarity;
[0158] a feature fitting unit configured to fit the historical long-term behavior features and the historical short-term behavior features based on the historical long-short term behavior feature similarity to obtain a behavior feature fitting result;
[0159] an iterative updating unit configured to iteratively update the initial prediction model based on the behavior feature fitting result until model fitting is achieved to obtain a trained long-term preference prediction model.
[0160] Further, the user long-term behavior preference output by the long-term preference prediction model is a long-term behavior preference feature vector, and the similarity calculation module 303 specifically includes:
[0161] a content feature extraction unit configured to obtain a candidate recommended content and perform feature representation on the candidate recommended content to obtain a candidate content feature vector;
[0162] a feature vector mapping unit configured to map the long-term behavior preference feature vector and the candidate content feature vector to the same feature space;
[0163] a cosine similarity calculation unit configured to calculate a cosine similarity between the long-term behavior preference feature vector and the candidate content feature vector in the feature space to obtain a similarity between the user long-term behavior preference and the candidate recommended content.
[0164] Further, the dynamic weighting module 304 specifically includes:
[0165] a behavior ID obtaining unit configured to parse a user real-time behavior sequence to obtain a user behavior ID in the user real-time behavior sequence;
[0166] an order information obtaining unit configured to determine order information of the user behavior ID in the user real-time behavior sequence;
[0167] a weighting information input unit configured to input the user behavior ID and the order information of the user behavior ID in the user real-time behavior sequence into a preset transformer network;
[0168] A dynamic weighting unit is configured to weight user behaviors in the user real-time behavior sequence based on the transformer network to obtain a weighted behavior sequence.
[0169] Further, the order information acquisition unit specifically comprises:
[0170] A first time sub-unit is configured to determine a trigger time of the user behavior corresponding to the user behavior ID to obtain a first time.
[0171] A second time sub-unit is configured to acquire a current system time to obtain a second time.
[0172] A time difference value calculation sub-unit is configured to calculate a time difference value between the first time and the second time, and take the time difference value as the order information of the user behavior ID in the user real-time behavior sequence.
[0173] Further, the ranking recommendation device 300 based on the user long-term preference further comprises:
[0174] A location sensitive information acquisition module is configured to access a user terminal based on user data, and acquire location sensitive information of the user terminal, wherein the location sensitive information affects a display position of the candidate recommended content on a display of the user terminal.
[0175] A position deviation calculation module is configured to import the location sensitive information into a preset shallow network, and calculate a position deviation of the candidate recommended content by using the shallow network based on the location sensitive information.
[0176] A candidate recommended content adjustment module is configured to adjust the candidate recommended content in the ranking recommendation result based on the position deviation to obtain a final recommendation result.
[0177] In the above embodiment, the application discloses a ranking recommendation device based on long-term preferences of a user, and belongs to the technical field of artificial intelligence and the field of medical insurance. The application receives a recommendation instruction, obtains user data and a long-term behavior sequence of a user to be recommended, inputs the long-term behavior sequence of the user into a pre-trained long-term preference prediction model, obtains a long-term behavior preference of the user, obtains candidate recommendation content, and calculates a similarity between the long-term behavior preference of the user and the candidate recommendation content. The application obtains a real-time behavior sequence of the user, dynamically weights user behaviors in the real-time behavior sequence of the user to obtain a weighted behavior sequence, inputs the user data, the candidate recommendation content, the similarity, and the weighted behavior sequence into a pre-trained ranking recommendation model, and obtains a ranking recommendation result. The application uses the long-term preference prediction model and the ranking recommendation model, combines the features of the long-term behavior preference of the user, and weights real-time behaviors to realize comprehensive recommendation, so as to provide a recommendation result that is more in line with the interests and preferences of the user. By considering the long-term preferences and real-time behaviors of the user, the degree of personalization and the accuracy of the recommendation can be improved. In addition, the application further calculates a position deviation of the candidate recommendation content in the user terminal through position-sensitive information, further adjusts the recommendation result based on the position deviation, and further improves the degree of personalization and the accuracy of the recommendation.
[0178] To solve the above technical problems, the application further provides a computer device. For details, please refer to Figure 4 , Figure 4 The basic structure block diagram of the computer device of the embodiment is shown in the figure.
[0179] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 which are connected to each other through a system bus. It should be pointed out that only the computer device 4 with components 41-43 is shown in the figure, but it should be understood that it is not required to implement all the shown components, and more or fewer components can be alternatively implemented. Among them, those skilled in the art can understand that the computer device here is a device capable of automatically performing numerical calculation and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to a microprocessor, an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), a digital signal processor (DSP), an embedded device, etc.
[0180] The computer device can be a desktop computer, a notebook computer, a palm computer, a cloud server, and other computing devices. The computer device can interact with the user through a keyboard, a mouse, a remote controller, a touchpad, a voice control device, and other ways.
[0181] The memory 41 includes at least one type of readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., an SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as a hard disk or a memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device 4. Of course, the memory 41 can also include both an internal storage unit and an external storage device of the computer device 4. In this embodiment, the memory 41 is generally used to store an operating system and various application software installed on the computer device 4, such as computer readable instructions of the ranking recommendation method based on user long-term preferences, etc. In addition, the memory 41 can also be used to temporarily store various data that have been output or will be output.
[0182] The processor 42 can be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip in some embodiments. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to run computer readable instructions or process data stored in the memory 41, such as running computer readable instructions of the ranking recommendation method based on user long-term preferences.
[0183] The network interface 43 can include a wireless network interface or a wired network interface, and is generally used to establish a communication connection between the computer device 4 and other electronic devices.
[0184] In the above embodiment, the application discloses a computer device, which belongs to the fields of artificial intelligence and medical insurance. The application receives a recommendation instruction, obtains user data and a long-term behavior sequence of a user to be recommended, inputs the long-term behavior sequence into a pre-trained long-term preference prediction model, obtains a long-term behavior preference of the user, obtains candidate recommended content, calculates a similarity between the long-term behavior preference of the user and the candidate recommended content, obtains a real-time behavior sequence of the user, dynamically weights user behaviors in the real-time behavior sequence to obtain a weighted behavior sequence, inputs the user data, the candidate recommended content, the similarity and the weighted behavior sequence into a pre-trained ranking recommendation model, and obtains a ranking recommendation result. The application uses the long-term preference prediction model and the ranking recommendation model, combines the features of the long-term behavior preference of the user and weights real-time behaviors to realize comprehensive recommendation, so as to provide a recommended result that is more in line with the interests and preferences of the user. By considering the long-term preferences and real-time behaviors of the user, the individuality and accuracy of the recommendation can be improved. In addition, the application further calculates a position deviation of the candidate recommended content in a user terminal based on position sensitive information, further adjusts the recommended result based on the position deviation, and further improves the individuality and accuracy of the recommendation.
[0185] The application also provides another implementation, that is, a computer readable storage medium storing computer readable instructions, which can be executed by at least one processor to make the at least one processor execute the steps of the ranking recommendation method based on long-term preferences of a user as described above.
[0186] In the above embodiment, the application discloses a computer readable storage medium, which belongs to the fields of artificial intelligence and medical insurance. The application receives a recommendation instruction, obtains user data and a long-term behavior sequence of a user to be recommended, inputs the long-term behavior sequence into a pre-trained long-term preference prediction model, obtains a long-term behavior preference of the user, obtains candidate recommended content, calculates a similarity between the long-term behavior preference of the user and the candidate recommended content, obtains a real-time behavior sequence of the user, dynamically weights user behaviors in the real-time behavior sequence to obtain a weighted behavior sequence, inputs the user data, the candidate recommended content, the similarity and the weighted behavior sequence into a pre-trained ranking recommendation model, and obtains a ranking recommendation result. The application uses the long-term preference prediction model and the ranking recommendation model, combines the features of the long-term behavior preference of the user and weights real-time behaviors to realize comprehensive recommendation, so as to provide a recommended result that is more in line with the interests and preferences of the user. By considering the long-term preferences and real-time behaviors of the user, the individuality and accuracy of the recommendation can be improved. In addition, the application further calculates a position deviation of the candidate recommended content in a user terminal based on position sensitive information, further adjusts the recommended result based on the position deviation, and further improves the individuality and accuracy of the recommendation.
[0187] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be realized by means of software and necessary general hardware platforms, of course, they can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes a plurality of instructions for causing a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in various embodiments of the present application.
[0188] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in a distributed computing environment, in which tasks are performed by remote processing devices connected by a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices.
[0189] Obviously, the above-described embodiments are only a part of the embodiments of the present application, and not all the embodiments, the preferred embodiments of the present application are given in the drawings, but do not limit the patent scope of the present application. The present application can be realized in many different forms, and conversely, the purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive. Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing specific embodiments, or make equivalent replacements to some technical features. Any equivalent structure made by using the contents of the specification and drawings, directly or indirectly applied to other related technical fields, is also within the scope of the patent protection of the present application.
Claims
1. A ranking recommendation method based on long-term preferences of a user, characterized by, The method comprises the following steps: receiving a recommendation instruction, obtaining user data and a long-term behavior sequence of a user to be recommended; inputting the long-term behavior sequence into a pre-trained long-term preference prediction model to obtain a long-term behavior preference of the user; obtaining candidate recommended content and calculating the similarity between the long-term behavior preference of the user and the candidate recommended content; obtaining a real-time behavior sequence of the user and dynamically weighting the user behavior in the real-time behavior sequence to obtain a weighted behavior sequence; inputting the user data, the candidate recommended content, the similarity and the weighted behavior sequence into a pre-trained ranking recommendation model to obtain a ranking recommendation result.
2. The ranking recommendation method based on a user's long-term preference according to claim 1, wherein, Before the step of inputting the long-term behavior sequence into the pre-trained long-term preference prediction model to obtain the long-term behavior preference of the user, the method further comprises the following steps: collecting historical behavior data and dividing the historical behavior data into a training data set and a validation data set, wherein the historical behavior data comprises a user historical long-term behavior sequence and a user historical short-term behavior sequence; training a preset initial prediction model based on the training data set to obtain a trained long-term preference prediction model; verifying the trained long-term preference prediction model based on the validation data set and outputting the long-term preference prediction model that passes the model verification.
3. The ranking recommendation method based on a user's long-term preference according to claim 2, wherein, The preset initial prediction model is a double-tower model, which is composed of two parallel neural networks. The training of the initial prediction model based on the training data set to obtain the trained long-term preference prediction model comprises the following steps: inputting the user historical long-term behavior sequence in the training data set into a first neural network of the initial prediction model to obtain historical long-term behavior features; inputting the user historical short-term behavior sequence in the training data set into a second neural network of the initial prediction model to obtain historical short-term behavior features; calculating the similarity between the historical long-term behavior features and the historical short-term behavior features to obtain a historical long-term and short-term behavior feature similarity; fitting the historical long-term behavior features and the historical short-term behavior features based on the historical long-term and short-term behavior feature similarity to obtain a behavior feature fitting result; iteratively updating the initial prediction model based on the behavior feature fitting result until the model is fitted to obtain the trained long-term preference prediction model.
4. The ranking recommendation method based on a user's long-term preference according to claim 1, wherein, The long-term behavior preference output by the long-term preference prediction model is a long-term behavior preference feature vector. The step of obtaining the candidate recommended content and calculating the similarity between the long-term behavior preference of the user and the candidate recommended content comprises the following steps: obtaining the candidate recommended content and performing feature representation on the candidate recommended content to obtain a candidate content feature vector; mapping the long-term behavior preference feature vector and the candidate content feature vector to the same feature space; calculating the cosine similarity between the long-term behavior preference feature vector and the candidate content feature vector in the feature space to obtain the similarity between the long-term behavior preference of the user and the candidate recommended content.
5. The ranking recommendation method based on a user's long-term preference according to claim 1, wherein, The user real-time behavior sequence is acquired, and user behaviors in the user real-time behavior sequence are dynamically weighted to obtain a weighted behavior sequence, specifically including: The user real-time behavior sequence is parsed to acquire user behavior IDs in the user real-time behavior sequence; The order information of the user behavior IDs in the user real-time behavior sequence is determined; The user behavior IDs and the order information of the user behavior IDs in the user real-time behavior sequence are input into a preset transformer network; The user behaviors in the user real-time behavior sequence are weighted based on the transformer network to obtain the weighted behavior sequence.
6. The ranking recommendation method based on a user's long-term preference according to claim 5, wherein, The order information of the user behavior IDs in the user real-time behavior sequence is determined, specifically including: The triggering time of the user behavior corresponding to the user behavior ID is determined to obtain a first time; The current system time is acquired to obtain a second time; The time difference between the first time and the second time is calculated, and the time difference is taken as the order information of the user behavior ID in the user real-time behavior sequence.
7. The ranking recommendation method based on a user's long-term preference according to claim 1, wherein, After the user data, the candidate recommended content, the similarity, and the weighted behavior sequence are input into a pre-trained ranking recommendation model to obtain a ranking recommendation result, the method further includes: A user terminal is accessed based on the user data, and location sensitive information of the user terminal is acquired, wherein the location sensitive information affects the display position of the candidate recommended content on a display of the user terminal; The location sensitive information is input into a preset shallow network, and the position deviation of the candidate recommended content is calculated using the shallow network based on the location sensitive information; The candidate recommended content in the ranking recommendation result is adjusted based on the position deviation to obtain a final recommendation result.
8. A ranking recommendation apparatus based on long-term preference of a user, characterized by, The method includes: A data acquisition module is configured to receive a recommendation instruction, acquire user data and a user long-term behavior sequence of a user to be recommended; A preference prediction module is configured to input the user long-term behavior sequence into a pre-trained long-term preference prediction model to obtain a user long-term behavior preference; A similarity calculation module is configured to acquire a candidate recommended content, and calculate a similarity between the user long-term behavior preference and the candidate recommended content; A dynamic weighting module is configured to acquire a user real-time behavior sequence, and dynamically weight user behaviors in the user real-time behavior sequence to obtain a weighted behavior sequence; A ranking recommendation module is configured to input the user data, the candidate recommended content, the similarity, and the weighted behavior sequence into a pre-trained ranking recommendation model to obtain a ranking recommendation result.
9. A computer device, comprising: The memory and the processor are included, the memory stores computer readable instructions, and the processor implements the steps of the ranking recommendation method based on a user long-term preference according to the computer readable instructions.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer readable instructions, and the processor implements the steps of the ranking recommendation method based on a user long-term preference according to the computer readable instructions.
Citation Information
Patent Citations
Article recommendation method and recommendation equipment
CN111784455A
User personalized commodity recommendation method and device
CN115880018A