Large-model-based text processing method and apparatus, and electronic device and storage medium

By segmenting the text into multiple pieces and using a large model to supplement and pre-process each piece, the problems of long processing time and poor user experience for texts with extremely large character volumes are solved, resulting in faster processing speed and a better user experience.

WO2026103333A1PCT designated stage Publication Date: 2026-05-21BAIDU ONLINE NETWORK TECH (BEIJIBG) CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
BAIDU ONLINE NETWORK TECH (BEIJIBG) CO LTD
Filing Date
2025-09-18
Publication Date
2026-05-21

AI Technical Summary

Technical Problem

When processing text data with extremely large character sets, existing technologies suffer from long processing times, frequent timeouts and errors, leading to a decline in user experience.

Method used

The input text is divided into multiple segments, and each segment is supplemented and pre-processed using a large model. Finally, the segments are aggregated to obtain the target text.

Benefits of technology

By using a segmented processing method, the speed of text pre-processing is improved, processing time is reduced, timeout errors are avoided, and user experience is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025122343_21052026_PF_FP_ABST
    Figure CN2025122343_21052026_PF_FP_ABST
Patent Text Reader

Abstract

The present disclosure relates to the field of artificial intelligence. Provided are a large-model-based text processing method and apparatus, and an electronic device and a storage medium, which can be used in application scenarios such as generative searching, intelligent document editing, intelligent assistants, virtual assistants, and intelligent e-commerce. The specific implementation solution involves: splitting an input text into a plurality of segments; using a first large model to complete each of the plurality of segments and then perform predetermined processing, so as to obtain a processed text corresponding to each segment; and on the basis of the processed text corresponding to each segment, obtaining a target text. The embodiments of the present disclosure can improve the speed of performing predetermined processing on an input text.
Need to check novelty before this filing date? Find Prior Art

Description

Text processing methods, devices, electronic devices, and storage media based on large models

[0001] This application claims priority to Chinese Patent Application No. 202411640368.4, filed on November 15, 2024, entitled “Text Processing Method, Apparatus, Electronic Device and Storage Medium Based on Large Model”, the entire contents of which are incorporated herein by reference. Technical Field

[0002] This disclosure relates to the field of artificial intelligence technology, particularly to the fields of natural language processing and large models, and can be used in application scenarios such as generative search, intelligent document editing, intelligent assistants, virtual assistants, and intelligent e-commerce. Background Technology

[0003] Artificial intelligence (AI) technology is rapidly being applied across various fields, demonstrating outstanding performance in natural language processing areas such as content generation and creation, intelligent document editing, and generative dialogue in recent years. However, when performing tasks like text rewriting, polishing, and translation using AI, users may input extremely large amounts of text. Processing such large amounts of text data requires considerable time and may result in timeout errors and a degraded user experience. Summary of the Invention

[0004] This disclosure provides a text processing method, apparatus, electronic device, and storage medium based on a large model.

[0005] According to one aspect of this disclosure, a text processing method based on a large model is provided, comprising:

[0006] The input text is divided into multiple segments;

[0007] Using the first major model, each of the multiple segments is completed and then subjected to predetermined processing to obtain the processed text corresponding to each segment;

[0008] The target text is obtained based on the processed text corresponding to each segment.

[0009] According to another aspect of this disclosure, a text processing apparatus based on a large model is provided, comprising:

[0010] The segmentation module is used to divide the input text into multiple segments;

[0011] The processing module is used to complete each of the multiple segments using the first large model and then perform predetermined processing to obtain the processed text corresponding to each segment.

[0012] The aggregation module is used to obtain the target text based on the processed text corresponding to each segment.

[0013] According to another aspect of this disclosure, an electronic device is provided, comprising:

[0014] At least one processor; and

[0015] The memory is communicatively connected to the at least one processor; wherein,

[0016] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform any of the methods described in the present disclosure.

[0017] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause the computer to perform any of the methods according to embodiments of this disclosure.

[0018] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements any of the methods according to embodiments of this disclosure.

