Method, device, electronic device and storage medium for generating presentation content

By extracting the document outline from the document to be processed and refining the paragraphs and outline, and using a large language model to generate a presentation, the problem of low compliance between the generated content and the original document is solved, and high-quality and consistent presentation generation is achieved.

CN117951290BActive Publication Date: 2025-09-23BAIDU ONLINE NETWORK TECH (BEIJIBG) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410160477.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-04
Publication Date
2025-09-23
Estimated Expiration
2044-02-04

AI Technical Summary

Technical Problem

When generating a presentation, the existing technology may lose a lot of original information, resulting in a low degree of compliance between the generated presentation content and the original document.

Method used

By extracting the document outline from the document to be processed, determining the paragraphs that match each title, and refining the paragraphs and outline, the presentation content is generated using a large language model to ensure that key information and structure are retained.

Benefits of technology

It improves the compliance of presentation content with the original document, increases the quality and consistency of presentation, and ensures the simplicity and logic of the content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117951290B_ABST
    Figure CN117951290B_ABST
Patent Text Reader

Abstract

This application discloses a method, apparatus, electronic device, and storage medium for generating presentation content, relating to the field of computer technology, particularly to artificial intelligence fields such as deep learning and natural language processing. The specific implementation scheme comprises: obtaining a document to be processed and extracting a document outline from the document to be processed; determining the paragraphs in the document to be processed that match each title in the document outline; refining the paragraphs that match each title to obtain refined text; refining the document outline to obtain a refined outline; and generating presentation content based on the refined outline and refined text; wherein the presentation content is used to generate the presentation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, in particular to artificial intelligence fields such as deep learning and natural language processing, and specifically to a method, device, electronic device and storage medium for generating presentation content. Background Art

[0002] A presentation is a dynamic document used to present information, typically consisting of a series of slides. Presentations can be used in a variety of scenarios, such as training and teaching, presentations and speeches, and advertising. The content of a presentation significantly impacts its effectiveness. Summary of the Invention

[0003] This application provides a method, device, electronic device, and storage medium for generating presentation content. The specific solution is as follows:

[0004] According to one aspect of the present application, a method for generating presentation content is provided, comprising:

[0005] Obtaining a document to be processed, and extracting a document outline from the document to be processed;

[0006] Determining a paragraph in the document to be processed that matches each heading in the document outline;

[0007] Refining the paragraphs matching each title to obtain refined text;

[0008] Refining the document outline to obtain a refined outline;

[0009] Generate presentation content based on the refined outline and the refined text; wherein the presentation content is used to generate a presentation.

[0010] According to another aspect of the present application, a device for generating presentation content is provided, comprising:

[0011] The acquisition module is used to obtain documents to be processed;

[0012] An extraction module, configured to extract a document outline from the document to be processed;

[0013] a determination module, configured to determine a paragraph in the document to be processed that matches each heading in the document outline;

[0014] A first refining module is used to refine the paragraphs matching each title to obtain refined text;

[0015] A second refining module is used to refine the document outline to obtain a refined outline;

[0016] A generation module is used to generate presentation content based on the refined outline and the refined text; wherein the presentation content is used to generate a presentation.

[0017] According to another aspect of the present application, an electronic device is provided, including:

[0018] at least one processor; and

[0019] a memory communicatively connected to the at least one processor; wherein,

[0020] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to perform the method described in the above embodiment.

[0021] According to another aspect of the present application, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method according to the above embodiment.

[0022] According to another aspect of the present application, a computer program product is provided, including a computer program, which implements the steps of the method described in the above embodiment when executed by a processor.

[0023] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present application.

[0025] Figure 1 A flowchart of a method for generating presentation content according to an embodiment of the present application is provided;

[0026] Figure 2 A flowchart of a method for generating presentation content provided in another embodiment of the present application;

[0027] Figure 3 This is an example diagram of the document outline of a document extracted using a large language model provided in this application;

[0028] Figure 4 A flowchart of a method for generating presentation content provided in another embodiment of the present application;

[0029] Figure 5 Comparison of the effects of a paragraph provided in this application before and after refinement;

[0030] Figure 6 A flowchart of a method for generating presentation content provided in another embodiment of the present application;

[0031] Figure 7 Comparison of the effects of a document outline provided for this application before and after refinement;

[0032] Figure 8 A flowchart of a method for generating presentation content provided in another embodiment of the present application;

[0033] Figure 9 A schematic diagram of the structure of a device for generating presentation content provided in one embodiment of the present application;

[0034] Figure 10 It is a block diagram of an electronic device used to implement the method for generating presentation content of an embodiment of the present application. DETAILED DESCRIPTION

[0035] The following description of exemplary embodiments of the present application is made in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0036] The following describes the method, device, electronic device and storage medium for generating presentation content according to an embodiment of the present application with reference to the accompanying drawings.

[0037] In some embodiments, a document outline can be extracted from the original document, and then the original document content can be abbreviated. Information from the abbreviated original text can be extracted and added to the outline to obtain the presentation content. However, abbreviating the original document may lose a significant amount of original text information, resulting in a poor degree of compliance between the generated presentation content and the original document.

[0038] Figure 1 A flowchart of a method for generating presentation content provided in one embodiment of the present application.

[0039] The method for generating presentation content of the embodiment of the present application can be executed by the device for generating presentation content of the embodiment of the present application, and the device can be configured in an electronic device to realize the function of generating presentation content.

[0040] Among them, the electronic device can be any device with computing capabilities, such as a personal computer, mobile terminal, server, etc. The mobile terminal can be, for example, a vehicle-mounted device, a mobile phone, a tablet computer, a personal digital assistant, a wearable device, and other hardware devices with various operating systems, touch screens and / or display screens.

[0041] like Figure 1 As shown, the method for generating the presentation content includes:

[0042] Step 101: Obtain a document to be processed and extract a document outline from the document to be processed.

[0043] In this application, the document to be processed can be a document in text format, such as a document in doc format, a document in wps format, etc., or a document in PDF format, which is not limited in this application.

[0044] For example, if the document to be processed is a document in text format, the document outline can be directly extracted from the document to be processed; if the document to be processed is a document in PDF format, the PDF format document can be converted into a text format document and then the document outline can be extracted.

