Template model essay format optimization method and system
Through preset template sample essay types and format requirements, the content generation AI service is used to generate formatted sample content, which solves the problems of poor reading experience and complex operation of AI application-based website template sample essays, and achieves efficient format orchestration and readability improvement.
Patent Information
- Application Number
- CN202410155400.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-04
- Publication Date
- 2025-08-08
AI Technical Summary
The template sample provided by AI application websites is in plain text form, with poor reading experience and unavailable directly, and requires manual adjustment of the format, resulting in increased user operation difficulty and time consumption.
By presetting the template sample types and format requirements, formatted sample content or files are generated, and paragraphs and formats are arranged using content generation AI services to provide WYSIWYG template sample files.
It improves the readability of template sample articles and user operation efficiency, solves the problem of poor plain text reading experience, and saves users time and difficulty in manually adjusting formats.
Smart Images

Figure CN120449818A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of content-generating AI services, and in particular to a method and system for optimizing the format of a template sample article. Background Art
[0002] AI application websites, after integrating content-generating AI services such as ChatGPT and Wenxin Yiyan, can provide answers to specific user questions. Users can use chat windows or Q&A sessions on the website to request AI-generated templates, such as reports, proposals, plans, questionnaires, briefings, notices, minutes, regulations, and speeches. The AI service will then generate text content based on the questions and provide it to the AI application website, which will then present it to the user.
[0003] Typically, AI application websites present users with plain text returned by AI services, which leads to the following problems:
[0004] (1) Plain text content with no paragraph or formatting. Reading plain text is not a good experience and details are easily missed.
[0005] (2) It cannot be used as a sample template. If you want to use it, you need to copy and paste it into a document, such as a Word file, and then adjust the paragraphs and format manually, which is time-consuming.
[0006] However, such templates need to be arranged in paragraphs and formats that are consistent with their characteristics in order to provide users with a better reading experience and more convenient operation. Therefore, there is an urgent need to provide a template format optimization method and system to solve the above problems. Summary of the Invention
[0007] To this end, it is necessary to provide a website or APP for AI applications. When providing template sample services to users, it can quickly use the text content returned by the content-generating AI service to process paragraphs and formats, and output formatted sample articles that meet different types of needs, thereby solving the problem of poor readability of the original text and providing a what-you-see-is-what-you-get template sample file.
[0008] To achieve the above objectives, the inventors provide a method for optimizing the format of a template sample, comprising the following steps:
[0009] S1, for different template sample types, preset template sample types, corresponding sample format requirements or template files with chapter directory;
[0010] S2, obtain the template type specified by the user;
[0011] S3, generating formatted sample content according to the acquired required template sample type and preset sample format requirements, or processing the generated text content into a formatted sample file and displaying it.
[0012] As a preferred embodiment of the present invention, step S2 further includes: obtaining a template sample type, presenting it to the user for selection, and obtaining a template sample type specified by the user.
[0013] As a preferred embodiment of the present invention, step S3 further includes:
[0014] S301, after receiving the template sample type specified by the user, obtain the preset sample format requirements, generate a prompt statement instruction, send the prompt statement instruction to request the content generation AI service to generate formatted sample content, or process the text content generated by the content generation AI service into a formatted sample file, and return it;
[0015] S302: After parsing the returned formatted sample content or sample file, the sample is displayed as a template sample.
[0016] As a preferred embodiment of the present invention, in step S301, the prompt statement instruction is generated including: paragraph requirements and formatting requirements, and HTML format content is generated according to the requirements; and / or, prompt words are added to the obtained preset HTML template, and HTML format content is generated according to the format of the HTML template according to the requirements.
[0017] As a preferred embodiment of the present invention, in step S3, generating prompt statement instructions includes: generating formatted text content according to a specified chapter directory, or generating an instance file by obtaining a preset template file.
[0018] As a preferred embodiment of the present invention, generating an instance file includes the following steps: when generating a prompt statement instruction, requiring the content generation AI service to extract key elements and element content; after receiving the generated text content, extracting the key elements and element content; based on the extracted key elements and element content, searching for variables corresponding to the key elements in the template file, and filling the corresponding element content into the variables to generate a formatted template; or,
[0019] By extracting key elements from the instance file, and then reversely extracting the element content corresponding to the key elements from the returned result content, filling them into the variables corresponding to the key elements of the instance file, a formatted template sample is generated.
[0020] To achieve the above objectives, the inventors also provide a template format optimization system, comprising:
[0021] The AI application frontend is used to obtain model essay types and display them to users for selection, send the template essay type selected by the user to the AI application backend, and obtain formatted essay content or formatted essay files from the AI application backend for display;
[0022] The AI application backend is used to preset template article types and corresponding article format requirements, or corresponding chapter directories and template files based on different template articles; receive the template article type selected by the user from the AI application frontend, generate prompt statement instructions and send them to the content generation AI service, and receive and process feedback from the content generation AI service;
[0023] Content generation AI services are used to generate formatted sample content or formatted sample files based on instructions from the AI application backend, and then feed them back to the AI application backend.
[0024] As a preferred embodiment of the present invention, the information sent by the AI application background to the content generation AI service includes: generated prompt sentence instructions, the generated prompt sentence instructions include paragraph requirements and formatting requirements, and require the content generation AI service to generate HTML format content; and / or, add prompt words to the obtained preset HTML template, and require the content generation AI service to generate HTML format content according to the format of the HTML template.
[0025] As a preferred embodiment of the present invention, the information sent by the AI application background to the content generation AI service includes: generated prompt statement instructions, the generated prompt statement instructions include requiring the content generation AI service to process it into formatted model content or formatted model files according to the specified chapter directory, or, obtain a preset template file to generate an instance file.
[0026] As a preferred embodiment of the present invention, generating an instance file includes: when generating a prompt statement instruction, the AI application background requires the content generation AI service to extract key elements and element content; after receiving the generated text content, the key elements and element content are extracted; the AI application background searches for variables corresponding to the key elements in the template file based on the extracted key elements and element content, and fills the corresponding element content into the variables to generate a formatted template; or,
[0027] The AI application backend extracts key elements from the instance file, then reversely extracts the element content corresponding to the key elements from the result content returned by the content generation AI service, fills it into the variables corresponding to the key elements of the instance file, and generates a formatted template sample.
[0028] As a preferred embodiment of the present invention, the AI application background includes a template example type acquisition module and a content generation module. The AI application foreground obtains the template example type through the template example type acquisition module. The content generation module is used to receive the template example type selected by the user sent by the AI application foreground, and generate prompt statement instructions, send them to the content generation AI service, and receive feedback from the content generation AI service and process it.
[0029] Different from the existing technology, the above technical solution has the following beneficial effects:
[0030] (1) This method and system effectively solves the problem of poor reading experience of pure text templates provided by large-scale AI services on AI application websites or apps, thereby effectively improving the readability of the content.
[0031] (2) This method and system effectively solve the problem that AI application websites or APPs cannot meet the formatting requirements when obtaining the template sample text provided by the large model AI service and can directly use the formatted document, which effectively saves the user's operation difficulty and time consumption. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 The method flow described in the specific implementation method Figure 1 ;
[0033] Figure 2 The method flow described in the specific implementation method Figure 2 ;
[0034] Figure 3 This is a system framework diagram described in the specific implementation method;
[0035] Figure 4 This is an example diagram of the document described in the specific implementation method. DETAILED DESCRIPTION
[0036] In order to explain the technical content, structural features, achieved objectives and effects of the technical solution in detail, the following is a detailed description in conjunction with specific embodiments and accompanying drawings.
[0037] like Figure 1 and Figure 2 As shown, this embodiment provides a template format optimization method, including the following steps:
[0038] S1, for different template sample types, preset template sample types, corresponding sample format requirements or template files with chapter directory;
[0039] S2, obtain the template type specified by the user;
[0040] S3, generating formatted sample content according to the acquired required template sample type and preset sample format requirements, or processing the generated text content into a formatted sample file and displaying it.
[0041] In the specific implementation process of the above embodiment, step S2 also includes: obtaining the template sample type, displaying it to the user for selection, and obtaining the template sample type specified by the user. Step S3 also includes:
[0042] S301, after receiving the template sample type specified by the user, obtain the preset sample format requirements, generate a prompt statement instruction, send the prompt statement instruction to request the content generation AI service to generate formatted sample content, or process the text content generated by the content generation AI service into a formatted sample file, and return it;
[0043] S302: After parsing the returned formatted sample content or sample file, the sample is displayed as a template sample.
[0044] In the above step S301, the prompt statement instruction is generated including: paragraph requirements and formatting requirements, and the content generation AI service generates HTML format content according to the requirements; and / or, the obtained preset HTML template is added with prompt words, and the HTML format content is generated according to the format of the HTML template according to the requirements.
[0045] In step S3 of the above embodiment, the instruction to generate a prompt statement further includes: requiring the generation of formatted text content according to the specified chapter directory, or generating an instance file by obtaining a preset template file. Generating an instance file includes the steps of: when generating the prompt statement instruction, requiring the extraction of key elements and element content, extracting the key elements and element content after receiving the generated text content, searching for variables corresponding to the key elements in the template file based on the extracted key elements and element content, and filling the corresponding element content into the variables to generate a formatted template sample; or,
[0046] By extracting key elements from the instance file, and then reversely extracting the element content corresponding to the key elements from the returned result content, filling them into the variables corresponding to the key elements of the instance file, a formatted template sample is generated.
[0047] The above embodiment is described below with examples: Specific embodiment 1
[0049] The AI application backend presets template sample types and corresponding sample format requirements based on various template samples frequently used in the workplace. In this example, the preset template sample type can be the performance appraisal summary report of the Ministry of Human Resources. The preset sample format requirements can be preset in text form: including paragraph requirements, such as: present each chapter in paragraphs, left-align the chapter title, and display the chapter number according to one, two, three, and so on. The preset formatting requirements include: font, position, indentation, etc., such as: Songti, size 11, left-aligned, first line indented 2 spaces, etc. The preset sample format requirements can also be preset in HTML template mode, using HTML tags and formatting to agree on the format of the content, such as " <style>.center{font-size:15px;margin-bottom:30px;}...< / style> <div class="center"> <h2> Performance Appraisal Summary Report< / h2> <div class="abstract"> summary <div class="content"> ... ”.
[0050] The AI application frontend obtains sample document types through the template document type acquisition module, such as the Ministry of Human Resources' employee satisfaction research report, performance management method research report, performance appraisal summary report, etc., and displays them for users to choose. When the AI application frontend recognizes the template document type selected by the user, such as the Ministry of Human Resources' performance appraisal summary report, it sends it to the AI application backend.
[0051] The AI application backend receives a specified template document type, such as a performance appraisal summary report, obtains the preset format requirements, and uses the content generation AI service to generate content. There are three implementation methods:
[0052] Method 1: Generate prompt statement instructions, including paragraph requirements and formatting requirements, such as: generate a performance appraisal summary report for the Human Resources Department, and present each chapter in paragraphs, with the chapter titles left-aligned and the chapter numbers displayed as one, two, three, and so on. The content of each chapter should be output in the following format: Songti, size 11, left-aligned, first line indented 2 spaces, etc., and the content must be generated in HTML format with good readability.
[0053] Method 2: Generate prompt statement instructions, add prompt words to the obtained preset HTML template, and require it to follow the format of the HTML template. For example, to generate a performance appraisal summary report for the Ministry of Human Resources, please refer to the following HTML format requirements to generate readable HTML format content: <style>.center{font-size:15px;margin-bottom:30px;}。
[0054] 方式3:生成的提示语句指令,包含段落要求和格式编排要求,如:生成人力部的绩效考核总结报告,并分段落呈现每个章节,章节的标题左对齐,按照一、二、三类推显示章节序号,每个章节的内容请按照以下格式输出:宋体、小四号、居左、首行缩进2格等,请参考以下HTML格式要求生成可读性好的HTML格式内容:<html><head><style>.center{font-size:15px;margin-bottom:30px;}。
[0055] AI应用后台发送生成好的提示语句指令给内容生成式AI服务,在本实施例中,内容生成式AI服务采用的是内容生成式AI服务,例如:ChatGPT、文心一言,内容生成式AI服务生成带格式的范文内容并返回;
[0056] AI应用后台将带格式的范文内容反馈给AI应用前台,AI应用前台解析HTML格式,将带格式的模板范文展示在界面上。具体实施例2
[0058] AI应用后台根据职场经常使用的各类模板范文,预置模板范文类型以及对应的章节目录、模板文件,如绩效考核总结报告的章节目录如标题、摘要、称呼、时间、总结等,模板文件如:《绩效考核总结报告模板.doc》,模板文件中已预设好段落和格式编排要求,文档范例如图4所示。
[0059] AI应用前台通过模板范文类型获取模块获取范文类型,如:人力部的员工满意度研究报告、绩效管理方法研究报告、绩效考核总结报告等,展示供用户选择,当AI应用前台识别到用户选择的模板范文类型,如:人力部的绩效考核总结报告,发送给AI应用后台。
[0060] AI应用后台收到指定的模板范文类型,如:绩效考核总结报告,自动封装提示语句指令,要求根据指定的章节目录,输出绩效考核总结报告,内容生成式AI服务生成绩效考核总结报告文本内容,如:标题-绩效考核总结报告;1.摘要:全体员工积极投入工作,完成各项任务;7.总结;等文本内容。
[0061] AI应用后台根据模板范文类型-绩效考核总结报告,获取提前预置好的绩效考核总结报告模板文件,生成新的实例文件,如图4所示。在本实施例中,通过以下两种方式将内容填充到模板范文实例文件中。
[0062] 方式1:使用内容生成式AI服务提取刚刚生成文本内容中关键元素及元素内容,然后填充到模板文件实例中。具体的:首先AI应用后台封装提示语句指令,请根据你刚刚生成的内容,帮我提取关键元素的内容,用":”分隔关键元素及内容,然后AI应用后台发送提示语句指令给内容生成式AI服务,内容生成式AI服务按照上述要求提取关键元素及内容,AI应用后台逐个提取关键元素及元素内容,然后到绩效考核总结报告模板实例文件中寻找关键元素对应的变量(如${摘要变量}、${背景概况变量}),填充关键元素对应的内容到变量中,如果未找到对应的变量,则丢弃关键元素对应的内容,最终形成一个新的带格式及内容的绩效考核总结报告范文。
[0063] 方式2:使用绩效考核总结报告实例文件中的关键词,反向提取收到文本内容中关键元素内容填充到模板文件中。首先AI应用后台从绩效考核总结报告实例文件中提取关键元素,如标题、摘要、总结等,然后反向从AI返回的结果内容中提取关键元素对应的内容,填充到实例文件中关键元素对应的变量(如${摘要变量}、${背景概况变量})中,如果未提取到相应内容,则丢弃关键元素对应的内容,不填充到实例文件中,最终生成一个新的带格式及内容的绩效考核总结报告范文。
[0064] AI应用后台将带格式及内容的绩效考核总结报告范文反馈给AI应用前台,AI应用前台通过第三方插件直接展示带格式的绩效考核总结报告在界面上,展示给用户。
[0065] 如图3所示,本实施例还提供了一种模板范文格式优化系统,包括:
[0066] AI应用前台,用于获取模范范文类型和展示给用户供选择,以及将用户选择的模板范文类型发送给AI应用后台,并从AI应用后台获取带格式的范文内容或带格式的范文文件和进行展示;
[0067] AI应用后台,用于根据不同模板范文,预置模板范文类型和相对应的范文格式要求,或对应的章节目录与模板文件;以及接收AI应用前台发送来的用户选择的模板范文类型,并将信息发送给内容生成式AI服务,和接收内容生成式AI服务的反馈并处理;
[0068] 内容生成式AI服务,用于根据AI应用后台的指令,生成带格式的范文内容或带格式的范文文件,并反馈给AI应用后台。
[0069] 在上述实施例中,AI应用后台将信息发送给内容生成式AI服务中的信息包括:生成的提示语句指令,生成的提示语句指令包括段落要求和格式编排要求,并要求内容生成式AI服务生成HTML格式内容;和 / 或,将获取到的预设HTML模板加入提示词,要求内容生成式AI服务按照HTML模板的格式生成HTML格式内容。生成的提示语句指令还包括根据指定的章节目录,要求内容生成式AI服务处理成带格式的范文内容或带格式的范文文件,或,获取预置的模板文件,生成实例文件。
[0070] 在上述实施例中,生成实例文件包括:AI应用后台在生成提示语句指令时,要求内容生成式AI服务提取关键元素和元素内容,在收到生成的文本内容后,进行关键元素和元素内容的提取,AI应用后台根据提取的关键元素和元素内容,在模板文件中寻找关键元素对应的变量,并填充关键元素对应的元素内容到变量中,生成带格式的模板范文;或,AI应用后台通过从实例文件中提取关键元素,然后反向从内容生成式AI服务返回的结果内容中提取关键元素对应的元素内容,填充到实例文件的关键元素对应的变量中,生成带格式的模板范文。
[0071] 如图3所示,AI应用后台包括模板范文类型获取模块和内容生成模块,AI应用前台通过模板范文类型获取模块获取模板范文类型,内容生成模块用于接收AI应用前台发送来的用户选择的模板范文类型,并生成提示语句指令,发送给内容生成式AI服务,和接收内容生成式AI服务的反馈并处理。
[0072] 在本模板范文格式优化系统的具体实施过程中,还包括采用了上述实施例中的模板范文格式优化方法。
[0073] 需要说明的是,尽管在本文中已经对上述各实施例进行了描述,但并非因此限制本发明的专利保护范围。因此,基于本发明的创新理念,对本文所述实施例进行的变更和修改,或利用本发明说明书及附图内容所作的等效结构或等效流程变换,直接或间接地将以上技术方案运用在其他相关的技术领域,均包括在本发明的专利保护范围之内。< / style>
Claims
1. A template format optimization method, characterized in that: The following steps are involved: S1, for different template sample types, preset template sample types, corresponding sample format requirements or template files with chapter directory; S2, obtain the template type specified by the user; S3, generating formatted sample content according to the acquired required template sample type and preset sample format requirements, or processing the generated text content into a formatted sample file and displaying it.
2. The template format optimization method according to claim 1, characterized in that: Step S2 also includes: obtaining a template sample type, presenting it to the user for selection, and obtaining a template sample type specified by the user.
3. The template format optimization method according to claim 1, characterized in that: Step S3 further includes: S301, after receiving the template sample type specified by the user, obtain the preset sample format requirements, generate a prompt statement instruction, send the prompt statement instruction to request the content generation AI service to generate formatted sample content, or process the text content generated by the content generation AI service into a formatted sample file, and return it; S302: After parsing the returned formatted sample content or sample file, the sample is displayed as a template sample.
4. The template format optimization method according to claim 3, characterized in that: In step S301, the prompt statement instruction is generated including: paragraph requirements and formatting requirements, and HTML format content is generated according to the requirements; and / or, prompt words are added to the obtained preset HTML template, and HTML format content is generated according to the format of the HTML template according to the requirements.
5. The template format optimization method according to claim 3, characterized in that: In step S3, generating prompt statement instructions includes: generating formatted text content according to the specified chapter directory, or generating an instance file by obtaining a preset template file.
6. The template format optimization method according to claim 5, characterized in that: Generating an instance file includes the following steps: when generating a prompt statement instruction, requesting the content generation AI service to extract key elements and element content; after receiving the generated text content, extracting the key elements and element content; based on the extracted key elements and element content, searching for variables corresponding to the key elements in the template file, and filling the corresponding element content into the variables to generate a formatted template sample; or, By extracting key elements from the instance file, and then reversely extracting the element content corresponding to the key elements from the returned result content, filling them into the variables corresponding to the key elements of the instance file, a formatted template sample is generated.
7. A template format optimization system, characterized by: include: The AI application frontend is used to obtain model essay types and display them to users for selection, send the template essay type selected by the user to the AI application backend, and obtain formatted essay content or formatted essay files from the AI application backend for display; The AI application backend is used to preset template article types and corresponding article format requirements, or corresponding chapter directories and template files based on different template articles; It also receives the template sample type selected by the user from the AI application frontend, generates prompt instructions and sends them to the content generation AI service, and receives and processes feedback from the content generation AI service; Content generation AI services are used to generate formatted sample content or formatted sample files based on instructions from the AI application backend, and then feed them back to the AI application backend.
8. The template format optimization system according to claim 7, characterized in that: The information sent by the AI application backend to the content generation AI service includes: generated prompt sentence instructions, which include paragraph requirements and formatting requirements, and require the content generation AI service to generate HTML format content; and / or, adding prompt words to the obtained preset HTML template, requiring the content generation AI service to generate HTML format content according to the format of the HTML template.
9. The template format optimization system according to claim 7, characterized in that: The information sent by the AI application backend to the content generation AI service includes: generated prompt statement instructions, the generated prompt statement instructions include requiring the content generation AI service to process it into formatted sample content or formatted sample files based on the specified chapter directory, or to obtain a preset template file and generate an instance file.
10. The template format optimization system according to claim 9, characterized in that: Generating an instance file includes: when generating a prompt statement instruction, the AI application background requires the content generation AI service to extract key elements and element content. After receiving the generated text content, the key elements and element content are extracted. The AI application background searches for variables corresponding to the key elements in the template file based on the extracted key elements and element content, and fills the corresponding element content into the variables to generate a formatted template; or, The AI application backend extracts key elements from the instance file, then reversely extracts the element content corresponding to the key elements from the result content returned by the content generation AI service, fills it into the variables corresponding to the key elements of the instance file, and generates a formatted template sample.
11. The template format optimization system according to claim 7, characterized in that: The AI application backend includes a template example type acquisition module and a content generation module. The AI application foreground obtains the template example type through the template example type acquisition module. The content generation module is used to receive the template example type selected by the user sent by the AI application foreground, generate prompt statement instructions, send them to the content generation AI service, and receive feedback from the content generation AI service and process it.