[0019] In the technical solution of this disclosure embodiment, the input text is divided into multiple segments. The first large model is used to supplement the complete segments before pre-processing. This allows the first large model to pre-process content with complete semantics. As a result, the method of performing pre-processing on segments and then summarizing to obtain the target text can replace pre-processing on the complete input text, thereby improving the speed of pre-processing the input text, reducing processing time, and avoiding problems such as timeout errors and decreased user experience.

[0020] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0021] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:

[0022] Figure 1 is a flowchart illustrating a text processing method based on a large model provided in an embodiment of this disclosure;

[0023] Figure 2 is a schematic diagram of the processing flow for each segment in an embodiment of this disclosure;

[0024] Figure 3 is a schematic diagram of an application example of the text processing method based on a large model according to an embodiment of this disclosure;

[0025] Figure 4 is a schematic diagram of another application example of the text processing method based on a large model according to the embodiments of this disclosure;

[0026] Figure 5 is a schematic diagram of another application example of the text processing method based on a large model according to the embodiments of this disclosure;

[0027] Figure 6 is a schematic diagram of the structure of a large-model-based text processing apparatus according to an embodiment of the present disclosure;

[0028] Figure 7 is a schematic diagram of the structure of a large-model-based text processing apparatus according to another embodiment of the present disclosure;

[0029] Figure 8 is a block diagram of an electronic device for implementing the large-model-based text processing method of the present disclosure. Detailed Implementation

[0030] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0031] To facilitate understanding of the technical solutions of the embodiments of this disclosure, the application scenarios of the text processing method based on large models in the embodiments of this disclosure are first introduced below. The text processing method based on large models in the embodiments of this disclosure can be used to perform predetermined processing on input text. Predetermined processing includes, for example, rewriting, polishing, editing, translating, information extraction, or summarizing long texts. For example, predetermined processing may include rewriting. A user can provide input text, and an electronic device executing the method in the embodiments of this disclosure can rewrite the input text to obtain target text with semantics that is the same as or similar to the input text and conforms to preset standards (e.g., text rewritten according to expressions in a specific application scenario), and return the target text to the user. Specifically, in the embodiments of this disclosure, rewriting can be achieved by dividing the input text into multiple segments and supplementing and rewriting each segment separately.

[0032] Figure 1 is a flowchart illustrating a large-model-based text processing method according to an embodiment of this disclosure. This method can be based on a large-model text processing device, which can be deployed in an electronic device. The electronic device can be a single-machine or multi-machine terminal, server, or other processing device. The terminal can be a mobile device, a personal digital assistant (PDA), a handheld device, a computing device, an in-vehicle device, a wearable device, or other user equipment (UE); the server can be a single-machine server or a server cluster. In some possible implementations, the method can also be implemented by the processor calling computer-readable instructions stored in memory. As shown in Figure 1, the method may include the following steps S110 to S130.

[0033] S110. Divide the input text into multiple segments.

[0034] In this context, "slicing" can be understood as a part of the input text. Step S110 can be understood as dividing the input text into multiple parts, each part being a slice. These slices can also be called slice characters, blocks, etc. In practical applications, the segmentation operation can also be described as slicing, cutting, splitting, or fragmenting.

[0035] Optionally, the electronic device can segment the input text into multiple segments based on punctuation characters / symbols in the input text, or it can segment the input text into multiple segments based on one or more of the following: the length of the input text, a preset number of segments, and a preset character count threshold. For example, the character count of each segment can be determined based on the length of the input text and the number of segments to be allocated, and then the input text can be segmented into multiple segments based on that character count. For example, if each segment contains 10,000 characters, then the input text will be segmented into multiple segments containing 10,000 characters each.

[0036] S120. Using the first major model, each segment in the multiple segments is completed and then pre-processed to obtain the processed text corresponding to each segment.

[0037] Here, a large model refers to a neural network model with a large number of parameters and a complex structure, capable of processing massive amounts of data and completing various complex tasks. A large model may include a Large Language Model (LLM). Optionally, the first large model may be a large model capable of handling multiple complex tasks, or it may be a large model specifically trained / fine-tuned to implement the segmentation processing in this embodiment of the disclosure.

