A method for processing a dialogue relationship, a computer and a readable storage medium

By decomposing dialogue relationship processing into three parts: relationship prediction, phrase prediction and trigger word prediction, combined with hidden character and trigger word detection, and adjusting model parameters, the accuracy problem of argument relationship prediction in conversational data is solved, and the processing efficiency and accuracy.

CN114676705BActive Publication Date: 2024-10-15TENCENT CLOUD COMPUTING (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110674476.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-17
Publication Date
2024-10-15
Estimated Expiration
2041-06-17

AI Technical Summary

Technical Problem

When the existing technology processes conversational data, it is difficult to accurately find contextual information related to arguments, resulting in inaccurate conversational relationship prediction results.

Method used

By inputting sample dialogue text and argument pairs into the initial relationship prediction model, feature extraction and loss function generation are performed. Combined with hidden character and trigger word detection, the model parameters are adjusted to generate a dialogue relationship prediction model. The relationship prediction task is decomposed into relationship prediction and phrases. The three parts of prediction and trigger word prediction are jointly trained.

Benefits of technology

It improves the accuracy and detection efficiency of dialogue relationship processing, makes full use of the information learned in phrase and trigger word prediction tasks, and enhances the comprehensiveness of relationship prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114676705B_ABST
    Figure CN114676705B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a method for processing a dialogue relationship, a computer and a readable storage medium, and relates to a machine learning technology of artificial intelligence. The method comprises: extracting sample text semantic information of a sample dialogue text and a sample argument pair in an initial relationship prediction model; predicting the predicted argument relationship of the sample argument pair based on the sample text semantic information, and generating a first loss function according to the actual argument relationship and the predicted argument relationship; predicting the predicted characters corresponding to the hidden characters in the sample dialogue text and the sample argument pair, and generating a second loss function according to the hidden characters and the predicted characters; predicting the predicted sequence annotation of the trigger word detection text data generated according to the actual argument relationship and the sample text semantic information, and generating a third loss function according to the actual sequence annotation and the predicted sequence annotation; training the initial relationship prediction model according to each loss function to obtain a dialogue relationship prediction model. The present application can improve the accuracy of dialogue relationship processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, computer and readable storage medium for processing a dialogue relationship. Background Art

[0002] Nowadays, there are a lot of conversational data. When processing this data, it is often necessary to analyze these conversational data, including the analysis of the arguments in the conversational data, such as the relationship extraction task for conversational arguments. Among them, many arguments in conversational data involve speakers. In the conversational relationship extraction task, the conversation text and the arguments are generally spliced, and the conversation text and the speaker's words in the arguments are explicitly replaced with pre-defined special symbols. The text obtained after the replacement is encoded and predicted to obtain the relationship between the speaker's words. Since the conversational data may be relatively long, it is difficult to accurately find the contextual information related to the arguments through the above method, so the prediction result of the argument relationship may be inaccurate. Summary of the invention

[0003] The embodiments of the present application provide a method, device, computer and readable storage medium for processing a dialogue relationship, which can improve the accuracy and detection efficiency of dialogue relationship processing.

[0004] On the one hand, an embodiment of the present application provides a method for processing a dialogue relationship, the method comprising:

[0005] Inputting the sample dialogue text and the sample argument pair in the sample dialogue text into the initial relationship prediction model, performing feature extraction on the sample dialogue text and the sample argument pair in the initial relationship prediction model, and obtaining sample text semantic information corresponding to the sample dialogue text; the sample argument pair includes a first sample argument and a second sample argument;

[0006] Predicting a predicted argument relationship between a first sample argument and a second sample argument based on semantic information of the sample text, and generating a first loss function according to an actual argument relationship and a predicted argument relationship between the first sample argument and the second sample argument;

[0007] Obtain hidden characters in the sample dialogue text and the sample argument pair, predict predicted characters corresponding to the hidden characters, and generate a second loss function according to the hidden characters and the predicted characters;

[0008] Generate trigger word detection text data according to the actual argument relationship and the semantic information of the sample text, predict the predicted sequence annotation in the trigger word detection text data, and generate a third loss function according to the actual sequence annotation and the predicted sequence annotation in the trigger word detection text data;

[0009] The model parameters of the initial relationship prediction model are adjusted according to the first loss function, the second loss function and the third loss function to generate a dialogue relationship prediction model; the dialogue relationship prediction model is used to predict the target argument relationship between the target argument pairs in the target dialogue text.

[0010] On the one hand, an embodiment of the present application provides a method for processing a dialogue relationship, the method comprising:

[0011] Inputting the target dialogue text and the target argument pair in the target dialogue text into the dialogue relation prediction model, performing feature extraction on the target dialogue text and the target argument pair in the dialogue relation prediction model, and obtaining target text semantic information corresponding to the target dialogue text; the target argument pair includes a first target argument and a second target argument;

[0012] The target text semantic information is predicted based on the relation prediction network in the dialogue relation prediction model to obtain the target argument relation between the first target argument and the second target argument; the dialogue relation prediction model is obtained by training the initial relation prediction model based on the first loss function, the second loss function and the third loss function; the initial relation prediction model includes the initial relation prediction network, the initial phrase prediction network and the initial trigger word prediction network; the first loss function is generated by the actual argument relation and the predicted argument relation between the first sample argument and the second sample argument, and the actual argument relation is obtained by predicting the sample text semantic information corresponding to the sample dialogue text where the first sample argument and the second sample argument are located in the initial relation prediction network; the second loss function is generated by the hidden characters and the predicted characters, and the predicted characters are obtained by predicting the hidden characters in the sample dialogue text, the first sample argument and the second sample argument in the initial phrase prediction network; the third loss function is generated by the actual sequence annotation and the predicted sequence annotation in the trigger word detection text data, and the trigger word detection text data is generated in the initial trigger word prediction network according to the actual argument relation and the sample text semantic information, and the predicted sequence annotation is obtained by predicting the trigger word detection text data.

[0013] On the one hand, an embodiment of the present application provides a device for processing a dialog relationship, the device comprising:

[0014] A model input module, used for inputting sample dialogue text and sample argument pairs in the sample dialogue text into an initial relationship prediction model;

[0015] A semantic information extraction module is used to extract features from the sample dialogue text and the sample argument pair in the initial relationship prediction model to obtain the sample text semantic information corresponding to the sample dialogue text; the sample argument pair includes a first sample argument and a second sample argument;

[0016] A relationship processing module, used for predicting a predicted argument relationship between a first sample argument and a second sample argument based on semantic information of the sample text;

[0017] A first loss generating module, configured to generate a first loss function according to an actual argument relationship and a predicted argument relationship between the first sample argument and the second sample argument;

[0018] A character acquisition module, used to acquire hidden characters in sample dialogue text and sample argument pairs;

[0019] A phrase prediction module, used to predict the predicted characters corresponding to the hidden characters;

[0020] A second loss generating module, used for generating a second loss function according to the hidden characters and the predicted characters;

[0021] A trigger detection generation module is used to generate trigger word detection text data based on actual argument relationships and sample text semantic information;

[0022] Sequence labeling module, used to predict the sequence labeling in the trigger word detection text data;

[0023] A third loss generation module, used to generate a third loss function according to the actual sequence annotation and the predicted sequence annotation in the trigger word detection text data;

[0024] The model training module is used to adjust the model parameters of the initial relationship prediction model according to the first loss function, the second loss function and the third loss function to generate a dialogue relationship prediction model; the dialogue relationship prediction model is used to predict the target argument relationship between the target argument pairs in the target dialogue text.

[0025] The semantic information extraction module includes:

[0026] A sample splicing unit, used for splicing the sample dialogue text and the sample argument pair based on the sample text splicing symbol to generate sample splicing text data;

[0027] An argument replacement unit, used to replace a first sample argument in the sample concatenated text data with a first sample argument symbol, and replace a second sample argument in the sample concatenated text data with a second sample argument symbol, to generate sample text sequence data;

[0028] The information extraction unit is used to extract features from the sample text sequence data to obtain the sample text semantic information corresponding to the sample dialogue text.

[0029] The sample text concatenation symbol includes a sample global semantic symbol; the sample text sequence data includes sample dialogue sequence data corresponding to the sample dialogue text, and the sample dialogue sequence data includes N sample dialogue phrases, where N is a positive integer;

[0030] The information extraction unit comprises:

[0031] The hidden layer extraction subunit is used to extract hidden layer features of the sample global semantic symbol, N sample dialogue phrases, the first sample argument symbol and the second sample argument symbol in the sample text sequence data, respectively, to obtain the sample global hidden state corresponding to the sample global semantic symbol, the sample phrase hidden states corresponding to the N sample dialogue phrases, the first initial sample argument hidden state corresponding to the first sample argument symbol and the second initial sample argument hidden state corresponding to the second sample argument symbol;

[0032] The semantic determination subunit is used to determine the sample global hidden state, N sample phrase hidden states, the first initial sample argument hidden state and the second initial sample argument hidden state as the sample text semantic information corresponding to the sample dialogue text.

[0033] Wherein, the hidden layer extraction subunit includes:

[0034] The global processing subunit is used to obtain the sample global relations between N sample dialogue phrases, the first sample argument symbol and the second sample argument symbol and the sample global semantic symbol respectively based on the pre-trained language network, perform feature fusion on the sample global relations, and generate the sample global hidden state corresponding to the sample global semantic symbol;

[0035] The state extraction subunit is used to extract hidden features of the N sample dialogue phrases, the first sample argument symbol and the second sample argument symbol, respectively, to obtain the sample phrase hidden states corresponding to the N sample dialogue phrases, the first initial sample argument hidden state corresponding to the first sample argument symbol, and the second initial sample argument hidden state corresponding to the second sample argument symbol.

[0036] Wherein, the N sample dialogue phrases include a first sample argument symbol and a second sample argument symbol; the initial relationship prediction model includes an initial relationship prediction network;

[0037] The relationship processing module includes:

[0038] A first argument recognition unit is used to obtain, based on an initial relationship prediction network, a first sample phrase hidden state corresponding to a first sample argument symbol from N sample phrase hidden states included in the semantic information of the sample text, and perform maximum pooling processing on the first sample phrase hidden state and the first initial sample argument hidden state to obtain a first sample argument hidden state of the first sample argument symbol;

[0039] A second argument recognition unit is used to obtain a second sample phrase hidden state corresponding to a second sample argument symbol from the N sample phrase hidden states, and perform maximum pooling processing on the second sample phrase hidden state and the second initial sample argument hidden state to obtain a second sample argument hidden state of the second sample argument symbol;

[0040] A hidden state concatenation unit is used to concatenate the global hidden state of the sample, the first sample argument hidden state and the second sample argument hidden state to obtain the sample hidden state information;

[0041] The relationship prediction unit is used to predict the predicted argument relationship between the first sample argument and the second sample argument based on the sample hidden state information.

[0042] Wherein, the relationship prediction unit comprises:

[0043] The semantic enhancement subunit is used to semantically enhance the latent state information of the sample to obtain enhanced semantic information of the sample;

[0044] The probability selection subunit is used to predict the sample relationship prediction probabilities of M candidate argument relationships corresponding to the first sample argument and the second sample argument based on the sample enhanced semantic information, and determine the candidate argument relationship with the largest sample relationship prediction probability as the predicted argument relationship between the first sample argument and the second sample argument; M is a positive integer.

[0045] The sample text sequence data further includes a first sample argument symbol and a second sample argument symbol, and N is a positive integer; the initial relationship prediction model includes an initial phrase prediction network;

[0046] The character acquisition module includes:

[0047] A phrase acquisition unit is used to acquire k sequence phrases in the sample text sequence data based on the initial phrase prediction network; the k sequence phrases include N sample dialogue phrases, a first sample argument symbol and a second sample argument symbol; k is a positive integer;

[0048] The state detection unit is used to detect the character states corresponding to the k sequence phrases in the sample text sequence data, and determine the sequence phrases whose character states are hidden states as hidden characters.

[0049] The phrase prediction module includes:

[0050] A character association unit is used to replace the hidden characters in the sample text sequence data with the character mask, obtain the character association information between the associated sequence phrase of the hidden character and the character mask, and obtain the mask hidden state of the character mask according to the character association information; the associated sequence phrase is the sequence phrase excluding the hidden character in the k sequence phrases;

[0051] The character prediction unit is used to extract features of the mask hidden state and predict the predicted character corresponding to the character mask.

[0052] Among them, the initial relationship prediction model includes an initial trigger word prediction network;

[0053] The trigger detection generation module includes:

[0054] A vector conversion unit, used for performing vector conversion on the actual argument relationship based on the initial trigger word prediction network to obtain an argument relationship vector corresponding to the actual argument relationship;

[0055] The data generation unit is used to concatenate the argument relationship vector with the N sample phrase hidden states in the sample text semantic information to generate trigger word detection text data.

[0056] The sequence labeling module includes:

[0057] The text splitting unit is used to split the trigger word detection text data into phrases to obtain t phrases to be marked; t is a positive integer;

[0058] An initial annotation unit, used to add initial annotations to the t phrases to be annotated respectively, and detect the phrase association relationship between adjacent phrase pairs to be annotated among the t phrases to be annotated;

[0059] The annotation updating unit is used to update the initial annotations corresponding to the t phrases to be annotated based on the phrase association relationship, obtain the predicted annotations corresponding to the t phrases to be annotated, and compose the predicted annotations corresponding to the t phrases to be annotated into a predicted sequence annotation.

[0060] On the one hand, an embodiment of the present application provides a device for processing a dialog relationship, the device comprising:

[0061] A target model input module, used for inputting a target dialogue text and a target argument pair in the target dialogue text into a dialogue relation prediction model;

[0062] A target semantics acquisition module is used to extract features of a target dialogue text and a target argument pair in a dialogue relationship prediction model to obtain target text semantic information corresponding to the target dialogue text; the target argument pair includes a first target argument and a second target argument;

[0063] The target relationship prediction module is used to predict the semantic information of the target text based on the relationship prediction network in the dialogue relationship prediction model, and obtain the target argument relationship between the first target argument and the second target argument; the dialogue relationship prediction model is obtained by training the initial relationship prediction model based on the first loss function, the second loss function and the third loss function; the initial relationship prediction model includes the initial relationship prediction network, the initial phrase prediction network and the initial trigger word prediction network; the first loss function is generated by the actual argument relationship and the predicted argument relationship between the first sample argument and the second sample argument, and the actual argument relationship is obtained by predicting the sample text semantic information corresponding to the sample dialogue text where the first sample argument and the second sample argument are located in the initial relationship prediction network; the second loss function is generated by hidden characters and predicted characters, and the predicted characters are obtained by predicting the hidden characters in the sample dialogue text, the first sample argument and the second sample argument in the initial phrase prediction network; the third loss function is generated by the actual sequence annotation and the predicted sequence annotation in the trigger word detection text data, and the trigger word detection text data is generated in the initial trigger word prediction network according to the actual argument relationship and the sample text semantic information, and the predicted sequence annotation is obtained by predicting the trigger word detection text data.

[0064] The target semantics acquisition module includes:

[0065] A target concatenation unit, used for concatenating the target dialogue text and the target argument pair based on the target text concatenation symbol to generate target concatenated text data;

[0066] A target replacement unit, used to replace the first target argument in the target concatenated text data with the first target argument symbol, and replace the second target argument in the target concatenated text data with the second target argument symbol, so as to generate target text sequence data;

[0067] The target acquisition unit is used to extract features from the target text sequence data to obtain the target text semantic information corresponding to the target dialogue text.

[0068] Wherein, the target model input module includes:

[0069] a consultation obtaining unit, configured to obtain a target dialogue text and dialogue consultation information associated with the target dialogue text;

[0070] A dialogue parsing unit, used to parse the dialogue consultation information and extract the target argument pairs in the dialogue consultation information;

[0071] A model input unit, used for inputting a target dialogue text and a target argument pair in the target dialogue text into a dialogue relation prediction model;

[0072] The device also includes:

[0073] The data storage module is used to generate target question and answer data based on the target dialogue text, dialogue consultation information and target argument pairs, and add the target question and answer data to the question and answer database.

[0074] On the one hand, an embodiment of the present application provides a computer device, including a processor, a memory, and an input and output interface;

[0075] The processor is connected to the memory and the input / output interface respectively, wherein the input / output interface is used to receive and output data, the memory is used to store a computer program, and the processor is used to call the computer program so that a computer device including the processor executes the conversation relationship processing method in one aspect of an embodiment of the present application.

[0076] On the one hand, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program, and the computer program is suitable for being loaded and executed by a processor so that a computer device having the processor executes the conversation relationship processing method in one aspect of the embodiment of the present application.

[0077] In one aspect, an embodiment of the present application provides a computer program product or a computer program, wherein the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided in various optional ways in one aspect of the embodiment of the present application.

[0078] Implementing the embodiments of the present application will have the following beneficial effects:

[0079] In an embodiment of the present application, a sample dialogue text and a sample argument pair in the sample dialogue text are input into an initial relationship prediction model, and feature extraction is performed on the sample dialogue text and the sample argument pair in the initial relationship prediction model to obtain sample text semantic information corresponding to the sample dialogue text; the sample argument pair includes a first sample argument and a second sample argument; a predicted argument relationship between the first sample argument and the second sample argument is predicted based on the sample text semantic information, and a first loss function is generated according to the actual argument relationship and the predicted argument relationship between the first sample argument and the second sample argument; hidden characters in the sample dialogue text and the sample argument pair are obtained, predicted characters corresponding to the hidden characters are predicted, and a second loss function is generated according to the hidden characters and the predicted characters; trigger word detection text data is generated according to the actual argument relationship and the sample text semantic information, a predicted sequence annotation in the trigger word detection text data is predicted, and a third loss function is generated according to the actual sequence annotation and the predicted sequence annotation in the trigger word detection text data; model parameters of the initial relationship prediction model are adjusted according to the first loss function, the second loss function and the third loss function to generate a dialogue relationship prediction model; the dialogue relationship prediction model is used to predict the target argument relationship between the target argument pairs in the target dialogue text. Through the above process, this application divides conversational relationship extraction into three related subtasks, namely, relationship prediction task, phrase prediction task and trigger word prediction task. By integrating these three subtasks and jointly training the model, it is possible to make full use of the effective information learned from the phrase prediction task and the trigger word prediction task, and influence the relationship prediction task based on the effective information, thereby improving the accuracy of conversational relationship processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0080] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0081] Figure 1 This is a network interaction architecture diagram for processing a dialogue relationship provided by an embodiment of the present application;

