A text processing method, device, storage medium and equipment
By employing a hybrid structured and adaptive method for writing prompts, and utilizing pre-defined prompts and a Large Language Model (LLM) to rewrite the user-input task text, the accuracy and flexibility issues of AI models in understanding complex prompts are addressed, thereby improving the user interaction experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- IFLYTEK CO LTD
- Filing Date
- 2023-09-04
- Publication Date
- 2026-05-08
AI Technical Summary
Existing AI models lack deep semantic understanding when processing complex speech or text information, which leads to an inability to fully understand complex prompts from users, potentially ignoring or misunderstanding user intent and reducing the user interaction experience.
By combining fixed prefixes of preset prompt words with a large language model (LLM), structured and adaptive hybrid rewriting is performed to optimize prompt word writing, improve writing efficiency and accuracy, and enable the AI model to more accurately understand and execute user tasks.
It improves the accuracy and flexibility of AI models in handling complex tasks, enhances the user interaction experience, lowers the barrier to writing prompts, and enables more users to effectively utilize AI models.
Smart Images

Figure CN117112764B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of natural language processing technology, and in particular to a text processing method, apparatus, storage medium and device. Background Technology
[0002] With the rapid development of next-generation information technologies such as Artificial Intelligence (AI) and the Internet of Things, the application scenarios of human-computer interaction are becoming increasingly widespread. Various intelligent interactive software and devices are appearing in people's lives and work. For example, AI models such as Chat Generative Pre-trained Transformer (ChatGPT), smart speakers, and smart TVs can provide intelligent interactive functions for numerous application scenarios, including information retrieval, to assist users in fulfilling various behavioral intentions.
[0003] Currently, the primary method for handling voice or text input from users in smart interactive software or devices (such as smart speakers and smart TVs) is to rely on AI models based on statistics and pattern recognition to understand and generate human language. However, because these models lack deep semantic understanding, they may encounter problems when processing overly complex instructions or prompts. The models may fail to fully understand complex prompts, ignoring certain parts or misunderstanding the intent of the prompts, thus failing to provide the user with the information they truly want in a timely and accurate manner. This results in poor processing of user input and a reduced user experience. Summary of the Invention
[0004] The main objective of this application is to provide a text processing method, apparatus, storage medium, and device that can improve the user's interactive experience by effectively writing prompts, enabling AI models to more accurately understand and execute user-instructed tasks.
[0005] This application provides a text processing method, including:
[0006] Obtain the target task text input by the target user;
[0007] By using the fixed prefixes of preset prompt words, the target task text is combined to obtain combined text;
[0008] The combined text is automatically parsed, and the parsing results are used to rewrite the preset prompt words in a structured and adaptive hybrid manner to obtain the optimized prompt word text.
[0009] In one possible implementation, the fixed prefix of the preset prompt word includes the usage rules of the prompt word; the usage rules of the prompt word include marking the fixed process part of the prompt word with a first preset marker symbol; the usage rules of the prompt word include marking the flexible process part of the prompt word with a second preset marker symbol.
[0010] In one possible implementation, after combining the target task text using a fixed prefix of a preset prompt word to obtain the combined text, the method further includes:
[0011] The large language model LLM, which is pre-constructed in conjunction with text input, is obtained by training language rules and patterns using a large-scale language dataset through autoregressive generation. When generating new text data, the large language model LLM predicts the probability of the next language unit based on the previously generated content until complete text data is generated.
[0012] The process of automatically parsing the combined text and using the parsing results to rewrite the preset prompt words in a structured and adaptive hybrid manner to obtain optimized prompt word text includes:
[0013] The combined text is automatically parsed using the Large Language Model (LLM), and the parsing results are used to rewrite the preset prompt words in a structured and adaptive hybrid manner to obtain the optimized prompt word text.
[0014] In one possible implementation, the method further includes:
[0015] The optimized prompt text is then fed back to the target user.
[0016] In one possible implementation, the automatic parsing of the combined text, and the use of the parsing results to rewrite the preset prompt words in a structured and adaptive hybrid manner to obtain optimized prompt word text, includes:
[0017] The combined text is automatically parsed, and based on the parsing results, the fixed process portion of the optimized prompt text is marked with a first preset marker symbol; and the adaptive process portion of the optimized prompt text is marked with a second preset marker symbol.
[0018] In one possible implementation, the method further includes:
[0019] The intelligent recognition and processing capabilities of the Large Language Model (LLM) are invoked to update the adaptive flow portion of the prompt text, resulting in the updated prompt text.
[0020] In one possible implementation, the method further includes:
[0021] Based on the optimized prompt text, a response text conforming to natural language habits is generated and the response text is sent back to the target user.
[0022] This application also provides a text processing apparatus, including:
[0023] The acquisition unit is used to acquire the target task text to be processed, input by the target user;
[0024] The combination unit is used to combine the target task text using a fixed prefix of a preset prompt word to obtain combined text.
[0025] The rewriting unit is used to automatically parse the combined text and use the parsing results to rewrite the preset prompt words in a structured and adaptive hybrid manner to obtain optimized prompt word text.
[0026] In one possible implementation, the fixed prefix of the preset prompt word includes the usage rules of the prompt word; the usage rules of the prompt word include marking the fixed process part of the prompt word with a first preset marker symbol; the usage rules of the prompt word include marking the flexible process part of the prompt word with a second preset marker symbol.
[0027] In one possible implementation, the device further includes:
[0028] The input unit is used to combine the pre-constructed large language model LLM with the text input; wherein, the large language model LLM is obtained by training language rules and patterns using a large-scale language dataset through autoregressive generation. When generating new text data, the large language model LLM predicts the probability of the next language unit based on the previously generated content until complete text data is generated.
[0029] The rewriting unit is specifically used for:
[0030] The combined text is automatically parsed using the Large Language Model (LLM), and the parsing results are used to rewrite the preset prompt words in a structured and adaptive hybrid manner to obtain the optimized prompt word text.
[0031] In one possible implementation, the device further includes:
[0032] The first feedback unit is used to provide the optimized prompt text to the target user.
[0033] In one possible implementation, the rewriting unit is specifically used for:
[0034] The combined text is automatically parsed, and based on the parsing results, the fixed process portion of the optimized prompt text is marked with a first preset marker symbol; and the adaptive process portion of the optimized prompt text is marked with a second preset marker symbol.
[0035] In one possible implementation, the device further includes:
[0036] The update unit is used to invoke the intelligent recognition and processing capabilities of the large language model LLM to update the random response process part of the prompt word text, thereby obtaining the updated prompt word text.
[0037] In one possible implementation, the device further includes:
[0038] The second feedback unit is used to generate a response text that conforms to natural language habits based on the optimized prompt text, and to send the response text back to the target user.
[0039] This application also provides a text processing device, including: a processor, a memory, and a system bus;
[0040] The processor and the memory are connected via the system bus;
[0041] The memory is used to store one or more programs, the one or more programs including instructions, which, when executed by the processor, cause the processor to perform any of the above-described text processing methods.
[0042] This application also provides a computer-readable storage medium storing instructions that, when executed on a terminal device, cause the terminal device to perform any of the above-described text processing methods.
[0043] This application also provides a computer program product, which, when run on a terminal device, causes the terminal device to execute any of the above-described text processing methods.
[0044] This application provides a text processing method, apparatus, storage medium, and device. First, it acquires the target task text input by the target user. Then, it combines the target task text using fixed prefixes of preset prompt words to obtain combined text. Next, it automatically parses the combined text and uses the parsing results to rewrite the preset prompt words in a structured and adaptive hybrid manner, resulting in optimized prompt word text. Therefore, because this application uses a structured and adaptive hybrid prompt word writing method, it effectively optimizes the written prompt words, improving the efficiency and accuracy of prompt word writing. This allows the relevant AI model to more accurately understand and execute the target task indicated by the target user, thereby improving the target user's interactive experience. Attached Figure Description
[0045] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0046] Figure 1 A flowchart illustrating a text processing method provided in an embodiment of this application;
[0047] Figure 2 Example diagram of a fixed prefix for a preset prompt word provided in the embodiments of this application;
[0048] Figure 3 An example diagram of the target task text input by the target user in an embodiment of this application;
[0049] Figure 4 Example diagrams of prompt words combined with text provided for embodiments of this application;
[0050] Figure 5 Example diagram of the optimized prompt text provided in the embodiments of this application;
[0051] Figure 6 Example diagram of the response text provided in the embodiments of this application;
[0052] Figure 7 Comparative example diagrams of prompt words provided in embodiments of this application;
[0053] Figure 8 This is a schematic diagram illustrating the composition of a text processing device provided in an embodiment of this application. Detailed Implementation
[0054] With the development of artificial intelligence, especially Natural Language Processing (NLP), AI models in intelligent interactive software or devices (such as ChatGPT and smart speakers) have made significant progress in understanding and generating human language. However, these models' understanding is still based on statistics and pattern recognition, rather than deep semantic understanding. This raises a problem: when faced with overly complex instructions or prompts, the models may struggle. They may fail to fully understand complex prompts, overlook certain parts, or misunderstand the intent of the prompts. Even after multiple iterations of prompts, the model may still struggle to grasp the true intent of the task. This leads to the question of how to effectively craft prompts so that AI models can more accurately understand and execute tasks.
[0055] To address this problem, researchers began using cue word writing methods. The basic idea behind this approach is to break down complex instructions into a series of simple cue words to help AI models better understand and execute them. While existing cue word writing methods have improved the performance of AI models in handling complex tasks to some extent, they also have some significant drawbacks and technical problems.
[0056] Specifically, firstly, existing methods for writing prompts mainly rely on manual work, which not only consumes a significant amount of manpower and time, but also may lead to inconsistent efficiency and quality due to human factors. This is especially true when dealing with large, complex, and dynamically changing tasks, where the efficiency and effectiveness of this method can be greatly reduced.
[0057] Secondly, existing methods for writing prompts are typically static, meaning they cannot automatically adjust prompts based on changes in the task. This makes these methods challenging when handling complex and dynamic tasks.
[0058] Finally, despite multiple iterations of the cue words, AI models may still struggle to understand the true intent of the task. This is because AI models don't truly understand language; instead, they identify patterns by analyzing vast amounts of data. Therefore, they may overlook or misunderstand certain parts of the cue words.
[0059] Therefore, designing a new method for writing prompt words to improve the efficiency and accuracy of prompt word writing, thereby enhancing the performance of AI models in handling complex tasks, while also considering flexibility and adaptability so that the model can adaptively handle various different tasks and situations, is a technical problem that urgently needs to be solved.
[0060] To address the aforementioned shortcomings, this application provides a text processing method. First, it acquires the target task text input by the target user. Then, it combines the target task text using fixed prefixes of preset prompt words to obtain combined text. Next, it automatically parses the combined text and uses the parsing results to rewrite the preset prompt words using a hybrid structured and adaptive approach, resulting in optimized prompt word text. As can be seen, because this application uses a hybrid structured and adaptive prompt word writing method, it effectively optimizes the written prompt words, improving the efficiency and accuracy of prompt word writing. This allows the relevant AI model to more accurately understand and execute the target task indicated by the target user, thereby improving the user's interactive experience.
[0061] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0062] First Embodiment
[0063] See Figure 1 This is a flowchart illustrating a text processing method provided in this embodiment. The method includes the following steps:
[0064] S101: Obtain the target task text to be processed, input by the target user.
[0065] In this embodiment, the task text that any user inputs into a smart interactive software or device (such as ChatGPT, smart speaker, etc.) to perform, which requires the user to perform text processing using this embodiment, is defined as the target task text to be processed, and the user is defined as the target user.
[0066] It should be noted that this embodiment does not limit the language type of the target task text. For example, the target task text can be Chinese text or English text, etc. Furthermore, the target task text can be directly input by the user into the intelligent interactive software, or it can be the text recognition result obtained after converting the user's input speech. This embodiment also does not limit the type of target task text. For example, the target task text can be text input by the target user regarding the need to perform daily life-related tasks (such as weather forecasting), or it can be text input by the target user regarding the need to perform tasks related to specific fields such as music and medicine (such as composing music or drawing).
[0067] Understandably, the target task text can be a sentence or a paragraph. A sentence refers to a collection of individual words, while a paragraph refers to a collection of sentences. After obtaining the sentence or paragraph text as the target task text to be processed, it can be processed according to subsequent steps to generate prompts that are easier for the AI model to understand. Based on these prompts, the AI model can more accurately understand and execute the task proposed by the target user.
[0068] S102: Using the fixed prefix of the preset prompt words, the target task text is combined to obtain the combined text.
[0069] In this embodiment, after obtaining the target task text input by the target user in step S101, in order to effectively write prompt words for it so that the AI model can more accurately understand and execute the task indicated by the target user, thereby improving the interactive experience of the target user, a fixed prefix of the prompt words can be preset to combine the target task text to obtain combined text, which is then used to continue to execute the subsequent step S103.
[0070] It should be noted that this application does not limit the specific content of the fixed prefix of the preset prompt words, and it can be set according to the actual situation and experience. A preferred implementation is that the fixed prefix of the preset prompt words may include, but is not limited to, the usage rules of the prompt words. The usage rules of the prompt words may include, but are not limited to, using a first preset marker symbol to mark the fixed process portion of the prompt words, and using a second preset marker symbol to mark the flexible process portion of the prompt words.
[0071] The fixed process section refers to a description of a part of the task instructed by the target user. Its content and steps are clearly defined before the task is executed and do not require significant adjustments. For example, for a shopping task proposed by a target user, the fixed process section may include steps such as adding products to the shopping cart, entering the delivery address, and selecting a payment method.
[0072] The contingency component refers to a description of another part of the task instructed by the target user. Its content and steps require the intelligent recognition and processing capabilities of the AI model to be utilized during task execution. For example, for the shopping task proposed by the target user above, the contingency component might include steps such as evaluating the product, evaluating the seller, and evaluating the shopping experience.
[0073] Furthermore, this application does not limit the specific content of the first preset marking symbol and the second preset marking symbol, as long as they are different. For example, the first preset marking symbol and the second preset marking symbol can be set to "++" and "&&" respectively, that is, "++" can be used to mark the "fixed process part" and "&&" can be used to mark the "adaptive part".
[0074] For example: Suppose the preset prompt words have a fixed prefix, such as... Figure 2 As shown, the target task text input by the target user is as follows: Figure 3 As shown, the target task text is combined using the fixed prefix of the preset prompt words, resulting in the following prompt words for the combined text: Figure 4 As shown, this is used to continue executing the subsequent step S103.
[0075] S103: Automatically parse the combined text and use the parsing results to rewrite the preset prompt words in a structured and adaptive hybrid manner to obtain the optimized prompt word text.
[0076] In this embodiment, after obtaining the combined text through step S102, in order to effectively write prompt words for it so that the AI model can more accurately understand and execute the task indicated by the target user, thereby improving the target user's interactive experience, existing or future text parsing methods can be used to automatically parse the combined text, and the parsing results can be used to rewrite the preset prompt words in a structured and adaptive hybrid manner to obtain optimized prompt word text, so that the AI model can more accurately understand the prompt words, and thus more accurately understand and execute the task proposed by the target user.
[0077] Specifically, one possible implementation is to combine the target task text using fixed prefixes of preset prompt words to obtain combined text. This combined text can then be input into a pre-built large language model (LLM). The LLM automatically parses the combined text and uses the parsing results to rewrite the preset prompt words in a structured and adaptive hybrid manner, resulting in optimized prompt text. This optimized prompt text can then be fed back to the target user to determine its basic structure and whether it meets the user's needs. If it does, the optimized prompt text can be directly input into the LLM. If the target user has other needs, the LLM's intelligent recognition and processing capabilities can be invoked to modify corresponding statements in the prompt words, such as updating the improvisation process section of the prompt text to obtain updated prompt text.
[0078] Among them, the Large Language Model (LLM) is trained on language rules and patterns using a large-scale language dataset through autoregressive generation. When generating new text data, the LLM predicts the probability of the next language unit based on the previously generated content until complete text data is generated.
[0079] One possible implementation is that a Large Language Model (LLM) can be a deep learning-based language model that can generate new language expressions, such as text, sentences, paragraphs, or even articles, based on the input text content. Compared to traditional programming methods, LLM eliminates the need for manual coding of every detail. Instead, it utilizes large-scale language datasets and trains language rules and patterns through autoregressive generation, simulating human commands to generate language expressions (such as text data). Specifically, when generating new text data, LLM predicts the probability of the next language unit based on previously generated content until complete text data is generated.
[0080] Specifically, one possible implementation is that during the rewriting of the prompt words, the combined text can be automatically parsed using a Large Language Model (LLM). Based on the parsing results, the "fixed process" and "adaptive process" parts of the prompt word text can be identified. The fixed process part of the optimized prompt word text can be marked with a first preset marker (such as "++"), and the adaptive process part of the optimized prompt word text can be marked with a second preset marker (such as "&&").
[0081] For example: Based on the above example, let's assume that the target task text is combined using the fixed prefix of the preset prompt words. The resulting combined text prompt words would be as follows: Figure 4 As shown, after rewriting it using the Large Language Model (LLM), the optimized prompt word text is as follows: Figure 5 As shown.
[0082] For the "fixed process" text marked with "++", the Large Language Model (LLM) ensures accuracy and stability by following predefined rules and procedures. For example, if the data processing steps are explicitly specified in the fixed process, the model will strictly follow them. For the "adaptive process" text marked with "&&", the LLM intelligently adapts to the specific input and context. For example, if the adaptive process proposes generating a corresponding response based on the input, the model will use its trained language model to generate the appropriate response based on the input.
[0083] An alternative approach is to generate a response text that conforms to natural language habits based on the optimized prompt text after completing the modifications to the fixed and adaptive processes. This response text can then be fed back to the target user. For example, a large language model (LLM) can output the final task result to the target user based on the task requirements proposed by the target user.
[0084] For example: Based on the above example, after rewriting it using the Large Language Model (LLM), we get the following: Figure 5 After obtaining the optimized prompt text shown, the Large Language Model (LLM) can further execute the task requirements proposed by the target user based on the optimized prompt text and output the following to the target user: Figure 6 The response text shown is the result of the task.
[0085] In this way, by using user-defined markers (such as "++" and "&&"), the Large Language Model (LLM) can flexibly handle various types of tasks. Users can also customize parts of the task flow according to their needs, enabling the model to handle various complex and specific tasks. In the "fixed flow" part of processing prompt text, the model strictly follows predefined rules and procedures, ensuring accuracy. In the "adaptive flow" part, the model can intelligently adapt to input and context, improving the flexibility and adaptability of task processing.
[0086] To facilitate understanding of the text processing method proposed in this application, the following section will compare and explain the process of writing prompt words in the text processing by comparing examples of prompt words.
[0087] For example: Figure 7 As shown, it demonstrates three different ways of writing prompts, which are used to instruct the model to generate 100 random numbers between 5 and 10.
[0088] Figure 7 The image on the left shows natural language prompts. This method of writing prompts directly uses natural language to give task instructions, such as "generate 100 numbers between 5 and 10". The advantage of this method is that it is intuitive and easy to understand, and users can use it without any programming knowledge. However, due to the ambiguity of natural language, the model may not be able to accurately understand and execute the user's instructions, such as strict adherence to specific requirements like the number of executions or the execution order.
[0089] Figure 7 The middle image illustrates a combination of programming language and natural language prompts. This method uses programming language to provide task instructions, such as "for i in range(100): generate any number between 5 and 10". The advantage of this method is that it forces the model to adhere to specified execution counts and order. Because the model has seen a large amount of code during pre-training, it can understand and execute such instructions. However, the disadvantage is that it requires users to have some programming knowledge; it may be difficult for users without programming experience to understand and use.
[0090] Figure 7 The diagram on the right illustrates the structured and adaptive hybrid prompts proposed in this application. This method combines the advantages of both structured and adaptive approaches, using natural language to describe the logically related parts while explicitly specifying which logic must be followed and which tasks can be interpreted arbitrarily, such as "+execute the task enclosed in [] below 100 times+&generate any number between 5 and 10&". The advantage of this method is that it can precisely specify the number of times and the order of task execution, while using natural language to describe the task, making it understandable and usable even for users without programming experience.
[0091] As can be seen, the structured and adaptive hybrid prompt writing method proposed in this application has the following four advantages compared with the other two writing methods:
[0092] First, it improves the accuracy of task processing. By precisely specifying the number of times and the order of task execution, the model can accurately execute the user's instructions, avoiding the ambiguity that may exist in natural language prompts.
[0093] Secondly, it improves the flexibility and adaptability of task processing. By using natural language to describe tasks, the model can adapt to the input and context, thus handling a variety of complex and specific tasks.
[0094] Third, it improves user-friendliness, meaning that users do not need programming knowledge to use the writing methods provided in this application, which greatly lowers the threshold for use and enables more users to use the model to complete tasks.
[0095] Fourth, it improves the efficiency of task processing. Through a hybrid structured and adaptive writing approach, the model can complete tasks more efficiently, avoiding the complex and tedious programming steps that programming language prompts may require.
[0096] Thus, by executing steps S101-S103, the prompt writing process can be simplified, efficiency improved, and labor costs reduced, allowing even non-professionals to easily create effective prompts. Secondly, the hybrid structured and adaptive writing approach enhances the output of the AI model, enabling it to perform better when handling complex or variable tasks. Thirdly, it provides better consistency and predictability, ensuring the model follows the same basic steps each time the same prompts are used, while allowing for adaptive responses to different inputs or situations. Finally, the structured part of this text processing method provides a clear framework, facilitating feedback collection and parsing for prompt optimization, while the flexibility of the adaptive part provides space for continuous learning and improvement. This allows the AI model to more accurately understand and execute tasks proposed by the target user, enabling the generation of responses that the target user truly desires using intelligent interactive software or devices such as ChatGPT or LLM, thereby improving the user's interactive experience.
[0097] In summary, the text processing method provided in this embodiment first obtains the target task text input by the target user; then, using fixed prefixes of preset prompt words, it combines the target task text to obtain combined text; next, it automatically parses the combined text and uses the parsing results to rewrite the preset prompt words in a structured and adaptive hybrid manner, resulting in optimized prompt word text. It is evident that because this application uses a structured and adaptive hybrid prompt word writing method, it effectively optimizes the written prompt words, improves the efficiency and accuracy of prompt word writing, thereby enabling the relevant AI model to more accurately understand and execute the target task indicated by the target user, thus improving the target user's interactive experience.
[0098] Second Embodiment
[0099] This embodiment will introduce a text processing device; please refer to the above method embodiment for related content.
[0100] See Figure 8 This is a schematic diagram of the composition of a text processing device provided in this embodiment. The device 800 includes:
[0101] The acquisition unit 801 is used to acquire the target task text to be processed input by the target user;
[0102] The combining unit 802 is used to combine the target task text using a fixed prefix of a preset prompt word to obtain combined text;
[0103] The rewriting unit 803 is used to automatically parse the combined text and use the parsing results to rewrite the preset prompt words in a structured and adaptive hybrid manner to obtain the optimized prompt word text.
[0104] In one implementation of this embodiment, the fixed prefix of the preset prompt word includes the usage rules of the prompt word; the usage rules of the prompt word include marking the fixed process part of the prompt word with a first preset marker symbol; the usage rules of the prompt word include marking the flexible process part of the prompt word with a second preset marker symbol.
[0105] In one implementation of this embodiment, the apparatus further includes:
[0106] The input unit is used to combine the pre-constructed large language model LLM with the text input; wherein, the large language model LLM is obtained by training language rules and patterns using a large-scale language dataset through autoregressive generation. When generating new text data, the large language model LLM predicts the probability of the next language unit based on the previously generated content until complete text data is generated.
[0107] The rewriting unit 803 is specifically used for:
[0108] The combined text is automatically parsed using the Large Language Model (LLM), and the parsing results are used to rewrite the preset prompt words in a structured and adaptive hybrid manner to obtain the optimized prompt word text.
[0109] In one implementation of this embodiment, the apparatus further includes:
[0110] The first feedback unit is used to provide the optimized prompt text to the target user.
[0111] In one implementation of this embodiment, the rewriting unit 803 is specifically used for:
[0112] The combined text is automatically parsed, and based on the parsing results, the fixed process portion of the optimized prompt text is marked with a first preset marker symbol; and the adaptive process portion of the optimized prompt text is marked with a second preset marker symbol.
[0113] In one implementation of this embodiment, the apparatus further includes:
[0114] The update unit is used to invoke the intelligent recognition and processing capabilities of the large language model LLM to update the random response process part of the prompt word text, thereby obtaining the updated prompt word text.
[0115] In one implementation of this embodiment, the apparatus further includes:
[0116] The second feedback unit is used to generate a response text that conforms to natural language habits based on the optimized prompt text, and to send the response text back to the target user.
[0117] Furthermore, embodiments of this application also provide a text processing device, including: a processor, a memory, and a system bus;
[0118] The processor and the memory are connected via the system bus;
[0119] The memory is used to store one or more programs, the one or more programs including instructions that, when executed by the processor, cause the processor to perform any of the above-described text processing methods.
[0120] Furthermore, embodiments of this application also provide a computer-readable storage medium storing instructions that, when executed on a terminal device, cause the terminal device to perform any of the above-described text processing methods.
[0121] Furthermore, this application also provides a computer program product, which, when run on a terminal device, causes the terminal device to execute any of the above-described text processing methods.
[0122] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that all or part of the steps in the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network communication device such as a media gateway, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.
[0123] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0124] It should also be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0125] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A text processing method, characterized in that, include: Obtain the target task text input by the target user; By using the fixed prefixes of preset prompt words, the target task text is combined to obtain combined text; The fixed prefix of the preset prompt word includes the usage rules of the prompt word; the usage rules of the prompt word include using a first preset marker symbol to mark the fixed process part of the prompt word; the usage rules of the prompt word include using a second preset marker symbol to mark the flexible process part of the prompt word; The combined text is automatically parsed, and the parsing results are used to identify the fixed process part text and the improvisation process part text in the prompt text. Then, the fixed process part text in the optimized prompt text is marked with the first preset mark symbol. And by using the second preset marker symbol to mark the adaptive process part of the optimized prompt text, the optimized prompt text is obtained.
2. The method according to claim 1, characterized in that, After combining the target task text using a fixed prefix of a preset prompt word to obtain the combined text, the method further includes: The large language model LLM, which is pre-constructed in conjunction with text input, is obtained by training language rules and patterns using a large-scale language dataset through autoregressive generation. When generating new text data, the large language model LLM predicts the probability of the next language unit based on the previously generated content until complete text data is generated. The process of automatically parsing the combined text and using the parsing results to rewrite the preset prompt words in a structured and adaptive hybrid manner to obtain optimized prompt word text includes: The combined text is automatically parsed using the Large Language Model (LLM), and the parsing results are used to rewrite the preset prompt words in a structured and adaptive hybrid manner to obtain the optimized prompt word text.
3. The method according to claim 1, characterized in that, The method further includes: The optimized prompt text is then fed back to the target user.
4. The method according to claim 2, characterized in that, The method further includes: The intelligent recognition and processing capabilities of the Large Language Model (LLM) are invoked to update the adaptive flow portion of the prompt text, resulting in the updated prompt text.
5. The method according to any one of claims 1-4, characterized in that, The method further includes: Based on the optimized prompt text, a response text conforming to natural language habits is generated and the response text is sent back to the target user.
6. A text processing device, characterized in that, include: The acquisition unit is used to acquire the target task text to be processed, input by the target user; The combination unit is used to combine the target task text using a fixed prefix of a preset prompt word to obtain combined text. The fixed prefix of the preset prompt word includes the usage rules of the prompt word; the usage rules of the prompt word include using a first preset marker symbol to mark the fixed process part of the prompt word; the usage rules of the prompt word include using a second preset marker symbol to mark the flexible process part of the prompt word; The rewriting unit is used to automatically parse the combined text, and use the parsing results to identify the fixed process part text and the improvisation process part text in the prompt text, and then use the first preset mark symbol to mark the fixed process part text in the optimized prompt text. And by using the second preset marker symbol to mark the adaptive process part of the optimized prompt text, the optimized prompt text is obtained.
7. A text processing device, characterized in that, include: Processor, memory, system bus; The processor and the memory are connected via the system bus; The memory is used to store one or more programs, the one or more programs including instructions that, when executed by the processor, cause the processor to perform the method according to any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed on a terminal device, cause the terminal device to perform the method described in any one of claims 1-5.
Citation Information
Patent Citations
NLU task processing method and system, electronic equipment and storage medium
CN114154482A
Text processing method, man-machine interaction method, equipment and storage medium
CN116450792A