Content recommendation method, system and equipment and storage medium

By building a content recommendation model composed of RAG module, comparison learning module, fine-tuning optimization module and recommendation generation module, the problems of cold start, sparse data and real-time response capabilities in high-precision recommendation scenarios in the existing technology are solved, and the recommendation effect of high accuracy and diversity is achieved.

CN119939009APending Publication Date: 2025-05-06WUHAN SHENZHI CLOUD SHADOW TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411717904.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-27
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

In high-precision recommendation scenarios such as e-commerce, social media and education platforms, existing technology has cold start problems, sparse data and insufficient real-time response capabilities, making it difficult to dynamically respond to users' personalized needs.

Method used

The content recommendation model consisting of the RAG module, the comparison learning module, the fine-tuning optimization module and the recommendation generation module is adopted to obtain candidate recommendation content through the user interest vector, adjust the model parameters, filter high-dimensional matching content, and calculate the recommended score through the weighted optimization objective function value, and finally provide content recommendation.

Benefits of technology

It realizes high-precision recommendation needs in different platform scenarios, improves the diversity and accuracy of recommendations, and can dynamically respond to user changes in personalized needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119939009A_ABST
    Figure CN119939009A_ABST
Patent Text Reader

Abstract

The invention discloses a content recommendation method, system and device and a storage medium, and the method comprises the steps: a content recommendation model is constructed by an RAG module, a comparative learning module, a fine tuning optimization model and a recommendation generation module, and a plurality of candidate recommendation contents are selected from a platform data resource library through the RAG module according to a user interest vector; adjusting model parameters of a comparative learning module through a fine tuning optimization module, and screening a plurality of high-dimensional matching contents from the plurality of candidate recommendation contents through the adjusted comparative learning module; and according to the module weighted recommendation score of each high-dimensional matching content, selecting a plurality of target recommendation contents from the plurality of high-dimensional matching contents through a recommendation generation module to perform content recommendation. The knowledge retrieval capability of the RAG module, the user interest characterization capability of the contrast learning module and the real-time feedback response mechanism of the fine tuning optimization module are combined, and high-precision recommendation requirements under different platform scenes are met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of data processing technology, and in particular relates to a content recommendation method, system, device and storage medium. Background Art

[0002] In scenarios such as e-commerce, social media, and education platforms that require highly accurate recommendations, traditional content recommendation models mainly use collaborative filtering and content-based recommendations. However, existing technologies have shortcomings in cold start problems, data sparsity, and real-time response capabilities. Not only is it difficult to dynamically respond to users' ever-changing personalized needs, but there are also certain limitations on the diversity of recommended content. Therefore, how to achieve high-precision recommendation needs in different platform scenarios has become an urgent problem to be solved.

[0003] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention

[0004] The main purpose of the present invention is to provide a content recommendation method, system, device and storage medium, aiming to solve the technical problem of how to achieve high-precision recommendation requirements in different platform scenarios.

[0005] To achieve the above object, the present invention provides a content recommendation method, which includes:

[0006] Obtaining a user interest vector corresponding to the user operation behavior data based on a content recommendation model, wherein the content recommendation model is constructed by a RAG module, a contrastive learning module, a fine-tuning optimization model, and a recommendation generation module;

[0007] Selecting a plurality of candidate recommended contents from a platform data resource library through the RAG module according to the user interest vector;

[0008] Adjusting the model parameters of the contrastive learning module through the fine-tuning optimization module, and screening a plurality of high-dimensional matching contents from a plurality of candidate recommended contents through the adjusted contrastive learning module;

[0009] Calculating a weighted optimization objective function value among the RAG module, the adjusted contrastive learning module, and the fine-tuning optimization module;

[0010] When the weighted optimization objective function value is less than a preset threshold, respectively calculating the weighted recommendation score of the module corresponding to each high-dimensional matching content;

[0011] According to the module weighted recommendation scores, the recommendation generation module selects multiple target recommended contents from multiple high-dimensional matching contents for content recommendation.

[0012] Optionally, selecting a plurality of candidate recommended contents from a platform data resource library through the RAG module according to the user interest vector includes:

[0013] Based on the RAG module, the correlation scores between the user interest vector and each content vector in the platform data resource library are calculated by using a correlation formula;

[0014] Selecting a plurality of candidate related contents from a plurality of content vectors according to the relevance scores;

[0015] Determining user feedback data based on a plurality of candidate related contents, and updating the user interest vector according to the user feedback data;

[0016] Filling and expanding the multiple candidate related contents according to the updated user interest vector and the context information corresponding to the multiple candidate related contents to obtain multiple pre-processed candidate contents;

[0017] A plurality of candidate recommended contents are selected from a plurality of pre-processed candidate contents according to user preference feature information.

[0018] Optionally, adjusting the model parameters of the contrastive learning module by the fine-tuning optimization module includes:

