A dialogue text processing method and device, computer equipment and storage medium

By combining the text of the current turn of dialogue and the text of the previous turn of dialogue, and using the trained model to extract and adjust text features, the problem of inaccurate referential elimination and omission recovery in the NL2SQL dialogue task by neural network models is solved, and the accuracy of dialogue text and response text is achieved.

CN115203389BActive Publication Date: 2025-12-30TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210714756.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-22
Publication Date
2025-12-30
Estimated Expiration
2042-06-22

AI Technical Summary

Technical Problem

Existing neural network models suffer from inaccurate referencing elimination and omission recovery when processing NL2SQL dialogue tasks, leading to inaccurate dialogue.

Method used

By acquiring the text of the current round of dialogue and the previous rounds of dialogue, and using the trained text adjustment model and the trained text response model, combined with dialogue background knowledge and historical text, text feature extraction and adjustment processing are performed to improve the accuracy of text adjustment and response.

Benefits of technology

It improves the accuracy of dialogue text, ensures the accuracy of referential elimination and omission recovery in dialogue, and enhances the prediction accuracy of response text.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115203389B_ABST
    Figure CN115203389B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a dialogue text processing method and device, computer equipment and a storage medium, which can be applied to cloud technology, artificial intelligence, intelligent transportation, Internet of Vehicles and various other scenarios; the embodiments of the present application can obtain a to-be-adjusted text of a current round of dialogue, and obtain historical dialogue texts of historical round of dialogues, the historical dialogue texts including historical response texts and historical to-be-adjusted texts; target text feature information of the to-be-adjusted text is determined according to the to-be-adjusted text, the historical response texts and the historical to-be-adjusted texts; the to-be-adjusted text is adjusted according to the target text feature information, and an adjusted text of the current round of dialogue is obtained; the to-be-adjusted text is processed for response text prediction according to the adjusted text and the historical to-be-adjusted texts, and a response text of the current round of dialogue is obtained; the embodiments of the present application can improve the accuracy of the to-be-adjusted text adjustment and improve the accuracy of the response text prediction, thereby improving the accuracy of the dialogue.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence processing technology, specifically to a dialogue text processing method, apparatus, computer device, and storage medium, wherein the storage medium is a computer-readable storage medium. Background Technology

[0002] NL2SQL (NLP Language To SQL) is a type of semantic parsing task designed to transform user-input natural language questions into SQL queries that can interact with databases. It enables interaction with databases and retrieval of information using natural language. In practical scenarios, NL2SQL tasks can be applied to dialogues, such as customer service and question-and-answer tables.

[0003] For NL2SQL tasks applied in dialogue, the main problems are pronoun removal and omission recovery. Pronoun removal refers to restoring the objects that pronouns refer to in the dialogue; omission recovery refers to restoring the information that has been omitted in the dialogue.

[0004] The main problems of NL2SQL dialogue tasks are currently addressed using neural network models. However, even with neural network models, inaccurate dialogue can still occur. Summary of the Invention

[0005] This application provides a method, apparatus, computer device, and computer-readable storage medium for processing dialogue text, which can improve the accuracy of dialogue.

[0006] A dialogue text processing method, comprising:

[0007] Get the text to be adjusted in the current round of dialogue, and get the historical dialogue text of the previous rounds of dialogue. The historical dialogue text includes historical response text and historical text to be adjusted.

[0008] Based on the text to be adjusted, historical response texts, and historical texts to be adjusted, determine the target text feature information of the text to be adjusted;

[0009] Based on the target text feature information, the text to be adjusted is processed to obtain the adjusted text of the current round of dialogue;

[0010] Based on the adjusted text and the historical text to be adjusted, the response text prediction process is performed on the text to be adjusted to obtain the response text for the current round of dialogue.

[0011] Accordingly, embodiments of this application provide a dialog text processing apparatus, including:

[0012] The acquisition unit can be used to acquire the text to be adjusted in the current round of dialogue, as well as the historical dialogue text of the previous round of dialogue. The historical dialogue text includes historical response text and historical text to be adjusted.

[0013] The determining unit can be used to determine the target text feature information of the text to be adjusted based on the text to be adjusted, historical response texts, and historical texts to be adjusted.

[0014] The adjustment unit can be used to adjust the text to be adjusted based on the feature information of the target text, so as to obtain the adjusted text of the current round of dialogue;

[0015] The prediction unit can be used to predict the response text of the text to be adjusted based on the adjusted text and the historical text to be adjusted, so as to obtain the response text of the current round of dialogue.

[0016] In some embodiments, the determining unit may be specifically used to obtain target dialogue background text that matches the text to be adjusted; and to determine target text feature information of the text to be adjusted based on the target dialogue background text, the text to be adjusted, historical response text, and historical text to be adjusted.

[0017] In some embodiments, the determining unit may be specifically used to fuse the target dialogue background text, the text to be adjusted, the historical response text, and the historical text to be adjusted to obtain the fused text to be adjusted; to extract features from the fused text to obtain the feature information of the fused text to be adjusted; and to determine the target text feature information of the text to be adjusted based on the feature information of the fused text to be adjusted.

[0018] In some embodiments, the prediction unit may be used to fuse the adjusted text and the historical text to be adjusted to obtain the fused text to be predicted; and to perform response text prediction processing on the text to be adjusted based on the fused text to be predicted to obtain the response text for the current round of dialogue.

[0019] In some embodiments, the prediction unit may be used to obtain target dialogue background text that matches the text to be adjusted; and to fuse the adjusted text, the historical text to be adjusted, and the target dialogue background text to obtain the fused text to be predicted.

[0020] In some embodiments, the prediction unit may be used to fuse the adjusted text, the text to be adjusted, and the historical text to be adjusted to obtain an initial fused text to be predicted; and to determine the fused predicted text based on the initial fused text to be predicted.

[0021] In some embodiments, the adjusted text is the text obtained by adjusting the text to be adjusted using a trained text adjustment model; the dialogue text processing device further includes a first training unit, which can be used to acquire a first text sample set, the first text sample set including first text samples labeled with adjusted text tags; the first text sample is predicted using the text adjustment model to be trained to obtain predicted adjusted text; the model parameters of the text adjustment model to be trained are converged based on the predicted adjusted text and the adjusted text tags to obtain the trained text adjustment model.

[0022] In some embodiments, the response text is the text obtained by performing response text prediction processing on the text to be adjusted using a trained text response model; the dialogue text processing device further includes a second training unit, which can be used to obtain a second text sample set, the second text sample set including second text samples labeled with response text tags; the second text samples are predicted using the text response model to be trained to obtain the predicted response text; the model parameters of the text response model to be trained are converged based on the predicted response text and the response text tags to obtain the trained text response model.

[0023] Furthermore, embodiments of this application also provide a computer device, including a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute any of the dialog text processing methods provided in embodiments of this application.

[0024] Furthermore, embodiments of this application also provide a computer-readable storage medium storing a computer program adapted for loading by a processor to execute any of the dialog text processing methods provided in embodiments of this application.

[0025] Furthermore, this application also provides a computer program product, including a computer program that, when executed by a processor, implements any of the dialog text processing methods provided in this application.

[0026] Furthermore, this application also provides a computer program product, including a computer program that, when executed by a processor, implements any of the dialog text processing methods provided in this application.

[0027] This application embodiment can obtain the text to be adjusted in the current round of dialogue, as well as the historical dialogue text of previous rounds of dialogue, including historical response text and historical text to be adjusted; determine the target text feature information of the text to be adjusted based on the text to be adjusted, the historical response text, and the historical text to be adjusted; perform adjustment processing on the text to be adjusted based on the target text feature information to obtain the adjusted text of the current round of dialogue; and perform response text prediction processing on the text to be adjusted based on the adjusted text and the historical text to be adjusted to obtain the response text of the current round of dialogue. Since this application embodiment can determine the target text feature information of the text to be adjusted based on the text to be adjusted, the historical response text, and the historical text to be adjusted, the accuracy of adjusting the text to be adjusted can be improved based on the target text feature information. Furthermore, based on the adjusted text obtained from the adjustment processing and the historical text to be adjusted, the accuracy of predicting the response text can be improved, thereby improving the accuracy of the dialogue. Attached Figure Description

