Generation method and generation system of PowerPoint and electronic equipment
By generating prompt templates and text data that meet the task requirements, and using a large language model to generate and fill text data, it is solved the problem that it is difficult to quickly generate presentations with clear structure and unified styles in the existing technology, and an efficient and intelligent presentation generation method is achieved.
Patent Information
- Application Number
- CN202510191195.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-20
- Publication Date
- 2025-06-10
AI Technical Summary
It is difficult for the prior art to quickly generate presentations with clear structure and unified styles, especially when dealing with complex document structures and diverse content. The generated presentations mostly rely on predefined static rules and are difficult to adjust dynamically.
By responding to the data entered by the user and the initial presentation template, the data is entered into the pre-trained prompt template to generate a model to generate a prompt template that meets the needs of a specific task. Then, text data generation instructions are sent to the large language model based on the prompt template and the document to be sorted, text data is generated in a preset format, and text data is accurately filled in the reserved position through node division rules and the initial presentation template to generate the target presentation.
It realizes accurate analysis and formatting filling of complex document content, and quickly generates presentations with clear structure and unified styles, improving generation efficiency and reducing manual editing costs.
Smart Images

Figure CN120124609A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular, to a method and system for generating a presentation and an electronic device. Background Art
[0002] In the scenario of generating a presentation, a user usually needs to quickly generate a presentation with a clear structure and unified style based on the content of multiple documents for report presentation, project summary, or teaching activities. Manually editing a presentation is not only time-consuming and laborious but also likely to affect the presentation effect due to inconsistent formatting or missing content.
[0003] In the prior art, generating a presentation is usually achieved based on a fixed template or a simple content filling tool. However, these methods usually only support documents in a single format and lack the ability to parse complex document structures and process diverse content. In addition, the generated presentations mostly rely on predefined static rules and are difficult to dynamically adjust the structure or style according to the actual content. Summary of the Invention
[0004] In view of this, an object of the present invention is to provide a method and system for generating a presentation and an electronic device, which can dynamically generate a prompt template and text data that meet the task requirements according to the input data, so as to achieve accurate parsing and formatted filling of complex document content, and then quickly generate a target presentation with a clear structure and unified style, improving the generation efficiency and reducing the manual editing cost.
[0005] In a first aspect, an embodiment of the present invention provides a method for generating a presentation, including: in response to input data and an initial presentation template sent by a user, inputting the input data into a pre-trained prompt template generation model to enable the prompt template generation model to output a prompt template corresponding to the input data; the input data includes task information and a document to be sorted; sending a text data generation instruction to a large language model based on the prompt template and the document to be sorted to enable the large language model to generate text data in a preset format based on the document to be sorted; determining a target node corresponding to the text data based on a preset node division rule; and filling the text data into the corresponding reserved position based on the initial node and the target node of each reserved position in the initial presentation template to generate a target presentation.
[0006] Further, the prompt template generation model is trained in the following manner: Obtain historical input data, and input the historical input data into the large language model so that the large language model outputs candidate prompt data; the historical input data includes historical task information and historical documents to be sorted; Based on a pre-set evaluation model, score the candidate prompt data, and screen out the candidate prompt data with scores reaching the preset threshold as the basic prompt data; Send a semantic expansion instruction to the large language model based on the basic prompt data so that the large language model outputs expanded prompt data; the expanded prompt data is the semantic expansion data of the basic prompt data; Generate a training data set based on the basic prompt data and the expanded prompt data, and use the training data set to train the prompt template generation model to be trained to obtain a trained prompt template generation model.
[0007] Further, the method further includes: If the scores of the candidate prompt data do not reach the preset threshold, send an iterative search instruction to the large language model based on the historical input data and the candidate prompt data, so that the large language model iteratively searches for the next batch of candidate prompt data near the candidate prompt data, and input the next batch of candidate prompt data found into the evaluation model for scoring until the candidate prompt data with scores reaching the preset threshold is screened out.
[0008] Further, the method further includes: Pre-embed the prompt template generation model into the large language model; The step of inputting the input data into the pre-trained prompt template generation model includes: Inputting the input data into the large language model, so that after the large language model performs intent recognition based on the input data, it sends the input data to the prompt template generation model.
[0009] Further, the number of documents to be sorted is greater than or equal to one; The step of sending a text data generation instruction to the large language model based on the prompt template and the document to be sorted so that the large language model generates text data in a preset format based on the document to be sorted includes: Sending a text data generation instruction including document key point extraction to the large language model based on the prompt template and the document to be sorted, so that the large language model extracts the key points of the document to be sorted and generates text data in a preset format based on the extracted key points.
[0010] Further, after the step of sending a text data generation instruction to the large language model based on the prompt template and the document to be sorted so that the large language model generates text data in a preset format based on the document to be sorted, the method further includes: Judging whether the text data conforms to the text data format rule; If not, correct the prompt template based on the preset correction rule to obtain the corrected prompt template; Generate a corrected text data generation instruction based on the corrected prompt template and the document to be sorted, and input the corrected text data generation instruction and the text data format rule into the large language model so that the large language model outputs the corrected text data.
[0011] Further, the text data includes at least one identifier; the step of determining the target node corresponding to the text data based on a preset node division rule includes: dividing the text data into at least one text data unit based on the line break identifier in the text data; dividing the text data unit into at least one text category based on the category identifier in the text data unit; dividing the text category into at least one text field based on the hierarchical identifier in the text category and the corresponding relationship between the hierarchical identifier and the node set in advance; each text field corresponds to a target node.
[0012] Further, the step of filling the text data into the corresponding reserved position to generate a target presentation based on the initial node and the target node of each reserved position in the initial presentation template includes: identifying the reserved position of the initial node corresponding to the target node in the presentation template; determining the theme information and element coordinates of the reserved position based on the initial presentation template; wherein, the theme information includes background style, font style, text color and font size, and the element coordinates are used to locate the specific position of the reserved position in the initial presentation template; filling the text data corresponding to the target node into the reserved position based on the element coordinates and the theme information to generate a filled target presentation; the layout of the target presentation is consistent with the initial presentation template.
[0013] In a second aspect, an embodiment of the present invention provides a presentation generation system, including: a prompt template generation module, configured to input the input data into a pre-trained prompt template generation model in response to the input data and the initial presentation template sent by the user, so that the prompt template generation model outputs a prompt template corresponding to the input data; the input data includes task information and a document to be sorted; a text data generation module, configured to send a text data generation instruction to a large language model based on the prompt template and the document to be sorted, so that the large language model generates text data in a preset format based on the document to be sorted; a target node determination module, configured to determine the target node corresponding to the text data based on a preset node division rule; a target presentation generation module, configured to fill the text data into the corresponding reserved position based on the initial node and the target node of each reserved position in the initial presentation template to generate a target presentation.
[0014] In a third aspect, an embodiment of the present invention provides an electronic device, including a memory and a processor, where a computer program is stored on the memory and can run on the processor, and when the processor executes the computer program, the above-mentioned method is implemented.
[0015] A method, system, and electronic device for generating a presentation provided by an embodiment of the present invention include: in response to input data and an initial presentation template sent by a user, inputting the input data into a pre-trained prompt template generation model to enable the prompt template generation model to output a prompt template corresponding to the input data; the input data includes task information and a document to be sorted; sending a text data generation instruction to a large language model based on the prompt template and the document to be sorted to enable the large language model to generate text data in a preset format based on the document to be sorted; determining a target node corresponding to the text data based on a preset node division rule; and filling the text data into a corresponding reserved position based on the initial node and the target node of each reserved position in the initial presentation template to generate a target presentation. In this method, through the prompt template generation model, a prompt template that meets specific task requirements is generated according to the input data, which can adapt to different types of document contents and structures, improving the flexibility and accuracy of generation. The large language model is used to extract key points and format single or multiple documents to be sorted, generating text data in a preset format, simplifying the process of sorting complex documents, and improving the content generation efficiency. Based on the node division rule of the text data and the initial presentation template, the text data is accurately filled into the reserved position to ensure that the content and layout structure of the generated target presentation are consistent. By judging the text data format rule and dynamically correcting the prompt template, the generation logic can be adaptively adjusted to further improve the quality and format standardization of the generated content. Through dynamically generating a prompt template, intelligently extracting document key points, accurately filling presentation content, and combining template correction and model training optimization, an efficient, intelligent, and standardized method for generating a target presentation is realized, greatly improving the efficiency and quality of users in multi-document processing and presentation generation.
[0016] Other features and advantages of the present invention will be described in the following specification, and, in part, will be obvious from the specification, or will be understood by practicing the present invention. The objectives and other advantages of the present invention are realized and obtained by the structures specifically pointed out in the specification, claims, and drawings.
[0017] To make the above objectives, features, and advantages of the present invention more obvious and understandable, the following specifically enumerates preferred embodiments and, in conjunction with the accompanying drawings, is described in detail as follows. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for the description of the specific embodiments or the prior art. Obviously, the following drawings are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0019] Figure 1 Flow chart of the method for generating a presentation provided by an embodiment of the present invention;
[0020] Figure 2 Flow chart of the method for generating a prompt template generation model provided by an embodiment of the present invention;
[0021] Figure 3 Flow chart of the method for correcting text data provided by an embodiment of the present invention;
[0022] Figure 4 Flow chart of the method for determining a target node provided by an embodiment of the present invention;
[0023] Figure 5 Flow chart of the method for generating a target presentation provided by an embodiment of the present invention;
[0024] Figure 6 Schematic diagram of the system for generating a presentation provided by an embodiment of the present invention.
[0025] Icons: 1 - Prompt template generation module; 2 - Text data generation module; 3 - Target node determination module; 4 - Target presentation generation module. Detailed implementation manners
[0026] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Apparently, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0027] To facilitate the understanding of this embodiment, the embodiments of the present invention will be introduced in detail below.
[0028] Embodiment 1:
[0029] Figure 1 Flow chart of the method for generating a presentation provided by an embodiment of the present invention.
[0030] Referring to Figure 1 , the method for generating a presentation includes:
[0031] Step S101, in response to the input data and the initial presentation template sent by the user, input the input data into a pre-trained prompt template generation model, so that the prompt template generation model outputs a prompt template corresponding to the input data; the input data includes task information and a document to be sorted.
[0032] Here, the user inputs input data and selects an initial presentation template through an input interface on a terminal (such as a computer). The task information may include the generation objectives of the presentation (such as the presentation theme, display structure requirements, format specifications, etc.). The document to be sorted is the document file uploaded by the user, which can be a single document or multiple documents, and the formats include Markdown (a lightweight markup language), Word (a rich text format document), txt (a plain text file), etc. The application does not limit the format of the document to be sorted.
[0033] In one embodiment, referring to Figure 2 , in step S101, the prompt template generation model is obtained through the following steps S201 - S204:
[0034] Step S201, obtain historical input data, and input the historical input data into a large language model so that the large language model outputs candidate prompt data; the historical input data includes historical task information and historical documents to be sorted.
[0035] Here, the historical input data is obtained from the user's actual usage records.
[0036] The historical task information is the task requirements or task descriptions put forward by the user for past PPT generation tasks. The historical task information includes the task requirement descriptions put forward by the user before, such as "generate an annual report PPT", and the requirements involved in these tasks, such as "include data analysis", "should have 3 levels", etc.
[0037] The historical documents to be sorted are the historical documents uploaded by the user, including documents in formats such as Markdown, Word, and txt, and contain content data for generating a presentation.
[0038] The candidate prompt data refers to the constraint data used to generate data that meets specific requirements. For example, "Please help me sort out the document content, and based on the extracted content, generate a year - end summary PPT that includes data analysis and has 3 levels". The content in the quotation marks are all the constraint conditions for the generated PPT. We require the large language model to predict new candidate prompt data for constraining the PPT generation style based on the historical documents to be sorted and the historical candidate prompt data.
[0039] Step S202, score the candidate prompt data based on a pre - set evaluation model, and filter out the candidate prompt data with scores reaching the preset threshold as the basic prompt data.
[0040] Here, the preset threshold is the minimum scoring requirement of the evaluation model, which is used to ensure that the filtered prompt data meets the quality standard and can be set in advance according to the actual situation.
[0041] The evaluation model is used to score the quality of candidate prompt data through preset rules or algorithms.
[0042] The scoring criteria may include: structural integrity, whether the prompt data covers all the requirements in the task information; content relevance, the degree of semantic matching between the prompt data and the historical documents to be sorted; hierarchical rationality, whether the levels of the titles and classifications are correct.
[0043] The screening mechanism may include: scoring each candidate prompt data one by one; using the candidate prompt data with a score reaching a preset threshold (set to 80 points) as the basic prompt data for subsequent generation.
[0044] Specifically, for the candidate prompt data:
[0045] First-level title: Annual Summary
[0046] Second-level titles: Background, Data Analysis
[0047] The scoring results corresponding to the candidate prompt data are: Structural integrity: 70 points (lacking "Future Plan"); Content relevance: 85 points; Hierarchical rationality: 90 points; Total score: 81 points (reaching the threshold). Screening result: Retained as the basic prompt data.
[0048] In one embodiment, after the steps of step S202, the method further includes:
[0049] If the scores of all candidate prompt data do not reach the preset threshold, an iterative search instruction is sent to the large language model based on the historical input data and the candidate prompt data, so that the large language model iteratively searches for the next batch of candidate prompt data near the candidate prompt data, and inputs the next batch of candidate prompt data found into the evaluation model for scoring until candidate prompt data with a score reaching the preset threshold is screened out.
[0050] Here, when scoring the candidate prompt data through the evaluation model, it is found that the scores of all candidate prompt data do not reach the preset threshold, indicating that the generated candidate prompt data cannot meet the requirements of the prompt template.
[0051] The reason why the candidate prompt data cannot meet the requirements of the prompt template may be: the candidate prompt data has an incomplete structure, such as lacking some necessary content or title levels; the semantic relevance with the historical input data (task information and documents to be sorted) is low; the expression of the prompt template is not precise enough or does not meet the expectations.
[0052] When the scores of all candidate prompt data do not meet the standard, they cannot be directly used, but the prompt data is further optimized through iterative search. The large language model generates new candidate prompt data near its semantics to increase the diversity and relevance of the samples.
[0053] The iterative search instruction may include: historical input data, historical task information, and historical documents to be sorted, which are used to provide the context for generating prompt data. The current candidate prompt data, as the basis for the search, provides a semantic scope reference.
[0054] The expansion rules are to specify the search scope and optimization direction, such as improving the structure, increasing content relevance, etc.
[0055] Taking the historical input data and the current candidate prompt data as inputs, send the iterative search instruction to the large language model; the large language model generates the next batch of candidate prompt data that is semantically similar to the current candidate prompt data but has improvements based on the inputs.
[0056] Specifically, the historical input data includes:
[0057] Historical task information: Generate an annual summary PPT, including background and data analysis.
[0058] Historical documents to be sorted: Target completion rate: 90%; Sales growth: 20%.
[0059] Current candidate prompt data (with unqualified scores):
[0060] First-level heading: Annual Summary
[0061] Second-level heading: Background
[0062] Iterative search output:
[0063] First-level heading: Annual Summary
[0064] Second-level headings: Background, Data Analysis
[0065] Data analysis content: Includes growth rate and customer group analysis.
[0066] Processing of the new batch of candidate prompt data. For the new batch of candidate prompt data generated by iterative search, use the same evaluation model as the initial candidate prompt data for scoring.
[0067] Scoring criteria:
[0068] Structural integrity: Whether it includes all necessary headings and content classifications.
[0069] Content relevance: The degree of semantic matching with historical task information and historical documents to be sorted.
[0070] Expression precision: Whether the headings and content are clear and the hierarchy is reasonable.
[0071] If the score reaches the preset threshold, use it as the basic prompt data; if it still does not reach the preset threshold, trigger the iterative search again until candidate prompt data that meets the conditions is found.
[0072] Specifically, the candidate prompt data input into the evaluation model:
[0073] First-level heading: Annual Summary
[0074] Second-level headings: Background, Data Analysis
[0075] Scoring results: Structural integrity: 90 points. Content relevance: 85 points. Expression precision: 88 points. Total score: 87 points (reaching the threshold).
[0076] If the score of the new batch of candidate prompt data reaches the preset threshold, the iterative search terminates, and high-quality basic prompt data is screened out. Among them, the maximum number of iterations is set to avoid infinite loops. For example, the iterative search is performed at most 10 times. If the data that meets the requirements still cannot be generated, manual intervention is triggered. Manual intervention means that if the large language model cannot generate data that meets the conditions, the user is allowed to provide feedback or adjust the model parameters and then retrain.
[0077] The embodiment of this application optimizes the quality of candidate prompt data in the process of generating prompt templates: when the score of the candidate prompt data does not meet the standard, semantic expansion search is performed based on the current candidate prompt data; the newly generated candidate prompt data is scored again, and the structure and content of the data are gradually optimized; through iterative search and screening, it is ensured that the quality of the input data of the prompt template generation model reaches the expected standard, thereby improving the training effect and generalization ability of the model.
[0078] Step S203, send a semantic expansion instruction to the large language model based on the basic prompt data, so that the large language model outputs expanded prompt data; the expanded prompt data is the semantic expansion data of the basic prompt data.
[0079] Here, the semantic expansion instruction is used to use the large language model to perform semantic expansion on the basic prompt data, generating expanded prompt data that is semantically similar to the basic prompt data but has a different expression form.
[0080] On the basis of retaining the original structure and core content of the basic prompt data, the expanded prompt data adds diverse expression forms, for example: changing the title expression form; adding refined classifications or content.
[0081] Sending a semantic expansion instruction to the large language model includes basic prompt data and expansion rules; generating expanded prompt data for enriching training samples.
[0082] Specifically, the basic prompt data includes:
[0083] First-level heading: Annual Summary
[0084] Second-level headings: Background, Data Analysis, Future Plans
[0085] The extended prompt data includes:
[0086] First-level heading: 2024 Year-end Summary
[0087] Second-level headings: Annual goal completion, sales data analysis, future plans
[0088] In step S204, a training data set is generated based on the basic prompt data and the extended prompt data, and the training data set is used to train the model for generating the prompt template to be trained, so as to obtain a trained prompt template generation model.
[0089] Here, the training data set includes input data and output data. The input data includes historical task information and historical documents to be sorted. The output data includes basic prompt data and extended prompt data.
[0090] Based on the correspondence between the input data and the output data, at least one training sample is generated, and the training data is used to train the prompt template generation model to optimize the model parameters so that it can accurately generate a prompt template that matches the input data. By training the model for generating the prompt template to be trained, the prompt template generation model can dynamically generate a prompt template according to the task information and the document to be sorted, and can adapt to diverse input data and task requirements.
[0091] In the embodiments of the present application, the model for generating the prompt template to be trained is trained through historical data and extended data to ensure that the model can adapt to diverse document contents and user requirements, and at the same time improve the accuracy and quality of the generated results.
[0092] In one embodiment, the method further includes: pre-embedding the prompt template generation model into a large language model.
[0093] Here, the prompt template generation model is embedded into the internal structure of the large language model as a modular component or integrated into its framework through an API (Application Programming Interface).
[0094] The embedding method can be direct embedding or external call. Direct embedding means integrating the logic of the prompt template generation model into the large language model so that the prompt template generation model becomes a sub-module of the large language model. External call means taking the prompt template generation model as an independent module so that the large language model can call it through a call interface.
[0095] The large language model is responsible for processing the intent recognition of the input data, and the prompt template generation model is responsible for generating accurate prompt templates according to the recognition results. By pre-embedding the prompt template generation model into the large language model, the large language model and the prompt template generation model jointly provide an integrated input processing ability, eliminating the multiple interaction delays between the large language model and the prompt template generation model.
[0096] The step of inputting the input data into the pre-trained prompt template generation model in step S101 includes:
[0097] Input the input data into the large language model, so that after the large language model performs intent recognition based on the input data, it sends the input data to the prompt template generation model.
[0098] Here, input the input data into the large language model so that the large language model can understand the user's core needs and the content type of the input data, in order to generate a suitable prompt template.
[0099] Based on the task information and the document content, determine: Task objective: such as generating an annual report, analyzing sales data, etc.; Document structure: such as content categories like title, data, chart, etc.
[0100] Among them, the task objective is that the large language model understands the user's needs through the task information and clarifies the type and purpose of document generation. The task objective being an annual report means generating a report summarizing the past year, which may include data analysis, trend prediction, result display, etc. The task objective being analyzing sales data means focusing on the detailed analysis of sales data, which may include charts, data summary, and trend analysis.
[0101] The document structure is that the large language model automatically identifies and classifies each part of the document according to the content in the document to be organized, so as to ensure that the generated document can accurately match the required format, hierarchy, and content. The title structure is determined by identifying the headings at all levels in the document and determining their hierarchy. For example: First-level heading (e.g., "Annual Summary"); Second-level heading (e.g., "Sales Data Analysis"); Third-level heading (e.g., "Sales Trends in 2023"). The data and chart structure is determined by determining whether the document contains specific data analysis, charts, and digital summaries. The model will extract these parts from the document content and organize them as part of the document. The content category refers to the specific content in the document, such as text content, data tables, charts, formulas, etc.
[0102] Use the natural language processing ability of the large language model to identify the intent in the following ways: Semantic parsing: Extract the key content in the task information. Content classification: Analyze the structure and semantics of the document to be organized.
[0103] After the large language model completes intent recognition, it passes the processing result as input to the prompt template generation model.
[0104] The data sent down includes: Task objective: the recognized user needs; Document structure: the divided content types and levels.
[0105] Generate a prompt template based on the input data, including: Define the structured framework of the PPT, including the title, data categories, chart positions, etc.
[0106] Organize the intent recognition results into a structured data format that the prompt template generation model can process, and pass the data to the prompt template generation model through an interface or the internal logic of the model.
[0107] The structured data format that the model can process can be in JSON (JavaScript Object Notation, JS key-value pair data) format.
[0108] Specifically, the input data includes Task information: Generate an annual summary. Document to be organized: Sales increased by 20%; Costs decreased by 10%.
[0109] The intent recognition results output by the large language model are:
[0110] Task objective: Generate a PPT containing sales data and cost analysis.
[0111] Document structure:
[0112] Title: Annual Report
[0113] Data: Growth rate and cost changes
[0114] Send the intent recognition results to the prompt template generation model, and the data sent down is:
[0115] {
[0116] "title": "Annual Summary",
[0117] "sections": [
[0118] {"name": "Sales Data", "content": "Growth rate 20%"},
[0119] {"name": "Cost Analysis", "content": "Cost decreased by 10%"} ]
[0121] }
[0122] Step S102: Send a text data generation instruction to the large language model based on the prompt template and the document to be sorted, so that the large language model generates text data in a preset format based on the document to be sorted.
[0123] Here, according to the structure and format requirements of the prompt template, a clear text data generation instruction is generated to guide the large language model to extract and format the content of the document to be sorted.
[0124] The text data generation instruction can include the document structure, such as chapter titles and content classifications, etc. The data format, such as specific requirements for tables, lists, or content, etc. The processing rules for special content, such as picture links, formulas, etc.
[0125] Take the prompt template and the document to be sorted as inputs, and generate the corresponding instruction. Process the document to be sorted through the large language model, extract the content, and organize it into text data that conforms to the structure of the prompt template.
[0126] For example, the text data generation instruction is as follows:
[0127] Generate the following document content in Markdown format according to the following structure:
[0128] # Annual Summary
[0129] ## Background
[0130] - Target completion rate: 90%
[0131] ## Data Analysis
[0132] Present in a table: | Index | Value |
[0133] The generated text data, and the output text data is the formatted content that meets the requirements of the prompt template.
[0134] For example: Text data:
[0135] # Annual Summary
[0136] ## Background
[0137] - Target completion rate: 90%
[0138] ## Data Analysis
[0139]
[0140] In one embodiment, the document to be sorted can be one or multiple.
[0141] When the number of documents to be sorted is greater than or equal to one, the following problems may exist among different documents to be sorted: inconsistent formats, which may be in formats such as Markdown, Word, or txt. The content is relevant but not repetitive. Multiple documents may revolve around the same theme but contain different key points. Information is scattered: It is necessary to extract the core content from multiple documents and integrate it.
[0142] The steps of step S102 include:
[0143] Send a text data generation instruction containing document key point extraction to the large language model based on the prompt template and the documents to be sorted, so that the large language model extracts the document key points from the documents to be sorted and generates text data in a preset format based on the extracted document key points.
[0144] Here, it is necessary to conduct unified analysis and processing on multiple documents, extract the content key points related to the prompt template, remove redundant or irrelevant information, and integrate them in a preset format.
[0145] The text data generation instruction includes a prompt template and a document processing instruction. The prompt template is used to provide structural and format requirements, and the document processing instruction is used to require the extraction of document key points and integration into a preset format. Input the prompt template and multiple documents to be sorted into the large language model, and the large language model parses the documents and generates corresponding format text data according to the structural and content requirements of the prompt template.
[0146] Extract the core content related to the prompt template from multiple documents, remove redundant information, and ensure that the generated text data is concise and accurate. Among them, the extraction rules can be based on the prompt template structure, based on semantic analysis, or based on data type. Based on the prompt template structure specifically means extracting the content that matches the titles and classifications defined in the template. Based on semantic analysis specifically means identifying the key points related to the task from the documents through semantic understanding. Based on data type specifically means extracting numerical values, tables, and picture links, etc. in the documents.
[0147] Parse each document one by one through the large language model, extract the content that matches the prompt template title, extract key data (such as growth rate, cost data), extract future plans or suggestions, etc. Integrate the extracted document key points to form a structured output.
[0148] Fill the extracted document key points into a specific text format according to the requirements of the prompt template. Among them, the Markdown format is often used for technical documents and reports. The list format is used to concisely display key points. The table format is used to display data or comparison information.
[0149] Integrate the extracted document key points, map them to the structure of the prompt template, and generate text data that meets the requirements according to the preset format rules.
[0150] For example, the first-level headings are filled into the overall document title, and the key points corresponding to the classifications are filled under the second-level headings. The data is filled into a table or list according to the format requirements.
[0151] Specifically, the document to be sorted includes the first document to be sorted in Markdown format and the second document to be sorted in Word format.
[0152] The first document to be sorted: The sales amount increased by 20%, and 5,000 new customers were added.
[0153] The second document to be sorted: The cost decreased by 10%. Future plans include optimizing the supply chain.
[0154] The task objective is to generate an annual summary, and the structure includes "Sales Data", "Cost Analysis", and "Future Plans".
[0155] Text data generation instructions:
[0156] Extract the key points of the following document content and generate it in Markdown format:
[0157] Prompt template:
[0158] - First-level heading: Annual Summary
[0159] - Second-level headings: Sales Data, Cost Analysis, Future Plans
[0160] Document content:
[0161] - The first document to be sorted: The sales amount increased by 20%, and 5,000 new customers were added.
[0162] - The second document to be sorted: The cost decreased by 10%. Future plans include optimizing the supply chain.
[0163] Based on the above content, the key points of the document are extracted as follows:
[0164] Sales Data: Growth rate 20%, 5,000 new customers added.
[0165] Cost Analysis: Cost decreased by 10%.
[0166] Future Plans: Optimize the supply chain.
[0167] Based on the extracted key points of the document and the preset format (Markdown format), map the key points of the document to the structure of the prompt template to generate the text data that meets the requirements:
[0168] # Annual Summary
[0169] ## Sales Data
[0170] - Sales growth rate: 20%
[0171] - New customers added: 5000 people
[0172] ## Cost analysis
[0173] - Cost reduction: 10%
[0174] ## Future plans
[0175] Optimize the supply chain
[0176] In one embodiment, referring to Figure 3 , after the steps of step S102, the method further includes:
[0177] Step S301, determining whether the text data conforms to the text data format rules.
[0178] Here, the text data format rules are used to verify whether the generated text data conforms to the standards of the structure and output requirements of the prompt template, and usually include: structural integrity, format consistency, and content accuracy. Structural integrity means whether the text data contains all the headings and content classifications defined in the prompt template. Format consistency means whether the format of the text data (such as Markdown syntax, table structure) conforms to the preset requirements. Content accuracy means whether the information in the text data is consistent with the content of the document to be sorted.
[0179] Use regular expressions, syntax parsers, or predefined validation scripts to check the format of the text data. Use semantic analysis tools to check whether the text data misses key information in the prompt template. Match the generated text data with the text data format rules one by one to determine whether it conforms to the preset rules.
[0180] Step S302, if not, correct the prompt template based on the preset correction rules to obtain a corrected prompt template.
[0181] Here, the correction rules are used to adjust the prompt template according to the format rule check results to ensure that the subsequent generated text data meets the expected requirements.
[0182] Specifically, if some parts defined in the prompt template are missing in the generated text data, add clear instructions to the prompt template. If the text data format does not conform to the rules, adjust the format guidelines of the prompt template. If the generated content is not specific enough, enhance the content requirements in the prompt template.
[0183] Adjust the original prompt template according to the correction rules to generate a corrected prompt template.
[0184] Step S303: Generate an instruction for generating revised text data based on the revised prompt template and the document to be organized, and input the instruction for generating revised text data and the text data format rules into the large language model so that the large language model outputs the revised text data.
[0185] Here, an instruction for generating revised text data is generated based on the revised prompt template and the document to be organized.
[0186] The instruction for generating revised text data is based on the revised prompt template and includes more explicit generation requirements. The instruction for generating revised text data may include instructions for filling in missing content, format optimization instructions, and content precision instructions. For example, the instruction for filling in missing content includes ensuring the addition of new headings and content in the prompt template. The format optimization instructions include content for strengthening format specifications. The content precision instructions include content for enhancing data and content.
[0187] Take the revised prompt template and the document to be organized as inputs, generate a new instruction for generating text data, and send it to the large language model.
[0188] Input the instruction for generating revised text data and the text data format rules into the large language model so that the large language model outputs the revised text data.
[0189] The large language model regenerates the text data according to the revised prompt template and generation instruction. Compare the revised text data with the preset format rules again to ensure that the output text data meets the text data format rules (such as the structural integrity defined by the prompt template and the correctness of the format rules).
[0190] If the revised text data conforms to the format rules, terminate the revision process. If it still does not conform, repeat the steps to further revise the prompt template and generation instruction.
[0191] Step S103: Determine the target node corresponding to the text data based on the preset node division rules.
[0192] Here, according to the preset node division rules, decompose the generated text data into nodes that can be mapped to the reserved positions in the presentation template to ensure that the content is consistent with the template structure.
[0193] In one embodiment, the text data includes at least one identifier.
[0194] Here, the identifier is used to mark the structure and type of the text data and is the basis for node division. Different types of identifiers have different uses. The identifier may include: line break identifier: used to distinguish text units; category identifier: used to identify the category of text content (such as title, list, table, etc.); hierarchical identifier: used to determine the hierarchical relationship of the content.
[0195] When the text data is generated by a large language model, identifiers are automatically embedded. For example: "#" in Markdown format represents the title level; the line break character "\n" represents the end of the content or unit; the list characters "*", "-", "+" represent list items; "$", "$$", "(", ")", "[", "]", "\begin{equat ion}", "\end{equat ion}", "\begin{a l ign}", "\end{a l ign}" represent mathematical formulas; "http:" or "https:" represents a picture link.
[0196] Refer to Figure 4 , the steps of step S103 include:
[0197] Step S401, based on the line break identifiers in the text data, divide the text data into at least one text data unit.
[0198] Here, taking each line break character as a delimiter, the text data is split into multiple text data units. The line break identifier is used to divide the text data into logical units, and each unit usually corresponds to an independent information segment.
[0199] Specifically, the text data:
[0200] # Annual Summary
[0201] ## Data Analysis
[0202] - Sales: 20%
[0203] - New customers: 5000 people
[0204] ## Future Plans
[0205] Optimize the supply chain
[0206] Divide the above text data into 6 text data units:
[0207] Unit 1: # Annual Summary
[0208] Unit 2: ## Data Analysis
[0209] Unit 3: - Sales: 20%
[0210] Unit 4: - New customers: 5000 people
[0211] Unit 5: ## Future Plans
[0212] Unit 6: Optimize the supply chain
[0213] Here, by dividing the text data into at least one text data unit, a basic unit is provided for subsequent classification based on the category identifier.
[0214] Step S402: Based on the category identifier in the text data unit, divide the text data unit into at least one text category.
[0215] Here, the category identifier is used to determine the content category of the unit according to the identifier in the text data unit. For example, the title category is identified by "#". The list category is identified by "-" or "*". The table category is identified by "|". The content category is text that does not contain the above identifiers.
[0216] For each text data unit, determine its category based on its first character or specific syntax symbol. For example: if the unit starts with "#", then the unit is of the title category. If the unit starts with "-", then the unit is of the list category. If the unit contains "|", then the unit contains the table category. Otherwise, it is of the content category.
[0217] Traverse each text unit, gradually match the classification according to the priority of the category identifier, and output the category information of each text unit.
[0218] Specifically, the three text categories corresponding to the above 6 text data units are as follows:
[0219] Unit 1: Title: #Annual Summary
[0220] Unit 2: Title: ##Data Analysis
[0221] Unit 3: List item: -Sales: 20%
[0222] Unit 4: List item: -New customers: 5000 people
[0223] Unit 5: Title: ##Future Plans
[0224] Unit 6: Content: Optimize the supply chain
[0225] By performing a preliminary content classification on the text data unit, a basis is provided for subsequent hierarchical division and node mapping.
[0226] Step S403: Based on the hierarchical identifier in the text category and the pre-set corresponding relationship between the hierarchical identifier and the node, divide the text category into at least one text field; each text field corresponds to a target node.
[0227] Here, the target node is a node that conforms to the JSON structure. JSON is a lightweight data interchange format that is widely supported in various programming languages and systems. The nodes defined in JSON can be directly mapped to the reserved positions in the presentation template. By traversing the JSON nodes, the content in the template can be dynamically filled without fixed coding rules.
[0228] Determine the hierarchical relationship of the text content through hierarchical identifiers (such as the number of #s, the indentation of the list), and map the content to the corresponding nodes. For example, "#" represents the first-level heading, "##" represents the second-level heading, and the indentation level of the list item represents the sub-list relationship.
[0229] According to the hierarchical identifiers and the preset hierarchical rules, further refine the text categories. Each hierarchical identifier corresponds to a text field, and the hierarchical structure of the field is consistent with the node mapping rules.
[0230] The corresponding relationship between the hierarchical identifier and the node is determined by the predefined rules. For example, the first-level heading corresponds to the first-level node, the second-level heading corresponds to the second-level node, and the list item corresponds to the sub-node.
[0231] Parse the hierarchical identifier for each text category, determine the hierarchy of the field according to the hierarchical identifier, and output the hierarchical structured text field and the node mapping relationship.
[0232] Specifically, divide the above text categories into the following text fields:
[0233] Unit 1: First-level node → Annual Summary
[0234] Unit 2: Second-level node → Data Analysis
[0235] Sub-node → Sales: 20%
[0236] Sub-node → New customers: 5000 people
[0237] Unit 5: Second-level node → Future Plans
[0238] Sub-node → Optimize the supply chain
[0239] Based on the divided text fields, convert the text fields into target nodes that conform to the JSON structure.
[0240]
[0241] Based on the mapping relationship between the generated text fields and the target nodes, ensure that the content structure is clear and meets the requirements of the presentation template.
[0242] Step S104, based on the initial nodes and target nodes of each reserved position in the initial presentation template, fill the text data into the corresponding reserved positions to generate the target presentation.
[0243] Here, according to the reserved positions and target nodes in the initial presentation template, a mapping relationship is established to determine the positions of content such as titles, content, tables, and pictures. Among them, the mapping relationship is that each reserved position corresponds to a target node.
[0244] Based on the theme information (font, color, font size, etc.) and element coordinates in the initial template, the text data is mapped to the corresponding positions in the presentation.
[0245] Generate a presentation file according to the filled content, ensuring that the content structure is consistent with the initial template and the style conforms to the predefined theme information.
[0246] In one embodiment, referring to Figure 5 , the steps of step S104 include:
[0247] Step S501, identify the reserved position of the initial node corresponding to the target node in the presentation template.
[0248] Here, the target node is a structured content unit generated after parsing the text data, including content such as titles, text, lists, and pictures. The initial node is the position reserved for various types of content in the presentation template, such as a title box, a content box, and a picture box.
[0249] The two are associated through node mapping rules to ensure that the parsed content can be accurately filled into the presentation template.
[0250] The node mapping rules can be: the first-level target node is mapped to the title box on the home page, the second-level target node is mapped to the title box on the content page, and the list or table content is mapped to the text box or list box.
[0251] Traverse the target nodes, match according to the type, level of the nodes and the definition of the initial nodes, and determine the reserved position of the initial node to be filled by each target node.
[0252] Step S502, based on the initial presentation template, determine the theme information and element coordinates of the reserved position; among them, the theme information includes the background style, font style, text color, and font size, and the element coordinates are used to locate the specific position of the reserved position in the initial presentation template.
[0253] Here, the theme information is used to define the visual style and design style of the presentation, including: background style (such as the background color or picture of the page), font style (the font type of the text), text color (the color of the title or text), and font size (the size of the text).
[0254] Element coordinates are used to locate the specific position of the initial nodes, ensuring that the content is filled in according to the predefined layout, including: starting coordinates, the position of the upper left corner of the node on the page (such as x: 100, y: 200). Dimensions: define the width and height of the node.
[0255] Read the theme information and coordinates of each reserved position from the initial presentation template, and for each initial node, record its style and layout attributes.
[0256] Specifically, the home page title box includes background style: blue gradient; font style: Arial; font size: 36pt; element coordinates: (100, 200). The content box includes background style: white; font style: Calibri; font size: 18pt; element coordinates: (150, 300).
[0257] Step S503, based on the element coordinates and theme information, fill the text data corresponding to the target nodes into the reserved positions to generate the target presentation with filling completed; the layout of the target presentation is consistent with the initial presentation template.
[0258] Here, according to the content type of the target nodes (such as title, content, list, table, etc.), fill them into the corresponding reserved positions according to the theme information and element coordinates.
[0259] Among them, the title is filled into the title box, keeping the font style and font size consistent. Paragraphs are filled into the text box, adjusting the line spacing and alignment. Tables are filled into the table box, automatically adapting the column width and row height. Pictures are filled into the picture box, scaled or cropped proportionally.
[0260] Adjust the content according to the size of the reserved position. When the text is too long, reduce the font size or add line breaks; when the content exceeds the size of the box, automatically paginate or segment and display.
[0261] Traverse the target nodes, and fill the corresponding text data into the template reserved positions according to the style and coordinates to ensure beautiful typesetting and complete content.
[0262] Specifically, after filling, on the home page: display "Annual Summary", font Arial, font size 36pt, blue background. On the data analysis page: display "Growth rate: 20%", font Calibri, font size 18pt, white background.
[0263] The filling of all content is based on the theme information and layout rules of the initial template, ensuring that the overall style of the target presentation is consistent with the initial template. The page order, content layout, and style strictly follow the definition of the initial template, the title position is fixed, the table and list layouts are unified, and the background and font styles are consistent.
[0264] Output the target presentation, which can display the complete content and maintain an aesthetic layout effect.
[0265] Conduct a visual inspection of the generated presentation to confirm whether the content position is correct, whether the style and font conform to the template design, and whether the content is complete.
[0266] A method for generating a presentation provided by an embodiment of the present invention includes: in response to input data and an initial presentation template sent by a user, inputting the input data into a pre-trained prompt template generation model so that the prompt template generation model outputs a prompt template corresponding to the input data; the input data includes task information and a document to be sorted; sending a text data generation instruction to a large language model based on the prompt template and the document to be sorted so that the large language model generates text data in a preset format based on the document to be sorted; determining a target node corresponding to the text data based on a preset node division rule; and filling the text data into corresponding reserved positions based on the initial nodes and target nodes of each reserved position in the initial presentation template to generate a target presentation. In this method, through the prompt template generation model, a prompt template that meets specific task requirements is generated according to the input data, which can adapt to different types of document contents and structures, improving the flexibility and accuracy of generation. The large language model is used to extract key points and format a single or multiple documents to be sorted, generating text data in a preset format, simplifying the process of sorting complex documents, and improving the content generation efficiency. Based on the node division rule of the text data and the initial presentation template, the text data is accurately filled into the reserved positions to ensure that the content and layout structure of the generated target presentation are consistent. By judging the text data format rules and dynamically correcting the prompt template, the generation logic can be adaptively adjusted to further improve the quality and format standardization of the generated content. Through dynamically generating prompt templates, intelligently extracting document key points, accurately filling presentation content, and combining template correction and model training optimization, an efficient, intelligent, and standardized method for generating target presentations is realized, greatly improving the efficiency and quality of users in multi-document processing and presentation generation.
[0267] Embodiment 2:
[0268] Figure 6 This is a schematic diagram of a presentation generation system provided by an embodiment of the present invention.
[0269] Refer to Figure 6 , the presentation generation system includes:
[0270] A prompt template generation module 1, configured to input input data into a pre-trained prompt template generation model in response to input data and an initial presentation template sent by a user, so that the prompt template generation model outputs a prompt template corresponding to the input data; the input data includes task information and a document to be sorted.
[0271] The text data generation module 2 is configured to send a text data generation instruction to the large language model based on the prompt template and the document to be sorted, so that the large language model generates text data in a preset format based on the document to be sorted.
[0272] The target node determination module 3 is configured to determine the target node corresponding to the text data based on a preset node division rule.
[0273] The target presentation generation module 4 is configured to fill the text data into the corresponding reserved position based on the initial node and the target node of each reserved position in the initial presentation template, and generate a target presentation.
[0274] In one embodiment, the prompt template generation module 1 is further configured to:
[0275] Obtain historical input data, and input the historical input data into the large language model, so that the large language model outputs candidate prompt data; the historical input data includes historical task information and historical documents to be sorted.
[0276] Score the candidate prompt data based on a pre-set evaluation model, and screen out the candidate prompt data with a score reaching a preset threshold as the basic prompt data.
[0277] Send a semantic extension instruction to the large language model based on the basic prompt data, so that the large language model outputs extended prompt data; the extended prompt data is the semantic extension data of the basic prompt data.
[0278] Generate a training data set based on the basic prompt data and the extended prompt data, and use the training data set to train the prompt template generation model to be trained, so as to obtain a trained prompt template generation model.
[0279] In one embodiment, the prompt template generation module 1 is further configured to:
[0280] If the scores of the candidate prompt data do not reach the preset threshold, an iterative search instruction is sent to the large language model based on the historical input data and the candidate prompt data, so that the large language model iteratively searches for the next batch of candidate prompt data near the candidate prompt data, and inputs the searched next batch of candidate prompt data into the evaluation model for scoring until the candidate prompt data with a score reaching the preset threshold is screened out.
[0281] In one embodiment, the prompt template generation module 1 is further configured to:
[0282] Pre-embed the prompt template generation model into the large language model; input the input data into the large language model, so that after the large language model performs intent recognition based on the input data, the input data is sent to the prompt template generation model.
[0283] In one embodiment, when the number of documents to be sorted is greater than or equal to one, the text data generation module 2 is further configured to:
[0284] Send a text data generation instruction including document key point extraction to the large language model based on the prompt template and the documents to be sorted, so that the large language model extracts the document key points from the documents to be sorted and generates text data in a preset format based on the extracted document key points.
[0285] In one embodiment, the text data generation module 2 is further configured to:
[0286] Determine whether the text data conforms to the text data format rules.
[0287] If not, correct the prompt template based on the preset correction rules to obtain the corrected prompt template.
[0288] Generate a corrected text data generation instruction based on the corrected prompt template and the documents to be sorted, and input the corrected text data generation instruction and the text data format rules into the large language model, so that the large language model outputs the corrected text data.
[0289] In one embodiment, the text data includes at least one identifier. The target node determination module 3 is further configured to:
[0290] Divide the text data into at least one text data unit based on the line break identifier in the text data.
[0291] Divide the text data unit into at least one text category based on the category identifier in the text data unit.
[0292] Divide the text category into at least one text field based on the hierarchical identifier in the text category and the corresponding relationship between the hierarchical identifier and the node set in advance; each text field corresponds to a target node.
[0293] In one embodiment, the target presentation generation module 4 is further configured to:
[0294] Identify the reserved position of the initial node corresponding to the target node in the presentation template.
[0295] Determine the theme information and element coordinates of the reserved position based on the initial presentation template; wherein, the theme information includes background style, font style, text color, and font size, and the element coordinates are used to locate the specific position of the reserved position in the initial presentation template.
[0296] Fill the text data corresponding to the target node into the reserved position based on the element coordinates and the theme information to generate a filled target presentation; the layout of the target presentation is consistent with the initial presentation template.
[0297] A presentation generation system provided by an embodiment of the present invention. In this manner, a prompt template and text data that meet the task requirements can be generated according to the input data, so as to quickly generate a target presentation, improve the generation efficiency and reduce the manual editing cost.
[0298] An embodiment of the present invention further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the steps of the presentation generation method provided by the above embodiment are implemented.
[0299] The computer program product provided by an embodiment of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the method described in the foregoing method embodiments. For specific implementation, reference can be made to the method embodiments, which will not be elaborated herein.
[0300] Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the above-described systems and devices can refer to the corresponding processes in the foregoing method embodiments, which will not be elaborated herein.
[0301] In addition, in the description of the embodiments of the present invention, unless otherwise clearly defined and limited, the terms "installation", "connection", and "connection" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium, and it can be the communication inside two components. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific situations.
[0302] If the above function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program code.
[0303] In the description of the present invention, it should be noted that the orientation or positional relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings. It is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it should not be construed as a limitation to the present invention. In addition, the terms "first", "second", and "third" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance.
[0304] Finally, it should be noted that the above-described embodiments are only specific embodiments of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that any person skilled in the art within the technical scope disclosed by the present invention can still modify the technical solutions described in the foregoing embodiments or can easily conceive of changes, or perform equivalent replacements for some of the technical features; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.
Claims
1. A method for generating a presentation, characterized in that: include: In response to input data and an initial presentation template sent by a user, the input data is input into a pre-trained prompt template generation model, so that the prompt template generation model outputs a prompt template corresponding to the input data; the input data includes task information and documents to be sorted; Sending a text data generation instruction to the large language model based on the prompt template and the document to be sorted, so that the large language model generates text data in a preset format based on the document to be sorted; Based on a preset node division rule, determining a target node corresponding to the text data; Based on the initial node of each reserved position in the initial presentation template and the target node, the text data is filled into the corresponding reserved position to generate a target presentation.
2. The method for generating a presentation according to claim 1, characterized in that: The prompt template generation model is trained in the following way: Acquire historical input data, and input the historical input data into a large language model so that the large language model outputs candidate prompt data; the historical input data includes historical task information and historical documents to be sorted; Scoring the candidate prompt data based on a preset evaluation model, and selecting candidate prompt data whose scores reach a preset threshold as basic prompt data; Sending a semantic expansion instruction to the large language model based on the basic prompt data, so that the large language model outputs the extended prompt data; The extended prompt data is semantic extended data of the basic prompt data; A training data set is generated based on the basic prompt data and the extended prompt data, and the prompt template generation model to be trained is trained using the training data set to obtain a trained prompt template generation model.
3. The method for generating a presentation according to claim 2, characterized in that: The method further comprises: If the scores of the candidate prompt data do not reach the preset threshold, an iterative search instruction is sent to the large language model based on the historical input data and the candidate prompt data, so that the large language model iteratively searches for the next batch of candidate prompt data near the candidate prompt data, and inputs the searched next batch of candidate prompt data into the evaluation model for scoring until the candidate prompt data whose scores reach the preset threshold are screened out.
4. The method for generating a presentation according to claim 1, characterized in that: The method further comprises: pre-embedding the prompt template generation model into the large language model; The step of inputting the input data into a pre-trained prompt template generation model includes: inputting the input data into the large language model, so that the large language model performs intent recognition based on the input data, and then sends the input data to the prompt template generation model.
5. The method for generating a presentation according to claim 1, characterized in that: The number of the documents to be sorted is greater than or equal to one copy; The step of sending a text data generation instruction to the large language model based on the prompt template and the document to be sorted, so that the large language model generates text data in a preset format based on the document to be sorted, includes: sending a text data generation instruction containing document key points extraction to the large language model based on the prompt template and the document to be sorted, so that the large language model extracts document key points from the document to be sorted, and generates text data in a preset format based on the extracted document key points.
6. The method for generating a presentation according to claim 1, characterized in that: After the step of sending a text data generation instruction to the large language model based on the prompt template and the document to be sorted, so that the large language model generates text data in a preset format based on the document to be sorted, the method further includes: Determining whether the text data complies with text data format rules; If it does not meet the requirements, the prompt template is modified based on a preset modification rule to obtain a modified prompt template; A revised text data generation instruction is generated based on the revised prompt template and the document to be sorted, and the revised text data generation instruction and the text data format rule are input into the large language model so that the large language model outputs the revised text data.
7. The method for generating a presentation according to claim 1, characterized in that: The text data includes at least one identifier; The step of determining the target node corresponding to the text data based on the preset node division rule includes: Based on a line break identifier in the text data, dividing the text data into at least one text data unit; Based on the category identifier in the text data unit, classifying the text data unit into at least one text category; Based on the hierarchical identifiers in the text category and the preset correspondence between the hierarchical identifiers and the nodes, the text category is divided into at least one text field; each text field corresponds to one target node.
8. The method for generating a presentation according to claim 1, characterized in that: The step of filling the text data into the corresponding reserved position based on the initial node of each reserved position in the initial presentation template and the target node to generate the target presentation includes: Identify a reserved position of an initial node corresponding to the target node in the presentation template; Based on the initial presentation template, determine the theme information and element coordinates of the reserved position; wherein the theme information includes background style, font style, text color and font size, and the element coordinates are used to locate the specific position of the reserved position in the initial presentation template; Based on the element coordinates and the subject information, the text data corresponding to the target node is filled into the reserved position to generate a filled target presentation; the layout of the target presentation is consistent with the initial presentation template.
9. A presentation generation system, characterized in that: include: A prompt template generation module, which is used to respond to input data and an initial presentation template sent by a user, input the input data into a pre-trained prompt template generation model, so that the prompt template generation model outputs a prompt template corresponding to the input data; the input data includes task information and documents to be sorted; A text data generation module, used for sending a text data generation instruction to the large language model based on the prompt template and the document to be sorted, so that the large language model generates text data in a preset format based on the document to be sorted; A target node determination module, used to determine the target node corresponding to the text data based on a preset node division rule; The target presentation generating module is used to fill the text data into the corresponding reserved position based on the initial node and the target node of each reserved position in the initial presentation template to generate the target presentation.
10. An electronic device, characterized in that: It includes a memory and a processor, wherein the memory stores a computer program that can be executed on the processor, and is characterized in that when the processor executes the computer program, it implements the method for generating a presentation as described in any one of claims 1 to 7.
Citation Information
Cited By
Visual report generation method and device based on large language model and program product
CN121093935A
Resume generation method and device
CN121303080A
Manuscript generation method and device, equipment and storage medium
CN121960420A
Detecting artificial intelligence generated text
US12596869B2
Detecting artificial intelligence generated text
US20240378380A1