[0019] Determine a positive sample content vector and a negative sample content vector corresponding to the updated user interest vector based on a plurality of candidate recommended contents;

[0020] Constructing a high-dimensional representation space according to the updated user interest vector, the positive sample content vector and the negative sample content vector through the contrastive learning module;

[0021] Based on the high-dimensional representation space, the model parameters of the contrastive learning module are adjusted through the fine-tuning optimization module according to the updated user interest vector, the positive sample content vector and the negative sample content vector.

[0022] Optionally, adjusting the model parameters of the contrastive learning module through the fine-tuning optimization module based on the high-dimensional representation space according to the updated user interest vector, the positive sample content vector, and the negative sample content vector includes:

[0023] Determine the loss function value of the contrastive learning module based on the high-dimensional representation space according to the updated user interest vector, the positive sample content vector and the negative sample content vector through the loss function of the positive and negative sample pairs;

[0024] Determine a fine-tuning loss function value by fine-tuning the loss function based on the fine-tuning optimization module according to the loss function value;

[0025] The model parameters of the contrastive learning module are adjusted through a parameter updating formula according to the fine-tuning loss function value.

[0026] Optionally, the loss function of the positive and negative sample pairs is:

[0027]

[0028] Where, L contrastive is the loss function value of the contrast learning module, u' is the updated user interest vector, and v i positive is the content vector of the ith positive sample, v j negative is the jth negative sample content vector, τ is the temperature coefficient, sim() is the similarity function, N is the number of positive sample contents, and L is the number of negative sample contents;

[0029] The fine-tuning loss function is:

[0030] L finetune =L contrastive +δf(u',v,θ)

[0031] Where, L finetune is the fine-tuning loss function value, δ is the weight factor for fine-tuning optimization, v is the content vector of positive and negative samples, f(u',v,θ) is the adaptation function of user feedback, and θ is the model parameter to be updated;

[0032] The parameter update formula is:

[0033]

[0034] In the formula, θ t is the model parameter at time t, θ t+1 is the model parameter at time t+1, η is the learning rate, is the rate of change of the loss function with respect to the model parameters θ.

[0035] Optionally, respectively calculating the module weighted recommendation score corresponding to each high-dimensional matching content includes:

[0036] Based on the recommendation generation module, weighted recommendation scores of the modules corresponding to the high-dimensional matching content are calculated using a recommendation score formula;

[0037] The recommendation score formula is:

[0038] S final =α·S RAG +β·S contrastive +γ·S finetune

[0039] S RAG=sim(u',c i )

[0040]

[0041] S finetune =ω i ·sim(u',c' i )

[0042] In the formula, S final Weighted recommendation score for the module, S RAG is the recommended score of the RAG module, S contrastive is the recommended score of the comparative learning module, S finetune is the recommended score of the fine-tuning optimization module, α is the weight of the recommended score of the RAG module, β is the weight of the recommended score of the contrastive learning module, γ is the weight of the recommended score of the fine-tuning optimization module, and c i is the i-th candidate recommendation content, c' i is the i-th high-dimensional matching content, ω i Dynamically generated weights for user feedback.

[0043] Optionally, selecting a plurality of target recommended contents from a plurality of high-dimensional matching contents through the recommendation generation module according to the module weighted recommendation scores for content recommendation includes:

[0044] According to the weighted recommendation scores of the modules, the plurality of high-dimensional matching contents are sorted by the recommendation generation module to obtain a high-dimensional matching sorting result;

[0045] Based on the high-dimensional matching ranking result, multiple target recommended contents are selected from multiple high-dimensional matching contents for content recommendation.

[0046] In addition, to achieve the above purpose, the present invention also proposes a content recommendation system, which includes a data input module and a content recommendation model, and the content recommendation model includes a RAG module, a contrastive learning module, a fine-tuning optimization module and a recommendation generation module:

[0047] The data input module is used to obtain user operation behavior data and generate a user interest vector according to the user operation behavior data;

[0048] The RAG module is further used to select a plurality of candidate recommended contents from the platform data resource library according to the user interest vector;

[0049] The fine-tuning optimization module is used to adjust the model parameters of the contrastive learning module;

[0050] The comparative learning module is used to screen a plurality of high-dimensional matching contents from a plurality of candidate recommended contents based on the adjusted model parameters;

[0051] The recommendation generation module is used to calculate the weighted recommendation score of the module corresponding to each high-dimensional matching content when the weighted optimization objective function value between the RAG module, the adjusted contrast learning module and the fine-tuning optimization module is less than a preset threshold;

[0052] The recommendation generation module is further used to select multiple target recommended contents from multiple high-dimensional matching contents for content recommendation according to the weighted recommendation scores of the module.

[0053] In addition, to achieve the above-mentioned purpose, the present invention also proposes a content recommendation device, which includes: a memory, a processor, and a content recommendation program stored in the memory and executable on the processor, wherein the content recommendation program is configured to implement the content recommendation method described above.

[0054] In addition, to achieve the above-mentioned purpose, the present invention further proposes a storage medium, on which a content recommendation program is stored, and when the content recommendation program is executed by a processor, the content recommendation method as described above is implemented.

[0055] The present invention obtains the user interest vector corresponding to the user operation behavior data based on the content recommendation model. The content recommendation model is constructed by a RAG module, a contrastive learning module, a fine-tuning optimization model and a recommendation generation module. First, multiple candidate recommended contents are selected from the platform data resource library through the RAG module according to the user interest vector, and then the model parameters of the contrastive learning module are adjusted through the fine-tuning optimization module, and multiple high-dimensional matching contents are screened from the multiple candidate recommended contents through the adjusted contrastive learning module. When the weighted optimization objective function value between the RAG module, the adjusted contrastive learning module and the fine-tuning optimization module is less than a preset threshold, the module weighted recommendation score corresponding to each high-dimensional matching content is calculated respectively, and then multiple target recommended contents are selected from the multiple high-dimensional matching contents through the recommendation generation module according to the module weighted recommendation score for content recommendation. Compared with the collaborative filtering and content-based recommendation methods used in the prior art, there are deficiencies in cold start problems, data sparsity and real-time response capabilities, which makes it difficult to dynamically respond to users' changing personalized needs. This embodiment combines the knowledge retrieval capability of the RAG module, the user interest representation capability of the comparative learning module and the real-time feedback response mechanism of the fine-tuning optimization module to achieve high-precision recommendation needs in different platform scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 It is a structural diagram of a content recommendation device in a hardware operating environment involved in an embodiment of the present invention;

[0057] Figure 2 A schematic diagram of a flow chart of a first embodiment of a content recommendation method of the present invention;

[0058] Figure 3 This is a structural block diagram of the first embodiment of the content recommendation model of the present invention.

[0059] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0060] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0061] Reference Figure 1 , Figure 1 A schematic diagram of the structure of a content recommendation device in a hardware operating environment according to an embodiment of the present invention.

[0062] like Figure 1 As shown, the content recommendation device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wireless-Fidelity, Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM) or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk storage. The memory 1005 may also be a storage system independent of the aforementioned processor 1001.