[0028] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0029] Figure 1 This is a schematic diagram of a scenario for the dialogue text processing method provided in the embodiments of this application;

[0030] Figure 2 This is a flowchart illustrating the dialogue text processing method provided in an embodiment of this application;

[0031] Figure 3 This is a flowchart illustrating how the target text feature information of the text to be adjusted is determined based on the text to be adjusted, historical response text, and historical text to be adjusted, according to an embodiment of this application.

[0032] Figure 4 These are two flowchart illustrations of the dialogue text processing method provided in the embodiments of this application;

[0033] Figure 5 This is a schematic diagram illustrating the training of the text-to-training adjustment model and the text-to-training response model provided in the embodiments of this application;

[0034] Figure 6 This is a schematic diagram of the data table provided in an embodiment of this application;

[0035] Figure 7 These are two schematic diagrams illustrating the training of the text-to-training adjustment model and the text-to-training response model provided in the embodiments of this application;

[0036] Figure 8 This is a schematic diagram of the structure of the dialogue text processing device provided in the embodiments of this application;

[0037] Figure 9 This is a schematic diagram of the structure of the computer device provided in the embodiments of this application. Detailed Implementation

[0038] 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, and 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.

[0039] This application provides a method, apparatus, computer device, and computer-readable storage medium for dialogue text processing. The dialogue text processing apparatus can be integrated into a computer device, which may be a server or a terminal, etc.

[0040] The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery network (CDN) acceleration services, and big data and artificial intelligence platforms. The terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, etc., but is not limited to these. The terminal and server can be directly or indirectly connected via wired or wireless communication, which is not limited herein. The embodiments of this application can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, and assisted driving.

[0041] This application relates to Artificial Intelligence (AI), which is the theory, method, technology, and application system for simulating, extending, and expanding human intelligence using digital computers or machines controlled by digital computers to perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce new intelligent machines that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to possess perception, reasoning, and decision-making capabilities.

[0042] Artificial intelligence (AI) is a comprehensive discipline encompassing a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies primarily include computer vision, speech processing, natural language processing, and machine learning / deep learning.

[0043] For example, see Figure 1 Taking the integration of a dialogue text processing device into a computer device as an example, the computer device acquires the text to be adjusted in the current round of dialogue and the historical dialogue text of the previous rounds of dialogue; based on the text to be adjusted, the historical response text, and the historical text to be adjusted, the target text feature information of the text to be adjusted is determined; based on the target text feature information, the text to be adjusted is processed to obtain the adjusted text of the current round of dialogue; based on the adjusted text and the historical text to be adjusted, the text to be adjusted is processed to predict the response text of the text to be adjusted to obtain the response text of the current round of dialogue.

[0044] The current round of dialogue can refer to at least one round of dialogue occurring within the current time period, generally referring to a round of dialogue occurring within the current time period. The previous round of dialogue can refer to at least one round of dialogue occurring within a historical time period. Both the current round and the previous round can be part of the current dialogue.

[0045] The text to be adjusted can refer to the dialogue text entered by the user; specifically, the text to be adjusted can refer to the question text entered by the user.

[0046] The historical dialogue text can include historical response text and historical text to be adjusted.

[0047] The following sections provide detailed descriptions of each example. It should be noted that the order in which the embodiments are described is not intended to limit the preferred order of the embodiments.

[0048] This embodiment will be described from the perspective of a dialogue text processing device, which can be integrated into a computer device, such as a server or a terminal. The terminal can include tablet computers, laptops, personal computers (PCs), wearable devices, virtual reality devices, or other smart devices that can acquire data.

[0049] like Figure 2 As shown, the specific flow of this dialogue text processing method is as follows: steps S101 to S104:

[0050] S101. Obtain the text to be adjusted in the current round of dialogue, and obtain the historical dialogue text of the previous rounds of dialogue.

[0051] The historical dialogue text includes historical response text and historical text to be adjusted.

[0052] The text to be adjusted can refer to the dialogue text entered by the user; specifically, it can refer to the question text entered by the user. User input methods include, but are not limited to, voice input and text input.

[0053] The current round of dialogue can refer to at least one round of dialogue that has occurred within the current time period, generally referring to a round of dialogue that has occurred within the current time period. Historical rounds of dialogue can refer to at least one round of dialogue that has occurred within a historical time period.

[0054] The method for obtaining the text to be adjusted in the current round of dialogue in this embodiment of the application can be: the computer device responds to the input operation for the current round of dialogue and obtains the text to be adjusted in the current round of dialogue.

[0055] The method for obtaining the text to be adjusted in the current round of dialogue in this embodiment of the application can also be as follows: the text acquisition device responds to the input operation for the current round of dialogue, the text acquisition device acquires the text to be adjusted in the current round of dialogue; the text acquisition device sends the text to be adjusted in the current round of dialogue to the computer device; the computer device receives the text to be adjusted in the current round of dialogue.

[0056] Of the two methods described above for obtaining the text to be adjusted in the current round of dialogue, the input operation can be a text input operation, a voice input operation, or a gesture input operation.

[0057] In this embodiment of the application, the historical dialogue text corresponding to each historical round of dialogue is stored in the database. Based on this, the implementation of this application can extract the historical dialogue text of the historical round of dialogue from the database.

[0058] S102. Based on the text to be adjusted, historical response texts, and historical texts to be adjusted, determine the target text feature information of the text to be adjusted.

[0059] In this application embodiment, there are multiple ways to determine the target text feature information of the text to be adjusted based on the text to be adjusted, historical response text, and historical text to be adjusted, as follows:

[0060] For example, such as Figure 3 As shown in the embodiments of this application, the method for determining the target text feature information of the text to be adjusted based on the text to be adjusted, historical response text, and historical text to be adjusted can be as shown in steps A1 to A2:

[0061] A1. Obtain the target dialogue background text that matches the text to be adjusted.

[0062] The target dialogue background text can refer to the background knowledge text of the dialogue corresponding to the text to be adjusted.

[0063] In this embodiment of the application, the method for obtaining the target dialogue background text that matches the text to be adjusted can be: obtaining at least one candidate dialogue background file, and filtering out the target dialogue background file that matches the text to be adjusted from the at least one candidate dialogue background file.

[0064] Candidate dialogue background files can be stored in a database or in the cloud. In this embodiment, the method for selecting a target dialogue background file matching the text to be adjusted from at least one candidate dialogue background file can be: extracting keywords from the text to be adjusted; and determining the target dialogue background file matching the text to be adjusted based on the keywords.

[0065] When the similarity between a keyword and a candidate keyword in a candidate dialogue background file is greater than a preset similarity threshold, the candidate dialogue background file can be called a target dialogue background file that matches the file to be adjusted; when a keyword is the same as a candidate keyword in a candidate dialogue background file, the candidate dialogue background file can be called a target dialogue background file that matches the file to be adjusted.

[0066] A2. Based on the target dialogue background text, the text to be adjusted, the historical response text, and the historical text to be adjusted, determine the target text feature information of the text to be adjusted.

[0067] In this embodiment of the application, the method for determining the target text feature information of the text to be adjusted based on the target dialogue background text, the text to be adjusted, the historical response text, and the historical text to be adjusted can be as follows: the target dialogue background text, the text to be adjusted, the historical response text, and the historical text to be adjusted are fused to obtain the fused text to be adjusted; features are extracted from the fused text to obtain the feature information of the fused text to be adjusted; and the target text feature information of the text to be adjusted is determined based on the feature information of the fused text to be adjusted.

[0068] In this embodiment, the method of fusing the target dialogue background text, the text to be adjusted, the historical response text, and the historical text to be adjusted to obtain the fused text to be adjusted can be as follows: directly concatenating the target dialogue background text, the text to be adjusted, the historical response text, and the historical text to be adjusted to obtain the concatenated dialogue text; using the concatenated dialogue text as the fused text to be adjusted; or obtaining a preset dialogue text; concatenating the preset dialogue text, the target dialogue background text, the text to be adjusted, the historical response text, and the historical text to be adjusted to obtain the target concatenated dialogue text; using the target concatenated dialogue text as the fused text to be adjusted.

