Cboth case generation method and device and published content generation method and device
By introducing a style classifier into the large language model to adjust the style encoding features, the problem of inaccurate style expression in stylized copy generation is solved, achieving high-quality, style-consistent copy generation and improving user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XINGIN INFORMATION TECH (SHANGHAI) CO LTD
- Filing Date
- 2025-12-31
- Publication Date
- 2026-05-01
AI Technical Summary
Existing large language models struggle to consistently output text that conforms to specific expression habits when generating stylized copy, resulting in inaccurate stylistic expression of the generated content and impacting user experience and usability.
A style classifier is introduced to identify the style coding features output by the target copy generation model in real time. By matching the features with multiple preset style categories and the differences in the target style tags, the style coding features are adjusted to generate stylized copy that meets user expectations.
It enhances the model's ability to follow style instructions during the inference phase, generating high-quality copy that is semantically reasonable and stylistically consistent, thereby improving the naturalness of the content and user acceptance.
Smart Images

Figure CN121960482A_ABST
Abstract
Description
Technical Field
[0001] The embodiments in this specification relate to the field of artificial intelligence technology, and in particular to a copywriting generation method, a content generation method and apparatus. Background Technology
[0002] With the rapid development of social media platforms, the demand for efficient and high-quality copywriting generation in video content creation is increasing. Large modeling technology provides a new solution for automated copywriting generation and is widely used in content production processes.
[0003] However, existing methods often suffer from inaccurate style expression or discrepancies with expectations when generating stylized copy, making it difficult to consistently output text that conforms to specific expression habits, thus limiting the usability and user experience of the generated content. Therefore, there is an urgent need for a copy generation solution that accurately generates copy in a specified style. Summary of the Invention
[0004] In view of this, embodiments of this specification provide a method for generating text. One or more embodiments of this specification also relate to a method for generating published content, a text generation apparatus, a published content generation apparatus, a computing device, a computer-readable storage medium, and a computer program product, to address the technical deficiencies existing in the prior art.
[0005] According to a first aspect of the embodiments of this specification, a text generation method is provided, comprising:
[0006] Obtain the video description information and target style tags of the target video;
[0007] Input the video description information and target style tags into the target copy generation model, and obtain the style encoding features output by the feature encoding layer of the target copy generation model;
[0008] The style coding features are input into the style classifier to obtain the matching relationship between the style coding features and multiple preset style categories. The style coding features are then adjusted based on the difference between the matching relationship and the target style label to generate the target style coding features. The style classifier is trained on the initial classifier using the sample coding features and the reference classification results.
[0009] Decode the target style encoding features to generate stylized copy that conforms to the target style tag.
[0010] According to a second aspect of the embodiments of this specification, a method for generating published content is provided, comprising:
[0011] Obtain the target video and target style tags uploaded from the front end, and generate video description information based on the target video;
[0012] Input the video description information and target style tags into the target copy generation model, and obtain the style encoding features output by the feature encoding layer of the target copy generation model;
[0013] The style coding features are input into the style classifier to obtain the matching relationship between the style coding features and multiple preset style categories. The style coding features are then adjusted based on the difference between the matching relationship and the target style label to generate the target style coding features. The style classifier is trained on the initial classifier using the sample coding features and the reference classification results.
[0014] Decode the target style encoding features to generate stylized copy that conforms to the target style tag;
[0015] Based on the target video and stylized copy, generate and publish the corresponding target content.
[0016] According to a third aspect of the embodiments of this specification, a copywriting generation apparatus is provided, comprising:
[0017] The first acquisition module is configured to acquire the video description information and target style tags of the target video;
[0018] The first encoding module is configured to input video description information and target style tags into the target text generation model, and obtain the style encoding features output by the feature encoding layer of the target text generation model;
[0019] The first adjustment module is configured to input style coding features into a style classifier, obtain the matching relationship between style coding features and multiple preset style categories, and adjust the style coding features based on the difference between the matching relationship and the target style label to generate target style coding features. The style classifier is trained on the initial classifier by the sample coding features and the reference classification results.
[0020] The first decoding module is configured to decode the target style encoding features and generate stylized copy that conforms to the target style tag.
[0021] According to a fourth aspect of the embodiments of this specification, a content generation apparatus is provided, comprising:
[0022] The second acquisition module is configured to acquire the target video and target style tags uploaded by the front end, and generate video description information based on the target video;
[0023] The second encoding module is configured to input video description information and target style tags into the target text generation model, and obtain the style encoding features output by the feature encoding layer of the target text generation model;
[0024] The second adjustment module is configured to input style coding features into a style classifier, obtain the matching relationship between style coding features and multiple preset style categories, and adjust the style coding features based on the difference between the matching relationship and the target style label to generate target style coding features. The style classifier is trained using sample coding features, reference style labels, and reference coding features.
[0025] The second decoding module is configured to decode the target style encoding features and generate stylized copy that conforms to the target style tag.
[0026] The publishing module is configured to generate and publish corresponding target content based on the target video and stylized text.
[0027] According to a fifth aspect of the embodiments of this specification, a computing device is provided, comprising:
[0028] Memory and processor;
[0029] The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, they implement the steps of the above-described text generation method or video content generation method.
[0030] According to a sixth aspect of the embodiments of this specification, a computer-readable storage medium is provided that stores a computer program / instructions, which, when executed by a processor, implement the steps of the above-described text generation method or video content generation method.
[0031] According to a seventh aspect of the embodiments of this specification, a computer program product is provided, including a computer program / instructions that, when executed by a processor, implement the steps of the above-described text generation method or video content generation method.
[0032] This specification provides a text generation method in its embodiments, which involves: acquiring video description information and target style tags of a target video; inputting the video description information and target style tags into a target text generation model to obtain style encoding features output by the feature encoding layer of the target text generation model; inputting the style encoding features into a style classifier to obtain the matching relationship between the style encoding features and multiple preset style categories, and adjusting the style encoding features based on the difference between the matching relationship and the target style tag to generate target style encoding features, wherein the style classifier is trained by training an initial classifier using sample encoding features and reference classification results; and decoding the target style encoding features to generate stylized text that conforms to the target style tag.
[0033] One embodiment of this specification introduces a style classifier to perform real-time discrimination of the style-encoded features output by the target copywriting generation model, obtaining their matching relationships with multiple preset style categories. Based on the difference between this matching relationship and the target style label specified by the user, the style-encoded features are adjusted. Since the style-encoded features generated by the original model may deviate from the target style, direct decoding can easily lead to inaccurate style representation. However, through the feedback signals provided by the classifier, the features can be directionally corrected before decoding, making the adjusted target style-encoded features more consistent with the feature representation of the target style. This process strengthens the model's ability to follow style instructions during the inference stage, effectively alleviating the style deviation problem caused by insufficient model instruction following ability, thereby generating high-quality copywriting that is semantically reasonable and stylistically consistent. Attached Figure Description
[0034] Figure 1 This is a flowchart illustrating a text generation method provided in one embodiment of this specification;
[0035] Figure 2 This is a flowchart illustrating a content generation method provided in one embodiment of this specification;
[0036] Figure 3a This is a schematic diagram of a task material selection interface provided in one embodiment of this specification;
[0037] Figure 3b This is a schematic diagram of a video loading interface provided in one embodiment of this specification;
[0038] Figure 3c This is a schematic diagram illustrating the updating of a video loading interface according to one embodiment of this specification;
[0039] Figure 3d This is a schematic diagram of an updated video loading interface provided in one embodiment of this specification;
[0040] Figure 3e This is a schematic diagram of a video browsing interface provided in one embodiment of this specification;
[0041] Figure 3f This is a schematic diagram illustrating the processing steps of a text generation method provided in one embodiment of this specification;
[0042] Figure 4 This is a schematic diagram of supervised fine-tuning of a large language model provided in one embodiment of this specification;
[0043] Figure 5 This is a schematic diagram illustrating the fine-tuning of activation values of a large language model by a style classifier according to one embodiment of this specification;
[0044] Figure 6This is a schematic diagram of the structure of a document generation device provided in one embodiment of this specification;
[0045] Figure 7 This is a schematic diagram of the structure of a content generation device provided in one embodiment of this specification;
[0046] Figure 8 This is a structural block diagram of a computing device provided in one embodiment of this specification. Detailed Implementation
[0047] Many specific details are set forth in the following description to provide a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.
[0048] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of this specification. The singular forms “a,” “described,” and “the” as used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0049] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this specification, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."
[0050] Furthermore, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties. Moreover, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0051] First, the terms and concepts used in one or more embodiments of this specification will be explained.
[0052] Large models refer to deep learning models with a massive number of parameters, typically containing hundreds of millions, tens of billions, hundreds of billions, trillions, or even tens of trillions of parameters. Large models are also known as foundation models. They are pre-trained on large-scale unlabeled corpora, producing pre-trained models with hundreds of millions of parameters. These models can adapt to a wide range of downstream tasks and have good generalization ability. Examples include Large Language Models (LLMs) and multi-modal pre-training models.
[0053] In practical applications, large models only require a small number of samples to fine-tune the pre-trained model before they can be applied to different tasks. Large models can be widely used in fields such as Natural Language Processing (NLP) and Computer Vision. Specifically, they can be applied to computer vision tasks such as Visual Question Answering (VQA), Image Captioning (IC), and Image Generation, as well as natural language processing tasks such as text-based sentiment classification, text summarization, and machine translation. The main application scenarios for large models include digital assistants, intelligent robots, search, online education, office software, e-commerce, and intelligent design.
[0054] Classifier Guidance (CLG) is a mechanism that enhances the controllability of output in generative models. Its core idea is to utilize an independently trained classifier to classify intermediate features generated by the generative model during inference in real time and provide directional guidance based on the classification results. Specifically, when generating text or images, the model's current feature representation is obtained and input into a pre-trained classifier to obtain the probability distribution of its category. By calculating the gradient of this distribution relative to the target category, the direction and magnitude of feature adjustment are determined, thus fine-tuning the original features to make them more aligned with the target conditions. This mechanism does not alter the generative model itself but achieves fine-grained control through gradient signals provided by an external classifier. It is widely used to improve the accuracy and consistency of generated content in terms of style, category, etc.
[0055] Copywriting refers to the structured text product (such as advertising slogans, video scripts, product introductions, etc.) formed by logically reorganizing and linguistically optimizing original materials based on a specific goal (such as publicity, narrative, or explanation). Its core value lies in transforming fragmented information into a persuasive, engaging, or logically clear content carrier.
[0056] In different application scenarios, "copywriting" can take many forms. Copywriting can include narrative copywriting, marketing copywriting, and explanatory copywriting. Narrative copywriting includes video scripts, which are narration, dialogue, subtitles, and / or transition notes generated for video footage; press releases / PR articles, which are key points generated for an event that meet media requirements, such as who, when, where, what, and why. Marketing copywriting includes social media posts, which are attractive headlines, descriptions, and hashtags generated for a series of product images or event videos; advertising scripts, which are fast-paced, focused advertising slogans and dialogue generated based on materials and advertising requirements. Explanatory copywriting includes documentary narration, which is narration that connects historical materials, expert interviews, and scene footage according to a historical timeline; and instructional video narration, which is an explanatory script that breaks down knowledge points and generates them according to the logical order of learning.
[0057] It should be noted that existing large language models suffer from insufficient instruction adherence and inaccurate style understanding when generating stylized copy. Even when users explicitly emphasize the target style in input prompts, the model struggles to consistently follow the instruction, and the generated content easily deviates from the expected expression habits. Furthermore, the model lacks a deep understanding of the stylistic characteristics of specific platforms, failing to accurately capture their integrated style that blends user intent, expression, and language rhythm. This results in deviations in tone, sentence structure, and expression from the platform's typical style, affecting the naturalness of the content and user acceptance.
[0058] To address the above issues, this specification provides a text generation method. One or more embodiments of this specification also relate to a video generation method, a text generation device, a video generation device, a computing device, a computer-readable storage medium, and a computer program product, which will be described in detail in the following embodiments.
[0059] See Figure 1 ,picture Figure 1 A flowchart of a text generation method according to an embodiment of this specification is shown, specifically including the following steps 102-108.
[0060] Step 102: Obtain the video description information and target style tags of the target video.
[0061] The embodiments in this specification apply to applications, websites, or mini-programs with content generation task processing capabilities. These applications, websites, or mini-programs enable automatic content generation. For example, a website deploying a style classifier and a copywriting generation model can implement functions such as material arrangement, copywriting generation, and video / note creation. Another example is a third-party application that uses an Application Programming Interface (API) to call a deployed style classifier and copywriting generation model to automatically generate corresponding content.
[0062] Specifically, the target video is the original video footage uploaded by the user in the content creation task. The system obtains this video file through the receiving end and uses it as the basic input for generating adapted copy. The target video usually contains multiple frames and may involve specific scenes, character actions, or event processes. Its content provides visual basis for subsequent generation of descriptive information and construction of copy.
[0063] Video description information is a textual representation of the target video content, generated by the system through multimodal analysis of the video. This information can include semantic content such as timestamps of key frames, object recognition results, scene classification, action descriptions, and logical relationships between frames. For example, the system can extract structured descriptions such as "[00:05] A person holding a coffee cup walks into the kitchen" and "[00:12] Opens the cabinet and takes out a condiment bottle" through the video understanding model, forming an ordered set of frame descriptions for subsequent model processing.
[0064] Target style tags are user-specified control signals that guide the direction of copy generation, representing the expected linguistic characteristics of the output copy. These tags not only reflect the content theme but also encompass comprehensive style features such as user intent, presentation style, and language rhythm. For example, "travel" indicates a lighthearted narrative style, "funny and witty" suggests a trendy and humorous language style, while "cooking demonstration" corresponds to a more professional and clearly step-by-step explanatory style. These tags serve as conditional input, participating in subsequent model inference and influencing the style consistency of the final generated results.
[0065] In practice, the system first receives the target video uploaded by the user and sends it to a pre-set video understanding module for analysis. This module performs frame-by-frame processing on the video based on a pre-trained visual encoder, extracts visual features from each keyframe, and uses time-series modeling techniques to identify dynamic changes between scenes. Subsequently, a text-to-image generation model is used to convert the visual features into natural language descriptions, generating a set of scene descriptions arranged in chronological order. Simultaneously, the system obtains target style tags from the user input interface. These tags can be provided through drop-down menus, tag selection, or text input, ensuring a consistent format and model recognition. After the video description information and target style tags are extracted, they are encapsulated into structured data units, preparing them as input for the next stage of the model. The entire process realizes the transformation from unstructured video to structured text descriptions and style instructions, laying the foundation for the subsequent generation of high-quality, style-controllable copy.
[0066] It should be noted that, for obtaining video description information of the target video, one option is to directly generate a complete description sequence through an end-to-end multimodal large model; another option is to process in stages, first extracting features by an independent visual model, and then generating descriptive text by a language model. For obtaining target style tags, one option is to provide users with preset tag options for selection; another option is for the system to automatically recommend suitable tags based on historical behavior, or to allow users to freely input style keywords.
[0067] Step 104: Input the video description information and target style tags into the target copywriting generation model, and obtain the style encoding features output by the feature encoding layer of the target copywriting generation model.
[0068] Specifically, video description information is a textual representation of the target video content, generated by the system through multimodal analysis in the preceding steps. It includes multiple scene descriptions organized in chronological order, used to represent key scenes, actions, and semantic logic in the video. This information serves as the core content input for the model and participates in semantic modeling in the subsequent generation process.
[0069] The target style tag is a user-specified style control signal used to guide the language expression tendency of the generated result, covering language style dimensions such as tone, rhythm, sentence structure, and emotional intensity. This tag exists in a structured form and can be concatenated with video description information or fused through embedding vectors. It participates in model inference as conditional input, influencing the feature representation during the generation process.
[0070] The target text generation model is a large language model trained under supervised fine-tuning, capable of extracting semantics from video descriptions and generating appropriate text. The model comprises multiple hierarchical structures, with the feature encoding layer located in the later stages, responsible for high-dimensional abstraction and comprehensive representation of contextual information. Its output activation state reflects the joint semantic and stylistic encoding results of the current input.
[0071] Style encoding features are high-dimensional vectors output by the feature encoding layer, generated by the target text generation model after receiving video description information and target style tags. These features not only contain semantic information of the input content but also incorporate the model's understanding of the target style, serving as a crucial intermediate representation for subsequent style control and text decoding. As a bridge connecting the generative model and the style classifier, these features are used for style consistency optimization before decoding.
[0072] In practice, the system formats and concatenates video description information with target style tags to form a unified input sequence, which is then fed into the target text generation model. The model transforms the input sequence into an initial vector sequence through its embedding layer, followed by context modeling through multiple attention and feedforward networks. During forward propagation, the system captures the activation vectors output by the feature encoding layer, i.e., the style-encoded features. This feature is a high-dimensional representation formed after integrating all input information, containing the semantic content and stylistic tendency of the current task. The system does not directly decode it but temporarily stores this feature and passes it to subsequent modules for discrimination and adjustment by the style classifier. The entire process achieves an end-to-end mapping from input to intermediate features, ensuring that the style-encoded features accurately reflect the model's understanding of the current task.
[0073] It should be noted that, for obtaining style encoding features, one option is to directly extract the hidden states of the penultimate layer of the target text generation model as style encoding features; another option is to set specific markers within the model and extract the vectors at the corresponding positions as style encoding features through pooling operations. Regarding input fusion methods, one option is to append the target style label as a prefix to the video description information; another option is to dynamically inject style label information into the encoding process through a cross-attention mechanism.
[0074] Step 106: Input the style coding features into the style classifier to obtain the matching relationship between the style coding features and multiple preset style categories, and adjust the style coding features based on the difference between the matching relationship and the target style label to generate the target style coding features. The style classifier is trained by the initial classifier through the sample coding features and the reference classification results.
[0075] Specifically, the style encoding feature is a high-dimensional vector output by the feature encoding layer of the target text generation model after processing video description information and target style tags. This vector represents the joint semantic and stylistic representation of the current input content. As an intermediate state for style control, this feature reflects the model's initial judgment of the output style before decoding and serves as the basis for subsequent adjustments.
[0076] Multiple preset style categories are a set of style types predefined by the system, used to classify and manage the expression forms of generated content. Each style category corresponds to a specific set of language expression features, such as sentence length, emotional intensity, word choice preferences, and rhythm, forming the discrimination space of the style classifier. These categories cover common expression needs on the platform, providing a reference standard for style consistency.
[0077] Matching relationships are the output of a style classifier after discriminating style-encoded features. They characterize the degree of proximity of a feature to various preset style categories in the vector space. These relationships are typically presented as probability distributions or similarity scores, reflecting the distributional tendency of the current feature across different style dimensions and providing direction for subsequent adjustments.
[0078] The target style label is the user-specified desired output style. In this step, it serves as a reference benchmark, compared with the matching relationships, to identify the deviation between the current style encoding features and the target. This label maintains semantic alignment with preset style categories to ensure the operability of the comparison process.
[0079] A style classifier is an independently trained discriminative model used to determine the style attribution of an input feature vector. This classifier is trained under supervised supervision using sample-encoded features and reference classification results, enabling it to identify different style features. Its output is a style discrimination signal, used to guide the generative model in adjusting its feature representation.
[0080] In practice, the system inputs style-encoded features into a pre-trained style classifier. The classifier performs forward computation on these features using its internal network structure, outputting their distribution probabilities across multiple preset style categories, i.e., matching relationships. The system compares these matching relationships with the ideal distribution corresponding to the target style label, calculating the difference between the two. This difference reflects the direction and degree of deviation of the current feature in style expression. Based on this difference, the system generates adjustment directions and amounts, and performs vector-level fine-tuning on the original style-encoded features, making the adjusted features closer to the feature representation of the target style in the style space. The adjustment process is performed while maintaining semantic coherence, avoiding interference with the core content. The final generated target style-encoded features are used as decoding input to generate the final text. This mechanism achieves proactive correction of style expression before decoding, enhancing the consistency between the generated results and user instructions.
[0081] It should be noted that, for obtaining matching relationships, one possible approach is to classify and score the style encoding features using a fully connected network, outputting the confidence score for each style category; another possible approach is to calculate the cosine similarity between the style encoding features and the center vectors of each style category as a matching metric. For adjusting style encoding features, one possible approach is to update the feature vector with weights based on the gradient direction output by the classifier; another possible approach is to construct a correction vector based on the difference between the matching relationship and the target distribution, and then linearly fuse it with the original features.
[0082] In one optional implementation of this embodiment, the style coding features are input into a style classifier to obtain the matching relationship between the style coding features and multiple preset style categories, including:
[0083] The style classifier maps style-encoded features to style distribution features, where style distribution features characterize the distribution of style-encoded features across multiple preset style categories.
[0084] Calculate the similarity between style distribution features and features of each preset style category;
[0085] The matching relationship between style coding features and each preset style category is determined based on similarity.
[0086] Specifically, the target style encoding feature is a high-dimensional vector adjusted by the style classifier. This vector, while preserving the original semantic information, enhances the linguistic expression tendency corresponding to the target style label. This feature serves as the initial input or conditional guidance signal for the decoder, determining the style consistency and content accuracy of the final generated copy.
[0087] A style classifier is a trained discriminative model capable of analyzing the style attribution of an input feature vector. This classifier is obtained through supervised learning of an initial classifier using sample encoded features and reference classification results. It possesses the ability to identify different style expression patterns and can be used to evaluate the closeness of input features to various preset style categories.
[0088] Style distribution features are the output of a style classifier after performing a nonlinear transformation on style encoding features. They characterize the distribution of the response intensity of these features across multiple preset style categories. This feature can reflect the activation level of the original encoding across different style dimensions, forming a comparable probabilistic or numerical distribution that reflects its overall style tendency.
[0089] Multiple preset style categories are a set of style types defined by the system. Each category corresponds to a typical language expression pattern, covering comprehensive features such as sentence structure, vocabulary, and rhythm. These categories constitute a reference system for style discrimination, providing a benchmark for determining matching relationships.
[0090] The preset style category features are reference vectors corresponding to each preset style category. They are obtained by the system through statistical analysis of the mean of the encoded features of typical samples or other aggregation methods, and are used to characterize the central position or typical distribution pattern of the style in the vector space.
[0091] Similarity is a measure of the closeness between style distribution features and features of each preset style category in the vector space. It can be calculated using cosine similarity, Euclidean distance, or other suitable methods. This value reflects the degree of alignment between the current feature and each category in terms of style representation.
[0092] The matching relationship is a result generated based on similarity, used to characterize the strength of the association between style-encoded features and various preset style categories. This relationship is presented in numerical form, indicating which style expression the feature is more inclined to, providing a basis for subsequent adjustments.
[0093] In practice, the system feeds the target style encoded features into the decoding layer of the target text generation model as contextual guidance for the generation process. The decoding layer receives these features initially and, combined with its internal state, begins generating the first lexical unit. In each generation step, the model calculates the probability distribution of each word in the vocabulary based on the joint representation of the current context and the target style encoded features, selecting the most suitable lexical unit as the output. This process continues, with generated lexical units continuously fed back to the model input, forming an autoregressive loop until a terminator is generated or the length limit is reached. Throughout the decoding process, the target style encoded features continuously participate in attention calculations, ensuring that each generation step is constrained by the target style. The final output stylized text is semantically faithful to the video description information and stylistically close to the user-specified style, achieving a dual alignment of content and style. This process completes the transformation from abstract features to readable text and is the final output stage of the entire generation task.
[0094] It should be noted that for the decoding process, one option is to use a greedy search strategy, selecting the word with the highest probability for output at each step; another option is to use a sampling strategy, randomly selecting words according to the probability distribution to increase the diversity of generation.
[0095] In the embodiments of this specification, a style classifier maps style coding features to style distribution features, and determines the matching relationship based on the similarity with preset style category features, thereby realizing the quantification of style tendency of style coding features.
[0096] In an optional implementation of this embodiment, the style encoding features are adjusted based on the difference between the matching relationship and the target style tag, including:
[0097] Based on the difference between the matching relationship and the target style label, feature adjustment parameters are generated, whereby the feature adjustment parameters are used to characterize the adjustment amount and direction of the style encoding features;
[0098] The style coding features are adjusted based on the adjustment amount and direction.
[0099] Specifically, the matching relationship is the output of the style classifier, used to characterize the strength of the association between style-encoded features and multiple preset style categories. It is usually presented in the form of a distribution, reflecting the response level of the current feature in each style dimension. As the output of style discrimination, this relationship provides a basis for identifying the deviation between the current state and the target.
[0100] The target style label is the desired style category specified by the user, used to guide the language expression tendency of the generated results. Internally, this label is mapped to a corresponding ideal distribution or reference point, and is compared with the matching relationships to determine whether the current feature meets the expected style requirements.
[0101] The difference represents the degree of inconsistency between the matching relationship and the ideal state corresponding to the target style label, manifested as the deviation in the style space. This difference not only includes the magnitude of the deviation but also implies the direction to be adjusted, serving as the fundamental input for generating feature adjustment parameters.
[0102] Feature adjustment parameters are control signals generated by the system based on differences, used to guide modifications to the original style-encoded features. These parameters comprise two core elements: adjustment direction and adjustment amount. The adjustment direction indicates the path the feature vector should move in high-dimensional space, while the adjustment amount determines the intensity of the movement. Essentially, this parameter is based on gradient information calculated from classifier feedback, reflecting the trend of change needed to make the features closer to the target style.
[0103] The adjustment direction is the part of the feature adjustment parameters that indicates the path of vector change. It is calculated by the system by analyzing the distribution differences between the matching relationship and the target style label. This direction points to a position in the style space that is closer to the target style, ensuring that the adjustment process has clear guidance.
[0104] The adjustment amount is the part of the feature adjustment parameters that controls the adjustment intensity, and it is dynamically determined based on the significance of the difference. The greater the difference, the higher the adjustment amount; the smaller the difference, the lower the adjustment amount, ensuring that the adjustment process is both effective and stable.
[0105] In practice, the system first aligns the matching relationship with the target style label, converting it into a comparable numerical form, such as mapping the label to an ideal distribution vector. Then, it calculates the distribution difference between the two, which can be measured using methods such as cross-entropy, KL divergence, or vector difference. Based on this difference, the system generates feature adjustment parameters through backpropagation or equivalent computation. These parameters contain a clear adjustment direction and amount. The adjustment direction is determined by the gradient direction of the difference, indicating how the style-encoded features should change to enhance the target style response; the adjustment amount is determined by the strength of the difference, controlling the magnitude of the adjustment. Subsequently, the system applies these parameters to the original style-encoded features, combining the adjustment direction and amount through vector operations to perform a weighted update of the features, generating the adjusted feature representation. This process achieves targeted enhancement of style features while maintaining semantic coherence, making the adjusted features more consistent with the expression requirements of the target style.
[0106] It should be noted that, for generating feature adjustment parameters, one option is to calculate the gradient of the classifier with respect to the style-encoded features using an automatic differentiation mechanism as the adjustment parameter; another option is to construct a pseudo-gradient vector based on the difference between the matching relationship and the target distribution. For adjusting style-encoded features, one option is to combine the adjustment direction and adjustment amount into a correction vector and add it to the original features; another option is to perform a weighted fusion of the original features and the correction vector using a gating mechanism.
[0107] In the embodiments of this specification, feature adjustment parameters are generated based on the difference between the matching relationship and the target style tag, and the style coding features are adjusted accordingly, thereby realizing the targeted correction of the feature vector.
[0108] In one optional implementation of this embodiment, the style coding features are adjusted based on the adjustment amount and direction, including:
[0109] Within the feature space corresponding to the style encoding features, determine the target feature subspace that is independent of semantics;
[0110] Within the target feature subspace, an adjustment amount is applied along the adjustment direction.
[0111] Specifically, the feature space is a multi-dimensional vector space in which style-encoded features reside, determined by the parameter structure of the target copy generation model. Different directions in this space correspond to different semantic or style change paths, and the system can identify subspaces related to specific attributes by analyzing the vector distribution.
[0112] The target feature subspace is a low-dimensional projected region in the feature space. Vector changes within this region primarily affect style representation without significantly impacting the original semantics. This subspace is determined by analyzing feature trajectories in historical samples where style changes have been observed while semantics remain stable. It is used to isolate the core content from the interference of style adjustments.
[0113] Semantic independence refers to the selection criterion for the target feature subspace, meaning that when vector operations are performed within this subspace, the core content, key entities, and logical relationships expressed by the style-encoded features do not change significantly. This attribute is verified through training or statistical analysis to ensure that the adjustment process focuses on the form of expression rather than the substance of content.
[0114] In practical implementation, the system first analyzes the structural characteristics of style-encoded features and, combined with preset semantic preservation constraints, identifies a target feature subspace in the feature space that is semantically independent. This process can be achieved by performing principal component analysis or singular value decomposition on a large number of samples to find a set of directions that primarily influence style changes but have a relatively small impact on semantics. Subsequently, the system projects the adjustment direction into this target feature subspace, ensuring that subsequent operations only take effect within this subspace. Based on this, the system applies an adjustment along the projected adjustment direction, generates a correction vector, and fuses it with the original style-encoded features to obtain an updated feature representation. This adjustment process is restricted to the target feature subspace, avoiding perturbations to semantically relevant dimensions, thus enhancing the expression of the target style while maintaining the core meaning of the original content. The entire process achieves targeted optimization of style features while ensuring semantic stability.
[0115] It should be noted that, for determining the target feature subspace, one option is to determine the irrelevant subspace by comparing and analyzing the feature change paths of style-transferred but semantically consistent sample pairs in the training data; another option is to use orthogonalization methods to separate style-related directions from semantically related directions. For applying the adjustment amount, one option is to multiply the adjustment amount by the projected adjustment direction and then directly add it to the original features; another option is to dynamically control the adjustment intensity using a learnable scaling factor.
[0116] In the embodiments of this specification, an adjustment amount is applied along the adjustment direction in the target feature subspace that is not semantically independent, so that the update of style encoding features is focused on the dimension that affects the form of language expression, avoiding interference with the feature dimension that carries the core semantics, thereby maintaining the stability of the original content meaning while achieving style enhancement.
[0117] Step 108: Decode the target style encoding features to generate stylized copy that conforms to the target style tag.
[0118] Specifically, the target style encoding feature is a high-dimensional vector adjusted by the style classifier. This vector, while preserving the original semantic information, enhances the linguistic expression tendency corresponding to the target style label. This feature serves as the initial input or conditional guidance signal for the decoder, determining the style consistency and content accuracy of the final generated copy.
[0119] Decoding refers to the process of progressively converting high-dimensional vector-like feature representations into natural language text, executed by the decoding layer in the target text generation model. This process generates an output sequence word-by-word over time, with the generation probability at each step constrained by the target style encoding features to ensure consistency between the language form and the specified style. The decoding process follows an autoregressive mechanism, using the generated content to predict the next lexical unit until a complete text output is achieved.
[0120] Stylized copy is the final natural language text generated by the system, used to complement the target video. This copy not only accurately reflects the video content but also embodies the expressive characteristics specified by the target style tag in terms of sentence structure, word choice, tone, and rhythm. For example, under the "funny and witty" style, it manifests as internet slang and humorous rhetoric; under the "travel" style, it manifests as narrative language and emotional appeal.
[0121] In practice, the system feeds the target style encoded features into the decoding layer of the target text generation model as contextual guidance for the generation process. The decoding layer receives these features initially and, combined with its internal state, begins generating the first lexical unit. In each generation step, the model calculates the probability distribution of each word in the vocabulary based on the joint representation of the current context and the target style encoded features, selecting the most suitable lexical unit as the output. This process continues, with generated lexical units continuously fed back to the model input, forming an autoregressive loop until a terminator is generated or the length limit is reached. Throughout the decoding process, the target style encoded features continuously participate in attention calculations, ensuring that each generation step is constrained by the target style. The final output stylized text is semantically faithful to the video description information and stylistically close to the user-specified style, achieving a dual alignment of content and style. This process completes the transformation from abstract features to readable text and is the final output stage of the entire generation task.
[0122] It should be noted that for the decoding process, one option is to use a greedy search strategy, selecting the word with the highest probability for output at each step; another option is to use a sampling strategy, randomly selecting words according to the probability distribution to increase the diversity of generation.
[0123] In one optional implementation of this embodiment, the target style encoding features are decoded to generate stylized copy that conforms to the target style tag, including:
[0124] The decoding layer of the target copy generation model converts the target style encoding features into stylized copy that conforms to the target style tag.
[0125] Specifically, decoding refers to the process of progressively converting high-dimensional vector-like feature representations into natural language text, executed by the decoding layer in the target text generation model. This process generates an output sequence word-by-word over time, with the generation probability at each step constrained by the target style encoding features to ensure consistency between the language form and the specified style. The decoding process follows an autoregressive mechanism, using the generated content to predict the next lexical unit until a complete text output is achieved.
[0126] Stylized copy is the final natural language text generated by the system, used to complement the target video. This copy not only accurately reflects the video content but also embodies the expressive characteristics specified by the target style tag in terms of sentence structure, word choice, tone, and rhythm. For example, under the "funny and witty" style, it manifests as internet slang and humorous rhetoric; under the "travel" style, it manifests as narrative language and emotional appeal.
[0127] In practice, the system inputs the target style encoding features into the decoding layer of the target text generation model to initiate the text generation process. The decoding layer first maps these features to an initial hidden state and generates the first lexical unit based on this state and the vocabulary probability distribution. Then, an autoregressive loop is entered, with the generated lexical unit serving as input for the next time step. Simultaneously, the decoding layer continuously associates the target style encoding features through a cross-attention mechanism, ensuring that each generation step is constrained by them. At each time step, the model calculates the most suitable lexical unit output until a terminator is generated or the length limit is reached. Throughout this process, the target style encoding features participate in decision-making as a global context, ensuring that the output text closely resembles the target style in tone, rhythm, and expression.
[0128] It should be noted that, regarding text generation, one option is to use a greedy search strategy to select the highest probability word character bit by bit; another option is to use a sampling strategy to introduce randomness and improve diversity. Regarding feature fusion, one option is to concatenate the target style encoded features into the decoder input sequence; another option is to dynamically inject feature information through a multi-layer attention mechanism.
[0129] In the embodiments described in this specification, the target style encoding features are converted into stylized text through a decoding layer, realizing the conversion from controlled features to natural language and ensuring that the generated content conforms to the user-specified style in terms of language form.
[0130] In an optional implementation of this embodiment, after decoding the target style encoding features and generating stylized copy that conforms to the target style tag, the method further includes:
[0131] Based on the target video and stylized copy, generate and publish the corresponding target content.
[0132] Specifically, the target video is the original video file uploaded by the user, containing multiple frames and time-series information, serving as the visual carrier for generating and publishing content. This video has already undergone content analysis and description extraction through previous steps, possessing the technical foundation for integration with the accompanying text.
[0133] Stylized copy is system-generated natural language text used to complement the target video and convey core information. This copy adjusts its expression based on the target style tags, reflecting different tones, rhythms, and rhetorical features to meet diverse expression needs.
[0134] The target content is a complete presentation unit consisting of a target video and stylized text, used for playback or display on the terminal interface. This content typically includes video footage and overlaid text information to achieve a coordinated expression of audiovisual information.
[0135] In practice, after generating stylized text, the system integrates it with the original target video. First, it determines the timing and location of the text within the video, aligning it with key shots based on timestamps or inserting it in segments according to the video's rhythm. Then, the text is embedded into the video as subtitles, titles, or animated text, creating a combined text and image output. The system supports various layout styles and animation effects to ensure visual harmony. After integration, the target content is packaged into a standard format file and pushed to the publishing channel for uploading or distribution. This process transforms independent materials into disseminable content, improving content creation efficiency.
[0136] It should be noted that for the text embedding method, one option is to display the text as a static subtitle fixed at the bottom of the video; another option is to present it dynamically according to the timeline, synchronized with the changes in the video. For the publishing method, one option is to automatically upload to a specified platform; another option is to generate a local file for users to manually publish.
[0137] In the embodiments described in this specification, target content is generated and published based on the target video and stylized text, completing a closed loop from content generation to output, and improving the integration efficiency and automation level of multimodal content.
[0138] In an optional implementation of this embodiment, after decoding the target style encoding features and generating stylized copy that conforms to the target style tag, the method further includes:
[0139] Obtain copywriting feedback information for stylized copywriting;
[0140] Update the style classifier and / or copy generation model based on copywriting feedback.
[0141] Specifically, the copywriting feedback information is quality assessment data for the stylized copywriting, provided by users or an automated evaluation module. This information may include user ratings of the accuracy of the copywriting style, suggestions for improvement, and whether or not they were adopted, or system-calculated style consistency indicators, semantic fidelity scores, etc. This feedback is used to measure the degree of match between the generated results and user expectations.
[0142] In practice, after generating stylized copy, the system initiates a feedback collection task. Explicit user feedback on the copy, such as ratings, editing history, or confirmation marks, is obtained through the user interface. Simultaneously, an automated evaluation module can be invoked to analyze the similarity of the copy to the target style tag in terms of linguistic features, generating implicit feedback information. The system then structures the collected copy feedback information, extracting key signals that can be used for model optimization. Subsequently, the style classifier and / or copy generation model are updated based on this feedback information. For the style classifier, high-confidence samples from the feedback can be used as incremental training data to adjust its classification boundaries. For the copy generation model, reinforcement learning or fine-tuning methods can be employed to optimize its parameters based on the feedback signals, making it more likely to produce results that align with user preferences in future generation. This process supports the continuous evolution of the model's capabilities.
[0143] It should be noted that for updating the style classifier, one option is to add samples marked as high-quality in the feedback to the training set for retraining; another option is to update the classifier parameters online based on the feedback gradient. For updating the copywriting generation model, one option is to use a reward-based reinforcement learning method to adjust the model strategy; another option is to fine-tune the model parameters.
[0144] In the embodiments of this specification, by obtaining copywriting feedback information and using it to update the style classifier and / or copywriting generation model, closed-loop optimization of the generation system is achieved, enabling the model to dynamically adjust its discrimination and generation capabilities based on actual usage effects, thereby improving the style accuracy and user satisfaction of subsequent tasks.
[0145] In one optional implementation of this embodiment, the style classifier is trained using the following method:
[0146] Obtain a training sample set, which includes sample encoding features and reference classification results. The reference classification results are used to characterize the matching relationship between sample encoding features and multiple preset style categories.
[0147] Input the sample encoded features into the initial classifier to obtain the predicted classification result;
[0148] The initial classifier is trained based on the difference between the predicted classification result and the reference classification result until the training stops, thus obtaining the style classifier.
[0149] Specifically, the training sample set is a dataset used to train the style classifier, pre-built and stored by the system. This sample set contains multiple training samples, each consisting of sample-encoded features and a corresponding reference classification result, used to supervise the learning process of the initial classifier.
[0150] Sample-encoded features are high-dimensional vectors extracted from historical generation tasks and generated by the target text generation model when processing video description information and style tags. These features are typically taken from the model's feature encoding layer output and can characterize the joint semantic and stylistic representation of the input content. Sample-encoded features cover a variety of content types and style distributions, ensuring the diversity and representativeness of the training data.
[0151] The reference classification result is the ideal output corresponding to the coded features of the sample, used to characterize the true attribution or distribution tendency of that feature across multiple predefined style categories. This result can be manually annotated style labels, expert-corrected distribution vectors, or style discrimination results obtained through high-confidence path backtracking. The reference classification result constitutes a supervisory signal, guiding the initial classifier to learn the correct style discrimination pattern.
[0152] Multiple preset style categories are a set of style types defined by the system, covering common expressions in the platform or task. Each category corresponds to a specific set of linguistic features, such as sentence structure, emotional intensity, and word preference, which constitute the output space of the classification task.
[0153] The initial classifier is an initial version of the style classifier, typically a neural network model such as a multilayer perceptron or a small Transformer structure. This classifier does not yet have accurate style discrimination capabilities and its parameters need to be gradually optimized through training.
[0154] The predicted classification result is the output of the initial classifier after performing forward computation on the encoded features of the input samples, reflecting its current judgment on style attribution. This result may deviate significantly from the reference classification result in the early stages of training, but will gradually converge as training progresses.
[0155] The difference is the degree of inconsistency between the predicted classification result and the reference classification result, used to measure the discrimination error of the initial classifier. This difference can be quantified by appropriate methods such as cross-entropy loss or mean squared error, and used as the basis for backpropagation.
[0156] Training termination criteria are the standards for determining whether model training is complete. These can include loss convergence, validation set performance stabilization, and reaching the maximum number of training epochs. When these conditions are met, the training process terminates, and the final style classifier is output.
[0157] In practice, the system first constructs a training sample set by collecting a sufficient number of sample-encoded features and their corresponding reference classification results through backtracking historical generation tasks or manually constructing examples. Then, the sample-encoded features are input batch by batch into the initial classifier to obtain predicted classification results. The system calculates the difference between the predicted results and the reference classification results, and updates the parameters of the initial classifier based on this difference using the backpropagation algorithm. The training process employs a gradient descent-like optimization method, iteratively approaching the reference results to make the predicted results gradually approximate the reference results. After each round of training, the system evaluates the model's performance on the validation set to determine if the training stopping condition is met. When the condition is met, training ends, and a style classifier with stable discriminative ability is output. This classifier can be applied to subsequent generation tasks to provide style guidance signals.
[0158] It should be noted that for training sample acquisition, one option is to automatically collect high-confidence samples from online generation tasks to construct the training set; another option is to semi-automatically construct the set through a combination of manual annotation and model labeling. For difference calculation, one option is to use the cross-entropy loss function to measure the difference in classification distribution; another option is to use the mean squared error to calculate the deviation between vectors. For training process control, one option is to set a fixed number of training rounds; another option is to determine the termination time based on an early stopping mechanism based on validation set loss.
[0159] In the embodiments described in this specification, a training sample set containing sample encoding features and reference classification results is obtained. The initial classifier is then iteratively trained based on the difference between the predicted and reference results, enabling the classifier to gradually learn the mapping rules between sample features and preset style categories. This training method utilizes supervisory signals to guide model parameter updates, ensuring that the style classifier has the ability to accurately identify feature style tendencies, thus laying the foundation for providing reliable discriminative support in generation tasks.
[0160] In an optional implementation of this embodiment, before obtaining the training sample set, the following steps are also included:
[0161] In the published content library, obtain sample published content containing content tags, where content tags include content topic tags and style feature tags;
[0162] Based on the sample's published content, content topic tags, and style feature tags, generate sample description information;
[0163] The sample description information is input into a pre-trained copywriting generation model to generate sample encoding features;
[0164] The sample encoded features are input into a pre-trained style classification teacher model to obtain reference classification results;
[0165] A training sample set is constructed based on the sample encoding features and the reference classification results.
[0166] Specifically, the published content library is a collection of historical published content stored by the system, containing multimodal content units that have been generated and displayed externally. Each sample published content consists of video footage and corresponding text, serving as the basic resource for constructing training data.
[0167] Content tags are structured meta-information attached to the sample content to describe its inherent attributes. Content topic tags represent the core topic or field covered by the content, such as "home renovation" or "outdoor sports"; style characteristic tags represent the tendency of its language expression, such as "lighthearted narrative" or "professional explanation." These tags constitute the conditional input for generating sample descriptive information.
[0168] Sample description information is a text-based input instruction generated based on the sample content and its content tags, used to simulate input conditions in real-world tasks. This information typically consists of a combination of content topic tags, style feature tags, and video scene descriptions, forming a complete prompt that can be used for model inference.
[0169] The pre-trained text generation model is a large language model with text generation capabilities, and it has been pre-trained on a large amount of image-text pairs. This model can generate appropriate encoded features based on the input descriptive information and output intermediate layer representations without performing complete decoding.
[0170] The pre-trained style classification teacher model is an independent model with high-precision style discrimination capabilities, trained on large-scale labeled data. This model can perform fine-grained classification of input feature vectors and output their distribution responses across multiple preset style categories as a source of reference classification results.
[0171] In practice, the system first filters sample published content containing complete content tags from the published content library, extracting the content theme tags and style feature tags. Then, it generates a visual description by combining the visual information of the sample published content with the aforementioned tags, forming sample description information. This information is input into a pre-trained copywriting generation model to obtain the sample encoded features output from its feature encoding layer. Next, this feature is fed into a pre-trained style classification teacher model to obtain its discriminative outputs on multiple preset style categories, i.e., reference classification results. Finally, the sample encoded features are paired with the reference classification results, and after batch processing, a complete training sample set is constructed for subsequent training of the style classifier.
[0172] It should be noted that, for generating sample description information, one option is to concatenate the content topic tags, style feature tags, and image descriptions according to a fixed template; another option is to construct a dynamic input format through prompt engineering. For obtaining reference classification results, one option is to directly use the softmax output of the teacher model as the distribution result; another option is to perform temperature scaling or truncation on its output to adjust the smoothness.
[0173] In the embodiments described in this specification, tagged sample published content is obtained from the published content library, and sample encoding features and reference classification results are automatically generated using a pre-trained model, thus achieving the automated construction of a high-quality training sample set. This method fully utilizes existing production data and mature model capabilities, avoids the cost of manual annotation, and ensures the consistency and reliability between sample features and reference results, providing a solid data foundation for the effective training of subsequent style classifiers.
[0174] See Figure 2 , Figure 2 A flowchart of a content generation method according to an embodiment of this specification is shown, which specifically includes the following steps.
[0175] Step 202: Obtain the target video and target style tags uploaded by the front end, and generate video description information based on the target video;
[0176] Step 204: Input the video description information and target style tags into the target copywriting generation model, and obtain the style encoding features output by the feature encoding layer of the target copywriting generation model;
[0177] Step 206: Input the style coding features into the style classifier to obtain the matching relationship between the style coding features and multiple preset style categories, and adjust the style coding features based on the difference between the matching relationship and the target style label to generate the target style coding features. The style classifier is trained on the initial classifier by the sample coding features and the reference classification results.
[0178] Step 208: Decode the target style encoding features to generate stylized copy that conforms to the target style tag;
[0179] Step 210: Based on the target video and stylized copy, generate and publish the corresponding target content.
[0180] It should be noted that the above is an illustrative scheme of a content generation method in this embodiment. It should also be noted that the technical solution of this content generation method is an application of the aforementioned text generation method in a scenario of automated content generation, and belongs to the same concept as the aforementioned text generation method. Details not described in detail in the technical solution of the content generation method can be found in the description of the aforementioned text generation method.
[0181] This specification provides a content generation method in its embodiments. After obtaining the target video and target style tags, descriptive information is generated based on the video and input into the target text generation model to obtain the style encoding features output by its feature encoding layer. By inputting this feature into a style classifier, the matching relationship between it and multiple preset style categories is obtained. Based on the difference between this matching relationship and the target style tag, adjustments are made to generate the target style encoding features. Since the original style encoding features may not fully respond to the target style tag, direct decoding may lead to style expression deviation. However, by using the discrimination signal provided by the style classifier, the features can be optimized in a targeted manner before decoding, making the adjusted features closer to the feature representation of the target style. This mechanism enhances the model's ability to follow style instructions during the inference stage, effectively alleviates the problem of unstable style generation in large models, and ultimately generates semantically reasonable and style-consistent stylized text. Combined with the target video, this generates published content, improving the overall controllability and consistency of content generation.
[0182] The following describes the front-end interaction process of the text generation method provided in the embodiments of this specification. Please refer to [link / reference]. Figure 3a , Figure 3a This is a schematic diagram of a task material selection interface provided in one embodiment of this specification, such as... Figure 3a As shown, the task material selection interface can be displayed, which includes multiple media materials, as well as the video generation control "One-Click Film Generation".
[0183] In response to the media material selection operation in the task material selection interface and the triggering of "one-click video creation", multiple task materials for the content generation task in this embodiment can be obtained. Based on these multiple task materials, the specific implementation process of the above-described text generation method can be executed to automatically generate the corresponding target text content or target video. Figure 3b For example, Figure 3bThis is a schematic diagram of a video loading interface provided in one embodiment of this specification. The client can respond to the "One-Click Video Generation" trigger operation of the video generation control in the task material selection interface to obtain the selected media material. The server can generate a video inference process based on the selected media material. The client can determine and display the video inference process 302a on the video loading interface. The inference process 302a includes at least one of the following inference information: at least one highlight segment 302b in the media material, at least one material content description 302g, video theme 302c, video content description 302d, and video content summary 302e. The inference information is determined based on the selected at least one media material. The aforementioned video theme 302c, video content description 302d, and video content summary 302e are generated based on the text generation method provided in the embodiment of this specification.
[0184] by Figure 3b For example, the reasoning process includes a summary of the video content, 302e, which is "An Unforgettable Trip, with everyday narrative text, accompanied by relaxing music, and packaged in a simple, everyday style." Here, the video title is "An Unforgettable Trip"; the video text is "everyday narrative text," which can be understood as a video text type; the background music is "accompanied by relaxing music," which can be understood as a video background music type; the video style is "simple, everyday style packaging," which can be understood as a video style type. The video voiceover can be understood as a video voiceover type, such as "funny voice."
[0185] In addition, the video loading interface also includes a command input field, through which update commands for at least one type of inference information are received. In response to the update command, the inference process updated based on the update command is displayed or dynamically displayed on the video loading interface. If the video inference process displayed on the video loading interface does not meet the video generation requirements, an update command can be input, and the updated inference process can then be displayed on the video loading interface. Continuing... Figure 3b For example, the video loading interface includes a command input control 316a. Clicking the command input control 316a allows the client to respond to a trigger operation on the command input control 316a by pulling up the keyboard 318a in the video loading interface. Figure 3c As shown, Figure 3cThis is a schematic diagram illustrating the update of a video loading interface according to one embodiment of this specification. When the command input control 316a is clicked, the keyboard changes from a hidden state to a raised state. An update command can be entered in the command input area 318b using the keyboard 318a. The entered update command can be displayed in the command input area 318b. The associated position of the command input area 318b may also include an input confirmation control 318c. The client can respond to the trigger operation of the input confirmation control 318c to confirm the entered update command and display the updated reasoning process in the video loading interface, such as... Figure 3d As shown, Figure 3d This is a schematic diagram of an updated video loading interface provided in one embodiment of this specification.
[0186] Continue with Figure 3b For example, the video loading interface also includes a video viewing control 302f. The client can respond to trigger operations on the video viewing control 302f and display, as shown below. Figure 3e The video browsing interface shown is as follows. Figure 3e This is a schematic diagram of a video browsing interface provided in one embodiment of this specification. The video browsing interface includes a video title, "An Unforgettable Trip," and a visual style, namely, a "simple style." For example... Figure 3e As shown, the video browsing interface also includes a video update control "Regenerate". If you are not satisfied with the generated video, or want to try generating other videos, you can click the video update control "Regenerate" in the video browsing interface. The client can respond to the trigger operation of the video update control "Regenerate" and display a new video in the video browsing interface. The new video is different from the previously displayed video.
[0187] The following is in conjunction with the appendix Figure 3f Taking the application of the copy generation method provided in this specification in the generation of controllable stylized copy as an example, the copy generation method will be further explained. Among other things, Figure 3f The flowchart of a text generation method provided in one embodiment of this specification is shown, which specifically includes the following steps.
[0188] Step 302: Construct a training sample set using the content library of the content publishing platform.
[0189] Specifically, at the training data level, we fully explored the content uploaded by users on the content publishing platform and combined it with the platform's existing structured tagging system (such as makeup, travel, food, vlog, etc.) to construct a batch of high-quality training samples with clear style annotations. These tags not only reflect the content theme but also contain implicit features such as user intent, expression style, and language style.
[0190] Step 304: Supervised fine-tuning of the large language model using the training sample set.
[0191] Specifically, by using these samples to supervise the fine-tuning of the open-source large language model, the model can be further endowed with "style awareness" capabilities on the basis of its existing language understanding capabilities, thereby automatically generating product recommendation copy and colloquial expressions that fit the style of the content platform.
[0192] See Figure 4 As shown, Figure 4 This diagram illustrates a supervised fine-tuning of a Large Language Model (LLM) according to one embodiment of this specification. The left side shows the input data, containing multiple samples (sample 1, sample 2, ..., sample N). Each sample is first labeled with a style (e.g., [style: travel], [style: funny and witty], [style: cooking demonstration]), followed by four scene descriptions (scene descriptions 1-4 corresponding to
[0001] to
[0004] ). The right side shows the output data, i.e., the "on-screen text" for the corresponding style, associated with specific text by scene number (single or combination) (e.g.,
[0003] on-screen text 1, [0001, 0004] on-screen text 2, etc.). The Large Language Model (LLM) is trained using these "input (style + scene description) - output (on-screen text)" sample pairs through supervised fine-tuning, ultimately generating a "style text generation model" that can output adapted text for different styles.
[0194] Step 306: Train the style classifier using the training sample set.
[0195] Specifically, to further improve the style consistency of the model during the inference phase, this embodiment introduces a Classifier Guidance mechanism derived from the fields of text generation and image generation. A training sample set is obtained, containing sample encoded features and reference classification results. The reference classification results represent the matching relationship between the sample encoded features and multiple preset style categories. The sample encoded features are input into the initial classifier to obtain their corresponding predicted classification results. By calculating the difference between the predicted classification results and the reference classification results, the parameters of the initial classifier are updated. Training is iterated until the training stopping condition is met, ultimately resulting in a style classifier with accurate style discrimination capabilities.
[0196] Step 308: Receive the video description information of the target video and the target style tag uploaded by the user; input the video description information and the target style tag into the target text generation model to obtain the style encoding features output by the feature encoding layer of the target text generation model; input the style encoding features into the style classifier to obtain the matching relationship between the style encoding features and multiple preset style categories; adjust the style encoding features based on the difference between the matching relationship and the target style tag to generate the target style encoding features. The style classifier is trained using sample encoding features and reference classification results; decode the target style encoding features to generate stylized text that conforms to the target style tag.
[0197] Specifically, a style classifier is used to perform real-time style discrimination on the activation vectors of the output layer of the large language model. Then, during the generation process, the output activation is guided in reverse: if the current activation deviates from the target style distribution, the activation value is fine-tuned based on the classifier's gradient information, gradually bringing it closer to the feature representation of the target style without significantly affecting semantic integrity. Ultimately, through this "activation correction before decoding" approach, we effectively guide the model output to the desired style distribution, thereby improving the consistency and recognizability of the generated copy in terms of tone, rhythm, and expression.
[0198] See Figure 5 As shown, Figure 5 This diagram illustrates a style classifier's fine-tuning of activation values in a large language model, as provided in one embodiment of this specification. First, prompt words are input into the LLM (Language Model) to generate corresponding activation values. Next, these activation values are fed into the style classifier, which outputs probability distributions for different styles, such as "funny and witty" with a probability of 0.6, "travel" with a probability of 0.3, and "culinary demonstration" with a probability of 0.1. Subsequently, the distribution of activation values is adjusted based on these probabilities to better align with the target style. Finally, the adjusted activation values are decoded and generated to output text conforming to the specified style. The entire process, through the feedback mechanism of the style classifier, achieves fine-grained control over the style of the content generated by the LLM.
[0199] Corresponding to the above method embodiments, this specification also provides embodiments of a document generation device. Figure 6 A schematic diagram of a document generation apparatus according to one embodiment of this specification is shown. Figure 6 As shown, the device includes:
[0200] The first acquisition module 602 is configured to acquire the video description information and target style tags of the target video;
[0201] The first encoding module 604 is configured to input video description information and target style labels into the target text generation model, and obtain the style encoding features output by the feature encoding layer of the target text generation model;
[0202] The first adjustment module 606 is configured to input style coding features into a style classifier, obtain the matching relationship between the style coding features and multiple preset style categories, and adjust the style coding features based on the difference between the matching relationship and the target style label to generate target style coding features. The style classifier is trained on the initial classifier by the sample coding features and the reference classification results.
[0203] The first decoding module 608 is configured to decode the target style encoding features and generate stylized copy that conforms to the target style tag.
[0204] Optionally, the first adjustment module 606 is further configured to map style coding features to style distribution features through a style classifier, wherein the style distribution features characterize the distribution of style coding features in multiple preset style categories;
[0205] Calculate the similarity between style distribution features and features of each preset style category;
[0206] The matching relationship between style coding features and each preset style category is determined based on similarity.
[0207] Optionally, the first adjustment module 606 is further configured to generate feature adjustment parameters based on the difference between the matching relationship and the target style label, wherein the feature adjustment parameters are used to characterize the adjustment amount and adjustment direction of the style coding features;
[0208] The style coding features are adjusted based on the adjustment amount and direction.
[0209] Optionally, the first adjustment module 606 is further configured to determine a semantically independent target feature subspace within the feature space corresponding to the style coding features;
[0210] Within the target feature subspace, an adjustment amount is applied along the adjustment direction.
[0211] Optionally, the first decoding module 608 is further configured to convert the target style encoding features into stylized copy that conforms to the target style tag through the decoding layer of the target copy generation model.
[0212] Optionally, the device also includes a publishing module configured to generate and publish corresponding target content based on the target video and stylized text.
[0213] Optionally, the device also includes an update module configured to obtain copywriting feedback information for stylized copywriting;
[0214] Update the style classifier and / or copy generation model based on copywriting feedback.
[0215] Optionally, the device further includes a training module configured to acquire a training sample set, wherein the training sample set contains sample encoding features and reference classification results, the reference classification results being used to characterize the matching relationship between the sample encoding features and multiple preset style categories;
[0216] Input the sample encoded features into the initial classifier to obtain the predicted classification result;
[0217] The initial classifier is trained based on the difference between the predicted classification result and the reference classification result until the training stops, thus obtaining the style classifier.
[0218] Optionally, the training module is further configured to obtain sample published content containing content tags from the published content library, wherein the content tags include content topic tags and style feature tags;
[0219] Based on the sample's published content, content topic tags, and style feature tags, generate sample description information;
[0220] The sample description information is input into a pre-trained copywriting generation model to generate sample encoding features;
[0221] The sample encoded features are input into a pre-trained style classification teacher model to obtain reference classification results;
[0222] A training sample set is constructed based on the sample encoding features and the reference classification results.
[0223] This specification provides a copywriting generation device that introduces a style classifier to perform real-time discrimination of the style encoding features output by the target copywriting generation model, obtaining their matching relationships with multiple preset style categories. Based on the difference between this matching relationship and the target style tag specified by the user, the style encoding features are adjusted. Since the style encoding features generated by the original model may deviate from the target style, direct decoding can easily lead to inaccurate style expression. However, through the feedback signal provided by the classifier, the features can be directionally corrected before decoding, making the adjusted target style encoding features more consistent with the feature representation of the target style. This process strengthens the model's ability to follow style instructions during the inference stage, effectively alleviating the style deviation problem caused by insufficient model instruction following ability, thereby generating high-quality copywriting that is semantically reasonable and stylistically consistent.
[0224] The above is a schematic scheme of a copywriting generation device according to this embodiment. It should be noted that the technical solution of this copywriting generation device and the technical solution of the above-described copywriting generation method belong to the same concept. For details not described in detail in the technical solution of the copywriting generation device, please refer to the description of the technical solution of the above-described copywriting generation method.
[0225] Corresponding to the above method embodiments, this specification also provides embodiments of a content generation apparatus. Figure 7 A schematic diagram of a content generation apparatus according to one embodiment of this specification is shown. Figure 7 As shown, the device includes:
[0226] The second acquisition module 702 is configured to acquire the target video and target style tags uploaded by the front end, and generate video description information based on the target video;
[0227] The second encoding module 704 is configured to input video description information and target style labels into the target text generation model, and obtain the style encoding features output by the feature encoding layer of the target text generation model;
[0228] The second adjustment module 706 is configured to input style coding features into a style classifier, obtain the matching relationship between style coding features and multiple preset style categories, and adjust the style coding features based on the difference between the matching relationship and the target style label to generate target style coding features. The style classifier is trained using sample coding features, reference style labels, and reference coding features.
[0229] The second decoding module 708 is configured to decode the target style encoding features and generate stylized copy that conforms to the target style tag.
[0230] The publishing module 710 is configured to generate and publish corresponding target content based on the target video and stylized text.
[0231] This specification provides a content generation device that, after acquiring a target video and a target style tag, generates descriptive information based on the video and inputs it into a target text generation model to obtain style encoding features output by its feature encoding layer. By inputting these features into a style classifier, the device obtains matching relationships with multiple preset style categories. Adjustments are made based on the differences between these matching relationships and the target style tag to generate target style encoding features. Since the original style encoding features may not fully respond to the target style tag, direct decoding may lead to style expression deviations. However, by using the discrimination signal provided by the style classifier, the features can be optimized in a targeted manner before decoding, making the adjusted features closer to the feature representation of the target style. This mechanism enhances the model's ability to follow style instructions during the inference stage, effectively alleviating the problem of unstable style generation in large models. Ultimately, it generates semantically reasonable and style-consistent stylized text, which, combined with the target video, generates published content, improving the overall controllability and consistency of content generation.
[0232] The above is an illustrative scheme of a content generation device according to this embodiment. It should be noted that the technical solution of this content generation device and the technical solution of the above-described content generation method belong to the same concept. For details not described in detail in the technical solution of the content generation device, please refer to the description of the technical solution of the above-described content generation method.
[0233] Figure 8 A structural block diagram of a computing device 800 according to one embodiment of this specification is shown. The components of the computing device 800 include, but are not limited to, a memory 810 and a processor 820. The processor 820 is connected to the memory 810 via a bus 830, and a database 850 is used to store data.
[0234] The computing device 800 also includes an access device 840, which enables the computing device 800 to communicate via one or more networks 860. Examples of these networks include Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or combinations of communication networks such as the Internet. The access device 840 may include one or more of any type of wired or wireless network interface (e.g., a network interface controller (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Wi-MAX (Worldwide Interoperability for Microwave Access) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, or a Near Field Communication (NFC) interface.
[0235] In one embodiment of this specification, the above-described components of the computing device 800 and Figure 8 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 8 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0236] The computing device 800 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or personal computers (PCs). The computing device 800 can also be a mobile or stationary server.
[0237] The processor 820 is used to execute the following computer program / instruction, which, when executed by the processor, implements the steps of the above-mentioned copywriting generation method or content publishing generation method.
[0238] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on its differences from other embodiments. In particular, the computing device embodiments are basically similar to the text generation method or content generation method embodiments, so the description is relatively simple; relevant parts can be referred to in the descriptions of the text generation method or content generation method embodiments.
[0239] An embodiment of this specification also provides a computer-readable storage medium storing a computer program / instructions that, when executed by a processor, implement the steps of the above-described text generation method or content generation method.
[0240] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on its differences from other embodiments. In particular, the computer-readable storage medium embodiments are relatively simple in description because they are fundamentally similar to the text generation method or content generation method embodiments; relevant parts can be referred to in the descriptions of the text generation method or content generation method embodiments.
[0241] An embodiment of this specification also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the above-described text generation method or content generation method.
[0242] The above is an illustrative scheme of a computer program product according to this embodiment. It should be noted that the technical solution of this computer program product belongs to the same concept as the technical solution of the above-mentioned copywriting generation method or content generation method. For details not described in detail in the technical solution of the computer program product, please refer to the description of the technical solution of the above-mentioned copywriting generation method or content generation method.
[0243] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0244] The computer instructions include computer program code, which may be in the form of source code, object code, executable file, or certain intermediate forms. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium may be appropriately added or removed according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.
[0245] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments in this specification are not limited to the described order of actions, because according to the embodiments in this specification, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments in this specification.
[0246] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0247] The preferred embodiments disclosed above are merely illustrative of this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the embodiments described herein. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the embodiments, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.
Claims
1. A method for generating copy, characterized in that, include: Obtain the video description information and target style tags of the target video; The video description information and the target style tag are input into the target text generation model to obtain the style encoding features output by the feature encoding layer of the target text generation model; The style encoding features are input into a style classifier to obtain the matching relationship between the style encoding features and multiple preset style categories. The style encoding features are then adjusted based on the difference between the matching relationship and the target style label to generate the target style encoding features. The style classifier is trained on an initial classifier using sample encoding features and reference classification results. The target style encoding features are decoded to generate stylized copy that conforms to the target style tag.
2. The copywriting generation method according to claim 1, characterized in that, The step of inputting the style encoding features into a style classifier to obtain the matching relationship between the style encoding features and multiple preset style categories includes: The style classifier maps the style encoding features to style distribution features, wherein the style distribution features characterize the distribution of the style encoding features across multiple preset style categories; Calculate the similarity between the style distribution features and the features of each preset style category; The matching relationship between the style coding features and each preset style category is determined based on the similarity.
3. The copywriting generation method according to claim 1, characterized in that, The adjustment of the style encoding features based on the difference between the matching relationship and the target style tag includes: Based on the difference between the matching relationship and the target style label, feature adjustment parameters are generated, wherein the feature adjustment parameters are used to characterize the adjustment amount and direction of the style encoding features; The style coding features are adjusted based on the adjustment amount and the adjustment direction.
4. The copywriting generation method according to claim 3, characterized in that, The adjustment of the style coding features based on the adjustment amount and the adjustment direction includes: Within the feature space corresponding to the style encoding features, a target feature subspace independent of semantics is determined; Within the target feature subspace, the adjustment amount is applied along the adjustment direction.
5. The copywriting generation method according to claim 1, characterized in that, Decoding the target style encoding features to generate stylized copy that conforms to the target style tag includes: The target style encoding features are converted into stylized copy that conforms to the target style tag through the decoding layer of the target copy generation model.
6. The copywriting generation method according to any one of claims 1-5, characterized in that, After decoding the target style encoding features to generate stylized copy that conforms to the target style tag, the method further includes: Based on the target video and the stylized text, generate and publish the corresponding target content.
7. The copywriting generation method according to any one of claims 1-5, characterized in that, After decoding the target style encoding features to generate stylized copy that conforms to the target style tag, the method further includes: Obtain copywriting feedback information for the stylized copy; Based on the copywriting feedback information, update the style classifier and / or the copywriting generation model.
8. The copywriting generation method according to any one of claims 1-5, characterized in that, The style classifier is trained using the following method: Obtain a training sample set, wherein the training sample set includes sample encoding features and reference classification results, and the reference classification results are used to characterize the matching relationship between the sample encoding features and multiple preset style categories; The sample encoded features are input into the initial classifier to obtain the predicted classification result; The initial classifier is trained based on the difference between the predicted classification result and the reference classification result until the training stops, thus obtaining a style classifier.
9. The method according to claim 8, characterized in that, Before obtaining the training sample set, the following is also included: In the published content library, obtain sample published content containing content tags, wherein the content tags include content theme tags and style feature tags; Based on the sample published content, the content topic tags, and the style feature tags, generate sample description information; The sample description information is input into a pre-trained copywriting generation model to generate sample encoding features; The sample encoded features are input into a pre-trained style classification teacher model to obtain a reference classification result; A training sample set is constructed based on the sample encoding features and the reference classification results.
10. A method for generating published content, characterized in that, include: Obtain the target video and target style tags uploaded from the front end, and generate video description information based on the target video; The video description information and the target style tag are input into the target text generation model to obtain the style encoding features output by the feature encoding layer of the target text generation model; The style encoding features are input into a style classifier to obtain the matching relationship between the style encoding features and multiple preset style categories. The style encoding features are then adjusted based on the difference between the matching relationship and the target style label to generate the target style encoding features. The style classifier is trained using sample encoding features, reference style labels, and reference encoding features. The target style encoding features are decoded to generate stylized copy that conforms to the target style tag; Based on the target video and the stylized text, generate and publish the corresponding target content.
11. A copywriting generation device, characterized in that, include: The first acquisition module is configured to acquire the video description information and target style tags of the target video; The first encoding module is configured to input the video description information and the target style tag into the target text generation model, and obtain the style encoding features output by the feature encoding layer of the target text generation model; The first adjustment module is configured to input the style encoding features into a style classifier, obtain the matching relationship between the style encoding features and multiple preset style categories, and adjust the style encoding features based on the difference between the matching relationship and the target style label to generate target style encoding features. The style classifier is obtained by training an initial classifier with sample encoding features and reference classification results. The first decoding module is configured to decode the target style encoding features and generate stylized copy that conforms to the target style tag.
12. A content generation device, characterized in that, include: The second acquisition module is configured to acquire the target video and target style tags uploaded by the front end, and generate video description information based on the target video; The second encoding module is configured to input the video description information and the target style tag into the target text generation model, and obtain the style encoding features output by the feature encoding layer of the target text generation model; The second adjustment module is configured to input the style encoding features into a style classifier, obtain the matching relationship between the style encoding features and multiple preset style categories, and adjust the style encoding features based on the difference between the matching relationship and the target style label to generate target style encoding features. The style classifier is trained using sample encoding features, reference style labels, and reference encoding features. The second decoding module is configured to decode the target style encoding features and generate stylized copy that conforms to the target style tag. The publishing module is configured to generate and publish corresponding target content based on the target video and the stylized text.
13. A computing device, characterized in that, include: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, they implement the steps of the text generation method according to any one of claims 1-9 or the content generation method according to claim 10.
14. A computer-readable storage medium, characterized in that, It stores a computer program / instruction that, when executed by a processor, implements the steps of the text generation method according to any one of claims 1-9 or the content generation method according to claim 10.
15. A computer program product, characterized in that, Includes a computer program / instruction that, when executed by a processor, implements the steps of the text generation method of any one of claims 1-9 or the content generation method of claim 10.