Data processing method and device, computer storage medium and terminal

By extracting relevant features through pre-trained semantic representation models and attention mechanisms, and combining internal and external memory for conversational reasoning, it solves the problems of low semantic understanding accuracy and uninterpretable results of conversational robots, and achieves more accurate and intelligent user interaction.

CN114925181BActive Publication Date: 2024-10-18ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210479364.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-28
Publication Date
2024-10-18
Estimated Expiration
2042-04-28

AI Technical Summary

Technical Problem

Existing conversational robots have problems with low accuracy and uninterpretable results in semantic understanding. Especially in multi-round conversations, it is difficult to effectively use the above information and external memory for reasoning.

Method used

Use a pre-trained semantic representation model to encode the target sentence and its context, obtain associated semantic features, extract intent and slot features through the attention mechanism, perform classification processing to determine the type of sentence and reply information, and combine internal and external memory Make inferences and form interpretable output.

Benefits of technology

It improves the accuracy of machine semantic understanding, enables the dialogue system to more accurately understand user intentions and slots, provides interpretable answers, and improves the intelligence and user experience of human-computer interaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114925181B_ABST
    Figure CN114925181B_ABST
Patent Text Reader

Abstract

The embodiments of this specification provide a data processing method and device, a computer storage medium and a terminal. The method includes: obtaining the associated semantic features between the first vector corresponding to the target sentence and the second vector corresponding to the context of the target sentence, and classifying the associated semantic features to obtain the type of target information of the target sentence, wherein the type of target information of the target sentence is related to the context of the target sentence or related to the target sentence. According to the type of target information, the reply information to the target sentence is determined.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this specification relate to the field of human-computer interaction technology, and more particularly to a data processing method and device, a computer-readable storage medium, and a terminal. Background Art

[0002] With the development of artificial intelligence technology, many conversational robots have emerged in society, such as Microsoft XiaoIce and Google Assistant. In the industrial world, most conversational robots are task-based robots that can help people handle some simple daily tasks, such as ordering food, customer service, booking flights, etc. With the development of social economy, people have begun to realize the importance of financial management, but financial management is a highly professional and complex subject, and consulting professional manual financial advisors is expensive, so there is a huge market demand for intelligent financial assistants.

[0003] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of this specification, and therefore may include information that does not constitute prior art known to ordinary technicians in the field. Summary of the invention

[0004] The purpose of the embodiments of this specification is to provide a data processing method and device, a computer-readable storage medium and a terminal, which can at least to a certain extent improve the accuracy of the machine's semantic understanding during the interaction between the user and the machine.

[0005] Other features and advantages of the embodiments of the present specification will become apparent from the following detailed description or may be learned in part from the practice of the present specification.

[0006] According to the first aspect of the embodiments of the present specification, an associated semantic feature between a first vector and a second vector is obtained, wherein the first vector is a vector corresponding to a target sentence, and the second vector is a vector corresponding to the context of the target sentence; the associated semantic feature is classified to obtain the type of target information of the target sentence; the type of the target information is: related to the context of the target sentence or related to the target sentence; and according to the type of the target information, the reply information to the target sentence is determined.

[0007] In one embodiment of the present specification, before obtaining the associated semantic features between the first vector and the second vector, the method further includes: encoding the target sentence through a pre-trained semantic representation model to obtain a sentence vector corresponding to the target sentence, and using the sentence vector corresponding to the target sentence as the first vector; and encoding the context of the target sentence through the pre-trained semantic representation model to obtain a vector corresponding to the context of the target sentence, and using the vector corresponding to the context of the target sentence as the second vector.

[0008] In one embodiment of the present specification, the above-mentioned encoding of the target sentence to obtain the sentence vector corresponding to the target sentence includes: encoding the target sentence based on the role embedding layer in the above-mentioned pre-trained semantic representation model to obtain the first role feature corresponding to the target sentence; determining the sentence vector corresponding to the target sentence based on the first role feature.

[0009] In one embodiment of the present specification, the above-mentioned encoding of the context of the above-mentioned target sentence to obtain the vector corresponding to the context of the above-mentioned target sentence includes: encoding the context of the above-mentioned target sentence based on the role embedding layer in the above-mentioned pre-trained semantic representation model to obtain the second role feature corresponding to the context of the above-mentioned target sentence; determining the vector corresponding to the context of the above-mentioned target sentence based on the above-mentioned second role feature.

[0010] In one embodiment of the present specification, the above-mentioned obtaining of the associated semantic features between the first vector and the second vector includes: obtaining, through a first attention mechanism, features related to the intent of the above-mentioned first vector in the above-mentioned second vector to obtain associated intent features; obtaining, through a second attention mechanism, features related to the slots of the above-mentioned first vector in the above-mentioned second vector to obtain associated slot features; and determining the above-mentioned associated semantic features and the above-mentioned associated slot features as the above-mentioned associated semantic features.

[0011] In one embodiment of the present specification, the target information includes intent; the classification processing of the associated semantic features to obtain the type of target information of the target sentence includes: classification processing of the associated intent features to obtain the intent type of the target sentence; wherein the intent type of the target sentence is: related to the context of the target sentence or related to the target sentence.

[0012] In one embodiment of the present specification, after the above-mentioned associated intention features are classified and processed to obtain the intention type of the above-mentioned target sentence, the above-mentioned method also includes: if the intention type of the above-mentioned target sentence is related to the context of the above-mentioned target sentence, then at least one previous intention corresponding to the context of the above-mentioned target sentence is determined, and the intention of the above-mentioned target sentence is determined in the above-mentioned at least one previous intention; the above-mentioned determination of reply information to the above-mentioned target sentence based on the type of the above-mentioned target information includes: determining the reply information to the above-mentioned target sentence according to the intention of the above-mentioned target sentence.

[0013] In one embodiment of the present specification, after the above-mentioned associated intention features are classified and processed to obtain the intention type of the above-mentioned target sentence, the above-mentioned method also includes: if the intention type of the above-mentioned target sentence is related to the above-mentioned target sentence, then determining the intention of the above-mentioned target sentence according to the above-mentioned associated intention features; the above-mentioned determining the reply information to the above-mentioned target sentence according to the type of the above-mentioned target information includes: determining the reply information to the above-mentioned target sentence according to the intention of the above-mentioned target sentence.

[0014] In one embodiment of the present specification, the target information includes a slot; the classification processing of the associated semantic features to obtain the type of target information of the target sentence includes: classification processing of the associated slot features to obtain the slot type of the target sentence; wherein the slot type of the target sentence is: related to the context of the target sentence or related to the target sentence.