[0045] In practical applications, different levels of titles may use different font sizes. In this application, the document outline can be extracted from the document to be processed based on the font size. Alternatively, a large language model can be used to extract the document outline from the document to be processed.

[0046] The document outline may include multiple levels of titles, and each level of titles may include at least one title.

[0047] Step 102: Determine the paragraphs in the document to be processed that match each heading in the document outline.

[0048] The paragraph matching each title may refer to a paragraph in the document to be processed that explains each title, that is, the details under each title.

[0049] In this application, the paragraphs matching each title can be determined based on the position information of each title in the document outline in the document to be processed, so as to determine the paragraphs matching each title by backtracking the original text.

[0050] For example, the paragraph between the first and second headings in a secondary heading can be treated as a paragraph that matches the first heading.

[0051] It should be noted that the paragraph matching each title can be one paragraph or multiple paragraphs, and there is no limitation on this.

[0052] Optionally, the word frequency of each segmented word in each title in each paragraph of the document to be processed can be determined, and the inverse document frequency of each segmented word in the document to be processed can be determined. Based on the word frequency and inverse document frequency corresponding to each segmented word in each title, the matching score between each title and each paragraph can be determined. Then, based on the matching score between each title and each paragraph, the paragraph that matches each title can be determined. In this way, based on the word frequency and inverse document frequency of each segmented word in the title in each paragraph of the document to be processed, the matching score between the title and each paragraph can be determined, and based on the matching score of each paragraph, the paragraph that matches the title can be determined, thereby improving accuracy.

[0053] The word frequency of a segmentation word in a paragraph in a document to be processed can be equal to the ratio of the number of times the segmentation word appears in the paragraph to the number of segmentations contained in the paragraph; the inverse document frequency of a segmentation word in a document to be processed can be used to indicate the commonness or rarity of the segmentation word in the document to be processed. The calculation process may include: dividing the total number of all paragraphs to be matched in the document to be processed by the number of paragraphs containing the segmentation word, and then taking the logarithm of the quotient to obtain the inverse document frequency of the segmentation word in the document to be processed. If a segmentation word appears commonly in multiple paragraphs, the inverse document frequency corresponding to the segmentation word is close to 0; conversely, the inverse document frequency corresponding to the segmentation word is larger.

[0054] Optionally, for each title, the frequency of each word in the title in a paragraph is multiplied by the inverse document frequency of each word in the document to be processed, thereby obtaining a product corresponding to each word. The product results corresponding to each word in the title are then added together to obtain a matching score between the title and the paragraph. Thus, using this method, a matching score between the title and each paragraph in the document to be processed can be obtained.

[0055] Optionally, the paragraph with the largest matching score is determined as the paragraph that matches the title.

[0056] Optionally, the longest common substring length between each title and each paragraph can be determined, and the ratio of the longest common substring length corresponding to each paragraph to each title can be determined as the longest common substring score corresponding to each paragraph. The matching score corresponding to each paragraph and the longest common substring score are weighted to obtain the total score corresponding to each paragraph. Then, based on the total score corresponding to each paragraph, the paragraph that matches each title is determined from each paragraph.

[0057] The higher the longest common substring score is, the higher the similarity between the title and the paragraph is. The weights of the matching score and the longest common substring score can be set according to actual needs and are not limited thereto.

[0058] Optionally, a preset number of paragraphs with the highest total scores can be determined as paragraphs matching the title, wherein the preset number can be one or more and is not limited to this.

[0059] Therefore, the matching score obtained based on the word frequency and inverse document frequency of each word in the title in each paragraph of the document to be processed can be combined with the longest common substring score to determine the paragraph that matches the title, thereby improving the accuracy of matching paragraphs.

[0060] Step 103: Refine the paragraphs matching each title to obtain refined text.

[0061] The details under the headings obtained by tracing back through the original text may not usually be well formatted, may be long paragraphs, or may contain erroneous and redundant information.

[0062] Based on this, in this application, for each title in the document outline, the paragraphs matching each title can be refined to obtain the refined text under each title.

[0063] The number of refined texts under each title can be one or more, and there is no limit to this; the refining processing of paragraphs may include but is not limited to removing redundant information, sorting out paragraphs, polishing paragraphs, formatting the number of words, etc.

[0064] In this application, a pre-trained key information extraction model can be used to refine the paragraphs matching each title to obtain refined text. If a title matches multiple paragraphs, the multiple paragraphs can be input into the key information extraction model separately to obtain the refined text corresponding to the paragraphs.

[0065] Optionally, a large language model may be used to refine the paragraphs matching each title to obtain refined text.

[0066] Step 104: Refine the document outline to obtain a refined outline.

[0067] Among them, the refining processing of the document outline may include but is not limited to removing labels in the document outline, removing redundant characters, formatting the number of words of the titles in the document outline, formatting the number of words of the same-level titles in the document outline, etc.

[0068] For example, the first-level title should not exceed 15 words, the second-level title should not exceed 20 words, etc.

[0069] In this application, it is identified whether there are preset characters in the document outline. If there are preset characters and the preset characters are located at a preset position in the document outline, the preset characters in the document outline are deleted to obtain a refined outline.

[0070] For example, if there are characters "one", "two", "three", "four", "1", "2", "3", "4", etc. before the title in the document outline, these characters can be deleted.

[0071] Optionally, a large language model may be used to refine the document outline to obtain a refined outline.

[0072] Step 105: Generate presentation content based on the refined outline and the refined text; wherein the presentation content is used to generate the presentation.

[0073] In this application, the refined text under each title can be added to each title in the refined outline, so that the refined text is filled into the refined outline to obtain the presentation content, and the presentation can be generated based on the presentation content later.

[0074] For example, the above method can be used to generate PPT content, and then the PPT content can be used to generate a PPT.

[0075] In an embodiment of the present application, a document outline is extracted from the document to be processed, paragraphs in the document to be processed that match each title in the document outline are determined, and the paragraphs are refined, so that the key information and structure in the document to be processed can be retained, the compliance of the presentation content with the original document is increased, the quality of the presentation is improved, and the consistency of the presentation content with the original document is ensured. In addition, the paragraphs and document outline that match each title are refined, thereby improving the conciseness of the presentation content.