[0063] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the content recommendation device, and may include more or less components than those shown in the figure, or combine certain components, or arrange the components differently.

[0064] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and a content recommendation program.

[0065] exist Figure 1In the content recommendation device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the content recommendation device of the present invention can be set in the content recommendation device, and the content recommendation device calls the content recommendation program stored in the memory 1005 through the processor 1001, and executes the content recommendation method provided by the embodiment of the present invention.

[0066] The embodiment of the present invention provides a content recommendation method, referring to Figure 2 , Figure 2 It is a flowchart of the first embodiment of the content recommendation method of the present invention.

[0067] In this embodiment, the content recommendation method includes the following steps:

[0068] Step S10: obtaining a user interest vector corresponding to the user operation behavior data based on a content recommendation model, wherein the content recommendation model is constructed by a RAG module, a contrastive learning module, a fine-tuning optimization model and a recommendation generation module.

[0069] It is easy to understand that the execution subject of this embodiment can be a content recommendation system with functions such as data processing, network communication and program running, or other computer devices with similar functions, etc., and this embodiment is not limited.

[0070] It should be noted that the content recommendation system includes a data input module and a content recommendation model. The content recommendation model includes a RAG module, a contrastive learning module, a fine-tuning optimization module and a recommendation generation module.

[0071] User operation behavior data can be understood as clicks or browsing records triggered when users view content.

[0072] In the specific implementation, the data input module obtains user operation behavior data and platform data resource library, and can generate user interest vectors based on user operation behavior data through deep learning models (such as Transformer, RNN, etc.), and send the user interest vectors to the content recommendation model. The user interest vectors represent the characteristic information of the user's current preferences, which is convenient for subsequent retrieval and generation of recommended content.

[0073] The platform data resource library is the corresponding database or data source under different platforms, such as the product database of the e-commerce platform, the social media database, the news information data source, etc. The database or data source stores multiple user-operable content.

[0074] It should be noted that the platform is a third-party platform operated and viewed by users, which can be e-commerce, social media, and education platforms, etc.

[0075] It should be understood that the Retrieval Enhanced Generation (RAG) module provides a hybrid recommendation method that combines retrieval and generation. First, relevant content is retrieved from an external knowledge base, and then the generation module processes the retrieval results and outputs recommended content that meets user needs. RAG technology is particularly applicable in applications with large amounts of information and frequent updates, such as e-commerce platforms, social media, and online education. By retrieving the latest product information or review content, RAG can enrich the recommended content.

[0076] In addition, RAG also performs well in cold start and data sparse scenarios: for new users or new content, RAG can generate preliminary recommendations through retrieval without relying on historical data, alleviating the cold start problem. In cross-domain recommendations, RAG matches content in different fields through external retrieval, such as converting interests in social media into product recommendations on e-commerce platforms.