[0082] Figure 2 It is a schematic diagram of a model training scenario provided in an embodiment of the present application;

[0083] Figure 3 It is a schematic diagram of a model structure provided in an embodiment of the present application;

[0084] Figure 4 is a flow chart of a method for model generation process provided by an embodiment of the present application;

[0085] Figure 5 The embodiment of the present application provides a model composition architecture diagram;

[0086] Figure 6 This is a schematic diagram of a model prediction scenario provided in an embodiment of the present application;

[0087] Figure 7 is a method flow chart of a model prediction process provided by an embodiment of the present application;

[0088] Figure 8 is a schematic diagram of a conversation relationship processing device provided in an embodiment of the present application;

[0089] Fig. 9 is a schematic diagram of another device for processing a dialog relationship provided in an embodiment of the present application;

[0090] Fig.10 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0091] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0092] Among them, the solution provided in the embodiment of the present application involves technologies such as machine learning in the field of artificial intelligence, and is intended to achieve automatic extraction and analysis of dialogue texts, so as to identify the relationship between argument pairs in the dialogue texts.

[0093] Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science. It attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that the machines have the functions of perception, reasoning and decision-making. In this application, the training and use of the dialogue relationship prediction model are realized through machine learning technology, and the automatic processing of the model is realized. This whole process realizes the relationship prediction artificial intelligence.

[0094] Among them, artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. Basic artificial intelligence technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, and mechatronics. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning. This application mainly involves machine learning / deep learning (such as the training and use of dialogue relationship prediction models).

[0095] Deep Learning (DL) is a new research direction in the field of Machine Learning (ML). Deep learning is the study of the inherent laws and representation levels of sample data. The information obtained in the learning process is of great help in the interpretation of data such as text, images and sounds. Among them, deep learning is a complex machine learning algorithm, and the results achieved in speech and image recognition far exceed those of previous related technologies. Deep learning usually includes artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and learning by teaching.

[0096] With the research and progress of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned driving, automatic driving, drones, robots, smart medical care, smart customer service, etc. It is believed that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role, such as the field of text analysis in this application.

[0097] In the examples of this application, see Figure 1 , Figure 1It is a network interaction architecture diagram for dialogue relationship processing provided in an embodiment of the present application. The embodiment of the present application can be implemented by a computer device 101, and the computer device 101 can perform data interaction with user devices (such as user devices 102a, 102b, and 102c, etc.). Among them, if the computer device 101 is a device for model training, the computer device 101 can obtain sample dialogue texts and sample argument pairs in the sample dialogue texts from each user device, and implement model training based on the sample dialogue texts and sample argument pairs to obtain a dialogue relationship prediction model for predicting argument pair relationships. Optionally, the sample dialogue text can be obtained from each user device, or directly from the computer device 101 (i.e., stored in the computer device 101), or can be obtained based on cloud storage technology, or can be obtained based on a blockchain network, which is not limited here. If the computer device 101 is a device for model prediction, the computer device 101 can respond to a relationship prediction request sent by any user device, for example, respond to a relationship prediction request sent by the user device 102a, obtain the target dialogue text and target argument pair included in the relationship prediction request, predict the target dialogue text and target argument pair based on the dialogue relationship prediction model, and obtain the target argument relationship of the target argument pair. Optionally, the computer device 101 can also obtain the target dialogue text and target argument pair stored in the computer device 101, predict the target dialogue text and target argument pair based on the dialogue relationship prediction model, and obtain the target argument relationship of the target argument pair, etc. In other words, the data involved in this application can be provided by a user device, or stored in the computer device 101, or can be stored based on cloud storage technology, or can be stored in a blockchain network, without limitation here.

[0098] Further, see Figure 2 , Figure 2 Schematic diagram of a model training scenario provided in an embodiment of the present application. Figure 2As shown, the computer device can obtain a model training sample 201, which includes a sample dialogue text and a sample argument pair in the sample dialogue text, input the sample dialogue text and the sample argument pair into the initial relationship prediction model, perform feature extraction on the sample dialogue text and the sample argument pair in the initial relationship prediction model, obtain sample text semantic information corresponding to the sample dialogue text, and input the sample text semantic information into the task processing area in the initial relationship prediction model, including the relationship prediction task area 2021, the phrase prediction task area 2022, and the trigger word prediction task area 2023. Among them, the sample argument pair includes a first sample argument and a second sample argument. Among them, the relationship prediction task area 2021 is used to extract the relationship between the argument pair, and the relationship extraction is a technology for identifying and determining the specific relationship between entity pairs from natural language text. Specifically, in the relationship prediction task area 221, the semantic information of the sample text is predicted to obtain the predicted argument relationship between the first sample argument and the second sample argument, the actual argument relationship between the first sample argument and the second sample argument is obtained, and a first loss function is generated based on the predicted argument relationship and the actual argument relationship. In the phrase prediction task area 222, the hidden characters in the sample dialogue text and the sample argument pair are obtained, the predicted characters corresponding to the hidden characters are predicted, and a second loss function is generated based on the hidden characters and the predicted characters. In the trigger word prediction task area 223, trigger word detection text data is generated based on the actual argument relationship and the semantic information of the sample text, the predicted sequence annotation in the trigger word detection text data is predicted, and a third loss function is generated based on the actual sequence annotation and the predicted sequence annotation in the trigger word detection text data. Based on the first loss function, the second loss function and the third loss function, multi-task learning is performed on the initial relationship prediction model to generate a dialogue relationship prediction model. By introducing effective information learned from phrase prediction tasks and trigger word prediction tasks into the relationship prediction task, the relationship prediction task can more comprehensively obtain information in the dialogue text (such as sample dialogue text or target dialogue text, etc.), thereby improving the prediction accuracy of the relationship prediction task.