[0069] In this embodiment of the application, the method of extracting features from the fused text to be adjusted to obtain the feature information of the fused text to be adjusted can be: using a neural network model in the existing related technologies to extract features from the fused text to obtain the feature information of the fused text to be adjusted; or the method of extracting features from the fused text to be adjusted to obtain the feature information of the fused text to be adjusted can be: using the trained text adjustment model of this embodiment of the application to extract features from the fused text to be adjusted to obtain the feature information of the fused text to be adjusted.

[0070] The above-mentioned post-training text adjustment model is a model obtained by training the text adjustment model to be trained.

[0071] For example, in this application embodiment, the method for determining the target text feature information of the text to be adjusted based on the text to be adjusted, the historical response text, and the historical text to be adjusted can be as follows: perform fusion processing on the text to be adjusted, the historical response text, and the historical text to be adjusted to obtain candidate fused dialogue text; perform feature extraction on the candidate fused dialogue text to obtain the target text feature information of the text to be adjusted.

[0072] In this embodiment of the application, the method of fusing the text to be adjusted, the historical response text, and the historical text to be adjusted to obtain the candidate fused dialogue text can be as follows: concatenating the text to be adjusted, the historical response text, and the historical text to be adjusted to obtain the candidate concatenated dialogue text; and using the candidate concatenated dialogue text as the candidate fused dialogue text.

[0073] In this embodiment of the application, the method for extracting features from the candidate fused dialogue text to obtain the target text feature information of the text to be adjusted can be: using a neural network model in existing related technologies to extract features from the candidate fused dialogue text to obtain the target text feature information of the text to be adjusted.

[0074] In this embodiment of the application, the method of extracting features from the candidate fused dialogue text to obtain the target text feature information of the text to be adjusted can also be: using the trained text adjustment model of this embodiment to extract features from the candidate fused dialogue text to obtain the target text feature information of the text to be adjusted.

[0075] S103. Based on the target text feature information, adjust the text to be adjusted to obtain the adjusted text of the current round of dialogue.

[0076] In this embodiment of the application, the adjustment method for the text to be adjusted can be either rewriting or correction.

[0077] In the embodiments of this application, when the adjustment method for the text to be adjusted is correction processing, the correction processing can be zero correction.

[0078] In this embodiment, a neural network model from existing related technologies can be used to adjust the text to be adjusted based on the target text feature information, thereby obtaining the adjusted text for the current round of dialogue.

[0079] In this embodiment, a trained text adjustment model can be used to adjust the text to be adjusted based on the target text feature information to obtain the adjusted text of the current round of dialogue.

[0080] The embodiments of this application can train the text adjustment model to be trained. The training method of the text adjustment model to be trained in the embodiments of this application can be as follows:

[0081] For example, obtain a first text sample set, which includes first text samples labeled with adjusted text tags; use the text adjustment model to be trained to predict the first text samples to obtain the predicted adjusted text; based on the predicted adjusted text and the adjusted text tags, converge the model parameters of the text adjustment model to be trained to obtain the trained text adjustment model.

[0082] S104. Based on the adjusted text and the historical text to be adjusted, perform response text prediction processing on the text to be adjusted to obtain the response text for the current round of dialogue.

[0083] The embodiment of this application can obtain the response text of the current round of dialogue by performing response text prediction processing on the text to be adjusted based on the adjusted text and the historical text to be adjusted. This can be done by: fusing the adjusted text and the historical text to be adjusted to obtain the fused text to be predicted; and performing response text prediction processing on the text to be adjusted based on the fused text to be predicted to obtain the response text of the current round of dialogue.

[0084] Among them, historical dialogue texts include historical texts to be adjusted, which can refer to the texts to be adjusted generated in the current dialogue within a historical time period.

[0085] In this embodiment, the method for fusing the adjusted text and historical dialogue text to obtain the fused text to be predicted can be as follows: obtaining the target dialogue background text that matches the text to be adjusted; fusing the adjusted text, the historical text to be adjusted, and the target dialogue background text to obtain the fused text to be predicted. For details on obtaining the target dialogue background text that matches the text to be adjusted, please refer to the foregoing description, which will not be repeated here.

[0086] In this embodiment of the application, the adjusted text, the historical text to be adjusted, and the target dialogue background text are fused to obtain the fused text to be predicted. The method is as follows: the adjusted text, the historical text to be adjusted, and the target dialogue background text are concatenated to obtain the concatenated text to be predicted; the concatenated text to be predicted is used as the fused text to be predicted.

[0087] In this embodiment of the application, the method of fusing the adjusted text, the historical text to be adjusted, and the target dialogue background text to obtain the fused text to be predicted can also be: obtaining a preset text; fusing the preset text, the adjusted text, the historical text to be adjusted, and the target dialogue background text to obtain the fused text to be predicted.

[0088] In this embodiment of the application, the method of fusing the adjusted text and the historical text to be adjusted to obtain the fused text to be predicted can also be: fusing the adjusted text, the text to be adjusted and the historical text to be adjusted to obtain the initial fused text to be predicted; and determining the fused predicted text based on the initial fused text to be predicted.

[0089] In one embodiment of this application, the adjusted text and the historical text to be adjusted are fused to obtain the fused text to be predicted. Alternatively, the adjusted text, the text to be adjusted, and the historical text to be adjusted are concatenated to obtain the initial fused text to be predicted. In another embodiment of this application, the initial fused text to be predicted can be used as the fused predicted text.

[0090] In this embodiment of the application, the method of performing response text prediction processing on the text to be adjusted based on the fused text to be predicted, and obtaining the response text of the current round of dialogue, can be as follows: using a neural network model in existing related technologies to perform response text prediction processing on the text to be adjusted based on the fused text to be predicted, and obtaining the response text of the current round of dialogue.

[0091] In this embodiment of the application, the method of performing response text prediction processing on the text to be adjusted based on the fused text to be predicted to obtain the response text of the current round of dialogue can also be: using a trained text response model to perform response text prediction processing on the text to be adjusted based on the fused text to be predicted to obtain the response text of the current round of dialogue.

[0092] The trained text response model can be a model obtained by training the text response model to be trained. In this embodiment, the text response model to be trained can be trained in the following way:

[0093] For example, a second text sample set is obtained, which includes second text samples labeled with response text tags; the text response model to be trained is used to predict the second text samples to obtain the predicted response text; based on the predicted response text and the response text tags, the model parameters of the text response model to be trained are converged to obtain the trained text response model.

[0094] This application embodiment can obtain the text to be adjusted in the current round of dialogue, as well as the historical dialogue text of previous rounds of dialogue, including historical response text and historical text to be adjusted; determine the target text feature information of the text to be adjusted based on the text to be adjusted, the historical response text, and the historical text to be adjusted; perform adjustment processing on the text to be adjusted based on the target text feature information to obtain the adjusted text of the current round of dialogue; and perform response text prediction processing on the text to be adjusted based on the adjusted text and the historical text to be adjusted to obtain the response text of the current round of dialogue. Since this application embodiment can determine the target text feature information of the text to be adjusted based on the text to be adjusted, the historical response text, and the historical text to be adjusted, the accuracy of adjusting the text to be adjusted can be improved based on the target text feature information. Furthermore, based on the adjusted text obtained from the adjustment processing and the historical text to be adjusted, the accuracy of predicting the response text can be improved, thereby improving the accuracy of the dialogue.

[0095] Based on the method described in the above embodiments, the following examples will provide further detailed explanations.

[0096] In this embodiment, the dialogue text processing device is specifically integrated into a computer device, which serves as a server.

[0097] First, it should be noted that the adjustment process performed on the text to be adjusted in this embodiment is a rewriting process.

[0098] Furthermore, it should be noted that existing related technologies have some problems when rewriting the text to be adjusted, as follows:

[0099] (1) When rewriting the text to be adjusted, the existing related technologies do not take into account the background knowledge of the current dialogue. Therefore, in the process of rewriting the text to be adjusted, it is impossible to accurately grasp the background knowledge information and give the correct rewriting result. The rewriting result includes referring to the rewriting result and / or omitting the rewriting result.

[0100] (2) When rewriting the text to be adjusted, the existing related technologies directly splice the historical dialogue text of multiple rounds as the input of the neural network model, and then directly predict the rewriting result. As the number of dialogue rounds increases, the historical dialogue text also increases, which increases the difficulty of rewriting the neural network model and results in the rewriting result of dialogues with many rounds being inaccurate.