[0015] In one embodiment of the present specification, after the above-mentioned associated slot features are classified and processed to obtain the slot type of the above-mentioned target sentence, the above-mentioned method also includes: if the slot type of the above-mentioned target sentence is related to the context of the above-mentioned target sentence, then determine at least one previous slot corresponding to the context of the above-mentioned target sentence, and determine the slot of the above-mentioned target sentence in at least one previous slot corresponding to the context of the above-mentioned target sentence; the above-mentioned determination of reply information to the above-mentioned target sentence based on the type of the above-mentioned target information includes: determining the reply information to the above-mentioned target sentence based on the slot of the above-mentioned target sentence.

[0016] In one embodiment of the present specification, after the above-mentioned associated slot features are classified and processed to obtain the slot type of the above-mentioned target sentence, the above-mentioned method also includes: if the slot type of the above-mentioned target sentence is related to the above-mentioned target sentence, then determining the slot of the above-mentioned target sentence according to the above-mentioned first vector; the above-mentioned determining the reply information to the above-mentioned target sentence according to the type of the above-mentioned target information includes: determining the reply information to the above-mentioned target sentence according to the slot of the above-mentioned target sentence.

[0017] In one embodiment of the present specification, the slot type of the target sentence also includes: related to a preset slot, the method also includes: if the slot type of the target sentence is related to the preset slot, then determining the slot of the target sentence in the preset slot; the above-mentioned determining the reply information to the target sentence based on the type of the target information includes: determining the reply information to the target sentence based on the slot of the target sentence.

[0018] According to the second aspect of the embodiments of this specification, a data processing device is provided, which includes: an acquisition module, used to: acquire the associated semantic features between the first vector and the second vector, wherein the first vector is a vector corresponding to the target sentence, and the second vector is a vector corresponding to the context of the target sentence; a classification module, used to: classify the associated semantic features to obtain the type of target information of the target sentence; the type of the target information is: related to the context of the target sentence or related to the target sentence; a reply information determination module, used to: determine the reply information to the target sentence according to the type of the target information.

[0019] According to the third aspect of the embodiments of this specification, a terminal is provided, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the data processing method described in the first aspect when executing the computer program.

[0020] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the data processing method described in the first aspect is implemented.

[0021] According to a fifth aspect of the embodiments of this specification, a computer program product is provided. When the computer program product is run on a computer or a processor, the computer or the processor implements the data processing method described in the first aspect when executing the computer or the processor.

[0022] The data processing method and device, computer storage medium and terminal provided in the embodiments of this specification have the following technical effects:

[0023] The solution provided by the exemplary embodiments of this specification is applicable to the semantic understanding process of the machine, and completes the semantic understanding and outputs the answer information corresponding to the question through dialogue representation, dialogue extraction, dialogue reasoning, and dialogue reasoning interpretable text. Specifically, the target sentence and the context corresponding to the target sentence are encoded respectively through a pre-trained semantic representation model to obtain a first vector and a second vector, and then the associated semantic features between the first vector and the second vector are obtained, and the associated semantic features are classified to determine the semantic type and semantics of the target sentence, and finally the corresponding answer information is determined according to the semantics of the target sentence. This improves the accuracy of the machine's semantic understanding and makes the semantic understanding results interpretable.

[0024] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present specification. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The accompanying drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the specification, and together with the specification are used to explain the principles of the specification. Obviously, the accompanying drawings described below are only some embodiments of the specification, and for those of ordinary skill in the art, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0026] Figure 1 A diagram schematically shows a usage scenario of a data processing method provided by an exemplary embodiment of this specification;

[0027] Figure 2 A flowchart of a data processing method provided by an exemplary embodiment of this specification is schematically shown;

[0028] Figure 3 A schematic diagram showing the structure of a data processing system provided by an exemplary embodiment of this specification is shown;

[0029] Figure 4 A flowchart of a method for determining a first vector and a second vector provided according to an exemplary embodiment of this specification is schematically shown;

[0030] Figure 5 A flowchart of a method for determining associated semantic features provided according to an exemplary embodiment of this specification is schematically shown;

[0031] Figure 6 A schematic diagram of a data processing device provided in an embodiment of the present specification is shown;

[0032] Figure 7 A schematic diagram of a data processing device provided by another embodiment of the present specification is shown;

[0033] Figure 8 A block diagram of a terminal provided in an embodiment of the present specification is schematically shown. DETAILED DESCRIPTION

[0034] In order to make the purpose, technical solutions and advantages of this specification more clear, the embodiments of this specification will be further described in detail below with reference to the accompanying drawings.

[0035] When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this specification. Instead, they are only examples of devices and methods consistent with some aspects of this specification as detailed in the attached claims.

[0036] In the description of this specification, it should be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in this specification can be understood according to specific circumstances. In addition, in the description of this specification, unless otherwise specified, "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previously associated objects are in an "or" relationship.

[0037] The core module of human-computer interaction equipment is used for natural-language understanding (NLU) of user language, which usually includes two tasks: intent understanding and slot recognition. With the development of technology, the process of human-computer interaction has become more and more complicated, and it is usually necessary to rely on the above information and external information of the dialogue to analyze and judge the user's semantics. Among them, the external information of the dialogue includes the information recorded in the background of the system, the knowledge of transaction experts, and so on. In order to improve the accuracy of semantic understanding and thus enhance the user's intelligent experience of using the dialogue system, the dialogue system must have the ability to understand and reason about semantics combined with different contextual scenarios.

[0038] In the related art, there are two commonly used technical solutions when building a dialogue model in a dialogue system. One is single-round dialogue modeling, combined with a dialogue management model (DM) for multi-round dialogue understanding. The disadvantage of this solution is that model errors are easily cascaded, and model optimization is not convenient. The other is simple multi-round dialogue modeling. The disadvantage of this solution is the lack of reasoning modules and external memory information input, and the multi-round dialogue understanding process is a black box, resulting in unexplainable semantic understanding results.

[0039] In response to the above problems, the embodiments of this specification provide a data processing method and device, a computer-readable storage medium and a terminal. Below, each step of the data processing method in this example implementation will be described in more detail in conjunction with the drawings and embodiments.

[0040] in, Figure 1 The following schematically shows a usage scenario diagram of a data processing method according to an exemplary embodiment of the present specification.