[0076] Figure 2 A flowchart of a method for generating presentation content provided in another embodiment of the present application.

[0077] like Figure 2 As shown, the method for generating the presentation content includes:

[0078] Step 201: Obtain the document to be processed.

[0079] In the present application, step 201 can be implemented in any of the embodiments of the present application, so it will not be described in detail here.

[0080] Step 202: Obtain a first prompt template. The first prompt template is used to prompt the large language model to perform an outline extraction task.

[0081] In this application, the first prompt template may include outline extraction task information and output information. For example, the first prompt template may be "Extract outline from [document]." For another example, the first prompt template may be "[document], extract outline from the above document."

[0082] Step 203: Obtain a first prompt text according to the first prompt template and the document to be processed.

[0083] In this application, the document to be processed can be added to a preset position in the first prompt template to obtain the first prompt text. For example, the first prompt template is "[document], extract the outline from the above document". When extracting the document outline for the document to be processed, the content of the document to be processed can be used to replace "document" in [] to obtain the first prompt text.

[0084] Optionally, an outline extraction requirement and an outline extraction sample may be obtained, and the document to be processed, the outline extraction requirement, and the outline extraction sample may be added to a first prompt template to obtain a first prompt text.

[0085] The outline extraction requirement may be used to indicate the outline output requirement of the large language model, that is, may be used to indicate the requirement for the document outline output by the large language model.

[0086] For example, outline output requirements may include one or more of the following: outline output format requirements, outline heading level requirements, outline heading quantity requirements, and outline heading distinction requirements. Therefore, by using outline extraction requirements, a document outline that meets the output format, heading level requirements, and heading quantity requirements can be extracted from the document to be processed, thereby improving the quality of the document outline and meeting diverse needs.

[0087] Here, the outline output format requirements may refer to the format requirements for the outline output by the large language model, the outline title level requirements may refer to the requirements for the number of title levels in the outline output by the large language model, the outline title quantity requirements may refer to the requirements for the quantity of titles at all levels in the outline output by the large language model, and the outline title distinction requirements may be the requirements for the way to distinguish titles at all levels in the outline output by the large language model.

[0088] It should be noted that the above outline output requirements are only examples and may also include other output requirements, which are not limited to this.

[0089] In this application, the outline extraction sample may include a sample document and an outline extracted from the sample document. The number of the outline extraction sample may be one or more, and is not limited thereto.

[0090] For example, the first sample prompt text can be "Extract the outline of [document to be processed], the output format is markdown, the extracted outline can be up to the third-level heading, the number of second-level headings must be greater than 1, if there is a third-level heading under a second-level heading, the number of this third-level heading must be greater than 1, the first-level heading, the second-level heading and the third-level heading are distinguished by adding the prefixes '#', '##' and '###' respectively, refer to the two examples given to extract the outline: {sample document 1}\n{sample outline 1}; {sample document 2}\n{sample outline 2}". For example, the document outline extracted from a document using this prompt text is as follows Figure 3 shown.

[0091] Therefore, by utilizing the first prompt text including outline extraction requirements and outline extraction samples to extract the document outline from the document to be processed, the accuracy of the extracted document outline can be improved and different outline extraction requirements can be met.

[0092] It should be noted that, in this application, the first prompt text may include outline extraction requirements and outline extraction samples, or may include one of the outline extraction requirements and outline extraction samples, and there is no limitation on this.

[0093] Step 204: Use the large language model to process the first prompt text to obtain a document outline.

[0094] In this application, the first prompt text is input into the large language model for processing to obtain a document outline output by the large language model.

[0095] Step 205: Determine the paragraphs in the document to be processed that match each heading in the document outline.

[0096] Step 206: Refine the paragraphs matching each title to obtain refined text.

[0097] Step 207: Refine the document outline to obtain a refined outline.

[0098] Step 208: Generate presentation content based on the refined outline and the refined text; wherein the presentation content is used to generate the presentation.

[0099] In the present application, steps 205 to 208 can be implemented in any of the embodiments of the present application, and therefore will not be described in detail here.

[0100] In this embodiment of the present application, a first prompt template can be obtained. Based on the first prompt template and the document to be processed, a first prompt text can be obtained. The first prompt text is then processed using a large language model to obtain a document outline. Thus, the document outline can be extracted from the document to be processed using the large language model, improving the accuracy and efficiency of document outline extraction.

[0101] Figure 4 A flowchart of a method for generating presentation content provided in another embodiment of the present application.

[0102] like Figure 4 As shown, the method for generating the presentation content includes:

[0103] Step 401: Obtain a document to be processed and extract a document outline from the document to be processed.

[0104] Step 402: Determine the paragraphs in the document to be processed that match each heading in the document outline.

[0105] In the present application, steps 401 and 402 can be implemented in any of the embodiments of the present application, and therefore will not be described in detail here.

[0106] Step 403: Obtain a second prompt template; wherein the second prompt template is used to prompt the large language model to perform the paragraph refinement task.

[0107] In this application, the second prompt template may include paragraph refining task information and output information, etc. For example, the second prompt template may be "Refine [paragraph content] and output the refined text", or the second prompt template may be "Optimize [paragraph content] and output the optimized text", etc.

[0108] Step 404: Obtain a second prompt text according to the second prompt template and the paragraph.

[0109] In this application, a paragraph can be added to a preset position in the second prompt template to obtain a second prompt text. For example, the second prompt template is "Refine [paragraph content] and output the refined text." When optimizing a paragraph that matches a certain title, the "paragraph content" in the template [] can be replaced with the paragraph that matches the title to obtain the second prompt text.

[0110] Optionally, a paragraph refining requirement and a paragraph refining sample may be obtained, and the paragraph, the paragraph refining requirement and the paragraph refining sample may be added to a second prompt template to obtain a second prompt text.

[0111] The paragraph refinement requirement may be used to indicate the refined text output requirement of the large language model, that is, may be used to indicate the requirement for the refined text output by the large language model.

[0112] Exemplarily, the refined text output requirements may include one or more of refined text output format requirements, refined text quantity requirements, refined text word count requirements, refined text content logic requirements, and the like.