[0101] Furthermore, it should be noted that existing related technologies predict response text by directly using the rewritten results. However, this method requires a very high accuracy rate in the rewritten results to ensure that the parsed response text is accurate. If the rewritten results are incorrect, the generated response text will also be incorrect.

[0102] Based on the above, in order to improve the accuracy of the rewritten results and the accuracy of the response text, this application proposes a dialogue text processing method, such as... Figure 4 As shown, the specific process is as follows: steps S201 to S210:

[0103] It should be noted that the dialogue text processing method proposed in this application embodiment utilizes a neural network model. This application embodiment uses two neural network models to handle different tasks. Before training the neural network models, the neural network models in this application embodiment include a text adjustment model to be trained and a text response model to be trained.

[0104] like Figure 5 The diagram illustrates the training process of the text adjustment model and the text response model in this embodiment of the application. The text adjustment model is trained to adjust the text to samples; specifically, this adjustment capability can be rewriting capability. The text response model is trained to respond to samples. The text adjustment model and the text response model are connected in series.

[0105] S201. The computer device acquires the first set of text samples.

[0106] The first text sample set includes the first text sample with the adjusted text labels.

[0107] In this embodiment, the first text sample may include question text samples corresponding to at least one round of dialogue. Specifically, in this embodiment, the first text sample may include question text samples corresponding to each round of dialogue.

[0108] S202. The computer equipment uses the text adjustment model to be trained to predict the first text sample and obtain the predicted adjusted text.

[0109] The text adjustment model to be trained can be a self-attention model, specifically, a Transformer model.

[0110] In this embodiment, the text adjustment model to be trained is used to predict the first text sample. After obtaining the prediction, there are several ways to adjust the text, as follows:

[0111] (1) First method: Obtain the target dialogue background text that matches the first text sample from the database; concatenate the first text sample and the target dialogue background text to obtain the first fused text sample, which includes the question text sample corresponding to each round of dialogue; based on the first fused text sample, use the text adjustment model to be trained to predict the question text sample of the current round of dialogue in the first text sample to obtain the predicted adjusted text of the current round of dialogue.

[0112] In order to improve the accuracy of the rewriting of the text adjustment model, this application adopts a dialogue background knowledge enhancement strategy, namely the first method, which introduces the target dialogue background text into the training process of the text adjustment model.

[0113] Since the target dialogue background text can exist in the form of a data table, it can specifically include the table name, column names, and column values ​​of the data table; more specifically, the target dialogue background text can be formed by concatenating the table name, column names, and column values ​​of the data table.

[0114] like Figure 6 As shown, the table is named "First Data Table," and its columns include "Name," "Fund Code," "Fund Type," "Redemption Settlement Time," "Redemption Fee," "Risk Level," "Purchase Restriction," "Cancellation Function," "Establishment Time," "Opening Time," "Withdrawal Limit," "Purchase Age," "Purchase Profit Date," and "Issuing Company." When the column name includes "Name," the column values ​​include "First Fund," "Second Fund," "Third Fund," and "Fourth Fund." This is only an example explanation of a portion of the data table's content.

[0115] It should be noted that the embodiments of this application can be applied to the dialogue system of an application. When it is necessary to build a data table-based dialogue system for a target domain or target background, it is necessary to extract the corresponding content from the table according to the user's question text, so as to provide the text-to-text adjustment model and the text-to-text response model for prediction.

[0116] This application embodiment utilizes an entity keyword recognition module to extract domain-relevant knowledge, effectively enhancing the domain adaptability of the text adjustment model and strengthening the application capability of NL2SQL technology in different scenarios. This is crucial for improving product adaptability. Specifically, this application embodiment can select a target dialogue background file matching the text to be adjusted from at least one candidate dialogue background file by: extracting keywords from the text to be adjusted; and determining the target dialogue background file matching the text to be adjusted based on the keywords.

[0117] In this embodiment of the application, there may be multiple data tables. For the case of multiple data tables, for example, the target dialogue background text is as shown in formula (1):

[0118]

[0119] Where K refers to the target dialogue background text; tab i This represents the name of the data table, indicating the i-th data table; col ij This represents the column name of the data table, indicating the j-th column in the i-th data table; val ijm This represents the column value of the data table, indicating the value of the m-th column in the j-th column of the i-th data table.

[0120] Based on the above, the first fused text sample of this application can be expressed as formula (2):

[0121] input1 = [K, Q] i≤t ] Formula (2)

[0122] Wherein, input1 refers to the first fused text sample; K refers to the target dialogue background text; Q i≤t This refers to the first text sample, which is the question text sample corresponding to each round of dialogue.

[0123] (2) The second method: If the current dialogue is the second dialogue, the question text samples corresponding to each dialogue in the first text sample are spliced ​​together to obtain the second fused text sample; based on the second fused text sample, the text adjustment model to be trained is used to predict the question text samples of the current dialogue in the first text sample to obtain the predicted adjusted text of the current dialogue.

[0124] Specifically, such as Figure 5 As shown, if the current round of dialogue is the second round of dialogue, then Q1 is the historical question text sample of the first round of dialogue, and Q2 is the question text sample of the second round of dialogue. The historical question text sample Q1 of the first round of dialogue and the question text sample Q2 of the second round of dialogue are concatenated to obtain the second fused text sample. Based on the second fused text sample, the text adjustment model to be trained is used to predict the question text sample Q2 of the second round of dialogue to obtain the predicted adjusted text R2 of the current round of dialogue.

[0125] If the current round of dialogue is neither the second round nor the first round, then obtain the historical predicted adjusted text corresponding to the previous rounds of dialogue; concatenate the historical predicted adjusted text and the first text sample to obtain the third fused text sample. The first text sample includes the question text sample corresponding to each round of dialogue, that is, the first text sample includes the historical question text sample corresponding to each round of dialogue in the previous rounds of dialogue and the question text sample of the current round of dialogue; based on the third fused text sample, use the text adjustment model to be trained to predict the question text sample of the current round of dialogue in the first text sample to obtain the predicted adjusted text of the current round of dialogue.

[0126] Specifically, such as Figure 5 As shown, if the current round of dialogue is neither the second nor the first round (e.g., the third round), then R2 is the predicted adjusted text of the second round, Q1 is the historical question text sample of the first round, Q2 is the historical question text sample of the second round, and Q3 is the question text sample of the third round. The predicted adjusted text R2 of the second round is obtained. The predicted adjusted text R2 of the second round, the historical question text sample Q1 of the first round, the historical question text sample Q2 of the second round, and the question text sample Q3 of the third round are concatenated to obtain the third fused text sample. Based on the third fused text sample, the text adjustment model to be trained is used to predict the question text sample of the current round in the first text sample to obtain the predicted adjusted text R3 of the current round. This process continues in the same manner, and will not be elaborated further here.

[0127] As the number of dialogue rounds increases, the accumulation of pronouns and ellipses in the historical dialogues becomes increasingly difficult for the text model to rewrite, leading to poor dialogue rewriting results. Therefore, this application's embodiment employs a recursive rewriting generation strategy, namely the second method described above. Specifically, for example, when predicting the rewriting of the question in round t, the input to the text adjustment model is a concatenation of the original question and the rewritten question from each round, i.e., a concatenation of the historical predicted adjusted text and the question text samples corresponding to each round of dialogue included in the second text sample. This process is used to train the text adjustment model. In this way, as the number of dialogue rounds increases, the accumulation of pronouns and ellipses does not increase, thus enabling the trained text adjustment model to achieve highly accurate rewriting even with a large number of rounds.

[0128] Based on the above, the second fused text sample can be expressed as formula (3):

[0129] input2=[Q1, Q2] Formula (3)

[0130] Wherein, input2 refers to the second fused text sample; Q1 refers to the historical question text sample of the first round of dialogue; and Q2 refers to the question text sample of the second round of dialogue, which is also the question text sample of the current round of dialogue.

[0131] Based on the above, the third fused text sample can be expressed as formula (4):

[0132] input3 = [Q1, {Q i R i} 1<i<t Q t ]=[Q1, Q2, R2, Q3, R3,..., Q t ] Formula (4)