[0041] The embodiments of this specification propose a memory reasoning system for executing the above data processing method, and can realize human-computer dialogue based on the memory reasoning system. Figure 1As shown, when the user interacts with the machine, the machine receives the statements issued by the user, and the dialogue system will make corresponding responses to the received statements. Among them, the statement 1 issued by the user (recorded as a question) and the machine's response to the statement 1 (recorded as an answer) are usually regarded as a round of dialogue between the human and the machine. After the user inputs the question in the first round of dialogue, the dialogue system performs semantic understanding on the question, and outputs the response to the first round of dialogue. Next, a second round of dialogue may be launched. The dialogue system performs semantic understanding based on the questions raised by the user in the first round of dialogue and the second round of dialogue, determines whether the semantics of the second round of dialogue inherits the first round of dialogue or points to the second round of questions, and outputs the response to the second round of questions based on the judgment result. Similarly, the semantics for the third round of dialogue, the semantics for the fourth round of dialogue, and the semantics for the nth round of dialogue are all determined based on the questions raised by the user in the round of dialogue and the context of the round of dialogue. That is, when the user raises the latest question (which can be recorded as the current question and the target sentence), the dialogue system will determine whether the semantics of the target sentence inherits the previous dialogue or points to the target sentence based on the target sentence and the previous dialogue corresponding to the target sentence, and output the answer to the target sentence.

[0042] Figure 2 The flowchart of the data processing method according to an exemplary embodiment of the present specification is schematically shown. Figure 3 A schematic diagram of the structure of a data processing system according to an exemplary embodiment of the present specification is shown.

[0043] This specification embodiment will be combined with Figure 3 The data processing system shown is Figure 2 The embodiment shown is described in detail, wherein Figure 3 As shown, the data processing system is the above-mentioned memory reasoning system, and the overall model is a framework based on multi-task learning, including: a pre-trained semantic representation model 310, a dialogue extraction model 320, a dialogue reasoning model 330, and a dialogue response module 340. Exemplarily, the relevant dialogue is semantically represented by the pre-trained semantic representation model 310, and then the dialogue extraction model 320 and the dialogue reasoning model 330 are jointly modeled and trained based on the semantic representation. Furthermore, after the above-mentioned joint modeling training, for the sentence input into the above-mentioned memory reasoning system, the above-mentioned multiple rounds of dialogue are first represented, and then the key information of the dialogue is extracted, and finally the learned dialogue representation is combined with the internal and external memory information to output the semantic understanding result of the end user, that is, the output of the intent and the slot. The specific execution process and model structure are introduced in detail below.

[0044] In S210, an associated semantic feature between a first vector and a second vector is obtained, wherein the first vector is a vector corresponding to the target sentence, and the second vector is a vector corresponding to the context of the target sentence.

[0045] In an exemplary embodiment, the first vector and the second vector are obtained based on a pre-trained semantic representation model in a data processing system.

[0046] In an exemplary embodiment, a target sentence (query) and the context corresponding to the target sentence are input into a memory reasoning system. Figure 3 As shown in the figure, the target sentence proposed by the user is "Well, analyze the rise and fall". From this sentence alone, it may be difficult to judge the user's specific intention, such as what specific rise and fall the user wants to analyze. Therefore, the intention and slot of the target sentence can be judged in combination with the context, that is, the previous conversation. For example, Figure 3 As shown, there are three rounds of the above dialogue between the user and the machine (Q represents the question raised by the user, and A represents the answer made by the machine): the first round is "Q1: Fund diagnosis; A1: Which fund do you want to see the diagnosis of?"; the second round is "Q2: How is the grading of XX CSI Baijiu Index? A2: The diagnosis result of the fund: XX CSI Baijiu Index grading..."; the third round is "Q3: Zhi Xiaobao is very smart; A3: Thank you for the compliment, sir". The above dialogue and the target sentence are used as the input of the memory reasoning system, and the target sentence query and the context of the query are obtained through the pre-trained BERT model for semantic representation.

[0047] Exemplarily, the number of rounds of the preceding dialogue input into the memory reasoning system may be at most 5 rounds, and at least no preceding dialogue input may be input, such as the first round of dialogue in human-computer interaction.

[0048] For example, Figure 4 The flowchart of the method for determining the first vector and the second vector in an exemplary embodiment of the present specification is schematically shown, with reference to Figure 4 , the embodiment shown in the figure includes:

[0049] S410, encoding the target sentence through the pre-trained semantic representation model to obtain a sentence vector corresponding to the target sentence, and using the sentence vector corresponding to the target sentence as the first vector. And S420, encoding the context of the target sentence through the pre-trained semantic representation model to obtain a vector corresponding to the context of the target sentence, and using the vector corresponding to the context of the target sentence as the second vector.

[0050] Exemplarily, the above-mentioned pre-trained semantic representation model is a pre-trained BERT model (Bidirectional Encoder Representations from Transformers), which is used for semantic representation.

[0051] In an exemplary embodiment, a dialogue modeling process for the target statement and the context of the target statement is performed: First, the target statement (query) and the context corresponding to the target statement are input into the pre-trained semantic representation model 310 for memory representation - multi-turn dialogue embedding representation. The specific implementation process is as follows:

[0052] The embodiment of this specification encodes based on the above-mentioned pre-trained BERT model and uses the bertcls symbol output representation to obtain the sentence vector corresponding to the target statement, that is, the first vector for speech representation of the above-mentioned target statement. The above-mentioned pre-trained BERT model encodes the context of the above-mentioned target statement and uses the bertcls symbol output representation to obtain the sentence vector corresponding to the context of the target statement, that is, the second vector for semantic representation of the context of the above-mentioned target statement.

[0053] In an exemplary embodiment, in order to improve the efficiency of human-machine dialogue, the embodiment of this specification adds a role embedding layer (Role Embedding) on the basis of the original BERT embedding layer (BERTEmbedding) to consider the representational role of different roles. As Figure 3 shown, the role embedding layer encodes the target statement and the corresponding context dialogue respectively to obtain the first role feature corresponding to the target statement and the second role feature corresponding to the context of the target statement. And a first vector corresponding to the target statement is determined based on the first role feature, and a second vector corresponding to the context of the target statement is determined based on the second role feature.

[0054] Among them, the first vector and the second vector use the BERTCLS symbol to output the sentence representation (Query Representation) (Qc: ['[CLS]', 'Q0', 'Q1'... 'Qn']) of the target statement and the sentence representation (Context Representation) of the context of the target statement. For example, Figure 3 the sentence representation Qc of the target statement in is: ['[CLS]', '嗯', '分', '析', '下', '涨', '跌'].

[0055] In an exemplary embodiment, the parameter initialization of the memory reasoning system includes two parts, in which the main task and base parameters (parameters of the BERT model) can use the model parameters of the historical version of Contextual NLU, and the reasoning task parameters are randomly initialized for training. The model can use old data information or continue iterative training on new data sets. Figure 3 As shown, the main tasks include: Task 1 Intent Detection and Task 2 Slot Extraction; the reasoning tasks include: Task 3 Intent Source Prediction and Task 4 Slot Source Prediction. Intent recognition is a semantic sentence classification problem, which can be classified using support vector machines (SVM), deep neural networks (DNN), etc., and is not limited in the embodiments of this specification.