[0113] Here, the refined text output format requirement may refer to the requirement on the format of the refined text output by the large language model, the refined text quantity requirement may refer to the requirement on the quantity of the refined text output by the large language model, the refined text word count requirement may refer to the requirement on the word count of each refined text output by the large language model, and the refined text content logic requirement may refer to the logic requirement on the refined text output by the large language model.

[0114] Therefore, through the paragraph refinement requirements, refined text that meets the requirements in output format, text quantity, text word count, content logic, etc. can be obtained, which improves the quality of the refined text and meets diversified needs.

[0115] It should be noted that the above refined text output requirements are only examples and may also include other output requirements, which are not limited to this.

[0116] In this application, the paragraph refinement sample may include a sample paragraph and a sample text refined from the sample paragraph. The number of the paragraph refinement sample may be one or more, and is not limited thereto.

[0117] For example, the second prompt text can be "Optimize [paragraph to be refined] so that the number of words in each optimized detail is as consistent as possible, the content is logically coherent, there must be at least two details, and the number of words in each detail is no less than 25. The output is in markdown format. Refer to the two examples given for optimization: {sample paragraph 1}\n{refined text 1}; {sample paragraph 2}\n{refined text 2}".

[0118] for example, Figure 5 (a) shows the paragraph content before refinement. Figure 5 The refined text is shown in (b), and it can be seen that two details are obtained after refining.

[0119] Therefore, by using the second prompt text containing paragraph refining requirements and paragraph refining samples to obtain refined text, the quality of the refined text can be improved and different refining requirements can be met.

[0120] To ensure error tolerance in the outline extraction results, if a title is incorrectly traced back to the source text, resulting in a large amount of original text under that title, a second prompt text can be generated based on the paragraph and content matching task. This second prompt text allows the large language model to find the paragraph that truly belongs to the title and refine the paragraph. The content matching task can refer to finding content within a paragraph that matches the title.

[0121] For example, the second prompt text can be "Based on the given paragraphs and titles, find the content corresponding to the titles in the paragraphs and optimize it so that the number of words in each optimized detail is as consistent as possible and the content is logically coherent. There must be at least two details, and each detail must have no fewer than 25 words. The output is in markdown format. Refer to the two given examples for optimization: {Sample Paragraph 1}\n{Refined Text 1}; {Sample Paragraph 2}\n{Refined Text 2}".

[0122] It should be noted that, in this application, the second prompt text may include paragraph refinement requirements and paragraph refinement samples, and the second prompt text may also include one of the paragraph refinement requirements and paragraph refinement samples, and there is no limitation on this.

[0123] Step 405: Use the large language model to process the second prompt text to obtain a refined text.

[0124] In this application, the second prompt text corresponding to each title can be input into the large language model for processing to obtain the refined text under each title. Here, the second prompt text corresponding to each title refers to the second prompt text obtained based on the paragraph matching each title.

[0125] Step 406: Refine the document outline to obtain a refined outline.

[0126] Step 407: Generate presentation content based on the refined outline and the refined text; wherein the presentation content is used to generate the presentation.

[0127] In this application, steps 406 and 407 can be implemented in any of the embodiments of this application, so they will not be described in detail here.

[0128] In this embodiment of the present application, a second prompt template can be obtained. Based on the second prompt template and the paragraphs matching each title, a second prompt text can be obtained. The second prompt text is then processed using a large language model to obtain refined text under each title. Thus, the paragraphs can be refined using the large language model to obtain refined text, thereby improving the quality and efficiency of the refined text.

[0129] Figure 6 A flowchart of a method for generating presentation content provided in another embodiment of the present application.

[0130] like Figure 6 As shown, the method for generating the presentation content includes:

[0131] Step 601: Obtain a document to be processed and extract a document outline from the document to be processed.

[0132] Step 602: Determine the paragraphs in the document to be processed that match each heading in the document outline.

[0133] Step 603: Refine the paragraphs matching each title to obtain refined text.

[0134] In the present application, steps 601 to 603 can be implemented in any of the embodiments of the present application, so they will not be described in detail here.

[0135] Step 604: Obtain a third prompt template; wherein the second prompt template is used to prompt the large language model to perform the outline refinement task.

[0136] In this application, the third prompt template may include outline refining task information and output information, etc. For example, the third prompt template may be "Refine [outline] and output the refined outline", or the second prompt template may be "Optimize [outline] and output the optimized outline", etc.

[0137] Step 605: Obtain a third prompt text according to the third prompt template and the document outline.

[0138] In this application, the document outline can be added to a preset position in the third prompt template to obtain the third prompt text. For example, the third prompt template is "Refine [Outline] and output the refined outline." When refining the document outline of the document to be processed, the content of the document outline can be used to replace the "Outline" in the template [] to obtain the third prompt text.

[0139] Optionally, outline refinement requirements and outline refinement samples may be obtained, and the document outline, outline refinement requirements, and outline refinement samples may be added to a third prompt template to obtain a third prompt text.

[0140] The outline refinement requirement may be used to indicate the refined outline output requirement of the large language model, that is, may be used to indicate the requirement for the refined outline output by the large language model.

[0141] Exemplarily, the refined outline output requirements may include one or more of refined outline output format requirements, refined outline title quantity requirements, refined text content logic requirements, and the like.

[0142] Here, the refined outline output format requirement may refer to the format requirement for the refined outline output by the large language model, the refined outline title number requirement may refer to the requirement for the number of titles in the refined outline output by the large language model, and the refined outline title word count requirement may refer to the requirement for the word count of the title in the refined outline output by the large language model.

[0143] Therefore, through the outline refinement requirements, a refined outline that meets the requirements such as output format, number of titles, and number of title words can be obtained, which improves the quality of the refined outline and meets diversified needs.

[0144] It should be noted that the above-mentioned refined outline output requirements are only examples and may also include other output requirements, which are not limited to this.

[0145] In this application, the outline refinement sample may include a first sample outline and a second sample outline obtained by refining the first sample outline. The number of the outline refinement samples may be one or more, and there is no limitation on this.

[0146] For example, the third prompt text may be "The following JSON string contains the outline of a document. Optimize the text in the outline. The number of titles remains consistent before and after optimization, and the number of words in each title does not exceed 15. Refer to the two examples given for optimization: {sample outline 1}\n{sample refined outline 1}; {sample outline 2}\n{sample refined outline 2}".