[0133] Wherein, input3 refers to the third fused text sample; R i This refers to adjusting the text based on historical predictions of the i-th round of dialogue; Q i This refers to the historical question text samples from the i-th round of dialogue; Q t It refers to the question text sample of the t-th round of dialogue, that is, the question text sample of the current round of dialogue.

[0134] The third approach is to retrieve the target dialogue background text that matches the first text sample from the database. If the current dialogue is the second round, the first text sample and the target dialogue background text are concatenated to obtain the fourth fused text sample. The first text sample includes the historical question text sample of the first round and the question text sample of the second round. Based on the fourth fused text sample, the text adjustment model to be trained is used to predict the question text sample of the second round in the first text sample to obtain the predicted adjusted text of the current round.

[0135] If the current round of dialogue is neither the second round nor the first round, then obtain the historical predicted adjusted text corresponding to the previous rounds of dialogue; concatenate the historical predicted adjusted text, the first text sample, and the target dialogue background text to obtain the fifth fused text sample. The first text sample includes the historical question text samples corresponding to each round of dialogue in the previous rounds of dialogue and the question text samples of the current round of dialogue; based on the fifth fused text sample, use the text adjustment model to be trained to predict the question text samples of the current round of dialogue in the first text sample to obtain the predicted adjusted text of the current round of dialogue.

[0136] Specifically, such as Figure 7As shown, if the current dialogue is neither the second nor the first round (e.g., the third round), then R2 is the predicted adjusted text of the second round, Q1 is the historical question text sample of the first round, Q2 is the historical question text sample of the second round, and Q3 is the question text sample of the third round. The predicted adjusted text R2 of the second round is obtained. The predicted adjusted text R2 of the second round, the historical question text sample Q1 of the first round, the historical question text sample Q2 of the second round, the question text sample Q3 of the third round, and the target dialogue background text K are concatenated to obtain the fifth fused text sample. Based on the fifth fused text sample, the text adjustment model to be trained is used to predict the question text sample Q3 of the current round in the first text sample to obtain the predicted adjusted text R3 of the current round. This process continues in the same manner, and will not be elaborated further here.

[0137] The third approach is essentially a combination of the first and second approaches. That is, this application integrates background knowledge enhancement strategies and recursive rewriting generation strategies, which can achieve higher text rewriting accuracy.

[0138] Based on the above, the fourth fused text sample can be expressed as formula (5):

[0139] input4 = [K, Q1, Q2]

[0140] Wherein, input4 refers to the fourth fused text sample; K refers to the target dialogue background text; Q1 refers to the historical question text sample of the first round of dialogue; and Q2 refers to the question text sample of the second round of dialogue, which is also the question text sample of the current round.

[0141] The fifth fused text sample can be represented by formula (6):

[0142] input5 = [K, Q1, {Q i R i} 1<i<t Q t ]=[K, Q1, Q2, R2, Q3, R3,…, Q t ] Formula (6)

[0143] Wherein, input5 refers to the fifth fused text sample, R i Q i Q t For details, please refer to the description above, which will not be repeated here.

[0144] S203. The computer equipment converges the model parameters of the text adjustment model to be trained based on the predicted adjusted text and the adjusted text label, thus obtaining the trained text adjustment model.

[0145] In this embodiment, a loss function can be used to calculate a first loss value between the predicted adjusted text and the adjusted text label; the model parameters of the text adjustment model to be trained are converged based on the first loss value to obtain the trained text adjustment model.

[0146] The loss function mentioned above can be the maximum likelihood loss function, or the cross-entropy loss function, etc.

[0147] The embodiments in this application are described using the maximum likelihood function as the loss function.

[0148] For the first method, the first loss value in this application embodiment can be expressed as formula (7):

[0149] Loss1 = -logP(R) t '|[K,Q i≤t ]) Formula (7)

[0150] Where Loss1 refers to the first loss value; R t ' refers to the adjusted text label; [K, Q i≤t ] refers to the first fused text sample.

[0151] In formula (7), P(R) t '|[K,Q i≤t For an explanation of ]), please refer to formula (8):

[0152] P(R t '|[K,Q i≤t ]) = Transformer([K, Q i≤t ]) Formula (8)

[0153] Wherein, Transformer([K, Q) i≤t The term "(")" refers to using the Transformer model as the text adjustment model to be trained in this application embodiment. The Transformer model is used to predict the first fused text sample to obtain the predicted adjusted text. Then, this application embodiment can also use the Transformer model to calculate the first probability value of the predicted adjusted text for the adjusted text label.

[0154] In this embodiment, the Transformer model can be used to predict the adjusted text using beam search.

[0155] The Transformer model in this application includes an encoder-decoder structure.

[0156] For the second approach, the first loss value in this application embodiment can be expressed as formula (9):

[0157] Loss1 = -logP(R) t '|[Q1, Q2]), or -logP(R t '|[Q1,{Q i R i} 1<i<t Q t ]) Formula (9)

[0158] Where Loss1 refers to the first loss value; R t ' refers to the adjusted text label; for a detailed explanation of formula (9), please refer to the explanations of formula (3), formula (4), formula (7) and formula (8), which will not be repeated here.

[0159] For the third method, the first loss value in this application embodiment can be expressed as formula (10):

[0160] Loss1 = -logP(R) t '|[K, Q1, Q2]), or -logP(R t '|[K,Q1,{Q i R i} 1<i<t Q t ]) Formula (10)

[0161] For a detailed explanation of formula (10), please refer to the explanations of formulas (5), (6), (7) and (8), which will not be repeated here.

[0162] S204. The computer device acquires the second set of text samples.

[0163] The second text sample set includes second text samples labeled with response text tags.

[0164] In this embodiment, the second text sample may include the predicted and adjusted text described above. Specifically, the second text sample may include the target dialogue background text used to obtain the predicted and adjusted text, the question text sample of the current round of dialogue, and the historical question text sample of the previous round of dialogue. Specifically, the second text sample may include the question text sample of the current round of dialogue used to obtain the predicted and adjusted text, and the historical question text sample of the previous round of dialogue.

[0165] In addition to the above, the second text sample may also include other preset text samples.

[0166] S205. The computer equipment uses the text-to-response model to be trained to predict the second text sample and obtain the predicted response text.

[0167] The text response model to be trained can be a self-attention model; specifically, the text adjustment model to be trained can be a Transformer model.

[0168] In this application, the text-to-response model to be trained is used to predict the second text sample. There are several ways to obtain the predicted response text, as follows:

[0169] Method A: The predicted adjusted text of the current round of dialogue, the question text sample of the current round of dialogue, and the historical question text sample of the historical rounds of dialogue are concatenated in the second text sample to obtain the fused text sample to be predicted; the text response model to be trained is used to extract features from the fused text sample to be predicted to obtain the feature information of the fused text sample to be predicted; based on the feature information of the fused text sample to be predicted, the text response model to be trained is used to predict the response text to obtain the predicted response text.

[0170] Specifically, such as Figure 5 As shown, for example, when the current round of dialogue is the third round, R3 is the predicted adjusted text of the current round of dialogue, Q3 is the question text sample of the current round of dialogue, Q2 is the historical question text sample of the second round of dialogue, and Q1 is the historical question text sample of the first round of dialogue. In this embodiment, the predicted adjusted text R3 of the current round of dialogue, the question text sample Q3 of the current round of dialogue, the historical question text sample Q2 of the second round of dialogue, and the historical question text sample Q1 of the first round of dialogue are concatenated to obtain a fused text sample to be predicted. The fused text sample to be predicted is then used to extract features from the text response model to be trained to obtain feature information of the fused text sample to be predicted. Based on the feature information of the fused text sample to be predicted, the text response model to be trained is used to predict the response text to obtain the predicted response text.

[0171] Method B: The predicted adjusted text of the current round, the target dialogue background text, the question text sample of the current round, and the historical question text samples of the historical rounds are concatenated in the second text sample to obtain the fused text sample to be predicted; the text response model to be trained is used to extract features from the fused text sample to obtain the feature information of the fused text sample to be predicted; based on the feature information of the fused text sample to be predicted, the text response model to be trained is used to predict the response text to obtain the predicted response text.

[0172] Based on the above, for the B method, the fused text sample to be predicted is as shown in formula (11):

[0173] input6 = [K, Q] i ≤t, R t ] Formula (11)