[0056] As a specific implementation method of “obtaining the associated semantic feature between the first vector and the second vector” in S210, Figure 5 The flowchart of the method for determining the associated semantic features according to an exemplary embodiment of the present specification is schematically shown. Figure 5 , the embodiment shown in the figure includes:

[0057] S510, using the first attention mechanism, obtaining features related to the intent of the first vector in the second vector to obtain associated intent features. S520, using the second attention mechanism, obtaining features related to the slots of the first vector in the second vector to obtain associated slot features. And, S530, determining the associated semantic features and the associated slot features as associated semantic features.

[0058] In an exemplary embodiment, the first vector and the second vector are input into the dialogue extraction model 320, and memory extraction-multi-round dialogue understanding is performed based on the memory reasoning system. The specific implementation process is: attention (Attention) calculation is performed on the first vector and the second vector to extract the previous sentence information related to the target sentence, that is, the associated semantic features. Taking into account the incomplete consistency of the two tasks of intent and slot, the embodiment of this specification adopts two attention mechanism modules, namely the first attention mechanism module: the intent attention module (Intent Attention), and the second attention mechanism module: the slot attention module (Slot Attention), and weight score calculations are performed respectively to obtain the associated intent features and associated slot features of the first vector and the second vector. Among them, the calculation formula of Attention is as follows:

[0059]

[0060] Among them, Q represents the sentence representation of the target sentence, that is, the first vector; K and V represent the sentence representation of the context of the target sentence, that is, the second vector; represents the scaling factor to prevent the dot product of Q and K from being too large; softmax is a normalized exponential function to normalize the calculation result to a probability distribution.

[0061] Continue to refer Figure 2 After obtaining the associated semantic features between the first vector and the second vector through the above embodiment, execute S220 to classify the associated semantic features to obtain the type of target information of the target sentence; the type of target information is: related to the previous context of the target sentence or related to the target sentence.

[0062] In an exemplary embodiment, after the associated semantic features are obtained, the associated intent features and the associated slot features are input into the dialogue reasoning model 330 to perform memory reasoning-intent disambiguation / slot disambiguation. The memory reasoning task in the dialogue reasoning model 330 is divided into two parts: intent reasoning and slot reasoning, so as to obtain the type (source) of the target information (intent and slot) of the target sentence. Among them, the intent reasoning task includes intent disambiguation and context intent inheritance; the slot reasoning task includes determining whether the slot refers to the previous slot and the specific reference position.

[0063] In an exemplary embodiment, the intent type (source) mainly includes the target sentence and the context of the target sentence. Task 3, the intent reasoning task, classifies and models the intent types of the associated intent features to determine whether the intent of the target sentence inherits the intent of the previous conversation or whether the target sentence has an intent transfer.

[0064] In an exemplary embodiment, the embodiment of this specification introduces two parts of memory, internal and external, in the memory reasoning system to provide output results for the reasoning task. Among them, the internal memory includes explicit dialogue context, including recognized previous intentions and previous slots, etc., and the external memory includes implicit dialogue context, mainly some preset slots related to user factors (such as positions, transactions, buy, sell, browse, add to favorites, etc. in the financial field).

[0065] In an exemplary embodiment, Figure 3 As shown, if the output of the intention reasoning task indicates that the intention of the associated intention feature points to the previous context, the current intention can inherit the previous dialogue, and the previous intention can be determined from the internal memory (Local, local part) of the dialogue memory (Dialogue Memory) as the output (Output), that is, determine which sentence in the previous dialogue the intention of the target sentence inherits. Exemplarily, when the target sentence is: "Well, analyze the rise and fall", through the above processing of the memory reasoning system, it can be known that the user's current intention is pointing to the previous context, and then determine from the internal memory that the current intention is to inherit the intention in the second round of dialogue in the previous dialogue, in order to analyze the rise and fall of the fund, then the output target sentence's intention is "intent = evaluate_fund".

[0066] In an exemplary embodiment, Figure 3 As shown, if the output of the intent reasoning task indicates that the intent of the associated intent feature points to the target sentence, indicating that the current intent has shifted, the latest recognition result of the NLU model (Task1 intent recognition task) is used as the output. For example, if the above dialogue is still the content in the above example, and the target sentence is: "Help me choose a fund", then the user's intention has shifted at this time. After the NLU model recognizes the intent, the intent of the target sentence can be output as: "intent = select_fund".

[0067] In an exemplary embodiment, the intent reasoning task and the intent recognition task use the same representation vector, that is, the parameters used in IntentAttention are the same.

[0068] In an exemplary embodiment, the slot type (source) includes the target sentence, the context of the target sentence, and external memory. Task 4 slot reasoning task models the slot type to decide whether the current slot inherits the slot in the previous dialogue, or is updated in the target sentence, or needs to be obtained from external user factors. The model of the slot reasoning task can be a network model of a gate mechanism.

[0069] In an exemplary embodiment, Figure 3 As shown, if the output of the slot reasoning task indicates that the slot of the associated slot feature points to the previous text, then the slot is selected from the previous slot in the internal memory as the output, that is, it is determined which slot in the previous dialogue the slot of the target sentence corresponds to. For example, when the target sentence is: "Well, analyze the rise and fall", through the above processing of the memory reasoning system, it can be known that the slot corresponding to the target sentence is XX Liquor Index Classification, that is, the object of the rise and fall that the user wants to analyze is the "XX Liquor Index Classification" fund mentioned in the second round of dialogue above, then the slot of the output target sentence is "fund_name = 'XX Liquor Index Classification'".

[0070] In an exemplary embodiment, Figure 3 As shown, if the output of the slot reasoning task indicates that the slot of the associated slot feature points to the target sentence, the latest recognition result of the NLU model (Task2 slot extraction task) on the word vector in the first vector is used as the output. For example, if the above dialogue is still the content in the above example, and the target sentence is: "Analyze the rise and fall of XX Guozheng semiconductor chips", then the slot is updated at this time. After the NLU model recognizes and extracts the slot, the slot of the target sentence can be output as "fund_name = 'XX Guozheng semiconductor chips'".

[0071] In an exemplary embodiment, if the output of the slot reasoning task indicates that the slot associated with the slot feature points to the outside, then the corresponding slot is obtained from the user factor in the external memory according to different pointing categories. Figure 3 As shown, the user factor (Global) of the external memory stores some preset slots, such as holding, subscription, redemption, etc. When the slot of the target sentence matches the slot in the external memory, the corresponding slot can be directly obtained from the external memory as output. For example, if the above dialogue is still the content in the above example, and the target sentence is: "holding fund", then the slot of the target sentence is the same as the "holding" slot in the external memory, then the output slot of the target sentence is "holding".