[0099] Further, see Figure 3 , Figure 3 This is a schematic diagram of a model structure provided in the embodiment of the present application. Figure 3As shown, the initial relationship prediction model includes an initial relationship prediction network, an initial phrase prediction network, and a trigger word prediction network, etc. The initial relationship prediction model also includes a shared encoder, and the input of the initial relationship prediction network, the initial phrase prediction network, and the initial trigger word prediction network, etc. is obtained based on the output of the shared encoder. After adjusting the model parameters of the initial relationship prediction model (i.e., adjusting the model parameters of the initial relationship prediction model), a dialogue relationship prediction model is generated, wherein the model parameter is a quantity that uses a universal variable to establish a relationship between a function and a variable. In the field of artificial intelligence, the model parameter is usually a real number matrix. Optionally, with the development of the model, the model parameter can also be data in other formats. Among them, the dialogue relationship prediction model can include a shared encoder, a relationship prediction network, a phrase prediction network, and a trigger word prediction network. Optionally, the dialogue relationship prediction model can also only include a shared encoder and a relationship prediction network, etc., to simplify the model structure.

[0100] The phrase prediction network and the trigger word prediction network are used to supplement the feature information of the relationship prediction network, so as to improve the prediction accuracy of the relationship prediction network. The relationship prediction task area refers to the initial relationship prediction network and the area where the relationship prediction network is located, that is, the network in the relationship prediction task area is called the initial relationship prediction network before training, and is called the relationship prediction network after training, which is used to predict the argument relationship between argument pairs (such as sample argument pairs or target argument pairs, etc.); the phrase prediction task area refers to the initial phrase prediction network and the area where the phrase prediction network is located, that is, the network in the phrase prediction task area is called the initial phrase prediction network before training, and is called the phrase prediction network after training, which is used to predict the phrases in the text; the trigger word prediction task area refers to the initial trigger word prediction network and the area where the trigger word prediction network is located, that is, the network in the trigger word prediction task area is called the initial trigger word prediction network before training, and is called the trigger word prediction network after training, which is used to predict the sequence annotation of the text.

[0101] It is understandable that the computer device or user device mentioned in the embodiment of the present application includes but is not limited to a terminal device or a server. In other words, the computer device or user device can be a server or a terminal device, or a system composed of a server and a terminal device. Among them, the terminal device mentioned above can be an electronic device, including but not limited to a mobile phone, a tablet computer, a desktop computer, a laptop computer, a PDA, a vehicle-mounted device, an augmented reality / virtual reality (AR / VR) device, a helmet display, a smart TV, a wearable device, a smart speaker, a digital camera, a camera and other mobile Internet devices (mobile internet device, MID) with network access capabilities, or terminal devices in scenarios such as trains, ships, and flights. Among them, the server mentioned above can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, vehicle-road collaboration, content distribution networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms.

[0102] For further information, see Figure 4 , Figure 4 This is a flow chart of a method for model generation process provided by an embodiment of the present application. Figure 4 As shown in Figure 2, the model generation process includes the following steps:

[0103] Step S401, input the sample dialogue text and the sample argument pairs in the sample dialogue text into the initial relationship prediction model, perform feature extraction on the sample dialogue text and the sample argument pairs in the initial relationship prediction model, and obtain sample text semantic information corresponding to the sample dialogue text, wherein the sample argument pairs include a first sample argument and a second sample argument.

[0104] In an embodiment of the present application, a computer device obtains a training sample, which includes a sample dialogue text and a sample argument pair in the sample dialogue text, wherein an argument refers to a substantive component with a subject role, and a noun paired with a predicate can be called an argument. The sample dialogue text can be any text data including at least two arguments, and the sample argument pair can be any two arguments in the sample dialogue text, for example, an argument pair composed of any two speakers in the sample dialogue text, or an argument pair composed of any two objects in the sample dialogue text, or an argument pair composed of a speaker and an object in the sample dialogue text, etc., without limitation herein. For example, if the sample conversation text obtained is "Speaker 1: 'Uh, like, could these margaritas be any stronger? Hey, Chandler.', Speaker 2: 'Hello, Mr. Bing', Speaker 3: '...', ...", then the sample argument pair can be an argument pair consisting of any two speakers in the sample conversation text, such as "{Speaker 1, Speaker 2}, {Speaker 1, Speaker 3} and {Speaker 2, Speaker 3}, etc.", or an argument pair consisting of a speaker and an object, such as "{Speaker 1, margaritas}, {Speaker 2, margaritas}, etc.", without limitation. In other words, the sample argument pair can have different argument pair types, including but not limited to the same speaker argument pair type, the same object argument pair type, and the speaker and object argument pair type. In the process of model training, the initial relationship prediction model can be trained based on different argument pair types at the same time to obtain a dialogue relationship prediction model that can detect different argument pair types, so as to improve the generalization of the trained model; or, the initial relationship prediction model can be trained based on different argument pair types to obtain multiple dialogue relationship prediction models, and different dialogue relationship prediction models detect different argument pair types, so as to improve the accuracy of the trained model. Optionally, the number of argument pair types required to be detected by a model can be determined based on needs, taking into account the generalization and accuracy of the model, etc., and there is no limitation here. Furthermore, the computer device can input the obtained sample dialogue text and the sample argument pairs in the sample dialogue text into the initial relationship prediction model, perform feature extraction on the sample dialogue text and the sample argument pairs in the initial relationship prediction model, and obtain the sample text semantic information corresponding to the sample dialogue text.

[0105] The computer device can perform data preprocessing and hidden feature extraction on the sample dialogue text and the sample argument pairs in the initial relationship prediction model to obtain the sample text semantic information corresponding to the sample dialogue text. Figure 5 This is a model composition architecture diagram provided by an embodiment of the present application, such as Figure 5 As shown, the computer device obtains training samples 501, which may include sample dialogue texts and sample argument pairs in the sample dialogue texts, inputs the sample dialogue texts and the sample argument pairs into the initial relationship prediction model 502, performs data preprocessing and hidden layer feature extraction on the sample dialogue texts and the sample argument pairs based on the shared encoder in the initial relationship prediction model 502, and obtains the sample text semantic information corresponding to the sample dialogue text. The initial relationship prediction model 502 can perform relationship prediction tasks, phrase prediction tasks, and trigger word prediction tasks.

[0106] Specifically, the computer device can splice the sample dialogue text and the sample argument pair based on the sample text splicing symbol in the initial relationship prediction model to generate sample spliced ​​text data, wherein the sample text splicing symbol may include a sample global semantic symbol and a sample separator, etc. Specifically, the computer device can splice the sample dialogue text and the sample argument pair, insert the sample text splicing symbol into the spliced ​​sample, and obtain the sample spliced ​​text data, wherein the sample text splicing symbol and the insertion method of the sample text splicing symbol can be determined based on the pre-trained language network in the shared encoder, the sample text splicing symbol can be any special character or special character string, which is not limited here, the sample global semantic symbol is used to refer to the global representation of the sample dialogue text and the sample argument pair, and the sample separator is used to segment the sample dialogue text and the sample argument pair. For example, the sample dialogue text is denoted as Tx, and the sample global semantic symbol in the sample text concatenation symbol is assumed to be [CLS], and the sample separator in the sample text concatenation symbol is [SEP]. The sample dialogue text and the sample argument pair are concatenated based on the sample global semantic symbol and the sample separator, wherein the first sample argument is denoted as a 1 , let the second sample argument be a 2 After the sample dialogue text and the sample argument pair are concatenated, the sample concatenated text data is obtained. The sample concatenated text data may be “[CLS]Tx[SEP]a 1 [SEP]a 2 [SEP]”, where it is assumed that the sample dialogue text Tx is “s 1 :t 1 s 2 :t 2 …s u :t u ", at this time, the sample concatenated text data can be expressed as "[CLS]s1 :t 1 s 2 :t 2 …s u :t u [SEP]a 1 [SEP]a 2 [SEP]”; Optionally, a sample separator may be further inserted into the sample dialogue text based on the text composition structure of the sample dialogue text to obtain sample concatenated text data, such as “[CLS]s 1 :t 1 [SEP]s 2 :t 2 [SEP]…[SEP]s u :t u [SEP]a 1 [SEP]a 2 [SEP]”, no restrictions are imposed here.

[0107] Furthermore, the computer device may replace the first sample argument in the sample concatenated text data with the first sample argument symbol, and replace the second sample argument in the sample concatenated text data with the second sample argument symbol, to generate sample text sequence data. Optionally, when replacing the sample arguments with corresponding sample argument symbols (i.e., replacing the first sample argument with the first sample argument symbol, or replacing the second sample argument with the second sample argument symbol), the positions of the sample arguments in the sample concatenated text data may be marked based on the starting argument symbol and the ending argument symbol. Specifically, the generation process of the sample text sequence data may be shown in formula ①:

[0108]

[0109] As shown in formula ①, represents the i-th character in the sample text sequence data, [B] represents the starting argument symbol, [E] represents the ending argument symbol, a 1 represents the first sample argument, a 2 represents the second sample argument, s i represents the i-th character in the sample concatenated text data, [S 1 ] represents the first sample argument symbol, [S 2 ] represents the second sample argument symbol. Optionally, the first sample argument symbol, the second sample argument symbol, the start argument symbol and the end argument symbol summarized in this application are not limited to the above representation methods, and can also be represented by other special characters or special character strings, which are not limited here. Wherein, formula ① is used to represent that the computer device traverses the sample splicing text data, and if the i-th character in the sample splicing text data is the first sample argument (i.e., s i =a1 ), then replace the i-th character in the sample concatenated text data with the first sample argument symbol [S 1 ], optionally, the position of the first sample argument in the sample concatenated text data can also be marked based on the starting argument symbol [B] and the ending argument symbol [E], that is, the i-th character in the sample concatenated text data is replaced by [B][S 1 ][E]; if the i-th character in the sample concatenated text data is the second sample argument (i.e. s i =a 2 ), then replace the i-th character in the sample concatenated text data with the second sample argument symbol [S 2 ], optionally, the position of the second sample argument in the sample concatenated text data can also be marked based on the starting argument symbol [B] and the ending argument symbol [E], that is, the i-th character in the sample concatenated text data is replaced by [B][S 2 ][E]; if the i-th character in the sample concatenated text data is not the first sample argument and is not the second sample argument, then the i-th character in the sample concatenated text data remains unchanged. Through the above process, the sample text sequence data is obtained. Wherein, i is a positive integer, i is less than or equal to the number of characters included in the sample concatenated text data.

[0110] The above process of generating sample text sequence data based on the sample dialogue text and the sample argument pairs in the sample dialogue text can be considered as a data preprocessing process for the sample dialogue text and the sample argument pairs in the sample dialogue text.

[0111] Furthermore, the computer device may perform feature extraction (i.e., hidden layer feature extraction) on the sample text sequence data to obtain sample text semantic information corresponding to the sample dialogue text. Specifically, the sample text concatenation symbol includes a sample global semantic symbol; the sample text sequence data includes sample dialogue sequence data corresponding to the sample dialogue text, and the sample dialogue sequence data includes N sample dialogue phrases, where N is a positive integer. When the computer device performs feature extraction on the sample text sequence data to obtain sample text semantic information corresponding to the sample dialogue text, specifically, the sample global semantic symbol, the N sample dialogue phrases, the first sample argument symbol, and the second sample argument symbol in the sample text sequence data are respectively subjected to hidden layer feature extraction to obtain the sample global hidden state corresponding to the sample global semantic symbol, the sample phrase hidden states corresponding to the N sample dialogue phrases, the first initial sample argument hidden state corresponding to the first sample argument symbol, and the second initial sample argument hidden state corresponding to the second sample argument symbol. The sample global hidden state, the N sample phrase hidden states, the first initial sample argument hidden state, and the second initial sample argument hidden state are determined as the sample text semantic information corresponding to the sample dialogue text.