[0174] Wherein, input6 refers to the fused text sample to be predicted; K refers to the target dialogue background file; Q i≤t This refers to the text samples of historical questions in previous rounds of dialogue and the text samples of questions in the current round of dialogue; R t This refers to adjusting the text after prediction.

[0175] Specifically, such as Figure 7 As shown, for example, when the current round of dialogue is the third round, R3 is the predicted adjusted text of the current round of dialogue, Q3 is the question text sample of the current round of dialogue, Q2 is the historical question text sample of the second round of dialogue, and Q1 is the historical question text sample of the first round of dialogue. In this embodiment, the predicted adjusted text R3 of the current round of dialogue, the question text sample Q3 of the current round of dialogue, the historical question text sample Q2 of the second round of dialogue, the historical question text sample Q1 of the first round of dialogue, and the target dialogue background text K in the second text sample are concatenated to obtain the fused text sample to be predicted. The fused text sample to be predicted is feature-extracted using the text response model to be trained to obtain the feature information of the fused text sample to be predicted. Based on the feature information of the fused text sample to be predicted, the text response model to be trained is used to predict the response text to obtain the predicted response text.

[0176] In order to alleviate the situation where the prediction of the response text is inaccurate due to the inaccuracy of the prediction after the text is adjusted, this embodiment of the application processes the historical question text samples of the historical round dialogue, the question text samples of the current round dialogue, and the background file of the target dialogue into the text response model to be trained.

[0177] S206. The computer equipment converges the model parameters of the text response model to be trained based on the predicted response text and the response text label, and obtains the trained text response model.

[0178] In this embodiment, a loss function can be used to calculate a second loss value between the predicted response text and the response text label; the model parameters of the trained text response model are converged based on the second loss value to obtain the trained text response model.

[0179] The loss function mentioned above can be the maximum likelihood loss function, or the cross-entropy loss function, etc.

[0180] This application uses the maximum likelihood function as the loss function and the Bth method as an example for description. The second loss value of this application embodiment can be expressed as formula (12):