[0147] for example, Figure 7 (a) shows the outline before refinement. Figure 7 The refined outline is shown in (b). As can be seen, through the refinement process, the labels "one," "two," "three," "1," "2," "3," and "4" in the original outline were deleted, the title "Telling from the Student's Perspective" was polished to become "Student Issues," and the redundant information "Secondary Vocational Mathematics" in the title "Changing the Concept of Secondary Vocational Mathematics Teaching" was deleted to become "Changing the Key to Teaching."

[0148] Therefore, by using the third prompt text containing outline refinement requirements and outline refinement samples to obtain a refined outline, the quality of the refined outline can be improved and different outline refinement needs can be met.

[0149] It should be noted that, in this application, the third prompt text may include outline refinement requirements and outline refinement samples, and the second prompt text may also include one of the outline refinement requirements and outline refinement samples, and there is no limitation on this.

[0150] Due to the instability of large language model output, the number of titles in the outline before and after optimization may be inconsistent. To ensure that the model input and output quantities are aligned, the input document outline can be constructed in a special format to indicate the label of each title in the document outline, thereby making it easier for the model to understand the concept of the number of titles.

[0151] For example, Arabic numerals from small to large may be added before each title in the order of the titles in the document outline from the front to the back in the document to be processed.

[0152] For example, the constructed document outline is {"0":"#"First-level heading 1, "1":"##"Second-level heading 1, "2":"##"Second-level heading 2, "3":"#"First-level heading 2, "4":##"Second-level heading 4, "5":"##"Second-level heading 5}.

[0153] Step 606: Use the large language model to process the third prompt text to obtain a refined outline.

[0154] In this application, the third prompt text is input into the large language model for processing to obtain a refined outline.

[0155] Step 607: Generate presentation content based on the refined outline and the refined text; wherein the presentation content is used to generate the presentation.

[0156] In the present application, step 607 can be implemented in any of the embodiments of the present application, so it will not be described in detail here.

[0157] In this embodiment of the present application, a third prompt template can be obtained. Based on the third prompt template and the document outline, a third prompt text can be obtained. The third prompt text is then processed using a large language model to obtain a refined outline. Thus, the document outline can be refined using a large language model to obtain a refined outline, thereby improving the quality and efficiency of the refined outline.

[0158] In some embodiments, a large language model can be used to extract a document outline, then abbreviate the original document content. The large language model can then be used to extract information from the abbreviated original text and populate the extracted outline. However, this approach, involving multiple calls to the large language model, is time-consuming and can increase the instability of the generated content. Furthermore, significant original text information may be lost, resulting in a poor adherence of the generated presentation content to the original document.

[0159] In the process of determining the paragraphs that match the title, an incorrect match may occur, or multiple titles may be matched to the same paragraph due to the same title. Based on this, in one embodiment of the present application, the position identifiers of the paragraphs that match each title in the document outline can be sorted to obtain a position sequence. If there is an anomaly in the position sequence, the target position identifier in the position sequence can be deleted to select the longest increasing subsequence in the position sequence, and the title corresponding to the target position identifier in the document outline can be deleted to obtain a candidate outline, which is then refined to obtain a refined outline.

[0160] When sorting, the position identifiers of the paragraphs with matching titles may be sorted according to the order of the titles in the document outline, wherein the position identifiers of the paragraphs may refer to the paragraph sequence numbers in the document to be processed.

[0161] For example, the abnormality in the position sequence may be that the position of the paragraph matched to a certain title is after the position of the paragraph corresponding to other titles, that is, the position sequence is not an increasing sequence.

[0162] For example, the document outline of the document to be processed contains 5 titles. The first title matches the first paragraph, the second title matches the fourth paragraph, the third title matches the 15th paragraph, the fourth title matches the 9th paragraph, and the fifth title matches the 35th paragraph, resulting in a position sequence of [1, 4, 15, 9, 35]. Due to the abnormality in the position sequence, the paragraph number 15 in the position sequence can be deleted, and the longest increasing subsequence [1, 4, 9, 35] can be selected. The third title corresponding to the paragraph number 15 in the document outline can be removed to obtain a new document outline, and then the document outline can be refined.

[0163] In this application, the method for refining the candidate outlines can refer to the method for refining the document outline in the above embodiment, so it will not be repeated here.

[0164] In an embodiment of the present application, it is possible to determine whether there are matching anomalies based on the position identifiers of the paragraphs that match each title in the document outline. If there are anomalies, some titles in the document outline can be removed using the longest increasing subsequence method to ensure that the order of the titles and the matching paragraphs is consistent.

[0165] In one embodiment of the present application, a large language model can be used to extract the document outline, refine the paragraphs matching the titles in the document outline, and refine the document outline. Figure 8 To explain, Figure 8 A flowchart of a method for generating presentation content provided in another embodiment of the present application.

[0166] like Figure 8 As shown, the method for generating the presentation content includes:

[0167] Step 801: Obtain a document to be processed, and extract a document outline from the document to be processed using a large language model.

[0168] In this application, the method of extracting a document outline from a document to be processed using a large language model can be referred to in the above embodiment, so it will not be repeated here.

[0169] Step 802: Determine the paragraphs in the document to be processed that match each heading in the document outline.

[0170] In this application, step 802 can be implemented in any of the embodiments of this application, so it will not be described here in detail.

[0171] Step 803: Using a large language model, the paragraphs matching each title are refined to obtain refined text.

[0172] In this application, the method of using a large language model to refine the paragraphs matching each title can be found in the above embodiment, so it will not be repeated here.

[0173] Step 804: Use the large language model to refine the document outline to obtain a refined outline.

[0174] In this application, the method of using a large language model to refine the document outline can be referred to the above embodiment, so it will not be repeated here.

[0175] Step 805: Generate presentation content based on the refined outline and the refined text; wherein the presentation content is used to generate the presentation.

[0176] In this application, step 805 can be implemented in any of the embodiments of this application, so it will not be described in detail here.

[0177] In the embodiments of this application, by establishing a series of operations including outline extraction, outline refinement (also known as title optimization), backtracking to the original text, and paragraph refinement (also known as detail optimization), the number of calls to the large language model can be reduced, and the original document outline can be better extracted and the details can be sorted out, thereby improving the stability, accuracy, and logic of the generated content. At the same time, during the title optimization and detail optimization stages, the large language model is used to refine and polish the generated outline content, ensuring the coherence and conciseness of the presentation content.

[0178] In the solution of this application, by extracting the document outline, detail optimization and title optimization through a large language model, the key information and structure in the original document can be effectively retained, the presentation content can be more compliant with the original text, and the quality and efficiency of document-generated presentations can be improved. At the same time, the consistency of the generated content with the original document is ensured, thereby providing users with a better user experience.

[0179] In order to implement the above embodiment, the embodiment of the present application also proposes a device for generating presentation content. Figure 9 A schematic structural diagram of a device for generating presentation content provided in one embodiment of the present application.

[0180] like Figure 9 As shown, the presentation content generating device 900 includes:

[0181] An acquisition module 910 is used to acquire a document to be processed;

[0182] An extraction module 920 is configured to extract a document outline from the document to be processed;

[0183] A determination module 930 is configured to determine a paragraph in the document to be processed that matches each heading in the document outline;

[0184] A first refining module 940 is configured to refine the paragraphs matching each title to obtain a refined text;

[0185] A second refining module 950 is configured to refine the document outline to obtain a refined outline;

[0186] The generating module 960 is used to generate presentation content according to the refined outline and the refined text; wherein the presentation content is used to generate a presentation.

[0187] Optionally, the extraction module 920 is configured to:

[0188] Obtaining a first prompt template; wherein the first prompt template is used to prompt the large language model to perform an outline extraction task;

[0189] Acquire a first prompt text according to the first prompt template and the document to be processed;

[0190] The first prompt text is processed using the large language model to obtain the document outline.

[0191] Optionally, the extraction module 920 is configured to:

[0192] The acquiring of a first prompt text according to the first prompt template and the document to be processed includes:

[0193] Obtaining an outline extraction requirement and an outline extraction sample; wherein the outline extraction requirement is used to indicate an outline output requirement of the large language model, and the outline extraction sample includes a sample document and an outline extracted from the sample document;

[0194] The first prompt text is obtained according to the document to be processed, the outline extraction requirement, the outline extraction sample and the first prompt template.

[0195] Optionally, the outline output requirements include at least one of the following:

[0196] Requirements for outline output format;

[0197] Requirements for the number of outline headings;

[0198] Requirements on the number of headings at all levels of the outline;

[0199] Requirements for distinguishing titles at all levels of the outline.

[0200] Optionally, the determining module 930 is configured to:

[0201] Determine the word frequency of each word in each title in each paragraph of the document to be processed, and determine the inverse document frequency of each word in the document to be processed;

[0202] Determine the matching score between each title and each paragraph based on the word frequency and inverse document frequency corresponding to each word in each title;

[0203] According to the matching scores between each title and the paragraphs, a paragraph matching each title is determined.

[0204] Optionally, the determining module 930 is configured to:

[0205] Determine the longest common substring length between each title and each paragraph;

[0206] Determining the longest common substring score corresponding to each paragraph according to the ratio of the longest common substring length corresponding to each paragraph to each title;

[0207] Weight the matching score and the longest common substring score of each paragraph to obtain the total score of each paragraph;

[0208] According to the total scores corresponding to the paragraphs, a paragraph matching each title is determined from the paragraphs.

[0209] Optionally, the first refining module 940 is configured to:

[0210] Obtaining a second prompt template; wherein the second prompt template is used to prompt the large language model to perform a paragraph refinement task;

[0211] Acquire a second prompt text according to the second prompt template and the paragraph;

[0212] The second prompt text is processed using the large language model to obtain the refined text.

[0213] Optionally, the first refining module 940 is configured to:

[0214] Obtaining a paragraph refinement requirement and a paragraph refinement sample; wherein the paragraph refinement requirement is used to indicate a refined text output requirement of the large language model, and the paragraph refinement sample includes a sample paragraph and a sample text refined from the sample paragraph;

[0215] The second prompt text is obtained according to the paragraph, the paragraph refining requirement, the paragraph refining sample and the second prompt template.

[0216] Optionally, the refined text output requirement includes at least one of the following:

[0217] Refine text output format requirements;

[0218] Requirement on the quantity of refined texts;

[0219] Refine the word count requirements for the text;

[0220] Refine the logical requirements of text content.

[0221] Optionally, the second refining module 950 is configured to:

[0222] Sorting the position identifiers of the paragraphs that match each title in the document outline to obtain a position sequence;

[0223] If there is an anomaly in the position sequence, the target position identifier in the position sequence is deleted to select the longest increasing subsequence in the position sequence;

[0224] Deleting the title corresponding to the target location identifier in the document outline to obtain a candidate outline;

[0225] The candidate outline is refined to obtain the refined outline.

[0226] Optionally, the second refining module 950 is configured to:

[0227] Obtaining a third prompt template; wherein the second prompt template is used to prompt the large language model to perform the outline refinement task;

[0228] Acquire a third prompt text according to the third prompt template and the document outline;

[0229] The third prompt text is processed using the large language model to obtain the refined outline.

[0230] Optionally, the second refining module 950 is configured to:

[0231] Obtaining an outline refinement requirement and an outline refinement sample; wherein the outline refinement requirement is used to indicate a refined outline output requirement of the large language model, and the outline refinement sample includes a first sample outline and a second sample outline obtained by refining the first sample outline;

[0232] The third prompt text is obtained according to the document outline, the outline refinement requirement, the outline refinement sample and the third prompt template.

[0233] Optionally, the refined outline output requirement includes at least one of the following:

[0234] Refine the outline output format requirements;

[0235] Refine the number of outline titles required;

[0236] Refine the word count requirements for the outline title.

[0237] It should be noted that the explanation of the aforementioned embodiment of the method for generating presentation content is also applicable to the device for generating presentation content of this embodiment, so it will not be repeated here.

[0238] In an embodiment of the present application, a document outline is extracted from the document to be processed, paragraphs in the document to be processed that match each title in the document outline are determined, and the paragraphs are refined, so that the key information and structure in the document to be processed can be retained, the compliance of the presentation content with the original document is increased, the quality of the presentation is improved, and the consistency of the presentation content with the original document is ensured. In addition, the paragraphs and document outline that match each title are refined, thereby improving the conciseness of the presentation content.

[0239] According to an embodiment of the present application, the present application also provides an electronic device, a readable storage medium and a computer program product.

[0240] Figure 10 A schematic block diagram of an example electronic device 1000 that can be used to implement embodiments of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or claimed herein.

[0241] like Figure 10 As shown, the device 1000 includes a computing unit 1001, which can perform various appropriate actions and processes according to a computer program stored in a ROM (Read-Only Memory) 1002 or a computer program loaded from a storage unit 1008 into a RAM (Random Access Memory) 1003. Various programs and data required for the operation of the device 1000 can also be stored in the RAM 1003. The computing unit 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An I / O (Input / Output) interface 1005 is also connected to the bus 1004.

[0242] Various components in device 1000 are connected to I / O interface 1005, including an input unit 1006, such as a keyboard, mouse, etc.; an output unit 1007, such as various types of displays, speakers, etc.; a storage unit 1008, such as a magnetic disk, optical disk, etc.; and a communication unit 1009, such as a network card, modem, wireless communication transceiver, etc. The communication unit 1009 allows device 1000 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0243] The computing unit 1001 can be various general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of the computing unit 1001 include, but are not limited to, a CPU (Central Processing Unit), a GPU (Graphic Processing Units), various dedicated AI (Artificial Intelligence) computing chips, various computing units that run machine learning model algorithms, a DSP (Digital Signal Processor), and any appropriate processor, controller, microcontroller, etc. The computing unit 1001 performs the various methods and processes described above, such as the method for generating presentation content. For example, in some embodiments, the method for generating presentation content can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as the storage unit 1008. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 1000 via the ROM 1002 and / or the communication unit 1009. When the computer program is loaded into RAM 1003 and executed by computing unit 1001, one or more steps of the method for generating presentation content described above may be performed. Alternatively, in other embodiments, computing unit 1001 may be configured to perform the method for generating presentation content in any other appropriate manner (e.g., via firmware).