[0077] The contrastive learning module involves a deep learning method based on distance metrics, which aims to improve the model's accurate capture of user interests and content features by enhancing the similarity between positive samples (samples with similar features or behaviors) and target samples, while reducing the similarity between negative samples (samples without relevant features or behaviors) and target samples.

[0078] In the content recommendation model, the contrastive learning module not only improves the matching accuracy of user and content features, but also enhances the robustness of the content recommendation model in data-sparse scenarios. In cold start scenarios (such as new users or new content), the efficient representation capability of the contrastive learning module enables the content recommendation model to process a small amount of user interaction data or rare content, thereby improving the coverage of recommendations.

[0079] In addition, the embedding update mechanism of the contrastive learning module also shows great advantages in multimodal recommendations (such as recommendations of text, image and other information), because it can map different types of data into a unified embedding space and achieve multi-angle characterization of user behavior.

[0080] The fine-tuning optimization module is a technology used to adjust model parameters in real time. By updating the parameters in the content recommendation model, the adaptability of the content recommendation model to changes in user preferences is enhanced. The fine-tuning optimization module not only improves the accuracy of the content recommendation model, but also significantly enhances the real-time response capability of the system, allowing the recommended content to be quickly updated according to the user's latest behavioral preferences. This is especially important in recommendation scenarios where user needs change rapidly (such as e-commerce and social media).

[0081] In content recommendation models, user preferences often change over time and context, and traditional batch update mechanisms have difficulty responding to these dynamic changes immediately. The fine-tuning optimization module can quickly adjust model parameters in a short period of time when user behavior changes. For example, when users continue to click on a certain type of content on the platform, the fine-tuning optimization module will adjust the model's embedded representation through a fast gradient update algorithm, so that the content recommendation model can generate content that better meets the user's needs based on the user's latest preferences when generating content in real time.

[0082] Step S20: selecting a plurality of candidate recommended contents from the platform data resource library through the RAG module according to the user interest vector.

[0083] Furthermore, based on the RAG module, the correlation scores between the user interest vector and each content vector in the platform data resource library are calculated respectively through the correlation formula; multiple candidate related contents are selected from the multiple content vectors according to the correlation scores; user feedback data is determined based on the multiple candidate related contents, and the user interest vector is updated according to the user feedback data; the multiple candidate related contents are filled and expanded according to the updated user interest vector and the context information corresponding to the multiple candidate related contents to obtain multiple pre-processed candidate contents; and multiple candidate recommended contents are selected from the multiple pre-processed candidate contents according to the user preference feature information.

[0084] In the specific implementation, the RAG module searches for candidate recommended content with high similarity in the platform data resource library according to the user interest vector u to ensure the relevance of the content to user needs.

[0085] In the retrieval process, by calculating the user interest vector u and the content vector c in the resource database i The similarity score S RAG , determine the relevance of the content:

[0086] S RAG (c i )=sim(u,c i )

[0087] In the formula, S RAG (c i ) is the content vector c i sim is the relevance score of the content, and sim is the similarity function, which is used to quantify the degree of match between user interests and candidate content. The higher the score, the stronger the relevance of the content to user needs. The system will filter out several candidate related content from high to low based on the similarity score as the basis for recommendation.

[0088] Furthermore, the system collects user feedback on multiple candidate related contents (such as clicks, likes, shares, etc.) to form new feedback data, namely user feedback data, to update the user interest vector according to the user feedback data, and fill in and expand the multiple candidate related contents according to the updated user interest vector and the context information corresponding to the multiple candidate related contents.

[0089] It should also be noted that user feedback data includes positive feedback data and negative feedback data, and these behaviors are quantified into preference signals (for example, clicking indicates positive feedback, and ignoring indicates negative feedback).

[0090] For example, in the e-commerce platform scenario, the basic information of the candidate products can be further enriched into attractive product descriptions, such as focusing on the core functions of the product or the highlights that users care about (such as photo effects, battery life, etc.), thereby increasing the attractiveness of the recommended content.

[0091] User preference feature information is the user's personalized preference. Based on the user's personalized preference, multiple pre-processed candidate contents are enhanced with specific elements to select multiple candidate recommended contents. For example, if a user shows a long-term preference for a specific brand or product category, such elements will be displayed first during content generation to ensure personalized and differentiated recommended content. If a user pays special attention to a brand's flagship product, the generation module will describe the brand's candidate content in detail to better attract the user's attention.

[0092] In this embodiment, the RAG module combines the updated user interest vector u' and the candidate recommendation content vector c i The correlation of is used to calculate the preliminary score of the recommended content. Define the loss function of the RAG module:

[0093]

[0094] Where Z is the number of candidate recommendation content, and M represents the total number of multiple pre-processed candidate content. This loss function uses the retrieval enhancement feature of the RAG module to expand the content range and ensure diversity. i The similarity is combined and the similar content score is maximized. The output of the RAG module provides diverse candidate content for subsequent contrastive learning.