[0038] For example, for each segment, or any given segment, the segment can be completed based on its context and semantics. It is understood that when the input text is segmented into multiple segments, the sentences and words at the beginning and end of each segment may be truncated, thus affecting the effectiveness of pre-processing on individual segments. In this embodiment, completing the segments before pre-processing ensures the effectiveness of the pre-processing, thereby supporting segmenting the input text into segments before pre-processing.

[0039] Optionally, the first large model can be a large model for processing text based on input-segmented output, meaning that the algorithmic processing of this large model is equivalent to completing the segments and performing predetermined processing. Alternatively, the first large model can include two large models, one for completing the segments and the other for performing predetermined processing on the completed segments; optionally, one or more pre-collected corpora or text datasets can be used to train / fine-tune the two large models separately to improve the segment processing performance.

[0040] Optionally, pre-processing may include rewriting, polishing, editing, translating, information extraction, or summarizing for long texts.

[0041] S130. Based on the processed text corresponding to each segment, obtain the target text.

[0042] In one implementation, the processed text can be sequentially concatenated according to the order of the individual segments, and the concatenated text can be used as the target text. In another implementation, after the processed text is concatenated sequentially, the concatenated text can be further processed, and the text obtained from the further processing can be used as the target text.

[0043] Optionally, this further processing may include rewriting, polishing, etc., that is, rewriting and polishing the text obtained by splicing multiple processed texts to obtain the target text. This further processing can be implemented by other models, such as by a smaller and more efficient model, thereby improving the processing effect while controlling the processing time of long texts.

[0044] Optionally, the further processing may also include format rendering, encapsulation, and other processing of the spliced ​​text, but this disclosure does not limit this aspect.

[0045] The above method divides the input text into multiple segments. The first large model is used to complete the segments before pre-processing. This allows the first large model to pre-process content with complete semantics. As a result, the method of performing pre-processing on segments and then summarizing to obtain the target text can replace pre-processing on the complete input text. This improves the speed of pre-processing the input text, reduces processing time, and avoids problems such as timeout errors and degraded user experience.

[0046] Figure 2 is a schematic diagram of the processing flow for each segment in an embodiment of this disclosure. As shown in Figure 2, in some embodiments, the above step S120, using the first large model to complete each segment in multiple segments and then performing predetermined processing to obtain the processing text corresponding to each segment, includes:

[0047] S210. Concatenate the unprocessed segments from multiple segments with at least one prompt word to obtain the concatenation result; wherein, the prompt word is used to guide the first large model to perform predetermined processing after the unprocessed segments are completed;

[0048] S220. Input the splicing result into the first large model to obtain the processing text corresponding to the segment to be processed.

[0049] The segment to be processed can be any one of multiple segments. Optionally, segments can be extracted one by one, and the extracted segments can be used as the segments to be processed. The above-mentioned splicing and model processing can be performed to obtain the processed text, and then the next segment can be extracted as the new segment to be processed.

[0050] Optionally, the aforementioned prompt can also be used to inform the first-level model of the current processing role, scenario requirements, and task requirements. For example, if the planned processing is to rewrite the input text according to a preset standard A, the prompt words concatenated with the segments to be processed could be as follows:

[0051] You will receive a text (original text), which you need to rewrite and output as a new text. If you think the original text is meaningless, the new text should be the same as the original. If it is meaningful, your rewrite should follow these rules:

[0052] Some words at the beginning and end of this text may be truncated, so you may need to fill them in based on the context and semantics before rewriting.

[0053] Every sentence in the entire text needs to be rewritten. You must ensure it is similar to the previous expression, but the vocabulary and sentence structure need to be changed.

[0054] You can also choose to rewrite several sentences at the same time, modify them together, and change the order of expression, but the meaning must be similar to the original sentences.

[0055] You must also ensure that your rewrite conforms to standard A.

[0056] The length (number of words) of the new text you output must be close to the length (number of words) of the original text, without too much fluctuation.