[0244] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, FPGAs (Field Programmable Gate Arrays), ASICs (Application-Specific Integrated Circuits), ASSPs (Application-Specific Standard Products), SOCs (System on Chips), CPLDs (Complex Programmable Logic Devices), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special-purpose or general-purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0245] The program code for implementing the methods of the present application can be written in any combination of one or more programming languages. Such program code can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the program code is executed by the processor or controller, the functions / operations specified in the flow charts and / or block diagrams are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0246] In the context of the present application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or apparatus. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or apparatus, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include an electrical connection based on one or more wires, a portable computer disk, a hard disk, RAM, ROM, EPROM (Electrically Programmable Read-Only-Memory) or flash memory, optical fiber, CD-ROM (Compact Disc Read-Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0247] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (Cathode-Ray Tube) or LCD (Liquid Crystal Display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0248] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: LAN (Local Area Network), WAN (Wide Area Network), the Internet, and blockchain networks.

[0249] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact via a communication network. The client-server relationship is established by computer programs running on the respective computers and establishing a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, a host product within the cloud computing service ecosystem that addresses the management difficulties and poor scalability of traditional physical hosts and VPS services. The server may also be a server in a distributed system or a server integrated with blockchain.

[0250] According to an embodiment of the present application, the present application also provides a computer program product, which, when an instruction processor in the computer program product is executed, executes the method for generating presentation content proposed in the above embodiment of the present application.