[0072] In an exemplary embodiment, since the intent and slots are not consistent in their relevance to historical conversations, the slot reasoning task can be classified in the same way as the intent reasoning task, but does not share the parameters in Attention. By combining internal and external information with reasoning tasks, the machine (dialogue system) can be more accurate in its natural semantic understanding of user language, improving the intelligence of human-computer interaction and user experience.

[0073] Continue to refer Figure 2 After determining the type of the target information of the target sentence, execute S230 to determine the response information to the target sentence according to the type of the target information.

[0074] In an exemplary embodiment, the intent and slot of the target sentence are input into the dialogue reply module 340, and the reply information of the target sentence can be determined. The specific implementation method is as follows: After determining the intent and slot of the target sentence, the reply information to the target sentence can also be determined based on the obtained intent and slot. Exemplarily, taking the target sentence "held funds" in the above example as an example, the output of the Task4 slot reasoning task can be mapped into different reasoning texts as reply information. Exemplarily, refer to the external memory-holding reply information shown in Table 1:

[0075] Table 1

[0076]

[0077]

[0078] In an exemplary embodiment, a corresponding reasoning copy can be made according to the number of slots. As shown in Table 1, the column of the number of slots indicates the number of funds held by the user. The user may not have the fund held (no slot found), or hold one (only one slot), or hold multiple funds (multiple slots), then the corresponding reasoning copy can be formed according to the number of positions held. For example, when the slot is not found, the output reply information can be: "Sir, the fund you hold has not been found yet, do you want to see these"; when there is only one slot, the output reply information can be: "Sir, you currently hold this fund: ${fund_name} (fund name)"; when there are multiple slots, the output reply information can be: "Sir, you currently hold these funds (showing the funds held by the user), which one do you want to ask?".

[0079] In an exemplary embodiment, the above is a case where the slot type points to external memory. When the slot type points to the previous conversation or the target sentence, the corresponding reply information can also be formulated according to the slot of the target sentence. In addition to determining the reply information according to the slot of the target sentence, the reply information can also be determined according to the intention of the target sentence (the intention type points to the previous conversation or the target sentence), or the reply information can be determined according to the intention and slot of the target sentence, etc. Forming an interpretable text of the reasoning process and displaying it to the user can make the output result interpretable and more user-friendly.

[0080] In an exemplary embodiment, to further improve the semantic understanding effect of the memory reasoning system, the number of Attention calculations can be increased, or better memory extraction can be performed through a graph. The multi-round dialogue in the above text can also be rewritten to extract the main information and turn it into a sentence, thereby completing the multi-round dialogue understanding. In addition to using classification tasks for natural semantic understanding, generation tasks can also be used for natural semantic understanding. Current market information, graph information, regular knowledge, etc. can also be injected into the model to better understand user semantics.

[0081] The embodiments of this specification propose a set of simple and scalable data processing methods based on a multi-task learning framework of a pre-trained language model, and a memory reasoning system for executing the above method to address the problems existing in multi-round dialogues, which can simultaneously solve problems such as intent inheritance, intent disambiguation, and slot reference (internal and external), and the model has good generalization capabilities. The embodiments of this specification introduce internal memory and external memory into the memory reasoning system, jointly model the intent, slot and related reasoning information, and finally form an interpretable text of the reasoning process to display to the user, which can avoid the cascade transmission of errors in the model and the inconvenience of model optimization. And the modularity of the model is good, and the output semantic understanding results are interpretable. At the same time, the extraction module of key information between multi-round dialogues enables the memory reasoning system to have a more comprehensive understanding of the user's semantics, enables the machine to form a good interaction with the user, and improves the user's intelligent experience.

[0082] The following are device embodiments of this specification, which can be used to implement the method embodiments of this specification. For details not disclosed in the device embodiments of this specification, please refer to the method embodiments of this specification.

[0083] in, Figure 6 A structural diagram of a data processing device according to an exemplary embodiment of the present specification is shown.

[0084] The data processing device 600 in the embodiment of this specification includes: an acquisition module 610, a classification module 620, and a reply information determination module 630, wherein:

[0085] The acquisition module 610 is used to: acquire the associated semantic features between the first vector and the second vector, wherein the first vector is a vector corresponding to the target sentence, and the second vector is a vector corresponding to the context of the target sentence.

[0086] The classification module 620 is used to classify the associated semantic features to obtain the type of target information of the target sentence; the type of target information is: related to the previous context of the target sentence or related to the target sentence.

[0087] The reply information determination module 630 is used to determine the reply information for the target sentence according to the type of the target information.

[0088] Figure 7 A structural diagram of a data processing device according to another exemplary embodiment of the present specification is shown.

[0089] Before the acquisition module 610 acquires the associated semantic features between the first vector and the second vector, the apparatus further includes: a first vector determination module 640 and a second vector determination module 650. The first vector determination module 640 is used to: encode the target sentence through the pre-trained semantic representation model to obtain the sentence vector corresponding to the target sentence, and use the sentence vector corresponding to the target sentence as the first vector; the second vector determination module 650 is used to: encode the context of the target sentence through the pre-trained semantic representation model to obtain the vector corresponding to the context of the target sentence, and use the vector corresponding to the context of the target sentence as the second vector.

[0090] The first vector determination module 640 includes: a first encoding unit 6401 and a first vector determination unit 6402. The encoding unit 6401 is used to encode the target sentence based on the role embedding layer in the pre-trained semantic representation model to obtain the first role feature corresponding to the target sentence; the sentence vector determination unit 6402 is used to determine the sentence vector corresponding to the target sentence based on the first role feature.

[0091] The second vector determination module 650 includes: a second encoding unit 6501 and a second vector determination unit 6502. The second encoding unit 6501 is used to encode the context of the target sentence based on the role embedding layer in the pre-trained semantic representation model to obtain the second role feature corresponding to the context of the target sentence; the second vector determination unit 6502 is used to determine the vector corresponding to the context of the target sentence based on the second role feature.

[0092] The acquisition module 610 includes: an associated intention feature determination unit 6101, an associated slot feature determination unit 6102, and an associated semantic feature determination unit 6103. The associated intention feature determination unit 6101 is used to: obtain features related to the intention of the first vector in the second vector through the first attention mechanism to obtain associated intention features; the associated slot feature determination unit 6102 is used to: obtain features related to the slot of the first vector in the second vector through the second attention mechanism to obtain associated slot features; the associated semantic feature determination unit 6103 is used to: determine the associated semantic features and the associated slot features as associated semantic features.

