Powerpoint generation method and device and storage medium
By obtaining the source document set and demand statements, generating a presentation outline and filtering candidate elements, the problem of inefficient presentation production in the prior art is solved, and the automated generated presentation is realized, and efficiency and user satisfaction are improved.
Patent Information
- Application Number
- CN202411968695.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-25
AI Technical Summary
In the prior art, the production efficiency of presentations is inefficient, specialized production personnel are required, time-consuming and energy-consuming, and the presentations generated based on the template may not meet user expectations.
Generate a target presentation outline by obtaining the source document set and source requirements statements, and identify candidate elements associated with the outline to generate a presentation from these elements. This method uses pre-trained intent recognition big model and format conversion strategies to automate the production process of presentations.
Automatic generation of presentations is realized, which improves production efficiency, reduces the consumption of time and energy costs, and ensures that the generated presentations meet user expectations.
Smart Images

Figure CN119884045A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a presentation generation method, device and storage medium. Background Art
[0002] Presentations (also called slides) can turn static files into dynamic files for display, making complex issues easy to understand and leaving a deeper impression. Therefore, presentations are becoming an important part of people's work and life, and are widely used in work reports, corporate publicity and other fields, so the demand for presentation production is also increasing day by day.
[0003] In the related art, on the one hand, professional presentations can be produced by dedicated production personnel, but the time and energy cost is high and the production efficiency is low. On the other hand, simple presentations can be generated according to presentation templates, but the generated presentations may not meet user expectations. Summary of the invention
[0004] In order to solve the above technical problems that on the one hand, professional presentations can be produced by dedicated production personnel, but the time and energy cost is high and the production efficiency is low. On the other hand, a simple presentation can be generated according to a presentation template, but the generated presentation may not meet the user's expectations, the embodiment of the present application provides a presentation generation method, device, electronic device and storage medium. The specific technical solution is as follows:
[0005] In a first aspect of an embodiment of the present application, a method for generating a presentation is first provided, the method comprising:
[0006] Acquire a source document set, wherein the source document set includes at least one source document;
[0007] Obtaining a source requirement statement, and generating a target presentation outline according to the source requirement statement and a source document set;
[0008] Determine a candidate element associated with the target presentation outline; wherein the candidate element is a document element contained in a source document;
[0009] A presentation is generated according to the candidate elements.
[0010] In an optional implementation, before determining the candidate element associated with the target presentation outline, the method further includes:
[0011] For any source document in the source document set, extract source elements in the source document;
[0012] A source element set is constructed according to the source element, wherein the source element set includes multiple source elements.
[0013] In an optional implementation, extracting source elements from any source document in the source document set includes:
[0014] For any source document in the source document set, determining a document type corresponding to the source document;
[0015] Finding a format conversion strategy corresponding to the document type;
[0016] According to the format conversion strategy, the source document is format converted to obtain a target document;
[0017] Extract the source element in the target document.
[0018] In an optional implementation, generating a target presentation outline according to the source requirement statement and the source document set includes:
[0019] Constructing source prompt words of a pre-trained intent recognition large model according to the source demand expression and the source document set;
[0020] The source prompt word is input into the pre-trained intention recognition model to obtain the target presentation outline.
[0021] In an optional embodiment, the step of inputting the source prompt word into the pre-trained intention recognition model to obtain a target presentation outline includes:
[0022] Inputting the source prompt words into the pre-trained intention recognition model to obtain a source presentation outline;
[0023] Obtain the adjustment requirement statement and construct the adjustment prompt words of the pre-trained intent recognition model;
[0024] The adjustment prompt words are input into the pre-trained intention recognition model to obtain the target presentation outline.
[0025] In an optional embodiment, the pre-trained intent recognition large model is obtained by:
[0026] Obtain a sample requirement statement, a sample document set, and a sample presentation outline corresponding to the sample requirement statement and the sample document set;
[0027] Constructing fine-tuning prompt words of the intent recognition model according to the sample requirement statement, the sample document set, and the sample presentation outline;
[0028] Inputting the fine-tuned prompt words into the intention recognition large model to obtain a predicted presentation outline;
[0029] Determining an outline loss between the predicted presentation outline and the sample presentation outline, and training the intent recognition model according to the outline loss;
[0030] When the outline loss converges, the training is stopped to obtain the pre-trained intent recognition model.
[0031] In an optional implementation, the determining the candidate element associated with the target presentation outline includes:
[0032] For any source element in the source element set, vectorize the source element to obtain an element vector;
[0033] Vectorizing the target presentation outline to obtain an outline vector;
[0034] Determine the similarity between the element vector and the outline vector; and filter candidate elements associated with the target presentation outline from the source element set based on the similarity.
[0035] In an optional implementation, the step of screening candidate elements associated with the target presentation outline from the source element set according to the similarity includes:
[0036] sorting the source elements in the source element set according to the similarity to obtain a source element sequence;
[0037] Select the first N source elements from the source element sequence, where N is a positive integer;
[0038] Determine the top N source elements as candidate elements to be associated with the target presentation outline;
[0039] Wherein, any source element in the source element set has a corresponding importance mark;
[0040] The step of sorting the source elements in the source element set according to the similarity to obtain a source element sequence includes:
[0041] For any source element in the source element set, the similarity and the importance mark corresponding to the source element are fused to obtain a fusion result;
[0042] According to the fusion result, the source elements in the source element set are sorted to obtain a source element sequence.
[0043] In an optional implementation, there are corresponding importance marks for corresponding source elements in the source element set;
[0044] The selecting the top N source elements from the source element sequence comprises:
[0045] Extracting a source element subsequence from the source element sequence, wherein the similarity corresponding to each source element in the source element subsequence exceeds a preset similarity threshold;
[0046] Determine whether the source element in the source element subsequence has the corresponding importance tag;
[0047] In the case that the source elements in the source element subsequence do not have the corresponding importance tags, selecting the top N source elements from the source element sequence;
[0048] Alternatively, when the source element in the source element subsequence has the corresponding importance flag, the following processing is performed:
[0049] Determine whether the number of the source elements having the importance mark in the source element subsequence is greater than or equal to N;
[0050] When the number of the source elements with the importance mark in the source element subsequence is greater than or equal to N, N source elements with the importance mark are selected from the source element subsequence.
[0051] In an optional embodiment, the method further comprises:
[0052] When the number of the source elements with the importance mark in the source element subsequence is less than N, all the source elements with the importance mark are selected from the source element subsequence;
[0053] The first M source elements are selected from the source element sequence, wherein the first M source elements are not repeated with the source elements having the importance mark, and M is a positive integer, and the sum of M and the number of the source elements having the importance mark is N.
[0054] In a second aspect of the embodiments of the present application, a presentation generating device is further provided, the device comprising:
[0055] A document set acquisition module, used to acquire a source document set, wherein the source document set includes at least one source document;
[0056] An outline generation module, used to obtain a source requirement statement, and generate a target presentation outline according to the source requirement statement and a source document set;
[0057] An element determination module, used to determine a candidate element associated with the target presentation outline; wherein the candidate element is a document element contained in a source document;
[0058] The document generation module is used to generate a presentation document based on the candidate elements.
[0059] In an optional embodiment, the device further comprises:
[0060] An element extraction module, used for extracting source elements from any source document in the source document set;
[0061] The element set construction module is used to construct a source element set according to the source element, wherein the source element set includes multiple source elements.
[0062] In an optional implementation, the element extraction module is specifically used to:
[0063] For any source document in the source document set, determining a document type corresponding to the source document;
[0064] Finding a format conversion strategy corresponding to the document type;
[0065] According to the format conversion strategy, the source document is format converted to obtain a target document;
[0066] Extract the source element in the target document.
[0067] In an optional implementation, the outline generation module specifically includes:
[0068] A source prompt word construction submodule is used to construct source prompt words of a pre-trained intent recognition large model according to the source demand expression and the source document set;
[0069] The outline generation submodule is used to input the source prompt words into the pre-trained intention recognition model to obtain the target presentation outline.
[0070] In an optional implementation, the outline generation submodule is specifically used for:
[0071] Inputting the source prompt words into the pre-trained intention recognition model to obtain a source presentation outline;
[0072] Obtain the adjustment requirement statement and construct the adjustment prompt words of the pre-trained intent recognition model;
[0073] The adjustment prompt words are input into the pre-trained intention recognition model to obtain the target presentation outline.
[0074] In an optional embodiment, the device further includes a model fine-tuning module, specifically configured to:
[0075] Obtain a sample requirement statement, a sample document set, and a sample presentation outline corresponding to the sample requirement statement and the sample document set;
[0076] Constructing fine-tuning prompt words of the intent recognition model according to the sample requirement statement, the sample document set, and the sample presentation outline;
[0077] Inputting the fine-tuned prompt words into the intention recognition large model to obtain a predicted presentation outline;
[0078] Determining an outline loss between the predicted presentation outline and the sample presentation outline, and training the intent recognition model according to the outline loss;
[0079] When the outline loss converges, the training is stopped to obtain the pre-trained intent recognition model.
[0080] In an optional implementation, the element determination module specifically includes:
[0081] An element processing submodule, for performing vectorization processing on any source element in the source element set to obtain an element vector;
[0082] An outline processing submodule, used for vectorizing the target presentation outline to obtain an outline vector, and determining the similarity between the element vector and the outline vector;
[0083] An element screening submodule is used to screen candidate elements associated with the target presentation outline from the source element set according to the similarity.
[0084] In an optional implementation, the element screening submodule specifically includes:
[0085] an element sorting unit, configured to sort the source elements in the source element set according to the similarity to obtain a source element sequence;
[0086] An element selection unit, used for selecting the first N source elements from the source element sequence, where N is a positive integer;
[0087] An element determination unit, configured to determine the top N source elements as candidate elements associated with the target presentation outline;
[0088] Wherein, any source element in the source element set has a corresponding importance mark; and the element sorting unit is specifically used for:
[0089] For any source element in the source element set, the similarity and the importance mark corresponding to the source element are fused to obtain a fusion result;
[0090] According to the fusion result, the source elements in the source element set are sorted to obtain a source element sequence.
[0091] In an optional implementation manner, there is a corresponding importance mark for each source element in the source element set; and the element selection unit is specifically configured to:
[0092] Extracting a source element subsequence from the source element sequence, wherein the similarity corresponding to each source element in the source element subsequence exceeds a preset similarity threshold;
[0093] Determine whether the source element in the source element subsequence has the corresponding importance tag;
[0094] In the case that the source elements in the source element subsequence do not have the corresponding importance tags, selecting the top N source elements from the source element sequence;
[0095] Alternatively, when the source element in the source element subsequence has the corresponding importance flag, the following processing is performed:
[0096] Determine whether the number of the source elements having the importance mark in the source element subsequence is greater than or equal to N;
[0097] When the number of the source elements with the importance mark in the source element subsequence is greater than or equal to N, N source elements with the importance mark are selected from the source element subsequence.
[0098] In an optional implementation, the element selection unit is further used to:
[0099] When the number of the source elements with the importance mark in the source element subsequence is less than N, all the source elements with the importance mark are selected from the source element subsequence;
[0100] The first M source elements are selected from the source element sequence, wherein the first M source elements are not repeated with the source elements having the importance mark, and M is a positive integer, and the sum of M and the number of the source elements having the importance mark is N.
[0101] In a third aspect of the embodiments of the present application, there is further provided an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0102] Memory, used to store computer programs;
[0103] The processor is used to implement any presentation generation method described in the first aspect when executing the program stored in the memory.
[0104] In a fourth aspect of the embodiments of the present application, a storage medium is further provided, wherein instructions are stored in the storage medium, and when the storage medium is run on a computer, the computer executes any one of the presentation generation methods described in the first aspect above.
[0105] In a fifth aspect of the embodiments of the present application, a computer program product comprising instructions is also provided, which, when executed on a computer, enables the computer to execute any of the above-described presentation generation methods.
[0106] The technical solution provided by the embodiment of the present application obtains a source document set, the source document set contains at least one source document, obtains a source requirement statement, generates a target presentation outline based on the source requirement statement and the source document set, determines candidate elements associated with the target presentation outline, wherein the candidate elements are document elements contained in the source document, and generates a presentation based on the candidate elements.
[0107] Through the source requirement expression and the source document set, the target presentation outline is generated, and the candidate elements associated with the target presentation outline are determined. The candidate elements are document elements contained in the source documents in the source document set. The presentation is generated based on the candidate elements. In this way, through the source requirement expression and the source document set, the target presentation outline is generated, and the candidate elements associated with the target presentation outline are determined. The presentation is generated. The candidate elements are document elements contained in the source documents in the source document set. The automatic generation of the presentation can be realized, which improves efficiency, reduces the consumption of time and energy costs, and the generated presentation meets user expectations. BRIEF DESCRIPTION OF THE DRAWINGS
[0108] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0109] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0110] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0111] Figure 1 A schematic diagram of an implementation flow of a presentation generation method shown in an embodiment of the present application;
[0112] Figure 2 This is a schematic diagram of an implementation flow of another presentation generation method shown in an embodiment of the present application;
[0113] Figure 3 A schematic diagram of an implementation process of a large model fine-tuning method shown in an embodiment of the present application;
[0114] Figure 4 This is a schematic diagram of an implementation flow of another method for generating a presentation document shown in an embodiment of the present application;
[0115] Figure 5 It is a structural schematic diagram of a presentation document generating device shown in an embodiment of the present application;
[0116] Figure 6 It is a schematic diagram of the structure of an electronic device shown in an embodiment of the present application. DETAILED DESCRIPTION
[0117] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0118] The disclosure below provides many different embodiments or examples to realize the different structures of the present application. In order to simplify the disclosure of the present application, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present application. In addition, the present application can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.
[0119] like Figure 1 FIG. 1 is a schematic diagram of an implementation flow of a method for generating a presentation provided in an embodiment of the present application. The method is applied to an electronic device and may specifically include the following steps:
[0120] S101, obtaining a source document set, where the source document set includes at least one source document.
[0121] In the embodiment of the present application, a user may be provided with some source documents in advance. These source documents may be any type of documents to which the user has access rights, and then constitute a source document set.
[0122] Thus, the above-mentioned source document set can be obtained, and the source document set contains at least one source document. For example, a source document set is obtained, and the source document set contains several source documents such as source document 1, source document 2, source document 3, ..., and the document types of the source documents can be various. In one embodiment of the present application, since the reference materials used by the user to generate the presentation document outline can be diverse, the source document can be any type of document to which the user has access rights, which can be a local document, an online document, or other documents accessed through a domain name or a link. The document type of the source document can be a word document, a table, a PDF document, etc., or a presentation document; the source document set can contain multiple documents of the same type, or multiple documents of different types, which are not limited here.
[0123] S102, obtaining a source requirement statement, and generating a target presentation outline according to the source requirement statement and a source document set.
[0124] In the embodiment of the present application, a source demand expression may be obtained, and the source demand expression may refer to a user's demand expression, which represents the user's intention. For example, the source demand expression may be "I want to make a year-end report, which mainly includes three parts. The first part is what the goal is for this year, the second part is the completion of the goal for this year, and the actions taken in the process of completing the goal, and the third part is the plan for the next year."
[0125] Therefore, for the source requirement expression and source document set obtained above, a target presentation outline can be generated according to the source requirement expression and source document set, and the target presentation outline can reflect the user's intention.
[0126] For example, for the above source requirement statement "I want to make a year-end report, which mainly includes three parts. The first part is what the goal is for this year, the second part is the completion of the goal for this year, and the actions taken in the process of completing the goal, and the third part is the plan for the next year", as well as the source document set, a target presentation outline can be generated based on it, which contains three first-level topics, corresponding to the three parts in the source requirement statement one by one.
[0127] S103, determining candidate elements associated with the target presentation outline, wherein the candidate elements are document elements contained in the source document.
[0128] In an embodiment of the present application, for the target presentation outline generated as described above, candidate elements associated with the target presentation outline can be determined, wherein the candidate elements are document elements contained in the source documents in the source document set, which can be text, pictures, tables, flow charts, objects, etc., meaning that there is an association between the determined candidate elements and the target presentation outline.
[0129] S104: Generate a presentation based on the candidate elements.
[0130] In an embodiment of the present application, for the candidate elements associated with the target presentation outline determined above, a presentation can be generated based on the candidate elements. The candidate elements can be typeset with reference to the target presentation outline, so that a presentation can be obtained.
[0131] Among them, the target presentation outline determines the framework (or architecture) of the presentation, and the candidate elements associated with the target presentation outline determine the specific content expression of the presentation, which is not limited in the embodiments of the present application.
[0132] Through the above description of the technical solution provided by the embodiment of the present application, a source document set is obtained, the source document set contains at least one source document, a source requirement statement is obtained, a target presentation outline is generated based on the source requirement statement and the source document set, and candidate elements associated with the target presentation outline are determined, wherein the candidate elements are document elements contained in the source document, and a presentation is generated based on the candidate elements.
[0133] Generate the target presentation outline through the source requirement expression and source document set, determine the candidate elements associated with the target presentation outline, the candidate elements are document elements contained in the source documents in the source document set, and generate the presentation based on the candidate elements. In this way, the presentation can be automatically generated based on user requirements and historical user documents, which improves efficiency, reduces the consumption of time and energy costs, and the generated presentation meets user expectations.
[0134] In addition, in an embodiment of the present application, for users, on the one hand, they can provide some documents in advance, and then extract the source elements therein to form a source element set; on the other hand, they can interact with the intention model to generate the presentation outline they want, and then recall some source elements from the source element set as candidate elements based on the presentation outline to generate a presentation.
[0135] Based on this, Figure 2 FIG. 1 is a schematic diagram of an implementation flow of another method for generating a presentation provided in an embodiment of the present application. The method is applied to an electronic device and may specifically include the following steps:
[0136] S201, obtaining a source document set, where the source document set includes at least one source document.
[0137] In the embodiment of the present application, this step is similar to the above-mentioned step S101, and the embodiment of the present application will not be described one by one here.
[0138] S202: For any source document in the source document set, extract source elements in the source document.
[0139] In the embodiment of the present application, for the above source document set, for any source document in the source document set, source elements in the source document are extracted, wherein the source elements may be various types of elements such as text, pictures, tables, flow charts and / or objects.
[0140] Among them, the source documents have various document types. For example, the source document can be a PDF document, or a text document (such as a DOC document), or a table document, etc., and they need to be formatted to facilitate the subsequent screening of candidate elements through vectorization processing.
[0141] For example, PDF documents or text documents can be converted into documents in XML format; mind maps or figma documents can be converted into documents in json format; table documents can be converted into documents in the format of table headers and each row of data. There are corresponding format conversion strategies for source documents of different document types.
[0142] Based on this, for any source document in the source document set, determine the document type corresponding to the source document, find the format conversion strategy corresponding to the document type, and then convert the format of the source document according to the format conversion strategy to obtain the target document, and extract the source elements in the target document, thereby realizing the extraction of source elements in each source document in the source document set.
[0143] S203, constructing a source element set according to the source elements, and obtaining a source requirement expression, wherein the source element set includes a plurality of source elements.
[0144] In an embodiment of the present application, for the source elements extracted from each source document in the above source document set, a source element set can be constructed based on these source elements, so that the source element set contains multiple source elements, and the source elements in the source element set come from at least one source document. When the source document set contains two or more source documents, the source elements come from different source documents, and the document formats of the source documents are different. In addition, it is also necessary to obtain a source requirement statement.
[0145] S204, constructing source prompt words of a pre-trained intent recognition large model based on the source demand expression and the source document set.
[0146] S205, input the source prompt word into the pre-trained intention recognition model to obtain the target presentation outline.
[0147] In an embodiment of the present application, a pre-trained intent recognition model is provided, which can automatically generate a corresponding presentation outline based on the user's input demand expression and the source document set, and the presentation outline is a reflection of the user's intent. Among them, the model architecture of the pre-trained intent recognition model can be similar to the model architecture of the existing large language model, and the embodiment of the present application does not limit this.
[0148] Based on this, according to the source demand statement and the source document set, the source prompt words of the pre-trained intent recognition model are constructed, and the source prompt words are input into the pre-trained intent recognition model to obtain the target presentation outline.
[0149] In one embodiment of the present application, the source prompt words may include three parts: input, output, and instruction description. For the input, it is filled with the above-mentioned requirement statement and the source document set; for the output, no content needs to be filled in to allow the pre-trained intent recognition large model to output; for the instruction description, it indicates what tasks the pre-trained intent recognition large model needs to perform based on the input, which can also be included in the input, and an additional presentation outline example is given for the pre-trained intent recognition large model to refer to. In addition, in the model application stage, the source prompt words may include two parts: input and instruction description, which is not limited in the embodiment of the present application.
[0150] For example, for the above source requirement statement "I want to make a year-end report, which mainly includes three parts. The first part is what the goal is for this year, the second part is the completion status of this year's goal, and the actions taken in the process of completing the goal, and the third part is the plan for next year", we can build the source prompt words of the pre-trained intent recognition big model based on the source requirement statement and the source document set, and input the source prompt words into the pre-trained intent recognition big model to obtain the target presentation outline. The target presentation outline contains three first-level topics, which correspond one by one to the three parts in the source requirement statement.
[0151] In addition, for the pre-trained intent recognition large model, the user may not be satisfied with the presentation outline generated based on the user's needs and the source document set. At this time, the presentation outline can be further adjusted based on the user's needs. After at least one adjustment, a presentation outline that meets the user's needs is finally obtained. Among them, for the pre-trained intent recognition large model, the user can make multiple adjustments based on user needs until the user is satisfied with the presentation outline generated by the pre-trained intent recognition large model.
[0152] Based on this, according to the source demand expression, the source prompt words of the pre-trained intent recognition large model are constructed, the source prompt words are input into the pre-trained intent recognition large model to obtain the source presentation outline, and then the adjustment demand expression is obtained, the adjustment prompt words of the pre-trained intent recognition large model are constructed, the adjustment prompt words are input into the pre-trained intent recognition large model to obtain the target presentation outline. In one embodiment of the present application, the adjustment demand expression is obtained, and the adjustment prompt words of the pre-trained intent recognition large model are constructed, including: obtaining the adjustment demand expression, and constructing the adjustment prompt words of the pre-trained intent recognition large model according to the adjustment demand expression, the source document set and the source presentation outline.
[0153] It should be noted that, in one embodiment of the present application, the adjustment prompt words, similar to the above-mentioned source prompt words, may also include three parts: input, output, and instruction description. For input, it may include a source document set and a source presentation outline, or it may include a source document set, a source presentation outline, and instructions represented by the demand statement; and for output, it is not necessary to fill in any content to allow the pre-trained intent recognition large model to output. For the instruction description, it indicates what tasks the pre-trained intent recognition large model needs to perform based on the input, which may also be included in the input, and an additional presentation outline example is given for the pre-trained intent recognition large model to refer to. In addition, in the model application stage, for the adjustment prompt words, it may include two parts: input and instruction description, which is not limited in the embodiment of the present application.
[0154] In addition, the pre-trained intent recognition model needs to be fine-tuned before it can generate the corresponding presentation outline based on the user's needs and source document set. Figure 3 FIG. 1 is a schematic diagram of an implementation flow of a large model fine-tuning method provided in an embodiment of the present application. The method is applied to an electronic device and may specifically include the following steps:
[0155] S301, obtaining a sample requirement statement, a sample document set, and a sample presentation outline corresponding to the sample requirement statement and the sample document set.
[0156] In the embodiment of the present application, a sample requirement statement, a sample document set, and a sample presentation outline corresponding to the sample requirement statement and the sample document set can be obtained. The sample requirement statement is similar to the above-mentioned source requirement statement, and the sample document set is similar to the above-mentioned source document set, including at least one sample document, and the sample presentation outline is similar to the above-mentioned target presentation outline. The embodiment of the present application will not be described one by one here.
[0157] S302, construct fine-tuning prompt words for the intent recognition model based on the sample requirement statement, the sample document set, and the sample presentation outline.
[0158] In the embodiment of the present application, the fine-tuning prompt words of the intention recognition large model can be constructed according to the sample demand expression, the sample document set and the sample presentation outline. The intention recognition large model can be any existing large language model.
[0159] It should be noted that, in one embodiment of the present application, the fine-tuning prompt words, similar to the above-mentioned source prompt words, can include three parts: input, output, and instruction description. For the input, it can include the above-mentioned sample document set, or it can include the sample document set and the instructions represented by the demand statement; and for the output, it includes the sample presentation outline, and the instruction description, which indicates what tasks the pre-trained intent recognition model needs to perform based on the input, can also be included in the input, and an additional presentation outline example is given for the reference of the pre-trained intent recognition model.
[0160] S303, input the fine-tuning prompt words into the intention recognition model to obtain the predicted presentation outline.
[0161] In an embodiment of the present application, the fine-tuning prompt words constructed above can be input into the intention recognition large model, and the intention recognition large model can predict the presentation outline based on this, so as to obtain the predicted presentation outline output by the intention recognition large model.
[0162] S304, determining the outline loss between the predicted presentation outline and the sample presentation outline, and training the intent recognition model according to the outline loss.
[0163] S305, when the outline loss converges, stop training and obtain a pre-trained intent recognition model.
[0164] In an embodiment of the present application, for a predicted presentation outline, an outline loss between the predicted presentation outline and the sample presentation outline can be determined, and the intent recognition model can be trained according to the outline loss. When the outline loss converges, for example, when the outline loss is less than a certain threshold, the training is stopped to obtain a pre-trained intent recognition model.
[0165] It should be noted that the outline loss between the predicted presentation outline and the sample presentation outline may be determined using an existing loss function, which is not limited in the embodiments of the present application.
[0166] After the above-mentioned fine-tuning steps, the fine-tuning prompt words are provided to the intention recognition large model for learning, and a pre-trained intention recognition large model is obtained. The intention recognition large model learns the correspondence between the sample demand expression in the fine-tuning prompt words and the sample presentation outline, and obtains the pre-trained intention recognition large model.
[0167] For the intent recognition big model, after the above-mentioned fine-tuning steps, a pre-trained intent recognition big model can be obtained. The user can input his own demand expression and source document set, build prompt words according to the demand expression and source document set, and input the prompt words into the pre-trained intent recognition big model to obtain the presentation outline.
[0168] S206, filtering candidate elements associated with the target presentation outline from the source element set.
[0169] In an embodiment of the present application, for a target presentation outline, candidate elements associated with the target presentation outline may be screened from a source element set, wherein the screening of candidate elements may be performed by vectorized processing.
[0170] Specifically, for any source element in the source element set, the source element is vectorized to obtain an element vector, the target presentation outline is vectorized to obtain an outline vector, and the similarity between the element vector and the outline vector is determined. Based on the similarity, candidate elements associated with the target presentation outline are screened from the source element set.
[0171] For example, for source element i in the source element set (i is 1, 2, 3, ..., N, where N is a positive integer), source element i is vectorized to obtain an element vector. Similarly, for the target presentation outline, vectorization is also performed to obtain an outline vector. Then the similarity between the element vector and the outline vector is calculated. In this way, for any source element in the source element set, there is a corresponding similarity with the target presentation outline. Based on these similarities, candidate elements associated with the target presentation outline can be screened from the source element set.
[0172] It should be noted that the similarity between the element vector and the outline vector can be determined by, for example, calculating the cosine distance, which is not limited in the embodiments of the present application.
[0173] Among them, for any source element in the source element set, there is a corresponding similarity between it and the target presentation outline. According to these similarities, the source elements in the source element set can be sorted to obtain a source element sequence. The source element sequence is an ordered source element sequence. The top N source elements are selected from the source element sequence, where N is a positive integer, and the top N source elements are determined as candidate elements associated with the target presentation outline.
[0174] It should be noted that, for the source elements in the source element set, the source elements in the source element set can be sorted from large to small according to the above similarity, so that an ordered source element sequence can be obtained, and then the top N source elements in the source element sequence are selected as candidate elements associated with the target presentation outline.
[0175] In addition, in the embodiment of the present application, for source elements in any source document of the source document set, the user has marked them accordingly according to their importance, so that in the process of extracting source elements in any source document of the source document set, corresponding importance marks are also extracted accordingly, so that each source element in the source element set has a corresponding importance mark. For example, importance marks can be divided into three categories: very important, relatively important, and generally important.
[0176] Therefore, in the process of sorting the source elements in the source element set, not only the similarity but also the importance mark can be referred to. To this end, for any source element in the source element set, the similarity and the importance mark corresponding to the source element are fused to obtain a fusion result, and according to the fusion result, the source elements in the source element set are sorted to obtain a source element sequence, and the top N source elements are selected from the source element sequence, where N is a positive integer, and the top N source elements are determined as candidate elements associated with the target presentation outline.
[0177] It should be noted that the similarities and importance marks corresponding to the source elements may be fused using a fusion method such as weighted summation, which is not limited in the embodiments of the present application.
[0178] S207: Generate a presentation based on the candidate elements.
[0179] In the embodiment of the present application, this step is similar to the above-mentioned step S104, and the embodiment of the present application will not be described one by one here.
[0180] In this way, users can, on the one hand, provide some documents in advance, and then extract the source elements from them to form a source element set. On the other hand, they can interact with the intention model to generate the presentation outline they want. Later, according to the presentation outline, some source elements are recalled from the source element set as candidate elements to generate a presentation. This can realize the automatic generation of presentations, improve efficiency, reduce the consumption of time and energy costs, and the generated presentation meets user expectations.
[0181] In addition, if Figure 4 FIG. 1 is a schematic diagram of an implementation flow of another method for generating a presentation provided in an embodiment of the present application. The method is applied to an electronic device and may specifically include the following steps:
[0182] S401, obtaining a source document set, where the source document set includes at least one source document.
[0183] S402: For any source document in the source document set, extract source elements in the source document.
[0184] S403, constructing a source element set according to the source elements, and obtaining a source requirement expression, wherein the source element set includes a plurality of source elements.
[0185] S404, constructing source prompt words of a pre-trained intent recognition large model according to the source demand expression and the source document set.
[0186] S405, input the source prompt word into the pre-trained intention recognition model to obtain the target presentation outline.
[0187] In the embodiment of the present application, steps S401 to S405 are similar to the above-mentioned steps S201 to S205, and the embodiment of the present application will not be described one by one here.
[0188] S406, for any source element in the source element set, perform vectorization processing on the source element to obtain an element vector.
[0189] S407, vectorizing the target presentation outline to obtain an outline vector, and determining the similarity between the element vector and the outline vector.
[0190] S408, screening candidate elements associated with the target presentation outline from the source element set according to the similarity.
[0191] In an embodiment of the present application, for any source element in the source element set, the source element is vectorized to obtain an element vector, the target presentation outline is vectorized to obtain an outline vector, and the similarity between the element vector and the outline vector is determined. Based on the similarity, candidate elements associated with the target presentation outline are screened from the source element set.
[0192] Among them, the source elements in the source element set can be sorted according to similarity to obtain a source element sequence, which is an ordered source element sequence. The top N source elements are selected from the source element sequence, where N is a positive integer, and the top N source elements are determined as candidate elements associated with the target presentation outline.
[0193] In addition, in an embodiment of the present application, for source elements in any source document of the source document set, if the user thinks it is important, it will be marked, and if it is not important, it will not be marked, which means that some source elements have corresponding importance marks, while some source elements do not have corresponding importance marks. Therefore, in the process of extracting source elements in any source document of the source document set, if the source element has a corresponding importance mark, the corresponding importance mark is also extracted accordingly. If the source element does not have a corresponding importance mark, there is no need to extract the corresponding importance mark. In this way, the corresponding source elements in the source element set have corresponding importance marks.
[0194] Therefore, when the source elements in the source element set are sorted according to the similarity to obtain the source element sequence, and the source elements with importance marks are selected from the source element sequence, the source elements can be preferentially selected. To this end, the source elements in the source element set are sorted according to the similarity to obtain the source element sequence, and a source element subsequence is intercepted from the source element sequence, wherein the similarity corresponding to each source element in the source element subsequence exceeds a preset similarity threshold, and it is determined whether the source elements in the source element subsequence have corresponding importance marks. In the case that the source elements in the source element subsequence do not have corresponding importance marks, the top N source elements are selected from the source element sequence, N being a positive integer, and the top N source elements are determined as candidate elements associated with the target presentation outline.
[0195] In addition, when there are corresponding importance marks for source elements in the source element subsequence, the following processing is performed: determine whether the number of source elements with importance marks in the source element subsequence is greater than or equal to N; when the number of source elements with importance marks in the source element subsequence is greater than or equal to N, select N source elements with importance marks from the source element subsequence; when the number of source elements with importance marks in the source element subsequence is less than N, select all source elements with importance marks from the source element subsequence; select the first M source elements from the source element sequence, the first M source elements do not overlap with the source elements with importance marks, and M is a positive integer, and the sum of M and the number of source elements with importance marks is N.
[0196] S409: Generate a presentation based on the candidate elements.
[0197] In the embodiment of the present application, this step is similar to the above-mentioned step S104, and the embodiment of the present application will not be described one by one here.
[0198] In this way, users can, on the one hand, provide some documents in advance, and then extract the source elements from them to form a source element set. On the other hand, they can interact with the intention model to generate the presentation outline they want. Later, according to the presentation outline, some source elements are recalled from the source element set as candidate elements to generate a presentation. This can realize the automatic generation of presentations, improve efficiency, reduce the consumption of time and energy costs, and the generated presentation meets user expectations.
[0199] Corresponding to the above method embodiment, the present application embodiment also provides a presentation document generation device, such as Figure 5 As shown, the apparatus may include: a document set acquisition module 510 , an outline generation module 520 , an element determination module 530 , and a manuscript generation module 540 .
[0200] A document set acquisition module 510 is used to acquire a source document set, wherein the source document set includes at least one source document;
[0201] An outline generation module 520 is used to obtain a source requirement statement and generate a target presentation outline according to the source requirement statement and a source document set;
[0202] An element determination module 530, configured to determine a candidate element associated with the target presentation outline; wherein the candidate element is a document element contained in a source document;
[0203] The document generation module 540 is used to generate a presentation document according to the candidate elements.
[0204] In an optional embodiment, the device further comprises:
[0205] An element extraction module, used for extracting source elements from any source document in the source document set;
[0206] The element set construction module is used to construct a source element set according to the source element, wherein the source element set includes multiple source elements.
[0207] In an optional implementation, the element extraction module is specifically used to:
[0208] For any source document in the source document set, determining a document type corresponding to the source document;
[0209] Finding a format conversion strategy corresponding to the document type;
[0210] According to the format conversion strategy, the source document is format converted to obtain a target document;
[0211] Extract the source element in the target document.
[0212] In an optional implementation, the outline generation module specifically includes:
[0213] A source prompt word construction submodule is used to construct source prompt words of a pre-trained intent recognition large model according to the source demand expression and the source document set;
[0214] The outline generation submodule is used to input the source prompt words into the pre-trained intention recognition model to obtain the target presentation outline.
[0215] In an optional implementation, the outline generation submodule is specifically used for:
[0216] Inputting the source prompt words into the pre-trained intention recognition model to obtain a source presentation outline;
[0217] Obtain the adjustment requirement statement and construct the adjustment prompt words of the pre-trained intent recognition model;
[0218] The adjustment prompt words are input into the pre-trained intention recognition model to obtain the target presentation outline.
[0219] In an optional embodiment, the device further includes a model fine-tuning module, specifically configured to:
[0220] Obtain a sample requirement statement, a sample document set, and a sample presentation outline corresponding to the sample requirement statement and the sample document set;
[0221] Constructing fine-tuning prompt words of the intent recognition model according to the sample requirement statement, the sample document set, and the sample presentation outline;
[0222] Inputting the fine-tuned prompt words into the intention recognition large model to obtain a predicted presentation outline;
[0223] Determining an outline loss between the predicted presentation outline and the sample presentation outline, and training the intent recognition model according to the outline loss;
[0224] When the outline loss converges, the training is stopped to obtain the pre-trained intent recognition model.
[0225] In an optional implementation, the element determination module specifically includes:
[0226] An element processing submodule, for performing vectorization processing on any source element in the source element set to obtain an element vector;
[0227] An outline processing submodule, used for vectorizing the target presentation outline to obtain an outline vector, and determining the similarity between the element vector and the outline vector;
[0228] An element screening submodule is used to screen candidate elements associated with the target presentation outline from the source element set according to the similarity.
[0229] In an optional implementation, the element screening submodule specifically includes:
[0230] an element sorting unit, configured to sort the source elements in the source element set according to the similarity to obtain a source element sequence;
[0231] An element selection unit, used for selecting the first N source elements from the source element sequence, where N is a positive integer;
[0232] An element determination unit, configured to determine the top N source elements as candidate elements associated with the target presentation outline;
[0233] Wherein, the corresponding source elements in the source element set have corresponding importance marks; and the element sorting unit is specifically used for:
[0234] For any source element in the source element set, the similarity and the importance mark corresponding to the source element are fused to obtain a fusion result;
[0235] According to the fusion result, the source elements in the source element set are sorted to obtain a source element sequence.
[0236] In an optional implementation manner, there is a corresponding importance mark for each source element in the source element set; and the element selection unit is specifically configured to:
[0237] Extracting a source element subsequence from the source element sequence, wherein the similarity corresponding to each source element in the source element subsequence exceeds a preset similarity threshold;
[0238] Determine whether the source element in the source element subsequence has the corresponding importance tag;
[0239] In the case that the source elements in the source element subsequence do not have the corresponding importance tags, selecting the top N source elements from the source element sequence;
[0240] Alternatively, when the source element in the source element subsequence has the corresponding importance flag, the following processing is performed:
[0241] Determine whether the number of the source elements having the importance mark in the source element subsequence is greater than or equal to N;
[0242] When the number of the source elements with the importance mark in the source element subsequence is greater than or equal to N, N source elements with the importance mark are selected from the source element subsequence.
[0243] In an optional implementation, the element selection unit is further used to:
[0244] When the number of the source elements with the importance mark in the source element subsequence is less than N, all the source elements with the importance mark are selected from the source element subsequence;
[0245] The first M source elements are selected from the source element sequence, wherein the first M source elements are not repeated with the source elements having the importance mark, and M is a positive integer, and the sum of M and the number of the source elements having the importance mark is N.
[0246] The present application also provides an electronic device, such as Figure 6 As shown, it includes a processor 61, a communication interface 62, a memory 63 and a communication bus 64, wherein the processor 61, the communication interface 62, and the memory 63 communicate with each other through the communication bus 64.
[0247] Memory 63, used for storing computer programs;
[0248] The processor 61 is used to execute the program stored in the memory 63 to implement the following steps:
[0249] Obtain a source document set, wherein the source document set includes at least one source document; obtain a source requirement statement, and generate a target presentation outline based on the source requirement statement and the source document set; determine candidate elements associated with the target presentation outline; wherein the candidate elements are document elements included in the source document; and generate a presentation based on the candidate elements.
[0250] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0251] The communication interface is used for communication between the above electronic device and other devices.
[0252] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0253] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0254] In another embodiment provided in the present application, a storage medium is also provided, in which instructions are stored. When the storage medium is run on a computer, the computer executes the presentation generation method described in any of the above embodiments.
[0255] In another embodiment provided in the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the presentation generation method described in any one of the above embodiments.
[0256] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a storage medium, or transmitted from one storage medium to another storage medium, for example, the computer instructions may be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.
[0257] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0258] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0259] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.
Claims
1. A method for generating a presentation, characterized in that: The method comprises: Acquire a source document set, wherein the source document set includes at least one source document; Obtaining a source requirement statement, and generating a target presentation outline according to the source requirement statement and a source document set; Determine a candidate element associated with the target presentation outline; wherein the candidate element is a document element contained in a source document; A presentation is generated according to the candidate elements.
2. The method according to claim 1, characterized in that Prior to determining candidate elements associated with the target presentation outline, further comprising: For any source document in the source document set, extract source elements in the source document; A source element set is constructed according to the source element, wherein the source element set includes multiple source elements.
3. The method according to claim 2, characterized in that The extracting source elements from any source document in the source document set includes: For any source document in the source document set, determining a document type corresponding to the source document; Finding a format conversion strategy corresponding to the document type; According to the format conversion strategy, the source document is format converted to obtain a target document; Extract the source element in the target document.
4. The method according to claim 1, characterized in that: The step of generating a target presentation outline according to the source requirement statement and the source document set includes: Constructing source prompt words of a pre-trained intent recognition large model according to the source demand expression and the source document set; The source prompt word is input into the pre-trained intention recognition model to obtain the target presentation outline.
5. The method according to claim 4, characterized in that The step of inputting the source prompt word into the pre-trained intention recognition model to obtain a target presentation outline includes: Inputting the source prompt words into the pre-trained intention recognition model to obtain a source presentation outline; Obtain the adjustment requirement statement and construct the adjustment prompt words of the pre-trained intent recognition model; The adjustment prompt words are input into the pre-trained intention recognition model to obtain the target presentation outline.
6. The method according to claim 4, characterized in that The pre-trained intent recognition model is obtained in the following way: Obtain a sample requirement statement, a sample document set, and a sample presentation outline corresponding to the sample requirement statement and the sample document set; Constructing fine-tuning prompt words of the intent recognition model according to the sample requirement statement, the sample document set, and the sample presentation outline; Inputting the fine-tuned prompt words into the intention recognition large model to obtain a predicted presentation outline; Determining an outline loss between the predicted presentation outline and the sample presentation outline, and training the intent recognition model according to the outline loss; When the outline loss converges, the training is stopped to obtain the pre-trained intent recognition model.
7. The method according to claim 2, characterized in that Identify candidate elements associated with the target presentation outline, including: For any source element in the source element set, vectorize the source element to obtain an element vector; Vectorizing the target presentation outline to obtain an outline vector; Determine the similarity between the element vector and the outline vector; and filter candidate elements associated with the target presentation outline from the source element set based on the similarity.
8. The method according to claim 7, characterized in that The step of screening candidate elements associated with the target presentation outline from the source element set according to the similarity comprises: sorting the source elements in the source element set according to the similarity to obtain a source element sequence; Select the first N source elements from the source element sequence, where N is a positive integer; Determine the top N source elements as candidate elements to be associated with the target presentation outline; Wherein, any source element in the source element set has a corresponding importance mark; The step of sorting the source elements in the source element set according to the similarity to obtain a source element sequence includes: For any source element in the source element set, the similarity and the importance mark corresponding to the source element are fused to obtain a fusion result; According to the fusion result, the source elements in the source element set are sorted to obtain a source element sequence.
9. The method according to claim 8, characterized in that There are corresponding importance marks for corresponding source elements in the source element set; The selecting the top N source elements from the source element sequence comprises: Extracting a source element subsequence from the source element sequence, wherein the similarity corresponding to each source element in the source element subsequence exceeds a preset similarity threshold; Determine whether the source element in the source element subsequence has the corresponding importance tag; In the case that the source elements in the source element subsequence do not have the corresponding importance tags, selecting the top N source elements from the source element sequence; Alternatively, when the source element in the source element subsequence has the corresponding importance flag, the following processing is performed: Determine whether the number of the source elements having the importance mark in the source element subsequence is greater than or equal to N; When the number of the source elements with the importance mark in the source element subsequence is greater than or equal to N, N source elements with the importance mark are selected from the source element subsequence.
10. The method according to claim 9, characterized in that The method further comprises: When the number of the source elements with the importance mark in the source element subsequence is less than N, all the source elements with the importance mark are selected from the source element subsequence; The first M source elements are selected from the source element sequence, wherein the first M source elements are not repeated with the source elements having the importance mark, and M is a positive integer, and the sum of M and the number of the source elements having the importance mark is N.
11. A presentation document generating device, characterized in that: The device comprises: A document set acquisition module, used to acquire a source document set, wherein the source document set includes at least one source document; An outline generation module, used to obtain a source requirement statement, and generate a target presentation outline according to the source requirement statement and a source document set; An element determination module, used to determine a candidate element associated with the target presentation outline; wherein the candidate element is a document element contained in a source document; The document generation module is used to generate a presentation document according to the candidate elements.
12. A storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.