A text processing method, device, storage medium and equipment
By calculating the clarity of user text and performing iterative processing to supplement information, the problem of intent recognition bias in intelligent interactive devices has been solved, achieving more accurate user intent recognition and improved interactive experience.
Patent Information
- Application Number
- CN202310491406.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-28
- Publication Date
- 2026-03-17
- Estimated Expiration
- 2043-04-28
AI Technical Summary
Existing smart interactive devices rely solely on keyword extraction when recognizing user intent, which leads to biases and a failure to provide timely and accurate feedback on the user's true intent, resulting in a poor interactive experience.
By acquiring the text input by the user, the clarity is calculated and it is determined whether it is lower than a preset threshold. If it is lower, importance analysis and information supplementation are performed. The process is iterated until the stopping condition is met, and the final response text is generated.
It improves the accuracy of identifying user intent, generates responses that users truly want, and enhances the interactive experience.
Smart Images

Figure CN116401354B_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 information technologies such as artificial intelligence 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, such as Chat Generative Pre-trained Transformer (ChatGPT), smart speakers, and smart TVs, which can provide intelligent interactive functions for many application scenarios such as information retrieval to assist users in completing various behavioral intentions.
[0003] Currently, the common approach for handling user input of voice or text information from smart interactive software or devices (such as smart speakers and smart TVs) involves using existing keyword extraction network models to extract corresponding keywords from the user's input text information (or text information converted from voice input). Based on these extracted keywords, the user's behavioral intent is identified, and then corresponding voice or text information is provided in response. However, this interaction method, which relies solely on extracted keywords to identify user intent, does not engage in proactive dialogue with the user or consider the impact of different users' language expression abilities. This can lead to biases in intent recognition, or even failure to identify the user's true intent, resulting in a failure to provide the user with the information they truly want in a timely and accurate manner. Consequently, the processing effect of user input text is poor, reducing the user's interactive 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 text processing effect and the efficiency of intelligent interactive question answering, thereby improving the user's interactive experience.
[0005] This application provides a text processing method, including:
[0006] Obtain the text of the target question to be answered, input by the target user;
[0007] Calculate the clarity of the target question text and determine whether the clarity is not lower than a preset threshold;
[0008] If yes, then generate a response text based on the target question text; if no, then perform importance analysis on the target question text, and supplement the target question text with information based on the analysis results to obtain a target question text with supplemented information.
[0009] The target question text with the supplemented information is used as the target question text again. The calculation of the clarity of the target question text and subsequent steps are repeated iteratively until a preset stopping condition is reached. The target question text with the supplemented information obtained after the iteration when the preset stopping condition is reached is used as the final target question text, so as to generate the final response text based on the final target question text.
[0010] In one possible implementation, calculating the clarity of the target question text includes:
[0011] The target question text is preprocessed using preset prompt words, and the preprocessed target question text is input into a pre-built large speech model LLM to predict the clarity of the target question text;
[0012] The large speech model LLM is trained on language rules and patterns using a large-scale language dataset through autoregressive generation. When generating new text data, the large speech model LLM predicts the probability of the next language unit based on the previously generated content until complete text data is generated.
[0013] In one possible implementation, the step of performing importance analysis on the target question text and supplementing the target question text with information based on the analysis results to obtain the supplemented target question text includes:
[0014] Construct a preset question text related to information supplementation, and input the preset question text into a pre-constructed large speech model (LLM);
[0015] Using the Large LLM speech model, the target question text is analyzed for importance based on the preset question text, and the relevant information of the question that the target user cares about most is predicted.
[0016] Based on information related to the issues that the target user cares about most, send relevant questions with supplementary information to the target user to achieve proactive interaction with the target user;
[0017] After receiving the relevant response text of supplementary information from the target user, the target question text is supplemented with information based on the relevant information of the question that the target user cares about most and the relevant response text of the supplementary information from the target user, so as to obtain the target question text with supplementary information.
[0018] In one possible implementation, the step of sending supplementary information-related question texts to the target user based on information related to the questions most concerned by the target user, thereby achieving proactive interaction with the target user, includes:
[0019] By using information related to the questions that the target user cares about most, keyword slots in the preset supplementary information related question text are filled to construct the supplementary information related question text; and the supplementary information related question text filled with keyword slots is sent to the target user to realize proactive interaction with the target user.
[0020] In one possible implementation, the value of the declarativity ranges from 1 to 10; the preset threshold is 8 or 9.
[0021] In one possible implementation, the preset stopping condition includes at least one of the following: the clarity of the target question text after information supplementation is not lower than a preset threshold, and the number of iterations reaches a preset number.
[0022] In one possible implementation, the preset number of times is 1.
[0023] This application also provides a text processing apparatus, including:
[0024] The acquisition unit is used to acquire the text of the target question to be answered, input by the target user.
[0025] A calculation unit is used to calculate the clarity of the target question text and determine whether the clarity is not lower than a preset threshold.
[0026] The supplementary unit is used to generate a response text based on the target question text if it is determined that the clarity is not lower than a preset threshold; and to perform importance analysis on the target question text if it is determined that the clarity is lower than the preset threshold, and to supplement the target question text with information based on the analysis results, so as to obtain the target question text with supplemented information.
[0027] An iterative unit is used to repeatedly iterate the calculation of the clarity of the target question text and subsequent steps, using the target question text with the information supplemented as the target question text again, until a preset stopping condition is reached. The target question text with the information supplemented after the iteration when the preset stopping condition is reached is used as the final target question text, so as to generate the final response text based on the final target question text.
[0028] In one possible implementation, the computing unit is specifically used for:
[0029] The target question text is preprocessed using preset prompt words, and the preprocessed target question text is input into a pre-built large speech model LLM to predict the clarity of the target question text;
[0030] The large speech model LLM is trained on language rules and patterns using a large-scale language dataset through autoregressive generation. When generating new text data, the large speech model LLM predicts the probability of the next language unit based on the previously generated content until complete text data is generated.
[0031] In one possible implementation, the supplementary unit includes:
[0032] A subunit is constructed to build a preset question text related to information supplementation, and the preset question text is input into a pre-constructed large speech model LLM;
[0033] The prediction subunit is used to perform importance analysis on the target question text based on the preset question text using the large speech model LLM, and predict the relevant information of the question that the target user cares about most.
[0034] The interaction subunit is used to send relevant question texts with supplementary information to the target user based on the information related to the questions that the target user cares about most, so as to realize active interaction with the target user.
[0035] The supplementary subunit is used to supplement the target question text with information related to the question that the target user cares about most and the relevant response text of the supplementary information provided by the target user after receiving the relevant response text of the supplementary information provided by the target user, so as to obtain the target question text with supplementary information.
[0036] In one possible implementation, the interaction subunit is specifically used for:
[0037] By using information related to the questions that the target user cares about most, keyword slots in the preset supplementary information related question text are filled to construct the supplementary information related question text; and the supplementary information related question text filled with keyword slots is sent to the target user to realize proactive interaction with the target user.
[0038] In one possible implementation, the value of the declarativity ranges from 1 to 10; the preset threshold is 8 or 9.
[0039] In one possible implementation, the preset stopping condition includes at least one of the following: the clarity of the target question text after information supplementation is not lower than a preset threshold, and the number of iterations reaches a preset number.
[0040] In one possible implementation, the preset number of times is 1.
[0041] This application also provides a text processing device, including: a processor, a memory, and a system bus;
[0042] The processor and the memory are connected via the system bus;
[0043] 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.
[0044] 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.
[0045] 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.
[0046] This application provides a text processing method, apparatus, storage medium, and device. First, it acquires the target question text input by a target user. Then, it calculates the clarity of the target question text and determines whether the clarity is not lower than a preset threshold. If so, it generates a response text based on the target question text. If not, it performs importance analysis on the target question text and supplements the target question text with information based on the analysis results, obtaining a supplemented target question text. Next, the supplemented target question text can be used again as the target question text, and the calculation of the clarity of the target question text and subsequent steps are iteratively repeated until a preset stopping condition is reached. The supplemented target question text obtained after the iteration when the preset stopping condition is reached is taken as the final target question text, so that a final response text can be generated based on the final target question text.
[0047] As can be seen, since this application supplements the target question text with information based on the results of the analysis of the clarity and importance of the target question text, it can more accurately identify the true intent of the target user based on the target question text with the supplemented information, and thus generate the response information text that the target user really wants, thereby improving the target user's interactive experience. Attached Figure Description
[0048] 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.
[0049] Figure 1 A flowchart illustrating a text processing method provided in an embodiment of this application;
[0050] Figure 2 This is a schematic diagram illustrating the composition of a text processing device provided in an embodiment of this application. Detailed Implementation
[0051] With the continuous development and progress of social technology, all kinds of intelligent interactive software and devices have appeared in people's lives and work, assisting people in completing various behavioral intentions through intelligent interaction.
[0052] However, current smart interactive software or devices (such as ChatGPT, smart speakers, etc.) typically process user input by using existing keyword extraction network models to extract keywords from the user's text input. They then identify the user's behavioral intent based on the extracted keywords and provide corresponding response text. However, this interaction method, which only identifies user intent based on extracted keywords, does not engage in interactive dialogue with the user, nor does it consider the impact of different users' speech expression abilities. This can lead to biases in identifying user intent, or even failure to identify the user's true intent. Consequently, it fails to provide the user with the information they truly want in a timely and accurate manner, thus reducing the user's interactive experience.
[0053] Therefore, how to improve the processing effect of user input text and the efficiency of intelligent question answering to further enhance the user's interactive experience is a technical problem that urgently needs to be solved.
[0054] To address the aforementioned shortcomings, this application provides a text processing method. First, it acquires the target question text input by the target user. Then, it calculates the clarity of the target question text and determines whether the clarity is not lower than a preset threshold. If so, it generates a response text based on the target question text. If not, it performs importance analysis on the target question text and supplements the target question text with additional information based on the analysis results, obtaining a supplemented target question text. Next, the supplemented target question text can be used again as the target question text, and the calculation of the target question text's clarity and subsequent steps are iteratively repeated until a preset stopping condition is reached. The supplemented target question text obtained after this iteration when the preset stopping condition is reached is taken as the final target question text, so that a final response text can be generated based on the final target question text.
[0055] As can be seen, since this application supplements the target question text with information based on the results of the analysis of the clarity and importance of the target question text, it can more accurately identify the true intent of the target user based on the target question text with the supplemented information, and thus generate the response information text that the target user really wants, thereby improving the target user's interactive experience.
[0056] 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.
[0057] First Embodiment
[0058] See Figure 1 This is a flowchart illustrating a text processing method provided in this embodiment. The method includes the following steps:
[0059] S101: Obtain the text of the target question to be answered, input by the target user.
[0060] In this embodiment, the question text input by any user using this embodiment to intelligent interactive software or device (such as ChatGPT, smart speaker, etc.) is defined as the target question text to be answered, and is defined as Q, and the user is defined as the target user.
[0061] It should be noted that this embodiment does not limit the language type of the target question text. For example, the target question text can be Chinese text or English text, etc. Furthermore, the target question 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 question text. For example, the target question text can be a question text about daily life conversations input by the target user, or it can be a text text about technical questions related to specific fields such as music and medicine input by the target user.
[0062] Understandably, the target question text can be a sentence or a paragraph. A sentence refers to a collection of words, while a paragraph refers to a collection of sentences. After obtaining the sentence or paragraph text as the target question text to be answered, it can be processed and answered according to the subsequent steps.
[0063] S102: Calculate the clarity of the target question text and determine whether the clarity is not lower than a preset threshold.
[0064] In this embodiment, after obtaining the target question text Q input by the target user in step S101, in order to improve the processing effect of the target question text and the efficiency of intelligent interactive question-and-answer with the target user, thereby improving the target user's interactive experience, the clarity of the target question text can be calculated using existing or future clarity calculation methods, and defined as C. t And to determine the clarity C t Check if the value is not lower than a preset threshold in order to continue with the subsequent step S103.
[0065] The clarity of the target question text represents the degree to which the semantics of the target question text clearly reflect the intent of the target user's question. This application does not limit the specific content format or corresponding value range of clarity. A preferred implementation is that the clarity value range can be from 1 to 10. Furthermore, this application does not limit the specific value of the preset threshold; it can be set according to actual circumstances and experience. For example, the preset threshold can be set to 8 or 9 to determine whether it is necessary to supplement the target question text through subsequent steps S103-S104, so that the information truly desired by the target user can be fed back to the target user in a timely and accurate manner.
[0066] Specifically, one optional implementation is that, after obtaining the target question text input by the target user, it should be noted that, in order to improve the processing effect of the target question text and the efficiency of intelligent interactive question-and-answer with the target user, thereby improving the user's interactive experience, the target question text can first be preprocessed using preset prompts (the specific content is not limited and can be preset according to the actual situation and experience), resulting in the preprocessed target question text, which is defined as Q. pre For example, preset prompts can be combined with the target question text line to form a question text used to ask for the clarity score of the target question text line, and this preprocessed target question text Q can be used to... pre (For example, the question text) is input into a pre-built large language model (LLM). The model predicts the clarity of the target question text to determine whether information supplementation is needed.
[0067] Large Language Models (LLMs) are deep learning-based language models that can generate new language expressions, such as text, sentences, paragraphs, and even articles, based on input text content. Compared to traditional programming methods, LLMs eliminate the need for manual coding of every detail. Instead, they utilize large-scale language datasets and are trained on language rules and patterns through autoregressive generation. They can also simulate human commands to generate language expressions (such as text data). Specifically, when generating new text data, LLMs predict the probability of the next language unit based on previously generated content until complete text data is generated.
[0068] During model training, a sample question text can be extracted from the training data, preprocessed, and then used as model input. The model's output of the explicitness prediction result is compared with the manually labeled result corresponding to the recorded sample question text, and the model parameters are updated based on the difference. This process is repeated multiple times until preset conditions are met (such as reaching a preset number of training iterations or the optimization function value remaining essentially unchanged). At this point, updating the model parameters stops, completing the training of the Large Speech Model (LLM) and generating a well-trained LLM.
[0069] In addition, validation question texts can be used to effectively validate the large speech model LLM. When the sharpness result corresponding to the predicted validation question text is inconsistent with the true label result corresponding to the validation question text, the large speech model LLM can be adjusted and updated in a timely manner, which helps to improve the prediction accuracy and precision of the large speech model LLM.
[0070] For example: Suppose the target user's input text Q for the question to be answered is as follows:
[0071] "Hello, I want to add more value to my [product / service] to improve customer retention. I want my [product / service] to be unique and provide users with the ultimate experience. Please give me some clear ideas, strategies, and step-by-step instructions."
[0072] Please refer to the current market sectors for [products / services] and provide entirely new ideas.
[0073] [Product / Service] = Breakfast Shop.
[0074] Let's assume the default prompt is: "The following paragraph, enclosed in ---, is a question asked by a user to ChatGPT. Please evaluate the clarity of this user's request and rate its clarity on a scale of 1 to 10. Note: You need to provide the clarity score in numerical form on the last line."
[0075] Then, using the preset prompt, the target question text Q is preprocessed to obtain the preprocessed target question text Q. pre as follows:
[0076] "The following paragraph, enclosed in ---, contains a question posed by a user to ChatGPT. Please assess the clarity of this user's request and rate its clarity on a scale of 1 to 10. Note: You must provide the clarity score as a number on the last line."
[0077] ---
[0078] Hello, I want to add more value to my [product / service] to improve customer retention. I want my [product / service] to be unique and provide users with the ultimate experience. Please give me some clear ideas, strategies, and step-by-step instructions.
[0079] Please refer to the current market sectors for [products / services] and provide entirely new ideas.
[0080] [Products / Services] = Breakfast Shop
[0081] ---”.
[0082] Thus, the preprocessed target problem text Q pre After inputting a pre-built large speech model (LLM), the LLM uses the learned language rules and patterns to predict the probability of the next language unit based on previously generated content through an "autoregressive generation" method, mimicking human instructions, until a complete language expression (including the precision of the predicted target question text) is generated, as follows:
[0083] "The user's needs are relatively clear. The user wants to improve customer retention by adding more value and wants to make the breakfast shop unique and provide users with the ultimate experience. The user also wants clear ideas, strategies, and instructions, as well as entirely new ideas. However, the user did not provide specific details about the breakfast shop or the market segment, which may limit the accuracy and actionability of the relevant suggestions provided by ChatGPT."
[0084] Clarity: 7".
[0085] As can be seen, the clarity of the target question text Q is the number "7" in the last line of the LLM output. Then, "7" can be compared with a preset threshold (such as 8 or 9) to determine whether information needs to be supplemented to the target question text Q through subsequent steps.
[0086] To illustrate further: Suppose the target user's input question Q is in English, as shown below:
[0087] “Give me suggestions on what to implement to add more value to [product / service] to increase customer retention.Give precise ideas, strategies, and step-by-step instructions to stay unique while giving the customers the ultimate experience.
[0088] Conclude with new ideas that are completely new to[product]'s marketsector.
[0089] Product=breakfast shop”.
[0090] After preprocessing the target question text in English using preset prompts, and then inputting the preprocessed target question text into a pre-built large speech model (LLM), the model output can be:
[0091] "The user's needs were quite clear. They explicitly stated that they needed ChatGPT to provide specific advice and strategies on how to increase customer retention at their breakfast shop, requiring clear, detailed steps, and unique, novel ideas. However, the user did not provide information on what specific value to add or the target customers, which may affect the relevance and effectiveness of ChatGPT's recommendations."
[0092] Clarity: 8".
[0093] S103: If yes, then generate a response text based on the target question text; if no, then perform importance analysis on the target question text, and supplement the target question text with information based on the analysis results to obtain the supplemented target question text.
[0094] In this embodiment, if step S102 determines that the clarity of the target question text is not lower than a preset threshold, it means that the semantics of the target question text can fully reflect the intent of the question raised by the target user. The response text can be directly generated based on the target question text. For example, the target question text can be directly input into intelligent interactive software or devices such as ChatGPT or LLM to generate the corresponding response text.
[0095] Conversely, if step S102 determines that the clarity of the target question text is lower than the preset threshold, it means that the semantics of the target question text cannot fully reflect the intent of the target user's question. In this case, it is necessary to perform importance analysis on the target question text and supplement the target question text with information based on the analysis results to obtain the supplemented target question text, which is then used to execute the subsequent step S104.
[0096] Specifically, one possible implementation is to first perform text and semantic analysis on the target question text, construct a preset question text related to information supplementation, and then input the preset question text into a pre-built large speech model (LLM).
[0097] For example, taking the Chinese target question text from the example above, if the clarity of the obtained target question text Q is "7" lower than the preset threshold (8 or 9), then the preset question text related to information supplementation can be constructed as follows:
[0098] To achieve the highest possible clarity (10 / 10), what other information does the user need to provide, and which is the most important? Please provide it in the following format:
[0099] Additional information:
[0100] The most important one:”
[0101] Then, using a large speech model (LLM), based on the obtained pre-defined question text, importance analysis can be performed on the target question text to predict the information related to the questions that the target user cares about most, and this information is defined as Q. sup .
[0102] For example, using the preset question text obtained in the example above, the Large LLM speech model is used to perform importance analysis on the target question text based on the preset question text. The model output is as follows:
[0103] Additional information:
[0104] -The exact location and city of the breakfast shop
[0105] - The target customer group and their preferences of breakfast shops
[0106] - Current menu and price range at the breakfast shop
[0107] -Environmental factors such as the breakfast shop's decor and atmosphere
[0108] The most important one:
[0109] -The target customer group and their preferences of breakfast shops.
[0110] It is evident that the information Q related to the most pressing concerns of the target users, as predicted by the model, is... sup The target customer group of breakfast shops and their preferences.
[0111] Next, you can leverage information related to the questions that the target users care about most, such as Q. sup It fills the keyword slots in the pre-defined supplementary information related question text to construct the supplementary information related question text (the specific content is not limited and can be set according to the actual situation and experience value), and sends the supplementary information related question text to the target user to achieve proactive interaction with the target user.
[0112] For example: Using the example above, let's take the question / related information that the target user cares about most, Q. sup Taking "the target customer group of breakfast shops and their preferences" as an example, using this Q&A... sup Fill in the keyword slots in the pre-defined supplementary information related question text. The constructed supplementary information related question text can be: "Based on your question, in order to provide a targeted and high-value solution, you may need to supplement some information about 'the target customer group of the breakfast shop and their preferences'."
[0113] Furthermore, upon receiving supplementary information from the target user, the relevant response text (defined here as R) sup After that, you can use information related to the questions that the target users care about most. sup Responding text R to supplementary information from target users sup The target question text Q is supplemented with information to obtain the supplemented target question text, which is then defined as Q'.
[0114] For example: Using the question text related to the supplementary information obtained in the example above, after sending it to the target user, assume the target user provides a response text R related to the supplementary information. sup The breakfast shop targets students and office workers. Students prefer breakfasts with a variety of flavors, while office workers prefer nutritious and healthy breakfasts.
[0115] You can then leverage information related to the questions that the target users care about most. sup The text contains relevant responses regarding the target customer group and their preferences for breakfast shops, as well as supplementary information on feedback from target users. sup "The target customers of the breakfast shop are students and office workers. Students tend to prefer breakfasts with more diverse flavors, while office workers prefer nutritious and healthy breakfasts." The Chinese target question text Q mentioned in the example of step S102 above is supplemented with additional information, resulting in the supplemented target question text Q' as shown below:
[0116] "Hello, I want to add more value to my [product / service] to improve customer retention. I want my [product / service] to be unique and provide users with the ultimate experience. Please give me some clear ideas, strategies, and step-by-step instructions."
[0117] Please refer to the current market sectors for [products / services] and provide entirely new ideas.
[0118] [Products / Services] = Breakfast Shop
[0119] Regarding the target customer group and their preferences for breakfast shops, the following information is available for reference:
[0120] The breakfast shop targets students and office workers. Students tend to prefer breakfasts with a variety of flavors, while office workers prefer nutritious and healthy breakfasts.
[0121] S104: The target question text with supplemented information is used as the target question text again. The calculation of the clarity of the target question text and subsequent steps are repeated iteratively until a preset stopping condition is reached. The target question text with supplemented information obtained after the iteration when the preset stopping condition is reached is used as the final target question text, so as to generate the final response text based on the final target question text.
[0122] In this embodiment, after supplementing the target question text with information in step S103 to obtain the supplemented target question text Q', it can be used again as the target question text in step S102, and its clarity and subsequent steps can be repeatedly iterated until a preset stopping condition is reached. The supplemented target question text Q' obtained after the iteration when the preset stopping condition is reached is used as the final target question text, so as to generate the final response text based on the final target question text.
[0123] The specific content of the preset stopping conditions is not limited in this application and can be set according to actual conditions and experience. One optional implementation is that the preset stopping conditions may include, but are not limited to, at least one of the following: the clarity of the target question text after information supplementation is not lower than a preset threshold, and the number of iterations reaches a preset number. The specific value of the preset number is also not limited in this application and can be set according to actual conditions and experience. One optional implementation is that the preset number can be 1, that is, the target question text Q' obtained through step S103 after information supplementation can be used as the final target question text, so that the final response text can be generated and returned to the target user based on the final target question text.
[0124] In this way, after obtaining the final target question text that meets the personalized needs of the target user and supplements the information, the target user's true intention can be more accurately identified using this target question text. This allows the use of intelligent interactive software or devices such as ChatGPT or LLM to generate the response information that the target user truly wants, thereby improving the user's interactive experience.
[0125] In summary, the text processing method provided in this embodiment first obtains the target question text input by the target user; then, it calculates the clarity of the target question text and determines whether the clarity is not lower than a preset threshold; if so, it generates a response text based on the target question text; if not, it performs importance analysis on the target question text and supplements the target question text with information based on the analysis results, obtaining a supplemented target question text; then, it can use the supplemented target question text as the target question text again, repeatedly iteratively calculating the clarity of the target question text and subsequent steps until a preset stopping condition is reached, and uses the supplemented target question text obtained after the iteration when the preset stopping condition is reached as the final target question text, so that a final response text can be generated based on the final target question text.
[0126] As can be seen, since this application supplements the target question text with information based on the results of the analysis of the clarity and importance of the target question text, it can more accurately identify the true intent of the target user based on the target question text with the supplemented information, and thus generate the response information text that the target user really wants, thereby improving the target user's interactive experience.
[0127] Second Embodiment
[0128] This embodiment will introduce a text processing device; please refer to the above method embodiment for related content.
[0129] See Figure 2 This is a schematic diagram of the composition of a text processing device provided in this embodiment. The device 200 includes:
[0130] The acquisition unit 201 is used to acquire the text of the target question to be answered, input by the target user;
[0131] The calculation unit 202 is used to calculate the clarity of the target question text and determine whether the clarity is not lower than a preset threshold.
[0132] The supplementary unit 203 is used to generate a response text based on the target question text if it is determined that the clarity is not lower than a preset threshold; and to perform importance analysis on the target question text if it is determined that the clarity is lower than the preset threshold, and to supplement the target question text with information based on the analysis results, so as to obtain the target question text with supplemented information.
[0133] The iteration unit 204 is used to repeatedly iterate the calculation of the clarity of the target question text and subsequent steps, using the target question text with the information supplemented as the target question text again, until a preset stopping condition is reached. The target question text with the information supplemented after the iteration when the preset stopping condition is reached is used as the final target question text, so as to generate the final response text based on the final target question text.
[0134] In one implementation of this embodiment, the computing unit 202 is specifically used for:
[0135] The target question text is preprocessed using preset prompt words, and the preprocessed target question text is input into a pre-built large speech model LLM to predict the clarity of the target question text;
[0136] The large speech model LLM is trained on language rules and patterns using a large-scale language dataset through autoregressive generation. When generating new text data, the large speech model LLM predicts the probability of the next language unit based on the previously generated content until complete text data is generated.
[0137] In one implementation of this embodiment, the supplementary unit 203 includes:
[0138] A subunit is constructed to build a preset question text related to information supplementation, and the preset question text is input into a pre-constructed large speech model LLM;
[0139] The prediction subunit is used to perform importance analysis on the target question text based on the preset question text using the large speech model LLM, and predict the relevant information of the question that the target user cares about most.
[0140] The interaction subunit is used to send relevant question texts with supplementary information to the target user based on the information related to the questions that the target user cares about most, so as to realize active interaction with the target user.
[0141] The supplementary subunit is used to supplement the target question text with information related to the question that the target user cares about most and the relevant response text of the supplementary information provided by the target user after receiving the relevant response text of the supplementary information provided by the target user, so as to obtain the target question text with supplementary information.
[0142] In one implementation of this embodiment, the interaction subunit is specifically used for:
[0143] By using information related to the questions that the target user cares about most, keyword slots in the preset supplementary information related question text are filled to construct the supplementary information related question text; and the supplementary information related question text filled with keyword slots is sent to the target user to realize proactive interaction with the target user.
[0144] In one implementation of this embodiment, the value of the clarity ranges from 1 to 10; the preset threshold is 8 or 9.
[0145] In one implementation of this embodiment, the preset stopping condition includes at least one of the following: the clarity of the target question text after information supplementation is not lower than a preset threshold, and the number of iterations reaches a preset number.
[0146] In one implementation of this embodiment, the preset number of times is 1.
[0147] Furthermore, embodiments of this application also provide a text processing device, including: a processor, a memory, and a system bus;
[0148] The processor and the memory are connected via the system bus;
[0149] 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.
[0150] 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.
[0151] 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.
[0152] 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.
[0153] 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.
[0154] 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.
[0155] 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 by, The method comprises the following steps: acquiring target question text input by a target user; calculating the explicitness of the target question text and determining whether the explicitness is not lower than a preset threshold; if yes, generating a reply text according to the target question text; if no, performing importance analysis on the target question text, supplementing information in the target question text according to the analysis result, and obtaining target question text after information supplementation; repeating the calculation of the explicitness of the target question text and the subsequent steps until a preset stopping condition is reached, and taking the target question text after information supplementation obtained after the last iteration as the final target question text, so as to generate a final reply text according to the final target question text; the importance analysis on the target question text and the information supplementation of the target question text according to the analysis result to obtain target question text after information supplementation comprises the following steps: constructing a preset question text related to information supplementation, and inputting the preset question text into a pre-constructed large language model LLM; using the large language model LLM to perform importance analysis on the target question text according to the preset question text, and predicting the information related to the question most concerned by the target user; according to the information related to the question most concerned by the target user, sending a related question text for supplementing information to the target user to realize active interaction with the target user; after receiving the related reply text for supplementing information fed back by the target user, supplementing information in the target question text according to the information related to the question most concerned by the target user and the related reply text for supplementing information fed back by the target user, and obtaining target question text after information supplementation.
2. The method of claim 1, wherein, the calculation of the explicitness of the target question text comprises the following steps: using a preset prompt word to pre-process the target question text, inputting the pre-processed target question text into a pre-constructed large language model LLM, and predicting the explicitness of the target question text; wherein the large language model LLM is obtained by training language rules and patterns through autoregressive generation of a large-scale language data set, and the large language model LLM predicts the possibility of the next language unit based on the content already generated when generating new text data, until a complete text data is generated.
3. The method of claim 1, wherein, the sending of the related question text for supplementing information to the target user according to the information related to the question most concerned by the target user to realize active interaction with the target user comprises the following steps: using the information related to the question most concerned by the target user to fill in the key word slot in the pre-set related question text for supplementing information, constructing the related question text for supplementing information, and sending the related question text for supplementing information filled with key word slots to the target user to realize active interaction with the target user.
4. The method according to any one of claims 1 to 3, characterized in that, the preset stopping condition comprises at least one of the explicitness of the target question text after information supplementation being not lower than a preset threshold and the number of iterations reaching a preset number.
5. A text processing apparatus characterized by comprising: The method comprises the following steps: An acquisition unit is configured to acquire target question text input by a target user and to be answered; A calculation unit is configured to calculate the explicitness of the target question text and to determine whether the explicitness is not lower than a preset threshold; A supplement unit is configured to generate reply text based on the target question text if it is determined that the explicitness is not lower than the preset threshold; If it is determined that the explicitness is lower than the preset threshold, the target question text is subjected to importance analysis processing, and information is supplemented to the target question text based on the analysis result to obtain information-supplemented target question text; An iteration unit is configured to repeatedly execute the calculation of the explicitness of the target question text and the subsequent steps by taking the information-supplemented target question text as the target question text until a preset stopping condition is reached, and to take the information-supplemented target question text obtained after the iteration when the preset stopping condition is reached as the final target question text, so as to generate final reply text based on the final target question text. The supplement unit comprises: A construction subunit is configured to construct a preset question text related to information supplement and to input the preset question text into a pre-constructed large language model (LLM); A prediction subunit is configured to use the large language model (LLM) to perform importance analysis processing on the target question text based on the preset question text and to predict information related to the question most concerned by the target user; An interaction subunit is configured to send a question text related to the supplement of information to the target user based on the information related to the question most concerned by the target user, so as to realize active interaction with the target user; A supplement subunit is configured to supplement information to the target question text based on the information related to the question most concerned by the target user and the reply text related to the supplement of information fed back by the target user, so as to obtain information-supplemented target question text.
6. A text processing device, characterized by comprising: The method comprises the following steps: A processor, a memory, and a system bus; The processor and the memory are connected through the system bus; The memory is configured to store one or more programs, the one or more programs comprising instructions that, when executed by the processor, cause the processor to execute the method of any one of claims 1-4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions, and when the instructions run on a terminal device, the terminal device executes the method of any one of claims 1-4.
Citation Information
Patent Citations
Intelligent question and answer interaction method and device and electronic equipment
CN108073600A
Information interaction method and device based on intention recognition, equipment and storage medium
CN111104495A
Information processing method and device for intelligent chat, electronic equipment and storage equipment
CN115455158A