[0093] In an exemplary embodiment, based on the above scheme, the target information includes intent. The above classification module 620 includes: an intent type determination unit 6201. The intent type determination unit 6201 is used to: classify the associated intent features to obtain the intent type of the target sentence; wherein the intent type of the target sentence is: related to the context of the target sentence or related to the target sentence.

[0094] The above device also includes: a first intention determination module 660. The first intention determination module 660 is used to: if the intention type of the target sentence is related to the context of the target sentence, determine at least one previous intention corresponding to the context of the target sentence, and determine the intention of the target sentence from the at least one previous intention.

[0095] The above-mentioned reply information determination module 630 includes: a first reply information determination unit 6301. The first reply information determination unit 6301 is used to: determine reply information to the target sentence according to the intention of the target sentence.

[0096] The above device further includes: a second intention determination module 670. The second intention determination module 670 is used to: if the intention type of the target sentence is related to the target sentence, determine the intention of the target sentence according to the associated intention feature.

[0097] The above-mentioned reply information determination module 630 includes: a second reply information determination unit 6302. The first reply information determination unit 6302 is used to: determine the reply information for the target sentence according to the intention of the target sentence.

[0098] In an exemplary embodiment, based on the above scheme, the target information includes a slot. The above classification module 620 includes: a slot type determination unit 6202. The slot type determination unit 6202 is used to: classify the associated slot features to obtain the slot type of the target sentence; wherein the slot type of the target sentence is: related to the previous context of the target sentence or related to the target sentence.

[0099] The above-mentioned device also includes: a first slot determination module 680. The first slot determination module 680 is used to: if the slot type of the target sentence is related to the context of the target sentence, determine at least one previous slot corresponding to the context of the target sentence, and determine the slot of the target sentence in the at least one previous slot corresponding to the context of the target sentence.

[0100] The above-mentioned reply information determination module 630 includes: a third reply information determination unit 6303. The third reply information determination unit 6303 is used to: determine the reply information for the target sentence according to the slot of the target sentence.

[0101] The above device further includes: a second slot determination module 690. The second slot determination module 690 is used to: if the slot type of the target sentence is related to the target sentence, determine the slot of the target sentence according to the first vector.

[0102] The above-mentioned reply information determination module 630 includes: a fourth reply information determination unit 6304. The fourth reply information determination unit 6304 is used to: determine the reply information for the target sentence according to the slot of the target sentence.

[0103] In an exemplary embodiment, based on the above scheme, the slot type of the target sentence is also: related to the preset slot. The above device also includes: a third slot determination module 6110. The third slot determination module 6110 is used to: if the slot type of the target sentence is related to the preset slot, determine the slot of the target sentence in the preset slot.

[0104] The above-mentioned reply information determination module 630 includes: a fifth reply information determination unit 6305. The fifth reply information determination unit 6305 is used to: determine the reply information for the target sentence according to the slot of the target sentence.

[0105] It should be noted that when the data processing device provided in the above embodiment executes the data processing method, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the data processing device provided in the above embodiment belongs to the same concept as the data processing method embodiment. Therefore, for details not disclosed in the device embodiment of this specification, please refer to the data processing method embodiment of this specification, which will not be repeated here.

[0106] The serial numbers of the embodiments of this specification are for description only and do not represent the advantages or disadvantages of the embodiments.

[0107] The embodiments of this specification also provide a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of the method of any of the above embodiments are implemented. The computer-readable storage medium may include, but is not limited to, any type of disk, including a floppy disk, an optical disk, a DVD, a CD-ROM, a micro drive, and a magneto-optical disk, a ROM, a RAM, an EPROM, an EEPROM, a DRAM, a VRAM, a flash memory device, a magnetic card or an optical card, a nanosystem (including a molecular memory IC), or any type of medium or device suitable for storing instructions and / or data.

[0108] The embodiments of the present specification also provide a terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of any of the above-mentioned embodiments when executing the program.

[0109] Figure 8 The structure diagram of the terminal according to an exemplary embodiment of this specification is schematically shown. Figure 8 As shown, the terminal 800 includes: a processor 801 and a memory 802 .

[0110] In the embodiments of this specification, the processor 801 is the control center of the computer system, which can be the processor of a physical machine or the processor of a virtual machine. The processor 801 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 801 may be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 801 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processor (CPU); the coprocessor is a low-power processor for processing data in the standby state.

[0111] In the embodiment of this specification, the processor 801 is specifically used for:

[0112] Obtaining associated semantic features between a first vector and a second vector, wherein the first vector is a vector corresponding to a target sentence, and the second vector is a vector corresponding to the context of the target sentence; classifying the associated semantic features to obtain the type of target information of the target sentence; the type of the target information is: related to the context of the target sentence or related to the target sentence; and determining reply information to the target sentence according to the type of the target information.

[0113] Furthermore, in one embodiment of the present specification, before obtaining the associated semantic features between the first vector and the second vector, it also includes: encoding the target sentence through a pre-trained semantic representation model to obtain a sentence vector corresponding to the target sentence, and using the sentence vector corresponding to the target sentence as the first vector; and encoding the context of the target sentence through the pre-trained semantic representation model to obtain a vector corresponding to the context of the target sentence, and using the vector corresponding to the context of the target sentence as the second vector.

[0114] Optionally, the above-mentioned encoding of the target sentence to obtain the sentence vector corresponding to the target sentence includes: encoding the target sentence based on the role embedding layer in the above-mentioned pre-trained semantic representation model to obtain the first role feature corresponding to the target sentence; determining the sentence vector corresponding to the target sentence based on the first role feature.

[0115] Optionally, the above-mentioned encoding of the context of the target sentence to obtain the vector corresponding to the context of the target sentence includes: encoding the context of the target sentence based on the role embedding layer in the above-mentioned pre-trained semantic representation model to obtain a second role feature corresponding to the context of the target sentence; determining the vector corresponding to the context of the target sentence based on the second role feature.

[0116] Optionally, the above-mentioned obtaining of associated semantic features between the first vector and the second vector includes: obtaining, through a first attention mechanism, features related to the intent of the above-mentioned first vector in the above-mentioned second vector to obtain associated intent features; obtaining, through a second attention mechanism, features related to the slots of the above-mentioned first vector in the above-mentioned second vector to obtain associated slot features; and determining the above-mentioned associated semantic features and the above-mentioned associated slot features as the above-mentioned associated semantic features.

[0117] Optionally, the target information includes intent; the classification processing of the associated semantic features to obtain the type of target information of the target sentence includes: classification processing of the associated intent features to obtain the intent type of the target sentence; wherein the intent type of the target sentence is: related to the context of the target sentence or related to the target sentence.

