Data processing method and device, electronic equipment and storage medium
By segmenting and rewriting multi-turn dialogues, deletion and insertion instructions are generated, solving the problems of low rewriting efficiency and incorrect intent recognition in existing technologies, and achieving efficient and accurate rewriting of user requests.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2022-08-09
- Publication Date
- 2026-04-28
AI Technical Summary
Existing technologies suffer from problems such as large search space, long time consumption, and easy errors in intent recognition during the rewriting of user requests in multi-turn dialogues, especially when the user request has a strong purpose, the generation process is difficult to control.
By segmenting historical dialogue information and current request information, and using a preset request rewriting model for rewriting analysis, instruction information for deletion, start insertion, and end insertion is generated to guide the rewriting process, reduce the search space, and improve efficiency.
It improves rewriting efficiency, ensures that the rewriting process is faithful to the dialogue history, reduces the possibility of incorrect or missed modifications, and enhances the accuracy of user intent recognition.
Smart Images

Figure CN115357695B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of artificial intelligence technology, and in particular to a data processing method, apparatus, electronic device, and storage medium. Background Technology
[0002] In the field of dialogue systems, accurately understanding user requests in multi-turn conversations is a crucial topic of widespread interest in both academia and industry. Real users often omit previously mentioned information or use pronouns to replace entities in previous requests during multi-turn conversations. These omissions and pronoun references in multi-turn conversations pose significant challenges to understanding user requests.
[0003] Existing technologies all use a sequence-to-sequence generation approach to rewrite user requests. This involves sequentially inputting the dialogue history into an encoder, placing the user request to be rewritten at the end, and then having a decoder generate a complete user request with supplementary information. However, generating a complete user request requires the model to select the correct words from a massive vocabulary and assemble them into a coherent sentence, resulting in an extremely large search space. This makes the aforementioned methods unsuitable for the time and storage requirements of online business systems. Secondly, in dialogue systems, user requests are highly purposeful, and even minor errors during rewriting can lead to misidentification of intent. The uncontrollable generation direction and extremely large search space in the aforementioned solutions may result in errors in the generated user requests, preventing the semantic understanding module in the dialogue system from capturing the true user intent. Summary of the Invention
[0004] In view of the aforementioned technical problems, this disclosure proposes a data processing method, apparatus, electronic device, and storage medium.
[0005] According to one aspect of the embodiments of this disclosure, a data processing method is provided, including:
[0006] Retrieve historical dialogue information and current request information;
[0007] The historical dialogue information and the current request information are segmented to obtain at least one first segmentation corresponding to the historical dialogue information and at least one second segmentation corresponding to the current request information.
[0008] Based on the at least one first word segment, the at least one second word segment is rewritten and analyzed to obtain target rewriting information. The target rewriting information includes deletion indication information corresponding to any second word segment, start insertion indication information corresponding to any second word segment, and end insertion indication information corresponding to any second word segment. The start insertion indication information represents the starting word segment in the at least one first word segment before the insertion of any second word segment; the end insertion indication information represents the ending word segment in the at least one first word segment before the insertion of any second word segment.
[0009] Based on the deletion instruction information, the start insertion instruction information, and the end insertion instruction information, the current request information is rewritten to obtain the target request information corresponding to the current request information.
[0010] According to another aspect of the embodiments of this disclosure, a data processing apparatus is provided, comprising:
[0011] The information acquisition module is used to acquire historical dialogue information and current request information;
[0012] The word segmentation processing module is used to perform word segmentation processing on the historical dialogue information and the current request information to obtain at least one first word corresponding to the historical dialogue information and at least one second word corresponding to the current request information.
[0013] The rewriting analysis module is used to perform rewriting analysis on the at least one second word based on the at least one first word to obtain target rewriting information. The target rewriting information includes deletion indication information corresponding to any second word, start insertion indication information corresponding to any second word, and end insertion indication information corresponding to any second word. The start insertion indication information represents the starting word in the at least one first word before the insertion of any second word; the end insertion indication information represents the ending word in the at least one first word before the insertion of any second word.
[0014] The rewriting module is used to rewrite the current request information based on the deletion instruction information, the start insertion instruction information, and the end insertion instruction information to obtain the target request information corresponding to the current request information.
[0015] According to another aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement the data processing method described above.
[0016] According to another aspect of the present disclosure, a computer-readable storage medium is provided, which, when the instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to perform the above-described data processing method.
[0017] According to another aspect of the present disclosure, a computer program product containing instructions is provided that, when run on a computer, causes the computer to perform the above-described data processing method.
[0018] The technical solutions provided by the embodiments of this disclosure have at least the following beneficial effects:
[0019] By segmenting historical dialogue information and current request information, at least one first segment corresponding to the historical dialogue information and at least one second segment corresponding to the current request information are obtained. Based on at least one first segment, at least one second segment is rewritten and analyzed to obtain target rewritten information including deletion indication information, start insertion indication information, and end insertion indication information. Thus, the segment for rewriting the current request information can be directly determined from the historical dialogue information, avoiding the process of searching for the most suitable words from a huge vocabulary, greatly reducing the search space, and improving the rewriting efficiency of the current request information. Furthermore, by combining deletion indication information that indicates whether to perform a deletion operation, start insertion indication information that represents the start segment before inserting any second segment in at least one first segment, and end insertion indication information that represents the end segment before inserting any second segment in at least one first segment, the current request information can be rewritten. Based on simple operations such as adding, deleting, and modifying, the convenience and efficiency of rewriting can be greatly improved. At the same time, the rewriting process can be guaranteed to be faithful to the dialogue history, greatly reducing the possibility of incorrect or missed modifications, thereby improving the accuracy of the user intent represented by the target request information.
[0020] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0021] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.
[0022] Figure 1 This is a schematic diagram illustrating an application system according to an exemplary embodiment;
[0023] Figure 2 This is a flowchart illustrating a data processing method according to an exemplary embodiment;
[0024] Figure 3This is a flowchart illustrating a method for rewriting and analyzing at least one second word based on at least one first word to obtain target rewritten information, according to an exemplary embodiment.
[0025] Figure 4 This is a flowchart illustrating an exemplary embodiment of a method for inputting at least one first segmentation word and at least one second segmentation word into a preset request rewriting model for rewriting prediction processing to obtain deletion instruction information, target start statistics information corresponding to any second segmentation word, and target end statistics information corresponding to any second segmentation word.
[0026] Figure 5 This is a flowchart illustrating a method for determining start insertion indication information and end insertion indication information based on target start statistics and target end statistics, according to an exemplary embodiment.
[0027] Figure 6 This is a flowchart illustrating a method for training a preset request rewriting model according to an exemplary embodiment;
[0028] Figure 7 This is a flowchart illustrating a method for rewriting current request information based on deletion instruction information, start insertion instruction information, and end insertion instruction information to obtain target request information corresponding to the current request information, according to an exemplary embodiment.
[0029] Figure 8 This is a schematic diagram illustrating the input and output of a preset request rewriting model according to an exemplary embodiment;
[0030] Figure 9 This is a schematic diagram illustrating a preset request rewriting model according to an exemplary embodiment;
[0031] Figure 10 This is a block diagram illustrating a data processing apparatus according to an exemplary embodiment;
[0032] Figure 11 This is a block diagram illustrating an electronic device for rewriting current request information according to an exemplary embodiment;
[0033] Figure 12 This is a block diagram illustrating another electronic device for rewriting current request information according to an exemplary embodiment. Detailed Implementation
[0034] Various exemplary embodiments, features, and aspects of this application will now be described in detail with reference to the accompanying drawings. The same reference numerals in the drawings denote elements that have the same or similar functions. Although various aspects of the embodiments are shown in the drawings, they are not necessarily drawn to scale unless specifically indicated otherwise.
[0035] The term “exemplary” as used herein means “serving as an example, embodiment, or illustration.” Any embodiment illustrated herein as “exemplary” is not necessarily to be construed as superior to or better than other embodiments.
[0036] Furthermore, to better illustrate this application, numerous specific details are provided in the following detailed embodiments. Those skilled in the art should understand that this application can be implemented without certain specific details. In some instances, methods, means, components, and circuits well-known to those skilled in the art have not been described in detail in order to highlight the main points of this application.
[0037] Artificial intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or computers-controlled machines to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. AI software technology mainly includes computer vision, speech processing, natural language processing, and machine learning / deep learning.
[0038] In recent years, with the research and progress of artificial intelligence technology, it has been widely applied in many fields. The solutions provided in this application involve technologies such as machine learning / deep learning, which are specifically illustrated through the following embodiments:
[0039] Please see Figure 1 , Figure 1 This is a schematic diagram illustrating an application system according to an exemplary embodiment. The application system can be used in the data processing method of this application. Figure 1 As shown, the application system may include at least server 01 and terminal 02.
[0040] In this embodiment, server 01 can be a server for a dialogue platform. Specifically, the server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides 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, CDN, and big data and artificial intelligence platforms.
[0041] In this embodiment, terminal 02 can be a user terminal that generates the current request information. The user terminal may include physical devices such as smartphones, desktop computers, tablets, laptops, smart speakers, in-vehicle terminals, digital assistants, augmented reality (AR) / virtual reality (VR) devices, and smart wearable devices, and may also include software running on the physical device, such as applications. The operating system running on the user terminal in this embodiment may include, but is not limited to, Android, iOS, Linux, and Windows.
[0042] In addition, it should be noted that, Figure 1 The example shown is merely one application environment provided by this disclosure. In practical applications, other application environments may also be included. For example, a dialogue platform may also be implemented on terminal 02.
[0043] In the embodiments described in this specification, the terminal 02 and the server 01 can be directly or indirectly connected through wired or wireless communication, and this application does not limit this connection.
[0044] It should be noted that the following diagram shows one possible sequence of steps, and it is not strictly necessary to follow this order. Some steps can be executed in parallel without interdependence.
[0045] Specifically, Figure 2 This is a flowchart illustrating a data processing method according to an exemplary embodiment. For example... Figure 2 As shown, this data processing method is used in electronic devices such as terminals or servers, and includes the following steps:
[0046] In step S201, historical dialogue information and current request information are obtained.
[0047] In one specific embodiment, historical dialogue information can be used to provide a reference for rewriting the current request information. Historical dialogue information can include dialogue information between the target requester and the dialogue platform prior to the time corresponding to the current request information. Specifically, the target requester can be the user account that edited and generated the current request information. The current request information can refer to the request information currently to be rewritten.
[0048] In one specific embodiment, the historical dialogue information can be retrieved from a preset memory in the server. Specifically, dialogue information prior to the current moment during the dialogue process can be stored as historical dialogue information in the preset memory of the server. The current request information can be generated and sent by the terminal.
[0049] In step S203, the historical dialogue information and the current request information are segmented to obtain at least one first segment corresponding to the historical dialogue information and at least one second segment corresponding to the current request information.
[0050] In one specific embodiment, by segmenting the historical dialogue information, at least one first segment can be obtained; by segmenting the current request information, at least one second segment can be obtained. Specifically, a pre-trained segmenter can be used to segment the historical dialogue information and the current request information respectively, to obtain at least one first segment corresponding to the historical dialogue information and at least one second segment corresponding to the current request information.
[0051] In step S205, at least one second word is rewritten and analyzed based on at least one first word to obtain the target rewritten information.
[0052] In one specific embodiment, the target rewriting information may include deletion indication information corresponding to any second segment, start insertion indication information corresponding to any second segment, and end insertion indication information corresponding to any second segment. The deletion indication information can be used to indicate whether a deletion operation should be performed. The start insertion indication information can represent the starting segment in at least one first segment before the insertion of any second segment. The starting segment can refer to the segment located at the beginning of the segment sequence before being inserted into any second segment. The start insertion indication information can be the identifier information of the starting segment or the identifier information corresponding to a non-insertion operation. The end insertion indication information can represent the ending segment in at least one first segment before the insertion of any second segment. The ending segment can refer to the segment located at the end of the segment sequence before being inserted into any second segment. The end insertion indication information can be the identifier information of the ending segment or the identifier information corresponding to a non-insertion operation.
[0053] In a specific embodiment, such as Figure 3 As shown, step S205 above may include:
[0054] S301. Input at least one first segmentation word and at least one second segmentation word into a preset request rewriting model for rewriting prediction processing to obtain deletion instruction information, target start statistics information corresponding to any second segmentation word, and target end statistics information corresponding to any second segmentation word.
[0055] S303. Based on the target start statistics and target end statistics, determine the start insertion instruction and the end insertion instruction.
[0056] In a specific embodiment, the target starting statistics can characterize the probability that any first word is the starting word corresponding to any second word. The target starting statistics can include the starting execution probability corresponding to a non-insertion operation and the starting insertion probability corresponding to at least one first word; the starting execution probability can be the probability that no first word is inserted before any second word; the starting insertion probability can be the probability that at least one first word is the starting word inserted before any second word.
[0057] In a specific embodiment, the target end statistics can characterize the probability that any first segmentation is the end segmentation corresponding to any second segmentation. The target end statistics can include the end execution probability corresponding to a non-insertion operation and the end insertion probability corresponding to at least one first segmentation; the end execution probability can be the probability that no first segmentation is inserted before any second segmentation; the end insertion probability can be the probability that at least one first segmentation is the end segmentation inserted before any second segmentation.
[0058] In one specific embodiment, the preset request rewriting model may include a feature extraction sub-model and a perceptron mapping sub-model.
[0059] In a specific embodiment, such as Figure 4 As shown, step S301 above may include:
[0060] S401. Input at least one first word and at least one second word into the feature extraction sub-model for feature extraction processing to obtain first semantic feature information corresponding to at least one first word and second semantic feature information corresponding to at least one second word.
[0061] In one specific embodiment, the first semantic feature information corresponding to each first word can characterize the semantics of the first word. The second semantic feature information corresponding to each second word can characterize the semantics of the second word. Optionally, the first semantic feature information and the second semantic feature information can be semantic feature vectors.
[0062] In one specific embodiment, the aforementioned feature extraction sub-model can be obtained by pre-training the text representation model with feature extraction capabilities. Optionally, the aforementioned text representation model can be a BERT (Bidirectional Encoder Representation from Transformers, Language Representation Model) model.
[0063] S403. Input the first semantic feature information and the second semantic feature information into the perceptron mapping sub-model for mapping processing to obtain deletion instruction information, target start statistics information and target end statistics information.
[0064] In a specific embodiment, the aforementioned perceptron mapping sub-model may include three multilayer perceptrons that do not share parameters, namely a first multilayer perceptron, a second multilayer perceptron, and a third multilayer perceptron. Specifically, the first semantic feature information and the second semantic feature information can be input into the three multilayer perceptrons respectively; by inputting the first and second semantic feature information into the first multilayer perceptron for word segmentation deletion learning, deletion indication information can be obtained; by inputting the first and second semantic feature information into the second multilayer perceptron for initial insertion word segmentation learning, target initial statistical information can be obtained; by inputting the first and second semantic feature information into the third multilayer perceptron for final insertion word segmentation learning, target final statistical information can be obtained.
[0065] In a specific embodiment, such as Figure 5 As shown, step S303 above may include:
[0066] S501. When the starting execution probability is not the maximum probability in the target starting statistics and the ending execution probability is not the maximum probability in the target ending statistics, the first segment corresponding to the maximum probability in the target starting statistics corresponding to any second segment is taken as the starting segment corresponding to any second segment.
[0067] S503. Generate start insertion indication information based on the starting word corresponding to any second word segmentation;
[0068] S505. Take the first segment with the highest probability in the target end statistics information corresponding to any second segment as the end segment corresponding to any second segment;
[0069] S507. Generate end insertion indication information based on the end segment corresponding to any second segment.
[0070] In a specific embodiment, if the starting execution probability is the maximum probability in the target starting statistics or the ending execution probability is the maximum probability in the target ending statistics, it can be determined that no insertion operation is performed before the second word segmentation. The starting insertion indication information corresponding to the second word segmentation can be the identification information of non-insertion operation, and correspondingly, the ending insertion indication information corresponding to the second word segmentation can be the identification information of non-insertion operation.
[0071] In a specific embodiment, such as Figure 6 As shown, the above method may further include:
[0072] S601. Obtain sample historical dialogue information, sample current request information, and sample request information.
[0073] In one specific embodiment, sample historical dialogue information, sample current request information, and sample request information can be used to train a pre-defined machine learning model. Sample current request information can refer to the request information to be rewritten corresponding to sample historical dialogue information. Sample request information can refer to the rewritten request information corresponding to sample current request information.
[0074] In one specific embodiment, a training sample dataset can be pre-constructed. This dataset may include multiple sets of training data, each set of which may include historical dialogue information, current request information, and request information. Specifically, by obtaining training data from the training sample dataset, historical dialogue information, current request information, and request information can be obtained.
[0075] S603. Perform word segmentation on the sample historical dialogue information and the sample current request information to obtain at least one third word corresponding to the sample historical dialogue information and at least one fourth word corresponding to the sample current request information.
[0076] In a specific embodiment, the above word segmentation process can refer to step S203 above, and will not be repeated here.
[0077] S605. Input at least one third word and at least one fourth word into a preset machine learning model for rewriting and prediction processing to obtain sample deletion indication information, sample start statistics information corresponding to any fourth word, and sample end statistics information corresponding to any fourth word.
[0078] In one specific embodiment, the sample start statistics can characterize the probability that any third word is the starting word corresponding to any fourth word. The sample start statistics may include the execution probability corresponding to a non-insertion operation and the insertion probability corresponding to at least one third word. The sample end statistics can characterize the probability that any third word is the ending word corresponding to any fourth word. The sample end statistics may include the execution probability corresponding to a non-insertion operation and the insertion probability corresponding to at least one third word.
[0079] In a specific embodiment, the above-described rewrite prediction process can refer to steps S401-S403, and will not be repeated here.
[0080] S607. Based on the sample start statistics and sample end statistics, determine the sample start insertion indication information and the sample end insertion indication information.
[0081] In one specific embodiment, the sample start insertion indication information can characterize the sample start segment before the insertion of any fourth segment in at least one third segment; specifically, the sample start segment can refer to the segment located at the beginning of the segment sequence before being inserted into any fourth segment. The sample end insertion indication information can characterize the sample end segment before the insertion of any fourth segment in at least one third segment.
[0082] In a specific embodiment, the process of determining the sample start insertion indication information and the sample end insertion indication information can refer to the above steps S501-S507, and will not be repeated here.
[0083] S609. Determine the rewrite information label based on the sample request information and the current sample request information.
[0084] In one specific embodiment, the rewrite information label may include a deletion instruction information label, a start insertion instruction information label, and an end insertion instruction information label.
[0085] In one specific embodiment, the sample request information and the current sample request information can be compared to obtain the rewrite information tag.
[0086] S611. Obtain the target loss information based on the sample deletion instruction information, sample start insertion instruction information, sample end insertion instruction information, and rewrite information label.
[0087] In one specific embodiment, the target loss information can be used as reference information for adjusting the model parameters in a preset machine learning model.
[0088] In a specific embodiment, three loss functions corresponding to a preset machine learning model can be pre-defined, namely a first loss function, a second loss function, and a third loss function. Based on sample deletion indication information, deletion indication information labels, and the first loss function, first loss information can be obtained; based on start insertion indication information labels, sample start insertion indication information, and the second loss function, second loss information can be obtained; based on end insertion indication information labels, sample end insertion indication information, and the third loss function, third loss information can be obtained; and then, the first, second, and third loss information are superimposed to obtain the aforementioned target loss information.
[0089] S613. Train a preset machine learning model based on the target loss information to obtain a preset request rewriting model.
[0090] In a specific embodiment, based on the target loss information, the preset machine learning model is updated to obtain an updated preset machine learning model. Based on the updated preset machine learning model, the model update steps described above—from obtaining sample historical dialogue information, sample current request information, and sample request information to updating the preset machine learning model based on the target loss information—are repeated until a preset convergence condition is met. The preset machine learning model that meets the preset convergence condition can be used as the preset request rewriting model. Optionally, the preset convergence condition may be that the target loss information is less than a preset loss threshold, or it may be that the number of iterations is greater than a preset number of updates; this is not limited here.
[0091] In step S207, the current request information is rewritten based on the deletion instruction information, the start insertion instruction information, and the end insertion instruction information to obtain the target request information corresponding to the current request information.
[0092] In one specific embodiment, the target request information may refer to the request information after rewriting the current request information.
[0093] In a specific embodiment, such as Figure 7 As shown, step S207 above may include:
[0094] S701. Based on the start insertion instruction information and the end insertion instruction information, insert the target segment corresponding to each second segment before each second segment in the current request information to obtain the initial request information.
[0095] In one specific embodiment, the target segmentation can be a segment between the starting segment and the ending segment corresponding to each second segment in at least one first segmentation. In practical applications, when the starting and ending segments are different first segments, the target segmentation can include the starting segment, the ending segment, and a first segment between the starting and ending segments. When the starting and ending segments are the same first segment, the target segmentation can be either the starting segment or the ending segment.
[0096] In a specific embodiment, based on the start insertion indication information and the end insertion indication information, the target segment corresponding to each second segment can be determined. Accordingly, the target segment corresponding to each second segment can be inserted before each second segment in the current request information to obtain the initial request information. Specifically, when neither the start insertion indication information nor the end insertion indication information is an identifier corresponding to a non-insertion operation, the segment between the start segment indicated by the start insertion indication information and the end segment indicated by the end insertion indication information can be used as the target segment. Accordingly, the target segment can be inserted before the second segment. When the start insertion indication information and / or the end insertion indication information corresponding to a second segment is an identifier corresponding to a non-insertion operation, the target segment corresponding to that second segment can be empty; it is understood that when the target segment is empty, no insertion operation is performed before that second segment.
[0097] S703. Based on the deletion instruction information, delete at least one second segment word in the initial request information to obtain the target request information.
[0098] In one specific embodiment, step S703 above may include:
[0099] Delete the second segment corresponding to the deletion instruction information that indicates the deletion operation in at least one second segment to obtain the target request information.
[0100] In one specific embodiment, the deletion instruction information corresponding to each second word can be a first instruction information and a second instruction information. The first instruction information can represent an instruction to perform a deletion operation; the second instruction information can represent an instruction not to perform a deletion operation. When the instruction information of any second word is the first instruction information, the second word can be deleted by performing a deletion operation on the second word; when the instruction information of any second word is the second instruction information, the second word can be retained.
[0101] In one specific embodiment, the above method may further include:
[0102] Based on the target request information, perform domain identification processing to obtain the target domain information corresponding to the current request information;
[0103] Intent recognition processing is performed based on the target request information to obtain the target intent information corresponding to the current request information.
[0104] In a specific embodiment, the target domain information corresponding to the current request information can characterize the knowledge domain to which the current request information belongs.
[0105] In one specific embodiment, the target request information can be input into a preset domain recognition module for domain recognition processing to obtain the target domain information.
[0106] In a specific embodiment, the target intent information corresponding to the current request information can characterize the intent of the target request object.
[0107] In one specific embodiment, the target request information can be input into a preset intent recognition module for intent recognition processing to obtain the target intent information.
[0108] In the above embodiments, by segmenting historical dialogue information and current request information, at least one first segment corresponding to the historical dialogue information and at least one second segment corresponding to the current request information are obtained. Based on at least one first segment, at least one second segment is rewritten and analyzed to obtain target rewritten information including deletion indication information, start insertion indication information, and end insertion indication information. Thus, the segment for rewriting the current request information can be directly determined from the historical dialogue information, avoiding the process of searching for the most suitable words from a very large vocabulary, greatly reducing the search space, and improving the rewriting efficiency of the current request information. Furthermore, by combining deletion indication information that indicates whether to perform a deletion operation, start insertion indication information that represents the start segment before inserting any second segment in at least one first segment, and end insertion indication information that represents the end segment before inserting any second segment in at least one first segment, the current request information can be rewritten. Based on simple operations such as adding, deleting, and modifying, the convenience and efficiency of rewriting can be greatly improved. At the same time, the rewriting process can be guaranteed to be faithful to the dialogue history, greatly reducing the possibility of incorrect or missed modifications, thereby improving the accuracy of the user intent represented by the target request information.
[0109] Figure 8 This is a schematic diagram illustrating the input and output of a preset request rewrite model according to an exemplary embodiment. Figure 9 This is a schematic diagram illustrating a preset request rewrite model according to an exemplary embodiment. (In conjunction with...) Figures 8-9 As shown, the process of rewriting the current request information is as follows:
[0110] Combination Figure 8 As shown, given a dialogue history including "How long does it take to get to City S by train?" and "Which train should I take?", if a user requests "Take train A", then "How long does it take to get to City S by train? Which train should I take?" can be used as historical dialogue information, and "Take train A" as the current request information. By segmenting the historical dialogue information and the current request information, multiple first-level words corresponding to the historical dialogue information and multiple second-level words corresponding to the current request information can be obtained. These multiple first-level words and multiple second-level words are then input into... Figure 9 The preset request rewriting model shown can obtain the deletion indication information corresponding to each second participle, the target start statistics information corresponding to each second participle, and the target end statistics information corresponding to each second participle. Based on the target start statistics information corresponding to any second participle and the target end statistics information corresponding to this second participle, the start insertion indication information corresponding to this second participle and the end insertion indication information corresponding to this second participle can be obtained.
[0111] Exemplarily, as Figure 8 shown, the identification information of the deletion indication information corresponding to the second participle "sit" is "0" (i.e., the second indication information), the start insertion indication information is "-1" (i.e., the identification information corresponding to a non-insertion operation), and the end insertion indication information is "-1" (i.e., the identification information corresponding to a non-insertion operation); the identification information of the deletion indication information corresponding to the second participle "Train A" is "0" (i.e., the second indication information), the start insertion indication information is "-1" (i.e., the identification information corresponding to a non-insertion operation), and the end insertion indication information is "-1" (i.e., the identification information corresponding to a non-insertion operation); the identification information of the deletion indication information corresponding to the second participle "." is "1" (i.e., the first indication information), the start insertion indication information is "3" (i.e., the identification information corresponding to the first participle "arrive"), and the end insertion indication information is "6" (i.e., the identification information corresponding to the first participle "?").
[0112] After determining the deletion indication information, start insertion indication information, and end insertion indication information corresponding to each second participle, based on the start insertion indication information and the end insertion indication information, the target participle corresponding to this second participle can be inserted before each second participle in the current request information to obtain an initial request information; based on the deletion indication information, the second participle corresponding to the deletion indication information that is the first indication information in the initial request information can be deleted to obtain a target request information.
[0113] Figure 10 is a block diagram of a data processing device shown according to an exemplary embodiment. As Figure 10 shown, the device may include:
[0114] An information acquisition module 1010, which can be used to acquire historical conversation information and current request information;
[0115] A participle processing module 1020, which can be used to perform participle processing on the historical conversation information and the current request information to obtain at least one first participle corresponding to the historical conversation information and at least one second participle corresponding to the current request information;
[0116] The rewrite analysis module 1030 can be used to perform rewrite analysis on at least one second word based on at least one first word to obtain target rewrite information. The target rewrite information includes deletion indication information corresponding to any second word, start insertion indication information corresponding to any second word, and end insertion indication information corresponding to any second word. The start insertion indication information represents the starting word in at least one first word before inserting any second word; the end insertion indication information represents the ending word in at least one first word before inserting any second word.
[0117] The rewriting module 1040 can be used to rewrite the current request information based on the deletion instruction information, the start insertion instruction information, and the end insertion instruction information to obtain the target request information corresponding to the current request information.
[0118] In one specific embodiment, the rewriting module 1040 described above may include:
[0119] The insertion processing module can be used to insert the target segment corresponding to each second segment before each second segment in the current request information based on the start insertion instruction information and the end insertion instruction information, so as to obtain the initial request information. The target segment is the segment between the start segment corresponding to each second segment and the end segment corresponding to each second segment in at least one first segment.
[0120] The deletion processing module can be used to delete at least one second word in the initial request information based on the deletion instruction information to obtain the target request information.
[0121] In one specific embodiment, the above-mentioned deletion processing module may include:
[0122] The deletion operation module can be used to delete the second segment corresponding to the deletion instruction information that indicates the deletion operation in at least one second segment to obtain the target request information.
[0123] In one specific embodiment, the rewrite analysis module 1030 described above may include:
[0124] The first rewrite prediction processing module can be used to input at least one first word and at least one second word into a preset request rewrite model for rewrite prediction processing, and obtain deletion indication information, target start statistics information corresponding to any second word, and target end statistics information corresponding to any second word. The target start statistics information represents the probability that any first word is the starting word corresponding to any second word, and the target end statistics information represents the probability that any first word is the ending word corresponding to any second word.
[0125] The insertion instruction information determination module can be used to determine the start insertion instruction information and the end insertion instruction information based on the target start statistics information and the target end statistics information.
[0126] In one specific embodiment, the above-mentioned insertion indication information determination module may include:
[0127] The starting word segmentation determination module can be used to determine the first word corresponding to the highest probability in the target starting statistics when the starting execution probability is not the maximum probability in the target starting statistics and the ending execution probability is not the maximum probability in the target ending statistics.
[0128] The start insertion indication information generation module can be used to generate start insertion indication information based on the start segment corresponding to any second segment;
[0129] The terminology termination module can be used to determine the terminology termination of any second terminology by selecting the first terminology with the highest probability in the target terminology termination statistics.
[0130] The end insertion indication information generation module can be used to generate end insertion indication information based on the end segment corresponding to any second segment.
[0131] In one specific embodiment, the above-described rewrite prediction processing module may include:
[0132] The feature extraction processing module can be used to input at least one first word segment and at least one second word segment into the feature extraction sub-model for feature extraction processing, so as to obtain the first semantic feature information corresponding to at least one first word segment and the second semantic feature information corresponding to at least one second word segment;
[0133] The mapping processing module can be used to input the first semantic feature information and the second semantic feature information into the perceptron mapping sub-model for mapping processing to obtain deletion indication information, target start statistics information and target end statistics information.
[0134] In one specific embodiment, the data processing apparatus may further include:
[0135] The sample information acquisition module can be used to acquire sample historical dialogue information, sample current request information, and sample request information;
[0136] The sample information word segmentation module can be used to segment sample historical dialogue information and sample current request information to obtain at least one third word corresponding to the sample historical dialogue information and at least one fourth word corresponding to the sample current request information.
[0137] The second rewriting prediction processing module can be used to input at least one third word and at least one fourth word into a preset machine learning model for rewriting prediction processing, and obtain sample deletion indication information, sample start statistics information corresponding to any fourth word, and sample end statistics information corresponding to any fourth word; the sample start statistics information represents the probability that any third word is the start word corresponding to any fourth word, and the sample end statistics information represents the probability that any third word is the end word corresponding to any fourth word;
[0138] The sample insertion indication information determination module can be used to determine the sample start insertion indication information and the sample end insertion indication information based on the sample start statistical information and the sample end statistical information;
[0139] The rewrite information label determination module can be used to determine the rewrite information label based on the sample request information and the sample current request information;
[0140] The target loss information acquisition module can be used to obtain target loss information based on sample deletion indication information, sample start insertion indication information, sample end insertion indication information, and rewrite information labels;
[0141] The preset request rewriting model acquisition module can be used to train a preset machine learning model based on the target loss information to obtain the preset request rewriting model.
[0142] In one specific embodiment, the data processing apparatus may further include:
[0143] The domain identification module can be used to perform domain identification processing based on the target request information to obtain the target domain information corresponding to the target request information;
[0144] The intent recognition module can be used to perform intent recognition processing based on the target request information to obtain the target intent information corresponding to the target request information.
[0145] Regarding the apparatus in the above embodiments, the specific manner in which each module and unit performs its operations has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0146] Figure 11 This is a block diagram illustrating an electronic device for rewriting current request information according to an exemplary embodiment. The electronic device may be a server, and its internal structure diagram may be as follows: Figure 11As shown, this electronic device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage medium. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a data processing method.
[0147] Figure 12 This is a block diagram illustrating another electronic device for rewriting current request information according to an exemplary embodiment. The electronic device may be a terminal, and its internal structure diagram may be as follows: Figure 12 As shown, the electronic device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage medium. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a data processing method. The display screen can be a liquid crystal display (LCD) or an e-ink display. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the device's casing, or an external keyboard, touchpad, or mouse.
[0148] Those skilled in the art will understand that Figure 11 or Figure 12 The structure shown is merely a block diagram of a portion of the structure related to the present disclosure and does not constitute a limitation on the electronic device to which the present disclosure is applied. A specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0149] In an exemplary embodiment, an electronic device is also provided, including: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement the data processing method as described in the embodiments of this disclosure.
[0150] In an exemplary embodiment, a computer-readable storage medium is also provided, wherein when the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the data processing method of the present disclosure embodiments.
[0151] In an exemplary embodiment, a computer program product including instructions is also provided, which, when run on a computer, causes the computer to perform the data processing method of the present disclosure embodiments.
[0152] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0153] It is understood that in the specific embodiments of this application, data such as user information are involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0154] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.
[0155] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A data processing method, characterized in that, The method includes: Retrieve historical dialogue information and current request information; The historical dialogue information and the current request information are segmented to obtain at least one first segmentation corresponding to the historical dialogue information and at least one second segmentation corresponding to the current request information. Based on the at least one first word segment, the at least one second word segment is rewritten and analyzed to obtain target rewriting information. The target rewriting information includes deletion indication information corresponding to any second word segment, start insertion indication information corresponding to any second word segment, and end insertion indication information corresponding to any second word segment. The start insertion indication information represents the starting word segment in the at least one first word segment before the insertion of any second word segment; the end insertion indication information represents the ending word segment in the at least one first word segment before the insertion of any second word segment; the starting word segment is the word segment located at the beginning of the word segment sequence before the insertion of any second word segment; the ending word segment is the word segment located at the end of the word segment sequence before the insertion of any second word segment. Based on the deletion instruction information, the start insertion instruction information, and the end insertion instruction information, the current request information is rewritten to obtain the target request information corresponding to the current request information. The process of rewriting the current request information based on the deletion indication information, the start insertion indication information, and the end insertion indication information to obtain the target request information corresponding to the current request information includes: Based on the start insertion indication information and the end insertion indication information, the target segment corresponding to each second segment is inserted before each second segment in the current request information to obtain the initial request information. The target segment is the segment between the start segment corresponding to each second segment and the end segment corresponding to each second segment in the at least one first segment. Based on the deletion instruction information, at least one second segment word in the initial request information is deleted to obtain the target request information.
2. The method according to claim 1, characterized in that, The step of deleting at least one second word in the initial request information based on the deletion instruction information to obtain the target request information includes: The target request information is obtained by deleting the second segment corresponding to the deletion instruction information that indicates the deletion operation in the at least one second segment.
3. The method according to claim 1, characterized in that, The rewriting analysis of the at least one second word based on the at least one first word to obtain target rewriting information includes: The at least one first word and the at least one second word are input into a preset request rewriting model for rewriting prediction processing to obtain the deletion instruction information, the target start statistics information corresponding to any second word, and the target end statistics information corresponding to any second word. The target start statistics information represents the probability that any first word is the start word corresponding to any second word, and the target end statistics information represents the probability that any first word is the end word corresponding to any second word. Based on the target start statistics and the target end statistics, the start insertion indication information and the end insertion indication information are determined.
4. The method according to claim 3, characterized in that, The target start statistics include the start execution probability corresponding to the non-insertion operation and the start insertion probability corresponding to the at least one first word segmentation; the target end statistics include the end execution probability corresponding to the non-insertion operation and the end insertion probability corresponding to the at least one first word segmentation. The step of determining the start insertion indication information and the end insertion indication information based on the target start statistics and the target end statistics includes: When the starting execution probability is a non-maximum probability in the target starting statistics and the ending execution probability is a non-maximum probability in the target ending statistics, the first segment corresponding to the maximum probability in the target starting statistics corresponding to any second segment is taken as the starting segment corresponding to any second segment. The starting insertion indication information is generated based on the starting word corresponding to any of the second word segments; Take the first segment that has the highest probability in the target end statistics information corresponding to any second segment as the end segment corresponding to any second segment; The end insertion indication information is generated based on the end segment corresponding to any of the second segment.
5. The method according to claim 3, characterized in that, The preset request rewriting model includes a feature extraction sub-model and a perceptron mapping sub-model; the step of inputting the at least one first word and the at least one second word into the preset request rewriting model for rewriting prediction processing to obtain the deletion instruction information, the target start statistics information corresponding to any second word, and the target end statistics information corresponding to any second word includes: The at least one first word and the at least one second word are input into the feature extraction sub-model for feature extraction processing to obtain the first semantic feature information corresponding to the at least one first word and the second semantic feature information corresponding to the at least one second word; The first semantic feature information and the second semantic feature information are input into the perceptron mapping sub-model for mapping processing to obtain the deletion instruction information, the target start statistics information and the target end statistics information.
6. The method according to claim 3, characterized in that, The method further includes: Obtain sample historical dialogue information, sample current request information, and sample request information; The sample historical dialogue information and the sample current request information are segmented to obtain at least one third segmented word corresponding to the sample historical dialogue information and at least one fourth segmented word corresponding to the sample current request information. The at least one third word and the at least one fourth word are input into a preset machine learning model for rewriting and prediction processing to obtain sample deletion indication information, sample start statistics information corresponding to any of the fourth words, and sample end statistics information corresponding to any of the fourth words. The sample start statistics information represents the probability that any of the third words is the start word corresponding to any of the fourth words, and the sample end statistics information represents the probability that any of the third words is the end word corresponding to any of the fourth words. Based on the sample start statistics and the sample end statistics, determine the sample start insertion indication and the sample end insertion indication; Based on the sample request information and the current sample request information, determine the rewrite information tag; The target loss information is obtained based on the sample deletion instruction information, the sample start insertion instruction information, the sample end insertion instruction information, and the rewritten information label; The preset machine learning model is trained based on the target loss information to obtain the preset request rewriting model.
7. The method according to claim 1, characterized in that, The method further includes: Based on the target request information, domain identification processing is performed to obtain the target domain information corresponding to the current request information; Based on the target request information, intent recognition processing is performed to obtain the target intent information corresponding to the current request information.
8. A data processing apparatus, characterized in that, The device includes: The information acquisition module is used to acquire historical dialogue information and current request information; The word segmentation processing module is used to perform word segmentation processing on the historical dialogue information and the current request information to obtain at least one first word corresponding to the historical dialogue information and at least one second word corresponding to the current request information. The rewriting analysis module is used to perform rewriting analysis on the at least one second word based on the at least one first word to obtain target rewriting information. The target rewriting information includes deletion indication information corresponding to any second word, start insertion indication information corresponding to any second word, and end insertion indication information corresponding to any second word. The start insertion indication information represents the starting word in the at least one first word before the insertion of any second word; the end insertion indication information represents the ending word in the at least one first word before the insertion of any second word; the starting word is the word located at the beginning of the word sequence before the insertion of any second word; the ending word is the word located at the end of the word sequence before the insertion of any second word. The rewriting module is used to rewrite the current request information based on the deletion instruction information, the start insertion instruction information, and the end insertion instruction information to obtain the target request information corresponding to the current request information. The rewriting module includes: An insertion processing module is used to insert a target segment corresponding to each second segment before each second segment in the current request information based on the start insertion indication information and the end insertion indication information, so as to obtain initial request information. The target segment is the segment between the start segment and the end segment corresponding to each second segment in the at least one first segment. The deletion processing module is used to delete at least one second word in the initial request information based on the deletion instruction information to obtain the target request information.
9. The apparatus according to claim 8, characterized in that, The deletion processing module includes: The deletion operation module is used to delete the second word corresponding to the deletion instruction information that indicates the deletion operation in the at least one second word segment, so as to obtain the target request information.
10. The apparatus according to claim 8, characterized in that, The rewrite analysis module includes: The first rewrite prediction processing module is used to input the at least one first word and the at least one second word into a preset request rewrite model for rewrite prediction processing, and obtain the deletion instruction information, the target start statistics information corresponding to any second word, and the target end statistics information corresponding to any second word. The target start statistics information represents the probability that any first word is the start word corresponding to any second word, and the target end statistics information represents the probability that any first word is the end word corresponding to any second word. The insertion instruction information determination module is used to determine the start insertion instruction information and the end insertion instruction information based on the target start statistics information and the target end statistics information.
11. The apparatus according to claim 10, characterized in that, The target start statistics include the start execution probability corresponding to the non-insertion operation and the start insertion probability corresponding to the at least one first word segmentation; the target end statistics include the end execution probability corresponding to the non-insertion operation and the end insertion probability corresponding to the at least one first word segmentation. The insertion instruction information determination module includes: The starting word segmentation determination module is used to, when the starting execution probability is a non-maximum probability in the target starting statistics and the ending execution probability is a non-maximum probability in the target ending statistics, take the first word corresponding to the maximum probability in the target starting statistics corresponding to any second word as the starting word corresponding to any second word; The start insertion indication information generation module is used to generate the start insertion indication information based on the start segment corresponding to any of the second segment; The term segmentation determination module is used to take the first term corresponding to the highest probability in the target term end statistics information corresponding to any second term as the term end corresponding to any second term. The end insertion indication information generation module is used to generate the end insertion indication information based on the end segment corresponding to any of the second segmentation words.
12. The apparatus according to claim 10, characterized in that, The preset request rewriting model includes a feature extraction sub-model and a perceptron mapping sub-model; the first rewriting prediction processing module includes: The feature extraction processing module is used to input the at least one first word segment and the at least one second word segment into the feature extraction sub-model for feature extraction processing, so as to obtain the first semantic feature information corresponding to the at least one first word segment and the second semantic feature information corresponding to the at least one second word segment; The mapping processing module is used to input the first semantic feature information and the second semantic feature information into the perceptron mapping sub-model for mapping processing to obtain the deletion instruction information, the target start statistics information and the target end statistics information.
13. The apparatus according to claim 10, characterized in that, The device further includes: The sample information acquisition module is used to acquire sample historical dialogue information, sample current request information, and sample request information; The sample information word segmentation module is used to perform word segmentation processing on the sample historical dialogue information and the sample current request information to obtain at least one third word corresponding to the sample historical dialogue information and at least one fourth word corresponding to the sample current request information. The second rewrite prediction processing module is used to input the at least one third word and the at least one fourth word into a preset machine learning model for rewrite prediction processing, and obtain sample deletion indication information, sample start statistics information corresponding to any of the fourth words, and sample end statistics information corresponding to any of the fourth words; the sample start statistics information represents the probability that any of the third words is the starting word corresponding to any of the fourth words, and the sample end statistics information represents the probability that any of the third words is the ending word corresponding to any of the fourth words; The sample insertion indication information determination module is used to determine sample start insertion indication information and sample end insertion indication information based on the sample start statistics information and the sample end statistics information; The rewrite information tag determination module is used to determine the rewrite information tag based on the sample request information and the sample current request information; The target loss information acquisition module is used to obtain target loss information based on the sample deletion instruction information, the sample start insertion instruction information, the sample end insertion instruction information, and the rewritten information label; The preset request rewriting model acquisition module is used to train the preset machine learning model based on the target loss information to obtain the preset request rewriting model.
14. The apparatus according to claim 8, characterized in that, The device further includes: The domain identification module is used to perform domain identification processing based on the target request information to obtain the target domain information corresponding to the current request information; The intent recognition module is used to perform intent recognition processing based on the target request information to obtain the target intent information corresponding to the current request information.
15. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to execute the executable instructions to implement the data processing method according to any one of claims 1 to 7.
16. A non-volatile computer-readable storage medium storing computer program instructions thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the data processing method according to any one of claims 1 to 7.
17. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the data processing method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Multi-round question and answer method, device and equipment
CN114547274A
Dialogue processing method, question rewriting model training method and device
CN114626385A