[0112] Specifically, the computer device can obtain the sample global relations between N sample dialogue phrases, the first sample argument symbol and the second sample argument symbol and the sample global semantic symbol respectively based on the pre-trained language network, perform feature fusion on the sample global relations, and generate the sample global hidden state corresponding to the sample global semantic symbol; perform hidden layer feature extraction on the N sample dialogue phrases, the first sample argument symbol and the second sample argument symbol respectively, and obtain the sample phrase hidden state corresponding to the N sample dialogue phrases, the first initial sample argument hidden state corresponding to the first sample argument symbol, and the second initial sample argument hidden state corresponding to the second sample argument symbol. The pre-trained language network can be any network that can obtain the hidden layer representation of the phrase, such as the bidirectional feature representation self-encoding pre-trained language model (BidirectionalEncoderRepresentationsfromTransformers,BERT), the autoregressive pre-training model (embeddingfromlanguagemodel,ELMo) or the generative pre-training model (Generative Pre-Training,GPT / GPT2), etc., which are not limited here.

[0113] For example, see Figure 6 , Figure 6 Schematic diagram of a model prediction scenario provided by an embodiment of the present application. Figure 6 As shown, the initial relationship prediction model includes a shared encoder 601, an initial relationship prediction network 602, an initial phrase prediction network 603, and an initial trigger word prediction network 604. The computer device obtains a training sample 6011, which includes a sample dialogue text 601a and a sample argument pair 601b. Assume that the sample dialogue text 601a is "a 1 :Mom! 2 :Sweetie...”, the sample argument pair 601b includes the first sample argument a 1 and the second sample argument a 2 The training sample 6011 is preprocessed to obtain sample text sequence data 6012. Specifically, the sample dialogue text 601a and the sample argument pair 601b are spliced ​​based on the sample text splicing symbol to generate sample spliced ​​text data. The sample spliced ​​text data can be “[CLS]a 1 :Mom! 2 :Sweetie……[SEP]a 1 [SEP]a 2 [SEP]". Further, the first sample argument a in the sample concatenation text data is 1 Replaced by the first sample argument symbol S 1, concatenate the sample to the first sample argument a in the text data 2 Replaced by the first sample argument symbol S 2 , and obtain the sample text sequence data 6012, which is "[CLS]S 1 :Mom! S 2 :Sweetie……[SEP]S 1 [SEP]S 2 [SEP]". The hidden layer features of the sample global semantic symbol "[CLS]", N sample dialogue phrases, the first sample argument symbol and the second sample argument symbol are extracted respectively to obtain the sample global hidden state "h [CLS] ”, N sample dialogue phrases correspond to the hidden states of the sample phrases, such as the sample dialogue phrase “S 1 "The corresponding sample phrase hidden state (subscript 1 indicates the first first sample argument appearing in the sample text sequence data 6012), the sample phrase hidden state "h i ”(i represents the i-th sample dialogue phrase among N sample dialogue phrases), the sample dialogue phrase “S 2 "The corresponding sample phrase hidden state …, and the first initial sample argument hidden state corresponding to the first sample argument symbol The second initial sample argument hidden state corresponding to the second sample argument symbol j represents the jth first sample argument symbol or second sample argument symbol appearing in the sample text sequence data 6012. Optionally, in the sample text sequence data 6012, the number of first sample argument symbols and second sample argument symbols may be the same or different. The sample global hidden state, the N sample phrase hidden states, the first initial sample argument hidden state and the second initial sample argument hidden state are determined as the sample text semantic information corresponding to the sample dialogue text.

[0114] Step S402: predicting a predicted argument relationship between a first sample argument and a second sample argument based on semantic information of the sample text, and generating a first loss function according to an actual argument relationship and a predicted argument relationship between the first sample argument and the second sample argument.

[0115] In an embodiment of the present application, the initial relationship prediction model includes an initial relationship prediction network, and the N sample dialogue phrases include a first sample argument symbol and a second sample argument symbol. When predicting the predicted argument relationship between the first sample argument and the second sample argument based on the sample text semantic information, the computer device can obtain the first sample phrase hidden state corresponding to the first sample argument symbol from the N sample phrase hidden states included in the sample text semantic information based on the initial relationship prediction network, perform maximum pooling processing on the first sample phrase hidden state and the first initial sample argument hidden state, and obtain the first sample argument hidden state of the first sample argument symbol; obtain the second sample phrase hidden state corresponding to the second sample argument symbol from the N sample phrase hidden states, perform maximum pooling processing on the second sample phrase hidden state and the second initial sample argument hidden state, and obtain the second sample argument hidden state of the second sample argument symbol. Optionally, the first sample argument hidden state and the second sample argument hidden state can also be generated in a shared encoder. In the initial relationship prediction model, the first sample argument hidden state and the second sample argument hidden state obtained by the shared encoder are input into the initial relationship prediction network. Furthermore, the computer device can concatenate the sample global hidden state, the first sample argument hidden state and the second sample argument hidden state to obtain the sample hidden state information; and predict the predicted argument relationship between the first sample argument and the second sample argument based on the sample hidden state information.

[0116] Furthermore, when predicting the predicted argument relationship between the first sample argument and the second sample argument based on the sample hidden state information, the sample hidden state information is semantically enhanced to obtain sample enhanced semantic information. Optionally, the computer device can semantically enhance the sample hidden state information based on a fusion network, and the fusion network can be any network that can perform semantic enhancement, such as a network including one or at least two highway networks, etc. Based on the sample enhanced semantic information, the sample relationship prediction probabilities of M candidate argument relationships corresponding to the first sample argument and the second sample argument are predicted, and the candidate argument relationship with the largest sample relationship prediction probability is determined as the predicted argument relationship between the first sample argument and the second sample argument, where M is a positive integer.

[0117] Furthermore, the computer device can generate a first loss function based on the actual argument relationship and the predicted argument relationship between the first sample argument and the second sample argument. The first loss function can be a binary cross entropy loss, a logarithmic loss function, or a square loss function between the actual argument relationship and the predicted argument relationship, and is not limited here.

[0118] Specifically, Figure 6 As shown, the first sample argument symbol S is obtained from the N sample phrase hidden states included in the sample text semantic information. 1The corresponding hidden state of the first sample phrase is etc., for the hidden state of the first sample phrase and the hidden state of the first initial sample argument Perform maximum pooling to obtain the first sample argument hidden state of the first sample argument symbol Get the second sample argument symbol S from the hidden state of N sample phrases 2 The corresponding hidden state of the second sample phrase is etc., for the hidden state of the second sample phrase and the hidden state of the second initial sample argument Perform maximum pooling to obtain the second sample argument hidden state of the second sample argument symbol In the initial relationship prediction network 602, the global hidden state h of the sample [CLS] , the first sample argument hidden state And the second sample argument hidden state The sample hidden state information 6021 is concatenated to obtain the predicted argument relationship between the first sample argument and the second sample argument based on the sample hidden state information 6021. The sample hidden state information 6021 can be denoted as h, The global hidden state of the sample represents the global semantic information in the sample text sequence data, and integrates the relationship between each phrase in the sample text sequence data and the sample global semantic symbol. The first sample argument hidden state represents the local semantic information related to the first sample argument, and the second sample argument hidden state represents the local semantic information related to the second sample argument. The global hidden state of the sample h [CLS] , the first sample argument hidden state And the second sample argument hidden state The sample latent state information 6021 is obtained by splicing, so that the sample latent state information can include global semantic information and local semantic information in the sample text sequence data, etc., and the features in the sample text sequence data can be extracted more comprehensively, thereby improving the accuracy of relationship prediction.

[0119] Step S403, obtaining hidden characters in the sample dialogue text and the sample argument pair, predicting predicted characters corresponding to the hidden characters, and generating a second loss function according to the hidden characters and the predicted characters.

[0120] In the embodiment of the present application, the sample text sequence data also includes a first sample argument symbol and a second sample argument symbol, N is a positive integer; the initial relationship prediction model includes an initial phrase prediction network. When obtaining hidden characters in the sample dialogue text and the sample argument pair, the computer device can obtain k sequence phrases in the sample text sequence data based on the initial phrase prediction network; the k sequence phrases include N sample dialogue phrases, the first sample argument symbol and the second sample argument symbol; k is a positive integer, and the sample text sequence data is obtained by preprocessing the sample dialogue text and the sample argument pair, such as Figure 6 "[CLS]S 1 :Mom! S 2 :Sweetie……[SEP]S 1 [SEP]S 2 [SEP]”, obtain k sequence phrases in the sample text sequence data 6012, and the k sequence phrases may include “[CLS]”, “S 1 ”, “Mom”, “S 2 ”…、“S 1 ” and “S 2 ”, etc. Optionally, the k sequence phrases may not include sample text concatenation symbols. Further, the character states corresponding to the k sequence phrases in the sample text sequence data are detected, and the sequence phrases whose character states are hidden are determined as hidden characters. Specifically, the computer device may detect the character states corresponding to the k sequence phrases in the sample text sequence data based on the default hidden probability, that is, the probability that the character state corresponding to each sequence phrase is hidden is the default hidden probability. For example, if the default hidden probability is 10%, the sequence phrases in the k sequence phrases are randomly hidden with a probability of 10%. Optionally, an argument sequence phrase may be obtained from the k sequence phrases, and the hidden characters may be determined from the argument sequence phrase. The argument sequence phrase refers to a sequence phrase for an argument, or may be a sequence phrase corresponding to the first sample argument and the second sample argument, so that the characteristics of the argument can be captured. Through the phrase prediction task, the model can distinguish the arguments in the sample dialogue text, and based on the context information of the argument, the characteristics of the argument can be obtained, which is helpful for predicting the argument relationship between sample argument pairs.

[0121] Furthermore, the computer device can predict the predicted character corresponding to the hidden character. Specifically, the hidden character in the sample text sequence data is replaced with a character mask, the character association information between the associated sequence phrase of the hidden character and the character mask is obtained, and the masked hidden state of the character mask is obtained according to the character association information; the associated sequence phrase is a sequence phrase other than the hidden character in the k sequence phrases. Among them, the computer device can obtain the masked hidden state of the character mask based on a pre-trained language network, that is, the above process (the process of replacing the hidden character with the character mask until the masked hidden state of the character mask is obtained) can be implemented based on a pre-trained language network. Furthermore, feature extraction is performed on the masked hidden state to predict the predicted character corresponding to the character mask. Optionally, the predicted character corresponding to the character mask can be predicted on the vocabulary through a non-linear classifier or the like. As Figure 6 In the initial phrase prediction network 603, hidden characters in the sample text sequence data are obtained, the hidden characters are replaced with character masks, the masked hidden states corresponding to the character masks are extracted, and the predicted characters corresponding to the character masks are predicted based on the masked hidden states. The initial phrase prediction network 603 is used to perform phrase prediction tasks.

[0122] Furthermore, the computer device may generate a second loss function based on the hidden characters and the predicted characters. The second loss function may be a binary cross entropy loss, a logarithmic loss function, or a square loss function between the predicted characters and the hidden characters, and is not limited here.

[0123] Step S404, generating trigger word detection text data according to the actual argument relationship and the semantic information of the sample text, predicting the predicted sequence annotation in the trigger word detection text data, and generating a third loss function according to the actual sequence annotation and the predicted sequence annotation in the trigger word detection text data.

