Super-long text abstract extraction method and device based on large model, terminal and medium
By cutting ultra-long text into multiple text slices and re-cutting, the inefficiency and understanding errors caused by improper window size when processing long text is solved, and the efficient understanding and accurate summary generation of large models when processing ultra-long text is achieved.
Patent Information
- Application Number
- CN202411873313.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-04-08
AI Technical Summary
When existing large models deal with long text, too large windows can lead to inefficiency and noise increase, and too small windows can miss important context information, resulting in misunderstandings or generating incoherent text.
By determining the text length of the ultra-long text and the maximum context length supported by the current big model, cut the ultra-long text into multiple text slices and re-cut each slice to obtain the fragment to be entered, input it to the big model to generate the summary result, and if necessary, splice the summary result with the next text slice until all slice processing is complete.
It effectively avoids the efficiency reduction and noise increase caused by excessive windows when large models process ultra-long text, and ensures that large models can accurately understand semantic information in the text, improving the quality of ultra-long text summary.
Smart Images

Figure CN119783666A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, device, terminal and medium for extracting a super-long text summary based on a large model. Background Art
[0002] At present, in the existing large model system, the context window is a very important evaluation criterion. The context window refers to the range of contextual information that the large model can consider when processing text. This range determines the maximum number of words or characters that the large model can refer to when generating or understanding text. The size of the context window has an important impact on the understanding ability and generation quality of the large model. The main function of the context window is to help the large model capture and understand the semantic information in the text.
[0003] In a larger context window, the large model can see more context information, which is very useful for understanding long texts, documents, books, etc. However, the size of the context window is not the larger the better. The longer the context window means the stronger the performance of the large model, but when the context length exceeds a certain limit, the performance of the large model will drop drastically. When the context length reaches a certain limit, both the output quality and the response speed of the large model will be greatly affected. In other words, if the window is too large, the large model may process too much information, which may lead to inefficiency and may even introduce unnecessary noise. On the contrary, if the window is too small, the large model may miss important context information, resulting in misunderstanding or incoherent text. For example, the maximum context token length supported by the current mainstream large model is generally 128K. If it exceeds this length, the large model will not be able to understand and obtain the correct answer.
[0004] Therefore, when faced with the problem of large models processing long texts, how to optimize the large model's processing process for long texts to improve the model's performance when processing long texts and ensure that the large model can accurately understand the semantic information in the text is a technical problem that needs to be solved by technical personnel in this field. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide a method, device, terminal and medium for extracting super-long text summaries based on a large model in response to the above-mentioned defects of the prior art, which can improve the performance of the model when processing long texts.
[0006] The technical solution adopted by the present invention to solve the technical problem is as follows:
[0007] A method for extracting a long text summary based on a large model, wherein the method comprises:
[0008] S1. Determine the text length of the super-long text, and based on the text length and the maximum context length supported by the current large model, cut the super-long text into multiple text slices, and select one text slice from the multiple text slices in turn as the current slice to be processed;
[0009] S2, re-cutting the current slice to be processed to obtain multiple segments to be input, and inputting the multiple segments to be input and the currently generated prompt words into the current large model to obtain the current summary result output by the current large model;
[0010] S3, determining whether the current slice to be processed is the last text slice, and if the current slice to be processed is not the last text slice, concatenating the current summary result with the next selected text slice to obtain a new current slice to be processed;
[0011] S4. Repeat steps S2 to S3 until all text slices are processed, and then determine the summary result corresponding to the last text slice output by the current large model as the target summary of the super-long text.
[0012] In one implementation, the cutting of the super-long text into multiple text slices based on the text length and the maximum context length supported by the current large model includes:
[0013] Calculate the maximum text length of each slice based on the text length and the maximum context length supported by the current large model;
[0014] The super-long text is cut according to the maximum text length of each slice to obtain multiple text slices.
[0015] In one implementation, the calculating the maximum text length of each slice based on the text length and the maximum context length supported by the current large model includes:
[0016] The number of slices is determined based on the text length and the maximum context length supported by the current large model, and the maximum text length of each slice is calculated according to the number of slices and the text length.
[0017] In one implementation, the calculating the maximum text length of each slice according to the number of slices and the text length includes:
[0018] The number of slices and the text length are processed according to a preset calculation formula to obtain the maximum text length of each slice;
[0019] Wherein, the preset calculation formula is:
[0020]
[0021] Among them, l max Indicates the maximum text length of each slice, L indicates the text length of the overlong text, and N indicates the number of slices.
[0022] In one implementation, the maximum text length is no greater than the maximum context length supported by the current large model.
[0023] In one implementation, the large model-based super-long text summary extraction method further includes:
[0024] The prompt words for specifying the length range of the summary output by the current large model are automatically generated according to the text length of the super-long text and the maximum context length supported by the current large model.
[0025] In one implementation, the step of re-slicing the current slice to be processed to obtain a plurality of segments to be input includes:
[0026] The preset long text cutting algorithm is used to re-cut the current slice to be processed to obtain multiple segments to be input.
[0027] The present invention also discloses a large model-based super-long text summary extraction device, wherein the device comprises:
[0028] A text length determination module, used to determine the text length of an overlong text;
[0029] A first text cutting module is used to cut the super-long text into multiple text slices based on the text length and the maximum context length supported by the current large model, and select one text slice from the multiple text slices in turn as the current slice to be processed;
[0030] The second text cutting module is used to re-cut the current slice to be processed to obtain multiple segments to be input;
[0031] A summary summarization module, used for inputting the plurality of the to-be-input segments and the currently generated prompt words into the current large model to obtain a current summary result output by the current large model;
[0032] A judgment module is used to judge whether the current slice to be processed is the last text slice;
[0033] A text concatenation module is used to concatenate the current summary result with the next selected text slice to obtain a new current slice to be processed when the current slice to be processed is not the last text slice;
[0034] The target summary determination module is used to repeatedly perform corresponding operations through the second text cutting module, the summary summarization module, the judgment module and the text splicing module until all text slices are processed, and then determine the summary result corresponding to the last text slice output by the current large model as the target summary of the super-long text.
[0035] The present invention also discloses a terminal, which includes: a memory, a processor, and a large model-based super-long text summary extraction program stored in the memory and executable on the processor. When the large model-based super-long text summary extraction program is executed by the processor, the steps of the large model-based super-long text summary extraction method as described above are implemented.
[0036] The present invention also discloses a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program can be executed to implement the steps of the large model-based super-long text summary extraction method as described above.
[0037] The present invention provides a large model-based super-long text summary extraction method, device, terminal and medium. The large model-based super-long text summary extraction method comprises: S1, determining the text length of the super-long text, and based on the text length and the maximum context length supported by the current large model, cutting the super-long text into multiple text slices, and selecting one text slice from the multiple text slices in turn as the current slice to be processed; S2, re-cutting the current slice to be processed to obtain multiple segments to be input, and inputting the multiple segments to be input and the currently generated prompt words into the current large model to obtain the current summary result output by the current large model; S3, judging whether the current slice to be processed is the last text slice, and when the current slice to be processed is not the last text slice, splicing the current summary result with the selected next text slice to obtain a new current slice to be processed; S4, repeatedly executing steps S2 to S3 until all text slices are processed, and determining the summary result corresponding to the last text slice output by the current large model as the target summary of the super-long text. It can be seen that the present invention cuts the super-long text into multiple text slices based on the text length of the super-long text and the maximum context length supported by the large model, and then uses the selected text slice as the current slice to be processed and re-cuts it, and inputs the cut multiple texts to be input and prompt words into the large model. When the current slice to be processed is not the last slice, continue to select the next text slice and splice it with the summary result output by the large model to obtain a new current slice to be processed, and then repeat the re-cutting and splicing process until all text slices are processed to obtain the target summary output by the large model, thereby ensuring that the length of the text fragment input into the large model will not exceed the maximum context length it supports, thereby improving the performance of the large model in processing long texts, thereby ensuring that the large model can accurately understand the semantic information in the text, and improving the quality of the summary of the super-long text output by the large model. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 It is a flow chart of a preferred embodiment of the method for extracting a super-long text summary based on a large model in the present invention;
[0039] Figure 2 It is a specific schematic diagram of processing the first standard long text slice and the Nth standard long text slice disclosed in the present invention;
[0040] Figure 3 This is a specific example processing diagram of the first standard long text slice disclosed in the present invention;
[0041] Figure 4 is a specific example processing schematic diagram of the Nth standard long text slice disclosed in the present invention;
[0042] Figure 5It is a specific flow chart of a method for extracting super-long text summaries based on a large model disclosed in the present invention;
[0043] Figure 6 This is a specific schematic diagram of calculating the maximum text length of each slice disclosed in the present invention;
[0044] Figure 7 It is a specific schematic diagram of cutting an overlong text disclosed in the present invention;
[0045] Figure 8 It is a specific flow chart of a method for extracting super-long text summaries based on a large model disclosed in the present invention;
[0046] Fig. 9 It is a functional principle block diagram of a preferred embodiment of a super-long text summary extraction device based on a large model in the present invention;
[0047] Fig.10 It is a functional principle block diagram of a preferred embodiment of the terminal in the present invention. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solution and advantages of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0049] See also Figure 1 , Figure 1 Flowchart of the method for extracting super-long text summaries based on a large model in the present invention. Figure 1 As shown, the large model-based super-long text summary extraction method described in the embodiment of the present invention includes:
[0050] Step S1, determine the text length of the super-long text, and based on the text length and the maximum context length supported by the current large model, cut the super-long text into multiple text slices, and select one text slice from the multiple text slices in turn as the current slice to be processed.
[0051] In this embodiment, the user uploads the super-long text by uploading a file or copying text. After receiving the super-long text, the text length of the super-long text is determined, and then based on the text length and the maximum context length supported by the current large model, the super-long text is cut to obtain multiple text slices, i.e., standard long text slices, so as to ensure that the length of each text slice does not exceed the maximum context length supported by the current large model, and then selects one text slice from the multiple text slices in turn as the current slice to be processed. It should be pointed out that the maximum context length supported by the current large model is generally 128K.
[0052] Step S2: re-cut the current slice to be processed to obtain a plurality of segments to be input, and input the plurality of segments to be input and the currently generated prompt words into the current large model to obtain the current summary result output by the current large model.
[0053] In this embodiment, after selecting one text slice from multiple text slices in turn as the current slice to be processed, the current slice to be processed is re-cut to obtain multiple segments to be input. Specifically, the current slice to be processed is re-cut using a preset long text cutting algorithm to obtain multiple segments to be input, that is, a selected text slice is first re-cut using the preset long text cutting algorithm to obtain smaller sentences, and it is ensured that the sentences and paragraphs are complete high-quality long text input segments. The segment is used as the final input text of the large model and is input into the current large model together with the currently generated prompt word to obtain the current summary result output by the current large model.
[0054] It can be understood that the standard long text slices are cut into a series of shorter texts again through the preset long text cutting algorithm, wherein the minimum text length after slicing and the step size of the long context window sliding are used as parameters to ensure that each segmented text is a complete and high-quality sentence, and each segmented text serves as the final input text of the large model.
[0055] It should be noted that when the super-long text is cut into multiple text slices based on the text length and the maximum context length supported by the current large model, a prompt word for specifying the length range of the summary output by the current large model is automatically generated based on the text length of the super-long text and the maximum context length supported by the current large model. For example, a prompt word is automatically generated, which requires that the length of the summary answered by the large model does not exceed 2.5K.
[0056] Step S3: determine whether the current slice to be processed is the last text slice, and if the current slice to be processed is not the last text slice, concatenate the current summary result with the next selected text slice to obtain a new current slice to be processed.
[0057] In this embodiment, it is determined whether the current slice to be processed is the last text slice, and when the current slice to be processed is not the last text slice, the current summary result output by the large model is spliced with the next selected text slice to obtain a new current slice to be processed.
[0058] Step S4, repeating steps S2 to S3 until all text slices are processed, and then determining the summary result corresponding to the last text slice output by the current large model as the target summary of the super-long text.
[0059] It can be understood that after completing the processing of a text slice, the current summary result output by the large model is spliced with the next selected text slice, and steps S2 to S3 are repeatedly executed based on the spliced text slice, that is, the spliced text slice is re-cut to obtain multiple new texts to be input, and then the multiple new texts to be input are input into the current large model together with the prompt word, and the current large model outputs a new current summary result. If the next text slice selected at this time is not the last text slice, then a new next text slice is selected again from the multiple text slices and spliced with the new current summary result. Based on the spliced text slice, steps S2 to S3 are repeatedly executed. When the new next text slice is the last text slice, the current summary result output by the large model is the target summary of the super-long text.
[0060] For example, see Figure 2 As shown, the first standard long text slice is selected from multiple standard long text slices, and the standard long text slice is further cut using the preset long text cutting algorithm to obtain better quality sentences. These sentences are used as the final input text of the large model and input into the current large model together with the prompt words. The current large model outputs the corresponding results. For a specific example of the processing of the first standard long text slice, see Figure 3 shown.
[0061] See the description Figure 2 As shown, the second to Nth standard long text slices are processed, that is, the second standard long text slice is selected, the second standard long text slice is spliced with the output result of the large model corresponding to the first standard long text slice, the preset long text cutting algorithm is called to cut the spliced text again, and a new final input text input to the large model is obtained, and the large model is called, and the new final input text and the prompt word are input into the large model again to obtain the output result of the large model, and so on, the third standard long text slice, the fourth standard long text slice to the Nth standard long text slice are processed in a loop according to the above process until the last standard long text slice is processed and the final answer output by the large model is obtained. For a specific example of the processing of the Nth standard long text slice, see Figure 4 shown.
[0062] It can be seen that in the embodiment of the present invention, the super-long text is cut into multiple text slices based on the text length of the super-long text and the maximum context length supported by the large model, and then the selected text slice is used as the current slice to be processed and re-cut, and the cut multiple texts to be input and prompt words are input into the large model. When the current slice to be processed is not the last slice, the next text slice is continuously selected and spliced with the summary result output by the large model to obtain a new current slice to be processed, and then the process of re-cutting and splicing is repeated until all text slices are processed to obtain the target summary output by the large model, thereby ensuring that the length of the text segment input into the large model will not exceed the maximum context length supported by it, thereby improving the performance of the large model in processing long texts, thereby ensuring that the large model can accurately understand the semantic information in the text, and improving the quality of the summary of the super-long text output by the large model.
[0063] See also Figure 5 As shown, the embodiment of the present invention discloses a specific method for extracting super-long text summaries based on a large model. Compared with the previous embodiment, this embodiment further illustrates and optimizes the technical solution.
[0064] Step S21, determining the text length of the super-long text.
[0065] Step S22: Calculate the maximum text length of each slice based on the text length and the maximum context length supported by the current large model.
[0066] In this embodiment, the text length of the super-long text is determined, and the maximum context length supported by the current large model is known, and the maximum text length of each slice can be calculated. It should be noted that the maximum text length is not greater than the maximum context length supported by the current large model. Figure 6 As shown, the input of the super-long text is received, the length of the super-long text is calculated, the configuration of the maximum context length of the large model is obtained, the maximum text length of each slice is automatically calculated based on the text length and the maximum context length of the current large model configuration, and the corresponding prompt words are generated.
[0067] Specifically, the number of slices is determined based on the text length and the maximum context length supported by the current large model, and the maximum text length of each slice is calculated based on the number of slices and the text length. That is, the number of slices and the text length are processed according to a preset calculation formula to obtain the maximum text length of each slice.
[0068] The preset calculation formula is:
[0069]
[0070] Among them, l maxIndicates the maximum text length of each slice, L indicates the text length of the overlong text, and N indicates the number of slices.
[0071] For example, the maximum length supported by the big model is 128K, and the total length of the document uploaded by the user is 1000K. The current user demand is to summarize the document through the big model. Under the condition that the maximum context length supported by the big model is 128K, it is automatically calculated that the document with a total text length of 1000K needs to be divided into 10 standard long text slices, so the text slice length of each standard long text slice is 100K.
[0072] Step S23: cutting the super-long text according to the maximum text length of each slice to obtain multiple text slices.
[0073] In this embodiment, after calculating the maximum text length of each slice, see Figure 7 As shown, the super long text can be cut according to the maximum text length of each slice to obtain multiple text slices. For example, a super long text with a text length of 1000K is sliced according to the slice length of 100K to obtain 10 text slices, and the length of each text slice is 100K.
[0074] Step S24: Select one text slice from the multiple text slices in turn as the current slice to be processed.
[0075] Step S25: re-cut the current slice to be processed to obtain a plurality of segments to be input, and input the plurality of segments to be input and the currently generated prompt words into the current large model to obtain the current summary result output by the current large model.
[0076] Step S26: determine whether the current slice to be processed is the last text slice, and if the current slice to be processed is not the last text slice, concatenate the current summary result with the next selected text slice to obtain a new current slice to be processed.
[0077] Step S27, repeating steps S25 to S26 until all text slices are processed, and then determining the summary result corresponding to the last text slice output by the current large model as the target summary of the super-long text.
[0078] For the specific contents of the above steps S24 to S27, reference may be made to the corresponding contents disclosed in the above embodiments, which will not be repeated here.
[0079] It can be seen that in the embodiment of the present invention, the super-long text is cut into multiple text slices based on the text length of the super-long text and the maximum context length supported by the large model, and then the selected text slice is used as the current slice to be processed and re-cut, and the cut multiple texts to be input and prompt words are input into the large model. When the current slice to be processed is not the last slice, the next text slice is continuously selected and spliced with the summary result output by the large model to obtain a new current slice to be processed, and then the process of re-cutting and splicing is repeated until all text slices are processed to obtain the target summary output by the large model, thereby ensuring that the length of the text segment input into the large model will not exceed the maximum context length supported by it, thereby improving the performance of the large model in processing long texts, thereby ensuring that the large model can accurately understand the semantic information in the text, and improving the quality of the summary of the super-long text output by the large model.
[0080] For example, see Figure 8 As shown, the input of the super-long text is received, the maximum length of each slice is automatically calculated based on the text length and the maximum context length supported by the current large model, and the corresponding prompt words are generated at the same time. The super-long text is cut into multiple standard long text slices according to the longest text length of each slice. The first standard long text slice is cut again to form multiple smaller sentences, and it is ensured that the sentences and paragraphs are complete and high-quality long text input fragments as the final input text of the large model. Then the long text input fragment and the prompt words are input to the large model, and the large model returns the output result. Then, the output result returned by the large model is spliced with the next standard long text, and the spliced text is cut again to obtain a new final input text input to the large model, and then the large model is called again to obtain the output result. The selection of standard long text slices, the splicing of text slices and output results, and then cutting are looped, and the process of re-calling the large model is repeated until the last standard long text slice is processed and the final answer output by the large model is obtained, thereby realizing the ability of the large model to summarize the super-long text and improving the quality of the super-long text summary output by the large model.
[0081] In one embodiment, if Fig. 9 As shown, based on the above-mentioned large model-based super-long text summary extraction method, the present invention also provides a large model-based super-long text summary extraction device, including:
[0082] A text length determination module 11, used to determine the text length of the overlong text;
[0083] A first text cutting module 12 is used to cut the super-long text into multiple text slices based on the text length and the maximum context length supported by the current large model, and select one text slice from the multiple text slices in turn as the current slice to be processed;
[0084] The second text cutting module 13 is used to cut the current slice to be processed again to obtain multiple segments to be input;
[0085] A summary module 14 is used to input the plurality of segments to be input and the currently generated prompt words into the current large model to obtain a current summary result output by the current large model;
[0086] A judging module 15 is used to judge whether the current slice to be processed is the last text slice;
[0087] The text concatenation module 16 is used to concatenate the current summary result with the next selected text slice to obtain a new current slice to be processed when the current slice to be processed is not the last text slice;
[0088] The target summary determination module 17 is used to repeatedly perform corresponding operations through the second text cutting module, the summary summarization module, the judgment module and the text splicing module until all text slices are processed, and then determine the summary result corresponding to the last text slice output by the current large model as the target summary of the super-long text.
[0089] Fig.10 A schematic diagram of the structure of a terminal provided in an embodiment of the present application. The terminal may include:
[0090] A memory 501 , a processor 502 , and a computer program stored in the memory 501 and executable on the processor 502 .
[0091] When the processor 502 executes the program, the large model-based super-long text summary extraction method provided in the above embodiment is implemented.
[0092] Furthermore, the terminal further includes:
[0093] The communication interface 503 is used for communication between the memory 501 and the processor 502 .
[0094] The memory 501 is used to store computer programs that can be executed on the processor 502 .
[0095] The memory 501 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0096] If the memory 501, the processor 502 and the communication interface 503 are implemented independently, the communication interface 503, the memory 501 and the processor 502 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0097] Optionally, in a specific implementation, if the memory 501, the processor 502 and the communication interface 503 are integrated on a chip, the memory 501, the processor 502 and the communication interface 503 can communicate with each other through an internal interface.
[0098] The processor 502 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
[0099] This embodiment also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the method for extracting a super-long text summary based on a large model as described above is implemented.
[0100] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed in this application. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the claims.
[0101] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0102] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, which can be embodied in any computer-readable medium for use by an instruction execution system, apparatus or device (such as a computer-based system, a system including a processor or other system that can read instructions from an instruction execution system, apparatus or device and execute instructions), or used in combination with these instruction execution systems, apparatuses or devices.
[0103] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above embodiment, the N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. If implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA, Programmable Gate Array), a field programmable gate array (FPGA, Field-Programmable Gate Array), etc.
[0104] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.
Claims
1. A method for extracting a long text summary based on a large model, characterized in that: The method comprises: S1. Determine the text length of the super-long text, and based on the text length and the maximum context length supported by the current large model, cut the super-long text into multiple text slices, and select one text slice from the multiple text slices in turn as the current slice to be processed; S2, re-cutting the current slice to be processed to obtain multiple segments to be input, and inputting the multiple segments to be input and the currently generated prompt words into the current large model to obtain the current summary result output by the current large model; S3, determining whether the current slice to be processed is the last text slice, and if the current slice to be processed is not the last text slice, concatenating the current summary result with the next selected text slice to obtain a new current slice to be processed; S4. Repeat steps S2 to S3 until all text slices are processed, and then determine the summary result corresponding to the last text slice output by the current large model as the target summary of the super-long text.
2. The large model-based super-long text summary extraction method according to claim 1 is characterized in that: The method of cutting the super-long text into a plurality of text slices based on the text length and the maximum context length supported by the current large model includes: Calculate the maximum text length of each slice based on the text length and the maximum context length supported by the current large model; The super-long text is cut according to the maximum text length of each slice to obtain multiple text slices.
3. The large model-based super-long text summary extraction method according to claim 2 is characterized in that: The calculating the maximum text length of each slice based on the text length and the maximum context length supported by the current large model includes: The number of slices is determined based on the text length and the maximum context length supported by the current large model, and the maximum text length of each slice is calculated according to the number of slices and the text length.
4. The large model-based super-long text summary extraction method according to claim 3 is characterized in that: The calculating the maximum text length of each slice according to the number of slices and the text length includes: The number of slices and the text length are processed according to a preset calculation formula to obtain the maximum text length of each slice; Wherein, the preset calculation formula is: Among them, l max Indicates the maximum text length of each slice, L indicates the text length of the overlong text, and N indicates the number of slices.
5. The large model-based super-long text summary extraction method according to claim 4 is characterized in that: The maximum text length is no greater than the maximum context length supported by the current large model.
6. The large model-based super-long text summary extraction method according to claim 1 is characterized in that: Also includes: The prompt words for specifying the length range of the summary output by the current large model are automatically generated according to the text length of the super-long text and the maximum context length supported by the current large model.
7. The method for extracting a long text summary based on a large model according to any one of claims 1 to 6, characterized in that: The step of re-slicing the current slice to be processed to obtain a plurality of segments to be input includes: The preset long text cutting algorithm is used to re-cut the current slice to be processed to obtain multiple segments to be input.
8. A large model-based super-long text summary extraction device, characterized in that: The device comprises: A text length determination module, used to determine the text length of an overlong text; A first text cutting module is used to cut the super-long text into multiple text slices based on the text length and the maximum context length supported by the current large model, and select one text slice from the multiple text slices in turn as the current slice to be processed; The second text cutting module is used to re-cut the current slice to be processed to obtain multiple segments to be input; A summary summarization module, used for inputting the plurality of the to-be-input segments and the currently generated prompt words into the current large model to obtain a current summary result output by the current large model; A judgment module is used to judge whether the current slice to be processed is the last text slice; A text concatenation module is used to concatenate the current summary result with the next selected text slice to obtain a new current slice to be processed when the current slice to be processed is not the last text slice; The target summary determination module is used to repeatedly perform corresponding operations through the second text cutting module, the summary summarization module, the judgment module and the text splicing module until all text slices are processed, and then determine the summary result corresponding to the last text slice output by the current large model as the target summary of the super-long text.
9. A terminal, characterized in that: include: A memory, a processor, and a large model-based super-long text summary extraction program stored in the memory and executable on the processor, wherein the large model-based super-long text summary extraction program, when executed by the processor, implements the steps of the large model-based super-long text summary extraction method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which can be executed to implement the steps of the large model-based super-long text summary extraction method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Long text processing method, related equipment and readable storage medium
CN112527992A
Customer call management method and device based on large language model, and medium
CN116861920A
Document abstract generation method and device, computer equipment and storage medium
CN117725203A
Document abstract generation method, computer equipment, storage medium and program product
CN118332104A
Text summarization generation method and apparatus, and device and storage medium
WO2022241950A1
Cited By
Method and device for extracting long text field and medium
CN121328570A
Intelligent perception assisted end-to-end beam forming prediction method and system
CN122092925A