Bullet screen prediction method and device, electronic equipment and storage medium
By incorporating historical bullet screen information of the target scene into the training of the bullet screen prediction model and optimizing the model parameters, the problem of poor bullet screen prediction performance in complex scenes is solved, and bullet screen generation with high accuracy and high efficiency is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-09
- Publication Date
- 2026-04-07
AI Technical Summary
Existing bullet screen prediction models struggle to accurately predict bullet screen content that is highly relevant to the scene in complex scenarios, resulting in slow model convergence and generated bullet screens that are not highly relevant to the scene.
By gradually introducing historical bullet screen information related to the target scene during the training process, and combining video screen descriptions and original bullet screen prompts, the model parameters are optimized to improve the model's ability to understand the scene and generate bullet screens that are highly relevant to the current scene.
It improves the accuracy and training efficiency of bullet screen prediction, making the generated bullet screen closely related to the scene and enhancing the interactive effect in the live broadcast scene.
Smart Images

Figure CN121815035A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of video live streaming technology, and more specifically, to a method, apparatus, electronic device, and storage medium for predicting bullet comments. Background Technology
[0002] With the rapid development of live streaming platforms and the continuous improvement of user engagement, bullet comments have become an indispensable interactive method in live streaming scenarios. Bullet comments are often highly correlated with the live stream content, reflecting viewers' emotional reactions and focus in real time. In existing technologies, deep learning-based bullet comment prediction models typically employ end-to-end training, analyzing live stream content or broadcaster voice information to predict potential bullet comment content.
[0003] Currently, traditional bullet screen prediction models directly predict viewer comments based on the on-screen description. However, due to insufficient learning of the context of the vertical domain, the models often struggle to accurately predict bullet screen content that fits the current scene. Only a very small number of prediction actions receive meaningful positive feedback (i.e., "rewards"), while the vast majority of prediction results receive zero or close to zero rewards. This leads to slow model convergence, resulting in bullet screens generated in some complex scenarios having low relevance to the scene and poor bullet screen prediction performance.
[0004] Therefore, how to improve the prediction effect of bullet comments in complex scenarios is a technical problem that needs to be solved. Summary of the Invention
[0005] In view of this, the purpose of the present invention is to provide a bullet screen prediction method, device, electronic device and storage medium, which can generate bullet screens with high relevance to the scene in complex scenes and improve the bullet screen prediction effect.
[0006] To achieve the above objectives, the technical solutions adopted in the embodiments of the present invention are as follows: In a first aspect, the present invention provides a method for predicting bullet comments, the method comprising: obtaining a bullet comment prediction model trained in a target scene; wherein the bullet comment prediction model is trained by gradually introducing historical bullet comments related to the target scene into the original bullet comment prompts; obtaining a video scene description and set bullet comment prompts in the target scene; and generating bullet comments using the bullet comment prediction model based on the video scene description and the bullet comment prompts.
[0007] Secondly, the present invention provides a training device for a bullet screen prediction model, comprising: an acquisition module for acquiring a bullet screen prediction model trained in a target scene; wherein the bullet screen prediction model is trained by gradually introducing historical bullet screens related to the target scene into the original bullet screen prompts; the acquisition module is further configured to acquire a video screen description and set bullet screen prompts in the target scene; and a prediction module for generating bullet screens based on the video screen description and the bullet screen prompts using the bullet screen prediction model.
[0008] Thirdly, the present invention provides an electronic device including a processor and a memory, the memory storing a computer program executable by the processor, the processor executing the computer program to implement the bullet screen prediction method described in any of the foregoing embodiments.
[0009] Fourthly, the present invention provides a storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the bullet screen prediction method as described in any of the foregoing embodiments.
[0010] The bullet comment prediction method, device, electronic device, and storage medium provided in this invention first train a bullet comment prediction model by gradually introducing historical bullet comments related to the target scene into the original bullet comment prompts. This allows the model to learn the association pattern between bullet comment content and screen context in the target scene, thereby obtaining a bullet comment prediction model optimized for the target scene. Then, in practical applications, the video screen description and the set initial bullet comment prompts in the current target scene are obtained as context input information. The video screen description and bullet comment prompts are input together into the trained bullet comment prediction model. The model uses the scene association features it has learned to perform inference and generate bullet comments that are highly related to the content of the current scene. This achieves the effect of closely associating bullet comments with the context and improving prediction accuracy in complex scenes.
[0011] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0012] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 A schematic flowchart of the bullet screen prediction model training method provided in an embodiment of the present invention is shown; Figure 2 This diagram illustrates an overall example of the training process of the bullet screen prediction model provided in an embodiment of the present invention. Figure 3 A schematic flowchart of the bullet screen prediction method provided in an embodiment of the present invention is shown; Figure 4 A functional block diagram of the bullet screen prediction device provided in an embodiment of the present invention is shown; Figure 5 A structural block diagram of an electronic device provided in an embodiment of the present invention is shown. Detailed Implementation
[0014] 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. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0015] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0016] It should be noted that relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover 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 limitations, 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.
[0017] Considering the slow training efficiency and poor training results of existing bullet screen prediction models, which lead to low correlation between generated bullet screens and scene in some complex scenarios and poor bullet screen prediction performance, this invention first provides a bullet screen prediction model training method that can solve the above problems. Please see Figure 1 , Figure 1 This is a schematic flowchart illustrating a bullet screen prediction model training method provided by an embodiment of the present invention. The method may include steps S101 to S104, as described below: S101: Obtain input prompts for the target scenario; In this embodiment of the invention, the input prompts include original bullet screen prompts and historical bullet screen prompts related to the target scene. The historical bullet screen prompts will serve as guiding prompts for subsequent training. Furthermore, the input prompts also include a description of the scene within the target scene.
[0018] S102: Input the input prompt into the bullet screen prediction model, and generate the first bullet screen prediction result and the second bullet screen prediction result at each training step; In this embodiment of the invention, the first bullet screen prediction result is generated under the original bullet screen prompt, and the second bullet screen prediction result is generated by incorporating historical bullet screens into the original bullet screen prompt; the intensity of incorporating historical bullet screens decreases sequentially with the training step time.
[0019] S103: In each training step, determine the reward scores for the first and second bullet screen prediction results and the differences in the internal state distribution of the model. S104: The bullet screen prediction model trained under the target scene is obtained by jointly optimizing the model parameters based on the reward score and the difference in the internal state distribution of the model in each training step until the training termination condition is met.
[0020] Unlike existing technologies, this invention, in the training process of the bullet screen prediction model, first acquires input prompts for the target scene, including a description of the current scene, original bullet screen prompts, and historical bullet screen information related to the scene. This historical bullet screen information serves as guiding prompts in subsequent model training. During training, by introducing historical bullet screens into the original bullet screen prompts, the model generates bullet screen prediction results under both the original prompts and the prompts incorporating historical bullet screens. As the number of training steps increases, the introduced historical bullet screens are gradually reduced, prompting the model to transition from relying on external prompts to autonomously predicting bullet screens based on the original bullet screen prompts, thus improving prediction accuracy. In each training step, the differences in the model's internal state distribution and the reward scores for bullet screen prediction results under different prompt conditions are simultaneously quantified. The former reveals the degree of influence of historical information on the model's cognitive process, while the latter reflects the quality of the generated content. Based on the reward scores and internal state distribution differences under these two conditions, the model parameters are jointly optimized, which not only improves the model's prediction quality but also ensures that the model can generate high-quality bullet screens even without historical bullet screens, thereby improving overall training efficiency and bullet screen prediction results.
[0021] In one embodiment of the present invention, the bullet screen prediction model obtained by the above training method may or may not be applied to live streaming platforms, video content recommendation systems, virtual anchor interaction systems or online education interaction scenarios, but is used to realize intelligent and real-time bullet screen generation and auxiliary interaction functions.
[0022] Next, the embodiments of the present invention will be described in conjunction with the relevant accompanying drawings. Figure 1 The training process of the bullet screen prediction model shown in the video will be explained in detail.
[0023] In step S101, the target scenarios applicable to this embodiment of the invention may include, but are not limited to, live streaming scenarios (such as game live streaming, e-commerce live streaming, etc.) and other types of video content playback scenarios, such as movie, TV series, sports event live streaming, or online education courses. In these scenarios, users may generate a large number of real-time interactive comments, i.e., bullet comments, during the viewing process.
[0024] Scene description refers to the pre-generated scene description based on video footage of the target scene in this embodiment of the invention. This is a detailed description of the visual content of the current target scene, which may include, but is not limited to, key plot points, character actions, and environmental features. For example, in game live streaming, the scene description may include the ongoing game footage, the actions of game characters, and in-game events; in e-commerce live streaming, it may include details of the displayed products and the host's presentation. This descriptive information provides the model with contextual background, enabling it to better understand the content of the current scene and generate relevant bullet comments.
[0025] In an optional implementation, multimodal image understanding can be performed on video frames in the current scene to generate a scene image description. Furthermore, the number of video frames can be a single frame or multiple frames; this is not limited here.
[0026] The original bullet comment prompts are the basic instructions pre-set in this embodiment of the invention to instruct the model to perform the task of generating bullet comment text, which constitute the basic guiding signals for the model to generate responses. For example, the original bullet comment prompts can be simple text instructions, such as "Please predict the bullet comments that the audience may send based on the current screen content." Such prompts help the model clarify the specific task and direction of generating bullet comments.
[0027] Historical bullet comments refer to auxiliary information introduced during the training phase in this embodiment of the invention, which helps the model understand the audience's expression habits and styles in specific scenarios. These historical bullet comments provide the model with rich prior knowledge, helping it to better understand and generate bullet comment content relevant to the current scenario.
[0028] In optional implementations, embodiments of the present invention may use existing bullet comments appearing in the scene during the current time period as historical bullet comments; or, a set of scene-related keywords may be pre-defined as historical bullet comments.
[0029] Based on the input prompts obtained in step S101, in step S102, this embodiment of the invention trains the bullet comment prediction model by gradually introducing historical bullet comments, and gradually reduces the intensity of introducing historical bullet comments as training progresses. Specifically, step S102 can be performed according to the following steps a1 to a4 for model training, as explained below: Step a1: Obtain the cue probability corresponding to each training step; In this embodiment of the invention, a training step refers to the iterative steps corresponding to a single parameter update during model training, thereby gradually adjusting model parameters to improve the accuracy of bullet screen prediction. The cue probability controls the intensity at which the model introduces historical bullet screens in the current training step. The cue probability decreases sequentially according to the training steps, which helps to gradually reduce guidance as training progresses, assisting the model in learning from easy to difficult and reducing the difficulty of model training.
[0030] For example, in the early stages of training, the probability of receiving prompts may be relatively high, while as training progresses, the probability of receiving prompts gradually decreases. This decreasing design helps the model to fully utilize historical bullet comments in the early stages of training to learn and understand the style and habits of viewers sending bullet comments in the target scene, while gradually reducing the reliance on external prompts in the later stages of training, enabling the model to autonomously generate high-quality bullet comments.
[0031] Step a2: Based on the prompt probability corresponding to each training step, obtain the target historical bullet comments to be introduced in each training step from all historical bullet comments; In this embodiment of the invention, the system selects a corresponding number or length of target historical bullet comments from pre-acquired historical bullet comments based on the cue probability of the current training step. These target historical bullet comments serve as auxiliary information to help the model better understand and generate bullet comments.
[0032] Understandably, since the probability of prompts differs in each training step, the number or length of the target historical bullet comments introduced also differs and gradually decreases, thereby achieving dynamic adjustment of the model's guidance prompt intensity: In the early stages of training, the prompt probability is high, and the model can acquire more historical context information, which is conducive to quickly establishing a basic understanding of the semantics of the live streaming scene and user expression patterns; as the number of training steps increases, the prompt probability gradually decreases, the model's dependence on external prompts weakens, and it relies more on the features it has learned for prediction, thereby improving its generalization ability and independent modeling ability in real reasoning scenarios.
[0033] Step a3: Add the target's historical bullet comments to the original bullet comment prompts to generate enhanced bullet comment prompts; In this embodiment of the invention, the selected target historical bullet comments are combined with the original bullet comment prompts to form a new, enhanced bullet comment prompt containing more contextual information. This enhanced bullet comment prompt can provide the model with richer guidance information, thereby improving the quality of its generated bullet comments.
[0034] In an optional implementation, the target historical comments can be appended to the original comment prompt to create an enhanced prompt. Furthermore, additional guiding text can be introduced before appending to clearly identify the added historical comment content.
[0035] For example, the original bullet screen prompt is "Please predict the bullet screen comments that the audience may send based on the current screen content." An instruction statement such as "The bullet screen comments that the audience may send at this moment are:" can be added after this. Then, the selected target historical bullet screen comments can be sequentially concatenated to this, thus forming a clearly structured and semantically coherent enhanced bullet screen prompt. This design not only enhances the model's ability to understand contextual information but also improves the readability and guidance effect of the prompt information through explicit labeling, helping to improve the relevance and accuracy of bullet screen generation.
[0036] Step a4: In each training step, generate the first bullet screen prediction result and the second bullet screen prediction result based on the scene description, the enhanced bullet screen prompts, and the original bullet screen.
[0037] In this embodiment of the invention, after inputting the scene description, enhanced bullet comment prompts, and original bullet comment prompts into the bullet comment prediction model, the model internally performs bullet comment prediction through two different paths. Specifically, one path generates a first bullet comment prediction result based on the scene description and original bullet comment prompts; the other path generates a second bullet comment prediction result based on the scene description and enhanced bullet comment prompts. In this way, the system can compare the bullet comment prediction results under the two prompt conditions in the same training step, thereby better evaluating and optimizing the model's performance.
[0038] This guidance method helps the bullet screen prediction model better understand the context of the current scene, effectively reduces the model's search space, increases the probability of the model making correct predictions, and increases its chances of obtaining positive rewards, thereby accelerating the model's learning process.
[0039] In one embodiment of the present invention, in order to achieve the effect of gradually decreasing the guidance information, the probability of the prompts used in each training step can be determined in the following manner: Step b1: Obtain the preset prompt probability corresponding to the initial training step; In this embodiment of the invention, the preset prompt probability is a relatively high value set at the beginning of training, which is used to ensure that the model can make full use of the bullet screen prompt information to learn and understand the user's habits and style of sending bullet screens in the target scene in the early stage of training.
[0040] Step b2: Gradually reduce the preset prompt probability according to the preset decay strategy to obtain the prompt probability corresponding to each training step after the initial training step.
[0041] In this embodiment of the invention, the system gradually reduces the initially set cue probability according to a predefined decay strategy, thereby obtaining the cue probability for each training step. Optionally, the decay strategy may be, but is not limited to, using a cosine annealing function. In this method, as training progresses, the cue probability decreases smoothly according to the cosine function.
[0042] Specifically, assuming the initial training step's preset prompt probability is 1 (i.e., 100%), during training, the prompt probability will gradually decrease to near 0 according to a cosine function. For example, if the default prompt count is 10 historical comments, when the prompt probability drops to around 0.5, the system will only prompt about 5 historical comments. Eventually, the prompt probability decays to near 0, at which point the guidance prompts completely degenerate into original comment prompts, that is, no related historical comments are given, and the model directly predicts based on the screen content.
[0043] This smooth scheduling strategy helps the model learn from easy to difficult, reducing the difficulty of model training. By providing more auxiliary information in the early stages of training, the model can better understand and learn user expression patterns in the target scene. As training progresses, this auxiliary information is gradually reduced, prompting the model to gradually rely on its own understanding of the input data to generate bullet comments, thereby improving its ability to autonomously generate bullet comments.
[0044] It should be understood that in this embodiment of the invention, the prompt probability at each training step can be determined in advance according to a set decay strategy; that is, the entire decay path is planned before training begins. Of course, the prompt probability can also be dynamically adjusted during training based on the model's current performance (such as reward score, KL divergence changes, etc.).
[0045] As can be seen from the foregoing, the model generates corresponding bullet screen prediction results under two conditions: the original bullet screen prompt and the bullet screen with historical prompts. Next, in step S103, the reward score of the bullet screen prediction model under these two conditions and the difference in the distribution of the model's internal state are determined for subsequent optimization of the model parameters.
[0046] In this embodiment of the invention, the reward score of the prediction result refers to the score obtained after evaluating the generated bullet screen prediction result, which reflects the quality and accuracy of the prediction result. Specifically, reward scores corresponding to the bullet screen prediction results under the original bullet screen prompt condition and the condition with historical bullet screens can be generated according to a preset reward model.
[0047] Optionally, the reward model can, but is not limited to, assign a reward score to each generated bullet comment sequence based on factors such as the degree of matching between the bullet comment prediction result and the video frame and context, and the naturalness and coherence of the language in the bullet comment prediction result. This helps the model optimize its generation strategy during training and improve the quality of generated bullet comments. The mathematical expression of the reward model can be in the form of: , This represents the generated trajectory, i.e., a sequence of bullet comments. Indicate the generation strategy; Indicates the trajectory Expected value; Representing the trajectory The value function of .
[0048] To obtain richer and more direct learning signals, this embodiment of the invention also simultaneously determines the differences in the internal distribution states of the model. This refers to the activation state or feature representation of the model's hidden layers during the generation of bullet comments under different conditions (i.e., the original bullet comment prompt condition and the condition with historical bullet comment prompts). Specifically, this embodiment of the invention can use the divergence value between the internal state distributions under these two conditions as the difference in internal state distributions. This difference not only provides rich learning signals but also helps the model better understand and utilize historical bullet comment information, thereby improving the quality and consistency of its generated bullet comments.
[0049] In an optional implementation, the above divergence value may be, but is not limited to, KL divergence, denoted as... ,in, This represents the internal state distribution under the original bullet screen prompt conditions. This represents the internal state distribution under the condition of historical bullet screen prompts. It can also be other forms of divergence values, which are not limited here.
[0050] For example, based on the two key metrics mentioned above, taking KL divergence as an example, the embodiments of the present invention can pre-construct a training objective function, as shown in the following formula:
[0051] in, This encourages the model to generate high-quality bullet comments through its strategy, thereby maximizing the expected reward score. Supervised learning terms based on KL divergence can help the model quickly learn the semantic information contained in high-quality guidance prompts, thereby accelerating the convergence of the model. This is a hyperparameter used to balance two objectives: maximizing the reward score and minimizing the hidden layer distribution difference. The goal of this objective function is to maximize the expected reward that the model can obtain by predicting bullet comments using its own policy, while minimizing the hidden layer distribution difference between conditions with and without historical bullet comments, thereby improving the quality of bullet comment generation and accelerating convergence.
[0052] Based on the objective function constructed above, in step S104, the function value of the preset training objective function can be determined based on the differences in the internal state distribution of the model and the reward score; the function value is backpropagated to each layer of the model to optimize the model parameters until the training termination condition is met, such as reaching the maximum number of training rounds or when the performance of the validation set converges, the parameter update process is terminated, and the trained bullet screen prediction model is output.
[0053] To gain a comprehensive understanding of the above-described bullet screen prediction model training process in the embodiments of the present invention, please refer to [link / reference needed]. Figure 2 , Figure 2 This is an example diagram illustrating the training process of the bullet screen prediction model provided in an embodiment of the present invention, combined with... Figure 2 It can be seen that the embodiments of the present invention have the following advantages: In each training step of this invention, a guidance prompt containing scene descriptions and relevant historical bullet comments is constructed and input into the bullet comment prediction model to drive it to generate candidate bullet comment sequences. The model parameters are then optimized based on the reward signal from the reward model and the divergence supervision signal. By combining guidance prompt enhancement with divergence supervision, the reward sparsity problem faced by the bullet comment prediction model during training is effectively alleviated. Furthermore, the guidance prompt strategy introduces a cosine annealing scheduling mechanism, achieving a smooth transition from assisted learning to independent model prediction, significantly enhancing the model's ability to understand the context in complex live streaming scenarios. Simultaneously, the divergence supervision term provides the model with additional learning signals, further accelerating its capture of bullet comment semantic features, thereby speeding up the convergence of the overall training process.
[0054] Based on the bullet screen prediction model obtained by the above training method, this embodiment of the invention provides a bullet screen prediction method. Please refer to [link / reference]. Figure 3 , Figure 3 A schematic flowchart of the bullet screen prediction method provided in this embodiment of the invention includes steps S301 to S303, as described below: S301: Obtain the bullet screen prediction model trained in the target scene; wherein, the bullet screen prediction model is trained by gradually introducing historical bullet screens related to the target scene into the original bullet screen prompts; S302: Obtain the video screen description and set bullet screen prompts in the target scene; S303: Generate bullet comments based on video descriptions and bullet comment prompts using a bullet comment prediction model.
[0055] In this embodiment of the invention, based on the bullet screen prediction model obtained in the above embodiments, the video scene description and set bullet screen prompts in the target scene can be used as input content. This input content is then fed into the bullet screen prediction model obtained through the training process described above. The model can quickly and accurately output bullet screens associated with the scene description in the target scene, and then display the generated bullet screens on the viewer's playback interface as part of the real-time interactive content. For example, in a game live streaming scenario, the system can automatically generate bullet screen content that fits the context, enhancing the atmosphere and user engagement.
[0056] It should be understood that in the embodiments of the present invention, there is no obvious execution order between steps S301 and S302. They can be executed simultaneously, or S301 can be executed first and then S302 can be executed. The specific order can be determined according to actual needs.
[0057] Optionally, in the target scene, the video image description can be a single frame or a description of multiple consecutive frames. Specifically, the video image description can be obtained from a single frame or multiple consecutive frames through multimodal image understanding.
[0058] Optionally, in the above-mentioned bullet screen prediction process, the input bullet screen prompts can be user-defined settings or set by the system based on the scene description. This embodiment of the invention does not limit this.
[0059] Optionally, the bullet screen prediction method provided in the embodiments of the present invention can be applied to, but is not limited to, live streaming platforms, video content recommendation systems, virtual anchor interaction systems, or online education interaction scenarios to achieve intelligent and real-time bullet screen generation and auxiliary interaction functions.
[0060] Unlike existing technologies, this invention first trains a bullet comment prediction model by gradually introducing historical bullet comments related to the target scene into the original bullet comment prompts. This allows the model to learn the correlation pattern between bullet comment content and visual context in the target scene, thereby obtaining a bullet comment prediction model optimized for the target scene. Then, in practical applications, the video scene description and the initial bullet comment prompts in the current target scene are obtained as contextual input information. The video scene description and bullet comment prompts are input together into the trained bullet comment prediction model. The model uses the scene correlation features it has learned to perform inference and generate bullet comments that are highly related to the content of the current scene. This achieves the effect of closely linking bullet comments with the context and improving prediction accuracy in complex scenes.
[0061] In order to perform the above Figure 3 The corresponding steps are described below, along with an implementation method for the bullet screen prediction device 40. Please refer to [link / reference]. Figure 4 , Figure 4 A functional block diagram of a bullet screen prediction device provided in an embodiment of the present invention is shown. The bullet screen prediction device 40 includes: an acquisition module 401 and a prediction module 402; The acquisition module 401 is used to obtain the bullet screen prediction model trained in the target scene; wherein, the bullet screen prediction model is trained by gradually introducing historical bullet screens related to the target scene into the original bullet screen prompts; The acquisition module 401 is used to acquire the video screen description and set bullet screen prompts in the target scene; The prediction module 402 is used to generate bullet comments based on the video screen description and bullet comment prompts using a bullet comment prediction model.
[0062] It is understandable that the acquisition module 401 and the prediction module 402 can be executed collaboratively. Figure 3 Each step in the process is used to achieve the corresponding technical effect.
[0063] It should be noted that the bullet screen prediction device 40 provided in this embodiment of the invention can be specific hardware on a device or software or firmware installed on the device. The implementation principle and technical effects of the device provided in this embodiment of the invention are the same as those in the foregoing method embodiments. For the sake of brevity, any parts not mentioned in the device embodiments can be referred to the corresponding content in the foregoing method embodiments. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can all be referred to the corresponding processes in the above method embodiments, and will not be repeated here.
[0064] Optionally, the above modules can be stored in the form of software or firmware. Figure 5 The memory shown is either stored in or embedded in the operating system (OS) of the electronic device 50, and can be used by... Figure 5 The processor executes the commands. Meanwhile, the data and program code required to execute these modules can be stored in memory.
[0065] Please see Figure 5 , Figure 5 The diagram illustrates a structural block diagram of an electronic device provided in an embodiment of the present invention, including a memory 501, a processor 502, and a communication interface 503. The memory 501, processor 502, and communication interface 503 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.
[0066] Optionally, the bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized into address buses, data buses, control buses, etc. For ease of representation, Figure 5 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0067] In this embodiment of the invention, the processor 502 may be a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in this embodiment of the invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in this embodiment of the invention can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor. The software modules may be located in the memory 501, and the processor 502 reads the program instructions from the memory 501 and, in conjunction with its hardware, completes the steps of the aforementioned methods.
[0068] In this embodiment of the invention, the memory 501 can be a non-volatile memory, such as a hard disk drive (HDD) or a solid-state drive (SSD), or it can be volatile memory, such as RAM. The memory can also be any other medium capable of carrying or storing desired executable program code having an instruction or data structure form and accessible by a computer, but is not limited thereto. The memory in this embodiment of the invention can also be a circuit or any other device capable of implementing a storage function for storing instructions and / or data.
[0069] The memory 501 can be used to store software programs and modules, such as the instructions / modules of the bullet screen prediction device 40 provided in this embodiment of the invention. These can be stored in the memory 501 in the form of software or firmware, or embedded in the operating system (OS) of the electronic device 50. The processor 502 executes various functional applications and data processing by executing the software programs and modules stored in the memory 501. The communication interface 503 can be used to communicate with other node devices for signaling or data.
[0070] Understandable. Figure 5 The structure shown is for illustrative purposes only; the electronic device 50 may also include components that are more advanced than those shown. Figure 5The more or fewer components shown, or having the same Figure 5 The different configurations shown. Figure 5 The components shown can be implemented using hardware, software, or a combination thereof.
[0071] Based on the above embodiments, the present invention also provides a readable storage medium storing a computer program. When the computer program is executed by a computer, it causes the computer to execute the bullet screen prediction method provided in the above embodiments. For specific implementation, please refer to the method embodiments, which will not be repeated here.
[0072] Based on the above embodiments, the present invention also provides a program product, which includes a computer program. The processor can execute the computer program to implement the bullet screen prediction method provided in the embodiments of the present invention. For specific implementation, please refer to the method embodiments, which will not be repeated here.
[0073] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and there may be other division methods in actual implementation. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the coupling or direct coupling or communication connection shown or discussed may be through some communication interface; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0074] Furthermore, 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 units can be selected to achieve the objectives of the embodiments of the present invention, depending on actual needs.
[0075] Furthermore, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0076] It should be noted that if the function is implemented as a software module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0077] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for predicting bullet comments, characterized in that, The method includes: Obtain a bullet screen prediction model trained in the target scene; wherein, the bullet screen prediction model is trained by gradually introducing historical bullet screens related to the target scene into the original bullet screen prompts; Obtain the video scene description and set bullet screen prompts in the target scene; The bullet screen prediction model is used to generate bullet screens based on the video screen description and the bullet screen prompts.
2. The bullet screen prediction method according to claim 1, characterized in that, Obtain the bullet screen prediction model trained in the target scene, including: Obtain input prompts in the target scene; wherein, the input prompts include a scene description, the original bullet screen prompts, and the historical bullet screen prompts; The input prompts are input into the bullet screen prediction model, and a first bullet screen prediction result and a second bullet screen prediction result are generated at each training step; The first bullet screen prediction result is generated under the original bullet screen prompt, and the second bullet screen prediction result is generated under the introduction of the historical bullet screen into the original bullet screen prompt; the intensity of the introduction of the historical bullet screen decreases sequentially with the training step time. In each training step, determine the reward scores for the first bullet screen prediction result and the second bullet screen prediction result, as well as the differences in the internal state distribution of the model. The model parameters are jointly optimized based on the reward score and the difference in the internal state distribution of the model in each training step until the training termination condition is met, resulting in the bullet screen prediction model trained in the target scene.
3. The bullet screen prediction method according to claim 2, characterized in that, The input prompts are fed into the bullet screen prediction model, and a first bullet screen prediction result and a second bullet screen prediction result are generated at each training step, including: Obtain the cue probability corresponding to each training step; wherein the cue probability decreases in chronological order of the training steps; Based on the prompt probability corresponding to each training step, the target historical bullet comments to be introduced in each training step are obtained from all historical bullet comments. Add the target historical bullet comments to the original bullet comment prompt to generate an enhanced bullet comment prompt; In each training step, the first bullet screen prediction result and the second bullet screen prediction result are generated based on the scene description, the enhanced bullet screen prompts, and the original bullet screen, respectively.
4. The bullet screen prediction method according to claim 3, characterized in that, Based on the prompt probability corresponding to each training step, the target historical bullet comments to be introduced in each training step are obtained from all historical bullet comments, including: The target historical bullet comments are obtained by sampling from all the historical bullet comments based on the suggested probability.
5. The bullet screen prediction method according to claim 2, characterized in that, Obtaining a bullet screen prediction model trained in the target scene also includes: Based on the preset reward model, generate reward scores corresponding to the first bullet screen prediction result and the second bullet screen prediction result respectively; The divergence value between the internal state distribution of the model when generating the first bullet screen prediction result and the second bullet screen result is used as the difference in internal state distribution.
6. The bullet screen prediction method according to claim 2, characterized in that, The model parameters are jointly optimized based on the reward score and the differences in the model's internal state distribution in each training step until the training termination condition is met. The resulting bullet screen prediction model trained in the target scene includes: The function value of the preset training objective function is determined based on the differences in the internal state distribution of the model and the reward score; The function value is backpropagated to each layer of the model to optimize the model parameters until the training termination condition is met, thus obtaining the bullet screen prediction model trained under the target scene.
7. The bullet screen prediction method according to any one of claims 1-6, characterized in that, Obtaining a bullet screen prediction model trained in the target scene also includes: Obtain the preset prompt probability corresponding to the initial training step; The preset prompt probability is gradually reduced according to the preset decay strategy to obtain the prompt probability corresponding to each training step after the initial training step.
8. A bullet screen prediction device, characterized in that, include: The acquisition module is used to obtain a bullet screen prediction model trained in the target scene; wherein, the bullet screen prediction model is trained by gradually introducing historical bullet screens related to the target scene into the original bullet screen prompts; The acquisition module is also used to acquire the video screen description and set bullet screen prompts in the target scene; The prediction module is used to generate bullet comments based on the video screen description and the bullet comment prompts input using the bullet comment prediction model.
9. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a computer program that can be executed by the processor to implement the bullet screen prediction method according to any one of claims 1-7.
10. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the bullet screen prediction method as described in any one of claims 1-7.