Stroma recognition method and device, electronic equipment and storage medium
By identifying and combining potential spoiler point information of video content and progress, the problem of low spoiler recognition accuracy in the prior art is solved, and a more efficient spoiler recognition effect is achieved.
Patent Information
- Application Number
- CN202411544717.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-18
AI Technical Summary
The prior art fails to fully consider the influencing factors of the video plot when identifying spoilers and comments in video websites, resulting in low recognition accuracy.
By identifying and storing potential spoiler point information of the video based on the content information of the target video, adding video progress factors during the identification process, selecting target potential spoiler point information after the video progress to be identified to improve the identification accuracy.
It improves the accuracy and rationality of spoiler recognition, and can more effectively avoid disturbing the viewer's viewing experience due to spoiler content.
Smart Images

Figure CN119484932A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of video processing technology, and in particular to a spoiler identification method, device, electronic equipment and storage medium. Background Art
[0002] When watching videos on video websites, spoiler comments and spoiler comments often affect the audience's viewing experience, especially in suspense and drama videos with tight plots. Sudden spoilers may make the audience lose their expectations and surprises for the plot. Therefore, spoiler identification is an important requirement of the interactive product department, which aims to help viewers avoid being disturbed by spoiler content while enjoying the interaction.
[0003] In current technology, barrage text is usually identified separately by identifying whether the barrage text itself is spoiler text. For example, some spoiler text can be set in advance, and then the barrage text can be matched with the spoiler text to identify whether the barrage text contains spoilers.
[0004] However, in the above spoiler recognition method, only pure barrage text recognition is performed, and the influencing factors of the video corresponding to the barrage text are not taken into account, such as the influence of the video plot, etc. Therefore, the accuracy of the above spoiler recognition method is low. Summary of the invention
[0005] The purpose of the embodiments of the present invention is to provide a spoiler identification method, device, electronic device and storage medium to achieve more accurate spoiler identification. The specific technical solution is as follows:
[0006] In a first aspect of the present invention, a spoiler identification method is provided, comprising:
[0007] Based on the content information of the target video, identifying potential spoiler point information of the target video, and storing the potential spoiler point information of the target video, wherein the potential spoiler point information refers to content information that is spoiler;
[0008] Acquire the information to be identified of the target video, and select the target potential spoiler point information located after the video progress corresponding to the information to be identified from the stored potential spoiler point information of the target video;
[0009] According to the information to be identified and the target potential spoiler point information, it is identified whether the information to be identified contains spoilers.
[0010] Optionally, based on the content information of the target video, potential spoiler point information of the target video is identified, including: for each time period in the target video, based on the content information of the current time period, obtaining potential spoiler point information of the current time period; and determining the potential spoiler point information of each time period in the target video as the potential spoiler point information of the target video.
[0011] Optionally, based on the content information of the current time period, obtaining potential spoiler point information of the current time period includes: inputting the content information of the current time period into a pre-trained potential spoiler point recognition model to obtain the potential spoiler point information of the current time period output by the potential spoiler point recognition model.
[0012] Optionally, the potential spoiler point identification model is trained in the following manner: obtaining first sample data, the first sample data including sample content information and annotated potential spoiler point information corresponding to the sample content information; inputting the sample content information into the potential spoiler point identification model to be trained, and obtaining predicted potential spoiler point information output by the potential spoiler point identification model to be trained; after determining that the training is completed based on the predicted potential spoiler point information and the annotated potential spoiler point information, the potential spoiler point identification model is obtained.
[0013] Optionally, the content information includes at least one of plot information and dialogue information.
[0014] Optionally, the potential spoiler point information of the target video includes potential spoiler point information of each time period in the target video; selecting the target potential spoiler point information located after the video progress corresponding to the information to be identified includes: selecting the potential spoiler point information of the time period located after the video progress corresponding to the information to be identified as candidate potential spoiler point information; selecting the target potential spoiler point information from the candidate potential spoiler point information according to the content relevance between the candidate potential spoiler point information and the information to be identified.
[0015] Optionally, the information to be identified includes barrage information; selecting potential spoiler point information in a time period after the video progress corresponding to the information to be identified, including: obtaining the time point at which the barrage information appears in the target video; selecting potential spoiler point information in a time period after the time point.
[0016] Optionally, the information to be identified includes comment information; and potential spoiler point information of a time period after the video progress corresponding to the information to be identified is selected, including: when the target video is a video, obtaining potential spoiler point information of each time period in the target video; when the target video includes multiple episodes, selecting potential spoiler point information of each time period in the current episode corresponding to the comment information, and potential spoiler point information of each time period in subsequent episodes of the current episode.
[0017] Optionally, the target potential spoiler point information is selected from the candidate potential spoiler point information according to the content relevance between the candidate potential spoiler point information and the information to be identified, including: for each candidate potential spoiler point information, calculating the content relevance between the current candidate potential spoiler point information and the information to be identified; and from the candidate potential spoiler point information, selecting multiple candidate potential spoiler point information whose content relevance is greater than a preset threshold and has the highest content relevance as the target potential spoiler point information.
[0018] Optionally, identifying whether the information to be identified contains spoilers based on the information to be identified and the target potential spoiler point information includes: inputting the information to be identified and the target potential spoiler point information into a pre-trained spoiler identification model to obtain a recognition result output by the spoiler identification model, wherein the recognition result indicates whether the information to be identified contains spoilers.
[0019] Optionally, the spoiler identification model is trained in the following manner: obtaining second sample data, the second sample data including sample identification information, sample potential spoiler point information and sample annotation information, the sample annotation information indicating whether the sample identification information contains spoilers; inputting the sample identification information and the sample potential spoiler point information into the spoiler identification model to be trained, obtaining a sample identification result output by the spoiler identification model to be trained, the sample identification result indicating whether the sample identification information contains spoilers; after determining that the training is completed based on the sample identification result and the sample annotation information, the spoiler identification model is obtained.
[0020] In a second aspect of the present invention, a spoiler identification device is provided, comprising:
[0021] A first identification module is used to identify potential spoiler point information of the target video based on the content information of the target video, and store the potential spoiler point information of the target video, wherein the potential spoiler point information refers to content information that is spoiler;
[0022] A selection module is used to obtain the information to be identified of the target video, and select the target potential spoiler point information located after the video progress corresponding to the information to be identified from the stored potential spoiler point information of the target video;
[0023] The second identification module is used to identify whether the information to be identified contains spoilers according to the information to be identified and the target potential spoiler point information.
[0024] Optionally, the first identification module includes: a spoiler point acquisition unit, used to obtain potential spoiler point information of the current time period based on content information of the current time period for each time period in the target video; and a spoiler point determination unit, used to determine the potential spoiler point information of each time period in the target video as the potential spoiler point information of the target video.
[0025] Optionally, the spoiler point acquisition unit is specifically configured to input content information of the current time period into a pre-trained potential spoiler point recognition model, and obtain potential spoiler point information of the current time period output by the potential spoiler point recognition model.
[0026] Optionally, the potential spoiler point identification model is trained in the following manner: obtaining first sample data, the first sample data including sample content information and annotated potential spoiler point information corresponding to the sample content information; inputting the sample content information into the potential spoiler point identification model to be trained, and obtaining predicted potential spoiler point information output by the potential spoiler point identification model to be trained; after determining that the training is completed based on the predicted potential spoiler point information and the annotated potential spoiler point information, the potential spoiler point identification model is obtained.
[0027] Optionally, the content information includes at least one of plot information and dialogue information.
[0028] Optionally, the potential spoiler point information of the target video includes potential spoiler point information of each time period in the target video; the selection module includes: a first selection unit, used to select potential spoiler point information of a time period after the video progress corresponding to the information to be identified, as candidate potential spoiler point information; a second selection unit, used to select the target potential spoiler point information from the candidate potential spoiler point information according to the content relevance between the candidate potential spoiler point information and the information to be identified.
[0029] Optionally, the information to be identified includes barrage information; the first selection unit is specifically used to obtain the time point when the barrage information appears in the target video; and select potential spoiler point information in a time period after the time point.
[0030] Optionally, the information to be identified includes comment information; the first selection unit is specifically used to obtain potential spoiler point information for each time period in the target video when the target video is a video; when the target video includes multiple episodes, select the potential spoiler point information for each time period in the current episode corresponding to the comment information, and the potential spoiler point information for each time period in subsequent episodes of the current episode.
[0031] Optionally, the second selection unit is specifically used to calculate, for each candidate potential spoiler point information, the content relevance between the current candidate potential spoiler point information and the information to be identified; and from the candidate potential spoiler point information, select multiple candidate potential spoiler point information whose content relevance is greater than a preset threshold and whose content relevance is the highest as the target potential spoiler point information.
[0032] Optionally, the second identification module is specifically used to input the information to be identified and the target potential spoiler point information into a pre-trained spoiler identification model to obtain a recognition result output by the spoiler identification model, and the recognition result indicates whether the information to be identified contains spoilers.
[0033] Optionally, the spoiler identification model is trained in the following manner: obtaining second sample data, the second sample data including sample identification information, sample potential spoiler point information and sample annotation information, the sample annotation information indicating whether the sample identification information contains spoilers; inputting the sample identification information and the sample potential spoiler point information into the spoiler identification model to be trained, obtaining a sample identification result output by the spoiler identification model to be trained, the sample identification result indicating whether the sample identification information contains spoilers; after determining that the training is completed based on the sample identification result and the sample annotation information, the spoiler identification model is obtained.
[0034] In another aspect of the implementation of the present invention, 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; the memory is used to store computer programs; and the processor is used to implement any of the above-mentioned spoiler identification methods when executing the program stored in the memory.
[0035] In another aspect of the present invention, 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, the computer implements any of the above-mentioned spoiler identification methods.
[0036] In yet another aspect of the present invention, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to implement any of the above-mentioned spoiler identification methods.
[0037] The spoiler identification method, device, electronic device and storage medium provided by the embodiments of the present invention can identify the potential spoiler point information of the target video based on the content information of the target video, and can add the potential spoiler point information to the influencing factors of the video content, so that the potential spoiler point information is closely integrated with the video content and is more targeted; by selecting the target potential spoiler point information that is located after the video progress corresponding to the information to be identified, the influencing factors of the video progress can be added, so that the target potential spoiler point information is located after the video progress corresponding to the information to be identified, which is more reasonable; therefore, the information to be identified and the target potential spoiler point information are compared and analyzed to identify whether the information to be identified contains spoilers, and the influencing factors of the video itself are added, thereby improving the accuracy and rationality of spoiler identification. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the embodiments of the present invention 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.
[0039] Figure 1 The figure is a flowchart of a spoiler identification method in an embodiment of the present invention.
[0040] Figure 2 Schematic diagram of a spoiler identification process in an embodiment of the present invention.
[0041] Figure 3 Schematic diagram of a spoiler identification option interface in an embodiment of the present invention.
[0042] Figure 4 4 is a structural block diagram of a spoiler identification device in an embodiment of the present invention.
[0043] Figure 5 The figure is a structural block diagram of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION
[0044] The technical solutions in the embodiments of the present invention will be described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0045] At present, the technology of identifying whether the barrage text itself is spoiler text by performing barrage text recognition alone will have some problems that cannot be identified. For example: (1) problems related to the progress of the series, such as the plot of a certain episode in the video that appears after the episode is not considered a spoiler; (2) problems related to self-created nouns, such as a noun in the video contains some important plots, but the spoiler recognition method for barrage text cannot recognize these specific nouns; (3) problems with the special meaning of common words, such as some suspense dramas, the murder weapon is a vase, but vase is a common word and is usually not considered a spoiler, so it cannot be recognized.
[0046] In view of the above problems, the embodiment of the present invention proposes to introduce the content information and video progress of the video, and to perform spoiler identification in combination with these influencing factors, which can solve the problem of being unable to identify in cases related to the progress of the series, related to self-created nouns, and the special meaning of common words, and improve the accuracy of spoiler identification. The spoiler identification method in the embodiment of the present invention can be applied to the server. The following is a detailed introduction.
[0047] Figure 1 The figure is a flowchart of a spoiler identification method in an embodiment of the present invention.
[0048] like Figure 1 As shown, the spoiler identification method may include the following steps:
[0049] Step 101: Based on the content information of a target video, identify potential spoiler point information of the target video, and store the potential spoiler point information of the target video.
[0050] The target video refers to the video that needs to be spoiler-identified. For example, the target video can be a whole video, such as a movie, etc. The target video can also contain multiple episodes, such as a TV series containing multiple episodes, etc.
[0051] The content information of the target video refers to information that can describe the specific content of the target video. For example, the content information of the target video may include but is not limited to at least one of the following: plot information, line information, and the like.
[0052] In the embodiment of the present invention, considering that the content information of the target video is relatively lengthy and there may be some content information that is not spoiler in the content information, if spoiler identification is performed directly based on the content information of the target video, the efficiency of spoiler identification will be reduced. Therefore, it is possible to refine the content information of the target video and identify potential spoiler point information of the target video based on the content information of the target video. Potential spoiler point information refers to content information that is spoiler, so potential spoiler point information is more refined and accurate than content information.
[0053] In an optional implementation, the target video may be divided into time periods, and the potential spoiler point information of each time period may be identified, thereby associating the potential spoiler point information with the video progress, so that the potential spoiler point information may be subsequently screened based on the video progress corresponding to the information to be identified. Therefore, the process of identifying the potential spoiler point information of the target video based on the content information of the target video may include: for each time period in the target video, based on the content information of the current time period, obtaining the potential spoiler point information of the current time period; determining the potential spoiler point information of each time period in the target video as the potential spoiler point information of the target video.
[0054] The division of the above time periods can be processed according to actual needs. For example, for plot information, the time periods can be divided according to preset durations, such as one minute as a time period, etc. For dialogue information, the time periods can be divided according to the time periods in which the dialogue information that can express a plot is located, etc. This embodiment does not limit this.
[0055] In an optional implementation, considering that the machine learning model has high accuracy and efficiency, a potential spoiler point identification model can be pre-trained and used to identify potential spoiler point information.
[0056] Exemplarily, the training process of the potential spoiler point identification model may include the following steps A1 to A3:
[0057] Step A1: Acquire first sample data, where the first sample data includes sample content information and annotated potential spoiler point information corresponding to the sample content information.
[0058] In an embodiment of the present invention, a video can be obtained from a video website as a first sample video, and the first sample video can be divided into time periods. The content information of each time period can be used as a sample content information, and the potential spoiler point information in the sample content information can be marked according to actual conditions, so as to obtain the marked potential spoiler point information corresponding to the sample content information.
[0059] Step A2: input the sample content information into the potential spoiler point recognition model to be trained, and obtain the predicted potential spoiler point information output by the potential spoiler point recognition model to be trained.
[0060] In the embodiment of the present invention, the input and output of the potential spoiler point recognition model are both text information, so the potential spoiler point recognition model to be trained can use any applicable text generation text model. For example, the potential spoiler point recognition model to be trained can use a model with a GPT (Generative Pre-trained Transformer) architecture that is good at natural language processing, such as LLaMA (Large Language Model Meta AI), Tongyi Qianwen, Baichuan, and so on.
[0061] In the process of training the potential spoiler point recognition model to be trained, the input of the potential spoiler point recognition model to be trained is the sample content information, and the output of the potential spoiler point recognition model to be trained is the predicted potential spoiler point information corresponding to the sample content information.
[0062] Step A3, after determining that the training is completed based on the predicted potential spoiler point information and the labeled potential spoiler point information, obtaining the potential spoiler point identification model.
[0063] Based on the predicted potential spoiler point information and the annotated potential spoiler point information, the loss function of the potential spoiler point recognition model to be trained can be calculated. When the loss function of the potential spoiler point recognition model to be trained is greater than or equal to a preset first loss threshold, it is determined that the training is not completed, and the parameters of the potential spoiler point recognition model to be trained are adjusted to continue training; when the loss function of the potential spoiler point recognition model to be trained is less than the preset first loss threshold, it is determined that the training is completed, and a trained potential spoiler point recognition model is obtained.
[0064] Exemplarily, during the training process, parameter adjustment can be performed by LoRA (Low-Rank Adaptation) fine-tuning, SFT (Supervised Fine-tuning), LoRA and SFT combined fine-tuning, etc., which is not limited in this embodiment.
[0065] Exemplarily, the loss function of the potential spoiler point recognition model to be trained may include but is not limited to: a cross entropy loss function, an absolute value loss function, a square loss function, etc. The specific value of the first loss threshold can be set according to actual needs, and this embodiment does not limit this.
[0066] Based on the potential spoiler point recognition model obtained through training, the content information of the current time period in the target video can be input into the pre-trained potential spoiler point recognition model to obtain the potential spoiler point information of the current time period output by the potential spoiler point recognition model.
[0067] For example, the specific input and output format of the potential spoiler point identification model is:
[0068] Input: content information (such as plot information or dialogue information);
[0069] Output: Potential spoiler point 1, potential spoiler point 2, potential spoiler point 3...
[0070] The separator between potential spoiler points can be a comma or any other defined symbol.
[0071] For plot information, input the plot information of a certain time period, and output the potential spoiler point 1, potential spoiler point 2, potential spoiler point 3, etc. of that time period.
[0072] For the dialogue information, input the dialogue information of a certain time period, and output the potential spoiler point 1, potential spoiler point 2, potential spoiler point 3, etc. in that time period.
[0073] The following are examples:
[0074] For example, the input is the plot information of a certain time period: A tries his best to continue to control the overall situation. At this moment, B also forcibly takes his blood and puts it on the mother poisonous insect in public, but it still doesn't work at all. Just when everyone is puzzled, C's master's wife rushes to the scene and puts C's blood on the mother insect to instantly dissolve the thing. Only then does everyone react and learn that the blood flowing in C is the real princess's blood.
[0075] The output is the potential spoiler information for that time period: the queen worm, the queen poison worm, and the princess’ bloodline.
[0076] For another example, the input is the dialogue information of a certain time period: D: Tell E that I want to eat fish.
[0077] The output is the potential spoiler point information for this time period: eating fish.
[0078] In the embodiment of the present invention, in order to avoid affecting the efficiency of spoiler identification, the potential spoiler point information of the target video can be identified in advance based on the content information of the target video, and the potential spoiler point information of the target video, that is, the potential spoiler point information of each time period in the target video, is stored in a database for standby, so that the potential spoiler point identification and spoiler identification are decoupled to avoid affecting the online identification efficiency during the peak period of the release of the information to be identified. Accordingly, since the potential spoiler point identification model can be identified in advance, the number of parameters of the potential spoiler point identification model can be relatively large, and can be processed according to actual needs.
[0079] Step 102, obtaining the information to be identified of the target video, and selecting the target potential spoiler point information located after the video progress corresponding to the information to be identified from the stored potential spoiler point information of the target video.
[0080] Exemplarily, the information to be identified of the target video may include, but is not limited to, at least one of the following: barrage information, comment information, and the like.
[0081] In an optional implementation, the process of selecting target potential spoiler point information located after the video progress corresponding to the information to be identified may include the following steps B1 to B2:
[0082] Step B1, selecting potential spoiler point information in a time period after the video progress corresponding to the information to be identified as candidate potential spoiler point information.
[0083] Since the bullet-chat information can correspond to a specific time point, the process of selecting the potential spoiler point information in the time period after the progress of the video corresponding to the information to be identified can include: obtaining the time point when the bullet-chat information appears in the target video; selecting the potential spoiler point information in the time period after the time point. The time point when the bullet-chat information appears in the target video can be the time point in the target video corresponding to the bullet-chat uploaded as recorded by the backend server.
[0084] Specifically, when the target video is a video, the potential spoiler point information of the time period after the time point when the barrage information appears in the target video is selected; when the target video includes multiple episodes, the potential spoiler point information of the time period after the time point when the barrage information appears in the target video in the current episode corresponding to the barrage information, as well as the potential spoiler point information of each time period in the subsequent episodes of the current episode corresponding to the barrage information are selected.
[0085] For example, for barrage information, each minute is divided into a time period. In the 10th episode of the video, it is necessary to identify whether a barrage information "C is the princess's son" contains spoilers. This barrage information appears at the 41st minute of the 10th episode. Then, the stored potential spoiler point information after the 41st minute of the 10th episode and in each time period from the 11th episode to the last episode can be selected, such as the queen insect, the mother poisonous insect, the princess's bloodline, and so on.
[0086] For comment information, since it may not correspond to a specific time point, the process of selecting potential spoiler point information of the time period after the video progress corresponding to the information to be identified for the comment information may include: when the target video is a video, obtaining the potential spoiler point information of each time period in the target video; when the target video includes multiple episodes, selecting the potential spoiler point information of each time period in the current episode corresponding to the comment information, as well as the potential spoiler point information of each time period in the subsequent episodes of the current episode.
[0087] Step B2: selecting the target potential spoiler point information from the candidate potential spoiler point information according to the content relevance between the candidate potential spoiler point information and the information to be identified.
[0088] In the embodiment of the present invention, considering that there are many candidate potential spoiler point information, which will affect the performance of spoiler identification, the content relevance between the candidate potential spoiler point information and the information to be identified can reflect the similarity between the candidate potential spoiler point information and the information to be identified. The greater the content relevance between the two, the greater the similarity between the two, and the greater the similarity between the two, the more the candidate potential spoiler point information can reflect whether the information to be identified contains spoilers. Therefore, the target potential spoiler point information can be selected from the candidate potential spoiler point information according to the content relevance between the candidate potential spoiler point information and the information to be identified.
[0089] In an optional implementation, the process of selecting the target potential spoiler point information from the candidate potential spoiler point information based on the content relevance between the candidate potential spoiler point information and the information to be identified may include: calculating, for each candidate potential spoiler point information, the content relevance between the current candidate potential spoiler point information and the information to be identified; and selecting, from the candidate potential spoiler point information, a plurality of candidate potential spoiler point information whose content relevance is greater than a preset threshold and whose content relevance is the highest, as the target potential spoiler point information.
[0090] Exemplarily, a text similarity matching model may be pre-trained, and the text similarity matching model may be used to obtain the content relevance between the candidate potential spoiler point information and the information to be identified.
[0091] Exemplarily, the training process of the text similarity matching model may include the following steps C1 to C3:
[0092] Step C1, obtaining third sample data, wherein the third sample data includes first sample identification information, first sample potential spoiler point information, and annotation similarity between the first sample identification information and the first sample potential spoiler point information.
[0093] In an embodiment of the present invention, a video can be obtained from a video website as the third sample video, and the first sample identification information can be plot information, line information, etc. in the third sample video. The first sample potential spoiler point information can be potential spoiler point information in the third sample video. The similarity between the first sample identification information and the first sample potential spoiler point information is annotated according to actual conditions, thereby obtaining the annotated similarity between the first sample identification information and the first sample potential spoiler point information.
[0094] Step C2: input the first sample identification information and the first sample potential spoiler point information into the text similarity matching model to be trained to obtain the output result of the text similarity matching model to be trained, wherein the output result is the predicted similarity between the first sample identification information and the first sample potential spoiler point information.
[0095] In the embodiment of the present invention, the text similarity matching model to be trained can be any applicable model that can calculate the similarity between two texts. For example, the text similarity matching model to be trained can be a BERT (Bidirectional Encoder Representation from Transformers) model, a Sentence (sentence embedding)-BERT model, and the like.
[0096] Step C3, after determining that the training is completed based on the annotation similarity and the predicted similarity, obtaining the text similarity matching model.
[0097] Based on the annotated similarity and the predicted similarity information, the loss function of the text similarity matching model to be trained can be calculated. When the loss function of the text similarity matching model to be trained is greater than or equal to a preset second loss threshold, it is determined that the training is not completed, and the parameters of the text similarity matching model to be trained are adjusted to continue training; when the loss function of the text similarity matching model to be trained is less than the preset second loss threshold, it is determined that the training is completed, and a trained text similarity matching model is obtained.
[0098] Exemplarily, the loss function of the text similarity matching model to be trained may include but is not limited to: a cross entropy loss function, an absolute value loss function, a square loss function, etc. The specific value of the second loss threshold can be set according to actual needs, and this embodiment does not limit this.
[0099] Based on the trained text similarity matching model, the current candidate potential spoiler point information and the information to be identified can be input into the text similarity matching model to obtain the content relevance between the current candidate potential spoiler point information and the information to be identified output by the text similarity matching model.
[0100] Then, from the candidate potential spoiler point information, multiple candidate potential spoiler point information whose content relevance is greater than a preset threshold and whose content relevance is the highest are selected as the target potential spoiler point information. The specific value of the preset threshold and the specific number of selected candidate potential spoiler point information can be set according to actual needs, and this embodiment does not limit this.
[0101] For example, using the text similarity matching model, for multiple potential spoiler point information, specifically potential spoiler point 1, potential spoiler point 2, potential spoiler point 3, etc., their content relevance s1, s2, s3, etc. with the information to be identified is calculated respectively. Based on the content relevance s1, s2, s3, etc., potential spoiler point 1, potential spoiler point 2, potential spoiler point 3, etc. are sorted in order from large to small in terms of content relevance, and multiple potential spoiler point information with a front sorting and a content relevance greater than a preset threshold are selected as the target potential spoiler point information. Among them, the content relevance can be a value between 0 and 1, 1 means complete relevance, and 0 means no relevance. The content relevance can also be a value in other forms, which is not limited in this embodiment.
[0102] Step 103: Identify whether the information to be identified contains spoilers based on the information to be identified and the target potential spoiler point information.
[0103] After selecting the target potential spoiler point information, the information to be identified and the target potential spoiler point information can be comprehensively analyzed to identify whether the information to be identified contains spoilers.
[0104] In an optional implementation, considering that the machine learning model has high accuracy and efficiency, a spoiler identification model may be pre-trained, and the spoiler identification model may be used to identify whether the information to be identified contains spoilers.
[0105] Exemplarily, the training process of the spoiler identification model may include the following steps D1 to D3:
[0106] Step D1, obtaining second sample data, wherein the second sample data includes sample identification information, sample potential spoiler point information, and sample annotation information, wherein the sample annotation information indicates whether the sample identification information contains spoilers.
[0107] In the embodiment of the present invention, a video can be obtained from a video website as the second sample video, and the sample identification information can be plot information, line information, etc. in the second sample video. The sample potential spoiler point information can be potential spoiler point information in the second sample video. Whether the sample identification information contains spoilers is marked according to the actual situation, thereby obtaining sample marking information.
[0108] Exemplarily, the sample annotation information may include the probability of the sample identification information having spoilers and the probability of the sample identification information not having spoilers, etc. The sum of the probability of the sample identification information having spoilers and the probability of the sample identification information not having spoilers is 1. In practical applications, it may be determined that a spoiler exists when the probability of the sample identification information having spoilers exceeds a preset first spoiler threshold value, and that a spoiler does not exist when the probability of the sample identification information not having spoilers exceeds a preset second spoiler threshold value, etc., according to actual needs.
[0109] Step D2, inputting the sample identification information and the sample potential spoiler point information into the spoiler identification model to be trained, obtaining the sample identification result output by the spoiler identification model to be trained, and the sample identification result indicates whether the sample identification information contains spoilers.
[0110] In the embodiment of the present invention, the spoiler identification model to be trained can select any applicable text classification model. For example, the spoiler identification model to be trained can select a model of the GPT (Generative Pre-trained Transformer) architecture that is good at natural language processing, such as LLaMA (Large Language Model MetaAI), Tongyi Qianwen, Baichuan, etc.
[0111] Exemplarily, the sample identification result may include the probability that the sample identification information contains spoilers and the probability that the sample identification information does not contain spoilers, etc. The sum of the probability that the sample identification information contains spoilers and the probability that the sample identification information does not contain spoilers is 1.
[0112] Step D3, after determining that the training is completed based on the sample recognition result and the sample annotation information, the spoiler recognition model is obtained.
[0113] Based on the sample recognition result and the sample annotation information, the loss function of the spoiler recognition model to be trained can be calculated. When the loss function of the spoiler recognition model to be trained is greater than or equal to a preset third loss threshold, it is determined that the training is not completed, and the parameters of the spoiler recognition model to be trained are adjusted to continue training; when the loss function of the spoiler recognition model to be trained is less than the preset third loss threshold, it is determined that the training is completed, and a spoiler recognition model that has been trained is obtained.
[0114] Exemplarily, during the training process, parameter adjustment can be performed by LoRA (Low-Rank Adaptation) fine-tuning, SFT (Supervised Fine-tuning), LoRA and SFT combined fine-tuning, etc., which is not limited in this embodiment.
[0115] Exemplarily, the loss function of the spoiler identification model to be trained may include but is not limited to: a cross entropy loss function, an absolute value loss function, a square loss function, etc. The specific value of the third loss threshold can be set according to actual needs, and this embodiment does not limit this.
[0116] Based on the spoiler recognition model obtained through training, the information to be recognized and the target potential spoiler point information are input into the pre-trained spoiler recognition model to obtain a recognition result output by the spoiler recognition model, wherein the recognition result indicates whether the information to be recognized contains spoilers.
[0117] For example, the specific input and output format of the spoiler identification model is:
[0118] Input: Potential spoiler point 1, potential spoiler point 2, potential spoiler point 3... <separator> information to be identified
[0119] Output: 0 or 1
[0120] Among them, 1 indicates the presence of spoilers, and 0 indicates the absence of spoilers. Of course, the probability of 1 and the probability of 0 can also be output according to actual needs.
[0121] In an embodiment of the present invention, by identifying potential spoiler point information of a target video based on content information of the target video, the potential spoiler point information can be added to the influencing factors of the video content, so that the potential spoiler point information is closely integrated with the video content and is more targeted; by selecting target potential spoiler point information that is located after the video progress corresponding to the information to be identified, the influencing factors of the video progress can be added, so that the target potential spoiler point information is located after the video progress corresponding to the information to be identified, which is more reasonable; therefore, the information to be identified and the target potential spoiler point information are compared and analyzed to identify whether the information to be identified contains spoilers, and the influencing factors of the video itself are added, thereby improving the accuracy and rationality of spoiler identification.
[0122] Figure 2 Schematic diagram of a spoiler identification process in an embodiment of the present invention.
[0123] like Figure 2As shown, the spoiler identification process includes: in the offline process, obtaining the line information and plot information from the database, using the potential spoiler point identification model to analyze the line information, obtaining the potential spoiler point information corresponding to the line information, using the potential spoiler point identification model to analyze the plot information, obtaining the potential spoiler point information corresponding to the plot information, and storing the potential spoiler point information corresponding to the line information and the potential spoiler point information corresponding to the plot information in the database. In the online process, obtaining the video's bullet screen information / comment information, recalling the potential spoiler point information from the database based on the bullet screen information / comment information, sorting the recalled potential spoiler point information, obtaining the target potential spoiler point information, using the spoiler identification model, analyzing the bullet screen information / comment information and the target potential spoiler point information, and obtaining the result of whether the bullet screen information / comment information contains spoilers. After identifying that the bullet screen information contains spoilers, the bullet screen information with spoilers can be blocked, so when the client plays the bullet screen information of the video, the bullet screen information with spoilers will not be played. After identifying that the comment information contains spoilers, the comment information containing spoilers can be blocked, so when the client displays the comment information of the video, the comment information containing spoilers will not be displayed. The specific process can be referred to the relevant description above, and this embodiment will not be discussed in detail here.
[0124] In the embodiment of the present invention, a spoiler identification option may also be provided in the terminal, such as Figure 3 In the smart anti-spoiler option, after the user sets the smart anti-spoiler option to be turned on, the server identifies whether the information to be identified contains spoilers according to the above-mentioned spoiler identification method, and then blocks the information to be identified that contains spoilers for the terminal, thereby meeting the user's needs.
[0125] Figure 4 4 is a structural block diagram of a spoiler identification device in an embodiment of the present invention.
[0126] like Figure 4 As shown, the spoiler identification device may include the following modules:
[0127] A first identification module 401 is used to identify potential spoiler point information of the target video based on the content information of the target video, and store the potential spoiler point information of the target video, wherein the potential spoiler point information refers to content information that is spoiler;
[0128] The selection module 402 is used to obtain the information to be identified of the target video, and select the target potential spoiler point information located after the video progress corresponding to the information to be identified from the stored potential spoiler point information of the target video;
[0129] The second identification module 403 is used to identify whether the information to be identified contains spoilers according to the information to be identified and the target potential spoiler point information.
[0130] Optionally, the first identification module 401 includes: a spoiler point acquisition unit, used to obtain potential spoiler point information of the current time period based on the content information of the current time period for each time period in the target video; and a spoiler point determination unit, used to determine the potential spoiler point information of each time period in the target video as the potential spoiler point information of the target video.
[0131] Optionally, the spoiler point acquisition unit is specifically configured to input content information of the current time period into a pre-trained potential spoiler point recognition model, and obtain potential spoiler point information of the current time period output by the potential spoiler point recognition model.
[0132] Optionally, the potential spoiler point identification model is trained in the following manner: obtaining first sample data, the first sample data including sample content information and annotated potential spoiler point information corresponding to the sample content information; inputting the sample content information into the potential spoiler point identification model to be trained, and obtaining predicted potential spoiler point information output by the potential spoiler point identification model to be trained; after determining that the training is completed based on the predicted potential spoiler point information and the annotated potential spoiler point information, the potential spoiler point identification model is obtained.
[0133] Optionally, the content information includes at least one of plot information and dialogue information.
[0134] Optionally, the potential spoiler point information of the target video includes potential spoiler point information of each time period in the target video; the selection module 402 includes: a first selection unit, used to select potential spoiler point information of a time period after the progress of the video corresponding to the information to be identified, as candidate potential spoiler point information; a second selection unit, used to select the target potential spoiler point information from the candidate potential spoiler point information according to the content relevance between the candidate potential spoiler point information and the information to be identified.
[0135] Optionally, the information to be identified includes barrage information; the first selection unit is specifically used to obtain the time point when the barrage information appears in the target video; and select potential spoiler point information in a time period after the time point.
[0136] Optionally, the information to be identified includes comment information; the first selection unit is specifically used to obtain potential spoiler point information for each time period in the target video when the target video is a video; when the target video includes multiple episodes, select the potential spoiler point information for each time period in the current episode corresponding to the comment information, and the potential spoiler point information for each time period in subsequent episodes of the current episode.
[0137] Optionally, the second selection unit is specifically used to calculate, for each candidate potential spoiler point information, the content relevance between the current candidate potential spoiler point information and the information to be identified; and from the candidate potential spoiler point information, select multiple candidate potential spoiler point information whose content relevance is greater than a preset threshold and whose content relevance is the highest as the target potential spoiler point information.
[0138] Optionally, the second identification module 403 is specifically configured to input the information to be identified and the target potential spoiler point information into a pre-trained spoiler identification model to obtain a recognition result output by the spoiler identification model, wherein the recognition result indicates whether the information to be identified contains spoilers.
[0139] Optionally, the spoiler identification model is trained in the following manner: obtaining second sample data, the second sample data including sample identification information, sample potential spoiler point information and sample annotation information, the sample annotation information indicating whether the sample identification information contains spoilers; inputting the sample identification information and the sample potential spoiler point information into the spoiler identification model to be trained, obtaining a sample identification result output by the spoiler identification model to be trained, the sample identification result indicating whether the sample identification information contains spoilers; after determining that the training is completed based on the sample identification result and the sample annotation information, the spoiler identification model is obtained.
[0140] In an embodiment of the present invention, by identifying potential spoiler point information of a target video based on content information of the target video, the potential spoiler point information can be added to the influencing factors of the video content, so that the potential spoiler point information is closely integrated with the video content and is more targeted; by selecting target potential spoiler point information that is located after the video progress corresponding to the information to be identified, the influencing factors of the video progress can be added, so that the target potential spoiler point information is located after the video progress corresponding to the information to be identified, which is more reasonable; therefore, the information to be identified and the target potential spoiler point information are compared and analyzed to identify whether the information to be identified contains spoilers, and the influencing factors of the video itself are added, thereby improving the accuracy and rationality of spoiler identification.
[0141] The embodiment of the present invention further provides an electronic device, such as Figure 5 As shown, it includes a processor 501 , a communication interface 502 , a memory 503 and a communication bus 504 , wherein the processor 501 , the communication interface 502 , and the memory 503 communicate with each other via the communication bus 504 .
[0142] Memory 503, used for storing computer programs;
[0143] The processor 501 is used to execute the program stored in the memory 503, and implements the following steps:
[0144] Based on the content information of the target video, identifying potential spoiler point information of the target video, and storing the potential spoiler point information of the target video, wherein the potential spoiler point information refers to content information that is spoiler;
[0145] Acquire the information to be identified of the target video, and select the target potential spoiler point information located after the video progress corresponding to the information to be identified from the stored potential spoiler point information of the target video;
[0146] According to the information to be identified and the target potential spoiler point information, it is identified whether the information to be identified contains spoilers.
[0147] Optionally, based on the content information of the target video, potential spoiler point information of the target video is identified, including: for each time period in the target video, based on the content information of the current time period, obtaining potential spoiler point information of the current time period; and determining the potential spoiler point information of each time period in the target video as the potential spoiler point information of the target video.
[0148] Optionally, based on the content information of the current time period, obtaining potential spoiler point information of the current time period includes: inputting the content information of the current time period into a pre-trained potential spoiler point recognition model to obtain the potential spoiler point information of the current time period output by the potential spoiler point recognition model.
[0149] Optionally, the potential spoiler point identification model is trained in the following manner: obtaining first sample data, the first sample data including sample content information and annotated potential spoiler point information corresponding to the sample content information; inputting the sample content information into the potential spoiler point identification model to be trained, and obtaining predicted potential spoiler point information output by the potential spoiler point identification model to be trained; after determining that the training is completed based on the predicted potential spoiler point information and the annotated potential spoiler point information, the potential spoiler point identification model is obtained.
[0150] Optionally, the content information includes at least one of plot information and dialogue information.
[0151] Optionally, the potential spoiler point information of the target video includes potential spoiler point information of each time period in the target video; selecting the target potential spoiler point information located after the video progress corresponding to the information to be identified includes: selecting the potential spoiler point information of the time period located after the video progress corresponding to the information to be identified as candidate potential spoiler point information; selecting the target potential spoiler point information from the candidate potential spoiler point information according to the content relevance between the candidate potential spoiler point information and the information to be identified.
[0152] Optionally, the information to be identified includes barrage information; selecting potential spoiler point information in a time period after the video progress corresponding to the information to be identified, including: obtaining the time point at which the barrage information appears in the target video; selecting potential spoiler point information in a time period after the time point.
[0153] Optionally, the information to be identified includes comment information; and potential spoiler point information of a time period after the video progress corresponding to the information to be identified is selected, including: when the target video is a video, obtaining potential spoiler point information of each time period in the target video; when the target video includes multiple episodes, selecting potential spoiler point information of each time period in the current episode corresponding to the comment information, and potential spoiler point information of each time period in subsequent episodes of the current episode.
[0154] Optionally, the target potential spoiler point information is selected from the candidate potential spoiler point information according to the content relevance between the candidate potential spoiler point information and the information to be identified, including: for each candidate potential spoiler point information, calculating the content relevance between the current candidate potential spoiler point information and the information to be identified; and from the candidate potential spoiler point information, selecting multiple candidate potential spoiler point information whose content relevance is greater than a preset threshold and has the highest content relevance as the target potential spoiler point information.
[0155] Optionally, identifying whether the information to be identified contains spoilers based on the information to be identified and the target potential spoiler point information includes: inputting the information to be identified and the target potential spoiler point information into a pre-trained spoiler identification model to obtain a recognition result output by the spoiler identification model, wherein the recognition result indicates whether the information to be identified contains spoilers.
[0156] Optionally, the spoiler identification model is trained in the following manner: obtaining second sample data, the second sample data including sample identification information, sample potential spoiler point information and sample annotation information, the sample annotation information indicating whether the sample identification information contains spoilers; inputting the sample identification information and the sample potential spoiler point information into the spoiler identification model to be trained, obtaining a sample identification result output by the spoiler identification model to be trained, the sample identification result indicating whether the sample identification information contains spoilers; after determining that the training is completed based on the sample identification result and the sample annotation information, the spoiler identification model is obtained.
[0157] 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.
[0158] The communication interface is used for communication between the above terminal and other devices.
[0159] 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.
[0160] 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.
[0161] In another embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium stores instructions. When the instructions are executed on a computer, the computer implements the spoiler identification method described in any of the above embodiments.
[0162] In yet another embodiment of the present invention, a computer program product comprising instructions is provided. When the computer program product is executed on a computer, the computer implements the spoiler identification method described in any one of the above embodiments.
[0163] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by 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 invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can 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 can be transmitted from a website site, computer, server or data center to another 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.). The computer-readable storage medium can 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 can 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 hard disk Solid State Disk (SSD)), etc.
[0164] 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.
[0165] 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.
[0166] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A spoiler identification method, characterized in that: include: Based on the content information of the target video, identifying potential spoiler point information of the target video, and storing the potential spoiler point information of the target video, wherein the potential spoiler point information refers to content information that is spoiler; Acquire the information to be identified of the target video, and select the target potential spoiler point information located after the video progress corresponding to the information to be identified from the stored potential spoiler point information of the target video; According to the information to be identified and the target potential spoiler point information, it is identified whether the information to be identified contains spoilers.
2. The method according to claim 1, characterized in that: Based on the content information of the target video, identify the potential spoiler information of the target video, including: For each time period in the target video, input content information of the current time period into a pre-trained potential spoiler point recognition model to obtain potential spoiler point information of the current time period output by the potential spoiler point recognition model; The potential spoiler point information of each time period in the target video is determined as the potential spoiler point information of the target video.
3. The method according to claim 2, characterized in that The potential spoiler point identification model is trained in the following way: Acquire first sample data, where the first sample data includes sample content information and annotated potential spoiler point information corresponding to the sample content information; Inputting the sample content information into a potential spoiler point recognition model to be trained, and obtaining predicted potential spoiler point information output by the potential spoiler point recognition model to be trained; After the training is completed based on the predicted potential spoiler point information and the labeled potential spoiler point information, the potential spoiler point identification model is obtained.
4. The method according to claim 1, characterized in that: The content information includes at least one of plot information and dialogue information.
5. The method according to claim 1, characterized in that The target video's potential spoiler point information includes the target video's potential spoiler point information for each time period; selecting the target potential spoiler point information located after the video progress corresponding to the information to be identified includes: Selecting potential spoiler point information in a time period after the progress of the video corresponding to the information to be identified as candidate potential spoiler point information; The target potential spoiler point information is selected from the candidate potential spoiler point information according to the content relevance between the candidate potential spoiler point information and the information to be identified.
6. The method according to claim 5, characterized in that The information to be identified includes bullet message information; Selecting potential spoiler point information in a time period after the progress of the video corresponding to the information to be identified includes: Obtain the time point at which the barrage information appears in the target video; The potential spoiler point information of the time period after the time point is selected.
7. The method according to claim 5, characterized in that The information to be identified includes comment information; Selecting potential spoiler point information in a time period after the progress of the video corresponding to the information to be identified includes: When the target video is a video, obtaining potential spoiler point information of each time period in the target video; When the target video includes multiple episodes, the potential spoiler point information of each time period in the current episode corresponding to the comment information and the potential spoiler point information of each time period in subsequent episodes of the current episode are selected.
8. The method according to claim 5, characterized in that Selecting the target potential spoiler point information from the candidate potential spoiler point information according to the content relevance between the candidate potential spoiler point information and the information to be identified includes: For each candidate potential spoiler point information, calculating the content relevance between the current candidate potential spoiler point information and the information to be identified; From the candidate potential spoiler point information, multiple candidate potential spoiler point information whose content relevance is greater than a preset threshold and whose content relevance is the highest are selected as the target potential spoiler point information.
9. The method according to claim 1, characterized in that: According to the information to be identified and the target potential spoiler point information, identifying whether the information to be identified contains spoilers includes: The information to be identified and the target potential spoiler point information are input into a pre-trained spoiler identification model to obtain a recognition result output by the spoiler identification model, wherein the recognition result indicates whether the information to be identified contains spoilers.
10. The method according to claim 9, characterized in that The spoiler detection model is trained in the following way: Acquire second sample data, where the second sample data includes sample identification information, sample potential spoiler point information, and sample annotation information, where the sample annotation information indicates whether the sample identification information contains spoilers; Inputting the sample identification information and the sample potential spoiler point information into a spoiler identification model to be trained, obtaining a sample identification result output by the spoiler identification model to be trained, wherein the sample identification result indicates whether there is a spoiler in the sample identification information; After the training is completed based on the sample recognition result and the sample annotation information, the spoiler recognition model is obtained.
11. A spoiler identification device, characterized in that: include: A first identification module is used to identify potential spoiler point information of the target video based on the content information of the target video, and store the potential spoiler point information of the target video, wherein the potential spoiler point information refers to content information that is spoiler; A selection module is used to obtain the information to be identified of the target video, and select the target potential spoiler point information located after the video progress corresponding to the information to be identified from the stored potential spoiler point information of the target video; The second identification module is used to identify whether the information to be identified contains spoilers according to the information to be identified and the target potential spoiler point information.
12. An electronic device, 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; A processor, for implementing the method according to any one of claims 1 to 10 when executing a program stored in a memory.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.
14. A computer program product having a computer program stored thereon, characterized in that: When the computer program is executed on a computer, the computer is enabled to implement the method according to any one of claims 1 to 10.