[0181] Loss2 = -logP(SQL'|[K, Q) i≤t R t ]) Formula (12)

[0182] Loss2 refers to the second loss value; R t This refers to adjusting the text after prediction; [K, Q] i≤t R t [] refers to the text sample to be predicted after fusion.

[0183] In formula (12), P(SQL'|[K, Q) i≤t R t For an explanation of ]), please refer to formula (13):

[0184] P(SQL'|[K,Q i≤t R t ]) = RATSQL([K, Q i≤t R t ]]) Formula (13)

[0185] First, it should be noted that the RATSQL (Relation-aware schema encoding and linking for text-to-sql parsers) model is an improvement on the NL2SQL task in existing related technologies. NL2SQL is essentially an improvement on the Transformer architecture.

[0186] Based on the above, RATSQL([K, Q) i≤t R t The RATSQL model is used as the text response model to be trained in this application embodiment. The RATSQL model is used to perform prediction processing on the fused text sample to be predicted to obtain the predicted response text. Then, this application embodiment can also use the RATSQL model to calculate the second probability value of the predicted response text for the response text label.

[0187] Based on the above, the post-trained text response model obtained in this application embodiment will not completely predict the SQL statement of the current round, i.e. the response text, based on the post-prediction adjusted text. Instead, it will simultaneously utilize the original historical question sequence and the rewritten information obtained from the prediction, thereby mitigating the risk of relying solely on the post-prediction adjusted text.

[0188] S207. The computer device obtains the text to be adjusted in the current round of dialogue and the historical dialogue text of the previous rounds of dialogue.

[0189] The historical dialogue text includes historical response text and historical text to be adjusted.

[0190] Here, the text to be adjusted can refer to the question text entered by the user. The current round of dialogue can refer to a round of dialogue that has occurred in the current time period. The historical rounds of dialogue can refer to at least one round of dialogue that has occurred in the past time period.

[0191] The method for obtaining the text to be adjusted in the current round of dialogue in this embodiment of the application can be: the computer device responds to the input operation for the current round of dialogue and obtains the text to be adjusted in the current round of dialogue.

[0192] In this embodiment of the application, the historical dialogue text corresponding to each historical round of dialogue is stored in the database. Based on this, the implementation of this application can extract the historical dialogue text of the historical round of dialogue from the database.

[0193] S208. The computer device determines the target text feature information of the text to be adjusted based on the text to be adjusted, the historical response text, and the historical text to be adjusted.

[0194] like Figure 3 As shown in the embodiments of this application, the method for determining the target text feature information of the text to be adjusted based on the text to be adjusted, historical response text, and historical text to be adjusted can be as shown in steps A1 to A2:

[0195] A1. Obtain the target dialogue background text that matches the text to be adjusted.

[0196] In this embodiment of the application, the method for obtaining the target dialogue background text that matches the text to be adjusted can be: obtaining at least one candidate dialogue background file, and filtering out the target dialogue background file that matches the text to be adjusted from the at least one candidate dialogue background file.

[0197] Candidate dialogue background files can be stored in a database or in the cloud.

[0198] A2. Based on the target dialogue background text, the text to be adjusted, the historical response text, and the historical text to be adjusted, determine the target text feature information of the text to be adjusted.

[0199] In this embodiment of the application, the method for determining the target text feature information of the text to be adjusted based on the target dialogue background text, the text to be adjusted, the historical response text, and the historical text to be adjusted can be as follows: the target dialogue background text, the text to be adjusted, the historical response text, and the historical text to be adjusted are fused to obtain the fused text to be adjusted; features are extracted from the fused text to obtain the feature information of the fused text to be adjusted; and the target text feature information of the text to be adjusted is determined based on the feature information of the fused text to be adjusted.

[0200] In this embodiment of the application, the method of fusing the target dialogue background text, the text to be adjusted, the historical response text, and the historical text to be adjusted to obtain the fused text to be adjusted can be as follows: directly concatenate the target dialogue background text, the text to be adjusted, the historical response text, and the historical text to be adjusted to obtain the concatenated dialogue text; use the concatenated dialogue text as the fused text to be adjusted.

[0201] In this embodiment of the application, the method for extracting features from the fused text to be adjusted and obtaining the feature information of the fused text to be adjusted can be: using the trained text adjustment model of this embodiment to extract features from the fused text to be adjusted and obtain the feature information of the fused text to be adjusted.

[0202] S209. The computer device uses a trained text adjustment model to adjust the text to be adjusted based on the target text feature information, and obtains the adjusted text of the current round of dialogue.

[0203] In this embodiment of the application, the method for adjusting the text to be adjusted can be rewriting.

[0204] S210. The computer device uses the trained text response model to predict the response text of the text to be adjusted based on the adjusted text and the historical text to be adjusted, and obtains the response text of the current round of dialogue.

[0205] The embodiment of this application can obtain the response text of the current round of dialogue by performing response text prediction processing on the text to be adjusted based on the adjusted text and the historical text to be adjusted. This can be done by: fusing the adjusted text and the historical text to be adjusted to obtain the fused text to be predicted; and performing response text prediction processing on the text to be adjusted based on the fused text to be predicted to obtain the response text of the current round of dialogue.

[0206] In this embodiment of the application, the method of fusing the adjusted text and the historical dialogue text to obtain the fused text to be predicted can be as follows: obtain the target dialogue background text that matches the text to be adjusted; and fuse the adjusted text, the historical text to be adjusted, and the target dialogue background text to obtain the fused text to be predicted.

[0207] In this embodiment of the application, the adjusted text, the historical text to be adjusted, and the target dialogue background text are fused to obtain the fused text to be predicted. The method is as follows: the adjusted text, the historical text to be adjusted, and the target dialogue background text are concatenated to obtain the concatenated text to be predicted; the concatenated text to be predicted is used as the fused text to be predicted.

[0208] In this embodiment of the application, the method of fusing the adjusted text and the historical text to be adjusted to obtain the fused text to be predicted can also be: fusing the adjusted text, the text to be adjusted and the historical text to be adjusted to obtain the initial fused text to be predicted; and determining the fused predicted text based on the initial fused text to be predicted.

[0209] Specifically, in this embodiment of the application, dialogue-based queries can be performed via a mini-program. Table 1 shows the question text and corresponding response text in multi-turn dialogues. In Table 1, the SQL statement refers to the statement predicted by the trained text-response model for generating the response text.

[0210]

[0211] Table 1

[0212] In summary, the embodiments of this application have the following advantages:

[0213] A. The background database knowledge that multi-turn dialogues depend on, i.e. the background text of the target dialogue, is added to the training of the text adjustment model to be trained. The resulting trained text adjustment model solves the shortcomings of existing solutions that cannot accurately grasp the domain background information in order to give the correct reference / omission rewriting results.

[0214] B. A recursive rewriting generation strategy is adopted to predict the rewriting of the text to be adjusted in each round, which solves the problem that as the number of dialogue rounds increases, the rewriting difficulty of the trained text adjustment model increases, resulting in poor rewriting effect for dialogues with many rounds.

[0215] C. The adjusted text predicted by the post-trained text adjustment model, the historical text to be adjusted, the text to be adjusted, and the target dialogue background text are fused and input into the post-trained text response model to alleviate the situation where the error in the prediction of the post-trained text adjustment model is passed to the post-trained text response model, resulting in the generation of incorrect response text.

[0216] D. By using the rewritten results of the current round of questions, i.e., adjusting the text after prediction, the text response model to be trained can focus more on converting natural text into SQL statements during the training process, thereby improving the ability of the text response model after training.

[0217] This application embodiment can obtain the text to be adjusted in the current round of dialogue, as well as the historical dialogue text of previous rounds of dialogue, including historical response text and historical text to be adjusted; determine the target text feature information of the text to be adjusted based on the text to be adjusted, the historical response text, and the historical text to be adjusted; perform adjustment processing on the text to be adjusted based on the target text feature information to obtain the adjusted text of the current round of dialogue; and perform response text prediction processing on the text to be adjusted based on the adjusted text and the historical text to be adjusted to obtain the response text of the current round of dialogue. Since this application embodiment can determine the target text feature information of the text to be adjusted based on the text to be adjusted, the historical response text, and the historical text to be adjusted, the accuracy of adjusting the text to be adjusted can be improved based on the target text feature information. Furthermore, based on the adjusted text obtained from the adjustment processing and the historical text to be adjusted, the accuracy of predicting the response text can be improved, thereby improving the accuracy of the dialogue.

[0218] To better implement the above methods, this application also provides a dialog text processing device, which can be integrated into a computer device, such as a server or terminal. The terminal may include a tablet computer, a laptop computer, and / or a personal computer.

[0219] For example, such as Figure 8 As shown, the dialogue text processing device may include an acquisition unit 301, a determination unit 302, an adjustment unit 303, a prediction unit 304, a first training unit 305, and a second training unit 306, as follows:

[0220] (1) Obtain unit 301;

[0221] The acquisition unit 301 can be used to acquire the text to be adjusted in the current round of dialogue, as well as the historical dialogue text of the historical rounds of dialogue. The historical dialogue text includes historical response text and historical text to be adjusted.

[0222] (2) Determine unit 302;

[0223] The determining unit 302 can be used to determine the target text feature information of the text to be adjusted based on the text to be adjusted, the historical response text, and the historical text to be adjusted.

[0224] In some embodiments, the determining unit 302 may be specifically used to obtain target dialogue background text that matches the text to be adjusted; and to determine the target text feature information of the text to be adjusted based on the target dialogue background text, the text to be adjusted, historical response text, and historical text to be adjusted.

[0225] In some embodiments, the determining unit 302 may be specifically used to fuse the target dialogue background text, the text to be adjusted, the historical response text, and the historical text to be adjusted to obtain the fused text to be adjusted; to extract features from the fused text to obtain the feature information of the fused text to be adjusted; and to determine the target text feature information of the text to be adjusted based on the feature information of the fused text to be adjusted.

[0226] (3) Adjustment unit 303;

[0227] The adjustment unit 303 can be used to adjust the text to be adjusted based on the target text feature information to obtain the adjusted text of the current round of dialogue.

[0228] (4) Prediction unit 304;

[0229] The prediction unit 304 can be used to perform response text prediction processing on the text to be adjusted based on the adjusted text and the historical text to be adjusted, so as to obtain the response text of the current round of dialogue.

[0230] In some embodiments, the prediction unit 304 may be specifically used to fuse the adjusted text and the historical text to be adjusted to obtain the fused text to be predicted; and to perform response text prediction processing on the text to be adjusted based on the fused text to be predicted to obtain the response text of the current round of dialogue.

[0231] In some embodiments, the prediction unit 304 may be specifically used to obtain target dialogue background text that matches the text to be adjusted; and to fuse the adjusted text, the historical text to be adjusted, and the target dialogue background text to obtain the fused text to be predicted.

[0232] In some embodiments, the prediction unit 304 may be specifically used to fuse the adjusted text, the text to be adjusted, and the historical text to be adjusted to obtain an initial fused text to be predicted; and to determine the fused predicted text based on the initial fused text to be predicted.

[0233] (5) First training unit 305;

[0234] The adjusted text is obtained by adjusting the text to be adjusted using the trained text adjustment model; the first training unit 305 can be used to obtain a first text sample set, which includes first text samples labeled with adjusted text tags; the first text samples are predicted using the text adjustment model to be trained to obtain the predicted adjusted text; based on the predicted adjusted text and the adjusted text tags, the model parameters of the text adjustment model to be trained are converged to obtain the trained text adjustment model.

[0235] (6) Second training unit 306;

[0236] The response text is obtained by using the trained text response model to predict the response text of the text to be adjusted; the second training unit 306 can be used to obtain a second text sample set, which includes second text samples labeled with response text tags; the text response model to be trained is used to predict the second text samples to obtain the predicted response text; based on the predicted response text and the response text tags, the model parameters of the text response model to be trained are converged to obtain the trained text response model.

[0237] As can be seen from the above, the acquisition unit 301 of this application embodiment can be used to acquire the text to be adjusted in the current round of dialogue, and to acquire the historical dialogue text of the historical round of dialogue, the historical dialogue text including historical response text and historical text to be adjusted; the determination unit 302 can be used to determine the target text feature information of the text to be adjusted based on the text to be adjusted, the historical response text, and the historical text to be adjusted; the adjustment unit 303 can be used to perform adjustment processing on the text to be adjusted based on the target text feature information to obtain the adjusted text of the current round of dialogue; the prediction unit 304 can be used to perform response text prediction processing on the text to be adjusted based on the adjusted text and the historical text to be adjusted to obtain the response text of the current round of dialogue; since this application embodiment can determine the target text feature information of the text to be adjusted based on the text to be adjusted, the historical response text, and the historical text to be adjusted, the accuracy of adjusting the text to be adjusted can be improved based on the target text feature information, and further, the accuracy of predicting the response text can be improved based on the adjusted text obtained from the adjustment processing and the historical text to be adjusted, thereby improving the accuracy of the dialogue.

[0238] This application also provides a computer device, such as... Figure 9 As shown, it illustrates a structural schematic diagram of the computer device involved in the embodiments of this application, specifically:

[0239] The computer device may include components such as a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will understand that... Figure 9 The computer device structure shown does not constitute a limitation on the computer device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:

[0240] The processor 401 is the control center of the computer device, connecting various parts of the computer device through various interfaces and lines. It performs various functions and processes data by running or executing software programs and / or modules stored in the memory 402, and by calling data stored in the memory 402. Optionally, the processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and computer programs, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 401.

[0241] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, computer programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.

[0242] The computer device also includes a power supply 403 that supplies power to the various components. Preferably, the power supply 403 can be logically connected to the processor 401 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 403 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0243] The computer device may also include an input unit 404, which can be used to receive input digital or character information communication, and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

[0244] Although not shown, the computer device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 401 in the computer device loads the executable files corresponding to the processes of one or more computer programs into the memory 402 according to the following instructions, and the processor 401 runs the computer programs stored in the memory 402 to realize various functions, as follows:

[0245] Get the text to be adjusted in the current round of dialogue, and get the historical dialogue text of the previous rounds of dialogue. The historical dialogue text includes historical response text and historical text to be adjusted.

[0246] Based on the text to be adjusted, historical response texts, and historical texts to be adjusted, determine the target text feature information of the text to be adjusted;

[0247] Based on the target text feature information, the text to be adjusted is processed to obtain the adjusted text of the current round of dialogue;

[0248] Based on the adjusted text and the historical text to be adjusted, the response text prediction process is performed on the text to be adjusted to obtain the response text for the current round of dialogue.

[0249] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0250] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by a computer program, or by a computer program controlling related hardware. The computer program can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0251] Therefore, embodiments of this application provide a computer-readable storage medium storing a computer program that can be loaded by a processor to execute any of the dialog text processing methods provided in embodiments of this application.

[0252] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0253] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0254] Since the instructions stored in the computer-readable storage medium can execute the steps in any of the dialog text processing methods provided in the embodiments of this application, the beneficial effects that any of the dialog text processing methods provided in the embodiments of this application can achieve can be realized, as detailed in the preceding embodiments, and will not be repeated here.

