Content generation method and device, storage medium and program product
By combining the theme generation model, content generation model and title generation model, the modular article generation process is solved, and the problems of low efficiency and insufficient diversity of article generation in the e-commerce field are achieved, efficient and diversified article generation is achieved, attracting user traffic.
Patent Information
- Application Number
- CN202411999518.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-06
AI Technical Summary
In the e-commerce field, generating article content usually requires users to manually enter a large amount of initial information, and the generated content is limited in diversity, time-consuming and labor-consuming, and the existing technology has not yet effectively solved this problem.
By combining the theme generation model, content generation model and title generation model, the output of each model and the prompt words corresponding to the next model are sequentially used as inputs to the next model, multiple target subtitles, article content and article titles that adapt to the field topics are generated, thereby modularizing the article generation process and improving efficiency and diversity.
It realizes the generation of multiple articles in multiple dimensions for the same topic field at the same time, improves the efficiency of article generation and content diversity, and attracts user traffic.
Smart Images

Figure CN119940307A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and in particular to a content generation method, device, storage medium and program product. Background Art
[0002] In the field of e-commerce, service articles are a form of text used to display merchant services or products on e-commerce platforms. Similar to advertisements, they convey the unique service content and advantages provided by merchants through carefully designed titles and content. These service articles can not only promote the sales of services or products, but also enhance the brand awareness of merchants, increase user engagement, attract user attention, and convey the merchant's service or product content. It can be seen that in the field of e-commerce, articles play an important role.
[0003] When generating article content, users are usually required to manually input a large amount of initial information, and use certain rules and template generation tools to generate text content based on the initial information, or regenerate the content based on historical articles or article content. This method is not only time-consuming and labor-intensive, but also usually generates a text content around a topic, which limits the diversity of the generated content.
[0004] Currently, there is no effective solution to the above problems. Summary of the invention
[0005] Multiple aspects of the present application provide a content generation method, device, storage medium and program product for simultaneously generating multiple articles of multiple dimensions for the same subject area, improving article generation efficiency and the diversity of article content, thereby attracting user traffic.
[0006] The embodiment of the present application provides a method for generating text content, including: generating an article title corresponding to each article content and the second content constraint information in the third model prompt word; and generating multiple target articles under the field theme according to each article content and its corresponding article title.
[0007] An embodiment of the present application also provides an electronic device, including: a memory and a processor; the memory is used to store a computer program; the processor is coupled to the memory and is used to execute the computer program to implement the steps in the above method.
[0008] An embodiment of the present application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor implements the steps in the above method.
[0009] An embodiment of the present application also provides a computer program product, which includes a computer program / instructions. When the computer program / instructions are executed by a processor, the processor is enabled to implement the steps in the above method.
[0010] In the embodiment of the present application, the topic generation model, the content generation model and the title generation model are combined, and the output of each model and the prompt word corresponding to the next model are used as the input of the next model in turn. Under the guidance of the prompt word corresponding to each model, multiple target subtitles adapted to the domain theme to which the article to be generated belongs represented by the topic description information, the article content corresponding to each target subtitle and the article title corresponding to each article content are generated in turn, so that multiple target articles under the domain theme are generated according to each article content and its corresponding article title. Thus, the article generation process is modularized, and each module uses different models and prompt words, so that multiple articles corresponding to multiple dimensions can be generated simultaneously for the same domain theme, improving the efficiency of article generation and the diversity of article content, thereby attracting user traffic. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0012] Figure 1a A flowchart of each module involved in a content generation method provided by an exemplary embodiment of the present application;
[0013] Figure 1b A flowchart of a content generation method provided by an exemplary embodiment of the present application;
[0014] Figure 1c A schematic diagram of a directory structure provided for an exemplary embodiment of the present application;
[0015] Figure 2 A schematic diagram of the structure of an electronic device provided as an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0016] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0017] 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 this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0018] In view of the technical problems that the process of generating articles is time-consuming and the content of articles is relatively simple, in an embodiment of the present application, a theme generation model, a content generation model and a title generation model are combined, and the output of each model and the prompt word corresponding to the next model are used as the input of the next model in turn. Under the guidance of the prompt word corresponding to each model, multiple target subtitles adapted to the domain theme to which the article to be generated belongs represented by the theme description information, the article content corresponding to each target subtitle and the article title corresponding to each article content are generated in turn, so that multiple target articles under the domain theme are generated according to each article content and its corresponding article title. Thus, the article generation process is modularized, and each module uses different models and prompt words, so that multiple articles corresponding to multiple dimensions can be generated simultaneously for the same domain theme, improving the efficiency of article generation and the diversity of article content, thereby attracting user traffic.
[0019] The embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0020] In the embodiments of the present application, a Chain of Thought (COT) chain can be introduced. The COT chain is an improved prompt technology, which aims to improve the performance of large models on complex reasoning tasks, such as arithmetic reasoning, common sense reasoning, symbolic reasoning, etc., by requiring the model to explicitly output the intermediate step-by-step reasoning steps before outputting the final answer, thereby enhancing the arithmetic, common sense and reasoning capabilities of the large model. The working principle of the COT chain is to help large language models improve their reasoning capabilities when handling complex tasks by simulating the step-by-step thinking process of humans. The COT chain provides a prompt COT prompt strategy, which requires the model to not only output the final answer, but also to show the intermediate reasoning steps, which helps the model better understand the context and complexity of the problem, avoid jumping errors, and improve the accuracy of the answer and the interpretability of the model output. The types of COT chains include but are not limited to the following: Zero-Shot-CoT and Few-Shot-CoT. Zero-Shot-CoT does not add examples, but only adds a line of classic "Let's think step by step" in the instructions to "awaken" the reasoning ability of the large model. Few-Shot-CoT describes the "problem-solving steps" in detail in the examples, allowing the model to obtain reasoning ability based on the "problem-solving steps" provided in the examples. Advantages of COT chains: It greatly improves the performance of LLM on complex reasoning tasks, and the output intermediate steps make it easier for users to understand the thinking process of the model, improving the interpretability of large model reasoning. Application of COT chains: By guiding the model to generate a detailed reasoning process, the accuracy and interpretability of the model are improved, and it is suitable for complex problems that require multi-step logical reasoning. In short, COT chains are a powerful technology that helps the model analyze and solve problems step by step by inserting a series of logical reasoning steps between the input and output of the model, thereby improving the model's problem-solving ability and the transparency of the decision-making process.
[0021] In the embodiment of the present application, the COT chain can be applied to the batch generation scenario of articles, and the model can be guided to perform logical reasoning through a series of prompt words with guiding model logical reasoning steps constructed by the COT chain. Figure 1aAs shown in the figure, the COT chain can be used to divide the article batch generation process into multiple modules, and each module is executed in a specific order to efficiently generate articles on specific domain themes, and can comprehensively cover different writing needs from multiple angles. This modular process not only improves the efficiency of batch generation of articles, but also ensures the diversity and depth of the article content, and meets the diversified creation needs. The COT chain is configured with corresponding prompt words for each module to guide the logical reasoning steps of the model in each module through the prompt words. The multiple modules include: information acquisition module, subtitle generation module, article content generation module, article title generation module, and article generation module, wherein the information acquisition module is used to obtain the article domain theme input by the user; the article content generation module is used to generate subtitles from multiple angles; the article content generation module is used to generate corresponding limited style article content according to the subtitles of each angle; the article title generation module is used to generate article titles corresponding to each article content; the article generation module is used to generate multiple articles under the domain theme according to each article content and its corresponding article title.
[0022] Furthermore, multiple articles under the generated domain theme can be published to at least one application. The at least one application can be an application that generates multiple articles or other applications associated with the application. The application can be an independently running APP or a small program that depends on the APP to run, which is not limited in this embodiment.
[0023] Figure 1b The exemplary embodiments of the present application provide Figure 1a The flowchart of the content generation method corresponding to each module in FIG. Figure 1b As shown, the method includes:
[0024] 101. Obtaining subject description information input by a user, where the subject description information represents the subject of the field to which the article to be generated belongs;
[0025] 102. Input the topic description information and the first model prompt word into the target topic generation model, generate a main title according to the topic description information, split the main title into multiple levels of subtitles according to the directory structure used to describe the topic word splitting level in the first model prompt word, and output multiple target subtitles in the multiple levels of subtitles;
[0026] 103. Input each target subtitle and the second model prompt word into the target content generation model, and generate the article content corresponding to each target subtitle according to the subject description information and the first content constraint information contained in the second model prompt word;
[0027] 104. Add each article content to the third model prompt word and input into the target title generation model, and generate an article title corresponding to each article content according to each article content in the third model prompt word and the second content constraint information;
[0028] 105. Generate multiple target articles under the domain theme based on the content of each article and its corresponding article title.
[0029] The embodiments of the present application do not limit the specific description method of the subject description information input by the user. For example, the subject description information can be a word, a sentence, a paragraph of text, a picture, and so on. The subject description information represents the domain theme to which the article to be generated belongs. This embodiment does not specifically limit the domain theme. For example, the domain theme can be a first-level category such as housekeeping, maintenance, and recycling; or, the domain theme can also be a second-level category or more categories such as a nanny, a babysitter, home appliance repair, house repair, home appliance recycling, and mobile phone recycling. Taking the domain theme of "baby-sitter" as an example, the subject description information input by the user corresponding to the domain theme may be "baby-sitter"; or, the subject description information may also be a sentence or a paragraph that directly or indirectly describes the baby-sitter, for example, "Please generate multiple related articles with baby-sitter as the domain theme", "Professionals who specialize in taking care of babies and assisting postpartum women, whose main job responsibilities include but are not limited to: baby care, postpartum care, housekeeping assistant, early education, cooking, etc.", "Interact with babies, promote the sensory and cognitive development of babies, and stimulate the baby's early learning through games and activities", "Cook for babies, feed babies, including breastfeeding or bottle feeding, bathe babies, change diapers and clothes, observe the growth and development of babies, such as weight, height, etc., to ensure the safety and health of babies", etc.
[0030] This embodiment does not limit the specific implementation method of the subject description information input by the user. For example, the user can enter the subject description information on the subject description information filling interface provided by the corresponding service application installed on the user terminal device; or, the user sends the subject description information and the demand information for generating multiple articles based on the field subject corresponding to the subject description information to the corresponding service application by email or text message; or, the corresponding service application will send a promotional link to the user by email or text message, and the user can fill in the subject description information through the promotional page corresponding to the promotional link. User terminal devices include but are not limited to mobile devices such as mobile phones or tablets, wearable devices such as smart watches, tablet computers or desktop computers, etc.
[0031] In an embodiment of the present application, after obtaining the topic description information input by the user, the topic description information and the first model prompt word can be input into the target topic generation model, a main title can be generated according to the topic description information, and the main title can be split into multiple levels of sub-titles according to the directory structure used to describe the topic word splitting hierarchy in the first model prompt word, and multiple target sub-titles in the multi-level sub-titles can be output.
[0032] In some embodiments, the first model prompt word includes: a main title prompt word, the main title prompt word includes: a third content description information, the third content description information includes: style constraint information, word count constraint information and / or format constraint information, and the directory structure prompt word includes: information for describing the directory structure of the subject word split level. In addition, the target subject generation model includes: a main title generation network layer, which is used to generate the main title according to the subject description information. Based on this, the main title is generated according to the subject description information. The optional implementation method includes: inputting the subject description information and the main title prompt word into the main title generation network layer, extracting keywords from the subject description information; selecting an initial main title adapted to the keyword from the main title database according to the keyword; generating a target main title as the main title corresponding to the subject description information according to the style constraint information, word count constraint information and / or format constraint information described in the main title prompt word. Alternatively, inputting the subject description information into the main title generation network layer, extracting key semantic information of the subject description information; generating an initial main title according to the key semantic information; generating a target main title as the main title corresponding to the subject description information according to the style constraint information, word count constraint information and / or format constraint information described in the main title prompt word.
[0033] It should be noted that the various prompt words involved in the context embodiments of the present application may include the specific implementation methods of the corresponding processes in the prompt words, and then the model outputs the results under the step-by-step guidance of the specific implementation methods included in the prompt words, or the prompt words may only include prompt events, and the prompt events are used to inform the model or each network layer of the model what the output results should be, and then the model or each network layer of the model performs the corresponding data processing process according to the output results. This embodiment does not limit this. For example, the specific implementation method of generating the main title according to the subject description information mentioned above can be the prompt content included in the main title prompt words, and the target subject generation model completes the generation process of the main title under the prompt of the main title prompt words; or, the main title prompt words only include the prompt that the target subject generation model needs to generate the main title, and the implementation method of generating the main title according to the subject description information is the function of the target subject generation model itself.
[0034] In some embodiments, the first model prompt word also includes: a model role prompt word, which is used to instruct the target theme generation model to generate a sub-title of a partial guidance tutorial type in the role of a technical expert corresponding to the domain theme. The sub-title of the partial guidance tutorial type can be understood as a sub-title with a guiding function. For example, the sub-title is "Daily Work of a Nanny". Then when the user wants to know the specific content of the daily work of a nanny, he can directly find the specific content of the nanny's work according to the sub-title. Based on this, according to the directory structure used to describe the hierarchy of the subject word splitting in the first model prompt word, the main title is split into multiple levels of sub-titles. Optional implementation methods include: under the prompt of the model role prompt word, according to the directory structure, the main title is split into multiple levels of partial guidance tutorial sub-titles. Among them, in order to ensure that the output multiple sub-titles have clear practical meanings and to ensure that each sub-title is clearly positioned in the overall content, the directory structure can choose the following format (taking the directory structure containing a secondary directory as an example):
[0035] {{"title":"xxx","directory":[{{"dir 1":["sub dir 1","sub dir 2"]}},{{"dir 2":["sub dir 3","sub dir 4"]}}]}}, where "title" represents the main title; "directory" represents the directory structure; "dir 1" represents the main directory; and "sub dir 1" represents the sub-directory.
[0036] In some embodiments, the first prompt word also includes: a directory structure prompt word, which is used to describe the directory structure of the subject word split level. The target subject generation model also includes: a subtitle generation network layer, which is used to generate multiple subtitles based on the main title. Accordingly, after obtaining the main title, the main title and the directory structure prompt word are input into the subtitle generation network layer, and the subject is split into multiple levels of subtitles according to the directory structure prompt word used to describe the directory structure of the subject word split level, and multiple target subtitles in the multi-level subtitles are output.
[0037] In some embodiments, the directory structure includes: multiple main directories, each main directory includes multiple subdirectories. Based on this, under the prompt of the model role prompt word, according to the directory structure, the main title is split into multiple levels of subtitles of the guidance and tutorial categories, including: under the prompt of the model role prompt word, according to the multiple main directories, the main title is split into multiple first-level subtitles, each first-level subtitle corresponds to a main directory; according to the multiple subdirectories under each main directory, the first-level subtitle corresponding to each main directory is split into multiple second-level subtitles, each second-level subtitle corresponds to a subdirectory.
[0038] Optionally, under the prompt of the model role prompt word, according to the multiple main directories, the main title is split into multiple first-level sub-titles, and each first-level sub-title corresponds to a main directory, including: document structure recognition, which requires identifying the structure in the document, especially the main title and the main directory, which can be achieved through natural language processing (NLP) technology, such as using regular expressions to match the title pattern, or using a specific NLP library to identify the title and directory structure; title and directory mapping, determining the relationship between each main title and its corresponding main directory, which involves analyzing the hierarchical structure of the document and associating each main title with the sub-directory under it. For example, text processing technology can be used, such as HTMLHeaderTextSplitter or MarkdownHeaderTextSplitter, which can be used to accurately map the title hierarchy. Accurate segmentation while retaining the context and structural information of the text; encoding, using an encoder to encode the content under each main directory and convert the text into an intermediate vector representation. This step can use a pre-trained model, such as BERT or LSTM, to obtain the deep semantic representation of the text; decoding, the decoder generates a first-level subtitle word by word based on the vector representation obtained in the encoding stage. The decoder can be a model based on the attention mechanism, which can predict the next most likely word based on the output of the encoder and the generated title content; subtitle generation, based on the prompts of the model role prompt words, combined with the results of encoding and decoding, generates the first-level subtitle corresponding to each main directory. This step can be implemented through a machine learning model. The model needs to be trained to recognize the relationship between the main title and the subtitle and generate appropriate subtitles.
[0039] Accordingly, outputting multiple target subheadings in the multi-level subheadings includes: outputting multiple secondary subheadings as multiple target subheadings. Alternatively, when the secondary subheadings corresponding to each primary subheading do not exist, multiple primary subheadings can be output as multiple target subheadings. Alternatively, when the secondary subheadings corresponding to some primary subheadings do not exist, and the secondary subheadings corresponding to another portion of primary subheadings exist, the first portion of the primary subheadings and the other portion and the secondary subheadings corresponding to the subheadings can be output as multiple target subheadings. Figure 1c This is an exemplary schematic diagram of a directory structure, and the multiple target subheadings corresponding to the output in this diagram are all secondary subheadings.
[0040] Furthermore, under the prompt of the model role prompt word, the main title is split into multiple levels of sub-titles of the guidance and tutorial type according to the directory structure, including: under the prompt of the model role prompt word, according to multiple main directories, the main title is split into multiple first-level sub-titles, each first-level sub-title corresponds to a main directory; according to multiple sub-directories under each main directory, the first-level sub-title corresponding to each main directory is split into multiple second-level sub-titles, each second-level sub-title corresponds to a sub-directory; according to a sub-directory corresponding to each second-level sub-title, the second-level sub-title corresponding to each second-level sub-directory is split into third-level sub-titles, each third-level sub-title corresponds to a sub-directory.
[0041] Accordingly, outputting multiple target subheadings in the multi-level subheadings includes: outputting multiple third-level subheadings as multiple target subheadings. Alternatively, in the case where the second-level subheadings corresponding to some first-level subheadings do not exist, and the second-level subheadings corresponding to another part of the first-level subheadings exist and the third-level subheadings corresponding to each second-level subheading exist, the first-level subheadings and the third-level subheadings corresponding to each second-level subheading can be output as multiple target subheadings. Alternatively, in the case where the second-level subheadings corresponding to some first-level subheadings do not exist, and the second-level subheadings corresponding to another part of the first-level subheadings exist and the third-level subheadings corresponding to some second-level subheadings exist, the first-level subheadings, the third-level subheadings corresponding to each second-level subheading and the second-level subheadings in another part where the third-level subheadings do not exist can be output as multiple target subheadings.
[0042] Take the main title "Nursing Nanny" and the directory structure includes secondary subdirectories as an example. The first-level subtitles can be, for example, "baby care", "maternal care", "housework assistant", "early education", "night care", "health monitoring", "safety education" or "nutrition guidance", etc. Among them, the secondary subtitles corresponding to "baby care" can be, for example, "how to feed a baby", "how to bathe a baby", "how to change diapers and clothes", "how to observe the growth and development of a baby" or "how to ensure the safety and health of a baby", etc. The secondary subtitles corresponding to "maternal care" can be, for example, "how to assist a mother in postpartum recovery", "how to help a mother with breast care", "breastfeeding guidance" or "how to provide psychological support and emotional counseling for a mother", etc. The secondary subtitles corresponding to "housework assistant" can be, for example, "how to clean and tidy up the baby's room and the mother's room", "how to wash baby clothes and bedding", "how to prepare simple family meals", etc. The secondary subtitles corresponding to "early education" can be, for example, "how to interact with a baby" or "how to stimulate a baby's early learning through games and activities", etc. The second-level sub-titles for "night care" can be, for example, "How to take care of a baby at night" or "How to feed at night", etc. The second-level sub-titles for "health monitoring" can be, for example, "How to monitor the health of a baby" or "How to promptly detect and report any abnormalities of a baby", etc. The second-level sub-titles for "safety education" can be, for example, "Educate babies on basic safety knowledge" or "How to protect the mental or physical health of babies", etc. The second-level sub-titles for "nutritional guidance" can be, for example, "nutritional advice" or "nutritional recipes", etc.
[0043] Furthermore, the directory structure may also include sub-titles at or above the third level. For the corresponding output of multiple target sub-titles in the multi-level sub-titles, please refer to the relevant description of the above embodiments, which will not be repeated here.
[0044] Furthermore, the first prompt word also includes: a directory generation prompt word, which is used to guide the target topic generation model to generate a directory corresponding to the main title according to the directory structure and multiple target subtitles described in the directory structure prompt word after outputting multiple target subtitles, so as to generate each part of the article content according to the directory corresponding to the main title.
[0045] Furthermore, in order to ensure the accuracy and structural integrity of the directory corresponding to the main title, the first prompt word also includes: a verification prompt word and a correction prompt word, the verification prompt word is used to describe the verification conditions of the directory, and the correction prompt word is used to describe the correction conditions of the directory. Based on this, after obtaining the directory structure corresponding to the main title, the directory corresponding to the main title is verified according to the verification conditions contained in the verification prompt word to ensure that the format of each part is correct, thereby avoiding data parsing failure or generation interruption due to format errors. Further, in the case where the verification result is a verification failure, the directory is corrected according to the correction prompt word used to describe the correction conditions of the revised directory to obtain a revised directory corresponding to the main title. Among them, the verification prompt word includes but is not limited to: whether the use of each symbol is correct and / or whether the association relationship between each symbol is correct, and in the case of incorrectness, the result of verification failure is output. The correction prompt word includes but is not limited to: the use position of each symbol and the association relationship between each symbol.
[0046] In an embodiment of the present application, after obtaining multiple target subtitles, each target subtitle and the second model prompt word can be input into the target content generation model, and the article content corresponding to each target subtitle is generated according to the subject description information and the first content constraint information contained in the second model prompt word. Wherein, the first content constraint information includes but is not limited to: style constraint information, word count constraint information and / or format constraint information; style constraint information refers to the requirements for the writing style or tone of the generated article content to ensure that the output content conforms to the expected cultural and emotional context, for example, the style constraint information can be: spoken expression, fluent sentences, reasonable segmentation or language description that conforms to the target platform, as many emoticons as possible, etc.; word count constraint information refers to the word count requirement of the generated article content, for example, the word count constraint information can be: the word count of each article does not exceed 500 words and / or the word count of each paragraph does not exceed 250 words; format constraint information refers to layout specification information, and format constraint information can be, for example, font size, font color, paragraph spacing or line spacing, etc. In addition, this embodiment does not limit the input method of inputting each target subtitle and the second model prompt word into the target content generation model. For example, multiple target subtitles can be input into the target content generation model at one time to generate the article content corresponding to each target subtitle at the same time. Alternatively, multiple target subtitles can be input into the target content generation model one by one to generate the article content corresponding to each target subtitle in sequence.
[0047] In some embodiments, according to the subject description information and the first content constraint information contained in the second model prompt word, the article content corresponding to each target subtitle is generated, including: using the subject description information as the field restriction information of each target subtitle to generate the initial content corresponding to each target subtitle; according to the style constraint information, word count constraint information and / or format constraint information in the first content constraint information, the initial content is corrected to obtain the article content. Taking the subject description information as "childcare nanny" and the subtitle as "cooking" as an example, in real life, there are many positions that can cook for babies, such as "chef, housekeeping aunt, live-in nanny" and other positions can cook for babies, but "chef, housekeeping aunt, live-in nanny" and other positions are not within the scope of "childcare nanny", then when generating the initial article content corresponding to the subtitle "childcare nanny-cooking", the article content cannot include "chef, housekeeping aunt, live-in nanny" and other positions cooking.
[0048] In some embodiments, the topic description information is used as the domain restriction information of each target subtitle to generate the initial content corresponding to each target subtitle, including: predicting multiple candidate characters corresponding to the next character and the probability value corresponding to each candidate character based on the domain restriction information of each target subtitle and the previous semantic information, the next character corresponds to initial content position information, and the initial content position information is used to indicate the position of the character in the initial content corresponding to the target subtitle; for the same initial content position information corresponding to different merchants, selecting characters with different probabilities as the characters at the position referred to by the initial position content information, so as to obtain different initial content for different merchants.
[0049] In some embodiments, the initial content is modified according to the style constraint information, word count constraint information and / or format constraint information in the first content constraint information to obtain the article content, including: adjusting the writing style of the initial content according to the style constraint information to obtain the first intermediate state content that meets the target style; adjusting the word count of the first intermediate state content according to the word count constraint information to obtain the second intermediate state content that meets the target word count; and adjusting the format of the second intermediate state content according to the format constraint information to obtain the article content in a specific format.
[0050] Optionally, the initial content is modified according to the style constraint information, word count constraint information and / or format constraint information in the first content constraint information to obtain the article content, including: identifying the language style requirements at least contained in the style constraint information in the first content constraint information, the language style requirements may be, for example, concise, accurate, logically clear, objective and neutral, and avoid verbosity; analyzing the initial content to identify the style characteristics of the initial content, the style characteristics may be, for example, the complexity of the language, the use of terms, the logical structure, etc.; formulating a specific adjustment strategy according to the analysis results of the style constraint information and the initial content, the adjustment strategy may, for example, This is to change the vocabulary selection, adjust the sentence structure, increase or decrease the use of professional terms, adjust the organization and presentation of information, etc.; modify the initial content according to the established strategy, such as rewriting certain sentences or paragraphs to conform to the target style, or replace complex technical terms with more understandable expressions, or simplify lengthy sentence structures; review the adjusted initial content to ensure that it conforms to the target style; if the adjusted content does not conform to the target style, further modify it according to the above steps until the content meets the target style requirements; use the article content that fully conforms to the target style as the first intermediate state content. By adjusting the style of the article content to conform to the set language style requirements, the readability and comprehensibility of the document can be improved, thereby improving the conversion rate of the article content.
[0051] Optionally, the word count of the first intermediate state content is adjusted according to the word count constraint information to obtain the second intermediate state content that meets the target word count, including: clarifying the specific requirements of the word count constraint; using a word count tool (such as a word count function of a word processing software) to determine the current word count of the first intermediate state content; analyzing the information density of the first intermediate state content to identify which parts contain key information and which parts can be streamlined or expanded; formulating a word count adjustment strategy according to the specific requirements of the word count constraint and the word count of the first intermediate state content. For example, when the word count of the first intermediate state content exceeds the specific requirements of the word count constraint, unnecessary details and repeated information can be removed, similar ideas or paragraphs can be merged, or more concise vocabulary and sentence structures can be used.
[0052] Optionally, the format constraint information includes but is not limited to: determining specific format requirements, the format requirements include but are not limited to page settings, font and paragraph formats, title and subtitle formats, formats of tables and figures, etc.; page settings, such as setting the page size to a preset size, adjusting the page margins to preset values (such as setting the top, bottom, left, and right margins to 2.54 cm); font and paragraph format adjustment, such as setting the text font to Songti size 5, the first line indentation to 2 characters, and the line spacing to single; title and subtitle format adjustment, such as using bold font size 4 for the first-level title and bold font size 5 for the second-level title; table or figure adjustment, such as when inserting a table, ensure that the lines are clear, the font size is consistent with the text, the text is vertically centered, the content is uniform, the figures should be black and white, do not contain a scale indication, and use Arabic numerals to mark the order of the figures. Accordingly, according to the above format constraint information, the second intermediate state content is formatted to obtain article content in a specific format.
[0053] In some embodiments, an article title corresponding to each article content is generated based on each article content in the third model prompt word and the second content constraint information, including: performing word segmentation processing on each article content to obtain multiple word segments, and extracting keywords from the multiple word segments; generating an initial title based on the keywords; and correcting the initial title based on the style constraint information, word count constraint information and / or format constraint information in the second content constraint information to obtain the article title.
[0054] Optionally, each article content is segmented to obtain multiple segmented words, including: preprocessing the text of each article content, such as removing punctuation marks, converting to lowercase (for case-sensitive languages), removing stop words, etc., to reduce the complexity of subsequent processing and improve the accuracy of word segmentation; further, different word segmentation algorithms are selected according to different languages and application scenarios. For example, for languages without obvious separators such as Chinese, commonly used word segmentation algorithms include but are not limited to: rule-based methods, statistical methods and deep learning-based methods. Rule-based methods such as Maximum Matching (MM) and Reverse Maximum Matching (RMM) use predefined dictionaries and rules for word segmentation. Statistical methods such as Hidden Markov Model (HMM) and Conditional Random Field (CRF) use large-scale corpora and statistical information for word segmentation. Deep learning-based methods can use neural network models such as Recurrent Neural Network (RNN), Long Short-Term Memory Network (Long Short-Term Memory Network) and Deep Learning-Based Methods. Memory, LSTM), Transformer, etc.; further, use word segmentation tools or libraries to implement word segmentation. For example, for Chinese, you can use jieba word segmentation library, pkuseg, THULAC, etc. These tools usually have integrated a variety of word segmentation algorithms and allow users to customize dictionaries to improve the accuracy of word segmentation; further, input the preprocessed text into the word segmentation tool, and the word segmentation tool segments the text according to the built-in algorithm and dictionary. For example, when using the jieba word segmentation library, you can directly get the word segmentation result list through the lcut function; further, on the basis of word segmentation, perform part-of-speech tagging on each word segmentation, that is, mark each word segmentation result with its part of speech (noun, verb, etc.) to facilitate further natural language processing tasks to obtain multiple word segmentations.
[0055] Optionally, the initial title is generated based on keywords, including: the encoding stage, using an encoder to encode the text and convert the text into an intermediate vector representation. This step uses a pre-trained model, such as BERT or LSTM, to obtain the deep semantic representation of the text; the decoding stage, the decoder generates the title word by word based on the vector representation obtained in the encoding stage, and can specifically predict the next most likely word based on the output of the encoder and the content of the generated title; the title generation stage, after determining the theme and keywords of the text, combines template matching, language generation and other technologies to generate the title. The API will generate multiple titles that meet the requirements based on the preset title templates and rules, combined with the theme and keywords of the text; the title optimization stage, the generated title is optimized to check whether the grammar and semantics of the title are correct, whether it conforms to reading habits, and whether it contains sensitive words. Through optimization, it is ensured that the generated title is both in line with the content theme and can attract readers' attention.
[0056] Optionally, if the style constraint information in the second content constraint information is a title example with a specific style, the initial title is modified according to the style constraint information in the second content constraint information to obtain the article title, including: learning the ability to generate a title in a specific style according to the title example; and modifying the initial title according to the ability to generate a title in a specific style to obtain the article title.
[0057] Further optionally, multiple target articles can be published to a target platform, and the first content constraint information, the second content constraint information, and the third content constraint information corresponding to the multiple target articles published to the target platform are associated with the style of the target platform, and the first content constraint information, the second content constraint information, and the third content constraint information corresponding to different platforms may be the same or different. In addition, each prompt word in the embodiment of the present application may also be associated with the target platform to be published, and the prompt words corresponding to different platforms may be the same or different. Then before generating multiple target articles, the target platform to be published of the target article can be determined first, so as to generate multiple target articles according to the constraint information and prompt words corresponding to the target platform. Correspondingly, before generating multiple target articles, the user can first select the target platform to be published, and generate corresponding multiple target articles according to the constraint information and prompt words of the target platform to be published.
[0058] Further optionally, before generating multiple target articles, the user may first select multiple target platforms to be published, and then generate corresponding multiple target articles according to the constraint information and prompt words of each target platform in the multiple target platforms to be published.
[0059] Further optionally, the target topic generation model, the target content generation model and the target title generation model are obtained through model training, then the training process of each model, the optional implementation method includes: obtaining sample data, the sample data includes sample topic description information, a benchmark subtitle corresponding to the sample description information and a benchmark article corresponding to the sample topic description information, the benchmark article includes a benchmark article content and a benchmark article title; inputting the sample topic description information and the first model prompt word into the initial topic generation model, generating a sample main title according to the sample topic description information, splitting the main title into multiple levels of subtitles according to the directory structure used to describe the topic word splitting hierarchy in the first model prompt word, and outputting multiple target sample subtitles in the multi-level subtitles; inputting each target sample subtitle and the second model prompt word into the initial content generation model, based on the sample topic description information and the first model prompt word. Generate sample article content corresponding to each target sample subtitle according to the topic description information and the first content constraint information contained in the second model prompt word; add each sample article content to the third model prompt word and input the initial title generation model, and generate a sample article title corresponding to each sample article content according to each sample article content and the second content constraint information in the third model prompt word; generate multiple target sample articles under the domain theme according to each sample article content and its corresponding sample article title; generate a target loss function according to the sample articles and the benchmark articles, and when the target loss function does not meet the model training conditions, continue to adjust the network parameters in each model until the target loss function meets the model training conditions, so as to obtain a target topic generation model, a target content generation model and a target title generation model.
[0060] Optionally, a target loss function is generated based on the sample article and the benchmark article, including: generating a first loss function based on the target sample subtitle and the benchmark subtitle; generating a second loss function based on the sample article content and the benchmark article content; generating a third loss function based on the sample article title and the benchmark article title; generating a target loss function based on the first loss function, the second loss function and / or the third loss function.
[0061] Further optionally, generating a target loss function based on the sample article and the benchmark article includes: generating a target loss function based on the first loss function, the second loss function and the third loss function; or, generating a target loss function based on the first loss function and the second loss function; or, generating a target loss function from the first loss function and the third loss function; or, generating a target loss function from the second loss function and the third loss function.
[0062] The technical solutions provided by the above-mentioned embodiments of the present application combine the topic generation model, the content generation model and the title generation model, and sequentially use the output of each model and the prompt word corresponding to the next model as the input of the next model. Under the guidance of the prompt word corresponding to each model, multiple target subtitles adapted to the domain theme to which the article to be generated belongs represented by the topic description information, the article content corresponding to each target subtitle and the article title corresponding to each article content are sequentially generated, thereby generating multiple target articles under the domain theme according to each article content and its corresponding article title. Thus, the article generation process is modularized, and each module uses different models and prompt words, so that multiple articles corresponding to multiple dimensions can be generated simultaneously for the same domain theme, improving the efficiency of article generation and the diversity of article content, thereby attracting user traffic.
[0063] Figure 2 The schematic diagram of the structure of the electronic device provided by the exemplary embodiment of the present application. Figure 2 As shown, it includes: a memory 20a and a processor 20b; the memory 20a is used to store a computer program; the processor 20b is coupled to the memory 20a and is used to execute the computer program to implement the following steps:
[0064] The subject description information input by the user is obtained, and the subject description information represents the domain subject to which the article to be generated belongs; the subject description information and the first model prompt word are input into the target subject generation model, and a main title is generated according to the subject description information; the main title is split into multiple subtitles according to the directory structure used to describe the subject word splitting level in the first model prompt word, and multiple target subtitles in the multi-level subtitles are output; each target subtitle and the second model prompt word are input into the target content generation model, and the article content corresponding to each target subtitle is generated according to the subject description information and the first content constraint information contained in the second model prompt word; each article content is added to the third model prompt word and input into the target title generation model, and the article title corresponding to each article content is generated according to each article content and the second content constraint information in the third model prompt word; and multiple target articles under the domain subject are generated according to each article content and its corresponding article title.
[0065] In some embodiments, the first model prompt also includes: a model role prompt, which is used to instruct the target subject generation model to generate a subtitle of a tutorial type based on the role of a technical expert corresponding to the domain subject. Based on this, according to the directory structure used to describe the hierarchy of the subject word splitting in the first model prompt, the main title is split into multiple levels of subtitles, including: under the prompt of the model role prompt, according to the directory structure, the main title is split into multiple levels of subtitles of a tutorial type.
[0066] In some embodiments, the directory structure includes: multiple main directories, each main directory includes multiple subdirectories. Based on this, when the processor, under the prompt of the model role prompt word, splits the main title into multiple levels of sub-titles of the tutorial type according to the directory structure, it is specifically used to: under the prompt of the model role prompt word, according to the multiple main directories, split the main title into multiple first-level subtitles, each first-level subtitle corresponds to a main directory; according to the multiple subdirectories under each main directory, split the first-level subtitle corresponding to each main directory into multiple second-level subtitles, each second-level subtitle corresponds to a subdirectory.
[0067] Accordingly, when outputting a plurality of target subheadings in a multi-level subheading, the processor is specifically configured to: output a plurality of second-level subheadings as a plurality of target subheadings.
[0068] In some embodiments, when the processor generates the article content corresponding to each target subheading based on the subject description information and the first content constraint information contained in the second model prompt word, it is specifically used to: use the subject description information as the field restriction information of each target subheading to generate the initial content corresponding to each target subheading; and modify the initial content based on the style constraint information, word count constraint information and / or format constraint information in the first content constraint information to obtain the article content.
[0069] In some embodiments, when the processor uses the topic description information as the domain restriction information of each target subtitle and generates the initial content corresponding to each target subtitle, it is specifically used to: predict multiple candidate characters corresponding to the next character and their corresponding probability values based on the domain restriction information of each target subtitle and the previous semantic information, the next character corresponds to initial content position information, and the initial content position information is used to indicate the position of the character in the initial content corresponding to the target subtitle; for the same initial content position information corresponding to different merchants, select characters with different probabilities as the characters at the position referred to by the initial position content information, so as to obtain different initial content for different merchants.
[0070] In some embodiments, when the processor modifies the initial content according to the style constraint information, word count constraint information and / or format constraint information in the first content constraint information to obtain the article content, it is specifically used to: adjust the writing style of the initial content according to the style constraint information to obtain a first intermediate state content that meets the target style; adjust the number of words of the first intermediate state content according to the word count constraint information to obtain a second intermediate state content that meets the target word count; and adjust the format of the second intermediate state content according to the format constraint information to obtain article content in a specific format.
[0071] In some embodiments, when the processor generates an article title corresponding to each article content based on each article content in the third model prompt word and the second content constraint information, it is specifically used to: perform word segmentation processing on each article content to obtain multiple word segments, and extract keywords from the multiple word segments; generate an initial title based on the keywords; and modify the initial title based on the style constraint information, word count constraint information and / or format constraint information in the second content constraint information to obtain the article title.
[0072] In some embodiments, the style constraint information in the second content constraint information is a title example with a specific style. Based on this, when the processor modifies the initial title according to the style constraint information in the second content constraint information to obtain the article title, it is specifically configured to: learn the ability to generate a title with a specific style according to the title example; and modify the initial title according to the ability to generate a title with a specific style to obtain the article title.
[0073] Further optionally, the processor is also used to publish multiple target articles to at least one platform, and the first content constraint information, the second content constraint information, and the third content constraint information corresponding to the multiple target articles published to each platform are associated with the style of the platform.
[0074] Further optionally, the processor is also used to obtain sample data, the sample data including sample subject description information, a benchmark subtitle corresponding to the sample subject description information, and a benchmark article corresponding to the sample subject description information, the benchmark article including benchmark article content and benchmark article title; input the sample subject description information and the first model prompt word into the initial subject generation model, generate a sample main title according to the sample subject description information, split the main title into multiple levels of subtitles according to the directory structure used to describe the subject word splitting level in the first model prompt word, and output multiple target sample subtitles in the multi-level subtitles; input each target sample subtitle and the second model prompt word into the initial content generation model, and generate a sample main title according to the subject description information contained in the second model prompt word and the first content constraint word. information, generate sample article content corresponding to each target sample subtitle; add each sample article content to the third model prompt word and input it into the initial title generation model, generate a sample article title corresponding to each sample article content according to each sample article content and the second content constraint information in the third model prompt word; generate multiple target sample articles under the domain theme according to each sample article content and its corresponding sample article title; generate a target loss function according to the sample articles and the benchmark articles, and when the target loss function does not meet the model training conditions, continue to adjust the network parameters in each model until the target loss function meets the model training conditions, so as to obtain the target theme generation model, the target content generation model and the target title generation model.
[0075] Optionally, when the processor generates a target loss function based on the sample article and the benchmark article, it is specifically used to: generate a first loss function based on the target sample subtitle and the benchmark subtitle; generate a second loss function based on the sample article content and the benchmark article content; generate a third loss function based on the sample article title and the benchmark article title; generate a target loss function based on the first loss function, the second loss function and / or the third loss function.
[0076] Furthermore, if Figure 2 As shown, the electronic device also includes: a communication component 20c, a display 20d, a power component 20e, an audio component 20f and other components. Figure 2 Only some components are shown schematically, which does not mean that the electronic device only includes Figure 2 Components shown.
[0077] The detailed implementation methods and beneficial effects provided by the embodiments of the present application have been described in detail in the aforementioned embodiments and will not be elaborated in detail here.
[0078] The exemplary embodiments of the present application further provide a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor is caused to implement the steps in the above-mentioned method embodiments.
[0079] An exemplary embodiment of the present application further provides a computer program product, which includes a computer program / instructions. When the computer program / instructions are executed by a processor, the processor is enabled to implement the steps in the above-mentioned method embodiments.
[0080] The above-mentioned memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable programmable read only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.
[0081] The above-mentioned communication component is configured to facilitate wired or wireless communication between the device where the communication component is located and other devices. The device where the communication component is located can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G / LTE, 5G and other mobile communication networks, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wide Band (UWB) technology, Bluetooth (BT) technology and other technologies.
[0082] The above-mentioned display includes a screen, and the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
[0083] The power supply assembly provides power to various components of the device where the power supply assembly is located. The power supply assembly may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device where the power supply assembly is located.
[0084] The above-mentioned audio component can be configured to output and / or input audio signals. For example, the audio component includes a microphone (Microphone, MIC), and when the device where the audio component is located is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in a memory or sent via a communication component. In some embodiments, the audio component also includes a speaker for outputting an audio signal.
[0085] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-readable storage media (including but not limited to disk storage, compact disc read-only memory (Compact Disc Read-Only Memory, CD-ROM), optical storage, etc.) containing computer-usable program code.
[0086] The present application is described with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, and the combination of the process and / or box in the flowchart and / or block diagram can be realized by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for realizing the function specified in one process or multiple processes in the flowchart and / or one box or multiple boxes in the block diagram.
[0087] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0088] These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0089] In a typical configuration, a computing device includes one or more processors (Central Processing Unit, CPU), input / output interface, network interface and memory.
[0090] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0091] Computer readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase-change random access memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0092] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0093] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A content generation method, characterized in that: include: Obtaining subject description information input by a user, wherein the subject description information represents the subject of the field to which the article to be generated belongs; Input the topic description information and the first model prompt word into a target topic generation model, generate a main title according to the topic description information, split the main title into multiple levels of subtitles according to the directory structure used to describe the topic word splitting level in the first model prompt word, and output multiple target subtitles in the multiple levels of subtitles; Input each target subtitle and the second model prompt word into the target content generation model, and generate the article content corresponding to each target subtitle according to the subject description information and the first content constraint information contained in the second model prompt word; Add each article content to the third model prompt word and input it into the target title generation model, and generate an article title corresponding to each article content according to each article content in the third model prompt word and the second content constraint information; According to the content of each article and its corresponding article title, multiple target articles under the subject of the field are generated.
2. The method according to claim 1, characterized in that The first model prompt word also includes: a model role prompt word, which is used to instruct the target topic generation model to generate a subtitle of a tutorial type based on the role of a technical expert corresponding to the domain topic; According to the directory structure used to describe the splitting level of the subject words in the first model prompt words, the main title is split into multiple levels of subtitles, including: Under the prompt of the model role prompt word, the main title is split into multiple levels of sub-titles of the guidance and tutorial categories according to the directory structure.
3. The method according to claim 2, characterized in that The directory structure includes: multiple main directories, each main directory includes multiple sub-directories; under the prompt of the model role prompt word, according to the directory structure, the main title is split into multiple levels of sub-titles of the tutorial class, including: Under the prompt of the model role prompt word, according to the multiple main directories, the main title is divided into multiple first-level subtitles, each first-level subtitle corresponds to a main directory; According to the multiple sub-directories under each main directory, the first-level sub-heading corresponding to each main directory is split into multiple second-level sub-headings, and each second-level sub-heading corresponds to a sub-directory; Correspondingly, outputting a plurality of target subtitles in the multi-level subtitles includes: outputting the plurality of secondary subtitles as the plurality of target subtitles.
4. The method according to claim 1, characterized in that: Generating article content corresponding to each target subtitle according to the topic description information and the first content constraint information contained in the second model prompt word, including: Using the subject description information as the domain restriction information of each target subtitle, generating the initial content corresponding to each target subtitle; The initial content is modified according to the style constraint information, the word count constraint information and / or the format constraint information in the first content constraint information to obtain the article content.
5. The method according to claim 4, characterized in that The subject description information is used as the domain restriction information of each target subtitle to generate the initial content corresponding to each target subtitle, including: Predicting multiple candidate characters corresponding to a next character and their corresponding probability values according to the domain restriction information and the previous semantic information of each target subtitle, wherein the next character corresponds to initial content position information, and the initial content position information is used to indicate the position of the character in the initial content corresponding to the target subtitle; For the same initial content position information corresponding to different merchants, characters with different probabilities are selected as the characters at the position indicated by the initial position content information, so as to obtain different initial contents for different merchants.
6. The method according to claim 4, characterized in that According to the style constraint information, the word count constraint information and / or the format constraint information in the first content constraint information, the initial content is modified to obtain the article content, including: According to the style constraint information, the writing style of the initial content is adjusted to obtain first intermediate state content that meets the target style; According to the word count constraint information, the word count of the first intermediate state content is adjusted to obtain a second intermediate state content that meets the target word count; The second intermediate state content is formatted according to the format constraint information to obtain the article content in a specific format.
7. The method according to claim 1, characterized in that According to each article content in the third model prompt word and the second content constraint information, an article title corresponding to each article content is generated, including: Perform word segmentation processing on the content of each article to obtain multiple word segments, and extract keywords from the multiple word segments; generating an initial title based on the keywords; The initial title is modified according to the style constraint information, the word count constraint information and / or the format constraint information in the second content constraint information to obtain the article title.
8. The method according to claim 7, characterized in that The style constraint information in the second content constraint information is a title example with a specific style; The initial title is modified according to the style constraint information in the second content constraint information to obtain the article title, including: The ability to learn to generate headlines of a particular style based on said headline examples; According to the ability to generate a title of a specific style, the initial title is modified to obtain the article title.
9. The method according to any one of claims 1 to 8, characterized in that Also includes: The multiple target articles are published to at least one platform, and the first content constraint information, the second content constraint information, and the third content constraint information corresponding to the multiple target articles published to each platform are associated with the style of the platform.
10. The method according to any one of claims 1 to 8, characterized in that Also includes: Acquire sample data, the sample data including sample subject description information, a base subtitle corresponding to the sample subject description information, and a base article corresponding to the sample subject description information, wherein the base article includes base article content and a base article title; Input the sample topic description information and the first model prompt word into the initial topic generation model, generate a sample main title according to the sample topic description information, split the main title into multiple levels of subtitles according to the directory structure used to describe the topic word splitting level in the first model prompt word, and output multiple target sample subtitles in the multiple levels of subtitles; Input each target sample subtitle and the second model prompt word into the initial content generation model, and generate sample article content corresponding to each target sample subtitle according to the subject description information and the first content constraint information contained in the second model prompt word; Add each sample article content to the third model prompt word and input into the initial title generation model, and generate a sample article title corresponding to each sample article content according to each sample article content in the third model prompt word and the second content constraint information; Generate multiple target sample articles under the subject of the field according to the content of each sample article and its corresponding sample article title; A target loss function is generated according to the sample article and the benchmark article. When the target loss function does not meet the model training conditions, the network parameters in each model are continuously adjusted until the target loss function meets the model training conditions to obtain a target topic generation model, a target content generation model and a target title generation model.
11. The method according to claim 10, characterized in that Generating a target loss function according to the sample article and the benchmark article includes: Generate a first loss function according to the target sample subtitle and the reference subtitle; Generate a second loss function according to the sample article content and the benchmark article content; Generate a third loss function according to the sample article title and the benchmark article title; A target loss function is generated according to the first loss function, the second loss function and / or the third loss function.
12. An electronic device, characterized in that: include: Memory and processor; The memory is used to store a computer program; the processor is coupled to the memory and is used to execute the computer program to implement the steps in the method according to any one of claims 1 to 11.
13. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the processor is caused to implement the steps in the method according to any one of claims 1 to 11.
14. A computer program product, characterized in that The computer program product comprises a computer program / instruction, which, when executed by a processor, enables the processor to implement the steps of any one of the methods of claims 1-11.
Citation Information
Cited By
Article generation method and device, electronic equipment and storage medium
CN121597831A