[0124] In an embodiment of the present application, the initial relationship prediction model includes an initial trigger word prediction network, wherein the trigger word refers to a word in the text that can clearly indicate the argument relationship. When generating trigger word detection text data based on the actual argument relationship and the semantic information of the sample text, the computer device can perform vector conversion on the actual argument relationship based on the initial trigger word prediction network to obtain the argument relationship vector corresponding to the actual argument relationship; the argument relationship vector is spliced ​​with the N sample phrase hidden states in the semantic information of the sample text to generate trigger word detection text data. Further, the computer device can perform phrase splitting on the trigger word detection text data to obtain t phrases to be annotated; t is a positive integer. Initial annotations are added to the t phrases to be annotated respectively, and the phrase association relationship of adjacent pairs of phrases to be annotated in the t phrases to be annotated is detected to detect whether each phrase to be annotated is the starting or ending boundary of the trigger word. The initial annotations corresponding to the t phrases to be annotated are updated based on the phrase association relationship to obtain the predicted annotations corresponding to the t phrases to be annotated respectively, and the predicted annotations corresponding to the t phrases to be annotated are composed of predicted sequence annotations. Optionally, the computer device can obtain the prediction sequence annotation in the trigger word detection text data based on the BIO annotation mode (B-begin, I-inside, O-outside), the BIOES annotation mode (B-begin, I-inside, O-outside, E-end, S-single) or only annotating the start boundary and end boundary of the trigger word. Figure 6 In the initial trigger word prediction network 604, the trigger word detection text data is predicted to obtain a prediction sequence label 6041, wherein the trigger word detection text data is obtained by splicing the argument relationship vector and the N sample phrase hidden states. Figure 6 e in r refers to the argument relationship vector, h i It refers to the i-th sample phrase hidden state among the N sample phrase hidden states.

[0125] Furthermore, the computer device can generate a third loss function based on the actual sequence annotations and predicted sequence annotations in the trigger word detection text data. The third loss function can be a binary cross entropy loss, a logarithmic loss function or a square loss function between the actual sequence annotations and the predicted sequence annotations, and is not limited here.

[0126] Optionally, the computer device can obtain the predicted argument relationship obtained in the initial relationship prediction network, perform vector conversion on the predicted argument relationship, obtain the predicted relationship vector corresponding to the predicted argument relationship, concatenate the predicted relationship vector with N sample phrase hidden states, generate trigger word test data, predict the test sequence annotation in the trigger word test data, and optimize and adjust the initial relationship prediction network based on the fourth loss function generated by the test sequence annotation and the actual sequence annotation.

[0127] Step S405 , adjusting the model parameters of the initial relationship prediction model according to the first loss function, the second loss function and the third loss function to generate a dialogue relationship prediction model.

[0128] In an embodiment of the present application, the dialogue relationship prediction model is used to predict the target argument relationship between the target argument pairs in the target dialogue text. Specifically, the computer device can generate a model loss function based on the first loss function, the second loss function and the third loss function, and adjust the model parameters of the initial relationship prediction model based on the model loss function, specifically, adjust the model parameters of each network in the initial relationship prediction model to generate a dialogue relationship prediction model. Optionally, the first loss function is recorded as L1, the second loss function is recorded as L2, and the third loss function is recorded as L3. Based on the first loss function, the second loss function and the third loss function, the model loss function is obtained, and the model loss function is "L=L1+L2+L3". The model parameters of the initial relationship prediction model are adjusted based on the model loss function. Through the above process, the relationship prediction task, phrase prediction task and trigger word prediction task are jointly trained in a multi-task learning manner, so that the information of the phrase prediction task and the trigger word prediction task can be provided to the relationship prediction task, that is, the relationship prediction task can obtain the feature information of the argument based on the phrase prediction task, and can obtain the trigger word information based on the trigger word prediction task, so that the relationship prediction task can more comprehensively obtain the information in the sample dialogue text, thereby improving the accuracy of relationship prediction. Among them, multi-task learning (MTL) is a machine learning method that considers multiple related tasks at the same time, and uses the internal relationship between each task to improve the generalization performance of a single task learning, that is, using the internal relationship between the relationship prediction task, the phrase prediction task and the trigger word prediction task to improve the generalization performance of the relationship prediction task.

[0129] In an embodiment of the present application, a sample dialogue text and a sample argument pair in the sample dialogue text are input into an initial relationship prediction model, and feature extraction is performed on the sample dialogue text and the sample argument pair in the initial relationship prediction model to obtain sample text semantic information corresponding to the sample dialogue text; the sample argument pair includes a first sample argument and a second sample argument; a predicted argument relationship between the first sample argument and the second sample argument is predicted based on the sample text semantic information, and a first loss function is generated according to the actual argument relationship and the predicted argument relationship between the first sample argument and the second sample argument; hidden characters in the sample dialogue text and the sample argument pair are obtained, predicted characters corresponding to the hidden characters are predicted, and a second loss function is generated according to the hidden characters and the predicted characters; trigger word detection text data is generated according to the actual argument relationship and the sample text semantic information, a predicted sequence annotation in the trigger word detection text data is predicted, and a third loss function is generated according to the actual sequence annotation and the predicted sequence annotation in the trigger word detection text data; model parameters of the initial relationship prediction model are adjusted according to the first loss function, the second loss function and the third loss function to generate a dialogue relationship prediction model; the dialogue relationship prediction model is used to predict the target argument relationship between the target argument pairs in the target dialogue text. Through the above process, this application divides conversational relationship extraction into three related subtasks, namely, relationship prediction task, phrase prediction task and trigger word prediction task. By integrating these three subtasks and jointly training the model, it is possible to make full use of the effective information learned from the phrase prediction task and the trigger word prediction task, and influence the relationship prediction task based on the effective information, thereby improving the accuracy of conversational relationship processing.

[0130] Further, see Figure 7 , Figure 7 This is a flow chart of a method for model prediction process provided by an embodiment of the present application. Figure 7 As shown in Figure 2, the model prediction process includes the following steps:

[0131] Step S701, input the target dialogue text and the target argument pair in the target dialogue text into the dialogue relationship prediction model, perform feature extraction on the target dialogue text and the target argument pair in the dialogue relationship prediction model, and obtain the target text semantic information corresponding to the target dialogue text, wherein the target argument pair includes a first target argument and a second target argument.

[0132] In an embodiment of the present application, a computer device splices a target dialogue text and a target argument pair based on a target text splicing symbol to generate target splicing text data; replaces a first target argument in the target splicing text data with a first target argument symbol, and replaces a second target argument in the target splicing text data with a second target argument symbol to generate target text sequence data; and performs feature extraction on the target text sequence data to obtain target text semantic information corresponding to the target dialogue text. The target text splicing symbol is the same as the sample text splicing symbol, but the names are different at different stages. For example, the sample text splicing symbol includes a sample global semantic symbol and a sample separator, etc. Assuming that the sample global semantic symbol is [CLS] and the sample separator is [SEP], the target text splicing symbol includes a target global semantic symbol and a target separator, etc. The target global semantic symbol is [CLS] and the target separator is [SEP]. Furthermore, the target text sequence data includes target dialogue sequence data corresponding to the target dialogue text, and the target dialogue sequence data includes v target dialogue phrases, where v is a positive integer. The computer device can extract hidden features of the target global semantic symbol, v target dialogue phrases, the first target argument symbol, and the second target argument symbol in the target text sequence data, respectively, to obtain the target global hidden state corresponding to the target global semantic symbol, the target phrase hidden states corresponding to the N target dialogue phrases, the first initial target argument hidden state corresponding to the first target argument symbol, and the second initial target argument hidden state corresponding to the second target argument symbol; the target global hidden state, the v target phrase hidden states, the first initial target argument hidden state, and the second initial target argument hidden state are determined as the target text semantic information corresponding to the target dialogue text. For details, see Figure 4 In step S401, the process of obtaining sample text semantic information corresponding to the sample dialogue text based on the sample dialogue text and the sample argument pair will not be described in detail here.

[0133] Optionally, the computer device may directly obtain the target dialogue text provided by the target user and the target argument pair in the target dialogue text. Alternatively, the computer device may obtain the target dialogue text and the dialogue consultation information associated with the target dialogue text, parse the dialogue consultation information, and extract the target argument pair in the dialogue consultation information; for example, the dialogue consultation information obtained is "What is the relationship between Speaker 2and Speaker4?", the dialogue consultation information is parsed, and the target argument pair in the dialogue consultation information is extracted, and it can be obtained that the target argument pair includes the first target argument "Speaker 2" and the second target argument "Speaker 4". Optionally, if the computer device obtains the first target argument in the dialogue consultation information, the dialogue consultation information is parsed to obtain the associated argument type, the argument corresponding to the associated argument type is obtained from the target dialogue text, and the argument corresponding to the associated argument type is determined as the second target argument, wherein the associated argument type includes but is not limited to a person type, an object type, or an animal type, etc., and the number of the second target arguments is one or at least two. Based on the dialogue relation prediction model, a target argument relation between the first target argument and each second target argument is obtained.

[0134] Step S702: predicting the target text semantic information based on the relationship prediction network in the dialogue relationship prediction model to obtain a target argument relationship between the first target argument and the second target argument.

[0135] In an embodiment of the present application, the dialogue relationship prediction model is obtained by training the initial relationship prediction model based on the first loss function, the second loss function and the third loss function; the initial relationship prediction model includes an initial relationship prediction network, an initial phrase prediction network and an initial trigger word prediction network; the first loss function is generated by the actual argument relationship and the predicted argument relationship between the first sample argument and the second sample argument, and the actual argument relationship is obtained by predicting the sample text semantic information corresponding to the sample dialogue text where the first sample argument and the second sample argument are located in the initial relationship prediction network; the second loss function is generated by hidden characters and predicted characters, and the predicted characters are obtained by predicting the hidden characters in the sample dialogue text, the first sample argument and the second sample argument in the initial phrase prediction network; the third loss function is generated by the actual sequence annotation and the predicted sequence annotation in the trigger word detection text data, and the trigger word detection text data is generated in the initial trigger word prediction network according to the actual argument relationship and the sample text semantic information, and the predicted sequence annotation is obtained by predicting the trigger word detection text data.

[0136] Among them, the computer device can adjust the model parameters of the initial relationship prediction model, delete the phrase prediction task area and the trigger word prediction task area, and obtain the dialogue relationship prediction model, which can simplify the model and reduce the resources occupied by the dialogue relationship prediction model. Alternatively, after the computer device adjusts the model parameters of the initial relationship prediction model, it retains the phrase prediction task area and the trigger word prediction task area to obtain the dialogue relationship prediction model, which is convenient for further optimization of the dialogue relationship prediction model. At this time, the model structure of the dialogue relationship prediction model can be as follows Figure 6 As shown. Among them, you can refer to Figure 5 In the training phase, the computer device performs joint training based on the relationship prediction task, the phrase prediction task and the trigger word prediction task to generate a dialogue relationship prediction model; in the testing phase, the relationship prediction result is obtained directly based on the relationship prediction task, and the relationship prediction result is used to represent the argument relationship between the argument pairs input into the dialogue relationship prediction model.

[0137] Furthermore, the computer device may generate target question and answer data based on the target dialogue text, dialogue consultation information and target argument pairs, and add the target question and answer data to a question and answer database.

[0138] Optionally, if the computer device obtains the first target argument in the dialogue consultation information, the dialogue consultation information is parsed to obtain the associated argument type. Specifically, if the computer device obtains the target argument relationship in the dialogue consultation information, the associated argument type corresponding to the target argument relationship is obtained, and the candidate argument corresponding to the associated argument type is obtained from the target dialogue text. The candidate argument relationship between the first target argument and the candidate argument is predicted based on the dialogue relationship prediction model, and the candidate argument whose candidate argument relationship is the target argument relationship is determined as the second target argument. The first target argument and the second target argument form a target argument pair, wherein the second target argument is the reply data of the dialogue consultation information, and the number of the candidate arguments is one or at least two. For example, the dialogue consultation information is “Who is the boss of Speaker 2?”, the first target argument “Speaker 2” is obtained in the dialogue consultation information, and the target argument relationship is “boss”. The associated argument type corresponding to the target argument relationship “boss” is the character type. It is assumed that the computer device obtains candidate arguments corresponding to the character type from the target dialogue text, and it is assumed that the candidate arguments include “Speaker 1, Speaker 3, and Speaker 4”. Based on the dialogue relationship prediction model, the candidate argument relationships between the first target argument and each candidate argument are predicted. It is assumed that the candidate argument relationship between the first target argument and the candidate argument “Speaker 1” is “subordinate”, the candidate argument relationship between the first target argument and the candidate argument “Speaker 3” is “friend”, and the candidate argument relationship between the first target argument and the candidate argument “Speaker 4” is “boss”, then the candidate argument “Speaker 4” is determined as the second target argument. The second target argument is the reply data of the dialogue consultation information, that is, Speaker 4 is Speaker 2's boss.