[0255] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various optional implementations of the above embodiments.

[0256] The foregoing has provided a detailed description of a dialog text processing method, apparatus, computer device, and computer-readable storage medium provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method of processing dialogue text, characterized by, The method comprises the following steps: obtaining the to-be-adjusted text of the current round of dialogue, and obtaining the historical dialogue text of the historical round of dialogue, wherein the historical dialogue text comprises historical response text and historical to-be-adjusted text; determining target text feature information of the to-be-adjusted text according to the to-be-adjusted text, the historical response text and the historical to-be-adjusted text; adjusting the to-be-adjusted text according to the target text feature information to obtain adjusted text of the current round of dialogue; performing response text prediction processing on the to-be-adjusted text according to the adjusted text and the historical to-be-adjusted text to obtain response text of the current round of dialogue, comprising: performing fusion processing on the adjusted text and the historical to-be-adjusted text to obtain fused to-be-predicted text; performing response text prediction processing on the to-be-adjusted text according to the fused to-be-predicted text to obtain response text of the current round of dialogue.

2. The dialog text processing method of claim 1, wherein, The method comprises the following steps: obtaining target dialogue background text matched with the to-be-adjusted text; determining target text feature information of the to-be-adjusted text according to the target dialogue background text, the to-be-adjusted text, the historical response text and the historical to-be-adjusted text.

3. The dialog text processing method of claim 2, wherein, The method comprises the following steps: performing fusion processing on the target dialogue background text, the to-be-adjusted text, the historical response text and the historical to-be-adjusted text to obtain fused to-be-adjusted text; performing feature extraction on the fused to-be-adjusted text to obtain fused to-be-adjusted text feature information; determining the target text feature information of the to-be-adjusted text according to the fused to-be-adjusted text feature information.

4. The dialog text processing method of claim 1, wherein, The method comprises the following steps: obtaining target dialogue background text matched with the to-be-adjusted text; performing fusion processing on the adjusted text, the historical to-be-adjusted text and the target dialogue background text to obtain the fused to-be-predicted text.

5. The dialog text processing method of claim 1, wherein, The method comprises the following steps: performing fusion processing on the adjusted text, the to-be-adjusted text and the historical to-be-adjusted text to obtain initial fused to-be-predicted text; determining the fused to-be-predicted text according to the initial fused to-be-predicted text.

6. The dialog text processing method of claim 1, wherein, The adjusted text is a text obtained by adjusting the to-be-adjusted text by using a trained text adjustment model; before adjusting the to-be-adjusted text according to the target text feature information, the method further comprises the following steps: obtaining a first text sample set comprising first text samples labeled with adjusted text labels; performing prediction processing on the first text samples by using a to-be-trained text adjustment model to obtain predicted adjusted text; Converge the model parameters of the text adjustment model to be trained according to the predicted post-adjustment text and the post-adjustment text label, to obtain a trained text adjustment model.

7. The dialog text processing method of claim 1, wherein, The response text is a text obtained by performing response text prediction processing on the text to be adjusted by using the trained text response model. Before the response text prediction processing on the text to be adjusted according to the post-adjustment text and the historical text to be adjusted, the method further comprises: obtaining a second text sample set comprising second text samples labeled with response text labels; performing prediction processing on the second text samples by using a text response model to be trained, to obtain predicted post-adjustment texts; converging the model parameters of the text response model to be trained according to the predicted post-adjustment texts and the response text labels, to obtain a trained text response model.

8. A dialogue text processing apparatus characterized by comprising: comprises: an obtaining unit, configured to obtain a text to be adjusted of a current round of dialogue, and obtain historical dialogue texts of historical rounds of dialogue, the historical dialogue texts comprising historical response texts and historical texts to be adjusted; a determining unit, configured to determine target text feature information of the text to be adjusted according to the text to be adjusted, the historical response texts and the historical texts to be adjusted; an adjusting unit, configured to perform adjustment processing on the text to be adjusted according to the target text feature information, to obtain a post-adjustment text of the current round of dialogue; a prediction unit, configured to perform response text prediction processing on the text to be adjusted according to the post-adjustment text and the historical text to be adjusted, to obtain a response text of the current round of dialogue, comprising: performing fusion processing on the post-adjustment text and the historical text to be adjusted, to obtain a post-fusion text to be predicted; performing response text prediction processing on the text to be adjusted according to the post-fusion text to be predicted, to obtain the response text of the current round of dialogue.

9. The dialogue text processing apparatus according to claim 8, characterized in that, The determining unit is specifically configured to obtain a target dialogue background text matched with the text to be adjusted; and determine the target text feature information of the text to be adjusted according to the target dialogue background text, the text to be adjusted, the historical response texts and the historical texts to be adjusted.

10. The dialogue text processing apparatus according to claim 9, characterized in that, The determining unit is specifically configured to perform fusion processing on the target dialogue background text, the text to be adjusted, the historical response texts and the historical texts to be adjusted, to obtain a post-fusion text to be adjusted; perform feature extraction on the post-fusion text to be adjusted, to obtain post-fusion text feature information of the post-fusion text to be adjusted; and determine the target text feature information of the text to be adjusted according to the post-fusion text feature information of the post-fusion text to be adjusted.

11. The dialog text processing apparatus according to claim 8, characterized by, The prediction unit is specifically configured to obtain a target dialogue background text matched with the text to be adjusted; and perform fusion processing on the post-adjustment text, the historical text to be adjusted and the target dialogue background text, to obtain a post-fusion text to be predicted.

12. The dialog text processing apparatus according to claim 8, characterized by, The prediction unit is specifically configured to perform fusion processing on the post-adjustment text, the text to be adjusted and the historical text to be adjusted, to obtain an initial post-fusion text to be predicted; and determine the post-fusion text to be predicted according to the initial post-fusion text to be predicted.

13. The dialog text processing apparatus according to claim 8, characterized by, The dialogue text processing apparatus further comprises a first training unit; The first training unit is configured to obtain a first text sample set, the first text sample set comprising first text samples labeled with adjusted text labels; perform prediction processing on the first text samples by using a to-be-trained text adjustment model to obtain predicted adjusted texts; and perform convergence on model parameters of the to-be-trained text adjustment model according to the predicted adjusted texts and the adjusted text labels, to obtain a trained text adjustment model; wherein the adjusted text is a text obtained by performing adjustment processing on a to-be-adjusted text by using the trained text adjustment model.

14. The dialog text processing apparatus according to claim 8, characterized by, The dialogue text processing apparatus further comprises a second training unit. The second training unit is configured to obtain a second text sample set, the second text sample set comprising second text samples labeled with response text labels; perform prediction processing on the second text samples by using a to-be-trained text response model to obtain predicted response texts; and perform convergence on model parameters of the to-be-trained text response model according to the predicted response texts and the response text labels, to obtain a trained text response model; wherein the response text is a text obtained by performing response text prediction processing on a to-be-adjusted text by using the trained text response model.

15. A computer device, comprising: The computer readable storage medium stores a computer program, and the computer program is adapted to be loaded by the processor to execute the dialogue text processing method according to any one of claims 1 to 7.

16. A computer readable storage medium characterized by: The computer readable storage medium stores a computer program, and the computer program is adapted to be loaded by the processor to execute the dialogue text processing method according to any one of claims 1 to 7.

17. A computer program product, characterised in that, The computer program product stores a computer program, and the computer program is adapted to be loaded by the processor to execute the dialogue text processing method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Context-based multi-round dialogue method and device, equipment and storage medium

    CN111108501A

  • Man-machine dialog method and device, equipment and storage medium

    CN112100354A