A multi-script differentiated imitation method and system
By performing structural analysis and circular geometric segmentation on the original video, time conservation constraints were constructed, solving the problem of structural deficiencies in AI script generation tools. This generated multiple imitation scripts aligned in the time dimension, ensuring the integrity and diversity of the narrative chain.
Patent Information
- Application Number
- CN202611360698.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-03
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2046-09-03
AI Technical Summary
Existing AI script generation tools cannot effectively identify and proportionally allocate the narrative logic structure of video scripts when generating multiple scripts, resulting in structural deficiencies in the scripts and affecting content quality and readability.
By performing structural analysis on the original video, time conservation constraints are constructed, and a circular geometric segmentation method is used to divide the area into fan-shaped regions to ensure that each imitation script has a complete narrative link on the timeline. Multiple imitation scripts are then generated using a large textual language model.
It achieves time-dimensional alignment between the imitation script and the original video, avoiding structural gaps, solving the problem of script duration discontinuity, and generating multiple scripts with different styles, thus solving the problem of homogenized output results.
Smart Images

Figure CN122864398B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a multi-script differentiated imitation method and system. Background Technology
[0002] With the increasing demand for large-scale production of short video content, creating multiple scripts based on a single original video has become a common scenario in content creation. However, existing AI script generation solutions have the following prominent shortcomings when handling such tasks: Specifically, a well-structured video script usually follows a logical narrative chain, namely a closed-loop structure of introducing the problem, developing the content, and summarizing and concluding. This requires the script to reasonably allocate different functional modules such as introduction, presentation of core content, and concluding guidance on the timeline.
[0003] However, most existing AI script generation tools are single-use tools, which cannot effectively identify and proportionally allocate the above-mentioned structural types when generating scripts, resulting in frequent structural gaps in the narrative logic of the generated scripts.
[0004] Typical issues include: the script's opening lacks setup and jumps directly into the core content, leaving the audience without necessary background knowledge; or the script's ending lacks a conclusion and summary, resulting in a broken narrative loop and an incomplete overall structure. These structural deficiencies affect the content quality and readability of the imitated scripts, limiting the effectiveness of AI-assisted script mass production in practical applications. Summary of the Invention
[0005] This invention provides a multi-script differentiated imitation method and system that can avoid the problem of narrative loop breakage caused by structural deficiencies.
[0006] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows: Firstly, a multi-script differentiated imitation method, the method comprising: The original video is acquired, and its structure is analyzed to obtain the original video storyboard. The original video storyboard contains the structural type, visuals, subtitles, narration, and sound effects fields divided by time. Based on the script duration of the original video storyboard, obtain the time conservation constraint. The time conservation constraint requires that the sum of the durations of each storyboard in each imitation script is equal to the script duration, and that the timeline is continuous without jumps. Construct a circle with the script duration as its circumference; divide the circle into multiple sector areas according to a preset central angle ratio, and the sum of the central angles of each sector area equals the circumference angle; allocate the duration according to the arc length corresponding to each sector area, and each sector area is respectively assigned to the pain point preparation structure, the solution and selling point structure, and the conversion guidance structure. Based on the original video storyboard, time conservation constraints, and the sector segmentation allocation scheme of the circle, construct imitation prompt words; Input the copy prompt words into the text large language model to obtain multiple copy scripts.
[0007] Secondly, a multi-script differentiated imitation system includes: The video structure analysis module is used to acquire the original video, perform video structure analysis on the original video, and obtain the original video storyboard. The original video storyboard contains the structure type, screen, subtitles, narration and sound effects fields divided by time segment. The constraint acquisition module is used to obtain time conservation constraints based on the script duration of the original video storyboard. The time conservation constraints require that the sum of the time of each storyboard in each imitation script is equal to the script duration, and that the timeline is continuous without jumps. The geometric segmentation module is used to construct a circle with the script duration as its circumference; divide the circle into multiple sector regions according to a preset central angle ratio, and the sum of the central angles of each sector region is equal to the circumference angle; allocate the duration according to the arc length corresponding to each sector region, and each sector region is respectively assigned to the pain point preparation structure, the solution and selling point structure, and the conversion guidance structure. The prompt word construction module is used to construct imitation prompt words based on the original video storyboard, time conservation constraints, and the circular sector segmentation allocation scheme; The parody generation module is used to input parody prompts into a large text language model and obtain multiple parody scripts.
[0008] The above-described solution of the present invention has at least the following beneficial effects: By applying the time conservation constraint, the sum of the times of each scene in each imitation script is required to equal the script duration, and the timeline must be continuous without jumps. This ensures that the imitation script is aligned with the original video in the time dimension, solving the problem of script duration being disconnected and uncontrollable in existing solutions.
[0009] Construct a circle with the script duration as its circumference, and divide it into sector areas corresponding to the pain point preparation structure, the solution and selling point structure, and the conversion guidance structure according to the preset central angle ratio. Allocate the duration according to the arc length of each sector area to ensure that each imitation script has a complete marketing narrative chain; first establish the demand, then provide the solution, and finally promote action to avoid the problem of marketing loop breakage caused by structural deficiencies.
[0010] Based on the original video storyboard, time conservation constraints, and a circular sector segmentation allocation scheme, imitation prompts are constructed. Multiple imitation scripts are generated in batches through a large text language model, enabling the same original video to produce multiple scripts with different styles, effectively solving the problem of homogenized output results. Attached Figure Description
[0011] Figure 1 This is a flowchart illustrating a multi-script differentiated imitation method provided by an embodiment of the present invention.
[0012] Figure 2 This is a schematic diagram of a multi-script differentiated imitation system provided by an embodiment of the present invention.
[0013] Figure 3 This is a schematic diagram of the process for obtaining the original video storyboard script provided by an embodiment of the present invention. Detailed Implementation
[0014] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0015] This embodiment provides a multi-script differentiated imitation method, such as... Figure 1 As shown, the method includes the following steps: Step S101: Obtain the original video, perform video structure analysis on the original video, and obtain the original video storyboard.
[0016] The original video storyboard includes time-segmented structure types, visuals, subtitles, narration, and sound effects. The original video is user-uploaded video footage, and the video format can be common formats such as MP4, AVI, and MOV. The original video length is generally between 15 and 180 seconds, covering the typical length range for short video content creation. The goal of video structure analysis is to extract standardized storyboards from the original video, providing a structured reference for subsequent storyboard generation.
[0017] Specifically, such as Figure 3 As shown, step S101 involves performing video structure analysis on the original video to obtain the original video storyboard, which includes the following sub-steps: Step S1011: Separate the audio track from the original video to obtain the audio track and the video track.
[0018] FFmpeg is used to demultiplex the original video file, separating the audio and video streams into independent audio and video tracks. The audio track is stored in WAV format with a sampling rate of 16kHz, a sampling precision of 16bit, and mono. The video track is extracted as a frame sequence, with the frame rate being the original video's frame rate, typically 24fps, 25fps, or 30fps. After separation, the audio and video tracks are fed into different processing pipelines for parallel processing to improve overall processing efficiency.
[0019] Step S1012: Perform speech recognition on the audio track, convert the speech signal into text, obtain the narration field, and record the start and end timestamps corresponding to each narration text.
[0020] Speech recognition employs an automatic speech recognition model based on deep neural networks, such as the Whisper or Paraformer model. The audio track is segmented using a fixed-length sliding window (30 seconds in length, 10-second increments). Each audio segment is fed into the speech recognition model for inference, outputting the corresponding text sequence and timestamps at the word level. The consecutively recognized text segments are concatenated according to their timestamps to obtain the complete narration text sequence. The timestamps are accurate to the millisecond level, with the start and end timestamps recorded based on the original video's timeline. Segments with a confidence level below a preset threshold are marked in the narration field for subsequent manual review. The preset threshold can be set to 0.7.
[0021] Step S1013: Sample the video track at a preset frame sampling interval to obtain a sampled frame sequence. Perform optical character recognition on each sampled frame, extract the text information in the picture as a subtitle field, and record the frame timestamp corresponding to each subtitle.
[0022] The preset frame sampling interval is dynamically determined based on the actual frame rate of the video. For a video with a frame rate of 24fps, the preset frame sampling interval is 12 frames, that is, one frame is sampled every 0.5 seconds. For a video with a frame rate of 30fps, the preset frame sampling interval is 15 frames, maintaining the sampling frequency of one frame every 0.5 seconds. The sampled keyframes are stored in image format, with the resolution maintaining the resolution of the original video. Optical character recognition uses a deep learning-based OCR model, such as PaddleOCR or TesseractOCR, to perform text region detection and text content recognition on each sampled frame. The recognized text information includes the text content, the position coordinates of the text in the image, and the frame timestamp corresponding to the text. In the case of recognizing the same text content in multiple consecutive frames, the start and end timestamps of the text content are merged to form a complete subtitle record.
[0023] Step S1014: Perform audio event detection on the audio track, identify non-speech audio events, and record the identified audio event types and start and end times as sound effect fields.
[0024] Audio event detection employs a convolutional neural network-based audio classification model, such as the PANNs or VGGish models. Audio tracks are detected using a fixed-length window (960 milliseconds) with a stride of 480 milliseconds. Mel-spectral features are extracted for each window and fed into the classification model, outputting the probability distribution of the audio event type corresponding to that window. Recognizable audio event types include, but are not limited to: background music, applause, laughter, explosions, transition effects, cue sounds, and ambient sounds. The classification results are temporally smoothed, merging consecutive and identical event types to obtain a type label and start / end timestamps for each audio event. For multiple audio events that overlap temporally, they are sorted by confidence level from highest to lowest, retaining the top three event types with the highest confidence.
[0025] Step S1015: Align the narration field, subtitle field, and sound effect field according to the timestamp to construct a timeline.
[0026] The timeline is constructed using a unified time axis reference, with the start time of the original video as the zero point. The narration field obtained in step S1012, the subtitle field obtained in step S1013, and the sound effect field obtained in step S1014 are mapped onto the same time axis according to their respective timestamp information. The timeline data structure is a list sorted by time. Each element in the list contains time period information and the combination of narration text, subtitle text, and sound effect types appearing within that time period. For blank intervals on the timeline, i.e., intervals with neither narration, subtitles, nor sound effects, they are marked as silent segments. For intervals on the timeline with overlapping information, they are aligned according to the timestamp precision, preserving complete overlapping information.
[0027] Step S1016: Perform semantic boundary detection on the text of the narration field, identify semantic turning points and topic switching points, and use the semantic turning points and topic switching points as the boundaries for scene segmentation.
[0028] Semantic boundary detection employs text segmentation algorithms based on pre-trained language models, such as the TextTiling algorithm or a BERT-based text segmentation model. The complete text sequence of the narration field is input into the text segmentation model. The model calculates the semantic similarity between adjacent sentences or text blocks, identifying locations where the similarity significantly decreases as semantic inflection points. Simultaneously, a topic-based model, such as the LDA model, is used to model the narration text by topic, detecting locations where the topic distribution changes significantly as topic switching points. Semantic inflection points and topic switching points are merged as candidate scene segmentation boundaries. To control the granularity of scene segmentation, the following constraints apply: the duration of a single scene segment is no less than 2 seconds and no more than 8 seconds. If the interval between candidate boundaries is less than 2 seconds, adjacent segments are merged; if the interval between candidate boundaries is greater than 8 seconds, additional segmentation boundaries are inserted within the interval at a fixed step size, which can be set to 5 seconds.
[0029] Step S1017: Divide the timeline into multiple storyboard segments according to the storyboard segmentation boundaries, label each storyboard segment with a structure type label, and generate the original video storyboard script.
[0030] The structural type tags include pain point introduction structure, solution and selling point structure, and conversion guidance structure. Among them, the pain point introduction structure corresponds to the problem introduction stage in the video script's narrative logic, the solution and selling point structure corresponds to the content development stage, and the conversion guidance structure corresponds to the summary and conclusion stage.
[0031] Based on the scene segmentation boundaries determined in step S1016, the timeline constructed in step S1015 is divided into multiple scene segments; each scene segment contains the scene description, subtitle text, narration text, and sound effect information within that time period; for each scene segment, a pre-trained multimodal large language model, such as the Qwen-VL model, is invoked to perform structure type recognition; the input of the multimodal large language model includes the video frame image, narration text, and subtitle text corresponding to the scene segment, and the output is the structure type label corresponding to that scene segment.
[0032] The following priority rules are used to determine the structural type label: When a storyboard segment simultaneously satisfies the characteristics of multiple structural types, the unique structural type label is determined in the following order: pain point introduction structure takes precedence over solution and selling point structure, and solution and selling point structure takes precedence over conversion guidance structure. The priority rules are based on the following: In the narrative logic of the video script, pain point introduction usually appears at the beginning of the script, solution and selling point appear in the middle, and conversion guidance appears at the end; when a storyboard segment contains multiple structural features, such as both pain point descriptions and mentions of solutions, a unique label should be determined based on its position and main function in the script; when both position and function are unclear, the above priority order is used to ensure the consistency and reproducibility of structural labeling.
[0033] Arrange all storyboard segments labeled with structural type in chronological order to generate the original video storyboard script.
[0034] Step S102: Obtain the time conservation constraints based on the script duration of the original video storyboard.
[0035] The time conservation constraint requires that the sum of the times of each scene in each script imitation must equal the script duration, and that the timeline must be continuous without jumps.
[0036] The script duration refers to the total duration of the original video storyboard, which is the duration of the original video. The script duration is extracted by scanning the timestamps of all storyboard segments in the original video storyboard, using regular expressions to extract the start and end times of each storyboard segment, and taking the end time of the last storyboard segment as the script duration.
[0037] The time conservation constraints include the following two layers of rigid constraints: The first constraint is that the sum of the times of each scene is equal to the script duration; that is, for any imitation script, the durations of all its scene segments are added together, and the sum is equal to the script duration of the original video, i.e., the total duration is equal.
[0038] The second constraint is that the timeline is continuous without jumps; that is, there are no time gaps or time overlaps between adjacent storyboard segments in the script; the end time of the previous storyboard segment is equal to the start time of the next storyboard segment.
[0039] Step S103: Construct a circle with the script duration as its circumference; divide the circle into multiple sector areas according to the preset central angle ratio, and the sum of the central angles of each sector area is equal to the full circle angle (i.e., 360 degrees); allocate the duration according to the arc length corresponding to each sector area, and each sector area is respectively assigned to the pain point preparation structure, the solution and selling point structure, and the conversion guidance structure.
[0040] Step S103 maps the script duration to the circumference of a circle, utilizing the geometric properties of the circle to achieve precise allocation of structural proportions; the preset central angle ratio is the proportional relationship between the central angles of each sector region. This proportional relationship can be automatically extracted through structural analysis of the original video, or it can be manually set by the user according to actual needs; when using the automatic extraction method, the steps for determining the preset central angle ratio are as follows: Step S1031: Extract the structure type tags corresponding to each scene in the original video storyboard.
[0041] Extract the structure type label and duration information corresponding to each segment from the original video storyboard generated in step S101; the duration information is extracted by subtracting the start time from the end time of the segment to obtain the duration of the segment.
[0042] Step S1032: Sum the duration of each scene belonging to the pain point preparation structure to obtain the total duration of the pain point preparation structure; sum the duration of each scene belonging to the solution and selling point structure to obtain the total duration of the solution and selling point structure; sum the duration of each scene belonging to the conversion guidance structure to obtain the total duration of the conversion guidance structure.
[0043] Based on the structure type tags and duration information extracted in step S1031, the segments are grouped and accumulated according to structure type. All segments in the original video storyboard are traversed. If the structure type tag of the segment is a pain point preparation structure, its duration is added to the total duration of the pain point preparation structure. If it is a solution and selling point structure, it is added to the total duration of the solution and selling point structure. If it is a conversion guidance structure, it is added to the total duration of the conversion guidance structure.
[0044] Step S1033: Sum the total duration of the pain point preparation structure, the total duration of the solution and selling point structure, and the total duration of the conversion guidance structure to obtain the script duration.
[0045] The script duration is consistent with the script duration extracted by regular expression in step S102. The two can be mutually verified to ensure the accuracy of the duration data.
[0046] Step S1034: Calculate the first percentage of the total time of the pain point preparation structure to the total script time, the second percentage of the total time of the solution and selling point structure to the total script time, and the third percentage of the total time of the conversion guidance structure to the total script time.
[0047] Divide the total time of the pain point preparation structure by the script duration to get the first percentage; divide the total time of the solution and selling point structure by the script duration to get the second percentage; divide the total time of the conversion guidance structure by the script duration to get the third percentage; the sum of the first, second, and third percentages equals 1.
[0048] Step S1035: Multiply the first proportion by a full circle (i.e., 360 degrees) to obtain the first central angle value; multiply the second proportion by a full circle to obtain the second central angle value; multiply the third proportion by a full circle to obtain the third central angle value. The sum of the first, second, and third central angle values equals a full circle. The ratio formed by the first, second, and third central angle values is used as the preset central angle ratio.
[0049] After determining the preset central angle ratio, the specific calculation steps for constructing the circle and dividing the sector region in step S103 are as follows: The script duration is used as the circumference of the circle; the circumference is divided by 2π to obtain the radius of the circle; here, 2π is the radian value corresponding to the full circle angle; a polar coordinate system is established with the center of the circle as the origin, and the horizontal rightward direction (0 degrees) is taken as the starting angle; the full circle angle (i.e., 360 degrees) is divided according to a preset central angle ratio to obtain the central angle angle values corresponding to multiple sector regions. The central angle angle value of each sector region corresponds one-to-one with the preset central angle ratio, and the sum of the central angle angle values of all sector regions equals the full circle angle.
[0050] For each sector, perform the following calculation: Multiply the central angle value of the sector by π and divide by 180 to obtain the central angle radian value of the sector; multiply the central angle radian value by the radius to obtain the arc length of the sector; use the arc length value directly as the allocation time for the corresponding structure type of the sector; the sum of the arc lengths of all sectors equals the circumference of the circle, which is also equal to the script duration; each sector is assigned to one of three structure types: the first sector is assigned to the pain point introduction structure, the second sector is assigned to the solution and selling point structure, and the third sector is assigned to the conversion guidance structure; the order of the sector arrangement is consistent with the narrative order of the script, that is, pain point introduction first, then solution and selling point, and finally conversion guidance.
[0051] In this embodiment, step S103 divides the circle into multiple sector regions according to a preset central angle ratio, and also includes a dynamic adjustment step; the dynamic adjustment step uses emotional intensity scoring to weight and correct the preset central angle ratio, so that the structural allocation ratio not only reflects the time distribution of the original video, but also reflects the emotional fluctuations of the original video; the dynamic adjustment step includes: Step S103A: Obtain the emotional intensity score of each shot in the original video storyboard script. The emotional intensity score is obtained by performing sentiment analysis on the narration field corresponding to the shot.
[0052] The sentiment analysis model is constructed using a fine-tuning approach based on a pre-trained language model, and the training process is as follows: A text dataset labeled with two dimensions: emotional valence and emotional arousal. Each sample in the dataset contains a text segment and two labeled values: an emotional valence value (ranging from -1.0 to +1.0) and an emotional arousal value (ranging from 0 to 1.0). Annotators assigned ratings for the emotional valence dimension from extremely negative to extremely positive, and for the emotional arousal dimension from extremely calm to extremely agitated, based on the text content. The dataset was divided into training, validation, and test sets according to a predetermined ratio. This predetermined ratio was determined based on the dataset size, typically with the training set having the largest proportion and the validation and test sets having roughly equal proportions, ensuring that the model was adequately trained while having sufficient samples for validation and testing.
[0053] Using a pre-trained language model (e.g., BERT-base-chinese or RoBERTa-base-chinese) as the backbone network, two independent fully connected regression heads are connected in parallel after the sentence vector output by the backbone network (i.e., the hidden state vector corresponding to the CLS marker at the beginning of the sequence). The first regression head is used to predict the sentiment valence score. This regression head contains a fully connected layer with an input dimension equal to the dimension of the backbone network's hidden state vector and an output dimension of 1. The activation function is the hyperbolic tangent function (tanh), which maps the output value to between -1.0 and +1.0. The second regression head is used to predict the sentiment arousal score. This regression head also contains a fully connected layer with an input dimension equal to the dimension of the backbone network's hidden state vector and an output dimension of 1. The activation function is the sigmoid function, which maps the output value to between 0 and 1.0.
[0054] During training, the mean squared error loss function is used, and the model learns to predict both dimensions simultaneously by minimizing the total loss. The optimizer is AdamW, and the initial learning rate is determined based on the size of the pre-trained model and the dataset, set within a small range to ensure training stability. The number of training epochs is determined based on the performance on the validation set. By monitoring the validation set loss or evaluation metrics, training stops when the validation set performance no longer improves to prevent overfitting. The batch size is determined based on available hardware resources (such as GPU memory size), and a larger batch size is chosen whenever resources allow to stabilize training. A learning rate warm-up strategy is adopted, with the warm-up steps accounting for a portion of the initial training. During the warm-up period, the learning rate linearly increases from zero or a small value to the initial learning rate. After the warm-up, the learning rate gradually decreases to near zero according to a preset decay strategy (such as linear decay or cosine decay).
[0055] After each training epoch, the model performance is evaluated on the validation set. The mean absolute error between the predicted emotional valence and the labeled value, and the mean absolute error between the predicted emotional arousal and the labeled value are calculated separately. The two mean absolute errors are added together to obtain the comprehensive error. The model parameters corresponding to the training epoch with the smallest comprehensive error are selected as the final model parameters, and the model is saved for subsequent inference. If the comprehensive error no longer decreases in multiple consecutive training epochs, early stopping is triggered to terminate training.
[0056] The input to the sentiment analysis model is the text content of the narration field corresponding to each segment in the original video storyboard. Before input, the text is preprocessed, that is, special characters and extra spaces are removed from the text, the text is truncated or padded to the maximum length supported by the model, and start tokens (CLS) and end tokens (SEP) are added to the beginning and end of the text, respectively. If the text length exceeds the maximum length, the first few tokens are truncated to the maximum length; if the text length is insufficient, special padding tokens are added to the end to the maximum length.
[0057] The preprocessed text sequence is input into the sentiment analysis model, and the processing procedure is as follows: The text sequence is processed through the embedding layer of a pre-trained language model. The embedding layer maps each token in the text sequence to a corresponding word vector, adds positional encoding based on the position of each token in the sequence, and adds segmentation encoding based on the sentence to which the token belongs. The word vector, positional encoding, and segmentation encoding are added together to obtain the input representation vector of each token. The input representation vector of the entire sequence forms a matrix with dimensions equal to the sequence length multiplied by the dimension of the hidden state.
[0058] The input representation vector sequence is processed by a multi-layer Transformer encoder of a pre-trained language model. Each Transformer encoder layer contains two sub-layers: a multi-head self-attention mechanism and a feedforward neural network. In the multi-head self-attention mechanism, the input vector is transformed linearly to generate a query vector, a key vector, and a value vector. Attention weights are calculated by the dot product of the query vector and the key vector, and then weighted and summed with the value vector to obtain the context representation vector of each token. Attention calculation is performed in parallel in multiple attention heads, and the results of each head are concatenated and transformed linearly to obtain the multi-head attention output. This output is added to the input (residual connection), then normalized, and then fed into the feedforward neural network for non-linear transformation. Residual connections and layer normalization are performed again to obtain the output of this layer. After layer-by-layer processing by the multi-layer Transformer encoder, the hidden state vector corresponding to the CLS token at the beginning of the sequence is taken as the sentence vector representation of the entire text. This sentence vector integrates the semantic information of all tokens in the text.
[0059] The sentence vector is fed into two regression heads simultaneously. In the emotion valence regression head, the sentence vector passes through a fully connected layer, outputting a scalar value, which is then passed through a hyperbolic tangent activation function to map the output value to the range of -1.0 to 1.0, thus obtaining the emotion valence score. In the emotion arousal regression head, the sentence vector passes through another fully connected layer, outputting a scalar value, which is then passed through a sigmoid activation function to map the output value to the range of 0 to 1.0, thus obtaining the emotion arousal score.
[0060] The sentiment analysis model outputs two values: a sentiment valence score, a floating-point number between -1.0 and +1.0, representing the degree of the text's emotion from negative to positive; and a sentiment arousal score, a floating-point number between 0 and 1.0, representing the degree of the text's emotion from calm to agitated. These two output values are passed to subsequent steps to calculate the sentiment intensity score.
[0061] The emotional intensity score is calculated as follows: the absolute value of the emotional valence score is taken to obtain the valence intensity; the valence intensity is multiplied by a first weighting coefficient to obtain the first component; the emotional arousal score is multiplied by a second weighting coefficient to obtain the second component; and the first and second components are added together to obtain the emotional intensity score, which ranges from 0 to 1.0. The values of the first and second weighting coefficients are based on the following considerations: in video scripts, emotional valence (the intensity of positive or negative emotions) usually has a greater impact on the audience's emotional experience than emotional arousal (the degree of calmness or excitement), therefore, the weight of valence intensity is slightly higher than that of arousal. The first weighting coefficient is set to 0.6, the second weighting coefficient is set to 0.4, and the sum of the two is 1. This weighting coefficient can be adjusted according to the actual application scenario; the emotional intensity score ranges from 0 to 1.0.
[0062] Step S103B: Calculate the average emotional intensity score of each scene corresponding to the pain point preparation structure, the solution and selling point structure, and the conversion guidance structure, to obtain the average emotional score of the pain point preparation, the solution and selling point, and the conversion guidance.
[0063] For the pain point setup structure, the emotional intensity scores of all scenes belonging to this structure are summed and divided by the number of scenes belonging to this structure to obtain the average emotional score for the pain point setup. For the solution and selling point structure, the emotional intensity scores of all scenes belonging to this structure are summed and divided by the number of scenes belonging to this structure to obtain the average emotional score for the solution and selling point. For the conversion guidance structure, the emotional intensity scores of all scenes belonging to this structure are summed and divided by the number of scenes belonging to this structure to obtain the average emotional score for the conversion guidance.
[0064] Step S103C: Normalize the average emotional values of pain point preparation, solution and selling point, and conversion guidance to obtain an emotional weight vector; the specific calculation steps for normalization are as follows: The average emotional values of pain point preparation, solution and selling point, and conversion guidance are added together to obtain the total emotional value. The average emotional value of pain point preparation is divided by the total emotional value to obtain the first emotional weight. The average emotional value of solution and selling point is divided by the total emotional value to obtain the second emotional weight. The average emotional value of conversion guidance is divided by the total emotional value to obtain the third emotional weight. The sum of the first, second, and third emotional weights equals 1, and the three constitute the emotional weight vector.
[0065] Step S103D: The emotion weight vector is weighted and fused with a preset central angle ratio to obtain an adjusted central angle ratio. The sector region of the circle is then redefined based on the adjusted central angle ratio. The specific calculation steps for the weighted fusion are as follows: A fusion coefficient is set, with a value ranging from 0 to 1. The value of the fusion coefficient determines the relative importance of the preset central angle ratio and the emotion weight in the final result. When the fusion coefficient is 1, the preset central angle ratio is used entirely; when the fusion coefficient is 0, the emotion weight is used entirely. In this embodiment, the fusion coefficient is 0.5. The proportions corresponding to each structural type in the preset central angle ratio are respectively recorded as the original first proportion, the original second proportion, and the original third proportion. The original first proportion, the original second proportion, and the original third proportion are calculated by step S1034. Each element in the emotion weight vector is respectively recorded as the first emotion weight, the second emotion weight, and the third emotion weight.
[0066] For the pain point groundwork structure: multiply the fusion coefficient by the original first proportion to obtain the first fusion term; multiply the difference between 1 and the fusion coefficient by the first emotion weight to obtain the second fusion term; add the first fusion term and the second fusion term to obtain the adjusted first proportion.
[0067] For the scheme and selling point structure: multiply the integration coefficient by the original second proportion to obtain the third integration item; multiply the difference between 1 and the integration coefficient by the second sentiment weight to obtain the fourth integration item; add the third integration item and the fourth integration item to obtain the adjusted second proportion.
[0068] For the transformation guidance structure: multiply the fusion coefficient by the original third proportion to obtain the fifth fusion term; multiply the difference between 1 and the fusion coefficient by the third emotion weight to obtain the sixth fusion term; add the fifth fusion term and the sixth fusion term to obtain the adjusted third proportion.
[0069] Verify that the sum of the adjusted first proportion, second proportion, and third proportion equals 1. If not, normalize the three proportions by dividing each by the sum of the three proportions. Multiply the adjusted first proportion by a full circle (360 degrees) to obtain the adjusted first central angle. Multiply the adjusted second proportion by a full circle to obtain the adjusted second central angle. Multiply the adjusted third proportion by a full circle to obtain the adjusted third central angle. The sum of the three adjusted central angles equals a full circle. Re-divide the circular sector based on the adjusted central angle values. The calculation method for the allocation duration corresponding to each sector area is as follows: multiply the central angle value of the sector area by π and then divide by 180 to obtain the radian value. Multiply the radian value by the radius to obtain the arc length. The arc length value is the allocation duration for this structure type. The above dynamic adjustment steps, through emotional intensity scoring, enable the circular sector segmentation allocation scheme to not only reflect the structural proportion of the original video, but also capture the emotional rhythm characteristics of the original video, thereby generating a paraphrased script that is more in line with the emotional fluctuations of the content itself in terms of structural allocation.
[0070] To further clarify the geometric calculation process of circle construction and arc length mapping, step S103 also includes the following steps: Step S103E: Using the script duration as the circumference of the circle, calculate the radius of the circle using the relationship between circumference and radius; using the script duration as the circumference of the circle; divide the circumference by 2π to obtain the radius of the circle. Here, 2π is the radian value corresponding to a full circle.
[0071] Step S103F: Establish a polar coordinate system with the center of the circle as the origin. In the polar coordinate system, starting from the initial angle, determine the boundary angles of each sector area sequentially according to the adjusted central angle ratio. Establish a polar coordinate system with the center of the circle as the pole and the horizontal rightward direction as the positive polar axis. Set the initial angle to 0 degrees, i.e., the polar axis direction. Determine the boundary angles of each sector area sequentially according to the adjusted central angle ratio, starting from the initial angle. The first sector area corresponds to the pain point preparation structure, with an initial angle of 0 degrees and an ending angle equal to the adjusted first central angle value. The second sector area corresponds to the solution and selling point structure, with an initial angle equal to the ending angle of the first sector area and an ending angle equal to the initial angle plus the adjusted second central angle value. The third sector area corresponds to the conversion guidance structure, with an initial angle equal to the ending angle of the second sector area and an ending angle equal to the initial angle plus the adjusted third central angle value. The ending angle of the third sector area equals a full circle (i.e., 360 degrees), returning to the initial angle position to form a complete circle.
[0072] Step S103G: Convert the central angle of each sector region to radian values, calculate the arc length of each sector region, and directly map the arc length to the allocation duration of the corresponding structure; for each sector region, multiply its central angle value by π and divide by 180 to obtain the radian value of the central angle of that sector region; add the radian values of the central angles of each sector region, and the sum is equal to 2π, satisfying the constraint that the sum of radians equals the radian of the full circle; for each sector region, multiply its central angle radian value by the radius to obtain the arc length of that sector region; use the arc length value directly as the allocation duration of the corresponding structure type of that sector region, and the allocation duration value is equal to the arc length value; add the arc lengths of each sector region, and the sum is equal to the circumference of the circle, which is also equal to the script duration, satisfying the time conservation constraint.
[0073] By establishing the above geometric model, a circle is constructed with the script duration as its circumference. In the polar coordinate system, sector regions are divided according to the proportion of the central angle. The allocated duration is obtained by calculating the arc length, thus realizing the visualization and precision of the structure duration allocation. The circumference of the circle is a constant value, which naturally ensures that the sum of the arc lengths equals the total duration, equivalent to the time conservation constraint. The proportion of the central angle intuitively reflects the proportion of each structure in the whole, which is easy to understand and adjust. The mathematical relationship between the arc length, the central angle, and the radius ensures the accuracy and reproducibility of the allocation calculation.
[0074] Step S104: Based on the original video storyboard, time conservation constraints, and the circular sector segmentation allocation scheme, construct the imitation prompt words.
[0075] The imitation prompts are natural language instructions for the input text big language model. The construction process is to transform the structured information of the original video storyboard, the rigid requirements of the time conservation constraints, and the duration allocation results of the circular sector segmentation allocation scheme into text instructions that the text big language model can understand and execute.
[0076] Step S104 involves constructing the imitation prompt words, including the following steps: Step S1041: Based on the sector segmentation and allocation scheme of the circle, extract the structure type and allocation duration corresponding to each sector region, and generate a structure duration constraint table. The structure duration constraint table includes a structure type field, an allocation duration field, and a structure order field.
[0077] Based on the results of the sector-based allocation scheme in step S103, the structure type, allocation duration, and sector order corresponding to each sector are extracted to construct a structure duration constraint table. The structure duration constraint table contains three rows: the first row corresponds to the first sector, with a structure type of "pain point preparation structure" and a structure order of 1; the second row corresponds to the second sector, with a structure type of "solution and selling point structure" and a structure order of 2; and the third row corresponds to the third sector, with a structure type of "conversion guidance structure" and a structure order of 3. The allocation duration field in each row is filled with the arc length value corresponding to that sector. The structure duration constraint table is stored in structured data format for easy programmatic processing and conversion; the allocation duration is retained to two decimal places to balance precision and readability. In practical applications, the allocation duration can be rounded to an integer number of seconds as needed, but the total duration after rounding must still equal the script duration.
[0078] Step S1042: Convert the structure duration constraint table into a natural language description of the structure constraint text.
[0079] The structural constraint text transforms the structured data in the structural duration constraint table into narrative instructions understandable by the text-based large language model. The structural constraint text is generated by filling in the structure type, structure order, and allocated duration of each row in the structural duration constraint table according to a pre-defined narrative template. The structural constraint text should explicitly require the script to unfold in the following order: pain point introduction structure, solution and selling point structure, and conversion guidance structure. The duration of each structure must equal its corresponding allocated duration, and the structures must be unfolded strictly in sequence, without cross-structure mixing or omission of any structure.
[0080] Step S1043: Extract core keywords and prohibited words from the original video storyboard and generate content constraint text.
[0081] Core keywords refer to words that appear repeatedly in the original video storyboard and are closely related to the theme. The extraction method for core keywords is as follows: The text of the narration and subtitle fields of all storyboard segments in the original video storyboard is concatenated to obtain the full text; the full text is then segmented into words, and stop words are removed. The weight score of each word is calculated using the TF-IDF algorithm or a keyword extraction algorithm based on a pre-trained language model; the words are then sorted from highest to lowest weight score, and the top-ranking words are selected as core keywords. Prohibited words refer to specific brand names, product models, or proper nouns appearing in the original video. These should be avoided in the imitation script to increase the differentiation and originality of the imitation script. Prohibited words are determined through a pre-set prohibited word dictionary matching or manual annotation.
[0082] The content constraint text is generated by filling in the extracted core keywords and prohibited words according to the preset template. The imitation script revolves around the core keywords and avoids using prohibited words. At the same time, the theme of the imitation script is required to be consistent with the original video, but the specific expression and wording should be changed.
[0083] The rules for filling the keyword list are as follows: Sort the core keywords extracted in step S1043 according to their weight scores from highest to lowest. Select a preset number of keywords with the highest ranking. The preset number can be determined according to actual needs, usually 5 to 8, to ensure that the keyword set covers the core content of the theme without being too redundant. Separate the selected keywords with Chinese commas "、" and fill them into the "{keyword list}" placeholder in the template. When filling, list the keywords in descending order of weight scores, separating each keyword with a comma, and do not add a comma after the last keyword. For example, if the extracted core keywords are "time management, task, priority, efficiency, schedule, to-do", and the weight scores are sorted from highest to lowest as "time management, efficiency, task, priority, schedule, to-do", then the filled result will be "time management, efficiency, task, priority, schedule, to-do".
[0084] Rules for filling the banned word list: Separate the prohibited words identified in step S1043 with Chinese commas "、" and fill them into the "{Prohibited Word List}" placeholder in the template; list the prohibited words in the order they appear in the original video. If the prohibited word list is empty (i.e., no prohibited words appear in the original video), replace the line with "There are no specific prohibited word restrictions for this imitation."; if there is only one prohibited word, fill in the word directly without adding a separator; if there are multiple prohibited words, separate each prohibited word with a comma, and do not add a comma after the last prohibited word.
[0085] Step S1044: Combine the structural constraint text, content constraint text, and time conservation constraint conditions, and add differentiated style instructions to generate multiple different imitation prompts, each corresponding to a different language style or narrative perspective.
[0086] The structural constraint text generated in step S1042, the content constraint text generated in step S1043, and the time conservation constraint condition in step S102 are combined to form the main body of the imitation prompt. The combination method is to splice them in sequence: first place the character setting text, then place the reference material text, then place the structural constraint text, then place the content constraint text, then place the time conservation constraint condition text, and finally place the output format requirement text.
[0087] Based on the main body, differentiated style instructions are added to generate multiple different imitation prompts. Style instructions include: please narrate from a first-person perspective with a friendly and approachable style; or please narrate from a third-person perspective with a professional and rigorous style; or please present it as a situational dialogue, developing the content through the conversation between two characters. Combining the main body with different style instructions yields multiple different imitation prompts, each corresponding to a different language style or narrative perspective. Upon receiving imitation prompts of different styles, the text-based large language model will generate imitation scripts with varying styles while maintaining structural and time constraints, thus achieving differentiated output across multiple scripts.
[0088] Step S105: Input the imitation prompts into the text large language model to obtain multiple imitation scripts.
[0089] The text-based large language model employs a large language model with strong text generation capabilities. The imitation prompt words are taken as input and sent to the inference interface of the text-based large language model. The model generates the corresponding imitation script based on the various constraints and reference materials in the imitation prompt words.
[0090] In step S105, the imitation prompt words are input into the text large language model to obtain multiple imitation scripts, including the following steps: Step S1051: Input multiple different imitation prompts into the text large language model in batches, with each imitation prompt corresponding to an independent inference request.
[0091] The large language model used in this embodiment is a large language model that has been pre-trained and then fine-tuned by instructions; the training of this type of model is divided into two stages: pre-training and instruction fine-tuning.
[0092] Pre-training phase: The pre-training phase involves self-supervised learning on a large-scale text corpus. The training corpus covers text data from various sources, including web pages, books, news, forum discussions, and encyclopedia entries. After data cleaning (removing HTML tags, advertisements, low-quality content, and duplicate content), deduplication (detecting and removing nearly duplicate documents based on locality-sensitive hashing or MinHash algorithms), and quality filtering (filtering low-quality text based on metrics such as text length, lexical richness, and language model perplexity), a training dataset with a scale of billions to trillions of tokens is constructed.
[0093] Pre-training employs an autoregressive language modeling objective, namely, predicting the next token based on the preceding context. During training, the text sequence is segmented into a token sequence, which is then input into a model structure composed of multiple stacked Transformer decoders. The model computes the hidden state vector for each token position layer by layer through a causal self-attention mechanism and positional encoding. The causal self-attention mechanism ensures that each token can only focus on itself and tokens at previous positions, and cannot focus on tokens at future positions, thus satisfying the requirements of autoregressive generation. The hidden state vector of each token is mapped to a vector along the vocabulary dimension through a linear layer, and then passed through a softmax function to output the predicted probability distribution of each token in the vocabulary. The training loss function is cross-entropy loss: the negative logarithm of the predicted probability corresponding to the true next token is taken as the loss value at that position, and the average of the loss values over all positions is taken to obtain the total loss. The gradient of the total loss with respect to the model parameters is calculated using the backpropagation algorithm, and the model parameters are updated using gradient descent.
[0094] The optimizer uses AdamW, and the learning rate employs a cosine annealing scheduling strategy, meaning the learning rate gradually decays from its initial value to near zero according to a cosine function. During training, mixed-precision training (using both 16-bit and 32-bit floating-point operations simultaneously) is used to accelerate training and reduce memory usage. Gradient accumulation (summing gradients from multiple mini-batches before updating parameters) is used to support equivalent large-batch training. The pre-training phase continues until the model's perplexity on the validation set converges, meaning the validation set perplexity no longer decreases over multiple consecutive evaluation epochs.
[0095] Instruction fine-tuning phase: Based on the pre-trained model, fine-tuning is performed to enhance the model's ability to follow diverse instructions and improve generation quality. The training data for instruction fine-tuning consists of manually labeled instruction-response pairs, with each training sample containing an instruction text and a corresponding expected response text. The instruction texts cover various task types, including text generation, summarization, rewriting, question answering, translation, and script writing, explicitly describing task requirements, constraints, and output formats. For example, in script writing instructions, the instruction text explicitly requires the generated script to include specific structural types (such as pain point introduction structures, solution and selling point structures, and conversion guidance structures), the time allocation for each structure, and output format requirements. The expected response texts are manually written to ensure accuracy, proper formatting, and full compliance with all requirements in the instructions.
[0096] During instruction fine-tuning, the instruction text and the expected response text are concatenated into a complete training sequence. No loss is calculated for the instruction portion (i.e., the loss mask is set to zero); only the cross-entropy loss is calculated for the response portion. This setup allows the model to focus on learning how to generate high-quality responses based on instructions, without needing to learn how to generate the instruction text itself. The optimizer for instruction fine-tuning uses AdamW, with a learning rate set to a small value, typically 1 / 10 or lower than the initial learning rate during pre-training, to ensure the model doesn't deviate excessively from the language knowledge learned during pre-training. The number of training epochs is determined based on performance on the validation set. By monitoring the quality metrics of the responses generated by the model on the validation set (such as ROUGE-L scores or human evaluation scores), an early stopping strategy is triggered to terminate training when validation set performance no longer improves, preventing overfitting. After instruction fine-tuning, the model possesses the ability to generate imitation scripts that conform to structural, temporal, and content constraints based on imitation prompts.
[0097] The input to the text-based large language model is the complete text of the imitation prompt words constructed in step S1044. These prompt words include character setting text, reference material text (structured text of the original video storyboard), structural constraint text, content constraint text, time conservation constraint text, output format requirement text, and style instruction text. These text components are concatenated sequentially to form a complete imitation prompt word. Before being fed into the model, the input text is converted into a token sequence by the model's built-in token segmenter. The segmenter divides the text by characters or subwords and maps them to token indices in the vocabulary. Dialogue format markers are added to the beginning and end of the token sequence; for example, a marker indicating the start of a user message is added at the beginning of the sequence, and a marker indicating the start of the model's response is added at the end, to guide the model into generation mode.
[0098] The processing procedure of the large text language model is an autoregressive token-by-token generation process, as follows: The token sequence of the input text is fed into the model's embedding layer. The embedding layer converts each token index into a corresponding vector representation, which captures the semantic information of the token. At the same time, positional encoding is added according to the position of each token in the sequence, enabling the model to perceive the sequential relationship between tokens. After adding the embedding vector to the positional encoding, the input representation vector for each token is obtained. The sequence of input representation vectors passes through a multi-layer Transformer decoder. Each decoder layer contains two core components: the first is a multi-head self-attention mechanism with causal masking, and the second is a feedforward neural network. The two components are connected through residual connections and layer normalization. In the multi-head self-attention mechanism, the input vector is transformed linearly to generate a query vector, a key vector, and a value vector. Attention weights are calculated by the dot product of the query vector and the key vector. The causal masking resets the attention weights for future positions to negative infinity, ensuring that each position can only focus on its own information and information from previous positions. The attention weights and value vectors are weighted and summed, and then linearly transformed to obtain the self-attention output of that layer. The self-attention output is added to the input (residual connection), then normalized, and then fed into the feedforward neural network for nonlinear transformation. The feedforward neural network typically contains two linear layers and a nonlinear activation function (such as GELU). Residual connections and layer normalization are performed again to obtain the output of that layer. After processing layer by layer by the multi-layer decoder, the hidden state vector corresponding to each token position is obtained.
[0099] During the generation phase, the hidden state vector at the last position of the sequence is taken and mapped to a vector of the vocabulary dimension through a linear layer (also known as the output projection layer). Each element of this vector corresponds to the original score of a token in the vocabulary. The original score vector is then passed through a softmax function to convert it into the predicted probability distribution of each token in the vocabulary. The softmax function takes each score as a power of e and divides it by the sum of all scores raised to the power of e to obtain the probability value of each token. The sum of all probability values is 1.
[0100] Based on this probability distribution, sampling is performed using the temperature parameter. The sampling method is as follows: First, each score in the original score vector is divided by the temperature parameter to obtain an adjusted score vector. When the temperature parameter is greater than 1, the distribution becomes smoother, increasing randomness and diversity; when the temperature parameter is less than 1, the distribution becomes sharper, reducing randomness and making the output more deterministic. Then, the adjusted score vector is passed through the softmax function to obtain an adjusted probability distribution. The next token is obtained by randomly sampling from the adjusted probability distribution according to probability. If a random seed is used, the state of the random number generator is initialized according to the random seed before sampling to ensure that different requests using different random seeds produce different sampling results.
[0101] The newly generated token is appended to the end of the existing sequence, increasing the sequence length by 1. The hidden state vector and probability distribution are recalculated based on the updated sequence to generate the next token. This process continues until either of the following termination conditions is met: an end marker is generated (such as the token sequence corresponding to "===End of video==="), or the total number of generated tokens reaches the preset maximum output length limit. Each time a new token is generated, the model recalculates the attention based on all existing tokens (including the input token and previously generated tokens). This process is called autoregressive generation.
[0102] The text-based large language model outputs a complete text, which is a copywriting script. The output text should conform to the output format requirements specified in the copywriting prompts, that is, it should start with "===Video Start===", followed by multiple scene segments arranged in chronological order. Each scene segment includes start and end times, structure type labels, screen descriptions, subtitle text, narration text, and sound effects information, and finally end with "===Video End===". The output text is passed to step S1052 for structured parsing, extracting scene boundary markers, timestamp markers, and structure type markers, and then dividing it into multiple scene segments to form a structured copywriting script.
[0103] Step S1052: Perform structured parsing on the text returned by the large text language model each time, and extract the scene boundary markers, timestamp markers and structure type markers.
[0104] The text returned by the large language model is natural language text containing a complete imitation script; the first step of structured parsing is to locate the scene boundary markers; in the imitation prompt words, the model is required to use specific markers as the start and end marks of each script; the start and end marks are matched by regular expressions, and the text content between the marks is extracted as a complete imitation script.
[0105] From the extracted script text, timestamp and structure type tags are further extracted. Timestamps are matched using regular expressions to extract time information in the format of start time - end time, yielding the start and end times of each storyboard segment. Structure type tags are extracted by matching keywords such as pain point setup structure, solution and selling point structure, and conversion guidance structure.
[0106] Step S1053: Divide the returned text into multiple storyboard segments according to the storyboard boundary markers, assign start and end times to each storyboard segment according to the timestamp markers, and label the structure type of each storyboard segment according to the structure type markers to form a structured imitation script.
[0107] Based on the storyboard boundary markers extracted in step S1052, the parody script text is divided into multiple independent storyboard segments. Each storyboard segment typically includes a timestamp line, a video line, a subtitle line, a narration line, and a sound effect line. A start and end time are assigned to each storyboard segment according to the timestamp markers. The structure type is labeled for each storyboard segment based on the structure type markers. This information is organized into a structured data format to form a structured parody script. The data format of the structured parody script is consistent with the original video storyboard script, facilitating subsequent storage, retrieval, and comparative analysis.
[0108] Step S1054: Merge the structured imitation scripts obtained from each inference request to obtain multiple imitation scripts.
[0109] The structured imitation scripts obtained from each inference request in step S1053 are collected into a list, and each element in the list corresponds to a complete imitation script. The final output of multiple imitation scripts is stored in JSON array format, and each imitation script contains information such as script number, generation time, and structured data of each storyboard segment.
[0110] Step S106: Script verification step.
[0111] After obtaining multiple imitation scripts in step S105, the quality of the imitation scripts generated by the large text language model is verified to ensure that the output scripts meet the time conservation constraints. The script verification steps include: Step S1061: Analyze the storyboard structure of each script and extract the timestamp information of each storyboard.
[0112] For each script imitation, its structured data is parsed, and the start and end times of each storyboard segment are extracted; the timestamp information is in seconds, accurate to an integer or one decimal place.
[0113] Step S1062: Calculate the duration of each scene based on the timestamp information, and sum the durations of each scene according to the structure type to obtain the actual duration of each structure type in the script.
[0114] For each storyboard segment, subtract the start time from the end time to obtain the duration of that storyboard segment. Based on the structure type label marked for each storyboard segment, group and sum the storyboard durations according to the structure type. Specifically, sum the durations of all storyboard segments labeled as "pain point introduction structure" to obtain the actual duration of the "pain point introduction structure"; sum the durations of all storyboard segments labeled as "solution and selling point structure" to obtain the actual duration of the "solution and selling point structure"; and sum the durations of all storyboard segments labeled as "conversion guidance structure" to obtain the actual duration of the "conversion guidance structure".
[0115] Step S1063: Calculate the sum of the actual durations of each structure type to obtain the total actual duration of the script imitation; add the actual durations of the pain point preparation structure, the solution and selling point structure, and the conversion guidance structure to obtain the total actual duration of the script imitation.
[0116] Step S1064: Compare the actual total duration with the script duration of the original video storyboard. If the absolute value of the difference between the two exceeds the preset duration deviation threshold, it is determined that the imitation script does not meet the time conservation constraint condition, and the imitation script is removed.
[0117] The preset duration deviation threshold can be set to 0.5 seconds; subtract the script duration of the original video storyboard from the actual total duration to obtain the duration difference; take the absolute value of the duration difference to obtain the absolute difference; if the absolute difference is greater than the preset duration deviation threshold, it is determined that the imitation script does not meet the first level constraint of time conservation (equal total duration constraint), and the imitation script is removed from the output results.
[0118] Step S1065: If the absolute value of the difference between the two does not exceed the preset duration deviation threshold, then further verify the continuity of the time axis and detect whether there is a time gap or time overlap between adjacent scenes. If there is a time gap or time overlap, then determine that the imitation script does not meet the time conservation constraint condition and remove the imitation script.
[0119] The timeline continuity check is achieved by examining the end and start times of adjacent shots one by one. For each pair of adjacent shots in the simulation script, the end time of the preceding shot and the start time of the following shot are compared. If the end time of the preceding shot equals the start time of the following shot, the pair of adjacent shots meets the continuity requirement. If the end time of the preceding shot is less than the start time of the following shot, there is a time gap, and the shot does not meet the continuity requirement. If the end time of the preceding shot is greater than the start time of the following shot, there is a time overlap, and the shot does not meet the continuity requirement. If any pair of adjacent shots in the simulation script has a time gap or time overlap, the simulation script is determined to not meet the second-level constraint of time conservation (timeline continuity without jump constraints), and the simulation script is removed from the output results.
[0120] Step S107: Semantic deduplication step.
[0121] After script verification in step S106, semantic deduplication is performed on the verified imitation scripts to remove redundant scripts with highly similar content, ensuring that the final output set of imitation scripts has sufficient differences. The semantic deduplication steps include: Step S1071: Concatenate the narration field of each imitation script to obtain the complete text sequence corresponding to each imitation script.
[0122] For each script imitation, the narration text of each scene segment is extracted in the order of the scenes, and concatenated with spaces as the delimiter to form the complete text sequence corresponding to the script imitation. The complete text sequence represents the core semantic content of the script imitation and is used for subsequent semantic similarity calculation.
[0123] Step S1072: Use a pre-trained text embedding model to vectorize each complete text sequence to obtain the semantic vector corresponding to each imitation script.
[0124] The pre-trained text embedding model employs a Transformer-based sentence embedding model, such as the text2vec-large-chinese model or the BGE model. Each complete text sequence of the imitated script is input into the text embedding model, which outputs a fixed-dimensional semantic vector, typically 768 or 1024 dimensions. The semantic vector encodes the semantic information of the text into a vector representation in a high-dimensional space. Semantic vectors corresponding to texts with similar semantics are closer together in the high-dimensional space, while semantic vectors corresponding to texts with significant semantic differences are farther apart.
[0125] Step S1073: Calculate the cosine similarity between the semantic vectors of any two imitation scripts.
[0126] For any two parody scripts' semantic vectors, the cosine similarity calculation steps are as follows: Calculate the dot product of two semantic vectors, which is the sum of the product of corresponding elements of the two vectors. Calculate the magnitude of the first semantic vector, which is the positive square root of the sum of the squares of its elements. Calculate the magnitude of the second semantic vector, which is the positive square root of the sum of the squares of its elements. Multiply the first and second magnitudes to get the magnitude product. Divide the dot product by the magnitude product to get the cosine similarity. The cosine similarity value ranges from -1 to +1, with higher values indicating greater similarity. A value closer to positive 1 indicates that the two texts are more semantically similar, while a value closer to 0 indicates that the semantics are less related. For N imitation scripts, the cosine similarity of N multiplied by N minus 1 and then divided by 2 needs to be calculated. Step S1074: Construct a similarity matrix and mark imitation script pairs with a cosine similarity exceeding a preset similarity threshold as similar script pairs. Construct a symmetric similarity matrix with N rows and N columns, where the element in the i-th row and j-th column represents the cosine similarity between the i-th and j-th imitation scripts. The preset similarity threshold can be set to 0.85. Traverse the upper triangular part of the similarity matrix (i.e., the elements above the diagonal) and mark script pairs with a cosine similarity exceeding the preset similarity threshold as similar script pairs.
[0127] Step S1075: For each pair of similar scripts, retain one of the imitation scripts and remove the rest. The retention rule is to prioritize retaining the imitation script with the smallest deviation between the actual duration and the allocated duration of each structure.
[0128] For each pair of similar scripts, one script needs to be kept and the other removed. The specific steps for executing the retention rule are as follows: For each script in a similar script pair, calculate the deviation between the actual duration and the allocated duration for each structural type. The deviation is calculated as follows: take the absolute value of the difference between the actual duration and the allocated duration of the pain point preparation structure to obtain the first difference; take the absolute value of the difference between the actual duration and the allocated duration of the solution and selling point structure to obtain the second difference; take the absolute value of the difference between the actual duration and the allocated duration of the conversion guidance structure to obtain the third difference; add the first, second, and third differences to obtain the total deviation. The smaller the total deviation, the closer the script is to the requirements of the circular sector segmentation allocation scheme in terms of structural duration allocation; compare the total deviations of the two scripts in the similar script pair, keep the one with the smaller total deviation, and remove the one with the larger total deviation; for the transitive similar script group involving multiple scripts (i.e., script A is similar to script B, script B is also similar to script C, forming a transitive similar script group), the following greedy strategy is used for processing: Construct an undirected graph where nodes represent each copy script. If the cosine similarity between two scripts exceeds a preset similarity threshold, connect them with an edge. Find all connected components in the graph, and each connected component corresponds to a set of scripts that transmit similarity. For each connected component, calculate the total deviation of each script within it, select the script with the smallest total deviation as the retained script for that connected component, and mark the remaining scripts as to be removed. Traverse all connected components and merge the retained scripts of each connected component as the deduplicated result.
[0129] Step S1076: The retained imitation scripts are used as the final output set of differentiated imitation scripts.
[0130] After the deduplication process in step S1075, the remaining imitation scripts constitute the final output set of differentiated imitation scripts. Each imitation script in this set has sufficient semantic difference and satisfies the time conservation constraints and structural integrity requirements.
[0131] This embodiment implements a multi-script differentiated imitation writing method through the above steps S101 to S107. This method ensures that the imitation script is strictly aligned with the original video in the time dimension through time conservation constraints, solving the problem of script duration being disjointed and uncontrollable in existing solutions. By mapping the script duration to the circumference of a circle and allocating time to a sector area divided by the central angle ratio, it ensures that each imitation script has a complete narrative chain, i.e., first laying the groundwork to introduce the problem, then developing the core content with solutions and selling points, and finally concluding with a transformation guide, avoiding the problem of narrative loop breakage caused by structural deficiencies. By constructing imitation prompts based on the original video storyboard, time conservation constraints, and the sector segmentation allocation scheme of the circle, and using a large textual language model to generate multiple imitation scripts in batches, multiple structurally complete and content-differentiated scripts can be produced from the same original video, effectively solving the problem of homogenized output results. Through script verification and semantic deduplication steps, the quality and diversity of the output scripts are further ensured.
[0132] This embodiment also provides a multi-script differentiated imitation system, such as Figure 2 As shown, this system is used to execute the aforementioned multi-script differentiated imitation method. The system includes: The video structure analysis module is used to acquire the original video, perform video structure analysis on the original video, and obtain the original video storyboard. The original video storyboard contains the structure type, screen, subtitles, narration and sound effects fields divided by time segment. The constraint acquisition module is used to obtain time conservation constraints based on the script duration of the original video storyboard. The time conservation constraints require that the sum of the time of each storyboard in each imitation script is equal to the script duration, and that the timeline is continuous without jumps. The geometric segmentation module is used to construct a circle with the script duration as its circumference; divide the circle into multiple sector regions according to a preset central angle ratio, and the sum of the central angles of each sector region is equal to the circumference angle; allocate the duration according to the arc length corresponding to each sector region, and each sector region is respectively assigned to the pain point preparation structure, the solution and selling point structure, and the conversion guidance structure. The prompt word construction module is used to construct imitation prompt words based on the original video storyboard, time conservation constraints, and the circular sector segmentation allocation scheme; The parody generation module is used to input parody prompts into a large text language model and obtain multiple parody scripts.
[0133] It should be noted that this system is a system corresponding to the above method. All implementation methods in the above method embodiments are applicable to this embodiment and can achieve the same technical effect.
[0134] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A multi-script differentiated imitation method, characterized in that, The method includes: The original video is acquired, and its structure is analyzed to obtain the original video storyboard. The original video storyboard contains the structural type, visuals, subtitles, narration, and sound effects fields divided by time. Based on the script duration of the original video storyboard, obtain the time conservation constraint. The time conservation constraint requires that the sum of the durations of each storyboard in each imitation script is equal to the script duration, and that the timeline is continuous without jumps. Construct a circle with the script duration as its circumference; divide the circle into multiple sector regions according to a preset central angle ratio, where the sum of the central angles of each sector region equals the circumference angle; allocate time according to the arc length corresponding to each sector region, with each sector region corresponding to the pain point prelude structure, the solution and selling point structure, and the conversion guidance structure, respectively; the preset central angle ratio is determined through the following steps: Extract the structure type tags corresponding to each scene in the original video storyboard script; The total duration of the pain point preparation structure is obtained by summing the duration of each scene belonging to the pain point preparation structure, the total duration of the solution and selling point structure is obtained by summing the duration of each scene belonging to the solution and selling point structure, and the total duration of the conversion guidance structure is obtained by summing the duration of each scene belonging to the conversion guidance structure. The total duration of the pain point preparation structure, the total duration of the solution and selling point structure, and the total duration of the conversion guidance structure are summed to obtain the script duration. The calculation shows the percentage of the total time spent on the pain point preparation structure in the total script time, the percentage of the total time spent on the solution and selling point structure in the total script time, and the percentage of the total time spent on the conversion guidance structure in the total script time. Multiply the first proportion by the full angle to obtain the first central angle, multiply the second proportion by the full angle to obtain the second central angle, multiply the third proportion by the full angle to obtain the third central angle, and the sum of the first central angle, the second central angle and the third central angle equals the full angle. The ratio formed by the first central angle, the second central angle and the third central angle is used as the preset central angle ratio. The process of dividing the circle into multiple sector regions according to a preset central angle ratio also includes a dynamic adjustment step, which includes: The emotional intensity score of each shot in the original video storyboard is obtained. The emotional intensity score is obtained by performing sentiment analysis on the narration field corresponding to the shot. The average emotional intensity scores of each scene corresponding to the pain point setup structure, the solution and selling point structure, and the conversion guidance structure were calculated to obtain the average emotional scores of the pain point setup, the solution and selling point structure, and the conversion guidance structure. The average emotional values of pain point preparation, solution and selling point, and conversion guidance are normalized to obtain an emotional weight vector. The emotional weight vector is weighted and fused with the preset central angle ratio to obtain the adjusted central angle ratio. The sector area of the circle is then re-divided according to the adjusted central angle ratio. Based on the original video storyboard, time conservation constraints, and the sector segmentation allocation scheme of the circle, construct imitation prompt words; Input the copy prompt words into the text large language model to obtain multiple copy scripts.
2. The multi-script differentiated imitation method according to claim 1, characterized in that, Video structure analysis was performed on the original video to obtain the original video storyboard, including: The original video is separated into audio and video tracks. Speech recognition is performed on the audio track to convert the speech signal into text, resulting in a narration field. The start and end timestamps of each narration text are recorded. The video track is sampled at a preset frame sampling interval to obtain a sampled frame sequence. Optical character recognition is performed on each sampled frame to extract the text information in the picture as a subtitle field, and the frame timestamp corresponding to each subtitle is recorded. Perform audio event detection on the audio track, identify non-speech audio events, and record the identified audio event type and start and end time as sound effect fields; Align the narration field, subtitle field, and sound effect field according to timestamps to create a timeline; Semantic boundary detection is performed on the narration text to identify semantic turning points and topic switching points, which are then used as the boundaries for scene segmentation. The timeline is divided into multiple segment segments based on the segment division boundaries. Each segment segment is labeled with a structure type tag, which includes pain point preparation structure, solution and selling point structure, and conversion guidance structure, generating the original video storyboard.
3. The multi-script differentiated imitation method according to claim 2, characterized in that, Constructing a circle with the script duration as its circumference also includes the following steps: Using the script duration as the perimeter value, the radius of the circle is calculated using the relationship between the perimeter and the radius. The relationship is that the radius equals the perimeter divided by the radian value corresponding to the circumference angle. Establish a polar coordinate system with the center of the circle as the origin. In the polar coordinate system, starting from the initial angle, determine the boundary angles of each sector region in sequence according to the adjusted central angle ratio. The central angle of each sector is converted into radian values; the arc length of each sector is calculated by multiplying the radian value of the central angle of each sector by the radius. The arc length is directly mapped to the allocation time of the corresponding structure, and the value of the allocation time is equal to the value of the arc length.
4. The multi-script differentiated imitation method according to claim 3, characterized in that, Constructing imitation prompts involves the following steps: Based on the sector-based allocation scheme of the circle, the structure type and allocation duration corresponding to each sector region are extracted, and a structure duration constraint table is generated. The structure duration constraint table includes a structure type field, an allocation duration field, and a structure order field. The structure duration constraint table is converted into a structure constraint text described in natural language. The structure constraint text includes: the requirement that the script be written in the order of pain point preparation structure, solution and selling point structure, and conversion guidance structure, and the duration of each structure is equal to the corresponding allocated duration. Extract core selling points, keywords, and prohibited words from the original video storyboard to generate content constraint text; By combining structural constraint text, content constraint text, and time conservation constraint conditions, and adding differentiated style instructions, multiple different imitation prompts are generated, each corresponding to a different language style or narrative perspective.
5. The multi-script differentiated imitation method according to claim 4, characterized in that, Input the paraphrase prompts into the text-based large language model to obtain multiple paraphrase scripts, including: Multiple different imitation prompts are input into the text large language model in batches, with each imitation prompt corresponding to an independent inference request. The text returned by the large text language model is structured and parsed each time, and the scene boundary markers, timestamp markers and structure type markers are extracted. The returned text is divided into multiple scene segments based on the scene boundary markers. Each scene segment is assigned a start time and an end time based on the timestamp markers. Each scene segment is labeled with a structure type based on the structure type markers, forming a structured imitation script. The structured imitation scripts obtained from each inference request are merged to obtain multiple imitation scripts.
6. The multi-script differentiated imitation method according to claim 5, characterized in that, After obtaining multiple imitation scripts, a script verification step is also included. The script verification step includes: Each script imitation is analyzed for its storyboard structure, and the timestamp information of each storyboard is extracted. The duration of each scene is calculated based on the timestamp information, and the durations of each scene are summed up according to the structural type to obtain the actual duration of each structural type in the script. Calculate the sum of the actual durations for each structure type to obtain the total actual duration of the script imitation; The actual total duration is compared with the script duration of the original video storyboard. If the absolute value of the difference between the two exceeds the preset duration deviation threshold, it is determined that the imitation script does not meet the time conservation constraint and the imitation script is removed. If the absolute value of the difference between the two does not exceed the preset duration deviation threshold, the continuity of the time axis is further checked, and it is detected whether there is a time gap or time overlap between adjacent scenes. If there is a time gap or time overlap, it is determined that the imitation script does not meet the time conservation constraint condition, and the imitation script is removed.
7. The multi-script differentiated imitation method according to claim 6, characterized in that, After obtaining multiple imitation scripts, a semantic deduplication step is also included, which includes: The narration field of each imitation script is concatenated to obtain the complete text sequence corresponding to each imitation script; The pre-trained text embedding model is used to vectorize each complete text sequence to obtain the semantic vector corresponding to each imitation script; Calculate the cosine similarity between the semantic vectors of any two parody scripts; Construct a similarity matrix and mark the imitation script pairs whose cosine similarity exceeds a preset similarity threshold as similar script pairs; For each pair of similar scripts, retain one of the imitation scripts and remove the rest. The retention rule is to prioritize retaining the imitation script with the smallest deviation between the actual duration and the allocated duration of each structure. The retained imitation scripts are used as the final output set of differentiated imitation scripts.
8. A multi-script differentiated imitation system, wherein the system implements the method as described in any one of claims 1 to 7, characterized in that, include: The video structure analysis module is used to acquire the original video, perform video structure analysis on the original video, and obtain the original video storyboard. The original video storyboard contains the structure type, screen, subtitles, narration and sound effects fields divided by time segment. The constraint acquisition module is used to obtain time conservation constraints based on the script duration of the original video storyboard. The time conservation constraints require that the sum of the time of each storyboard in each imitation script is equal to the script duration, and that the timeline is continuous without jumps. The geometric segmentation module is used to construct a circle with the script duration as its circumference; divide the circle into multiple sector regions according to a preset central angle ratio, and the sum of the central angles of each sector region is equal to the circumference angle; allocate the duration according to the arc length corresponding to each sector region, and each sector region is respectively assigned to the pain point preparation structure, the solution and selling point structure, and the conversion guidance structure. The prompt word construction module is used to construct imitation prompt words based on the original video storyboard, time conservation constraints, and the circular sector segmentation allocation scheme; The parody generation module is used to input parody prompts into a large text language model and obtain multiple parody scripts.
Citation Information
Patent Citations
Automatic line feed method based on video script
CN120358396A
Method and device for generating video script and electronic equipment
CN120769136A