[0118] Optionally, after the above-mentioned associated intention features are classified and processed to obtain the intention type of the above-mentioned target sentence, it also includes: if the intention type of the above-mentioned target sentence is related to the context of the above-mentioned target sentence, then at least one previous intention corresponding to the context of the above-mentioned target sentence is determined, and the intention of the above-mentioned target sentence is determined in the above-mentioned at least one previous intention; the above-mentioned determination of reply information to the above-mentioned target sentence based on the type of the above-mentioned target information includes: determining the reply information to the above-mentioned target sentence according to the intention of the above-mentioned target sentence.

[0119] Optionally, after the above-mentioned associated intention features are classified and processed to obtain the intention type of the above-mentioned target sentence, it also includes: if the intention type of the above-mentioned target sentence is related to the above-mentioned target sentence, then the intention of the above-mentioned target sentence is determined according to the above-mentioned associated intention features; the above-mentioned determination of the reply information to the above-mentioned target sentence according to the type of the above-mentioned target information includes: determining the reply information to the above-mentioned target sentence according to the intention of the above-mentioned target sentence.

[0120] Optionally, the target information includes a slot; the classification processing of the associated semantic features to obtain the type of target information of the target sentence includes: classification processing of the associated slot features to obtain the slot type of the target sentence; wherein the slot type of the target sentence is: related to the context of the target sentence or related to the target sentence.

[0121] Optionally, after the above-mentioned associated slot features are classified and processed to obtain the slot type of the above-mentioned target sentence, it also includes: if the slot type of the above-mentioned target sentence is related to the context of the above-mentioned target sentence, then determine at least one previous slot corresponding to the context of the above-mentioned target sentence, and determine the slot of the above-mentioned target sentence in at least one previous slot corresponding to the context of the above-mentioned target sentence; the above-mentioned determining the reply information to the above-mentioned target sentence according to the type of the above-mentioned target information includes: determining the reply information to the above-mentioned target sentence according to the slot of the above-mentioned target sentence.

[0122] Optionally, after the above-mentioned associated slot features are classified and processed to obtain the slot type of the above-mentioned target sentence, it also includes: if the slot type of the above-mentioned target sentence is related to the above-mentioned target sentence, then the slot of the above-mentioned target sentence is determined according to the above-mentioned first vector; the above-mentioned determination of the reply information to the above-mentioned target sentence according to the type of the above-mentioned target information includes: determining the reply information to the above-mentioned target sentence according to the slot of the above-mentioned target sentence.

[0123] Optionally, the slot type of the target sentence also includes: related to a preset slot, and also includes: if the slot type of the target sentence is related to the preset slot, then determining the slot of the target sentence in the preset slot; the above-mentioned determining the reply information to the target sentence according to the type of the target information includes: determining the reply information to the target sentence according to the slot of the target sentence.

[0124] The memory 802 may include one or more computer-readable storage media, which may be non-transitory. The memory 802 may also include a high-speed random access memory and a non-volatile memory, such as one or more disk storage terminals and flash memory storage terminals. In some embodiments of the present specification, the non-transitory computer-readable storage medium in the memory 802 is used to store at least one instruction, which is used to be executed by the processor 801 to implement the method in the embodiment of the present specification.

[0125] In some embodiments, the terminal 800 further includes: a peripheral terminal interface 803 and at least one peripheral terminal. The processor 801, the memory 802 and the peripheral terminal interface 803 may be connected via a bus or a signal line. Each peripheral terminal may be connected to the peripheral terminal interface 803 via a bus, a signal line or a circuit board. Specifically, the peripheral terminal includes: at least one of a display screen 804, a camera 808 and an audio circuit 808.

[0126] The peripheral terminal interface 803 may be used to connect at least one peripheral terminal related to input / output (I / O) to the processor 801 and the memory 802. In some embodiments of the present specification, the processor 801, the memory 802, and the peripheral terminal interface 803 are integrated on the same chip or circuit board; in some other embodiments of the present specification, any one or two of the processor 801, the memory 802, and the peripheral terminal interface 803 may be implemented on a separate chip or circuit board. This embodiment of the present specification does not specifically limit this.

[0127] The display screen 804 is used to display the user interface (UI). The UI may include graphics, text, icons, videos and any combination thereof. When the display screen 804 is a touch display screen, the display screen 804 also has the ability to collect touch signals on the surface or above the surface of the display screen 804. The touch signal can be input to the processor 801 as a control signal for processing. At this time, the display screen 804 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments of the present specification, the display screen 804 can be one, and the front panel of the terminal 800 is set; in other embodiments of the present specification, the display screen 804 can be at least two, which are respectively set on different surfaces of the terminal 800 or are folded; in some other embodiments of the present specification, the display screen 804 can be a flexible display screen, which is set on the curved surface or folded surface of the terminal 800. Even, the display screen 804 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 804 can be prepared using materials such as a liquid crystal display (Liquid Crystal Display, LCD), an organic light-emitting diode (Organic Light-Emitting Diode, OLED), etc.

[0128] The camera 805 is used to capture images or videos. Optionally, the camera 805 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize panoramic shooting and virtual reality (VR) shooting function or other fusion shooting functions. In some embodiments of the present specification, the camera 805 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.

[0129] The audio circuit 808 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 801 for processing. For the purpose of stereo sound collection or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the terminal 800. The microphone may also be an array microphone or an omnidirectional collection microphone.

[0130] The power supply 805 is used to power various components in the terminal 800. The power supply 805 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 805 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery charged through a wired line, and a wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.

[0131] The terminal structure block diagram shown in the embodiment of this specification does not constitute a limitation on the terminal 800. The terminal 800 may include more or fewer components than those shown in the figure, or combine certain components, or adopt a different component arrangement.

[0132] In this specification, the terms "first", "second", etc. are used for descriptive purposes only and should not be understood as indicating or implying relative importance or order; the term "plurality" refers to two or more, unless otherwise clearly defined. The terms "installed", "connected", "connected", "fixed", etc. should be understood in a broad sense. For example, "connected" can be a fixed connection, a detachable connection, or an integral connection; "connected" can be a direct connection or an indirect connection through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms in this specification can be understood according to specific circumstances.

[0133] In the description of this specification, it is necessary to understand that the directions or positional relationships indicated by the terms "upper" and "lower" are based on the directions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing this specification and simplifying the description, rather than indicating or implying that the device or unit referred to must have a specific direction, be constructed and operated in a specific orientation. Therefore, it should not be understood as a limitation on this specification.