[0095] It should be understood that the output of the RAG module provides a diverse candidate content pool for the contrastive learning module. In the screening process of the contrastive learning module, the initial screening of the RAG module not only enriches the selection range of recommended content, but also ensures the overall relevance of the content.

[0096] Step S30: adjusting the model parameters of the contrastive learning module through the fine-tuning optimization module, and screening a plurality of high-dimensional matching contents from a plurality of candidate recommended contents through the adjusted contrastive learning module.

[0097] Furthermore, the processing method for adjusting the model parameters of the contrastive learning module through the fine-tuning optimization module is to determine the positive sample content vector and the negative sample content vector corresponding to the updated user interest vector based on multiple candidate recommended contents; construct a high-dimensional representation space according to the updated user interest vector, the positive sample content vector and the negative sample content vector through the contrastive learning module; and adjust the model parameters of the contrastive learning module through the fine-tuning optimization module according to the updated user interest vector, the positive sample content vector and the negative sample content vector based on the high-dimensional representation space.

[0098] It should be understood that a positive sample content vector is a content vector that the user is interested in. Content in which the user explicitly expresses interest is considered a positive sample, such as content that the user clicks, likes, or purchases. Content in which the user does not show interest is considered a negative sample, including content that the user does not click or content that is ignored during recommendation. A negative sample content vector is a content vector that is ignored by the user.

[0099] To ensure the accuracy of similarity calculation, the contrastive learning module dynamically optimizes the embedding space based on user feedback. The system readjusts the selection of positive and negative sample pairs based on the user's real-time interactive behavior (such as clicks and shares), so that the model can dynamically adapt to user preferences in subsequent recommendations.

[0100] In this embodiment, the high-dimensional representation space maps user interests and content features into the same mathematical space. User interests (behavior vectors) and content features (such as multimodal features of text and images) are embedded in the same space to ensure that different types of data can be directly compared. In this space, similarity can be calculated by vector distance (such as cosine similarity), thereby efficiently matching users with content. By uniformly representing the features of different types of data, the system can flexibly adapt to a variety of data types (such as images, text, videos, etc.), greatly improving the diversity of recommended content and matching accuracy.

[0101] In the specific implementation, the loss function improves the accuracy of the content recommendation model by maximizing the similarity of positive sample pairs and minimizing the similarity of negative sample pairs in the high-dimensional representation space.

[0102] Furthermore, the processing method of adjusting the model parameters of the contrastive learning module through the fine-tuning optimization module in the content recommendation model based on the high-dimensional representation space according to the updated user interest vector, the positive sample content vector and the negative sample content vector is as follows: based on the high-dimensional representation space, according to the updated user interest vector, the positive sample content vector and the negative sample content vector, the loss function value of the contrastive learning module is determined through the loss function of the positive and negative sample pairs; based on the fine-tuning optimization module in the content recommendation model, the fine-tuning loss function value is determined through the fine-tuning loss function according to the loss function value; and the model parameters of the contrastive learning module are adjusted through the parameter updating formula according to the fine-tuning loss function value.

[0103] The loss function for positive and negative sample pairs is:

[0104]

[0105] Where, L contrastive is the loss function value of the contrast learning module, u' is the updated user interest vector, and v i positive is the content vector of the ith positive sample, v j negative is the jth negative sample content vector, τ is the temperature coefficient, sim() is the similarity function, N is the number of positive sample contents, and L is the number of negative sample contents;

[0106] In different user scenarios, the system dynamically adjusts the temperature coefficient τ according to the breadth or concentration of user interests to balance the similarity distribution of recommended content. For example, when the user's preferences are more concentrated, the system will reduce the τ value to improve the accuracy of distinguishing positive and negative samples; in scenarios with broad preferences, the system will increase τ to more smoothly distinguish between positive and negative sample pairs.

[0107] Through this loss function, the system can significantly improve the updated user interest vector u' and the positive sample content vector v i positive , and at the same time reduce the updated user interest vector u' and the negative sample content vector v j negative The similarity.

[0108] The fine-tuning loss function is:

[0109] L finetune =L contrastive +δf(u',v,θ)

[0110] Where, L finetune is the fine-tuning loss function value, δ is the weight factor for fine-tuning optimization, v is the content vector of positive and negative samples, f(u',v,θ) is the adaptation function of user feedback, and θ is the model parameter to be updated;

[0111] When a user shows a high interest in a specific type of content (such as frequently clicking on articles on a specific topic), the fine-tuning optimization module will update the parameter weights in real time during the model training process, making the model's embedding space and similarity calculation mechanism more inclined to match this type of content.

[0112] The parameter update formula is:

[0113]

[0114] In the formula, θ t is the model parameter at time t, θ t+1 is the model parameter at time t+1, η is the learning rate, is the rate of change of the loss function with respect to the model parameters θ.

[0115] By quickly updating model parameters, the system can ensure timely adjustment of recommended content when user needs change to meet the dynamic needs of users.

[0116] The fine-tuning optimization module receives real-time feedback from users and dynamically updates the parameters of the comparative learning module, so that the recommended content can better adapt to changes in user needs. Through the feedback closed-loop mechanism, the fine-tuning optimization module achieves a balance between the accuracy and real-time nature of the content, and continuously optimizes the output content of the RAG module and the comparative learning module to maintain the relevance and adaptability of the recommendations.

[0117] In this embodiment, the fine-tuning optimization module dynamically adjusts the model parameters of the contrastive learning according to the real-time feedback of the user. To this end, the loss function L of the fine-tuning optimization is defined as Fine-Tuning for:

[0118]

[0119] Where f(u',v,θ) is the adaptation function based on user feedback, and the weight parameter θ of the contrastive learning module is adjusted through user feedback.

[0120] After obtaining user feedback, the fine-tuning optimization module adaptively updates the feature matching weights in the contrastive learning loss function to ensure that the system can adjust the recommendation results in real time according to changes in user needs.

[0121] Step S40: Calculating the weighted optimization objective function value among the RAG module, the adjusted contrastive learning module and the fine-tuning optimization module.

[0122] The RAG module, contrastive learning module and fine-tuning optimization module form a closed-loop personalized recommendation process, which achieves accurate matching of recommended content with user interests and real-time adaptation to changes in user preferences. In order to reflect the synergy of the three modules, the weighted optimization objective function of the content recommendation model is:

[0123] L=κ·L RAG +ε·L contrastive +ρ·L Fine-Tuning

[0124] Where L is the weighted optimization objective function value, κ is the weight of the RAG module, ε is the weight of the contrastive learning module, and ρ is the weight of the fine-tuning optimization module.

[0125] Through the joint optimization of the above three modules, the content recommendation model can dynamically update parameters based on real-time user feedback to ensure the diversity and accurate matching of recommended content.

[0126] Step S50: When the weighted optimization objective function value is less than a preset threshold, the weighted recommendation scores of the modules corresponding to the high-dimensional matching contents are calculated respectively.

[0127] The preset threshold is a user-defined setting. When the weighted optimization objective function value is less than the preset threshold, it proves that the content recommendation model has good performance. If the weighted optimization objective function value is greater than or equal to the preset threshold, it is judged that the content recommendation model has poor performance. It is necessary to update the parameters of the content recommendation model and optimize the content recommendation model so that the weighted optimization objective function value is less than the preset threshold.

[0128] Step S60: selecting a plurality of target recommended contents from a plurality of high-dimensional matching contents through the recommendation generation module according to the module weighted recommendation scores for content recommendation.

[0129] Furthermore, the weighted recommendation scores of the modules corresponding to each high-dimensional matching content are calculated respectively through the recommendation score formula;

[0130] The recommended score formula is:

[0131] S final =α·S RAG +β·S contrastive +γ·S finetune

[0132] S RAG =sim(u',c i )

[0133]

[0134] S finetune =ω i ·sim(u',c' i )

[0135] In the formula, S final Weighted recommendation score for the module, S RAG is the recommended score of the RAG module, S contrastiveis the recommended score of the comparative learning module, S finetune is the recommended score of the fine-tuning optimization module, α is the weight of the recommended score of the RAG module, β is the weight of the recommended score of the contrastive learning module, γ is the weight of the recommended score of the fine-tuning optimization module, and c i is the i-th candidate recommendation content, c' i is the i-th high-dimensional matching content, ω i Dynamically generated weights for user feedback.

[0136] In this implementation, multiple high-dimensional matching contents are sorted by the recommendation generation module according to the module weighted recommendation scores to obtain a high-dimensional matching sorting result; based on the high-dimensional matching sorting result, multiple target recommended contents are selected from the multiple high-dimensional matching contents for content recommendation.

[0137] It should also be noted that the sorting criteria for multiple high-dimensional matching content include content similarity scores, user click-through rates, personalized preferences and other factors.

[0138] The recommendation generation module combines the RAG retrieval content, the precise matching of contrastive learning and the dynamic feedback of the fine-tuning optimization module to form the final recommendation result. The goal of this module is to generate personalized, accurate and diverse recommendation content to meet the dynamic needs of users.

[0139] In a specific implementation, a preset number of target recommended contents can be selected for content recommendation by the recommendation generation module according to the high-dimensional matching sorting result, and multiple target recommended contents with a value greater than a preset recommendation score can be selected from multiple high-dimensional matching contents according to the high-dimensional matching sorting result for content recommendation. The preset recommendation score can be a user-defined setting, and this embodiment does not limit it.

[0140] In order to maintain continuous optimization of the content recommendation model, the present invention improves the stability and performance of the system by regularly updating user behavior data and model parameters.

[0141] User behavior data update: The system regularly updates user interest vectors and content vectors based on the user's latest behavior data (such as clicks, browsing, purchase records, etc.) to ensure the timeliness of the data.

[0142] Closed-loop feedback mechanism: In each iteration, the system adjusts the model’s sample selection strategy, temperature coefficient, and weight parameters of each module based on user feedback data to achieve recommended closed-loop optimization, ensuring that the system always adapts to the dynamic changes in user needs.

[0143] In this embodiment, a user interest vector corresponding to user operation behavior data is obtained based on a content recommendation model. The content recommendation model is constructed by a RAG module, a contrastive learning module, a fine-tuning optimization model and a recommendation generation module. First, multiple candidate recommended contents are selected from a platform data resource library through the RAG module according to the user interest vector, and then the model parameters of the contrastive learning module are adjusted through the fine-tuning optimization module, and multiple high-dimensional matching contents are screened from multiple candidate recommended contents through the adjusted contrastive learning module. When the weighted optimization objective function value between the RAG module, the adjusted contrastive learning module and the fine-tuning optimization module is less than a preset threshold, the module weighted recommendation score corresponding to each high-dimensional matching content is calculated respectively, and then multiple target recommended contents are selected from multiple high-dimensional matching contents through the recommendation generation module according to the module weighted recommendation score for content recommendation. Compared with the collaborative filtering and content-based recommendation methods used in the prior art, there are deficiencies in cold start problems, data sparsity and real-time response capabilities, which makes it difficult to dynamically respond to users' changing personalized needs. This embodiment combines the knowledge retrieval capability of the RAG module, the user interest representation capability of the comparative learning module and the real-time feedback response mechanism of the fine-tuning optimization module to achieve high-precision recommendation needs in different platform scenarios.

[0144] Reference Figure 3 , Figure 3 This is a structural block diagram of the first embodiment of the content recommendation model of the present invention.

[0145] like Figure 3 As shown, the content recommendation system proposed in the embodiment of the present invention includes a data input module 301 and a content recommendation model 302, and the content recommendation model includes a RAG module 3021, a contrast learning module 3022, a fine-tuning optimization module 3023 and a recommendation generation module 3024:

[0146] The data input module 301 is used to obtain user operation behavior data and generate a user interest vector according to the user operation behavior data;

[0147] The RAG module 3021 is further used to select a plurality of candidate recommended contents from the platform data resource library according to the user interest vector;

[0148] The fine-tuning optimization module 3023 is used to adjust the model parameters of the contrastive learning module;

[0149] The comparative learning module 3022 is used to screen a plurality of high-dimensional matching contents from a plurality of candidate recommended contents based on the adjusted model parameters;

[0150] The recommendation generation module 3024 is used to calculate the weighted recommendation score of the module corresponding to each high-dimensional matching content when the weighted optimization objective function value between the RAG module, the adjusted contrast learning module and the fine-tuning optimization module is less than a preset threshold;

[0151] The recommendation generation module 3024 is further used to select multiple target recommended contents from multiple high-dimensional matching contents for content recommendation according to the module weighted recommendation scores.

[0152] Other embodiments or specific implementations of the content recommendation model of the present invention may refer to the above-mentioned method embodiments, which will not be described in detail here.

[0153] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0154] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0155] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware data platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory / random access memory, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0156] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A content recommendation method, characterized in that: The content recommendation method comprises the following steps: Obtaining a user interest vector corresponding to the user operation behavior data based on a content recommendation model, wherein the content recommendation model is constructed by a RAG module, a contrastive learning module, a fine-tuning optimization model, and a recommendation generation module; Selecting a plurality of candidate recommended contents from a platform data resource library through the RAG module according to the user interest vector; Adjusting the model parameters of the contrastive learning module through the fine-tuning optimization module, and screening a plurality of high-dimensional matching contents from a plurality of candidate recommended contents through the adjusted contrastive learning module; Calculating a weighted optimization objective function value among the RAG module, the adjusted contrastive learning module, and the fine-tuning optimization module; When the weighted optimization objective function value is less than a preset threshold, respectively calculating the weighted recommendation score of the module corresponding to each high-dimensional matching content; According to the module weighted recommendation scores, the recommendation generation module selects multiple target recommended contents from multiple high-dimensional matching contents for content recommendation.

2. The method according to claim 1, characterized in that The selecting a plurality of candidate recommended contents from the platform data resource library through the RAG module according to the user interest vector includes: Based on the RAG module, the correlation scores between the user interest vector and each content vector in the platform data resource library are calculated by using a correlation formula; Selecting a plurality of candidate related contents from a plurality of content vectors according to the relevance scores; Determining user feedback data based on a plurality of candidate related contents, and updating the user interest vector according to the user feedback data; Filling and expanding the multiple candidate related contents according to the updated user interest vector and the context information corresponding to the multiple candidate related contents to obtain multiple pre-processed candidate contents; A plurality of candidate recommended contents are selected from a plurality of pre-processed candidate contents according to user preference feature information.

3. The method according to claim 2, characterized in that The adjusting the model parameters of the contrastive learning module by the fine-tuning optimization module includes: Determine a positive sample content vector and a negative sample content vector corresponding to the updated user interest vector based on a plurality of candidate recommended contents; Constructing a high-dimensional representation space according to the updated user interest vector, the positive sample content vector and the negative sample content vector through the contrastive learning module; Based on the high-dimensional representation space, the model parameters of the contrastive learning module are adjusted through the fine-tuning optimization module according to the updated user interest vector, the positive sample content vector and the negative sample content vector.

4. The method according to claim 3, characterized in that The adjusting the model parameters of the contrastive learning module through the fine-tuning optimization module based on the high-dimensional representation space according to the updated user interest vector, the positive sample content vector, and the negative sample content vector includes: Determine the loss function value of the contrastive learning module based on the high-dimensional representation space according to the updated user interest vector, the positive sample content vector and the negative sample content vector through the loss function of the positive and negative sample pairs; Determine a fine-tuning loss function value by fine-tuning the loss function based on the fine-tuning optimization module according to the loss function value; The model parameters of the contrastive learning module are adjusted through a parameter updating formula according to the fine-tuning loss function value.

5. The method according to claim 4, characterized in that The loss function of the positive and negative sample pairs is: Where, L contrastive is the loss function value of the contrast learning module, u' is the updated user interest vector, and v i positive is the content vector of the ith positive sample, v j negative is the jth negative sample content vector, τ is the temperature coefficient, sim() is the similarity function, N is the number of positive sample contents, and L is the number of negative sample contents; The fine-tuning loss function is: L finetune =L contrastive +δf(u',v,θ) Where, L finetune is the fine-tuning loss function value, δ is the weight factor for fine-tuning optimization, v is the content vector of positive and negative samples, f(u',v,θ) is the adaptation function of user feedback, and θ is the model parameter to be updated; The parameter update formula is: In the formula, θ t is the model parameter at time t, θ t+1 is the model parameter at time t+1, η is the learning rate, is the rate of change of the loss function with respect to the model parameters θ.

6. The method according to any one of claims 1 to 5, characterized in that: The respectively calculating the weighted recommendation scores of the modules corresponding to the high-dimensional matching contents includes: Based on the recommendation generation module, weighted recommendation scores of the modules corresponding to the high-dimensional matching content are calculated using a recommendation score formula; The recommendation score formula is: S final =α·S RAG +β·S contrastive +γ·S finetune S RAG =yes(u',c i ) S finetune =ω i ·yes(u',c' i ) In the formula, S final Weighted recommendation score for the module, S RAG is the recommended score of the RAG module, S contrastive is the recommended score of the comparative learning module, S finetune is the recommended score of the fine-tuning optimization module, α is the weight of the recommended score of the RAG module, β is the weight of the recommended score of the contrastive learning module, γ is the weight of the recommended score of the fine-tuning optimization module, and c i is the i-th candidate recommendation content, c' i is the i-th high-dimensional matching content, ω i Dynamically generated weights for user feedback.

7. The method according to claim 6, characterized in that The selecting a plurality of target recommended contents from a plurality of high-dimensional matching contents through the recommendation generation module according to the module weighted recommendation scores for content recommendation comprises: According to the weighted recommendation scores of the modules, the plurality of high-dimensional matching contents are sorted by the recommendation generation module to obtain a high-dimensional matching sorting result; Based on the high-dimensional matching ranking result, multiple target recommended contents are selected from multiple high-dimensional matching contents for content recommendation.

8. A content recommendation system, characterized in that: The content recommendation system includes a data input module and a content recommendation model, and the content recommendation model includes a RAG module, a contrastive learning module, a fine-tuning optimization module and a recommendation generation module: The data input module is used to obtain user operation behavior data and generate a user interest vector according to the user operation behavior data; The RAG module is further used to select a plurality of candidate recommended contents from the platform data resource library according to the user interest vector; The fine-tuning optimization module is used to adjust the model parameters of the contrastive learning module; The comparative learning module is used to screen a plurality of high-dimensional matching contents from a plurality of candidate recommended contents based on the adjusted model parameters; The recommendation generation module is used to calculate the weighted recommendation score of the module corresponding to each high-dimensional matching content when the weighted optimization objective function value between the RAG module, the adjusted contrast learning module and the fine-tuning optimization module is less than a preset threshold; The recommendation generation module is further used to select multiple target recommended contents from multiple high-dimensional matching contents for content recommendation according to the weighted recommendation scores of the module.

9. A content recommendation device, characterized in that: The device comprises: a memory, a processor, and a content recommendation program stored in the memory and executable on the processor, wherein the content recommendation program is configured to implement the content recommendation method according to any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium stores a content recommendation program, and when the content recommendation program is executed by the processor, the content recommendation method according to any one of claims 1 to 7 is implemented.