[0057] Sometimes the original text may be very short, and you may need to provide new text based on the original text.

[0058] If the original text is empty, then the new text should also be empty.

[0059] According to the above embodiment, the fragment to be processed is concatenated with the prompt, and the concatenation result is input into the first large model. The prompt guides the first large model to complete the fragment to be processed and then perform the predetermined processing. That is, the algorithm processing of the first large model is equivalent to completing the fragment and performing the predetermined processing. This method can guarantee the effect of the predetermined processing of the fragment and does not require additional training / fine-tuning of the first large model, which can reduce resource consumption.

[0060] In some embodiments, the aforementioned at least one prompt word may include a custom prompt word and / or a role-based prompt word. The custom prompt word may be a prompt word input by a target object, which may refer to a user or the developer / maintainer of the text processing device, etc. This custom prompt word can be used to describe scenario requirements, task requirements, etc., thereby improving the flexibility of text processing and enabling the method of this disclosure embodiment to achieve better results in various scenarios and tasks. The role-based prompt word may be a pre-configured prompt word used to prompt the first large model to complete the input fragment to be processed before performing predetermined processing.

[0061] Figure 3 illustrates a schematic diagram of an application example of the large-model-based text processing method according to an embodiment of this disclosure. As shown in Figure 3, this application example includes:

[0062] S310. Divide the input text into multiple segments, including segment 1, segment 2, segment n, etc.

[0063] S320. For each segment, concatenate it with the custom prompt and the role prompt, and input it into the first large model to obtain the processed text corresponding to the segment after processing by the first large model.

[0064] S330. The target text, composed of individual processed texts, is returned to the user using the SSE method. SSE (Server-Sent Events) is a streaming output technology that presents text to the user character by character, providing a progressive presentation method, optimizing the dialogue experience, and helping users track the model's thought process and see how it gradually builds its response, thus improving the transparency and explainability of the dialogue.

[0065] In some embodiments, at least one of the above-mentioned prompt words includes a role prompt word;

[0066] The method also includes:

[0067] Get the custom suggestion words input by the target object;

[0068] The second major model is used to rewrite the custom prompt words to obtain the character prompt words; the second major model is trained using multiple texts related to the pre-processing.

[0069] For example, the target object (e.g., user, developer, maintainer, etc.) can input custom prompts to describe task requirements, scenario requirements, etc. These custom prompts are then rewritten by the second main model to generate role prompts, which are used to concatenate with the segments to be processed. The second main model can be a model specifically trained for the predetermined process, capable of more accurately representing the task requirements and scenario requirements of that predetermined process.

[0070] According to the above embodiments, the custom prompt words input by the target object are rewritten to obtain role prompt words. This can standardize the standard and form of the prompt words, thereby improving the guidance effect on the first model and further improving the effect of pre-processing the input text.

[0071] In some embodiments, the large-model-based text processing method may further include:

[0072] Create a message queue corresponding to the input text and store multiple fragments into the message queue in sequence. The fragments in the message queue are extracted by the consumer in sequence. The consumer uses the first main model to complete the extracted fragments and then performs the scheduled processing.

[0073] Accordingly, based on the processed text corresponding to each segment, the target text is obtained, including:

[0074] If there are no shards in the message queue, the singleton pattern is used to encapsulate the processing text corresponding to each shard to obtain the target text.

[0075] The above embodiments use message queues to implement sequential processing of each slice and singleton encapsulation. Figure 4 is a schematic diagram of an application example, which uses text rewriting as an example to present the above processing flow. As shown in Figure 4, when the input text is sliced, multiple slices (slice 1, slice 2, slice 3, and slice n, etc.) can be used as producers, and a message queue corresponding to the input text can be created. Each slice is put into the message queue one by one. When there are a specified number of slices in the queue, the producers no longer push slices into the message queue. The consumers (including the task extraction module and the text rewriting module) extract the slices to complete and rewrite them. The rewritten output processed text is added to the SSE stream message and enters the singleton mode for encapsulation. After a slice is rewritten, the text rewriting module notifies the task extraction module to consume the next slice, and so on until the processing of the last slice is completed. After all slices are rewritten, the target text is encapsulated in the singleton mode, transmitted via SSE, and returned to the user.