[0139] Specifically, the present application can be applied to information extraction business in the field of culture and tourism to optimize relationship prediction capabilities, quickly extract effective knowledge information from introduction documents, and customize private knowledge graphs; or, it can be applied to question-and-answer systems to help improve the knowledge base of question-and-answer systems and ensure that question-and-answer systems can answer user questions more effectively, etc., without limitation here.

[0140] Furthermore, in the model training stage, the input parameters of the initial relationship prediction model may also include task type, task version, usage area, input data path, output data path, and task identifier, etc., which are not limited here. For details, see Table 1:

[0141] Table 1

[0142]

[0143] Among them, in Table 1, the task type (Action) is used to indicate whether the task type of this model prediction task is a training type or a test type, etc., and the task type at this time can be a training type; the task version (Version) is used to indicate the version number or version generation time of the model used; the use area (Region) is used to indicate the regional list, product type or user list to which the model can be applied; the input data path (InputDatasetPath) is used to indicate the storage location path of the training samples used by the training model, etc.; the output data path (OutputModelPath) is used to indicate the storage location path of the model to be trained, etc.; the task identifier (ProjectId) is used to indicate the identifier (ID) of this model prediction task. Optionally, each input parameter in Table 1 may not be input into the initial relationship prediction model, but only be used as a log record for this model training phase.

[0144] Among them, the output parameters of the initial relationship prediction model may also include training completion time and task request identifier, etc., which are not limited here. For details, please refer to Table 2:

[0145] Table 2

[0146]

[0147]

[0148] Among them, in Table 2, the training completion time (TimeOfTrain) is used to indicate the duration or completion time of this model prediction task; the task request identifier (RequestId) is used to indicate the request identifier (ID) for requesting this model prediction task, which is the unique identifier of the request and can be used to indicate the scene change of the task, the user identifier of the initiator of the request, or the number of requests, etc.

[0149] Furthermore, in the model prediction stage, the input parameters of the dialogue relationship prediction model may also include task type, task version, usage area, input data path, output data path, and task identifier, etc., which are not limited here. For details, please refer to Table 3:

[0150] Table 3

[0151]

[0152] Among them, in Table 3, the task type (Action) is used to indicate whether the task type of this model prediction task is a training type or a test type, etc., and the task type at this time can be a test type or a prediction type; Version is used to indicate the version number or version generation time of the model used; Region is used to indicate the region list, product type or user list to which the model can be applied; Input data path (InputDatasetPath) is used to indicate the storage location path of the data used for testing the model or using the model, such as the storage path of the target dialogue text; Output data path (OutputModelPath) is used to indicate the storage location path of the trained model; Task ID (ProjectId) is used to indicate the ID (ID) of this model prediction task. Optionally, each input parameter in Table 3 may not be input into the dialogue relationship prediction model, but only be used as a log record in the model training phase.

[0153] The output parameters of the conversation relationship prediction model may also include an output result data path and a task request identifier, etc., which are not limited here. For details, please refer to Table 4:

[0154] Table 4

[0155]

[0156] Among them, in Table 4, the output result data path (OutputDatasetPath) is used to indicate the storage location path of the data obtained by this model prediction task, such as the target argument relationship, etc. The path can be a location path in the blockchain network, or a storage path in a computer device, or a storage path indicated by cloud storage technology, etc., and there is no restriction here; the task request identifier (RequestId) is used to indicate the request identifier (ID) for requesting this model prediction task, which is a unique identifier of the request and can be used to indicate the scene change of the task, the user identifier of the request initiator, or the number of requests, etc.

[0157] For further information, see Figure 8 , Figure 8 Schematic diagram of a conversation relationship processing device provided in an embodiment of the present application. The conversation relationship processing device may be a computer program (including program code, etc.) running in a computer device, for example, the conversation relationship processing device may be an application software; the device may be used to execute the corresponding steps in the method provided in an embodiment of the present application. Figure 8 As shown, the dialog relationship processing device 800 can be used for Figure 4The computer device in the corresponding embodiment, specifically, the device may include: a model input module 11, a semantic information extraction module 12, a relationship processing module 13, a first loss generation module 14, a character acquisition module 15, a phrase prediction module 16, a second loss generation module 17, a trigger detection generation module 18, a sequence labeling module 19, a third loss generation module 20 and a model training module 21.

[0158] A model input module 11, used for inputting sample dialogue text and sample argument pairs in the sample dialogue text into an initial relationship prediction model;

[0159] The semantic information extraction module 12 is used to extract features from the sample dialogue text and the sample argument pair in the initial relationship prediction model to obtain the sample text semantic information corresponding to the sample dialogue text; the sample argument pair includes a first sample argument and a second sample argument;

[0160] A relationship processing module 13, configured to predict a predicted argument relationship between a first sample argument and a second sample argument based on semantic information of the sample text;

[0161] A first loss generating module 14, configured to generate a first loss function according to an actual argument relationship and a predicted argument relationship between the first sample argument and the second sample argument;

[0162] A character acquisition module 15, used to acquire hidden characters in a sample dialogue text and a sample argument pair;

[0163] A phrase prediction module 16, used to predict the predicted characters corresponding to the hidden characters;

[0164] A second loss generating module 17, used to generate a second loss function according to the hidden characters and the predicted characters;

[0165] A trigger detection generation module 18 is used to generate trigger word detection text data according to the actual argument relationship and the sample text semantic information;

[0166] A sequence tagging module 19, for predicting the predicted sequence tags in the trigger word detection text data;

[0167] A third loss generating module 20, configured to generate a third loss function according to actual sequence annotations and predicted sequence annotations in the trigger word detection text data;

[0168] The model training module 21 is used to adjust the model parameters of the initial relationship prediction model according to the first loss function, the second loss function and the third loss function to generate a dialogue relationship prediction model; the dialogue relationship prediction model is used to predict the target argument relationship between the target argument pairs in the target dialogue text.

[0169] The semantic information extraction module 12 includes:

[0170] A sample splicing unit 121, used to splice the sample dialogue text and the sample argument pair based on the sample text splicing symbol to generate sample spliced ​​text data;

[0171] An argument replacement unit 122, used to replace the first sample argument in the sample concatenated text data with the first sample argument symbol, and replace the second sample argument in the sample concatenated text data with the second sample argument symbol, to generate sample text sequence data;

[0172] The information extraction unit 123 is used to extract features from the sample text sequence data to obtain sample text semantic information corresponding to the sample dialogue text.

[0173] The sample text concatenation symbol includes a sample global semantic symbol; the sample text sequence data includes sample dialogue sequence data corresponding to the sample dialogue text, and the sample dialogue sequence data includes N sample dialogue phrases, where N is a positive integer;

[0174] The information extraction unit 123 includes:

[0175] Hidden layer extraction subunit 1231, used for performing hidden layer feature extraction on the sample global semantic symbol, N sample dialogue phrases, first sample argument symbol and second sample argument symbol in the sample text sequence data, respectively, to obtain the sample global hidden state corresponding to the sample global semantic symbol, the sample phrase hidden states corresponding to the N sample dialogue phrases, the first initial sample argument hidden state corresponding to the first sample argument symbol and the second initial sample argument hidden state corresponding to the second sample argument symbol;

[0176] The semantic determination subunit 1232 is used to determine the sample global hidden state, N sample phrase hidden states, the first initial sample argument hidden state and the second initial sample argument hidden state as sample text semantic information corresponding to the sample dialogue text.

[0177] The hidden layer extraction subunit 1231 includes:

[0178] The global processing subunit 123a is used to obtain the sample global relations between the N sample dialogue phrases, the first sample argument symbol and the second sample argument symbol and the sample global semantic symbol respectively based on the pre-trained language network, perform feature fusion on the sample global relations, and generate the sample global hidden state corresponding to the sample global semantic symbol;

[0179] The state extraction subunit 123b is used to extract hidden features of the N sample dialogue phrases, the first sample argument symbol and the second sample argument symbol, respectively, to obtain the sample phrase hidden states corresponding to the N sample dialogue phrases, the first initial sample argument hidden state corresponding to the first sample argument symbol, and the second initial sample argument hidden state corresponding to the second sample argument symbol.

[0180] Wherein, the N sample dialogue phrases include a first sample argument symbol and a second sample argument symbol; the initial relationship prediction model includes an initial relationship prediction network;

[0181] The relationship processing module 13 includes:

[0182] A first argument recognition unit 131 is used to obtain a first sample phrase hidden state corresponding to a first sample argument symbol from N sample phrase hidden states included in the sample text semantic information based on an initial relationship prediction network, and perform maximum pooling processing on the first sample phrase hidden state and the first initial sample argument hidden state to obtain a first sample argument hidden state of the first sample argument symbol;

[0183] The second argument recognition unit 132 is used to obtain a second sample phrase hidden state corresponding to a second sample argument symbol from the N sample phrase hidden states, and perform maximum pooling processing on the second sample phrase hidden state and the second initial sample argument hidden state to obtain a second sample argument hidden state of the second sample argument symbol;

[0184] A hidden state concatenation unit 133 is used to concatenate the sample global hidden state, the first sample argument hidden state and the second sample argument hidden state to obtain sample hidden state information;

[0185] The relationship prediction unit 134 is used to predict the predicted argument relationship between the first sample argument and the second sample argument based on the sample hidden state information.

[0186] The relationship prediction unit 134 includes:

[0187] The semantic enhancement subunit 1341 is used to perform semantic enhancement on the latent state information of the sample to obtain enhanced semantic information of the sample;

[0188] The probability selection subunit 1342 is used to predict the sample relationship prediction probabilities of M candidate argument relationships corresponding to the first sample argument and the second sample argument based on the sample enhanced semantic information, and determine the candidate argument relationship with the largest sample relationship prediction probability as the predicted argument relationship between the first sample argument and the second sample argument; M is a positive integer.

[0189] The sample text sequence data further includes a first sample argument symbol and a second sample argument symbol, and N is a positive integer; the initial relationship prediction model includes an initial phrase prediction network;

[0190] The character acquisition module 15 comprises:

[0191] The phrase acquisition unit 151 is used to acquire k sequence phrases in the sample text sequence data based on the initial phrase prediction network; the k sequence phrases include N sample dialogue phrases, a first sample argument symbol and a second sample argument symbol; k is a positive integer;

[0192] The state detection unit 152 is used to detect the character states corresponding to the k sequence phrases in the sample text sequence data, and determine the sequence phrases whose character states are hidden states as hidden characters.

[0193] The phrase prediction module 16 includes:

[0194] The character association unit 161 is used to replace the hidden character in the sample text sequence data with a character mask, obtain the character association information between the associated sequence phrase of the hidden character and the character mask, and obtain the mask hidden state of the character mask according to the character association information; the associated sequence phrase is a sequence phrase in the k sequence phrases excluding the hidden character;

[0195] The character prediction unit 162 is used to extract features of the mask hidden state and predict the predicted character corresponding to the character mask.

[0196] Among them, the initial relationship prediction model includes an initial trigger word prediction network;

[0197] The trigger detection generation module 18 includes:

[0198] A vector conversion unit 181 is used to perform vector conversion on the actual argument relationship based on the initial trigger word prediction network to obtain an argument relationship vector corresponding to the actual argument relationship;

[0199] The data generating unit 182 is used to concatenate the argument relationship vector with the N sample phrase hidden states in the sample text semantic information to generate trigger word detection text data.

[0200] The sequence labeling module 19 includes:

[0201] The text splitting unit 191 is used to split the trigger word detection text data into phrases to obtain t phrases to be marked; t is a positive integer;