[0251] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this application can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this application can be achieved. This is not a limitation herein.

[0252] The above specific embodiments do not constitute a limitation on the scope of protection of this application. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application shall be included within the scope of protection of this application.

Claims

1. A method for generating presentation content, comprising: Acquire a document to be processed, and extract a document outline from the document to be processed, wherein the document outline includes multiple levels of headings, and each level of headings includes at least one heading; Determining a paragraph in the document to be processed that matches each heading in the document outline; Refining the paragraphs matching each title to obtain refined text; Refining the document outline to obtain a refined outline; Generating presentation content according to the refined outline and the refined text; wherein the presentation content is used to generate a presentation; The paragraphs matching each title are refined to obtain refined text, including: Obtaining a second prompt template; wherein the second prompt template is used to prompt the large language model to perform a paragraph refinement task; Obtaining a paragraph refinement requirement and a paragraph refinement sample; wherein the paragraph refinement requirement is used to indicate a refined text output requirement of the large language model, and the paragraph refinement sample includes a sample paragraph and a sample text refined from the sample paragraph; Acquire a second prompt text according to the paragraph, the paragraph refining requirement, the paragraph refining sample, and the second prompt template; Among them, the refined text output requirements include refined text output format requirements, refined text quantity requirements, refined text word count requirements, and refined text content logic requirements.

2. The method according to claim 1, wherein The step of extracting a document outline from the document to be processed includes: Obtaining a first prompt template; wherein the first prompt template is used to prompt the large language model to perform an outline extraction task; Acquire a first prompt text according to the first prompt template and the document to be processed; The first prompt text is processed using the large language model to obtain the document outline.

3. The method according to claim 2, wherein: The acquiring of a first prompt text according to the first prompt template and the document to be processed includes: Obtaining an outline extraction requirement and an outline extraction sample; wherein the outline extraction requirement is used to indicate an outline output requirement of the large language model, and the outline extraction sample includes a sample document and an outline extracted from the sample document; The first prompt text is obtained according to the document to be processed, the outline extraction requirement, the outline extraction sample and the first prompt template.

4. The method according to claim 3, wherein: The outline output requirements include at least one of the following: Requirements for outline output format; Requirements for the number of outline headings; Requirements on the number of headings at all levels of the outline; Requirements for distinguishing titles at all levels of the outline.

5. The method according to claim 1, wherein Determining a paragraph in the document to be processed that matches each heading in the document outline includes: Determine the word frequency of each word in each title in each paragraph of the document to be processed, and determine the inverse document frequency of each word in the document to be processed; Determine the matching score between each title and each paragraph based on the word frequency and inverse document frequency corresponding to each word in each title; According to the matching scores between each title and the paragraphs, a paragraph matching each title is determined.