[0076] As can be understood, using the above method, when the user provides another input text, a message queue corresponding to the new input text is created, and similar operations are performed. That is, each fragment of the same input text is ensured to undergo scheduled processing sequentially through message queue processing, and is ultimately encapsulated using the singleton pattern. When the user simultaneously inputs different input texts, there is no situation where fragments of different input texts are processed interchangeably. In this way, while effectively speeding up the scheduled processing, the consistency of each processed text is maintained, thereby ensuring the quality of the target text.

[0077] In some embodiments, user experience optimization designs can be incorporated into the above mechanism. For example, as shown in Figure 4, when the first slice enters the message queue, the user can be notified that loading is in progress; when the rewriting is complete, the user can be notified that the task is finished, so that the user can understand the work progress. As another example, if the user chooses to clear the text and cancel the processing request for the input text during the work process, a pop-up window can be displayed on the interactive interface asking whether to clear the text. If the user selects "Do not prompt again," the timestamp is recorded and saved, and the pop-up window will not be displayed again within a predetermined time. Furthermore, it can be supported to synchronize the output target text to the editor in the interactive interface for further processing, ensuring the integrity of the user experience.

[0078] In some embodiments, the input text is segmented into multiple pieces, including:

[0079] Based on a preset character count threshold, the input text is divided into multiple segments.

[0080] The preset character count is, for example, 10,000 or 20,000.

[0081] The above embodiments, by pre-setting a fixed character threshold, divide the input text into segments with a character count not exceeding the threshold, thus ensuring an effective improvement in processing speed.

[0082] In some embodiments, a word count limit can be imposed on the input text. For example, the word count limit can be based on either the number of characters or the number of words. If a word count limit is used, the word count can be calculated according to the following rules: 1. The word count starts from the first input character; 2. After a space or newline appears, the next character is counted as a new word; special characters other than spaces and newlines, as well as punctuation, are not counted as additional words; multiple spaces, multiple newlines, and combinations of newlines and spaces are all counted as only one word. Using a word count limit can better adapt to pre-defined processing tasks in most scenarios.

[0083] In some embodiments, the large-model-based text processing method further includes:

[0084] Based on the proportion of each language in the unprocessed segments across multiple segments, the language used for the processing text corresponding to the unprocessed segment is determined.

[0085] Alternatively, the language with the highest percentage of text can be used as the language for text processing.

[0086] For example, when the segment to be processed is entirely in English, the processed text output by the first large model is determined to be in English; when the segment to be processed is entirely in Chinese, the processed text output by the first large model is determined to be in Chinese; when 90% of the content in the processed segment is in Chinese and 10% is in English, the processed text output by the first large model is determined to be in Chinese.

[0087] Optionally, after determining the language used for the processed text, restrictions on that language can be added to the prompt words, or the aforementioned language determination rules can be added to the prompt words, so that the first model outputs the processed text according to the aforementioned rules.

[0088] According to the above embodiments, the language of the processed text is determined based on the proportion of each language in the slice, which can support different languages ​​for pre-processing, thereby improving flexibility.

[0089] In some embodiments, the large-model-based text processing method further includes:

[0090] The target text is rendered using multiple rendering plugins within the multimodal rendering engine.

[0091] The rendered target text is output through the interactive interface.

[0092] For example, the malicious rendering plugins include one or more of the following: paragraph plugin, list plugin, table plugin, reference plugin, formula plugin, hyperlink plugin, code block plugin, data chart plugin, flowchart plugin, and mind map plugin.

[0093] According to the above embodiments, a multimodal rendering engine can be used to render the target text, thereby improving the display effect of the target text and optimizing the user experience.

