Video recommendation method and device, electronic equipment and storage medium
The video script analysis model is used to analyze the video currently watched by the user, combined with user preferences, to filter out video recommendations that match the current plot, solving the problem of video recommendation mismatch in the existing technology, and improving the accuracy of recommendations and user experience.
Patent Information
- Application Number
- CN202410829539.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-25
- Publication Date
- 2024-10-15
AI Technical Summary
When video streaming platforms recommend videos, they usually do not pay attention to the plot of the video currently watched by the user, resulting in a mismatch between the recommended video and the user's current plot, reducing the accuracy of the recommendation.
Use the pre-trained video script analysis model to analyze the video currently played by the user, obtain the video category label and segment category label, combine the user's video viewing record information, filter out the video files to be recommended that match the current video plot, and based on the playback Information is recommended.
The accuracy of video recommendation is improved, and the recommended video is closely related to the plot of the video currently watched by the user, thus improving the user experience.
Smart Images

Figure CN118779489A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of video recommendation, and in particular to a video recommendation method, device, electronic device and storage medium. Background Art
[0002] When making video recommendations, video streaming platforms usually count the user's historical video viewing records, video likes, comments, and other data to make video recommendations. This recommendation method does not pay attention to the video episodes that the user is currently watching, and cannot fully understand the plot of the video currently being watched, resulting in the recommended videos not being closely related to the plot currently being watched by the user, resulting in poor accuracy of video recommendations. Summary of the invention
[0003] The purpose of the embodiments of the present application is to provide a video recommendation method, device, electronic device and storage medium, so as to recommend videos related to the plot of the video currently being watched to the user, thereby improving the accuracy of video recommendation. The specific technical solution is as follows:
[0004] In a first aspect of the implementation of the present application, a video recommendation method is first provided, comprising:
[0005] Using a pre-trained video script analysis model to process the target video script information of the target video file currently played by the user, obtain a video category label of the target video file, and a plurality of target video segments of the target video file segmented based on video plot information and segment category labels of the plurality of target video segments;
[0006] Determining a preference category label of the user according to the video viewing record information of the user;
[0007] Obtaining candidate video files matching the video category label;
[0008] Based on the preference category label and the segment category label, selecting a video file to be recommended corresponding to each target video segment from the candidate video files;
[0009] Based on the playback information of the target video segment, the video file to be recommended is recommended to the user.
[0010] In a second aspect of the implementation of the present application, a video recommendation device is provided, including:
[0011] A video category label acquisition module is used to process the target video script information of the target video file currently played by the user using a pre-trained video script analysis model to obtain the video category label of the target video file, and multiple target video segments of the target video file segmented based on video plot information and segment category labels of the multiple target video segments;
[0012] A preference category label determination module, used to determine the user's preference category label based on the user's video viewing record information;
[0013] A candidate video file acquisition module, used to acquire candidate video files matching the video category label;
[0014] A to-be-recommended video screening module, configured to screen out a to-be-recommended video file corresponding to each of the target video segments from the candidate video files based on the preference category label and the segment category label;
[0015] The to-be-recommended video recommendation module is used to recommend the to-be-recommended video file to the user based on the playback information of the target video segment.
[0016] In another aspect of the present application, there is also provided an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0017] Memory, used to store computer programs;
[0018] The processor is used to implement any of the above-mentioned video recommendation methods when executing the program stored in the memory.
[0019] In another aspect of the present application, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is executed on a computer, the computer executes any of the above-mentioned video recommendation methods.
[0020] In another aspect of the present application, a computer program product is provided, on which a computer program is stored. When the computer program is run on a computer, the computer executes any of the above-mentioned video recommendation methods.
[0021] The solution provided by the embodiment of the present application uses a pre-trained video script analysis model to process the target video script information of the target video file currently played by the user, and obtains the video category label of the target video file, and multiple target video segments of the target video file segmented based on the video plot information and the segment category labels of the multiple video segments. According to the user's video viewing record information, the user's preferred category label is determined. The candidate video files matching the video category label are obtained. Based on the preferred category label and the segment category label, the video files to be recommended corresponding to each target video segment are screened out from the candidate video files. Based on the playback information of the target video segment, the video files to be recommended are recommended to the user. The embodiment of the present application uses a video script analysis model to analyze the video currently played by the user, and combines the category labels of the segmented video segments and the user's preferred category labels to screen the videos to be recommended, so that videos related to the plot of the video currently being watched can be recommended to the user, thereby improving the accuracy of video recommendations. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.
[0023] Figure 1 A flowchart of a video recommendation method provided in an embodiment of the present application;
[0024] Figure 2 A flowchart of the steps of a video script analysis model training method provided in an embodiment of the present application;
[0025] Figure 3 A flowchart of a method for segmenting a video clip provided in an embodiment of the present application;
[0026] Figure 4 A flowchart of another video script analysis model training method provided in an embodiment of the present application;
[0027] Figure 5 A flowchart of a method for screening video files to be recommended provided in an embodiment of the present application;
[0028] Figure 6 A flowchart of a method for recommending video files to be recommended provided in an embodiment of the present application;
[0029] Figure 7 A flowchart of a method for determining a playback end time provided in an embodiment of the present application;
[0030] Figure 8 A schematic diagram of the structure of a video recommendation device provided in an embodiment of the present application;
[0031] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0032] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0033] Figure 1 A flowchart of a video recommendation method provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the video recommendation method may include: step 101, step 102, step 103, step 104 and step 105.
[0034] Step 101: Use a pre-trained video script analysis model to process the target video script information of the target video file currently played by the user to obtain a video category label of the target video file, and multiple target video segments of the target video file divided based on video plot information and segment category labels of the multiple target video segments.
[0035] In the embodiment of the present application, the video script analysis model refers to a pre-trained model for analyzing video scripts. The video script analysis model can be used to analyze the category labels of the video (such as comedy, thriller, action, etc.). At the same time, it can be used to divide the video into several video segments according to the learned video segmentation rules, and predict the segment category label of each video segment. The training process of the video script analysis model can be combined with Figure 2 This is described in detail in the following embodiments, but is not limited to this embodiment.
[0036] The target video file is the video file currently being played by the user.
[0037] When a user plays a target video file, a pre-trained video script analysis model can be used to process the target video script information of the target video file to obtain a video category label of the target video file, and multiple target video segments of the target video file divided based on video plot information and segment category labels of the multiple target video segments.
[0038] The video category label is the total category label of the target video file. In this example, the video category label can be only one label or multiple labels, etc. Specifically, it can be determined according to actual conditions, and this embodiment does not limit this.
[0039] The segment category label is the category label of each target video segment. In this example, the segment category label can be only one label or multiple labels. Specifically, it can be determined according to actual conditions, and this embodiment does not limit this.
[0040] In a specific implementation, the video script analysis model can segment the target video file using a preset video segmentation rule. In this example, the preset video segmentation rule can be at least one of a video scene segmentation rule (i.e., segmenting the video according to different video scenes), a video plot development segmentation rule (i.e., segmenting according to the plot of the video plot), and a video character dialogue segmentation rule (i.e., segmenting according to the completeness of the character dialogue in the video).
[0041] Step 102: Determine the user's preference category label based on the user's video viewing record information.
[0042] The preference category tag may be used to indicate the video category of the user's interest preference.
[0043] In this example, the user's preference category label can be determined based on the user's video viewing record information. In a specific implementation, the video streaming platform can establish a video interest analysis model corresponding to each user based on the user's historical video viewing record. Then, the user's preference category label can be analyzed through the video interest analysis model.
[0044] In a specific implementation, for users on a video streaming platform, we can collect user behavior data such as viewing history, likes, favorites, and comments on the video streaming platform, as well as user viewing behavior data (such as user playback speed information, pause and playback information, viewing time information for different scenarios and characters, and only watching him (some platforms can realize the function of only watching a certain actor)), etc.), and extract important information as training data to train a video interest analysis model for representing videos of higher user interest, and analyze the user's preferred video category labels, i.e., preference category labels.
[0045] Step 103: Obtain candidate video files that match the video category label.
[0046] After obtaining the video category label of the target video file, the candidate video files matching the video category label can be obtained. Specifically, video files with the same or similar video category label as the video category label can be obtained from the video database of the video streaming platform as candidate video files. For example, the video category labels of the target video file are: "thriller" and "science fiction". Then, the video files with the video category label containing "thriller" can be filtered out from the video database, and the video files with the video category label containing "science fiction" can be filtered out from the video database. Then, the filtered video files with the video category label containing "thriller" and the video files with the video category label containing "science fiction" can be used as candidate video files, etc.
[0047] It can be understood that the above examples are merely examples listed for a better understanding of the technical solutions of the embodiments of the present application, and are not intended to be the sole limitation to the embodiments.
[0048] Step 104: Based on the preference category label and the segment category label, select a to-be-recommended video file corresponding to each target video segment from the candidate video files.
[0049] After obtaining the user's preferred category label and segment category label, the video file to be recommended corresponding to each target video segment can be screened out from the candidate video files according to the preferred category label and segment category label. The video file to be recommended is the video file recommended to the user.
[0050] In a specific implementation, the candidate video files can be scored based on the matching degree between the preferred category label and the segment category label and the category label of the candidate video file, and two scoring values can be obtained. The video files to be recommended can be screened out from the candidate video files by combining the two scoring values. Figure 5 This will be described in detail in the following specific implementation, and this embodiment will not be described in detail here.
[0051] After selecting the video file to be recommended corresponding to each target video segment from the candidate video files based on the preference category label and the segment category label, step 105 is performed.
[0052] Step 105: Recommending the video file to be recommended to the user based on the playback information of the target video segment.
[0053] After selecting the recommended video file corresponding to each target video segment from the candidate video files based on the preference category label and the segment category label, the recommended video file can be recommended to the user based on the playback information of the target video segment.
[0054] In a specific implementation of the present application, the video file to be recommended can be recommended to the user during the process of playing the target video clip. For example, if the playing time of the target video clip is 30 minutes, when the playing time of the target video clip reaches 10 minutes or 15 minutes, the video file to be recommended can be played in the form of a pop-up window to achieve video recommendation, such as displaying a pop-up window at the lower left corner or upper right corner of the video playback interface, and playing the video file to be recommended in the pop-up window. Alternatively, the file name of the video file to be recommended can be displayed in the form of a pop-up window to achieve video recommendation, such as displaying a pop-up window at the lower left corner or upper right corner of the video playback interface, and displaying the file name of the video file to be recommended in the pop-up window.
[0055] In another specific implementation of the present application, the video file to be recommended can be recommended to the user after the target video segment is played. For example, when the target video segment is detected to be finished playing, the video file to be recommended can be recommended in the form of a pop-up window, such as displaying a pop-up window at the lower left corner or upper right corner of the video playback interface, and playing the video file to be recommended in the pop-up window, or displaying the file name of the video file to be recommended in the pop-up window, etc., to recommend the video file, etc.
[0056] The embodiment of the present application can identify and understand the plot elements, character interactions and emotional trends in the video content by deeply analyzing the script. This can better capture and match the characteristics of the plot currently being watched by the user, and at the same time, combined with the recommendation method preferred by the user, it can provide the user with more relevant drama recommendations and make the recommended videos more in line with the user's preferences.
[0057] Next, combine Figure 2 The training process of the video script analysis model is described in detail as follows.
[0058] Reference Figure 2 , shows a flowchart of the steps of a video script analysis model training method provided by an embodiment of the present application. Figure 2 As shown, the video script analysis model training method may include: step 201, step 202 and step 203.
[0059] Step 201: Obtain video script information of the video file.
[0060] In this embodiment, when the video script analysis model is trained, the video script information of the video file can be obtained. In a specific implementation, a large amount of video script information of the video file can be collected from a video platform or other sources.
[0061] After obtaining the video script information, the collected video script information can also be preprocessed, such as text cleaning, removal of irrelevant information, removal of duplicate information, etc. After preprocessing, the following process is executed.
[0062] After obtaining the video script information of the video file, execute step 202.
[0063] Step 202: Based on a preset video segmentation rule, the video script information is segmented to obtain multiple video clips of the video file.
[0064] After obtaining the video script information of the video file, the video script information can be segmented according to the preset video segmentation rules to obtain multiple video clips of the video file. In a specific implementation, the preset video segmentation rules can be input into a word segmenter, and the word segmenter can be used to segment the video script information to obtain multiple video clips. In this example, the preset video segmentation rules may include: rules for segmenting the video script according to video scene information (i.e., segmenting the video according to different video scenes), rules for segmenting the video script according to video development plot information (i.e., segmenting according to the plot of the video plot), and rules for segmenting the video script according to video character dialogue information (i.e., segmenting according to the completeness of the character dialogue in the video). The segmentation processing method for the video script information according to the preset segmentation rules will be combined with the following embodiments. Figure 3 A detailed description is given below and this embodiment will not be described in detail here.
[0065] After the video script information is segmented based on the preset video segmentation rule to obtain multiple video segments of the video file, step 203 is executed.
[0066] Step 203: Train the video script analysis model to be trained based on the multiple video clips to obtain the video script analysis model.
[0067] In this embodiment, the video script analysis model to be trained may be a pre-selected model capable of performing video script analysis, such as a GPT (Generative Pre-trained Transformer) model, etc. This embodiment does not limit the specific structure of the video script analysis model to be trained.
[0068] After the video script information is segmented based on the preset video segmentation rules to obtain multiple video clips of the video file, the video script analysis model to be trained can be trained based on the multiple video clips to obtain a video script analysis model.
[0069] In the specific training process, one video clip can be input into the model for training at a time, or multiple video clips of the same video file can be combined into an input sequence and input into the model for training. The specific input method can be determined according to the training requirements, and this embodiment does not limit this.
[0070] In practical applications, for input video clips, a true category label can be added to each video clip in advance. After the video script analysis model to be trained processes each video clip, a predicted category label for each video clip can be output. A loss function can be calculated by combining the true category label and the predicted category label. The loss function is used to determine whether the video script analysis model to be trained has converged. If it has converged, the model training process is terminated to obtain a video script analysis model. The specific implementation process of model training can be combined with the following embodiments. Figure 4 A detailed description is given below and this embodiment will not be described in detail here.
[0071] The embodiment of the present application trains a video script analysis model that can perform in-depth analysis of video scripts to identify video script plots, so as to better capture and match the characteristics of the user's current viewing plot and provide the user with more relevant drama recommendations.
[0072] Next, combine Figure 3 The video file segmentation process is described in detail as follows.
[0073] Reference Figure 3 , shows a flowchart of the steps of a video segment segmentation method provided by an embodiment of the present application. Figure 3 As shown, the video segment segmentation method may include: step 301, step 302 and step 303.
[0074] Step 301: Segment the video script information based on the video scene information to obtain multiple video clips of the video file.
[0075] In this embodiment, when the preset video segmentation rule is a rule for segmenting the video script according to the video scene information, the video script information can be segmented based on the video scene information to obtain multiple video clips of the video file. For example, for science fiction videos, the scene segmentation video clips can be: 1. Scene: inside the spaceship; 2. Scene: planetary surface, etc. Or, for historical videos, the scene segmentation video clips can be: 1. Scene: siege video screen; 2. Scene: military tent, tactical deployment video screen, etc.
[0076] Step 302: Segment the video script information based on the video development plot information to obtain multiple video clips of the video file.
[0077] When the preset video segmentation rule is a rule for segmenting the video script according to the video development plot information, the video script information can be segmented based on the video development plot information to obtain multiple video clips of the video file. For example, taking a love video as an example, the video clips of the video plot development segmentation can be: 1. Plot: the plot before the hero and heroine meet; 2. Plot: the plot when the hero and heroine first meet; 3. Plot: the plot when the hero and heroine fall in love, etc.
[0078] Step 303: Segment the video script information based on the video character dialogue information to obtain multiple video clips of the video file.
[0079] When the preset video segmentation rule is a rule for segmenting the video script according to the video character dialogue information, the video script information can be segmented based on the video character dialogue information to obtain multiple video clips of the video file. For example, taking a comedy video as an example, the video clips segmented according to the dialogue rule can be: 1. A clip of character A talking with colleagues in the office; 2. A clip of character A talking with athletes in the stadium, etc.
[0080] In a specific implementation, when segmenting a video file, any one of the three preset video segmentation rules may be used to segment the video file, or any two or three of the three preset video segmentation rules may be used in combination to segment the video file. The specific screening method of the preset video segmentation rules may be determined according to business requirements, and this embodiment does not limit this.
[0081] The method of making a video script with video scene information and video character dialogue information can be shown in the following example:
[0082] Video Clip 1:
[0083] [Scene] Inside the spaceship
[0084] [Character 1] Captain: We are heading to an unknown galaxy.
[0085] [Character 2] Mechanic: There's a problem with the ship's engine!
[0086] Video Clip 2:
[0087] [Scene] Planetary surface
[0088] [Character 1] Crewman A: The creatures on this planet look very strange.
[0089] [Character 2] Crewman B: We need to explore this planet.
[0090] It can be understood that the above examples are merely examples listed for a better understanding of the technical solutions of the embodiments of the present application, and are not intended to be the sole limitation to the embodiments.
[0091] The embodiment of the present application divides the script according to video scene information, video development plot information, video character dialogue information, etc., which can improve the accuracy of video segmentation, so that the videos recommended to users are more in line with the video plot of each segmented video segment. At the same time, the video script analysis model trained according to the segmented video segments can identify and understand the plot elements, character interactions, emotional trends and other information in the video content to make video recommendations, which can improve the accuracy of video recommendations.
[0092] Next, combine Figure 4 The model training process is described in detail.
[0093] Reference Figure 4 , shows a flowchart of another video script analysis model training method provided by an embodiment of the present application. Figure 4 As shown, the video script analysis model may include: step 401, step 402, step 403 and step 404.
[0094] Step 401: Input the multiple video clips into the video script analysis model to be trained, so that the video script analysis model to be trained processes the multiple video clips.
[0095] In this embodiment, the multiple video clips can be clips obtained by segmenting according to script segmentation rules such as video scene information, video development plot information, and video character dialogue information. Each of the multiple video clips is marked with a video plot label, and the video plot label includes any one of category labels such as video scene category label, video development plot category label, and video character dialogue category label.
[0096] When training the model, each individual video clip among multiple video clips can be used as the input of the model, or multiple video clips can be combined into an input sequence as the input of the model.
[0097] When combining multiple video clips into an input sequence as the input of the model, some special markers (such as identifiers or separators, etc.) can be added at the beginning of the input sequence to prompt the model to start processing a new video clip.
[0098] After obtaining the multiple video clips, the multiple video clips can be input into the video script analysis model to be trained, so that the multiple video clips can be processed by the video script analysis model to be trained.
[0099] Step 402: Obtain a predicted video plot label for each of the multiple video clips output by the video script analysis model to be trained, wherein the predicted video plot label includes any one of a predicted video scene category label, a predicted video development plot category label, and a predicted video character dialogue category label.
[0100] After the video script analysis model to be trained completes processing of multiple video clips, the predicted video plot label of each of the multiple video clips output by the video script analysis model to be trained can be obtained, wherein the predicted video plot label may include any one of: predicted video scene category label, predicted video development plot category label and predicted video character dialogue category label.
[0101] Step 403: Based on the video plot label and the predicted video plot label, calculate the loss value of the video script analysis model to be trained.
[0102] Then, the loss value of the video script analysis model to be trained can be calculated based on the video plot label and the predicted video plot label. Specifically, the loss value can be calculated based on any one of the labels such as the video scene category label, the video development plot category label, and the video character dialogue category label of the video clip and any one of the corresponding predicted video scene category label, the predicted video development plot category label, and the predicted video character dialogue category label.
[0103] In this example, the loss value may be a commonly used cross entropy loss function, a binary cross entropy loss function, etc. A regression loss function may also be used, such as a mean square error loss function or a mean absolute error loss function, etc. This embodiment does not limit the type of loss function.
[0104] Step 404: When the loss value is within a preset range, the trained video script analysis model to be trained is used as the final video script analysis model.
[0105] The preset range refers to a preset loss value range used to determine whether the video script analysis model to be trained has converged. The specific value of the preset range can be determined according to business needs, and this embodiment does not limit this.
[0106] After calculating the loss value of the video script analysis model to be trained, it can be determined whether the loss value is within a preset range.
[0107] If the loss value is not within the preset range, it means that the video script analysis model to be trained has not converged. At this time, more model training samples (i.e., segmented video clips) can be combined to continue training the video script analysis model to be trained until the model converges.
[0108] If the loss value is within the preset range, it means that the video script analysis model to be trained has converged. At this time, the trained video script analysis model to be trained can be used as the final video script analysis model for subsequent video script analysis scenarios.
[0109] The embodiment of the present application obtains a video script analysis model by training with video clips after video script segmentation (i.e., clips obtained by segmentation according to script segmentation rules such as video scene information, video development plot information, video character dialogue information, etc.), so that the model can better predict key information of the video script such as plot climax, character dialogue, important turning points, etc., and can recommend videos that are more closely related to the video plot to users.
[0110] Next, combine Figure 5 The implementation process of combining the preference category label and the video category label to select the video file to be recommended from the candidate video files is described in detail.
[0111] Reference Figure 5 , shows a flowchart of the steps of a method for screening video files to be recommended provided by an embodiment of the present application. Figure 5 As shown, the method for screening video files to be recommended may include: step 501, step 502 and step 503.
[0112] Step 501: Based on the matching degree between the preferred category label and the category label of the candidate video file, the candidate video file is scored to obtain a first score value.
[0113] In this embodiment, after the candidate video file is acquired, the candidate video file may be scored based on the matching degree between the preferred category label and the category label of the candidate video file to obtain a first scoring value.
[0114] In a specific implementation, when the category tag of the candidate video file includes the preferred category tag, the candidate video file may be given a higher first score value, and when the category tag of the candidate video file does not include the preferred category tag, the candidate video file may be given a lower first score value.
[0115] Of course, the first score value can also be calculated in combination with other methods. For example, first, an initial score value is assigned to the candidate video file based on whether the category label of the candidate video file contains the preferred category label. The similarity between the preferred category label and the category label is calculated (such as Euclidean distance or cosine distance, etc.), and then another score value is assigned to the candidate video file based on the similarity. Finally, the two scores are weighted summed in a weighted summation manner to obtain the first score value.
[0116] Step 502: Based on the degree of match between the target video scene category label, and / or the target video plot development category label, and / or the video character dialogue category label and the category label of the candidate video file, score the candidate video file to obtain a second score value.
[0117] After obtaining the candidate video file, the candidate video file can be scored based on the degree of match between the target video scene category label, and / or the target video plot development category label, and / or the video character dialogue category label and the category label of the candidate video file to obtain a second scoring value.
[0118] In a specific implementation, when the category tag of the candidate video file includes the target video scene category tag, and / or the target video plot development category tag, and / or the video character dialogue category tag, the candidate video file can be given a higher second score value. When the category tag of the candidate video file does not include the target video scene category tag, and / or the target video plot development category tag, and / or the video character dialogue category tag, the candidate video file can be given a lower second score value.
[0119] Of course, the second rating value can also be calculated in combination with other methods. For example, first, according to whether the category label of the candidate video file contains the target video scene category label, and / or the target video plot development category label, and / or the video character dialogue category label, an initial rating value is assigned to the candidate video file. The similarity (such as Euclidean distance or cosine distance, etc.) between the target video scene category label, and / or the target video plot development category label, and / or the video character dialogue category label and the category label is calculated, and then another rating value is assigned to the candidate video file in combination with the similarity. Finally, the two ratings are weighted and summed in a weighted summation manner to obtain the second rating value.
[0120] Step 503: Based on the first scoring value and the second scoring value, select a to-be-recommended video file corresponding to the target video segment from the candidate video files.
[0121] After the first score value and the second score value are calculated, the video file to be recommended corresponding to the target video segment can be screened out from the candidate video files based on the first score value and the second score value. Specifically, the first score and the second score can be weighted and summed to obtain the score value of the candidate video file. Then, the candidate video files can be sorted in descending order of the score value to obtain a sorting result. The candidate video files ranked in the top N positions in the sorting result are screened as the video files to be recommended corresponding to the target video segment, where N is a positive integer. For example, the candidate video files are sorted in descending order of the score value as follows: video 1, video 2, video 3, video 4, video 5. When N=1, the video file to be recommended is video 1. When N=2, the video files to be recommended are video 1 and video 2, etc.
[0122] It can be understood that the above examples are merely examples listed for a better understanding of the technical solutions of the embodiments of the present application, and are not intended to be the sole limitation to the embodiments.
[0123] The embodiment of the present application can improve the accuracy of video recommendation by scoring candidate video files according to the preference category label and the segment category label, and filtering out the video files to be recommended from the candidate video files according to the score value. In the above manner, the video files that contain both the preference category label and the video category label in the candidate video files have higher scores, and vice versa, the lower the score, so that the video recommended to the user can meet the user's preferences and the video plot of the video currently being watched by the user.
[0124] Next, combine Figure 6 The implementation process of recommending video files to be recommended to users is described in detail.
[0125] Reference Figure 6 , shows a flowchart of the steps of a method for recommending video files to be recommended provided by an embodiment of the present application. Figure 6 As shown, the method for recommending video files to be recommended may include: step 601 and step 602.
[0126] Step 601: Determine the playback end time of the target video segment according to the playback start time of the target video file and the duration information of the target video segment.
[0127] In this embodiment, the playback end time may be used to indicate the time when the target video segment ends.
[0128] After obtaining the video file to be recommended, the end time of the target video segment can be determined according to the start time of the target video file and the duration information of the target video segment. Specifically, the start time of the target video segment can be calculated according to the start time of the target video file and the position of the target video segment in the target video file, and then the end time of the target video segment can be calculated in combination with the duration information of the target video segment.
[0129] Of course, when the target video clip playback end time is counted, the playback speed information of the target video file played by the user should also be considered. Specifically, in the following embodiments, the playback speed information of the target video file played by the user should be considered. Figure 7 A detailed description is given below and this embodiment will not be described in detail here.
[0130] After the playback end time of the target video segment is determined, step 602 is executed.
[0131] Step 602: When the current time reaches the playback end time, recommend the video file to be recommended to the user.
[0132] After determining the end time of the target video clip, the video file to be recommended can be recommended to the user when the current time reaches the end time of the playback. For example, the start time of the current target video clip is "00:00:00", and the end time is "00:05:00", that is, the first 5 minutes of the target video file. After playing the 5-minute video clip, the video to be recommended can be recommended to the user. For example, the category tags of the video clip are "action", "psychology", and "thriller", and the user's preferred category tag is "thriller". After playing the 5-minute video clip, the video to be recommended with the category tag of "thriller" can be recommended to the user.
[0133] It can be understood that the above examples are merely examples listed for a better understanding of the technical solutions of the embodiments of the present application, and are not intended to be the sole limitation to the embodiments.
[0134] In the embodiment of the present application, after the target video segment is played, the video file related to the plot of the target video segment or in line with the user's preference can be recommended to the user without affecting the user's viewing of the video file.
[0135] Next, combine Figure 7 The process of calculating the playback end time of the target video segment based on the playback speed information of the target video file is described in detail.
[0136] Reference Figure 7 , shows a flowchart of a method for determining the end time of playback provided by an embodiment of the present application. Figure 7As shown, the method for determining the playback end time may include: step 701 and step 702.
[0137] Step 701: Obtain the playback speed information of the target video file.
[0138] In this embodiment, when calculating the playback end time of the target video segment, the playback speed information of the target video file (such as 2 times accelerated playback, or 1.5 times decelerated playback, etc.) may be obtained.
[0139] Step 702: Determine the playback end time of the target video segment based on the playback start time, the playback speed information, and the duration information of the target video segment.
[0140] Furthermore, the playback end time of the target video segment can be determined based on the playback start time, the playback speed information, and the duration information of the target video segment. Specifically, the playback start time of the target video segment can be calculated based on the playback start time of the target video file, the position of the target video segment in the target video file, and the playback speed information of the target video file, and then the playback end time of the target video segment can be calculated in combination with the duration information and the playback speed information of the target video segment.
[0141] The embodiment of the present application calculates the playback end time of the target video segment in combination with the playback speed information of the target video file, thereby improving the accuracy of the calculation.
[0142] The video recommendation method provided in the embodiment of the present application uses a pre-trained video script analysis model to process the target video script information of the target video file currently played by the user, and obtains the video category label of the target video file, and multiple target video segments and segment category labels of the multiple video segments of the target video file segmented based on the video plot information. According to the user's video viewing record information, the user's preferred category label is determined. The candidate video files matching the video category label are obtained. Based on the preferred category label and the segment category label, the video files to be recommended corresponding to each target video segment are screened out from the candidate video files. Based on the playback information of the target video segment, the video files to be recommended are recommended to the user. The embodiment of the present application uses a video script analysis model to analyze the video currently played by the user, and combines the category labels of the segmented video segments and the user's preferred category labels to screen the videos to be recommended, so that videos related to the plot of the currently watched video can be recommended to the user, thereby improving the accuracy of video recommendation.
[0143] Reference Figure 8 , which shows a schematic diagram of the structure of a video recommendation device provided in an embodiment of the present application, such as Figure 8 As shown, the video recommendation device 800 may include the following modules:
[0144] The video category label acquisition module 810 is used to process the target video script information of the target video file currently played by the user using a pre-trained video script analysis model to obtain the video category label of the target video file, and multiple target video segments of the target video file segmented based on the video plot information and the segment category labels of the multiple target video segments;
[0145] A preference category label determination module 820 is used to determine the user's preference category label based on the user's video viewing record information;
[0146] A candidate video file acquisition module 830 is used to acquire a candidate video file matching the video category label;
[0147] A to-be-recommended video screening module 840 is used to screen out a to-be-recommended video file corresponding to each of the target video segments from the candidate video files based on the preference category label and the segment category label;
[0148] The video to be recommended recommendation module 850 is used to recommend the video file to be recommended to the user based on the playback information of the target video segment.
[0149] Optionally, the device further comprises:
[0150] A video script acquisition module is used to obtain video script information of a video file;
[0151] A video segment acquisition module, used for segmenting the video script information based on a preset video segmentation rule to obtain multiple video segments of the video file;
[0152] The script analysis model acquisition module is used to train the video script analysis model to be trained based on the multiple video clips to obtain the video script analysis model.
[0153] Optionally, the video clip acquisition module includes:
[0154] A first segment acquisition unit, configured to segment the video script information based on the video scene information to obtain a plurality of video segments of the video file;
[0155] A second segment acquisition unit is used to segment the video script information based on the video development plot information to obtain multiple video segments of the video file;
[0156] The third segment acquisition unit is used to segment the video script information based on the video character dialogue information to obtain multiple video segments of the video file.
[0157] Optionally, each of the plurality of video clips is annotated with a video plot label, wherein the video plot label comprises any one of a video scene category label, a video development plot category label and a video character dialogue category label.
[0158] The script analysis model acquisition module includes:
[0159] A video clip input unit, used for inputting the plurality of video clips into the video script analysis model to be trained, so that the video script analysis model to be trained processes the plurality of video clips;
[0160] A predicted label acquisition unit, used to acquire a predicted video plot label of each video clip in the plurality of video clips output by the video script analysis model to be trained, wherein the predicted video plot label includes: any one of a predicted video scene category label, a predicted video development plot category label, and a predicted video character dialogue category label;
[0161] A loss value calculation unit, used to calculate the loss value of the video script analysis model to be trained based on the video plot label and the predicted video plot label;
[0162] The script analysis model acquisition unit is used to use the trained video script analysis model to be trained as the final video script analysis model when the loss value is within a preset range.
[0163] Optionally, the segment category labels include: target video scene category labels, target video plot development category labels and video character dialogue category labels.
[0164] The video screening module to be recommended includes:
[0165] A first score acquisition unit, configured to score the candidate video file based on the matching degree between the preference category label and the category label of the candidate video file to obtain a first score value;
[0166] A second scoring acquisition unit is used to score the candidate video file based on the matching degree between the target video scene category label, and / or the target video plot development category label, and / or the video character dialogue category label and the category label of the candidate video file to obtain a second scoring value;
[0167] The to-be-recommended video screening unit is configured to screen out the to-be-recommended video file corresponding to the target video segment from the candidate video files based on the first scoring value and the second scoring value.
[0168] Optionally, the video screening unit to be recommended includes:
[0169] a rating value obtaining subunit, configured to perform a weighted summation of the first rating value and the second rating value to obtain a rating value of the candidate video file;
[0170] A sorting result obtaining subunit is used to sort the candidate video files in descending order of the score values to obtain a sorting result;
[0171] The to-be-recommended video acquisition subunit is used to select candidate video files ranked in the top N positions from the ranking results as the to-be-recommended video files corresponding to the target video clip, where N is a positive integer.
[0172] Optionally, the video recommendation module includes:
[0173] a playback end time determination unit, configured to determine the playback end time of the target video segment according to the playback start time of the target video file and the duration information of the target video segment;
[0174] The to-be-recommended video recommendation unit is used to recommend the to-be-recommended video file to the user when the current time reaches the playback end time.
[0175] Preferably, the playback end time determination unit includes:
[0176] A playback speed acquisition subunit, used to acquire playback speed information of the target video file;
[0177] The end time determination subunit is used to determine the end time of the playback of the target video segment based on the playback start time, the playback speed information, and the duration information of the target video segment.
[0178] The video recommendation device provided in the embodiment of the present application uses a pre-trained video script analysis model to process the target video script information of the target video file currently played by the user, and obtains the video category label of the target video file, and multiple target video segments and segment category labels of the multiple video segments of the target video file segmented based on the video plot information. According to the user's video viewing record information, the user's preferred category label is determined. The candidate video file matching the video category label is obtained. Based on the preferred category label and the segment category label, the video file to be recommended corresponding to each target video segment is screened out from the candidate video file. Based on the playback information of the target video segment, the video file to be recommended is recommended to the user. The embodiment of the present application uses a video script analysis model to analyze the video currently played by the user, and combines the category labels of the segmented video segments and the user's preferred category labels to screen the videos to be recommended, so that videos related to the plot of the video currently being watched can be recommended to the user, thereby improving the accuracy of video recommendation.
[0179] The present application also provides an electronic device, such as Fig. 9 As shown, it includes a processor 901, a communication interface 902, a memory 903 and a communication bus 904, wherein the processor 901, the communication interface 902, and the memory 903 communicate with each other through the communication bus 904.
[0180] Memory 903, used for storing computer programs;
[0181] The processor 901 is used to execute the program stored in the memory 903 to implement the following steps:
[0182] Using a pre-trained video script analysis model to process the target video script information of the target video file currently played by the user, obtain a video category label of the target video file, and a plurality of target video segments of the target video file segmented based on video plot information and segment category labels of the plurality of target video segments;
[0183] Determining a preference category label of the user according to the video viewing record information of the user;
[0184] Obtaining candidate video files matching the video category label;
[0185] Based on the preference category label and the segment category label, selecting a video file to be recommended corresponding to each target video segment from the candidate video files;
[0186] Based on the playback information of the target video segment, the video file to be recommended is recommended to the user.
[0187] Optionally, before the pre-trained video script analysis model is used to process the video script information of the target video file currently played by the user to obtain the video category label of the target video file, the method further includes:
[0188] Get the video script information of the video file;
[0189] Based on a preset video segmentation rule, the video script information is segmented to obtain multiple video clips of the video file;
[0190] The video script analysis model to be trained is trained based on the multiple video clips to obtain the video script analysis model.
[0191] Optionally, the video script information is segmented based on a preset video segmentation rule to obtain multiple video clips of the video file, including:
[0192] Segmenting the video script information based on the video scene information to obtain multiple video clips of the video file; and / or
[0193] Segmenting the video script information based on the video development plot information to obtain multiple video clips of the video file; and / or
[0194] The video script information is segmented based on the video character dialogue information to obtain multiple video clips of the video file.
[0195] Optionally, each of the plurality of video clips is annotated with a video plot label, wherein the video plot label comprises any one of a video scene category label, a video development plot category label and a video character dialogue category label.
[0196] The step of training the video script analysis model to be trained based on the multiple video clips to obtain the video script analysis model comprises:
[0197] Inputting the plurality of video clips into the video script analysis model to be trained, so that the video script analysis model to be trained processes the plurality of video clips;
[0198] Obtaining a predicted video plot label of each of the multiple video clips output by the video script analysis model to be trained, wherein the predicted video plot label includes: any one of a predicted video scene category label, a predicted video development plot category label, and a predicted video character dialogue category label;
[0199] Based on the video plot label and the predicted video plot label, a loss value of the video script analysis model to be trained is calculated;
[0200] When the loss value is within a preset range, the trained video script analysis model to be trained is used as the final video script analysis model.
[0201] Optionally, the segment category labels include: target video scene category labels, target video plot development category labels and video character dialogue category labels.
[0202] The step of selecting a video file to be recommended corresponding to each target video segment from the candidate video files based on the preference category label and the segment category label includes:
[0203] Based on the matching degree between the preferred category label and the category label of the candidate video file, scoring the candidate video file to obtain a first scoring value;
[0204] Scoring the candidate video file based on the degree of match between the target video scene category label, and / or the target video plot development category label, and / or the video character dialogue category label and the category label of the candidate video file to obtain a second scoring value;
[0205] Based on the first scoring value and the second scoring value, a to-be-recommended video file corresponding to the target video segment is screened out from the candidate video files.
[0206] Optionally, the filtering out the to-be-recommended video file corresponding to the target video segment from the candidate video files based on the first scoring value and the second scoring value includes:
[0207] Performing a weighted summation on the first scoring value and the second scoring value to obtain a scoring value of the candidate video file;
[0208] Sorting the candidate video files in descending order of the score values to obtain a sorting result;
[0209] The candidate video files ranked in the top N positions are selected from the ranking results as the video files to be recommended corresponding to the target video segment, where N is a positive integer.
[0210] Optionally, the recommending the to-be-recommended video file to the user based on the playback information of the target video segment includes:
[0211] Determining the end time of playing the target video segment according to the start time of playing the target video file and the duration information of the target video segment;
[0212] When the current time reaches the playback end time, the video file to be recommended is recommended to the user.
[0213] Optionally, determining the playback end time of the target video segment according to the playback start time of the target video file and the duration information of the target video segment includes:
[0214] Obtaining playback speed information of the target video file;
[0215] Based on the playback start time, the playback speed information, and the duration information of the target video segment, the playback end time of the target video segment is determined.
[0216] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0217] The communication interface is used for communication between the above terminal and other devices.
[0218] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0219] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0220] In another embodiment provided by the present application, a computer-readable storage medium is provided. The computer-readable storage medium stores instructions. When the computer-readable storage medium is executed on a computer, the computer executes the video recommendation method described in any one of the above embodiments.
[0221] In another embodiment provided by the present application, a computer program product is further provided, on which a computer program is stored. When the computer program is run on a computer, the computer executes the video recommendation method described in any one of the above embodiments.
[0222] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.
[0223] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device 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 device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0224] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0225] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.
Claims
1. A video recommendation method, It is characterized in that include: Using a pre-trained video script analysis model to process the target video script information of the target video file currently played by the user, obtain a video category label of the target video file, and a plurality of target video segments of the target video file segmented based on video plot information and segment category labels of the plurality of target video segments; Determining a preference category label of the user according to the video viewing record information of the user; Obtaining candidate video files matching the video category label; Based on the preference category label and the segment category label, selecting a video file to be recommended corresponding to each target video segment from the candidate video files; Based on the playback information of the target video segment, the video file to be recommended is recommended to the user.
2. The method according to claim 1, It is characterized in that Before the pre-trained video script analysis model is used to process the video script information of the target video file currently played by the user to obtain the video category label of the target video file, the method further includes: Get the video script information of the video file; Based on a preset video segmentation rule, the video script information is segmented to obtain multiple video clips of the video file; The video script analysis model to be trained is trained based on the multiple video clips to obtain the video script analysis model.
3. The method according to claim 2, It is characterized in that The video script information is segmented based on a preset video segmentation rule to obtain multiple video clips of the video file, including: Segmenting the video script information based on the video scene information to obtain multiple video clips of the video file; and / or Segmenting the video script information based on the video development plot information to obtain multiple video clips of the video file; and / or The video script information is segmented based on the video character dialogue information to obtain multiple video clips of the video file.
4. The method according to claim 3, It is characterized in that Each of the plurality of video clips is annotated with a video plot label, wherein the video plot label includes any one of a video scene category label, a video development plot category label, and a video character dialogue category label. The step of training the video script analysis model to be trained based on the multiple video clips to obtain the video script analysis model comprises: Inputting the plurality of video clips into the to-be-trained video script analysis model so that the to-be-trained video script analysis model processes the plurality of video clips; Obtaining a predicted video plot label of each of the multiple video clips output by the video script analysis model to be trained, wherein the predicted video plot label includes: any one of a predicted video scene category label, a predicted video development plot category label, and a predicted video character dialogue category label; Based on the video plot label and the predicted video plot label, a loss value of the video script analysis model to be trained is calculated; When the loss value is within a preset range, the trained video script analysis model to be trained is used as the final video script analysis model.
5. The method according to claim 1, It is characterized in that The segment category labels include: target video scene category labels, target video plot development category labels and video character dialogue category labels. The step of selecting a video file to be recommended corresponding to each target video segment from the candidate video files based on the preference category label and the segment category label includes: Based on the matching degree between the preferred category label and the category label of the candidate video file, scoring the candidate video file to obtain a first scoring value; Scoring the candidate video file based on the degree of match between the target video scene category label, and / or the target video plot development category label, and / or the video character dialogue category label and the category label of the candidate video file to obtain a second scoring value; Based on the first scoring value and the second scoring value, a to-be-recommended video file corresponding to the target video segment is screened out from the candidate video files.
6. The method according to claim 5, It is characterized in that The step of selecting the video file to be recommended corresponding to the target video segment from the candidate video files based on the first scoring value and the second scoring value includes: Performing a weighted summation on the first scoring value and the second scoring value to obtain a scoring value of the candidate video file; Sorting the candidate video files in descending order of the score values to obtain a sorting result; The candidate video files ranked in the top N positions are selected from the ranking results as the video files to be recommended corresponding to the target video clip, where N is a positive integer.
7. The method according to claim 1, It is characterized in that The recommending the video file to be recommended to the user based on the playback information of the target video segment includes: Determining the end time of playing the target video segment according to the start time of playing the target video file and the duration information of the target video segment; When the current time reaches the playback end time, the video file to be recommended is recommended to the user.
8. The method according to claim 7, It is characterized in that The step of determining the end time of playing the target video segment according to the start time of playing the target video file and the duration information of the target video segment includes: Obtaining playback speed information of the target video file; Based on the playback start time, the playback speed information, and the duration information of the target video segment, the playback end time of the target video segment is determined.
9. A video recommendation device, It is characterized in that include: A video category label acquisition module is used to process the target video script information of the target video file currently played by the user using a pre-trained video script analysis model to obtain the video category label of the target video file, and multiple target video segments of the target video file segmented based on video plot information and segment category labels of the multiple target video segments; A preference category label determination module, used to determine the user's preference category label based on the user's video viewing record information; A candidate video file acquisition module, used to acquire candidate video files matching the video category label; A to-be-recommended video screening module, configured to screen out a to-be-recommended video file corresponding to each of the target video segments from the candidate video files based on the preference category label and the segment category label; The to-be-recommended video recommendation module is used to recommend the to-be-recommended video file to the user based on the playback information of the target video segment.
10. An electronic device, It is characterized in that It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; The processor is used to implement the video recommendation method described in any one of claims 1-8 when executing the program stored in the memory.
11. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the video recommendation method as described in any one of claims 1 to 8 is implemented.
12. A computer program product comprising instructions on which a computer program is stored, It is characterized in that When the computer program is executed on a computer, the computer is enabled to execute the video recommendation method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Video recommendation method, device and equipment and computer readable storage medium
CN112579913A
Video type prediction and recommendation method and system based on depth visual features
CN116095410A
Video pushing method and device, electronic equipment and storage medium
CN117768731A
Video generating method and apparatus, electronic device, and readable storage medium
WO2023128877A2
Cited By
Ship video-on-demand method and system based on video slices
CN119155490A