[0202] An initial annotation unit 192 is used to add initial annotations to the t phrases to be annotated respectively, and detect the phrase association relationship between adjacent phrase pairs to be annotated in the t phrases to be annotated;

[0203] The annotation updating unit 193 is used to update the initial annotations corresponding to the t phrases to be annotated based on the phrase association relationship, obtain the predicted annotations corresponding to the t phrases to be annotated, and compose the predicted annotations corresponding to the t phrases to be annotated into a predicted sequence annotation.

[0204] The embodiment of the present application provides a dialog relationship processing device, which can input a sample dialog text and a sample argument pair in the sample dialog text into an initial relationship prediction model, perform feature extraction on the sample dialog text and the sample argument pair in the initial relationship prediction model, and obtain sample text semantic information corresponding to the sample dialog text; the sample argument pair includes a first sample argument and a second sample argument; predict a predicted argument relationship between the first sample argument and the second sample argument based on the sample text semantic information, and generate a first loss function according to the actual argument relationship and the predicted argument relationship between the first sample argument and the second sample argument; obtain hidden characters in the sample dialog text and the sample argument pair, predict predicted characters corresponding to the hidden characters, and generate a second loss function according to the hidden characters and the predicted characters; generate trigger word detection text data according to the actual argument relationship and the sample text semantic information, predict predicted sequence annotations in the trigger word detection text data, and generate a third loss function according to the actual sequence annotations and the predicted sequence annotations in the trigger word detection text data; adjust model parameters of the initial relationship prediction model according to the first loss function, the second loss function, and the third loss function to generate a dialog relationship prediction model; the dialog relationship prediction model is used to predict the target argument relationship between target argument pairs in the target dialog text. Through the above process, this application divides conversational relationship extraction into three related subtasks, namely, relationship prediction task, phrase prediction task and trigger word prediction task. By integrating these three subtasks and jointly training the model, it is possible to make full use of the effective information learned from the phrase prediction task and the trigger word prediction task, and influence the relationship prediction task based on the effective information, thereby improving the accuracy of conversational relationship processing.

[0205] For further information, see Fig. 9 , Fig. 9 Schematic diagram of another conversation relationship processing device provided in an embodiment of the present application. The conversation relationship processing device may be a computer program (including program code, etc.) running in a computer device, for example, the conversation relationship processing device may be an application software; the device may be used to execute the corresponding steps in the method provided in an embodiment of the present application. Fig. 9 As shown, the dialog relationship processing device 900 can be used for Figure 7 The computer device in the corresponding embodiment may specifically include: a target model input module 31 , a target semantics acquisition module 32 and a target relationship prediction module 33 .

[0206] A target model input module 31, used for inputting a target dialogue text and a target argument pair in the target dialogue text into a dialogue relationship prediction model;

[0207] The target semantics acquisition module 32 is used to extract features of the target dialogue text and the target argument pair in the dialogue relationship prediction model to obtain target text semantic information corresponding to the target dialogue text; the target argument pair includes a first target argument and a second target argument;

[0208] The target relationship prediction module 33 is used to predict the semantic information of the target text based on the relationship prediction network in the dialogue relationship prediction model to obtain the target argument relationship between the first target argument and the second target argument; the dialogue relationship prediction model is obtained by training the initial relationship prediction model based on the first loss function, the second loss function and the third loss function; the initial relationship prediction model includes the initial relationship prediction network, the initial phrase prediction network and the initial trigger word prediction network; the first loss function is generated by the actual argument relationship and the predicted argument relationship between the first sample argument and the second sample argument, and the actual argument relationship is obtained by predicting the sample text semantic information corresponding to the sample dialogue text where the first sample argument and the second sample argument are located in the initial relationship prediction network; the second loss function is generated by hidden characters and predicted characters, and the predicted characters are obtained by predicting the hidden characters in the sample dialogue text, the first sample argument and the second sample argument in the initial phrase prediction network; the third loss function is generated by the actual sequence annotation and the predicted sequence annotation in the trigger word detection text data, and the trigger word detection text data is generated in the initial trigger word prediction network according to the actual argument relationship and the sample text semantic information, and the predicted sequence annotation is obtained by predicting the trigger word detection text data.

[0209] The target semantics acquisition module 32 includes:

[0210] A target splicing unit 321 is used to splice the target dialogue text and the target argument pair based on the target text splicing symbol to generate target spliced ​​text data;

[0211] A target replacement unit 322, used to replace the first target argument in the target concatenated text data with the first target argument symbol, and replace the second target argument in the target concatenated text data with the second target argument symbol, to generate target text sequence data;

[0212] The target acquisition unit 323 is used to extract features from the target text sequence data to obtain target text semantic information corresponding to the target dialogue text.

[0213] Wherein, the target model input module 31 includes:

[0214] The consultation acquisition unit 311 is used to acquire the target dialogue text and the dialogue consultation information associated with the target dialogue text;

[0215] A dialogue parsing unit 312, used to parse the dialogue consultation information and extract the target argument pairs in the dialogue consultation information;

[0216] A model input unit 313, used for inputting a target dialogue text and a target argument pair in the target dialogue text into a dialogue relationship prediction model;

[0217] The device 900 further includes:

[0218] The data storage module 34 is used to generate target question and answer data according to the target dialogue text, dialogue consultation information and target argument pairs, and add the target question and answer data to the question and answer database.

[0219] See also Fig.10 , Fig.10 Schematic diagram of the structure of a computer device provided in an embodiment of the present application. Fig. 9 As shown, the computer device in the embodiment of the present application may include: one or more processors 1001, a memory 1002, and an input-output interface 1003. The processor 1001, the memory 1002, and the input-output interface 1003 are connected via a bus 1004. The memory 1002 is used to store a computer program, which includes program instructions, and the input-output interface 1003 is used to receive data and output data, such as for data interaction between various networks in the model, or for data interaction between the computer device and the user device; the processor 1001 is used to execute the program instructions stored in the memory 1002.

[0220] Wherein, when the processor 1001 is located in a computer device for model training, the following operations may be performed:

[0221] Inputting the sample dialogue text and the sample argument pair in the sample dialogue text into the initial relationship prediction model, performing feature extraction on the sample dialogue text and the sample argument pair in the initial relationship prediction model, and obtaining sample text semantic information corresponding to the sample dialogue text; the sample argument pair includes a first sample argument and a second sample argument;

[0222] Predicting a predicted argument relationship between a first sample argument and a second sample argument based on semantic information of the sample text, and generating a first loss function according to an actual argument relationship and a predicted argument relationship between the first sample argument and the second sample argument;

[0223] Obtain hidden characters in the sample dialogue text and the sample argument pair, predict predicted characters corresponding to the hidden characters, and generate a second loss function according to the hidden characters and the predicted characters;

[0224] Generate trigger word detection text data according to the actual argument relationship and the semantic information of the sample text, predict the predicted sequence annotation in the trigger word detection text data, and generate a third loss function according to the actual sequence annotation and the predicted sequence annotation in the trigger word detection text data;

[0225] The model parameters of the initial relationship prediction model are adjusted according to the first loss function, the second loss function and the third loss function to generate a dialogue relationship prediction model; the dialogue relationship prediction model is used to predict the target argument relationship between the target argument pairs in the target dialogue text.

[0226] Wherein, when the processor 1001 is located in a computer device for performing model prediction, the processor 1001 may perform the following operations:

[0227] Inputting the target dialogue text and the target argument pair in the target dialogue text into the dialogue relation prediction model, performing feature extraction on the target dialogue text and the target argument pair in the dialogue relation prediction model, and obtaining target text semantic information corresponding to the target dialogue text; the target argument pair includes a first target argument and a second target argument;

[0228] The target text semantic information is predicted based on the relation prediction network in the dialogue relation prediction model to obtain the target argument relation between the first target argument and the second target argument; the dialogue relation prediction model is obtained by training the initial relation prediction model based on the first loss function, the second loss function and the third loss function; the initial relation prediction model includes the initial relation prediction network, the initial phrase prediction network and the initial trigger word prediction network; the first loss function is generated by the actual argument relation and the predicted argument relation between the first sample argument and the second sample argument, and the actual argument relation is obtained by predicting the sample text semantic information corresponding to the sample dialogue text where the first sample argument and the second sample argument are located in the initial relation prediction network; the second loss function is generated by the hidden characters and the predicted characters, and the predicted characters are obtained by predicting the hidden characters in the sample dialogue text, the first sample argument and the second sample argument in the initial phrase prediction network; the third loss function is generated by the actual sequence annotation and the predicted sequence annotation in the trigger word detection text data, and the trigger word detection text data is generated in the initial trigger word prediction network according to the actual argument relation and the sample text semantic information, and the predicted sequence annotation is obtained by predicting the trigger word detection text data.

[0229] In some feasible implementations, the processor 1001 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.

[0230] The memory 1002 may include a read-only memory and a random access memory, and provide instructions and data to the processor 1001 and the input / output interface 1003. A portion of the memory 1002 may also include a non-volatile random access memory. For example, the memory 902 may also store information about the device type.

[0231] In a specific implementation, the computer device can execute the following operations through its built-in functional modules: Figure 4 or Figure 7 For details on the implementation methods provided in each step, please refer to the Figure 4 or Figure 7 The implementation methods provided in each step will not be repeated here.

[0232] The embodiment of the present application provides a computer device, including: a processor, an input / output interface, and a memory, wherein the processor obtains a computer program in the memory and executes the computer program. Figure 4The various steps of the method shown in are used to perform the dialogue relationship processing operation. The embodiment of the present application realizes inputting sample dialogue text and sample argument pairs in the sample dialogue text into an initial relationship prediction model, extracting features of the sample dialogue text and the sample argument pairs in the initial relationship prediction model, and obtaining sample text semantic information corresponding to the sample dialogue text; the sample argument pairs include a first sample argument and a second sample argument; predicting a predicted argument relationship between the first sample argument and the second sample argument based on the sample text semantic information, and generating a first loss function according to the actual argument relationship and the predicted argument relationship between the first sample argument and the second sample argument; obtaining hidden characters in the sample dialogue text and the sample argument pairs, predicting predicted characters corresponding to the hidden characters, and generating a second loss function according to the hidden characters and the predicted characters; generating trigger word detection text data according to the actual argument relationship and the sample text semantic information, predicting predicted sequence annotations in the trigger word detection text data, and generating a third loss function according to the actual sequence annotations and the predicted sequence annotations in the trigger word detection text data; adjusting model parameters of the initial relationship prediction model according to the first loss function, the second loss function and the third loss function to generate a dialogue relationship prediction model; the dialogue relationship prediction model is used to predict the target argument relationship between target argument pairs in the target dialogue text. Through the above process, this application divides conversational relationship extraction into three related subtasks, namely, relationship prediction task, phrase prediction task and trigger word prediction task. By integrating these three subtasks and jointly training the model, it is possible to make full use of the effective information learned from the phrase prediction task and the trigger word prediction task, and influence the relationship prediction task based on the effective information, thereby improving the accuracy of conversational relationship processing.

[0233] The present application also provides a computer-readable storage medium storing a computer program suitable for being loaded and executed by the processor. Figure 4 or Figure 7 For details on the dialogue relationship processing methods provided in each step, please refer to the Figure 4 or Figure 7 The implementation methods provided in each step are not repeated here. In addition, the description of the beneficial effects of adopting the same method is not repeated. For technical details not disclosed in the computer-readable storage medium embodiment involved in this application, please refer to the description of the method embodiment of this application. As an example, the computer program can be deployed to execute on one computer device, or on multiple computer devices located in one place, or on multiple computer devices distributed in multiple locations and interconnected by a communication network.

[0234] The computer-readable storage medium may be the conversation relationship processing device provided in any of the aforementioned embodiments or the internal storage unit of the computer device, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device. Further, the computer-readable storage medium may also include both the internal storage unit of the computer device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.