[0134] The embodiments of this specification also provide a computer-readable storage medium, which stores instructions, and when the instructions are executed on a computer or a processor, the computer or the processor executes one or more steps in the above embodiments. If the components of the above data processing device are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium.

[0135] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The above computer program product includes one or more computer instructions. When the above computer program instructions are loaded and executed on a computer, the above process or function according to the embodiment of this specification is generated in whole or in part. The above computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The above computer instructions can be stored in a computer-readable storage medium or transmitted by the above computer-readable storage medium. The above computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (Digital Subscriber Line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The above computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, data center, etc. that contains one or more available media integrated. The above-mentioned available media can be magnetic media (for example, floppy disks, hard disks, tapes), optical media (for example, digital versatile discs (DVD)), or semiconductor media (for example, solid state disks (SSD)), etc.

[0136] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0137] The above is only a specific implementation of this specification, but the protection scope of this specification is not limited to this. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in this specification, which should be included in the protection scope of this specification. Therefore, equivalent changes made according to the claims of this specification are still within the scope covered by this specification.

Claims

1. A data processing method, wherein: include: Acquire an associated semantic feature between a first vector and a second vector, wherein the first vector is a vector corresponding to a target sentence, and the second vector is a vector corresponding to a context of the target sentence; Classify the associated semantic features to obtain the type of target information of the target sentence; the type of the target information is: related to the previous context of the target sentence or related to the target sentence; Determining, according to the type of the target information, response information to the target sentence; The step of acquiring the associated semantic feature between the first vector and the second vector includes: Acquire features related to the intent of the first vector in the second vector through the first attention mechanism to obtain associated intent features; By using a second attention mechanism, features related to the slots of the first vector are obtained in the second vector to obtain associated slot features; The associated intention feature and the associated slot feature are determined as the associated semantic feature.

2. The method according to claim 1, wherein: Before acquiring the associated semantic feature between the first vector and the second vector, the method further includes: encoding the target sentence through a pre-trained semantic representation model to obtain a sentence vector corresponding to the target sentence, and using the sentence vector corresponding to the target sentence as the first vector; and The context of the target sentence is encoded by using the pre-trained semantic representation model to obtain a vector corresponding to the context of the target sentence, and the vector corresponding to the context of the target sentence is used as the second vector.

3. The method according to claim 2, wherein: The encoding of the target sentence to obtain a sentence vector corresponding to the target sentence includes: Encoding the target sentence based on the role embedding layer in the pre-trained semantic representation model to obtain a first role feature corresponding to the target sentence; A sentence vector corresponding to the target sentence is determined based on the first role feature.

4. The method according to claim 2, wherein: The encoding of the context of the target sentence to obtain a vector corresponding to the context of the target sentence includes: Encoding the context of the target sentence based on the role embedding layer in the pre-trained semantic representation model to obtain a second role feature corresponding to the context of the target sentence; A vector corresponding to the context of the target sentence is determined based on the second role feature.

5. The method according to claim 1, wherein: The target information includes intention; The classifying process of the associated semantic features to obtain the type of target information of the target sentence includes: Classifying the associated intention features to obtain the intention type of the target sentence; The intention type of the target sentence is: related to the context of the target sentence or related to the target sentence.

6. The method according to claim 5, wherein: After classifying the associated intention features to obtain the intention type of the target sentence, the method further includes: If the intention type of the target sentence is related to the context of the target sentence, then determining at least one previous intention corresponding to the context of the target sentence, and determining the intention of the target sentence from the at least one previous intention; The step of determining, according to the type of the target information, the response information to the target sentence includes: According to the intention of the target sentence, answer information to the target sentence is determined.

7. The method according to claim 5, wherein: After classifying the associated intention features to obtain the intention type of the target sentence, the method further includes: If the intention type of the target sentence is related to the target sentence, determining the intention of the target sentence according to the related intention feature; The step of determining, according to the type of the target information, the response information to the target sentence includes: According to the intention of the target sentence, answer information to the target sentence is determined.

8. The method according to claim 1, wherein: The target information includes a slot; The classifying process of the associated semantic features to obtain the type of target information of the target sentence includes: Classifying the associated slot features to obtain the slot type of the target sentence; The slot type of the target sentence is: related to the context of the target sentence or related to the target sentence.

9. The method according to claim 8, wherein: After classifying the associated slot features to obtain the slot type of the target sentence, the method further includes: If the slot type of the target sentence is related to the context of the target sentence, determining at least one previous slot corresponding to the context of the target sentence, and determining the slot of the target sentence in the at least one previous slot corresponding to the context of the target sentence; The step of determining, according to the type of the target information, the response information to the target sentence includes: According to the slot of the target sentence, response information to the target sentence is determined.

10. The method according to claim 8, wherein: After classifying the associated slot features to obtain the slot type of the target sentence, the method further includes: If the slot type of the target sentence is related to the target sentence, determining the slot of the target sentence according to the first vector; The step of determining, according to the type of the target information, the response information to the target sentence includes: According to the slot of the target sentence, response information to the target sentence is determined.

11. The method according to claim 8, wherein: The slot type of the target sentence also includes: related to the preset slot, the method also includes: If the slot type of the target sentence is related to the preset slot, determining the slot of the target sentence in the preset slot; The step of determining, according to the type of the target information, the response information to the target sentence includes: According to the slot of the target sentence, response information to the target sentence is determined.

12. A data processing device, characterized in that: include: An acquisition module, used to: acquire an associated semantic feature between a first vector and a second vector, wherein the first vector is a vector corresponding to a target sentence, and the second vector is a vector corresponding to a context of the target sentence; A classification module is used to classify the associated semantic features to obtain the type of target information of the target sentence; the type of the target information is: related to the previous context of the target sentence or related to the target sentence; A reply information determination module, used to: determine reply information to the target sentence according to the type of the target information; Wherein, the acquisition module includes: an associated intention feature determination unit, an associated slot feature determination unit and an associated semantic feature determination unit; The associated intention feature determination unit is used to: obtain features related to the intention of the first vector in the second vector through a first attention mechanism to obtain an associated intention feature; The associated slot feature determination unit is used to: obtain features related to the slot of the first vector in the second vector through a second attention mechanism to obtain associated slot features; The associated semantic feature determination unit is used to determine the associated intention feature and the associated slot feature as associated semantic features.

13. A terminal comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the data processing method according to any one of claims 1 to 11 is implemented.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the data processing method according to any one of claims 1 to 11 is implemented.

15. A computer program product comprising instructions, which, when the computer program product is run on a computer or a processor, causes the computer or the processor to execute the data processing method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Man-machine conversation sentiment analysis method based on layered gating circulation unit

    CN112100325A