Dialogue method and system based on neural network with adaptive connection
Through an adaptive connection-based neural network system, the problem of coherence and contextual relevance of chatbots in multiple rounds of conversations is solved, the ability to handle complex semantic tasks is improved, and the transfer of cross-domain knowledge is realized.
Patent Information
- Application Number
- CN202410937415.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2044-07-12
AI Technical Summary
Existing chatbots have difficulty effectively maintaining the coherence and contextual relevance of multiple rounds of conversations, resulting in them becoming a simple question-and-answer system that cannot handle complex semantic tasks.
Adopting a neural network system based on adaptive connections, including a history acquisition module, an input acquisition module and an answer generation module, the current response information is generated through activation units, adaptive parameter adjustment units and emotion recognition units, and the context-aware activation function and context-aware Weight generators and emotion encoders dynamically adjust network parameters and emotional states to enhance conversational consistency and contextual relevance.
It improves the processing ability of chatbots in complex semantic tasks, enhances topic coherence and contextual relevance in multiple rounds of conversations, solves the long-term dependence problem in long conversation processing, and realizes the transfer of cross-domain knowledge.
Smart Images

Figure CN118503391B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a dialogue method and system based on a neural network with adaptive connections. Background Art
[0002] In recent years, artificial intelligence technology has continued to mature, especially deep learning technology has continued to develop, and the development and use of chatbots has gradually become popular. In theory, chatbots can not only achieve emotional communication with humans, but can also be widely used in various customer service systems and consulting systems, saving a lot of human resources and improving work efficiency. There are many ways to implement chatbots, including the early ones that are completely rule-based, the later ones that are query-based or retrieval-based, and the later ones that are generative based on deep learning models. But no matter which way the chatbot is implemented, the capture and transmission of contextual information similar to human communication is a difficult problem in the current field. Because this problem cannot be solved, many chatbots have become a simple question-and-answer system that cannot effectively and accurately achieve multi-round dialogues.
[0003] In existing dialogue systems, maintaining topic coherence and context relevance in multi-round dialogues has always been a challenge. Although traditional long short-term memory network models have shown some effectiveness in processing long dialogues, they still have long-term dependency issues, which limits the coherence and semantic understanding of dialogues. At the same time, existing activation functions cannot fully capture and utilize historical dialogue information, which affects the chatbot's ability to handle complex semantic tasks.
[0004] Therefore, it is necessary to provide a conversation method and system based on an adaptively connected neural network to solve the multi-round conversation processing problem in the prior art, especially to improve topic coherence and context relevance. Summary of the invention
[0005] The present invention provides a dialogue system based on an adaptively connected neural network, comprising: a history acquisition module for acquiring historical dialogue information; an input acquisition module for acquiring current user input information; and an answer generation module for generating current response information based on the historical dialogue information and the current user input information through a dialogue model, wherein the dialogue model comprises an activation unit, an adaptive parameter adjustment unit, an emotion recognition unit and a response unit, the activation unit being used to generate a current activation value based on the historical dialogue information and the current user input information, the adaptive parameter adjustment unit being used to adjust the network parameters of the response unit, the emotion recognition unit being used to determine the current emotional state of the user based on the current user input information, and the response unit being used to generate the current response information based on the current activation value and the current emotional state of the user.
[0006] Furthermore, the activation unit generates a current activation value based on the historical conversation information and the user's current input information, including: encoding the historical conversation information to generate a historical information code; and generating the current activation value based on the historical information code and the user's current input information through a context-aware activation function.
[0007] Furthermore, the context-aware activation function is: ,in, For the time step The current activation value of The user currently inputs information. Encode historical information, and is the weight matrix, is the bias term, is a nonlinear function.
[0008] Furthermore, the adaptive parameter adjustment unit adjusts the network parameters of the response unit, including: extracting the contextual representation of the historical dialogue information; generating a current connection weight according to the contextual representation of the historical dialogue information by a context-aware weight generator, wherein the current connection weight is used to adjust the connection strength between any two neurons of the response unit.
[0009] Furthermore, the expression function of the context-aware weight generator is: ,in, For the time step The response unit of Neuron to The current connection weights of neurons, is the context representation of the historical conversation information, is the preset parameter, is a nonlinear function.
[0010] Furthermore, the emotion recognition unit determines the user's current emotional state based on the user's current input information, including: performing word vector conversion on the user's current input information to obtain the word vector; and calculating the emotion attention weight corresponding to the word vector through the emotion encoder.
[0011] Furthermore, the expression function of the emotion encoder is: ,in, is at the time step The emotional attention weight, is the input word vector, and are the weight matrix and bias term of the emotion encoder, is a non-linear activation function.
[0012] Further, the response unit generates the current response information based on the current activation value and the current emotional state of the user, including: generating an input sequence based on the historical dialogue information and the current input information of the user; using The input sequence is processed to obtain a bidirectional hidden state at each time point; an attention mechanism is applied to calculate an attention score at each time point based on the bidirectional hidden state; the bidirectional hidden state at each time point is weighted based on the attention score at each time point to generate a weighted hidden state; a context-aware hidden state is generated based on the user's current input information and the hidden state at the previous time point through a context-aware gating mechanism; and the current response information is generated based on the context-aware hidden state, the current activation value, and the user's current emotional state.
[0013] Furthermore, the applied attention mechanism calculates the attention score at each time point based on the following function: ,in, For the time step The attention score, is a scoring function used to measure the hidden state With the global context The degree of matching, is an exponential function used to ensure the non-negativity of the attention score, is the total number of time points.
[0014] The present invention provides a dialogue method based on an adaptively connected neural network, which is applied to the above-mentioned dialogue system based on an adaptively connected neural network, including: obtaining historical dialogue information; obtaining user current input information; generating current response information based on the historical dialogue information and the user current input information through a dialogue model, wherein the dialogue model includes an activation unit, an adaptive parameter adjustment unit, an emotion recognition unit and a response unit, the activation unit is used to generate a current activation value based on the historical dialogue information and the user current input information, the adaptive parameter adjustment unit is used to adjust the network parameters of the response unit, the emotion recognition unit is used to determine the user's current emotional state based on the user's current input information, and the response unit is used to generate the current response information based on the current activation value and the user's current emotional state.
[0015] The present invention provides a computer device, including a memory and a processor, wherein the memory stores computer-readable instructions, and when the instructions are executed by the processor, the processor executes the above-mentioned dialogue method based on the adaptively connected neural network.
[0016] The present invention provides one or more non-volatile computer-readable storage media containing computer-executable instructions. When the computer-executable instructions are executed by one or more processors, the processors execute the above-mentioned dialogue method based on the adaptively connected neural network.
[0017] Compared with the prior art, the dialogue method and system based on the adaptively connected neural network provided by the present invention have at least the following beneficial effects:
[0018] Adaptive connection mode is adopted to dynamically adjust network parameters according to the context of the dialogue to improve the processing ability of the dialogue system in complex semantic tasks. At the same time, by introducing specially designed activation functions, the topic coherence and context relevance of the model in multiple rounds of dialogue are enhanced. In addition, by improving LSTM and combining transfer learning technology, the long-term dependency problem of long dialogue processing is solved, and the effective transfer of cross-domain knowledge is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] This specification will be further described in the form of exemplary embodiments, which will be described in detail by the accompanying drawings. These embodiments are not restrictive, and in these embodiments, the same number represents the same structure, wherein:
[0020] Figure 1 is a module schematic diagram of a dialogue system based on an adaptively connected neural network according to some embodiments of this specification;
[0021] Figure 2 is a schematic diagram of a process for generating a current activation value according to some embodiments of this specification;
[0022] Figure 3 is a schematic diagram of a process of adjusting network parameters of a response unit according to some embodiments of this specification;
[0023] Figure 4 is a schematic diagram of a process for determining a user's current emotional state according to some embodiments of this specification;
[0024] Figure 5 is a schematic diagram of a process for generating current response information according to some embodiments of this specification;
[0025] Figure 6 is a flowchart of establishing a dialogue model through a transfer learning method according to some embodiments of this specification;
[0026] Figure 7 is a flowchart of a conversation method based on an adaptively connected neural network according to some embodiments of this specification;
[0027] Figure 8is a schematic diagram of a computer device according to some embodiments of the present specification. DETAILED DESCRIPTION
[0028] In order to more clearly illustrate the technical solutions of the embodiments of this specification, the following is a brief introduction to the drawings required for the description of the embodiments. Obviously, the drawings described below are only some examples or embodiments of this specification. For ordinary technicians in this field, this specification can also be applied to other similar scenarios based on these drawings without creative work. Unless it is obvious from the language environment or otherwise explained, the same reference numerals in the figures represent the same structure or operation.
[0029] Figure 1 is a schematic diagram of a module of a dialogue system based on an adaptively connected neural network according to some embodiments of this specification, such as Figure 1 As shown, the dialogue system based on the adaptively connected neural network may include a history acquisition module 110 , an input acquisition module 120 and an answer generation module 130 .
[0030] The history acquisition module 110 may be used to acquire historical conversation information.
[0031] The historical dialogue information may include the user's inquiry information and the dialogue system's response information at multiple historical time points.
[0032] The input acquisition module 120 can be used to acquire the user's current input information.
[0033] The answer generation module 130 may be configured to generate current response information based on historical dialogue information and user current input information through a dialogue model.
[0034] Among them, the dialogue model includes an activation unit, an adaptive parameter adjustment unit, an emotion recognition unit and a response unit. The activation unit is used to generate a current activation value based on historical dialogue information and the user's current input information. The adaptive parameter adjustment unit is used to adjust the network parameters of the response unit. The emotion recognition unit is used to determine the user's current emotional state based on the user's current input information. The response unit is used to generate current response information based on the current activation value and the user's current emotional state.
[0035] Figure 2 is a schematic diagram of a process for generating a current activation value according to some embodiments of this specification, such as Figure 2 As shown, in some embodiments, the activation unit generates a current activation value based on the historical dialogue information and the user's current input information, including:
[0036] Encode the historical conversation information and generate the historical information encoding. Specifically, a memory mechanism, such as a gated recurrent unit (GRU) or LSTM (Long Short-Term Memory), is used to encode the historical conversation information.
[0037] The current activation value is generated based on the historical information encoding and the user's current input information through the context-aware activation function.
[0038] It can be understood that in this way, the context-aware activation function can dynamically adjust the current activation value at each time step according to the user's current input information and historical conversation information, thereby enhancing the coherence and context relevance of the conversation. For example, if the historical conversation information shows that the user is discussing a specific topic, the context-aware activation function can make the network more inclined to generate replies related to the topic.
[0039] In some embodiments, the context-aware activation function is:
[0040]
[0041] in, For the time step The current activation value of The user currently inputs information. Encode historical information, and is the weight matrix, is the bias term, is a nonlinear function.
[0042] Figure 3 is a schematic diagram of a flow chart of adjusting network parameters of a response unit according to some embodiments of this specification, such as Figure 3 As shown, in some embodiments, the adaptive parameter adjustment unit adjusts the network parameters of the response unit, including:
[0043] Extract contextual representation of historical conversation information;
[0044] The current connection weight is generated by a context-aware weight generator according to the context representation of the historical dialogue information, wherein the current connection weight is used to adjust the connection strength between any two neurons of the response unit.
[0045] It can be understood that the network parameters of the answering unit are dynamically adjusted to better adapt to the context of different conversations. This is achieved by introducing a set of variable connection weights in the network, which can be automatically adjusted according to changes in the content of the conversation. In this way, the neural network can dynamically adjust its internal connections according to the context of the conversation, so that it can better adapt to different context changes when processing multiple rounds of conversations.
[0046] In some embodiments, the expression function of the context-aware weight generator is:
[0047]
[0048] in, For the time step The response unit of Neuron to The current connection weights of neurons, is the context representation of the historical conversation information, is the preset parameter, is a nonlinear function.
[0049] Just as an example, a dataset containing multiple rounds of dialogues is first preprocessed to obtain context representation Then, the context-aware weight generator is used to Generate weights for each time step These weights are used to adjust the strength of the connections in the neural network so that the network can better adapt to the context of the current conversation. As the conversation progresses, the context-aware weight generator continuously updates the weights based on new contextual information, ensuring that the network can always adjust its behavior based on the latest conversation content. In this way, a chat system that can handle complex multi-round conversations can be trained.
[0050] Figure 4 is a flow chart of determining the current emotional state of a user according to some embodiments of this specification, such as Figure 4 As shown, in some embodiments, the emotion recognition unit determines the current emotion state of the user based on the current input information of the user, including:
[0051] Convert the user's current input information into a word vector to obtain the word vector;
[0052] The sentiment attention weight corresponding to the word vector is calculated through the sentiment encoder.
[0053] It can be understood that through the above process, the response unit can pay more attention to the key parts of emotional expression when processing user input, so as to more accurately identify the user's emotions and give appropriate responses.
[0054] In some embodiments, the expression function of the emotion encoder is:
[0055]
[0056] in, is at the time step The emotional attention weight, is the input word vector, and are the weight matrix and bias term of the emotion encoder, is a non-linear activation function.
[0057] Just as an example, there is a data set containing user sentiment labels. First, the user's current input information is converted into a word vector Next, the sentiment encoder is used to calculate the sentiment attention weight , and applies emotion attention weights to the neural network to highlight emotion-related information when processing user input. In this way, when the network is trained to recognize user emotions, it can more accurately identify various emotional states and give more appropriate responses. In this way, the performance of the chat system on emotion recognition tasks can be significantly improved.
[0058] Figure 5 is a schematic diagram of a process for generating current response information according to some embodiments of this specification, such as Figure 5 As shown, in some embodiments, the response unit generates current response information based on the current activation value and the current emotional state of the user, including:
[0059] Generate input sequence based on historical dialogue information and user's current input information;
[0060] The input sequence is processed using Bi-LSTM (Bi-directional Long Short-Term Memory) to obtain a bidirectional hidden state at each time point. Bi-LSTM can consider both past and future contextual information, thereby improving the understanding of each part of a long conversation. In Bi-LSTM, the hidden state at each time point It is calculated by combining the hidden states of the forward LSTM and the backward LSTM;
[0061] Apply the attention mechanism to calculate the attention score at each time point based on the bidirectional hidden state;
[0062] Weight the bidirectional hidden state at each time point based on the attention score at each time point to generate a weighted hidden state;
[0063] Generate context-aware hidden states based on the user's current input information and weighted hidden states through a context-aware gating mechanism, where the context-aware gating mechanism can dynamically control the flow of information so that the network can better capture long-term dependencies;
[0064] Generate current response information based on context-aware hidden state, current activation value and user's current emotional state.
[0065] Specifically, Bi-LSTM can be expressed as:
[0066]
[0067] in, and Represents the time points The hidden states of the forward and backward LSTMs, Represents the concatenation of vectors.
[0068] In some embodiments, the attention mechanism is applied to calculate the attention score at each time point based on the following function:
[0069]
[0070] in, For the time step The attention score, is a scoring function used to measure the hidden state With the global context The degree of matching, is an exponential function used to ensure the non-negativity of the attention score, is the total number of time points.
[0071] The calculation formula of the context-aware gating mechanism is:
[0072]
[0073] in, is the context-aware hidden state, is the sigmoid activation function, is the weight matrix, is the bias term, is the hidden state at the previous time point, is the input at the current time point.
[0074] The CAA (Context-Aware Activation Function) activation function is a hypothetical design that aims to dynamically adjust the activation value based on the current input, the context-aware hidden state of the historical conversation, and the current emotional state of the user. This design enables the dialogue system or chatbot to more accurately understand the user's intention at each time step and generate highly context-relevant and coherent response information. In the dialogue system, the context-aware hidden state is maintained by Bi-LSTM. Bi-LSTM can capture the temporal dependency and sequence information in the dialogue to form an internal representation of the dialogue history. The CAA activation function can use this context-aware hidden state to understand the previous dialogue content, including the topics, questions, emotional tendencies, etc. mentioned by the user. The current activation value is usually calculated based on the input of the current time step. This input may be the user's text input, voice input, or other forms of input. The CAA activation function considers the correlation between the current activation value and the context-aware hidden state to determine the importance and relevance of the current input in the dialogue context. The user's current emotional state is crucial to generating appropriate response information. Emotional state can affect the user's understanding of the dialogue content and their expectations of the dialogue system or chatbot. Through sentiment analysis technology, the system can detect the user's emotional tendencies, such as positive, negative, neutral, etc. The CAA activation function incorporates this emotional information into its calculation process to ensure that the generated response information matches the user's emotional state.
[0075] Based on the context-aware hidden state, the current activation value, and the user's current emotional state, the CAA activation function dynamically adjusts the activation value of the neural network. These adjusted activation values will be used to guide the subsequent decoding or generation process. In the decoding or generation stage, response information that is highly relevant to the context, coherent, and in line with the user's emotional expectations is generated based on these adjusted activation values. In this way, the CAA activation function can significantly enhance the coherence and context relevance of the dialogue system. It enables the system to better understand the user's intentions and needs, and generate more natural, fluent, and humane response information. This design helps to improve user satisfaction and trust in the dialogue system, thereby promoting the widespread application and development of dialogue systems.
[0076] Just as an example, suppose that a long dialogue task is being processed. First, the input sequence is processed using Bi-LSTM to obtain bidirectional hidden states. Then, an attention mechanism is applied to calculate the attention score at each time point, and these scores are used to weight the hidden state to highlight the most relevant information. Next, the context-aware gating mechanism dynamically adjusts the gating value based on the current input and the hidden state at the previous time point to control the flow of information. Finally, the context-aware hidden state is fed into the output layer to generate a prediction result. In this way, the improved LSTM model can more effectively handle long-term dependency problems in long dialogues and improve the performance of chat systems in complex dialogue tasks.
[0077] In some embodiments, the answer generation module 130 is further used to establish a dialogue model through a transfer learning method.
[0078] Figure 6 is a flow chart of establishing a dialogue model through a transfer learning method according to some embodiments of this specification, such as Figure 6 As shown, in some embodiments, the transfer learning method may include the following process:
[0079] Source domain training: First, a deep neural network model is trained in a source domain so that it can learn the features and knowledge unique to that domain;
[0080] Feature extraction: extract high-level feature representations from the model trained in the source domain. These features capture the key information in the source domain.
[0081] Fine-tuning: Apply the extracted features to data from the target domain and perform further training (fine-tuning) in the target domain to adapt to specific tasks in the new domain.
[0082] As an example, a model trained in the field of image recognition is applied to the natural language processing task. First, high-level visual features are extracted from the image recognition model. Then, these features are combined with the data of the natural language processing task and fine-tuned on this basis to adapt to the new task requirements. Finally, the effect of transfer learning is evaluated by comparing the performance of the model on the natural language processing task before and after fine-tuning. In this way, the knowledge learned in the source domain can be effectively utilized to improve the performance of the model in the target domain, and the effective transfer of cross-domain knowledge can be achieved.
[0083] In order to quantify the effect of feature transfer, a migration effect index T can be defined, which is measured by comparing the performance improvement of the model in the target domain before and after fine-tuning:
[0084]
[0085] in, and Represent the performance of the model in the target domain after and before fine-tuning, respectively.
[0086] Figure 7 is a flowchart of a conversation method based on an adaptively connected neural network according to some embodiments of this specification, such as Figure 7 As shown, the dialogue method based on the adaptively connected neural network may include the following steps.
[0087] Step 710, obtaining historical conversation information.
[0088] Step 720, obtaining the user's current input information.
[0089] Step 730, generating current response information based on historical dialogue information and current user input information through a dialogue model, wherein the dialogue model includes an activation unit, an adaptive parameter adjustment unit, an emotion recognition unit and a response unit, the activation unit is used to generate a current activation value based on historical dialogue information and current user input information, the adaptive parameter adjustment unit is used to adjust network parameters of the response unit, the emotion recognition unit is used to determine the current emotional state of the user based on the current user input information, and the response unit is used to generate current response information based on the current activation value and the current emotional state of the user.
[0090] The dialogue method based on a neural network with adaptive connections can be executed by a dialogue system based on a neural network with adaptive connections. For more descriptions of the dialogue method based on a neural network with adaptive connections, please refer to the relevant descriptions of the dialogue system based on a neural network with adaptive connections, which will not be repeated here.
[0091] Figure 8 is a schematic diagram of a computer device according to some embodiments of this specification, the computer device includes a memory and a processor, the memory stores computer-readable instructions, and when the instructions are executed by the processor, the processor executes the above-mentioned dialogue method based on the adaptive connection neural network. It should be noted that Figure 8 The computer device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0092] like Figure 8As shown, the processor includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 802 or the program loaded from the storage part 808 to the random access memory (RAM) 803, such as executing the method in the above embodiment. In the RAM 803, various programs and data required for system operation are also stored. The CPU 801, the ROM 802 and the RAM 803 are connected to each other through the bus 804. The input / output (I / O) interface 805 is also connected to the bus 804.
[0093] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed so that a computer program read therefrom is installed into the storage section 808 as needed.
[0094] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part 809, and / or installed from a removable medium 811. When the computer program is executed by a central processing unit (CPU) 801, various functions defined in the system of the present application are executed.
[0095] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier, which carries a computer-readable computer program. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0096] Finally, it should be understood that the embodiments described in this specification are only used to illustrate the principles of the embodiments of this specification. Other variations may also fall within the scope of this specification. Therefore, as an example and not a limitation, alternative configurations of the embodiments of this specification may be considered consistent with the teachings of this specification. Accordingly, the embodiments of this specification are not limited to the embodiments explicitly introduced and described in this specification.
Claims
1. A dialogue system based on an adaptively connected neural network, characterized in that: include: History acquisition module, used to obtain historical conversation information; Input acquisition module, used to obtain the user's current input information; an answer generation module, configured to generate current answer information based on the historical dialogue information and the user's current input information through a dialogue model, wherein the dialogue model includes an activation unit, an adaptive parameter adjustment unit, an emotion recognition unit, and a response unit, wherein the activation unit is configured to generate a current activation value based on the historical dialogue information and the user's current input information, the adaptive parameter adjustment unit is configured to adjust a network parameter of the response unit, the emotion recognition unit is configured to determine a user's current emotion state based on the user's current input information, and the response unit is configured to generate the current answer information based on the current activation value and the user's current emotion state; The activation unit generates a current activation value based on the historical dialogue information and the user's current input information, including: Using a memory mechanism to encode the historical conversation information to generate a historical information code; Generate the current activation value based on the historical information encoding and the user's current input information through a context-aware activation function, wherein the current activation value is used to enhance the coherence and context relevance of the conversation; The context-aware activation function is: in, For the time step The current activation value of The user currently inputs information. Encode historical information, and is the weight matrix, is the bias term, is a nonlinear function; The adaptive parameter adjustment unit adjusts the network parameters of the response unit, including: Extracting a contextual representation of the historical conversation information; Generate a current connection weight according to the context representation of the historical dialogue information by a context-aware weight generator, wherein the current connection weight is used to adjust the connection strength between any two neurons of the response unit, and the dialogue model dynamically adjusts its internal connection according to the context of the dialogue, so as to adapt to different context changes when processing multiple rounds of dialogue; The expression function of the context-aware weight generator is: in, For the time step The response unit of Neuron to The current connection weights of neurons, is the context representation of the historical conversation information, is the preset parameter, is a nonlinear function; The emotion recognition unit determines the current emotion state of the user based on the current input information of the user, including: Perform word vector conversion on the user's current input information to obtain a word vector; Calculating the sentiment attention weight corresponding to the word vector through a sentiment encoder, wherein the sentiment attention weight is used to highlight sentiment-related information when processing user input; The expression function of the emotion encoder is: in, is at the time step The emotional attention weight, is the input word vector, and are the weight matrix and bias term of the emotion encoder, is a non-linear activation function.
2. The dialogue system based on the neural network of adaptive connection according to claim 1, characterized in that: The response unit generates the current response information based on the current activation value and the current emotional state of the user, including: Generate an input sequence based on the historical conversation information and the user's current input information; use Processing the input sequence to obtain a bidirectional hidden state at each time point; Applying an attention mechanism to calculate an attention score at each time point based on the bidirectional hidden state; Weighting the bidirectional hidden state at each time point based on the attention score at each time point to generate a weighted hidden state; Generate a context-aware hidden state based on the user's current input information and the hidden state at a previous time point through a context-aware gating mechanism; The current response information is generated based on the context-aware hidden state, the current activation value, and the current emotional state of the user.
3. The dialogue system based on the adaptively connected neural network according to claim 2, characterized in that: The applied attention mechanism calculates the attention score at each time point based on the following function: in, For the time step The attention score, is a scoring function used to measure the hidden state With the global context The degree of matching, is an exponential function used to ensure the non-negativity of the attention score, is the total number of time points.
4. A conversation method based on a neural network with adaptive connections, applied to a conversation system based on a neural network with adaptive connections as claimed in any one of claims 1 to 3, characterized in that: include: Get historical conversation information; Get the user's current input information; The current response information is generated based on the historical dialogue information and the user's current input information through a dialogue model, wherein the dialogue model includes an activation unit, an adaptive parameter adjustment unit, an emotion recognition unit and a response unit, the activation unit is used to generate a current activation value based on the historical dialogue information and the user's current input information, the adaptive parameter adjustment unit is used to adjust the network parameters of the response unit, the emotion recognition unit is used to determine the user's current emotional state based on the user's current input information, and the response unit is used to generate the current response information based on the current activation value and the user's current emotional state.