[0235] The present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes Figure 4 or Figure 7 The method provided in the various optional methods realizes the division of conversational relationship extraction into three related subtasks, namely, relationship prediction task, phrase prediction task and trigger word prediction task. By integrating these three subtasks and jointly training the model, it is possible to make full use of the effective information learned from the phrase prediction task and the trigger word prediction task, and influence the relationship prediction task based on the effective information, thereby improving the accuracy of conversational relationship processing.

[0236] The terms "first", "second", etc. in the description, claims, and drawings of the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, device, product, or equipment that includes a series of steps or units is not limited to the listed steps or modules, but optionally includes steps or modules that are not listed, or optionally includes other step units inherent to these processes, methods, devices, products, or equipment.

[0237] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in this description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0238] The method and related apparatus provided by the embodiment of the present application are described with reference to the method flow chart and / or structural diagram provided by the embodiment of the present application. Specifically, each process and / or box in the method flow chart and / or structural diagram, as well as the combination of the processes and / or boxes in the flow chart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the process. Figure 1 A process or multiple processes and / or structures Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or structures Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A flow or multiple flows and / or structures illustrate the steps of the functions specified in one block or multiple blocks.

[0239] The steps in the method of the embodiment of the present application can be adjusted in order, combined and deleted according to actual needs.

[0240] The modules in the device of the embodiment of the present application can be merged, divided and deleted according to actual needs.

[0241] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.

Claims

1. A method for processing a dialogue relationship, characterized in that: The method comprises: Inputting a sample dialogue text and a sample argument pair in the sample dialogue text into an initial relationship prediction model, performing feature extraction on the sample dialogue text and the sample argument pair in the initial relationship prediction model to obtain sample text semantic information corresponding to the sample dialogue text; the sample argument pair includes a first sample argument and a second sample argument; Predicting a predicted argument relationship between the first sample argument and the second sample argument based on the semantic information of the sample text, and generating a first loss function according to an actual argument relationship between the first sample argument and the second sample argument and the predicted argument relationship; Obtaining hidden characters in the sample dialogue text and the sample argument pair, predicting predicted characters corresponding to the hidden characters, and generating a second loss function according to the hidden characters and the predicted characters; Generate trigger word detection text data according to the actual argument relationship and the sample text semantic information, predict the predicted sequence annotation in the trigger word detection text data, and generate a third loss function according to the actual sequence annotation in the trigger word detection text data and the predicted sequence annotation; The model parameters of the initial relationship prediction model are adjusted according to the first loss function, the second loss function and the third loss function to generate a dialogue relationship prediction model; the dialogue relationship prediction model is used to predict the target argument relationship between the target argument pairs in the target dialogue text.

2. The method according to claim 1, characterized in that The extracting features of the sample dialogue text and the sample argument pairs in the initial relationship prediction model to obtain sample text semantic information corresponding to the sample dialogue text includes: splicing the sample dialogue text and the sample argument pair based on the sample text splicing symbol in the initial relationship prediction model to generate sample spliced ​​text data; Replacing the first sample argument in the sample concatenated text data with the first sample argument symbol, and replacing the second sample argument in the sample concatenated text data with the second sample argument symbol, to generate sample text sequence data; Feature extraction is performed on the sample text sequence data to obtain sample text semantic information corresponding to the sample dialogue text.

3. The method according to claim 2, characterized in that The sample text concatenation symbol includes a sample global semantic symbol; the sample text sequence data includes sample dialogue sequence data corresponding to the sample dialogue text, and the sample dialogue sequence data includes N sample dialogue phrases, where N is a positive integer; The step of extracting features from the sample text sequence data to obtain sample text semantic information corresponding to the sample dialogue text includes: Performing hidden layer feature extraction on the sample global semantic symbol, the N sample dialogue phrases, the first sample argument symbol, and the second sample argument symbol in the sample text sequence data, respectively, to obtain a sample global hidden state corresponding to the sample global semantic symbol, sample phrase hidden states corresponding to the N sample dialogue phrases, a first initial sample argument hidden state corresponding to the first sample argument symbol, and a second initial sample argument hidden state corresponding to the second sample argument symbol; The sample global hidden state, the N sample phrase hidden states, the first initial sample argument hidden state, and the second initial sample argument hidden state are determined as sample text semantic information corresponding to the sample dialogue text.

4. The method according to claim 3, characterized in that The step of extracting hidden features from the sample global semantic symbol, the N sample dialogue phrases, the first sample argument symbol, and the second sample argument symbol in the sample text sequence data to obtain a sample global hidden state corresponding to the sample global semantic symbol, sample phrase hidden states corresponding to the N sample dialogue phrases, a first initial sample argument hidden state corresponding to the first sample argument symbol, and a second initial sample argument hidden state corresponding to the second sample argument symbol includes: Based on the pre-trained language network, obtaining sample global relations between the N sample dialogue phrases, the first sample argument symbol, the second sample argument symbol, and the sample global semantic symbol, respectively, performing feature fusion on the sample global relations, and generating sample global hidden states corresponding to the sample global semantic symbol; Hidden features are extracted for the N sample dialogue phrases, the first sample argument symbol, and the second sample argument symbol, respectively, to obtain sample phrase hidden states corresponding to the N sample dialogue phrases, a first initial sample argument hidden state corresponding to the first sample argument symbol, and a second initial sample argument hidden state corresponding to the second sample argument symbol.

5. The method according to claim 3, characterized in that The N sample dialogue phrases include the first sample argument symbol and the second sample argument symbol; the initial relationship prediction model includes an initial relationship prediction network; The predicting the predicted argument relationship between the first sample argument and the second sample argument based on the sample text semantic information includes: Based on the initial relationship prediction network, obtaining a first sample phrase hidden state corresponding to the first sample argument symbol from the N sample phrase hidden states included in the sample text semantic information, performing maximum pooling processing on the first sample phrase hidden state and the first initial sample argument hidden state to obtain a first sample argument hidden state of the first sample argument symbol; Obtaining a second sample phrase hidden state corresponding to the second sample argument symbol from the N sample phrase hidden states, performing maximum pooling processing on the second sample phrase hidden state and the second initial sample argument hidden state to obtain a second sample argument hidden state of the second sample argument symbol; Concatenating the sample global hidden state, the first sample argument hidden state, and the second sample argument hidden state to obtain sample hidden state information; A predicted argument relationship between the first sample argument and the second sample argument is predicted based on the sample hidden state information.

6. The method according to claim 5, characterized in that The predicting the predicted argument relationship between the first sample argument and the second sample argument based on the sample hidden state information includes: Performing semantic enhancement on the sample hidden state information to obtain sample enhanced semantic information; Based on the sample enhanced semantic information, predict the sample relationship prediction probabilities of M candidate argument relationships corresponding to the first sample argument and the second sample argument, and determine the candidate argument relationship with the largest sample relationship prediction probability as the predicted argument relationship between the first sample argument and the second sample argument; M is a positive integer.

7. The method according to claim 3, characterized in that The sample text sequence data also includes the first sample argument symbol and the second sample argument symbol, and N is a positive integer; the initial relationship prediction model includes an initial phrase prediction network; The step of obtaining the hidden characters in the sample dialogue text and the sample argument pair includes: Based on the initial phrase prediction network, k sequence phrases in the sample text sequence data are obtained; the k sequence phrases include the N sample dialogue phrases, the first sample argument symbol and the second sample argument symbol; k is a positive integer; The character states respectively corresponding to k sequence phrases in the sample text sequence data are detected, and the sequence phrases whose character states are hidden states are determined as hidden characters.

8. The method according to claim 7, characterized in that The predicting the predicted character corresponding to the hidden character includes: The hidden character in the sample text sequence data is replaced with a character mask, character association information between the associated sequence phrase of the hidden character and the character mask is obtained, and a mask hidden state of the character mask is obtained according to the character association information; the associated sequence phrase is a sequence phrase in the k sequence phrases excluding the hidden character; Feature extraction is performed on the mask hidden state to predict the predicted character corresponding to the character mask.

9. The method according to claim 3, characterized in that The initial relationship prediction model includes an initial trigger word prediction network; The generating of trigger word detection text data according to the actual argument relationship and the sample text semantic information includes: Based on the initial trigger word prediction network, the actual argument relationship is vectorized to obtain an argument relationship vector corresponding to the actual argument relationship; The argument relationship vector is concatenated with the N sample phrase hidden states in the sample text semantic information to generate trigger word detection text data.

10. The method according to claim 1, characterized in that The predicting of the predicted sequence annotation in the trigger word detection text data includes: Splitting the trigger word detection text data into phrases to obtain t phrases to be annotated; t is a positive integer; Adding initial annotations to the t phrases to be annotated respectively, and detecting the phrase association relationship between adjacent phrase pairs to be annotated among the t phrases to be annotated; Based on the phrase association relationship, initial annotations corresponding to the t phrases to be annotated are updated to obtain predicted annotations corresponding to the t phrases to be annotated, and the predicted annotations corresponding to the t phrases to be annotated are combined into predicted sequence annotations.

11. A method for processing a dialogue relationship, characterized in that: The method comprises: Inputting a target dialogue text and a target argument pair in the target dialogue text into a dialogue relationship prediction model, performing feature extraction on the target dialogue text and the target argument pair in the dialogue relationship prediction model to obtain target text semantic information corresponding to the target dialogue text; the target argument pair includes a first target argument and a second target argument; The target text semantic information is predicted based on the relationship prediction network in the dialogue relationship prediction model, and the target argument relationship between the first target argument and the second target argument is obtained; the dialogue relationship prediction model is obtained by training the initial relationship prediction model based on the first loss function, the second loss function and the third loss function; the initial relationship prediction model includes an initial relationship prediction network, an initial phrase prediction network and an initial trigger word prediction network; the first loss function is generated by the actual argument relationship and the predicted argument relationship between the first sample argument and the second sample argument, and the actual argument relationship is the relationship between the first sample argument and the second sample argument in the initial relationship prediction network. The sample text semantic information corresponding to the sample dialogue text where the argument is located is predicted; the second loss function is generated by hidden characters and predicted characters, and the predicted characters are predicted in the initial phrase prediction network for the sample dialogue text, the first sample argument and the hidden characters in the second sample argument; the third loss function is generated by actual sequence annotation and predicted sequence annotation in the trigger word detection text data, and the trigger word detection text data is generated in the initial trigger word prediction network according to the actual argument relationship and the sample text semantic information, and the predicted sequence annotation is predicted for the trigger word detection text data.

12. The method according to claim 11, characterized in that The step of extracting features from the target dialogue text and the target argument pair in the dialogue relationship prediction model to obtain target text semantic information corresponding to the target dialogue text includes: splicing the target dialogue text and the target argument pair based on the target text splicing symbol to generate target spliced ​​text data; Replacing the first target argument in the target concatenated text data with the first target argument symbol, and replacing the second target argument in the target concatenated text data with the second target argument symbol, to generate target text sequence data; Feature extraction is performed on the target text sequence data to obtain target text semantic information corresponding to the target dialogue text.

13. The method according to claim 11, characterized in that The step of inputting the target dialogue text and the target argument pair in the target dialogue text into the dialogue relationship prediction model comprises: Acquiring a target dialogue text and dialogue consultation information associated with the target dialogue text; Parsing the dialogue consultation information to extract target argument pairs in the dialogue consultation information; Inputting the target dialogue text and the target argument pair in the target dialogue text into a dialogue relation prediction model; The method further comprises: Target question and answer data are generated according to the target dialogue text, the dialogue consultation information and the target argument pair, and the target question and answer data are added to a question and answer database.

14. A computer device, characterized in that: Includes processor, memory, input and output interfaces; The processor is connected to the memory and the input / output interface respectively, wherein the input / output interface is used to receive data and output data, the memory is used to store a computer program, and the processor is used to call the computer program so that the computer device executes the method described in any one of claims 1 to 10, or executes the method described in any one of claims 11 to 13.

15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which is suitable for being loaded and executed by a processor, so that a computer device having the processor executes the method according to any one of claims 1 to 10, or executes the method according to any one of claims 11 to 13.