6. The method according to claim 5, wherein: The step of determining a paragraph matching each title based on the matching scores between each title and each paragraph includes: Determine the longest common substring length between each title and each paragraph; Determining the longest common substring score corresponding to each paragraph according to the ratio of the longest common substring length corresponding to each paragraph to each title; Weight the matching score and the longest common substring score of each paragraph to obtain the total score of each paragraph; According to the total scores corresponding to the paragraphs, a paragraph matching each title is determined from the paragraphs.

7. The method of claim 1, wherein: The refining of the document outline to obtain a refined outline includes: Sorting the position identifiers of the paragraphs that match each title in the document outline to obtain a position sequence; If there is an anomaly in the position sequence, the target position identifier in the position sequence is deleted to select the longest increasing subsequence in the position sequence; Deleting the title corresponding to the target location identifier in the document outline to obtain a candidate outline; The candidate outlines are refined to obtain the refined outline.

8. The method of claim 1, wherein: The refining of the document outline to obtain a refined outline includes: Obtaining a third prompt template; wherein the second prompt template is used to prompt the large language model to perform the outline refinement task; Acquire a third prompt text according to the third prompt template and the document outline; The large language model is used to process the third prompt text to obtain the refined outline.

9. The method of claim 8, wherein: The acquiring of a third prompt text according to the third prompt template and the document outline includes: Obtaining an outline refinement requirement and an outline refinement sample; wherein the outline refinement requirement is used to indicate a refined outline output requirement of the large language model, and the outline refinement sample includes a first sample outline and a second sample outline obtained by refining the first sample outline; The third prompt text is obtained according to the document outline, the outline refinement requirement, the outline refinement sample and the third prompt template.

10. The method of claim 9, wherein: The output requirements of the refined outline include at least one of the following: Refine the outline output format requirements; Refine the number of outline titles required; Refine the word count requirements for the outline title.

11. A device for generating presentation content, comprising: The acquisition module is used to obtain documents to be processed; An extraction module, configured to extract a document outline from the document to be processed, wherein the document outline includes multiple levels of headings, and each level of headings includes at least one heading; a determination module, configured to determine a paragraph in the document to be processed that matches each heading in the document outline; A first refining module is used to refine the paragraphs matching each title to obtain refined text; A second refining module is used to refine the document outline to obtain a refined outline; A generating module, configured to generate presentation content based on the refined outline and the refined text; wherein the presentation content is used to generate a presentation; Wherein, the first refining module is used to: Obtaining a second prompt template; wherein the second prompt template is used to prompt the large language model to perform a paragraph refinement task; Obtaining a paragraph refinement requirement and a paragraph refinement sample; wherein the paragraph refinement requirement is used to indicate a refined text output requirement of the large language model, and the paragraph refinement sample includes a sample paragraph and a sample text refined from the sample paragraph; Acquire a second prompt text according to the paragraph, the paragraph refining requirement, the paragraph refining sample, and the second prompt template; Among them, the refined text output requirements include refined text output format requirements, refined text quantity requirements, refined text word count requirements, and refined text content logic requirements.

12. The device according to claim 11, wherein The extraction module is used to: Obtaining a first prompt template; wherein the first prompt template is used to prompt the large language model to perform an outline extraction task; Acquire a first prompt text according to the first prompt template and the document to be processed; The first prompt text is processed using the large language model to obtain the document outline.

13. The device of claim 12, wherein: The extraction module is used to: The acquiring of a first prompt text according to the first prompt template and the document to be processed includes: Obtaining an outline extraction requirement and an outline extraction sample; wherein the outline extraction requirement is used to indicate an outline output requirement of the large language model, and the outline extraction sample includes a sample document and an outline extracted from the sample document; The first prompt text is obtained according to the document to be processed, the outline extraction requirement, the outline extraction sample and the first prompt template.

14. The apparatus of claim 13, wherein: The outline output requirements include at least one of the following: Requirements for outline output format; Requirements for the number of outline headings; Requirements on the number of headings at all levels of the outline; Requirements for distinguishing titles at all levels of the outline.

15. The apparatus of claim 11, wherein: The determining module is configured to: Determine the word frequency of each word in each title in each paragraph of the document to be processed, and determine the inverse document frequency of each word in the document to be processed; Determine the matching score between each title and each paragraph based on the word frequency and inverse document frequency corresponding to each word in each title; According to the matching scores between each title and the paragraphs, a paragraph matching each title is determined.

16. The apparatus of claim 15, wherein: The determining module is configured to: Determine the longest common substring length between each title and each paragraph; Determining the longest common substring score corresponding to each paragraph according to the ratio of the longest common substring length corresponding to each paragraph to each title; Weight the matching score and the longest common substring score of each paragraph to obtain the total score of each paragraph; According to the total scores corresponding to the paragraphs, a paragraph matching each title is determined from the paragraphs.

17. The apparatus of claim 11, wherein: The second refining module is used to: Sorting the position identifiers of the paragraphs that match each title in the document outline to obtain a position sequence; If there is an anomaly in the position sequence, the target position identifier in the position sequence is deleted to select the longest increasing subsequence in the position sequence; Deleting the title corresponding to the target location identifier in the document outline to obtain a candidate outline; The candidate outlines are refined to obtain the refined outline.

18. The apparatus of claim 11, wherein: The second refining module is used to: Obtaining a third prompt template; wherein the second prompt template is used to prompt the large language model to perform the outline refinement task; Acquire a third prompt text according to the third prompt template and the document outline; The large language model is used to process the third prompt text to obtain the refined outline.

19. The apparatus of claim 18, wherein: The second refining module is used to: Obtaining an outline refinement requirement and an outline refinement sample; wherein the outline refinement requirement is used to indicate a refined outline output requirement of the large language model, and the outline refinement sample includes a first sample outline and a second sample outline obtained by refining the first sample outline; The third prompt text is obtained according to the document outline, the outline refinement requirement, the outline refinement sample and the third prompt template.

20. The apparatus of claim 19, wherein The output requirements of the refined outline include at least one of the following: Refine the outline output format requirements; Refine the number of outline titles required; Refine the word count requirements for the outline title.

21. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 10.

22. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-10.

23. A computer program product comprising a computer program, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Powerpoint generation method and device, electronic equipment and storage medium

    CN117436416A