A video recommendation method, apparatus, electronic device, and storage medium
By generating user status documents and using a large language model to generate semantic units, matching videos are searched from a vector database. Combined with weighted score fusion and filtering mechanisms, the problem of poor video recommendation performance in existing technologies is solved, achieving more accurate personalized recommendations and effective recall of long-tail videos.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUNAN HAPPLY SUNSHINE INTERACTIVE ENTERTAINMENT MEDIA CO LTD
- Filing Date
- 2026-03-19
- Publication Date
- 2026-05-26
AI Technical Summary
Existing video recommendation technologies perform poorly in scenarios with sparse user behavior, fail to effectively uncover users' deeper interests, and are ineffective in recommending new users, relying excessively on popular items.
User status documents are generated by using multi-source heterogeneous user information, semantic units are generated by calling a large language model, matching videos to be recommended are searched from a vector database, and recommendations are made by combining weighted score fusion and filtering mechanisms.
It improves the personalization and accuracy of video recommendations, effectively solves the long-tail recommendation problem, enhances user engagement and interest discovery capabilities, and significantly improves the recommendation effect for new users and users with sparse behavior.
Smart Images

Figure CN122087147A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of video recommendation technology, specifically to a video recommendation method, apparatus, electronic device, and storage medium. Background Technology
[0002] The recall phase of a recommendation system is responsible for quickly filtering out hundreds of candidate items from a massive item database. Currently, the main technologies for video recall are collaborative filtering methods (user-based collaborative filtering and item-based collaborative filtering). However, these methods heavily rely on the density of the "user-item interaction matrix," resulting in poor recommendation performance in video scenarios with sparse behavior. Summary of the Invention
[0003] In view of this, embodiments of the present invention provide a video recommendation method, apparatus, electronic device, and storage medium to improve the video recommendation effect.
[0004] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:
[0005] The first aspect of this invention discloses a video recommendation method, the method comprising:
[0006] Generate user status documents using multi-source heterogeneous user information;
[0007] The large language model is invoked to generate the first semantic unit based on the user state document;
[0008] Search a vector database for recommended videos that match the first semantic unit, wherein the vector database contains at least dense vectors for each video;
[0009] At least some of the videos to be recommended will be recommended to the user.
[0010] Preferably, the process of invoking a large language model to generate a first semantic unit based on the user state document includes:
[0011] The user status document is combined with a preset prompt word strategy to obtain the target prompt word;
[0012] The target prompt word is input into the large language model to obtain the first semantic unit output by the large language model.
[0013] Preferably, searching for videos to be recommended that match the first semantic unit from a vector database includes:
[0014] Convert the first semantic unit into a query vector;
[0015] Calculate the similarity between the query vector and the dense vectors of each video in the vector database;
[0016] The videos corresponding to the dense vectors whose similarity to the query vector is higher than a threshold are identified as videos to be recommended.
[0017] Preferably, recommending at least a portion of the videos to be recommended to the user includes:
[0018] The query vector and the dense vector of the video to be recommended are used to perform weighted score fusion to obtain the final score of the video to be recommended;
[0019] The videos to be recommended are sorted according to their final scores.
[0020] At least a portion of the sorted videos to be recommended are recommended to the user.
[0021] Preferably, recommending at least a portion of the sorted videos to the user includes:
[0022] The sorted videos to be recommended are then filtered.
[0023] The remaining videos after filtering are then recommended to the user.
[0024] Preferably, generating a user status document using multi-source heterogeneous user information includes:
[0025] The draft document is obtained by filling information into a preset structured template with multi-source heterogeneous information from the user. The multi-source heterogeneous information includes at least behavioral sequences, user attributes, and contextual information.
[0026] The draft document is then fine-tuned and rewritten to obtain the user status document.
[0027] Preferably, before searching the vector database for the video to be recommended that matches the first semantic unit, the method further includes:
[0028] Generate the second semantic unit for each video;
[0029] The second semantic unit is converted into a dense vector;
[0030] The dense vectors are stored in a vector database.
[0031] A second aspect of the present invention provides a video recommendation device, the device comprising:
[0032] The first generation module is used to generate user status documents based on the user's multi-source heterogeneous information.
[0033] The second generation module is used to call the large language model to generate the first semantic unit based on the user state document;
[0034] The search module is used to search for videos to be recommended that match the first semantic unit from a vector database, wherein the vector database contains at least dense vectors of each video;
[0035] The recommendation module is used to recommend at least a portion of the videos to be recommended to the user.
[0036] A third aspect of the present invention provides a computer device comprising: a processor and a memory, the processor and the memory being connected via a bus; wherein the processor is configured to call and execute a program stored in the memory; and the memory is configured to store the program, the program being configured to implement the video recommendation method of the first aspect of the present invention.
[0037] A fourth aspect of the present invention provides a storage medium storing computer-executable instructions for executing the video recommendation method of the first aspect of the present invention.
[0038] Based on the video recommendation method, apparatus, electronic device, and storage medium provided in the above embodiments of the present invention, a user status document is generated based on the user's multi-source heterogeneous information, and then a large language model is invoked to generate a first semantic unit based on the user status document. Videos to be recommended that match the first semantic unit are searched from a vector database, and at least a portion of these videos are recommended to the user, thereby improving the video recommendation effect. Attached Figure Description
[0039] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0040] Figure 1 A flowchart of a video recommendation method provided in an embodiment of the present invention;
[0041] Figure 2 A flowchart for finding videos to be recommended, provided in an embodiment of the present invention;
[0042] Figure 3 A flowchart for recommending at least a portion of the videos to be recommended to a user, provided as an embodiment of the present invention;
[0043] Figure 4 A flowchart illustrating the process of generating user status documents provided in an embodiment of the present invention;
[0044] Figure 5 A flowchart illustrating the generation of the first semantic unit provided in an embodiment of the present invention;
[0045] Figure 6 A data processing flowchart for a vector database provided in an embodiment of the present invention;
[0046] Figure 7 This is a structural block diagram of a video recommendation device provided in an embodiment of the present invention. Detailed Implementation
[0047] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0048] In this application, the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0049] The recall phase of a recommendation system is responsible for quickly filtering out hundreds of candidate items from a massive item database. Currently, the main technologies for video recall include collaborative filtering methods, vectorized recall methods, and knowledge graph-based recall methods.
[0050] Among them, collaborative filtering methods mainly include user-based collaborative filtering and item-based collaborative filtering. However, this method relies heavily on the density of the "user-item interaction matrix", which leads to the problem of over-recommendation of popular items and fails to effectively mine long-tail interests.
[0051] Vectorized recall methods include the dual-tower model, which maps users and items to the same vector space for inner product retrieval. However, the recommendation effect is limited by the quality and distribution of the supervision signal (usually clicks), and it is also difficult to get rid of popularity bias. Furthermore, it lacks the ability to model users' deep and cross-domain semantic interests.
[0052] Knowledge graph-based retrieval methods: These methods utilize external structured knowledge to enhance semantic associations. However, they require high quality and completeness in the construction of the knowledge graph, and have limited flexibility and scalability.
[0053] In summary, existing methods are essentially based on the "memory" and "extrapolation" of historical behavior, and cannot perform deep interest inference and semantic expansion based on limited behavior. In addition, for new users or users with extremely sparse behavior (cold start), the recommendation effect of existing methods drops sharply, and they can usually only rely on coarse-grained strategies such as popular lists or user attributes, which cannot achieve true personalization.
[0054] To address this, embodiments of the present invention provide a video recommendation method, apparatus, electronic device, and storage medium. The method generates a user status document based on multi-source heterogeneous user information, and then invokes a large language model to generate a first semantic unit based on the user status document. Videos matching the first semantic unit are searched from a vector database, and at least a portion of these videos are recommended to the user, thereby improving the video recommendation effect.
[0055] In practical applications, this solution can be applied to video recommendation in various video scenarios (such as long video scenarios and short video scenarios).
[0056] It should be noted that this solution has informed users in advance and obtained their authorization before collecting user behavior, user attributes and other data. In other words, this solution collects relevant user data under the premise of compliance.
[0057] See Figure 1 The flowchart illustrates a video recommendation method provided by an embodiment of the present invention, which includes:
[0058] Step S101: Generate a user status document using the user's multi-source heterogeneous information.
[0059] In the specific implementation step S101, multi-source heterogeneous information of the user is obtained, which includes at least behavior sequence, user attributes and context information.
[0060] The behavior sequence is extracted from platform logs, showing user behaviors such as playing, searching, liking, and collecting over a period of time (e.g., 90 days). These behaviors constitute the behavior sequence. Each behavior is converted into a triple in the form of (item ID, behavior type, timestamp). This triple is then expanded into a natural language phrase using item metadata (e.g., title, type).
[0061] It should be noted that, in order to address the problem of sparse user behavior but uneven signal value, when collecting user behavior sequences, the collected behaviors are cleaned (e.g., time-normalized), and then differentiated to determine the weight of each behavior.
[0062] For example, the action of "playing a 120-minute movie in its entirety" has a higher positive weight than the action of "quitting after playing for 5 minutes".
[0063] The method for differentiating "behaviors" to determine their weights is as follows: each behavior is assigned an initial base weight through a weight mapping table, and then the weight of each behavior is non-linearly adjusted according to factors such as playback ratio and behavior time decay.
[0064] User attributes include static attributes (such as age, gender, and registration duration) and dynamic attributes (such as activity levels in the past 30 days and distribution of frequently viewed movies and TV shows).
[0065] Context information: real-time data collection request time (time period, weekday / weekend), device type, geographical location, and network environment.
[0066] After obtaining multi-source heterogeneous information from users, it is necessary to preprocess the multi-source heterogeneous information. Preprocessing includes key behavior extraction (such as extracting behaviors such as completion of play, collection, and exploration), time-series pattern analysis (such as analyzing recent preference changes), heterogeneous information alignment (such as aligning time, scene, and intensity), and outlier filtering.
[0067] Among them, key behavior extraction and temporal pattern analysis are performed on user behavior sequences in multi-source heterogeneous information, and heterogeneous information alignment is used to transform multi-source heterogeneous information into a machine-understandable, semantically rich structured document.
[0068] After preprocessing the user's multi-source heterogeneous information, information is filled into a preset structured template using the user's multi-source heterogeneous information to obtain a draft document.
[0069] Specifically, the structured template is a JSON template with a predefined document framework. This structured template includes basic profiles (age, gender, and region, etc.), behavioral summaries (recent key actions and preferences), interest tags (type, topic, style preference, etc.), and real-time status (device, time period, and session scenario, etc.). Information is filled into this structured template using multi-source heterogeneous information from users to obtain a draft document.
[0070] It should be noted that a rule engine can be used to populate the corresponding key fields when filling information into the structured template. Furthermore, the roles of behavioral sequences, user attributes, and contextual information from multi-source heterogeneous information during the process of populating the structured template are as follows:
[0071] The role of behavioral sequences: to identify users' most stable and frequent areas of interest; to analyze interest migration paths through time series analysis (e.g., from "science fiction movies" → "hard science fiction" → "space physics documentaries"); and to calculate the intensity of users' preferences for specific genres / directors / actors by accumulating the weights of behaviors.
[0072] The role of user attributes: attributes such as age and region provide security for recommendations; recommending dialect content or localized adaptations based on the user's region; VIP level and historical payment behavior can indicate acceptance of high-quality and exclusive content.
[0073] The role of contextual information: device type is used to recommend content with appropriate bitrate and quality; network environment is used to avoid recommending 4K ultra-high-definition playback under mobile network conditions; time scenario is used to recommend short dramas during weekday lunchtimes and movies in the evening.
[0074] To make the draft document more natural, coherent, and in line with the input habits of the large language model, the draft document was fine-tuned and rewritten to obtain the user status document, which can clearly present the user's core interests, behavioral patterns, and current scenario.
[0075] Specifically, a lightweight text generation model can be used to fine-tune and rewrite the draft document to obtain the user status document.
[0076] For example, the specific content of the obtained user status document is as follows:
[0077] "User ID: U1001; Time period: Weekend evening, home TV; Recent high-weight behavior: In the past three days, watched the entire series of a certain TV series (12 episodes in total, 70 minutes per episode); Historical interests: In the past six months, a certain film and television genre accounted for more than 60%, with a preference for multi-narrative and period-related works; Current exploration clues: Searched for suspense dramas yesterday."
[0078] Understandably, when generating user status documents, different document generation strategies can be adopted based on the user type to determine the focus of the user status document.
[0079] For example, when generating user status documents, for users with rich behavioral data and long historical records, the first document generation strategy (denoted as document generation strategy A) can be used to deeply mine the stable interest profile formed by the user over a long period of time.
[0080] For example, when generating user status documents, for users who have been highly active recently and whose interests may change, a second document generation strategy (denoted as document generation strategy B) can be used to quickly capture the user's current short-term interests and immediate intentions.
[0081] For example, when generating user status documents, a third document generation strategy (denoted as document generation strategy C) can be used for new users, users with sparse behavior, or users who have been inactive for a long time to build a usable initial profile and guide interest exploration when data is limited.
[0082] In some specific embodiments, after generating the user status document, it undergoes quality checks across multiple dimensions. Only when the user status document passes these checks is it output for use in subsequent steps. If the user status document fails the quality checks across multiple dimensions, the structured template or document generation strategy needs to be adjusted.
[0083] The quality checks across multiple dimensions include at least: integrity checks, consistency checks, timeliness checks, diversity checks, readability checks, length checks, and sensitive information checks.
[0084] Integrity verification is used to check whether the user status document contains key fields such as basic profile, behavior summary, interest tags, and real-time status.
[0085] Consistency checks are used to verify the consistency of internal information in a user status document. For example, they can check whether a user's historical behavior and interest tags are consistent, or whether there are contradictions between the user's real-time status and basic profile.
[0086] Timeliness verification is used to check whether the data used in the user status document is within a valid time range.
[0087] Diversity validation is used to check whether user status documents contain diverse points of interest (avoiding single-interest descriptions).
[0088] Readability checks are used to verify whether the natural language in user status documents is clear, fluent, and coherent.
[0089] Length validation is used to check whether the length of the user status document is appropriate.
[0090] Sensitive information validation is used to check whether user status documents contain sensitive information.
[0091] By using user status documents that have passed quality verification as conditions, the large language model is driven to generate diverse candidate interest descriptions, which effectively compensates for data sparsity and provides users with recall capabilities based on semantic reasoning for cold starts. See the following explanation for details.
[0092] Step S102: Invoke the large language model to generate the first semantic unit based on the user state document.
[0093] It should be noted that an arbitrary type of large language model is pre-selected as the base to construct an instruction fine-tuning dataset. The sample format is "{"instruction":"Generate diverse interest descriptions based on user status.", "input":"User status document", "output":"A set of semantic units in JSON format"}". Low-rank adaptation (LoRA) technique is used when training the large language model.
[0094] In the specific implementation step S102, the generation direction of the large language model is controlled by the system prompt, the user state document is combined with the preset prompt strategy to obtain the target prompt, the target prompt is input into the large language model to obtain the first semantic unit output by the large language model.
[0095] Understandably, the prompt word library contains multiple prompt word strategies. The user state document is combined with each prompt word strategy to obtain multiple target prompt words. For each target prompt word, it is input into a large language model to obtain the first semantic unit output by the large language model. Multiple first semantic units can be obtained through the aforementioned method; that is, each prompt word strategy can generate one first semantic unit.
[0096] For example, the prompt word library includes prompt word strategy A, prompt word strategy B and prompt word strategy C; prompt word strategy A is an interest-deepening strategy, which is used to generate descriptions of similar works that are more in-depth in theme and more refined in production based on the user's most explicit interests;
[0097] Prompt word strategy B is an interest exploration strategy, used to generate descriptions of works that are weakly related to the user's historical interests, but slightly different in terms of type, style or region, to help them discover new areas;
[0098] The prompt keyword strategy C is a freshness and long-tail support strategy, which is used to ensure that the generated descriptions contain 30% of high-quality content that was launched within the last 90 days and whose play count ranks in the bottom 50% of the platform.
[0099] The user status document is combined with the prompt word strategy A to obtain the corresponding target prompt word A. The target prompt word A is then input into the large language model to obtain the first semantic unit A output by the large language model.
[0100] The user status document is combined with the prompt word strategy B to obtain the corresponding target prompt word B. The target prompt word B is then input into the large language model to obtain the first semantic unit B output by the large language model.
[0101] The user status document is combined with the prompt word strategy C to obtain the corresponding target prompt word C. The target prompt word C is then input into the large language model to obtain the first semantic unit C output by the large language model.
[0102] It should be noted that the large language model is constrained to output a standardized JSON array, with each first semantic unit being an object with fixed fields. Post-processing, such as deduplication and key element integrity verification, is performed on the first semantic units to ensure the output quality of the large language model.
[0103] For example, one example of the generated first semantic unit is: "json{"semantic_unit_id":"SU_001","category":"science fiction movie","theme":"high-concept time philosophy","key_elements":["director:Zhang San","narrative structure:non-linear","emotional tone:grand and tragic"]","reasoning":"inferred based on user's viewing behavior of a movie and preference for complex narratives."","diversity_tag":"interest deepening instruction" / / identifier generation strategy}".
[0104] As can be seen from the above description, this solution dynamically adjusts the generation focus of the large language model by switching prompt word strategies, which can proactively plan the direction of video recall rather than passively responding to user history, and can solve the problems of insufficient diversity and long-tail mining.
[0105] Step S103: Search the vector database for videos to be recommended that match the first semantic unit.
[0106] It should be noted that dense vectors for each video are generated in advance, and then these dense vectors are stored in a vector database. In other words, the vector database must contain at least the dense vectors for each video. The following explains how the dense vectors for the videos are obtained.
[0107] In some specific embodiments, a second semantic unit is generated for each video, the second semantic unit is converted into a dense vector, and the dense vector is stored in a vector database.
[0108] In practice, for each video in the video library, the video's metadata and external knowledge are extracted, and "multimodal analysis" and "script and subtitle natural language processing (NLP) analysis" are performed on the video.
[0109] The metadata includes structured information such as title, description, tags, and cast / crew list. External knowledge of the video is obtained from film and television knowledge graphs or professional film review APIs, including information such as the director's statement, awards, professional reviews, and socio-cultural background.
[0110] Multimodal analysis: For each video, keyframes and audio clips are sampled according to the timeline or plot segments. Visual models are used to analyze the visual style and scene composition, and audio models are used to analyze the music type and emotional tone.
[0111] Script and subtitle NLP analysis: Utilizing natural language processing technology to analyze video subtitles or scripts, extracting key entities (characters, locations), emotional change curves, core plot summaries, and classic lines.
[0112] For each video, by combining the video's "metadata", "external knowledge", "multimodal analysis results", and "script and subtitle NLP analysis results", multiple second semantic units (e.g., 3-8 second semantic units) are generated for the video using rule templates or lightweight generation models. Each second semantic unit of the video is encoded into a dense vector of fixed dimensions using a text encoder. Triples consisting of dense vectors, video IDs, and second semantic units are stored in a vector database, and an index structure suitable for approximate nearest neighbor search is constructed.
[0113] For example, store the triple (video_id, semantic_unit_vector, semantic_unit_text) in a vector database. Here, video_id is the video ID, semantic_unit_vector is the dense vector obtained by encoding the second semantic unit, and semantic_unit_text is the second semantic unit.
[0114] It should be noted that the second semantic unit is usually a JSON string or text in a specific format. The second semantic unit contains semantic information such as the type, theme, style, and key elements of the video.
[0115] The above is a description of the data in the vector database.
[0116] In the specific implementation step S103, based on the dense vectors of each video in the vector database, the video to be recommended that matches the first semantic unit is searched in the vector database. The video to be recommended is the video corresponding to the second semantic unit that has a high similarity to the first semantic unit.
[0117] Step S104: Recommend at least some of the videos to be recommended to the user.
[0118] In this embodiment of the invention, a user status document is generated based on the user's multi-source heterogeneous information, and then a large language model is invoked to generate a first semantic unit based on the user status document. Videos matching the first semantic unit are searched from a vector database, and at least a portion of these videos are recommended to the user, thereby improving the video recommendation effect.
[0119] Regarding the above embodiments of the present invention Figure 1 The step S103, "searching for videos to be recommended that match the first semantic unit from the vector database," refers to [see section 103]. Figure 2 This illustrates a flowchart of the process for finding videos to be recommended, provided in an embodiment of the present invention. Figure 2 Includes the following steps:
[0120] Step S201: Convert the first semantic unit into a query vector.
[0121] In the specific implementation step S201, for each first semantic unit, a text encoder is used to encode the first semantic unit into a query vector in real time. That is, each first semantic unit is encoded into a query vector.
[0122] Step S202: Calculate the similarity between the query vector and the dense vectors of each video in the vector database.
[0123] In the specific implementation step S202, for each query vector, the similarity between the query vector and the dense vectors of each video in the vector database is calculated.
[0124] Step S203: Determine the videos corresponding to dense vectors with a similarity to the query vector that is higher than a threshold as the videos to be recommended.
[0125] In the specific implementation of step S203, for each query vector, the video corresponding to the dense vector with a similarity higher than the threshold is determined as the video to be recommended, that is, the most similar videos recalled by the query vector are used as the videos to be recommended.
[0126] In the specific implementation, for all query vectors, an Approximate Nearest Neighbor (ANN) query is performed in parallel in the vector database to recall the most similar video IDs for each query vector. The videos corresponding to the recalled video IDs are the videos to be recommended.
[0127] The above embodiments of the present invention Figure 2 This is an explanation of how to find videos to recommend.
[0128] Regarding the above embodiments of the present invention Figure 1 Step S104, which involves "recommending at least some of the videos to be recommended to the user," can be found in [link to relevant documentation]. Figure 3 This illustrates a flowchart of an embodiment of the present invention for recommending at least a portion of the videos to be recommended to a user. Figure 3 Includes the following steps:
[0129] Step S301: Use the query vector and the dense vector of the video to be recommended to perform weighted score fusion to obtain the final score of the video to be recommended.
[0130] It should be noted that in the process of determining the video to be recommended, since a video to be recommended may be matched by multiple first semantic units (i.e., multiple first semantic units may recall the same video to be recommended), in the specific implementation step S301, for each video to be recommended, a weighted score is fused using each query vector, the weight of each query vector, and the dense vector of the video to be recommended, so as to obtain the final score of the video to be recommended.
[0131] The final score of each video to be recommended can be calculated using formula (1).
[0132] (1);
[0133] In formula (1), v is the dense vector of the video to be recommended, and q i Let be the i-th query vector, sim be the cosine similarity, and w be the inequality. i Let be the weight of the i-th query vector, and FinalScore(v) be the final score of the video to be recommended.
[0134] That is, for each video to be recommended, the final score of the video to be recommended is calculated based on each query vector and the weight of each query vector using formula (1).
[0135] It should be noted that the weight of the query vector can be determined based on the confidence of the large language model that generates the first semantic unit, or it can be determined through policy importance.
[0136] Step S302: Sort the videos to be recommended according to their final scores.
[0137] In the specific implementation step S302, all videos to be recommended are sorted in descending order according to their final scores.
[0138] Understandably, after sorting all the videos to be recommended, the sorting order of all the videos to be recommended can be dynamically adjusted based on the user's status.
[0139] For example, if a user's status shows that they are currently watching a TV series, then the ranking of recommended videos in the series they are currently watching will be increased.
[0140] Step S303: Recommend at least a portion of the sorted videos to the user.
[0141] In the specific implementation step S303, the sorted videos to be recommended are filtered, and the remaining videos to be recommended are recommended to the user.
[0142] In practice, the sorted videos to be recommended are deduplicated and / or scene-adaptive filtered, and the remaining videos are recommended to the user.
[0143] The deduplication filter is used to remove videos that a user has already watched before being recommended.
[0144] Scene-adaptive filtering is used to: filter out videos that do not fit the current context and prioritize recommending videos that do fit the current context, based on the user's current context.
[0145] For example, if the user's current context indicates that the user is using a mobile network, then excessively long videos (duration greater than 2 hours) will be filtered out, and TV series or short videos will be recommended to the user first.
[0146] Understandably, besides recommending the filtered videos to the user, you could also recommend all the sorted videos to the user directly, or recommend the top M videos with the highest final scores to the user.
[0147] The above embodiments of the present invention Figure 3 This is an explanation regarding recommending at least some of the videos to users.
[0148] To better understand how user state documents and first semantic units are generated, and how data is generated and stored in the vector database, we will respectively... Figure 4 , Figure 5 and Figure 6 Let's illustrate this with examples from real-world application scenarios.
[0149] See Figure 4 , Figure 4 This diagram illustrates a flowchart of a process for generating user status documents according to an embodiment of the present invention. Figure 4 Includes the following steps:
[0150] Step S401: Obtain the user's multi-source heterogeneous information in the data input layer.
[0151] Step S402: Preprocess the multi-source heterogeneous information in the core processing layer.
[0152] The preprocessing performed in the core processing layer includes: key behavior extraction (e.g., extracting behaviors such as completion of broadcasts, collection, and exploration), time-series pattern analysis (e.g., analyzing recent preference changes), heterogeneous information alignment (e.g., aligning time, scene, and intensity), and outlier filtering.
[0153] Step S403: Select a document generation strategy.
[0154] Among them, a document generation strategy is selected from the first document generation strategy (document generation strategy A), the second document generation strategy (document generation strategy B), and the third document generation strategy (document generation strategy C).
[0155] Document generation strategy A is a comprehensive, panoramic strategy used to deeply mine stable interest profiles formed over a long period of time. Document generation strategy B is a recent-focused strategy used to quickly capture users' current short-term interests and immediate intentions. Document generation strategy C is a cold-start guidance strategy used to build a usable initial profile and guide interest exploration when data is limited.
[0156] Step S404: Generate the user status document in the document generation layer.
[0157] It should be noted that when generating user status documents, it is necessary to perform relevant processing on basic profiles, behavioral summaries, interest tags, and real-time status.
[0158] The processing of the basic profile includes processing information such as the user's age, gender, and region.
[0159] The processing of behavioral summaries involves summarizing the user's recent key actions and preferences.
[0160] The processing of interest tags involves abstracting user interests such as type, theme, and style preferences.
[0161] The processing of real-time status involves capturing contextual information such as the user's current device, time period, and session scenario.
[0162] Step S405: Perform quality checks on the user status documents across multiple dimensions.
[0163] Step S406: Determine whether the user status document has passed the quality check. If it fails, proceed to step S407; if it passes, proceed to step S408.
[0164] Step S407: Adjust the structured template or document generation strategy, then return to step S404.
[0165] Step S408: Output the user status document.
[0166] See Figure 5 , Figure 5 This diagram illustrates a flowchart of an embodiment of the present invention for generating a first semantic unit. Figure 5 Includes the following steps:
[0167] Step S501: Select a prompt word strategy.
[0168] The selected prompt strategies include at least three: Prompt Strategy A, Prompt Strategy B, and Prompt Strategy C. Prompt Strategy A is an interest-deepening strategy, Prompt Strategy B is an interest-exploration strategy, and Prompt Strategy C is a novelty and long-tail support strategy.
[0169] Step S502: Combine the user status document with the prompt word strategy to obtain the target prompt word.
[0170] Step S503: Input the target prompt word into the large language model to obtain the first semantic unit output by the large language model.
[0171] Step S504: Determine if the format of the first semantic unit is correct. If incorrect, proceed to step S505; if correct, proceed to step S506.
[0172] Step S505: Format and correct the first semantic unit, then return to step S504.
[0173] Step S506: Output the first semantic unit.
[0174] See Figure 6 The diagram illustrates the data processing flowchart of the vector database provided in an embodiment of the present invention. Figure 6 Includes the following steps:
[0175] Step S601: Traverse the video library to obtain a single video.
[0176] Step S602: Extract the video's metadata and external knowledge, and perform multimodal analysis and script and subtitle NLP analysis on the video.
[0177] Step S603: Integrate the information from the previous step to generate multiple second semantic units of the video.
[0178] It should be noted that during the execution of step S603, the "information from the previous step" includes: the video's "metadata", "external knowledge", "multimodal analysis results", and "script and subtitle NLP analysis results".
[0179] Step S604: Encode the second semantic unit of the video into a dense vector.
[0180] Step S605: Store the triple consisting of the dense vector, the video ID, and the second semantic unit into the vector database.
[0181] Step S606: Determine whether the video library has been traversed. If not, return to step S601; if completed, confirm that the data storage of the vector database has been completed.
[0182] It should be noted that, Figure 4 , Figure 5 and Figure 6 The execution principle has been described in the above embodiments of the present invention. Figure 1 For a detailed explanation, please refer to [reference needed], which will not be repeated here.
[0183] Based on the above embodiments, this solution has the following beneficial effects:
[0184] Deeply understand the complex semantics of videos: Through structured semantic units, it is possible to model and match users' interests in abstract dimensions such as narrative structure, artistic style, and deep themes, thereby achieving a deeper level of personalization.
[0185] Effectively solves the long-tail recommendation problem: Through a controllable long-tail support strategy and in-depth content analysis, it can accurately identify and recall high-quality but low-exposure videos such as movies, documentaries, and niche TV series.
[0186] Significantly enhance user engagement: More accurate interest discovery and diversified recommendation results can improve user completion rate, average daily viewing time and exploration satisfaction.
[0187] Handling cold starts: Generative recall based on semantic reasoning can provide new or sparse users with more personalized initial recommendations than the trending list, accelerating user interest modeling.
[0188] Corresponding to the video recommendation method provided in the above embodiments of the present invention, see also... Figure 7 The present invention also provides a structural block diagram of a video recommendation device, which includes: a first generation module 701, a second generation module 702, a search module 703, and a recommendation module 704.
[0189] The first generation module 701 is used to generate user status documents using multi-source heterogeneous information of users.
[0190] In specific implementation, the first generation module 701 is specifically used to: fill information into a preset structured template using the user's multi-source heterogeneous information to obtain a draft document, wherein the multi-source heterogeneous information includes at least a behavior sequence, user attributes, and context information; and fine-tune and rewrite the draft document to obtain a user status document.
[0191] The second generation module 702 is used to call the large language model to generate the first semantic unit based on the user state document.
[0192] In specific implementation, the second generation module 702 is used to: combine the user status document with the preset prompt word strategy to obtain the target prompt word; input the target prompt word into the large language model to obtain the first semantic unit output by the large language model.
[0193] The lookup module 703 is used to find recommended videos that match the first semantic unit from the vector database, which contains at least the dense vectors of each video.
[0194] Recommendation module 704 is used to recommend at least a portion of the videos to be recommended to the user.
[0195] In this embodiment of the invention, a user status document is generated based on the user's multi-source heterogeneous information, and then a large language model is invoked to generate a first semantic unit based on the user status document. Videos matching the first semantic unit are searched from a vector database, and at least a portion of these videos are recommended to the user, thereby improving the video recommendation effect.
[0196] Preferably, the lookup module 703 includes a transformation submodule, a calculation submodule, and a determination submodule. The execution principle of each submodule is as follows:
[0197] The transformation submodule is used to transform the first semantic unit into a query vector.
[0198] The computation submodule is used to calculate the similarity between the query vector and the dense vectors of each video in the vector database.
[0199] The determination submodule is used to identify videos corresponding to dense vectors with a similarity higher than a threshold to the query vector as videos to be recommended.
[0200] Preferably, the recommendation module 704 includes a fusion submodule, a sorting submodule, and a recommendation submodule. The execution principle of each submodule is as follows:
[0201] The fusion submodule is used to perform weighted score fusion using the query vector and the dense vector of the video to be recommended, so as to obtain the final score of the video to be recommended.
[0202] The sorting submodule is used to sort the videos to be recommended according to their final scores.
[0203] The recommendation submodule is used to recommend at least a portion of the sorted videos to the user.
[0204] The recommendation submodule is specifically used to: filter the sorted videos to be recommended; and recommend the remaining videos to the user.
[0205] Preferably, the video recommendation device further includes:
[0206] The storage module is used to generate the second semantic units for each video; convert the second semantic units into dense vectors; and store the dense vectors in the vector database.
[0207] Preferably, embodiments of the present invention also provide a computer device, including: a processor and a memory, the processor and the memory being connected via a bus; wherein, the processor is used to call and execute a program stored in the memory; the memory is used to store the program, the program being used to implement the video recommendation method provided in the above method embodiments.
[0208] Preferably, the present invention also provides a storage medium storing computer-executable instructions for executing the video recommendation method provided in the above-described method embodiments.
[0209] In summary, embodiments of the present invention provide a video recommendation method, apparatus, electronic device, and storage medium. The method generates a user status document based on multi-source heterogeneous user information, and then calls a large language model to generate a first semantic unit based on the user status document. Videos matching the first semantic unit are searched from a vector database, and at least a portion of these videos are recommended to the user, thereby improving the video recommendation effect.
[0210] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for system or system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and relevant parts can be referred to the descriptions in the method embodiments. The systems and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0211] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0212] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A video recommendation method, characterized in that, The method includes: Generate user status documents using multi-source heterogeneous user information; The large language model is invoked to generate the first semantic unit based on the user state document; Search a vector database for recommended videos that match the first semantic unit, wherein the vector database contains at least dense vectors for each video; At least some of the videos to be recommended will be recommended to the user.
2. The method according to claim 1, characterized in that, The process of generating a first semantic unit based on the user state document using a large language model includes: The user status document is combined with a preset prompt word strategy to obtain the target prompt word; The target prompt word is input into the large language model to obtain the first semantic unit output by the large language model.
3. The method according to claim 1, characterized in that, The system searches the vector database for videos to be recommended that match the first semantic unit, including: Convert the first semantic unit into a query vector; Calculate the similarity between the query vector and the dense vectors of each video in the vector database; The videos corresponding to the dense vectors whose similarity to the query vector is higher than a threshold are identified as videos to be recommended.
4. The method according to claim 3, characterized in that, Recommending at least a portion of the videos to be recommended to the user includes: The query vector and the dense vector of the video to be recommended are used to perform weighted score fusion to obtain the final score of the video to be recommended; The videos to be recommended are sorted according to their final scores. At least a portion of the sorted videos to be recommended are recommended to the user.
5. The method according to claim 4, characterized in that, Recommending at least a portion of the sorted videos to the user, including: The sorted videos to be recommended are then filtered. The remaining videos after filtering are then recommended to the user.
6. The method according to claim 1, characterized in that, Generate user status documents using multi-source heterogeneous user information, including: The draft document is obtained by filling information into a preset structured template with multi-source heterogeneous information from the user. The multi-source heterogeneous information includes at least behavioral sequences, user attributes, and contextual information. The draft document is then fine-tuned and rewritten to obtain the user status document.
7. The method according to claim 1, characterized in that, Before searching the vector database for the video to be recommended that matches the first semantic unit, the process also includes: Generate the second semantic unit for each video; The second semantic unit is converted into a dense vector; The dense vectors are stored in a vector database.
8. A video recommendation device, characterized in that, The device includes: The first generation module is used to generate user status documents based on the user's multi-source heterogeneous information. The second generation module is used to call the large language model to generate the first semantic unit based on the user state document; The search module is used to search for videos to be recommended that match the first semantic unit from a vector database, wherein the vector database contains at least dense vectors of each video; The recommendation module is used to recommend at least a portion of the videos to be recommended to the user.
9. A computer device, characterized in that, include: A processor and a memory are connected via a bus; wherein the processor is used to call and execute a program stored in the memory; The memory is used to store a program for implementing the video recommendation method as described in any one of claims 1-7.
10. A storage medium, characterized in that, The storage medium stores computer-executable instructions for performing the video recommendation method as described in any one of claims 1-7.