[0094] Figure 5 is a schematic diagram of an application example. As shown in Figure 5, a text processing device is deployed in the electronic device. This device can provide services for various AIGC (Artificial Intelligence Generated Content) scenarios, such as intelligent creation, rewriting, summarizing, and intelligent insight. It provides corresponding services based on AIGC data services, AIGC business plugins, and an AIGC multimodal rendering engine. The AIGC data service can access the AIGC data server and output text in Markdown format. AIGC business plugins include creation plugins, insight plugins, and plugins for other scenarios. The AIGC multimodal rendering engine completes the rendering processing of the output text through core layer capabilities, external dependency libraries, multimodal rendering plugins, and the interface layer.

[0095] Figure 6 is a schematic diagram of the structure of a large-model-based text processing apparatus according to an embodiment of the present disclosure.

[0096] As shown in Figure 6, the device includes:

[0097] The segmentation module 610 is used to segment the input text into multiple segments;

[0098] The processing module 620 is used to complete each of the multiple segments using the first large model and then perform pre-defined processing to obtain the processing text corresponding to each segment.

[0099] The summary module 630 is used to obtain the target text based on the processed text corresponding to each segment.

[0100] In some embodiments, the processing module 620 is configured to:

[0101] The unprocessed segments from multiple segments are concatenated with at least one prompt word to obtain the concatenation result; the prompt word is used to guide the first large model to perform predetermined processing after the unprocessed segments are completed.

[0102] Input the splicing result into the first large model to obtain the processed text corresponding to the segment to be processed.

[0103] In some embodiments, at least one prompt word includes a role prompt word. As shown in Figure 7, the text processing apparatus further includes:

[0104] The prompt word acquisition module 710 is used to acquire custom prompt words input by the target object;

[0105] The prompt word rewriting module 720 is used to rewrite custom prompt words using the second major model to obtain character prompt words; the second major model is trained using multiple texts related to the pre-processing.

[0106] In some embodiments, as shown in FIG7, the text processing apparatus further includes:

[0107] The queue processing module 730 is used to create a message queue corresponding to the input text and store multiple fragments into the message queue in sequence. The fragments in the message queue are extracted by the consumer in sequence, and the consumer uses the first big model to complete the extracted fragments and then perform the scheduled processing.

[0108] Correspondingly, the aggregation module is used to encapsulate the processing text corresponding to each shard in the singleton pattern to obtain the target text when there is no shard in the message queue.

[0109] In some embodiments, the fragmentation module 610 is used for:

[0110] Based on a preset character count threshold, the input text is divided into multiple segments.

[0111] In some embodiments, as shown in FIG7, the text processing apparatus further includes:

[0112] The language determination module 740 is used to determine the language used for the processing text corresponding to the segment to be processed based on the proportion of each language in the segment to be processed among multiple segments.

[0113] In some embodiments, as shown in FIG7, the text processing apparatus further includes:

[0114] Rendering module 750 is used to render target text based on multiple rendering plugins in the multimodal rendering engine;

[0115] Output module 760 is used to output the rendered target text through an interactive interface.

[0116] The specific functions and examples of each module and submodule of the apparatus in this disclosure can be found in the relevant descriptions of the corresponding steps in the above method embodiments, and will not be repeated here.

[0117] The acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0118] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

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

[0120] As shown in Figure 8, device 800 includes a computing unit 801, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 802 or a computer program loaded from storage unit 808 into random access memory (RAM) 803. RAM 803 can also store various programs and data required for the operation of device 800. The computing unit 801, ROM 802, and RAM 803 are interconnected via bus 804. Input / output (I / O) interface 805 is also connected to bus 804.

[0121] Multiple components in device 800 are connected to I / O interface 805, including: input unit 806, such as keyboard, mouse, etc.; output unit 807, such as various types of monitors, speakers, etc.; storage unit 808, such as disk, optical disk, etc.; and communication unit 809, such as network card, modem, wireless transceiver, etc. Communication unit 809 allows device 800 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0122] The computing unit 801 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as large-model-based text processing methods. For example, in some embodiments, the large-model-based text processing method can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed on device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the large-model-based text processing method described above can be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform a large-model-based text processing method by any other suitable means (e.g., by means of firmware).

[0123] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0124] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0125] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0126] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0127] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0128] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0129] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0130] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A text processing method based on a large model, comprising: The input text is divided into multiple segments; Using the first major model, each of the multiple segments is completed and then subjected to predetermined processing to obtain the processed text corresponding to each segment; The target text is obtained based on the processed text corresponding to each segment.

2. The method of claim 1, wherein, The first model is used to complete each of the multiple segments and then perform predetermined processing to obtain the processed text corresponding to each segment, including: The unprocessed segment from the plurality of segments is concatenated with at least one prompt word to obtain a concatenation result; wherein, the prompt word is used to guide the first large model to complete the unprocessed segment and perform predetermined processing; The splicing result is input into the first large model to obtain the processed text corresponding to the segment to be processed.

3. The method of claim 2, wherein, The at least one prompt word includes a role prompt word; The method further includes: Get the custom suggestion words input by the target object; The custom prompt words are rewritten using a second major model to obtain the character prompt words; wherein, the second major model is trained using multiple texts related to the predetermined processing.

4. The method according to any one of claims 1-3, further comprising: A message queue corresponding to the input text is created, and the multiple fragments are stored sequentially into the message queue; wherein, the fragments in the message queue are extracted sequentially by a consumer, and the consumer is used to complete the extracted fragments using the first large model and then perform predetermined processing; The process of obtaining the target text based on the processed text corresponding to each segment includes: If there are no shards in the message queue, the processing text corresponding to each shard is encapsulated using the singleton pattern to obtain the target text.

5. The method of any one of claims 1-4, wherein, The process of dividing the input text into multiple segments includes: Based on a preset character count threshold, the input text is divided into multiple segments.

6. The method according to any one of claims 1-5, further comprising: Based on the proportion of each language in the unprocessed segments among the multiple segments, the language used for the processing text corresponding to the unprocessed segment is determined.

7. The method according to any one of claims 1-6, further comprising: The target text is rendered using multiple rendering plugins in a multimodal rendering engine. The rendered target text is output through the interactive interface.

8. A text processing device based on a large model, comprising: The segmentation module is used to divide the input text into multiple segments; The processing module is used to complete each of the multiple segments using the first large model and then perform predetermined processing to obtain the processed text corresponding to each segment. The aggregation module is used to obtain the target text based on the processed text corresponding to each segment.

9. The apparatus of claim 8, wherein, The processing module is used for: The unprocessed segment from the plurality of segments is concatenated with at least one prompt word to obtain a concatenation result; wherein, the prompt word is used to guide the first large model to complete the unprocessed segment and perform predetermined processing; The splicing result is input into the first large model to obtain the processed text corresponding to the segment to be processed.

10. The apparatus of claim 9, wherein, The at least one prompt word includes a role prompt word; The device further includes: The prompt word acquisition module is used to acquire custom prompt words input by the target object; The prompt word rewriting module is used to rewrite the custom prompt words using a second major model to obtain the character prompt words; wherein, the second major model is trained using multiple texts related to the predetermined processing.

11. The apparatus according to any one of claims 8-10, further comprising: The queue processing module is used to create a message queue corresponding to the input text and store the multiple fragments into the message queue in sequence; wherein, the fragments in the message queue are extracted by the consumer in sequence, and the consumer is used to complete the extracted fragments using the first large model and then perform predetermined processing; The aggregation module is used for: If there are no shards in the message queue, the processing text corresponding to each shard is encapsulated using the singleton pattern to obtain the target text.

12. The apparatus of any one of claims 8-11, wherein, The sharding module is used for: Based on a preset character count threshold, the input text is divided into multiple segments.

13. The apparatus according to any one of claims 8-12, further comprising: The language determination module is used to determine the language used in the processing text corresponding to the segment to be processed based on the proportion of each language in the segment to be processed among the multiple segments.

14. The apparatus according to any one of claims 8-13, further comprising: The rendering module is used to render the target text based on multiple rendering plugins in the multimodal rendering engine; The output module is used to output the rendered target text through an interactive interface.

15. An electronic device comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.

16. A non-transitory computer readable storage medium having stored thereon computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-7.

17. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-7.