Memory enhancement and reasoning method and system for intelligent interaction
By meticulously segmenting and chronologically arranging user interaction data, and combining it with memory-enhanced reasoning networks, the problem of insufficient utilization of historical interaction information in existing technologies has been solved, thereby improving the accuracy and fluency of intelligent interaction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANGHAI MINGQI NETWORK TECH CO LTD
- Filing Date
- 2026-04-10
- Publication Date
- 2026-05-08
AI Technical Summary
Existing intelligent interaction methods lack effective use of historical interaction information, making it difficult to accurately understand the user's true intentions when faced with ambiguous or unclear user expressions or complex interaction scenarios, thus affecting the accuracy and fluency of the interaction.
By capturing the user's original interaction data stream, segmenting and chronologically arranging interaction events, parsing the semantics and operation types of the interaction content, generating interaction intent tags, and using a memory-enhanced reasoning network to encode contextual knowledge and fuse semantics, historical interaction memory entries are retrieved to complete the current interaction intent and generate response reasoning content.
It improves the accuracy and fluency of intelligent interaction, achieves a deep understanding of user intent and accurate response, and enhances the user experience.
Smart Images

Figure CN121998106A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent interaction technology, and more specifically, to a memory enhancement and reasoning method and system for intelligent interaction. Background Technology
[0002] In the field of intelligent interaction, with the increasing complexity of interaction scenarios and the rising frequency of interactions, accurately understanding user intent and providing appropriate responses has become a key challenge. Existing intelligent interaction methods often focus only on information from the current interaction round when processing user interaction data, lacking effective utilization of historical interaction information. This leads to difficulties in accurately grasping the user's true intent when faced with ambiguous or unclear user expressions or complex interaction contexts.
[0003] For example, in multi-turn dialogue scenarios, users may mention related topics in different turns, but the emphasis and level of detail in each statement differ. Existing methods, unable to integrate this information scattered across different turns, easily overlook key clues, thus failing to accurately understand the user's complete intent. Furthermore, for interactions with implicit intentions, existing methods lack effective reasoning mechanisms, making it difficult to uncover the user's latent needs from limited interaction information. This severely impacts the accuracy and fluency of the interaction, failing to meet users' growing demands for intelligent interaction systems. Summary of the Invention
[0004] In view of this, the purpose of this application is to provide a memory enhancement and reasoning method and system for intelligent interaction.
[0005] According to a first aspect of this application, a memory enhancement and reasoning method for intelligent interaction is provided, the method comprising: The system captures the user's original interaction data stream generated during continuous interaction by the intelligent interactive terminal, performs interaction event segmentation on the user's original interaction data stream to obtain multiple interaction event units, assigns an event occurrence time tag to each interaction event unit, and performs time sequence arrangement processing on the interaction event units based on the event occurrence time tag to generate an interaction event time sequence. The interaction content semantics and interaction operation type of each interaction event unit in the interaction event time sequence are analyzed. Based on the interaction content semantics and the interaction operation type, the interaction intent of the interaction event unit is initially determined to obtain an initial intent tag. Based on the event occurrence time tag and the initial intent tag, the interaction rounds of the interaction event unit are merged to generate an interaction round unit sequence carrying intent identifiers. Extract the core interaction request keywords and core interaction object keywords of each interaction round unit in the sequence of interaction round units. Based on the core interaction request keywords, perform knowledge association and expansion processing in a preset interaction knowledge base to obtain background support knowledge units. Based on the core interaction object keywords, perform object anchoring processing on the background support knowledge units to generate the interaction context knowledge set corresponding to the interaction round unit. The interactive context knowledge set is input into the memory-enhanced reasoning network for context knowledge encoding processing to generate a context knowledge encoding vector. The context knowledge encoding vector is semantically fused with the semantics of the interactive content of the interactive round unit to generate a fused memory representation vector. Based on the fused memory representation vector, the historical interactive round memory entries that match the current interactive round are retrieved from the long-term interactive memory bank. Extract historical interaction request keywords and historical interaction object keywords from the historical interaction round memory entries. Based on the historical interaction request keywords and historical interaction object keywords, perform intent completion processing on the core interaction request keywords and core interaction object keywords of the current interaction round to generate an enhanced interaction intent representation. Based on the enhanced interaction intent representation, generate response reasoning content for the current interaction round and send it to the intelligent interactive terminal for interaction content presentation processing.
[0006] According to a second aspect of this application, a memory enhancement and reasoning system for intelligent interaction is provided. The memory enhancement and reasoning system for intelligent interaction includes a machine-readable storage medium and a processor. The machine-readable storage medium stores machine-executable instructions. When the processor executes the machine-executable instructions, the memory enhancement and reasoning system for intelligent interaction implements the aforementioned memory enhancement and reasoning method for intelligent interaction.
[0007] Based on any of the above aspects, the technical effect of this application is as follows: By meticulously segmenting and chronologically arranging the user's original interaction data stream, preliminary intent determination and interaction round merging of interaction event units are performed, effectively integrating relevant interaction information and improving the accuracy of intent analysis. Extracting core keywords and expanding them through knowledge association and object anchoring generates an interaction context knowledge set, enriching the understanding dimensions of the interaction context. Utilizing a memory-enhanced reasoning network for contextual knowledge encoding and semantic fusion fully leverages long-term interaction memory to retrieve historical memory entries matching the current interaction. Based on historical memory, the current interaction intent is completed, generating an enhanced interaction intent representation and response reasoning content, achieving a deep understanding of user intent and accurate responses, significantly improving the accuracy, fluency, and user experience of intelligent interaction. Attached Figure Description
[0008] Figure 1 A flowchart illustrating the memory enhancement and reasoning method for intelligent interaction provided in an embodiment of this application is shown. Figure 2 A schematic diagram of the component structure of the memory enhancement and reasoning system for intelligent interaction provided in an embodiment of this application is shown. Detailed Implementation
[0009] The technical solution of this invention can be applied to various intelligent interactive systems. The following detailed explanation of the technical solution uses a specific smart home interaction scenario. In this scenario, the intelligent interactive terminal is a home intelligent central control panel.
[0010] Figure 1 This paper illustrates a flowchart of a memory enhancement and reasoning method and system for intelligent interaction provided in an embodiment of this application. The detailed steps include: Step S110: Capture the user's original interaction data stream generated during continuous interaction by the intelligent interactive terminal, perform interaction event segmentation processing on the user's original interaction data stream to obtain multiple interaction event units, assign an event occurrence time tag to each interaction event unit, and perform time sequence arrangement processing on the interaction event units according to the event occurrence time tag to generate an interaction event time sequence.
[0011] The home smart control panel captures all raw data generated by user interaction with the system in real time, forming the user raw interaction data stream. This raw interaction data stream includes voice signal data streams collected via a microphone array, touch operation data streams collected via a touchscreen, and gaze-attention data streams collected via a camera. All raw data is synchronized with the home smart gateway during capture, ensuring that each data point carries a timestamp accurate to milliseconds.
[0012] The user's original interaction data stream is processed by interaction event segmentation. For the voice signal data stream, an endpoint detection algorithm based on dual-threshold comparison is used to calculate the short-time energy and short-time zero-crossing rate of the voice signal. When these two characteristic parameters continuously exceed a preset voice start threshold, it is marked as a voice start point; when they continuously fall below a preset voice end threshold, it is marked as a voice end point, thereby segmenting the continuous voice stream into discrete voice interaction event units. For the touch operation data stream, the state changes of the touch points on the touchscreen are monitored. When a complete process of a touch point appearing and disappearing is detected, this process is defined as a touch interaction event unit, and the coordinate sequence, pressure value, and timestamp sequence of the touch point are recorded. For the gaze attention data stream, gaze estimation technology based on pupil-corneal reflex is used to obtain the coordinates of the user's gaze point on the screen. Combined with the gaze point dwell time, when the dwell time of the gaze point in a fixed area exceeds a preset gaze duration threshold, the continuous gaze data segment is segmented into a gaze interaction event unit.
[0013] After segmentation, each generated interactive event unit is assigned an event occurrence timestamp, which is the timestamp of the first raw data point within that interactive event unit. Based on the event occurrence timestamps of all interactive event units, a merge sort algorithm is used to sort all interactive event units in chronological order, generating an interactive event chronological sequence arranged in ascending order of time.
[0014] Step S120: Analyze the interaction content semantics and interaction operation type of each interaction event unit in the interaction event time sequence; perform preliminary interaction intent determination processing on the interaction event unit based on the interaction content semantics and the interaction operation type to obtain a preliminary intent tag; and perform interaction round merging processing on the interaction event unit based on the event occurrence time tag and the preliminary intent tag to generate an interaction round unit sequence carrying intent identifiers.
[0015] Step S121: Perform multimodal content parsing processing on each interactive event unit, extract the text semantic content, touch semantic content and gaze semantic content contained in the interactive event unit, and perform semantic alignment and fusion processing on the text semantic content, the touch semantic content and the gaze semantic content to construct the multimodal interactive content semantic representation corresponding to the interactive event unit.
[0016] For each interactive event unit in the interactive event time sequence, modality-specific parsing is first performed based on its type. For the voice interactive event unit, its audio data is input into an automatic speech recognition model, which is trained based on connection-time classification criteria and outputs a corresponding text string. Then, this text string is input into a natural language understanding model, which adopts a bidirectional encoding representation transformer architecture and outputs the text semantic content representation containing intent and entity. For the touch interactive event unit, its touch point coordinate sequence is extracted, and the operation gesture is identified through trajectory analysis algorithm. Clicks, swipes, zooms, etc. are identified by calculating the displacement, speed, and direction changes of the coordinate sequence. At the same time, the object identifier of the operated object is identified by combining the screen interface layout when the touch occurs, which together constitute the touch semantic content representation. For the gaze interactive event unit, the gaze point coordinate sequence is extracted, and the user's visual focus sequence is identified by analyzing the transfer path of the gaze point between different screen areas and the duration of residence in each area, which constitutes the gaze semantic content representation.
[0017] The semantic content of the three modalities mentioned above is aligned and fused. Based on the event occurrence time tag, the text semantic content, touch semantic content, and gaze semantic content with an absolute time difference less than a preset fusion time window are grouped together. A multimodal encoder is used for fusion. The multimodal encoder first maps the text semantic content to text feature vectors through a word embedding layer, maps the operation type and object identifier in the touch semantic content to touch feature vectors through an embedding layer, and encodes the attention point sequence in the gaze semantic content into gaze feature vectors through a long short-term memory network. A cross-modal attention mechanism is introduced into the multimodal encoder to calculate the attention weights between each pair of the text feature vector, touch feature vector, and gaze feature vector. These attention weights are obtained through query-key-value dot product operations. The calculated attention weights are used to weight the touch feature vector and the gaze feature vector. Then, the weighted feature vector is concatenated with the text feature vector along the feature dimension to obtain the multimodal interaction content semantic representation vector of dimension D_m.
[0018] The multimodal encoder employs a fusion architecture based on a cross-modal attention mechanism. Specifically, the multimodal encoder comprises three independent single-modal encoding sub-networks and a cross-modal attention fusion layer. The text feature vector is extracted through a sub-network consisting of 12 stacked Transformer encoder layers, each layer containing a multi-head self-attention sub-layer and a feedforward neural network sub-layer, with 12 attention heads and a hidden layer dimension of 768. The touch feature vector is extracted through a 3-layer Long Short-Term Memory network, with 256 hidden units per layer. The gaze feature vector is extracted through a 3-layer temporal convolutional network, with a kernel size of 3 and 256 channels per layer.
[0019] In the cross-modal attention fusion layer, the text feature vector is used as the query, and the touch feature vector and the gaze feature vector are used as the key and value, respectively. Multi-head cross-attention for text-touch and text-gaze is calculated, with the number of attention heads set to 8. After residual connection and layer normalization between the outputs of the two attention modules and the original text feature vector, they are concatenated along the feature dimension to obtain the final multimodal interactive content semantic representation vector.
[0020] The training process of the multimodal encoder uses a large-scale multimodal interaction dataset, which contains paired speech, touch, and gaze event units, each group of data is labeled with corresponding semantic tags. The input consists of the original audio waveform, touch coordinate sequence, and gaze coordinate sequence; the output is the semantic representation vector of the multimodal interaction content. During training, a contrastive learning loss function is used to bring the different modal representations of the same event unit closer together in the vector space. The Adam optimizer is used, with an initial learning rate of 0.0001, a batch size of 64, and 50 training epochs. In inference applications, the real-time collected speech, touch, and gaze data undergo the same preprocessing as the training data, are input into the multimodal encoder, and forward propagation yields the semantic representation vector of the multimodal interaction content.
[0021] Step S122: Perform semantic classification processing on the interactive event unit based on the semantic representation of the multimodal interactive content, determine the semantic category label to which the interactive event unit belongs, perform operation type recognition processing on the touch operation events contained in the interactive event unit, and determine the interactive operation type of the interactive event unit based on the operation gesture type.
[0022] The multimodal interactive content semantic representation vector generated in step S121 is input into a pre-trained semantic classifier. The semantic classifier is a three-layer multilayer perceptron network with hidden layer nodes H1 and H2, an output layer node count equal to the preset total number of semantic categories, and an output layer activation function of Softmax. The semantic classifier calculates the probability that the multimodal interactive content semantic representation vector belongs to each semantic category, and uses the category corresponding to the maximum probability as the semantic category label of the interactive event unit. Simultaneously, the coordinate sequence and pressure sequence from the touch interactive event unit are input into an operation type recognition model based on a temporal convolutional network. This model consists of multiple stacked residual convolutional blocks, each containing a one-dimensional convolutional layer, a batch normalization layer, and a ReLU activation layer. Finally, a global average pooling layer and a fully connected layer output the operation gesture type probability distribution, and the gesture type with the highest probability is taken as the interaction operation type of the interactive event unit.
[0023] The semantic classifier employs a multilayer perceptron architecture. Specifically, the multilayer perceptron comprises three fully connected layers. The first layer has the same input dimension as the semantic representation vector of the multimodal interaction content, set to 768, and an output dimension of 512. The second layer has an input dimension of 512 and an output dimension of 256. The third layer has an input dimension of 256 and an output dimension equal to the preset total number of semantic categories, for example, 20 categories. Each fully connected layer is followed by a batch normalization layer and a ReLU activation function. The third layer is followed by a Softmax activation function to output the probability distribution.
[0024] The training process of the semantic classifier uses 500,000 manually labeled sets of multimodal interaction content semantic representation vectors and their corresponding semantic category labels. The input is the multimodal interaction content semantic representation vector generated in step S121, and the output is a 20-dimensional category probability distribution. The loss function is cross-entropy loss. The Adam optimizer is used, with an initial learning rate of 0.001, a batch size of 128, and 30 training epochs. Accuracy is used as the evaluation metric, and training stops when the accuracy on the validation set reaches 95%. In inference applications, the multimodal interaction content semantic representation vector generated in step S121 is directly input into the classifier, and the category with the highest probability in the Softmax output is taken as the semantic category label. The operation type recognition model employs a temporal convolutional network architecture. Specifically, the temporal convolutional network consists of five stacked residual convolutional blocks. Each residual convolutional block contains two one-dimensional convolutional layers, each with a kernel size of 3 and a stride of 1, padded to maintain the sequence length. The first convolutional layer outputs 64 channels, with the number of channels doubling in subsequent layers up to 256. Each convolutional layer is followed by a batch normalization layer and a ReLU activation function. Residual connections directly add the input of each block to its output. The network finally connects to a global average pooling layer, compressing the feature maps of each channel into a 256-dimensional vector. This vector is then mapped to the number of operation gesture types (e.g., 10 categories) through a fully connected layer, followed by a Softmax activation function to output the probability distribution.
[0025] The training process of the operation type recognition model uses 500,000 touch trajectory data points. Each trajectory contains a coordinate sequence and a pressure value sequence, with the sequence length uniformly padded or truncated to 100 time steps. The input is the normalized coordinate and pressure sequences, and the output is the probability of 10 types of operation gestures. The loss function is cross-entropy loss. The Adam optimizer is used, with an initial learning rate of 0.001, a batch size of 64, and 40 training epochs. During inference, the real-time collected touch trajectory sequences are normalized in length, input into the network for forward propagation, and the gesture type with the highest probability is taken as the interaction operation type.
[0026] Step S123: Input the semantic category label and the interaction operation type into a pre-built intention preliminary determination model for comprehensive reasoning processing. The intention preliminary determination model performs rule matching processing on the semantic category label and the interaction operation type according to a preset intention determination rule library. When the semantic category label and the interaction operation type match a certain intention determination rule at the same time, the intention label corresponding to the intention determination rule is used as the preliminary intention label of the interaction event unit.
[0027] The initial intent determination model is constructed, with the intent determination rule base at its core. This rule base is stored in the form of production rules, where each rule consists of an antecedent and a consequent. The antecedent is a logical AND combination of the semantic category label and the interaction operation type, and the consequent is the corresponding initial intent label. The semantic category label and the interaction operation type are input as facts into the initial intent determination model. The model uses the RETE algorithm for rule matching, traversing the rule base to find all rules whose antecedents completely match the input facts. When a matching rule exists, the consequent of that rule is output as the initial intent label for that interaction event unit; if multiple rules match simultaneously, the rule with the highest priority is selected for output.
[0028] Step S124: After assigning the initial intent label to each interactive event unit in the interactive event time sequence, perform initial clustering processing on the interactive event units based on the initial intent label, and cluster multiple consecutive interactive event units with the same initial intent label into candidate interactive round groups, and assign a corresponding candidate round identifier to each candidate interactive round group.
[0029] Traverse the sequence of interaction events, initializing an empty list to store the candidate interaction round groups. Sequentially scan each interaction event unit in the sequence; if the initial intent label of the current unit is the same as the previous unit, add the current unit to the current group; otherwise, close the current group and add it to the list. Then, create a new group with the current unit as the first element. After scanning, assign a unique integer as the candidate round identifier to each candidate interaction round group in the list.
[0030] Step S125: Perform round continuity detection processing on the time interval between adjacent interactive event units within each candidate interaction round group. When the time interval between adjacent interactive event units within the candidate interaction round group exceeds a preset round interruption time threshold, the adjacent interactive event units exceeding the round interruption time threshold are divided into different candidate interaction round groups.
[0031] For each candidate interaction round group, calculate the difference in the event occurrence timestamps of two adjacent interaction event units within it to obtain the time interval. The preset threshold for the round interruption time is T_break. Traverse all adjacent pairs within the group; if the time interval is greater than T_break, split the original group into two subgroups at that position. Update the candidate interaction round group list for all the newly obtained subgroups after the splits.
[0032] Step S126: Reassign candidate round identifiers to each segmented candidate interaction round group, and perform round merging and reorganization processing on all interaction event units in the interaction event time sequence according to the reassigned candidate round identifiers, combining interaction event units belonging to the same candidate round identifier into the same interaction round unit.
[0033] Each candidate interaction round group obtained after step S125 is reassigned a unique candidate round identifier. Then, the interaction event sequence is traversed, and according to the new group identifier to which each interaction event unit belongs, the logical pointers or storage addresses of all interaction event units under the same identifier are merged together to form the data structure of the interaction round unit.
[0034] Step S127: Generate a corresponding round start time tag and round end time tag for each interaction round unit. Use the intention tag with the highest frequency among the preliminary intention tags of all interaction event units in the interaction round unit as the intention identifier of the interaction round unit, and generate the final sequence of interaction round units containing the round start time tag, the round end time tag and the intention identifier.
[0035] For each interaction round unit, iterate through all the interaction event units it contains, taking the smallest event occurrence time tag as the round start time tag and the largest event occurrence time tag as the round end time tag. Count the initial intent tags of all interaction event units, use a hash table to record the occurrence frequency of each tag, and find the tag with the highest occurrence frequency as the intent identifier for that unit. Sort all interaction round units according to their round start time tags and output the interaction round unit sequence.
[0036] Step S130: Extract the core interaction request keywords and core interaction object keywords for each interaction round unit in the interaction round unit sequence; perform knowledge association expansion processing in a preset interaction knowledge base based on the core interaction request keywords to obtain background support knowledge units; and perform object anchoring processing on the background support knowledge units based on the core interaction object keywords to generate the interaction context knowledge set corresponding to the interaction round unit.
[0037] Step S131: Perform multimodal content integration processing on each interaction round unit, and collect and integrate the text semantic content, touch semantic content and gaze semantic content of all interaction event units contained in the interaction round unit to generate the complete interactive content text of the interaction round unit.
[0038] The text semantic content of all voice interaction event units, the operation description and object name in the touch semantic content of all touch interaction event units, and the attention area description in the gaze semantic content of all gaze interaction event units are concatenated into a long text string according to their respective event occurrence time tags, which serves as the complete interaction content text.
[0039] Step S132: The complete interactive content text is segmented into multiple text sentence units, each text sentence unit is segmented into multiple text vocabulary units, each text vocabulary unit is tagged with part of speech to determine its part of speech category, and each text vocabulary unit is named entity recognition to identify entity reference information.
[0040] The complete interactive content text is segmented into sentences using rules based on punctuation and line breaks, resulting in a list of text sentence units. For each text sentence unit, a word segmentation tool based on a dictionary and Hidden Markov Model is used to segment the text, resulting in a list of text vocabulary units. For each text vocabulary unit, a part-of-speech tagging model based on Conditional Random Fields is used to perform part-of-speech tagging, outputting part-of-speech labels. For each text vocabulary unit, a named entity recognition model based on Bidirectional Long Short-Term Memory Networks and Conditional Random Fields is used to perform entity recognition, outputting entity type labels such as device name, room name, and person name.
[0041] The part-of-speech tagging model adopts a bidirectional long short-term memory (LSTM) network architecture based on conditional random fields. Specifically, the bidirectional LSM network comprises an input layer that maps each word to a 300-dimensional word embedding vector; a bidirectional LSM layer containing forward and backward LSM networks, each with 256 hidden units, concatenated to obtain a 512-dimensional context-related representation; a fully connected layer that maps the 512-dimensional representation to the number of part-of-speech tags, for example, 40 categories; and finally, a conditional random field layer that models the tag transitions of the entire sequence and outputs the optimal tag sequence.
[0042] The training process of the part-of-speech tagging model uses 200,000 annotated Chinese sentences, each containing a word sequence and its corresponding part-of-speech tag sequence. The input is a word sequence, and the output is a part-of-speech tag sequence. The loss function is the negative log-likelihood loss of a conditional random field. The Adam optimizer is used, with an initial learning rate of 0.001, a batch size of 32, and 30 training epochs. Accuracy is used as the evaluation metric. In inference applications, the segmented word sequence is input into the model, and the optimal part-of-speech tag sequence is obtained through Viterbi decoding.
[0043] The named entity recognition model adopts a bidirectional long short-term memory network-conditional random field architecture. Specifically, the bidirectional long short-term memory network-conditional random field model includes an input layer that maps each word to a 300-dimensional word embedding vector and concatenates it with character features extracted by a character-level convolutional neural network; a bidirectional long short-term memory layer with 256 hidden units, concatenating them to obtain 512-dimensional features; a fully connected layer that maps to the number of entity labels, for example, 10 categories; and finally, a conditional random field layer for sequence decoding.
[0044] The named entity recognition model was trained using 100,000 sentences of Chinese text labeled with entities such as device names and room names. The input was text sentences, and the output was a sequence of entity labels in BIO annotation format. The loss function used was negative log-likelihood loss with a conditional random field. The Adam optimizer was used, with an initial learning rate of 0.001, a batch size of 32, and 30 training epochs. During inference, the text sentences were input into the model, and Viterbi decoding was used to obtain entity mentions and their types.
[0045] Step S133: Based on the part-of-speech tagging processing results, select noun-type vocabulary units and verb-type vocabulary units from all text vocabulary units as candidate keyword units, and perform word frequency statistics processing on the candidate keyword units to calculate the frequency of each candidate keyword unit in the complete interactive content text.
[0046] Based on part-of-speech tags, text lexical units tagged as nouns and verbs are selected to form the candidate keyword unit set. The candidate keyword unit set is traversed, and a hash table is used to count the total number of times each lexical unit appears in the complete interactive content text to obtain the frequency of occurrence.
[0047] Step S134: Sort the candidate keyword units in descending order according to their frequency of occurrence, select a preset number of candidate keyword units with the highest frequency of occurrence as preliminary screening keywords, and perform semantic role labeling on the preliminary screening keywords to determine the semantic role type played by each preliminary screening keyword in the interaction round unit.
[0048] The candidate keyword units are sorted from highest to lowest frequency of occurrence, and the top K keywords are selected as the initial screening keywords. The initial screening keywords, along with the text sentence units in which they are located, are input into a transformer-based semantic role labeling model. The model outputs the semantic role that each word plays in the sentence, such as core predicate, patient, agent, location, etc.
[0049] The semantic role labeling model adopts a Transformer-based encoder-decoder architecture. Specifically, the semantic role labeling model uses a pre-trained BERT-based Chinese model as the encoder to convert the input text into a 768-dimensional context representation sequence; the decoder adopts a 6-layer Transformer decoder, each layer containing masked multi-head self-attention, encoder-decoder cross-attention, and a feedforward network, and each position in the output sequence corresponds to a semantic role label.
[0050] The semantic role labeling model was trained using a corpus of 50,000 manually labeled sentences. The input is a sentence containing the target word, and the output is a semantic role label for each word. Cross-entropy loss was used as the loss function. The Adam optimizer was employed, with an initial learning rate of 2e-5, a batch size of 16, and 10 training epochs. In inference applications, the pre-selected keywords and their corresponding sentences were concatenated and input into the model, which then outputs the semantic role type for each word.
[0051] Step S135: Based on the semantic role type, identify the word units belonging to the action role of the appeal from the preliminary screening keywords as the core interactive appeal keywords, and identify the word units belonging to the object role of the appeal from the preliminary screening keywords as candidate core interactive object keywords.
[0052] From the initial keyword screening, words with semantic roles as core predicates or representing the user's main actions are selected as the core interaction appeal keywords. Words with semantic roles as patients or representing the object of an action are selected as the candidate core interaction object keywords.
[0053] Step S136: Perform entity linking processing on the candidate core interaction object keywords, map each candidate core interaction object keyword to the corresponding object node in the preset interaction object knowledge base, and obtain the object attribute description information corresponding to each candidate core interaction object keyword.
[0054] The candidate core interactive object keywords are input into the interactive object knowledge base, which is a graph database containing object entity nodes and their attributes. The string similarity and semantic similarity between the candidate core interactive object keywords and the names of each object entity node in the knowledge base are calculated, and the node with the highest similarity is selected as the link result. All attribute information of this node, such as type, location, status, and supported operations, is read as the object attribute description information.
[0055] Step S137: Based on the object attribute description information, perform importance evaluation processing on the candidate core interaction object keywords, calculate the keyness score of each candidate core interaction object keyword in the interaction round unit, and select the candidate core interaction object keyword with the highest keyness score as the core interaction object keyword.
[0056] For each candidate core interaction keyword, its keyness score S_obj = w1*TF + w2*HF + w3*MF is calculated. Here, TF is the frequency of occurrence, HF is the frequency of mention of the object in the user's historical interactions, and MF is the semantic matching degree between the object and the core interaction appeal keyword, obtained by calculating the compatibility score between object attributes and appeal actions. w1, w2, and w3 are preset weights. The candidate core interaction keyword with the highest score is selected as the final core interaction keyword.
[0057] Step S138: Input the core interactive appeal keyword into the preset interactive knowledge base for concept matching processing, retrieve appeal concept nodes that are semantically similar to the core interactive appeal keyword in the interactive knowledge base, and collect multiple related knowledge nodes in the interactive knowledge base along the preset knowledge association path starting from the appeal concept node.
[0058] The core interactive appeal keywords are input into the interactive knowledge base, which contains appeal concept nodes. The cosine similarity of the word vectors of the core interactive appeal keywords and each appeal concept node is calculated, and the node with the highest similarity is selected as the matched appeal concept node. Starting from this node, a breadth-first traversal is performed in the interactive knowledge base along preset relationship edges such as superordinate concepts, subordinate concepts, related concepts, and common scenarios, collecting all traversed nodes as the related knowledge nodes.
[0059] Step S139: Perform deduplication filtering on all collected relevant knowledge nodes, perform relevance scoring on the deduplicated relevant knowledge nodes to calculate the semantic relevance score between each relevant knowledge node and the claim concept node, and select a preset number of relevant knowledge nodes with the highest semantic relevance scores as candidate background support knowledge units.
[0060] Remove duplicate nodes from the set of relevant knowledge nodes. For each deduplicated node, calculate its semantic relevance score R with the claim concept node, R = 1 / (shortest path length + 1) or by calculating the dot product of the node embedding vectors. Sort the nodes by score from highest to lowest, and select the top M nodes as the candidate background supporting knowledge units.
[0061] Step S1310: Input the core interactive object keyword into the interactive knowledge base for entity matching processing, retrieve object entity nodes in the interactive knowledge base that are semantically similar to the core interactive object keyword, and obtain the object attribute information associated with the object entity node stored in the interactive knowledge base.
[0062] Input the core interactive object keywords into the interactive knowledge base and match them with object entity nodes. The matching method is the same as in step S136. Obtain all object attribute information associated with the matched object entity node, including object type, supported operations, current state, historical state records, and linkage relationships with other devices.
[0063] Step S1311: Based on the object attribute information, perform object relevance filtering on the candidate background support knowledge units, calculate the semantic relevance between each candidate background support knowledge unit and the object entity node, and retain the candidate background support knowledge units with semantic relevance exceeding a preset threshold as background support knowledge units associated with the core interactive object keywords.
[0064] For each candidate background supporting knowledge unit, calculate the shortest path length L between it and the object entity node in the interactive knowledge base, and the semantic relevance A = 1 / (L+1). A preset relevance threshold is T_rel; candidate background supporting knowledge units with A ≥ T_rel are retained, and these are the background supporting knowledge units.
[0065] Step S1312: All retained background support knowledge units are structured and organized. Each background support knowledge unit is classified and grouped according to its association with the requested concept node. A corresponding object anchoring tag is added to each background support knowledge unit. All background support knowledge units after classification, grouping and adding object anchoring tags are combined into the interactive context knowledge set.
[0066] Based on the relationship type between each background supporting knowledge unit and the claim concept node (e.g., superior, subordinate, related scenario), they are categorized into different groups. An object anchoring tag is added to each background supporting knowledge unit, marking the core interactive object keywords primarily associated with that unit. All grouped units and their tags are encapsulated into a JSON object, serving as the interactive context knowledge set.
[0067] Step S140: Input the interactive contextual knowledge set into the memory-enhanced reasoning network for contextual knowledge encoding processing to generate a contextual knowledge encoding vector. Perform semantic fusion processing on the contextual knowledge encoding vector and the semantics of the interactive content of the interactive round unit to generate a fused memory representation vector. Based on the fused memory representation vector, retrieve the historical interactive round memory entries that match the current interactive round from the long-term interactive memory bank.
[0068] Step S141: Extract text content from each background support knowledge unit in the interactive context knowledge set to obtain the knowledge description text corresponding to each background support knowledge unit. Then, perform text cleaning and sentence segmentation on the knowledge description text to divide it into multiple knowledge description statement units.
[0069] Each background support knowledge unit in the interactive context knowledge set is traversed, and its stored knowledge description text field is extracted. The knowledge description text is then cleaned to remove HTML tags, special characters, and redundant whitespace. A punctuation-based sentence segmentation tool is used to divide the cleaned text into multiple knowledge description statement units.
[0070] Step S142: Each knowledge description statement unit is input into the knowledge encoder of the memory-enhanced reasoning network for semantic vectorization processing. The knowledge encoder performs lexical embedding mapping processing and self-attention mechanism encoding processing on the knowledge description statement unit to generate a statement semantic vector corresponding to each knowledge description statement unit.
[0071] The knowledge encoder employs a transformer encoder architecture. Each knowledge description sentence unit is lexically embedded to obtain a lexical embedding sequence, and positional encoding is added. The sequence is input into a multi-layer transformer encoder block, each block containing a multi-head self-attention sublayer and a feedforward neural network sublayer, followed by residual connections and layer normalization. The vector corresponding to the [CLS] tag output by the last encoder layer is taken as the sentence semantic vector.
[0072] The knowledge encoder employs a Transformer encoder architecture. Specifically, the knowledge encoder consists of six identical encoder layers stacked together. Each encoder layer contains a multi-head self-attention sublayer and a feedforward neural network sublayer. The multi-head self-attention sublayer uses eight attention heads, each with a dimension of 64. The feedforward neural network sublayer contains two linear transformations with an intermediate dimension of 2048, using the ReLU activation function. Each sublayer is followed by residual connections and layer normalization. The input sequence is first mapped to a 512-dimensional vector through a vocabulary embedding layer, and positional encoding is added.
[0073] The knowledge encoder is trained using a large-scale Chinese corpus, employing a masked language model task to randomly mask 15% of the words for prediction. The pre-training dataset consists of 10 billion tokens. After pre-training, fine-tuning is performed using knowledge description text from an interactive knowledge base, with the fine-tuning task being the prediction of the next sentence. The Adam optimizer is used, with an initial learning rate of 1e-4 and a batch size of 256. During inference applications, the knowledge description sentence units are lexically embedded and positionally encoded, input into the encoder, and the output vector at the last layer [CLS] position is taken as the semantic vector of the sentence.
[0074] Step S143: Aggregate the semantic vectors of all knowledge description statement units corresponding to the same background supporting knowledge unit, calculate the mean vector of all semantic vectors as the knowledge unit vector of the background supporting knowledge unit, and concatenate and combine the knowledge unit vectors of all background supporting knowledge units to generate the context knowledge encoding vector corresponding to the interactive context knowledge set.
[0075] For all the statement semantic vectors belonging to the same background supporting knowledge unit, calculate their arithmetic mean on each dimension to obtain the knowledge unit vector of that unit. Concatenate all the knowledge unit vectors along the feature dimensions in a fixed order to form a one-dimensional long vector, which is the contextual knowledge encoding vector.
[0076] Step S144: Extract the interaction content semantics of the interaction round unit corresponding to the current interaction round in the interaction round unit sequence. The interaction content semantics are stored in the form of multimodal interaction content semantic representation. The multimodal interaction content semantic representation is input into the content encoder of the memory-enhanced inference network for semantic encoding processing and converted into an interaction content semantic vector with the same dimension as the contextual knowledge encoding vector.
[0077] From the sequence of interaction rounds generated in step S127, the currently processed interaction round is extracted, and its stored multimodal interaction content semantic representation vector is obtained. The multimodal interaction content semantic representation vector is input into the content encoder, which is a single-layer linear mapping network. The content encoder linearly projects the vector onto the same dimensional space as the contextual knowledge encoding vector through a learnable weight matrix W_c, and outputs the interaction content semantic vector.
[0078] Step S145: Input the contextual knowledge encoding vector and the interaction content semantic vector into the cross-modal fusion module of the memory-enhanced reasoning network for feature interaction processing, calculate the attention weight distribution between the contextual knowledge encoding vector and the interaction content semantic vector, and perform weighted adjustment processing on the interaction content semantic vector according to the attention weight distribution to generate attention-weighted interaction content semantic vector.
[0079] The cross-modal fusion module first divides the contextual knowledge encoding vector into multiple equal-length segments, each segment being considered a key-value vector. Using the interaction content semantic vector as a query, the dot product of the query and each key-value vector is calculated to obtain an attention score. The attention score is then Softmax normalized to obtain the attention weight distribution. The attention weight distribution is used to perform a weighted summation of each key-value vector to obtain a context vector. Finally, the context vector is multiplied element-wise by the interaction content semantic vector to obtain the attention-weighted interaction content semantic vector.
[0080] Step S146: The contextual knowledge encoding vector and the attention-weighted interaction content semantic vector are concatenated to generate a concatenated fusion vector. The concatenated fusion vector is then subjected to linear transformation and activation function processing. The dimension of the concatenated fusion vector is mapped to a preset memory representation dimension space to generate the fused memory representation vector.
[0081] The contextual knowledge encoding vector and the attention-weighted interaction content semantic vector are concatenated along the feature dimension to obtain the concatenated fusion vector. This concatenated fusion vector is then input into a fully connected layer, linearly mapped to the memory representation dimension space using the weight matrix W_f, and further transformed non-linearly using the Tanh activation function to finally output the fused memory representation vector.
[0082] Step S147: Perform vectorized pre-indexing processing on each historical interaction round memory entry stored in the long-term interactive memory bank. When storing each historical interaction round memory entry into the long-term interactive memory bank, input the historical interaction round memory entry into the memory-enhanced inference network for encoding processing to generate the historical memory representation vector corresponding to the historical interaction round memory entry.
[0083] When a new historical interaction round memory entry is stored in the long-term interaction memory bank, the set of interaction context knowledge and the semantic representation of the multimodal interaction content contained in the entry are extracted, and the memory-enhancing inference network is input according to the forward calculation process described in steps S141 to S146 to calculate the historical memory representation vector corresponding to the entry.
[0084] Step S148: Associate the historical memory representation vector with the storage address of the memory entry of the historical interaction round and store it in the vector index area of the long-term interaction memory bank. Construct an approximate nearest neighbor search index based on spatial partitioning based on all historical memory representation vectors stored in the vector index area.
[0085] The generated historical memory representation vector and the storage address of the historical interaction round memory entry in the long-term interaction memory bank are combined into a key-value pair and stored in the vector index area. Product quantization technology is used to cluster and quantize all the historical memory representation vectors in the vector index area to construct an inverted index structure, forming the approximate nearest neighbor search index.
[0086] Step S149: Input the fusion memory representation vector of the current interaction round into the approximate nearest neighbor search index for fast retrieval processing, determine the target subspace to which the fusion memory representation vector belongs, and traverse the vector inverted index table of the target subspace to calculate the vector distance metric between the fusion memory representation vector and each historical memory representation vector.
[0087] The fused memory representation vector of the current interaction round is used as the query vector and input into the approximate nearest neighbor search index. First, based on the coarse quantizer of the product quantizer, the query vector is assigned to the nearest cluster center to determine the target subspace. Then, all the historical memory representation vectors within the target subspace are read from the inverted index, and the Euclidean distance between the query vector and each historical vector is calculated.
[0088] Step S1410: Select the first preset number of historical memory representation vectors with the smallest vector distance metric as preliminary candidate memory vectors, and read the complete content data of the historical interaction round memory entries corresponding to each preliminary candidate memory vector from the long-term interactive memory bank according to the storage address associated with the preliminary candidate memory vectors.
[0089] The Euclidean distances calculated in step S149 are sorted in ascending order, and the top N historical memory representation vectors with the smallest distances are selected as the preliminary candidate memory vectors. Based on the storage addresses associated with these vectors in the vector index area, the complete content data of the corresponding historical interaction round memory entries are read from the main storage area of the long-term interactive memory bank.
[0090] Step S1411: Perform relevance reordering on each historical interaction round memory entry read, calculate the matching score between each historical interaction round memory entry and the current interaction round, and select the second preset number of historical interaction round memory entries with the highest matching score as the historical interaction round memory entries that match the current interaction round.
[0091] For each historical interaction round memory entry retrieved, the matching score S_match = α*(1 / D_euclidean) + β*Sim_l + γ*Sim_o is calculated. Where D_euclidean is the Euclidean distance, Sim_l is the semantic similarity between the historical and current request keywords, Sim_o is the entity matching degree between the historical and current object keywords, and α, β, and γ are preset weights. The top K entries with the highest scores are selected as the final matched historical interaction round memory entries, sorted from highest to lowest.
[0092] Step S150: Extract historical interaction request keywords and historical interaction object keywords from the historical interaction round memory entries; perform intent completion processing on the core interaction request keywords and core interaction object keywords of the current interaction round based on the historical interaction request keywords and historical interaction object keywords to generate an enhanced interaction intent representation; generate response reasoning content for the current interaction round based on the enhanced interaction intent representation and send it to the intelligent interactive terminal for interaction content presentation processing.
[0093] Step S151: parse the complete content data of the historical interaction round memory entries, directly extract the stored historical interaction request keyword field from the historical interaction round memory entries, and obtain the core request keyword information expressed by the user during the historical interaction process.
[0094] For each historical interaction round memory entry matched in step S1411, its predefined data structure is parsed, and the value of the historical interaction request keyword field is directly read to obtain the historical interaction request keyword list.
[0095] Step S152: Directly extract the stored historical interaction object keyword field from the historical interaction round memory entries, obtain the core object keyword information that the user focuses on during the historical interaction, perform semantic generalization processing on the historical interaction request keywords, and map the historical interaction request keywords to the corresponding request type node in the preset request type classification system.
[0096] Simultaneously, the keyword field of the historical interaction object is read to obtain the keyword list of the historical interaction object. The keywords of the historical interaction requests are input into the request type classification system, which is a tree structure. The word vector similarity between the keywords and the names of each node is calculated, and the keywords are mapped to the request type node with the highest similarity.
[0097] Step S153: Obtain the superior request category information and subordinate request subclass information of the corresponding request type node, construct the request type hierarchical tree structure of the historical interaction request keywords, perform attribute expansion processing on the historical interaction object keywords, and query the complete object attribute set corresponding to the historical interaction object keywords in the preset interaction object knowledge base.
[0098] In the aforementioned request type classification system, all ancestor nodes of the current node are obtained as superior request category information, and all descendant nodes are obtained as subordinate request subclass information. These nodes are then organized into a hierarchical tree structure according to their hierarchical relationship. The keywords of the historical interaction objects are input into the interaction object knowledge base to query and retrieve their corresponding object attribute sets.
[0099] Step S154: Perform a request continuity detection process on the core interaction request keywords of the current interaction round and the historical interaction request keywords, calculate the semantic similarity between the core interaction request keywords and the historical interaction request keywords, and determine that the current interaction request and the historical interaction request have a request continuity relationship when the semantic similarity exceeds a preset request continuity determination threshold.
[0100] Calculate the cosine similarity of the word vectors of the current core interaction appeal keywords and the historical interaction appeal keywords to obtain a semantic similarity score. A threshold for determining the continuity of the appeal is preset to T_intent; if the similarity score is ≥ T_intent, then the appeal continuity relationship is determined.
[0101] Step S155: When it is determined that the current interaction request and the historical interaction request have a request continuity relationship, the historical interaction request keyword is taken as the main request keyword, and the core interaction request keyword of the current interaction round is taken as the sub-request keyword. The request hierarchy inclusion relationship between the main request keyword and the sub-request keyword is determined according to the request type hierarchy tree structure of the historical interaction request keyword.
[0102] When the aforementioned demand continuity relationship exists, the historical interaction demand keywords are used as the primary demand keywords, and the current core interaction demand keywords are used as secondary demand keywords. In the demand type hierarchical tree structure, it is determined whether the secondary demand keyword is a subordinate node or modifier of the primary demand keyword, and this inclusion relationship is recorded.
[0103] Step S156: Perform object association detection processing on the core interaction object keywords of the current interaction round and the historical interaction object keywords to identify whether there is a direct or indirect object association relationship between the core interaction object keywords of the current interaction round and the historical interaction object keywords. The object association relationship includes the same object relationship, belonging to the same category relationship, and functional complementary relationship.
[0104] Determine whether the current core interaction object keyword and the historical interaction object keyword point to the same entity. If they do, they are considered to be of the same object relationship. If not, determine whether they belong to the same category in the interaction object knowledge base. If they do, they are considered to be of the same category relationship. If not, further determine whether they have a co-occurrence or linkage relationship. If they do, they are considered to be of complementary functions.
[0105] Step S157: Based on the results of the object association detection and the request continuity detection, perform intent completion processing on the core interaction request keywords and the core interaction object keywords of the current interaction round. When there is semantic missingness in the core interaction request keywords, extract the missing request semantic information from the historical interaction request keywords to supplement them, and obtain the completed core interaction request keywords.
[0106] If the semantics of the current core interaction request keywords are incomplete, such as lacking degree modification or target, corresponding modifiers or implicit object information are extracted from the historical interaction request keywords to supplement them based on the continuity relationship of the request.
[0107] Step S158: When the core interaction object keyword has missing attributes, the missing object attribute information is extracted from the complete object attribute set of the historical interaction object keyword to supplement it. The supplemented core interaction request keyword and the supplemented core interaction object keyword are combined and encoded to generate an enhanced interaction intent representation that integrates historical interaction information.
[0108] If the current core interaction object keyword lacks attributes such as location or type, the missing attributes are extracted from the object attribute set of the historical interaction object keywords to supplement them. The supplemented appeal keyword and object keyword are concatenated into a text sequence, input into an embedding layer, and mapped to a fixed-length vector as the enhanced interaction intent representation vector.
[0109] Step S159: The enhanced interactive intent representation input is used to perform reasoning generation processing on the pre-built response content generation model. Based on the completed core interactive appeal keywords, a matching response template is retrieved from the preset response template library. The response template with the highest appeal type matching degree with the completed core interactive appeal keywords is selected as the candidate response template.
[0110] The response content generation model includes a template retrieval module. The request type of the completed core interactive request keywords is used as the query, and the response template library is searched. The matching degree with the request type tag of each template is calculated, and the template with the highest matching degree is selected as the candidate response template.
[0111] The response content generation model described in this step adopts a Transformer-based encoder-decoder architecture. Specifically, the model comprises a 6-layer Transformer encoder and a 6-layer Transformer decoder. The encoder expands the enhanced interaction intent representation vector into a sequence form before processing, and the decoder generates the response text autoregressively. Each layer contains a multi-head self-attention sublayer and a feedforward network sublayer, with 12 attention heads and a hidden layer dimension of 768. The model also includes an output layer with a vocabulary size of 30,000, mapping the decoder output to a vocabulary probability distribution.
[0112] The training process of the response content generation model uses 500,000 sets of historical interaction rounds of data, each set containing the enhanced interaction intent representation and the corresponding standard response text. The input is the enhanced interaction intent representation, and the output is the response text sequence. The loss function is cross-entropy loss. The Adam optimizer is used, with an initial learning rate of 1e-4, a batch size of 64, and 20 training rounds. Beam search decoding is used, with a beamwidth of 5. In inference applications, the enhanced interaction intent representation vector generated in step S158 is input into the encoder, and the decoder generates response text through autoregression, taking the word sequence with the highest probability as the output. In S1510, based on the completed core interaction object keywords and the description information of the object association relationship, the fillable variable part in the candidate response template is filled with variables, and the completed core interaction object keywords and their associated object information are filled into the corresponding fillable variable positions to generate preliminary response text content.
[0113] The candidate response template is parsed to identify fillable variables such as [object], [operation], and [degree]. The completed core interaction object keywords are filled into the [object] variable, and the core actions from the completed core interaction request keywords are filled into the [operation] variable. Based on the associated object information in the object association relationship, the corresponding association variables are filled in to generate the preliminary response text content.
[0114] Step S1511: Perform fluency optimization processing on the preliminary response text content, resolve the referential relationship in the preliminary response text content based on the description information of the continuity relationship of the request, adjust the sentence structure of the preliminary response text content according to the preset language expression rules, and generate response reasoning content that conforms to the natural language expression habits.
[0115] Based on the continuity of the stated demands, it is determined whether the current round is a continuation of a previous demand. If so, the recurring object names are replaced with pronouns to resolve the referential issues. A pre-defined language expression rule base is applied to simplify, merge, or reorganize the sentence structure, eliminating redundancy and unnatural expressions, and outputting the optimized response reasoning content.
[0116] In step S1512, the response reasoning content is sent to the display module of the smart interactive terminal for text presentation processing. The response reasoning content is displayed on the interactive interface of the smart interactive terminal in the form of a dialog bubble. At the same time, the response reasoning content is sent to the speech synthesis module of the smart interactive terminal for speech synthesis processing to generate a corresponding response voice signal and play it through the speaker.
[0117] The response reasoning text is sent to both the display module and the speech synthesis module. The display module renders a speech bubble in the dialogue area of the interactive interface to display the text. The speech synthesis module uses a text-to-speech engine to synthesize the text into an audio signal, which is then played through a speaker.
[0118] Step S1513: The response reasoning content is associated with the enhanced interaction intent representation of the current interaction round and stored in a related storage process. The response reasoning content, the enhanced interaction intent representation, and the interaction event time sequence of the current interaction round are combined and encapsulated into a new historical interaction round memory entry. The new historical interaction round memory entry is stored in the long-term interaction memory bank.
[0119] The response reasoning content, the enhanced interaction intent representation vector, the interaction event time sequence, and the interaction round unit information are packaged into a complete entry according to a predefined data structure. This entry is written into the long-term interaction memory bank, and the vectorized pre-indexing process in step S147 is triggered to generate the historical memory representation vector and update the index.
[0120] Step S160, the method further includes the step of performing memory decay and reinforcement processing on the long-term interactive memory bank.
[0121] Step S161: Configure an initial memory strength parameter and a latest access time tag for each historical interaction round memory entry in the long-term interactive memory bank. Whenever a historical interaction round memory entry is retrieved and output as a historical interaction round memory entry that matches the current interaction round, update the latest access time tag of the historical interaction round memory entry to the current time.
[0122] When each historical interaction round memory entry is created, a memory strength parameter S_mem is initialized to 1.0, and the latest access time tag T_access is set to the creation time. Each time this entry is output as a matching result in step S1411, T_access is updated to the current system time.
[0123] Step S162: Perform incremental reinforcement operation on the memory strength parameter of the historical interaction round memory entry, increase the preset strength increment value, and calculate the time interval length between the historical interaction round memory entry and the current time based on the latest access time tag of each historical interaction round memory entry.
[0124] When an entry is accessed, the operation S_mem=min(S_mem+ΔS,1.0) is performed on S_mem, where ΔS is a preset intensity increment value. A decay thread is periodically started to iterate through all entries, calculate the difference between the current time and T_access, and obtain the time interval Δt.
[0125] Step S163: Perform a periodic decay operation on the memory intensity parameter of each historical interaction round memory entry according to the time interval length, calculate the decay coefficient according to the preset decay function, and multiply the memory intensity parameter by the decay coefficient to obtain the decayed memory intensity parameter.
[0126] The decay coefficient λ = exp(-Δt / τ) is calculated using the exponential decay function, where τ is the decay half-life constant. Then, S_mem = S_mem * λ is updated.
[0127] Step S164: Normalize the memory intensity parameters of all historical interaction round memory entries in the long-term interactive memory bank, and map the memory intensity parameters of each historical interaction round memory entry to a unified intensity value range to obtain normalized memory intensity parameters.
[0128] Periodically scan the S_mem value of all entries to find the maximum value S_max and the minimum value S_min. For each entry, calculate S_norm=(S_mem-S_min) / (S_max-S_min) to obtain the normalized memory strength parameter, which has a value range of [0,1].
[0129] Step S165: Screen the historical interaction round memory entries stored in the long-term interaction memory library according to the normalized memory strength parameter, and remove the historical interaction round memory entries with the normalized memory strength parameter lower than the preset memory elimination threshold from the long-term interaction memory library.
[0130] Preset the memory elimination threshold as T_prune. Traverse all entries. If S_norm < T_prune, then delete the entry from the main storage area of the long-term interaction memory library.
[0131] Step S166: Delete the corresponding historical memory representation vectors of the removed historical interaction round memory entries from the vector index area, perform memory integration processing on the historical interaction round memory entries stored in the long-term interaction memory library, and identify multiple historical interaction round memory entries with similar historical interaction requirement keywords and similar historical interaction object keywords.
[0132] Simultaneously delete the historical memory representation vectors corresponding to the removed entries from the vector index area. For the remaining entries, use the DBSCAN clustering algorithm to cluster with the semantic vectors of the historical interaction requirement keywords and the historical interaction object keywords as features, and identify the entries within the same cluster as similar entries.
[0133] Step S167: Merge the identified multiple similar historical interaction round memory entries to generate a new integrated memory entry. The historical interaction requirement keywords of the integrated memory entry take the union of the historical interaction requirement keywords of the multiple similar historical interaction round memory entries.
[0134] For each group of similar entries obtained by clustering, create a new integrated memory entry. Take the union of the sets of historical interaction requirement keywords of all entries in the group as the historical interaction requirement keywords of the new entry.
[0135] Step S168: The historical interaction object keywords of the integrated memory entry take the union of the historical interaction object keywords of the multiple similar historical interaction round memory entries, and the memory strength parameter of the integrated memory entry takes the maximum value of the memory strength parameters of the multiple similar historical interaction round memory entries.
[0136] Take the union of the sets of historical interaction object keywords of all entries in the group as the historical interaction object keywords of the new entry. Take the maximum value of S_mem of all entries in the group as the initial memory strength parameter of the new entry.
[0137] Step S169: Store the new integrated memory entry into the long-term interactive memory bank, and generate a corresponding historical memory representation vector for the new integrated memory entry to update the vector index area of the long-term interactive memory bank.
[0138] The new integrated memory entry is written to the main storage area of the long-term interactive memory bank, and all old entries and their vectors in the group are deleted from the original bank. Step S147 is triggered to generate the historical memory representation vector for the new entry and insert it into the vector index area.
[0139] Step S170, the method further includes the step of updating and optimizing the memory-enhanced reasoning network online.
[0140] Step S171: Collect the enhanced interaction intent representation and the response reasoning content corresponding to the current interaction round as the current training sample, use the enhanced interaction intent representation as the input feature, use the response reasoning content as the expected output label, and store the current training sample in the online training sample buffer pool.
[0141] After each interaction, the enhanced interaction intent representation vector generated in step S158 and the response reasoning content text generated in step S1511 are combined into a sample pair and stored in the online training sample buffer pool. The buffer pool adopts a first-in-first-out queue with a fixed capacity of C.
[0142] Step S172: When the number of training samples stored in the online training sample buffer pool reaches a preset batch training threshold, training samples of a preset batch size are randomly extracted from the online training sample buffer pool to form a batch training dataset.
[0143] When the number of samples in the buffer pool reaches the batch training threshold B_train, B samples are randomly selected from the pool, with B being the batch size, to form a batch training dataset.
[0144] Step S173: Input the enhanced interaction intent representation of each training sample in the batch training dataset into the memory-enhanced inference network for forward propagation processing to obtain the corresponding predicted response inference content, and calculate the loss function value between the predicted response inference content of each training sample and the expected output label.
[0145] Each enhanced interaction intent representation vector in the batch is input into the memory-enhanced inference network, and the complete encoding, fusion, retrieval, and generation process is executed to output the predicted response inference content. The cross-entropy loss function is used to calculate the loss between the predicted content and each word in the expected output label, and the summation yields the loss value L_i for that sample.
[0146] The loss function of the memory-enhanced reasoning network during training is the sum of multi-task losses. Specifically, it includes: a comparison loss between the contextual knowledge encoding vector and the historical memory representation vector, using the InfoNCE loss function to ensure the current encoding vector is similar to matching historical vectors and dissimilar to non-matching historical vectors; a cross-entropy loss for generating response reasoning content, calculating the lexical-level difference between the generated response and the standard response; and a classification loss for the intent completion result, used to supervise the quality of the enhanced interactive intent representation. Each loss term is weighted and summed according to preset weights of 0.3, 0.5, and 0.2.
[0147] Step S174: Average the loss function values of all training samples in the batch training dataset based on the loss function values to obtain the average loss value. Then, calculate the gradient information of each network layer in the memory-enhanced inference network using the backpropagation algorithm based on the average loss value.
[0148] Calculate the arithmetic mean of the loss values of all samples within the batch: L_avg = (1 / B)*ΣL_i. Using L_avg as the optimization objective, calculate the gradient of the loss function with respect to the weights of each layer, starting from the output layer, through the backpropagation algorithm.
[0149] Step S175: Based on the gradient information and the preset learning rate parameter, update and optimize the network weight parameters of the memory-enhanced inference network, and use the stochastic gradient descent optimization algorithm to gradually adjust the network weight parameters to reduce the average loss value.
[0150] The Adam optimizer is used to update all trainable parameters in the network based on the calculated gradient information and the preset learning rate η: θ_new=θ_old-η*(gradient+momentum term).
[0151] Step S176: After each completion of the network weight parameter update and optimization process of the memory-enhanced inference network, the batch training dataset used in this update and optimization process is removed from the online training sample buffer pool, and the newly collected current training samples are stored in the online training sample buffer pool for subsequent batch training.
[0152] The B samples used in this training session are popped from the buffer and deleted. Samples generated by subsequent interactions are then stored in the buffer, awaiting the next batch training trigger.
[0153] Step S177: Periodically perform performance evaluation processing on the encoder part and cross-modal fusion module of the memory-enhanced inference network, input the preset evaluation test sample set into the current version of the memory-enhanced inference network for inference processing, and obtain the corresponding evaluation response inference content.
[0154] Every fixed time period \(T_{eval}\), the pre - constructed evaluation test sample set is input into the current network, and the inference forward propagation is performed to obtain the evaluation response inference content. The evaluation test sample set includes standard inputs and expected outputs.
[0155] Step S178, compare the evaluation response inference content with the standard response inference content in the evaluation test sample set, calculate the evaluation accuracy rate. When the evaluation accuracy rate is lower than the preset accuracy threshold, trigger the network re - training process to globally re - train and optimize the memory - enhanced inference network.
[0156] Perform a word - by - word matching of the evaluation response inference content with the standard output to calculate the accuracy rate Acc. If Acc < \(T_{acc}\), trigger global re - training, and train the network from scratch using all historical data until the performance recovers on the validation set.
[0157] Step S180, the method further includes steps for dynamically expanding and updating the interactive knowledge base.
[0158] Step S181, monitor the user's original interaction data stream received by the intelligent interaction terminal in real - time, and identify novel interaction demand expressions and novel interaction object mentions that are not covered by the current interactive knowledge base from the user's original interaction data stream.
[0159] Perform the processing of steps S120 to S130 on the real - time incoming user's original interaction data stream, and extract the demand expressions and object mentions therein. Match the above - mentioned expressions with the demand concept nodes and object entity nodes in the interactive knowledge base. If the match fails, mark them as novel interaction demand expressions or novel interaction object mentions.
[0160] Step S182, perform semantic clustering processing on the novel interaction demand expressions, cluster multiple novel interaction demand expressions with the same or similar demands into the same novel demand category, and generate a corresponding demand category identifier for each novel demand category.
[0161] Collect all novel interaction demand expressions within a period of time, use the K - means algorithm to cluster them with their word vectors as features, and set an appropriate number of clusters. Generate a UUID for each cluster as the demand category identifier.
[0162] Step S183, perform entity recognition processing on the novel interaction object mentions, identify the object name, object type, and object attribute information corresponding to the novel interaction object mentions, and generate a corresponding novel object entity identifier for each novel interaction object mention.
[0163] For each novel interactive object mention, the named entity recognition model from step S132 is used to extract its object name and type. Its attribute information is then completed using a search engine or knowledge base API to generate a UUID as the novel object entity identifier.
[0164] Step S184: Send the novel claim category and the novel object entity identifier to the manual review terminal for review and confirmation, and receive the review and confirmation result returned by the manual review terminal. The review and confirmation result includes the claim category validity mark and the object entity validity mark.
[0165] Package the representative expressions of the novel claims to be confirmed and the novel object entity information to be confirmed, and send them to the manual review interface. Receive the validity flag returned by the manual reviewer; 1 for valid and 0 for invalid.
[0166] Step S185: When the validity of the claim category is marked as valid, the novel claim category is added as a new claim concept node to the interactive knowledge base, and claim definition description information and claim category attribute information are configured for the new claim concept node.
[0167] If the validity flag is 1, a new appeal concept node is created in the interactive knowledge base, and the appeal definition description and attributes are filled in, such as the category and common trigger words.
[0168] Step S186: When the object entity validity mark is valid, add the object entity corresponding to the novel object entity identifier as a new object entity node to the interactive knowledge base, and configure object attribute information for the new object entity node.
[0169] If the validity flag is 1, a new object entity node is created in the interactive knowledge base, and the object attribute information obtained in step S183 is filled in.
[0170] Step S187: Based on the co-occurrence relationship between the novel interactive appeal expression and the novel interactive object mention in the user's original interactive data stream, establish an appeal-object association relationship between the new appeal concept node and the new object entity node.
[0171] Analyze the co-occurrence frequency of the novel appeal expression and the novel object mention in historical data. If the co-occurrence frequency exceeds a threshold, create an association edge between the new appeal concept node and the new object entity node.
[0172] Step S188: Periodically perform relationship mining on the existing demand concept nodes and existing object entity nodes in the interactive knowledge base, identify potential new relationships between the existing demand concept nodes and existing object entity nodes, and add the identified new relationships to the interactive knowledge base.
[0173] The FP-Growth association rule mining algorithm is used to analyze the co-occurrence patterns of appeal concepts and object entities in a large number of historical interaction logs, and potential associations with confidence exceeding the threshold are discovered. These associations are then added as new relations to the knowledge base.
[0174] Step S190, the method further includes the step of detecting and resolving memory conflicts in the long-term interactive memory bank.
[0175] Step S191: Before storing the new historical interaction round memory entry into the long-term interaction memory bank, perform similarity calculation processing on the enhanced interaction intent representation of the new historical interaction round memory entry and the historical memory representation vector of the existing historical interaction round memory entries in the long-term interaction memory bank.
[0176] Before storing a new entry in step S1513, the cosine similarity between the enhanced interaction intent representation vector and all the historical memory representation vectors in the vector index area is calculated.
[0177] Step S192: When there is an existing historical interaction round memory entry whose similarity to the enhanced interaction intent representation of the new historical interaction round memory entry exceeds a preset conflict detection threshold, the existing historical interaction round memory entry is marked as a conflict candidate memory entry.
[0178] The preset conflict detection threshold is T_conflict. If there exists an existing vector whose cosine similarity to a new vector is ≥ T_conflict, then the entry corresponding to that existing vector is marked as the conflict candidate memory entry.
[0179] Step S193: Extract the core interaction request keywords and core interaction object keywords of the new historical interaction round memory entries, extract the historical interaction request keywords and historical interaction object keywords of the conflict candidate memory entries, and perform a request consistency comparison process on the core interaction request keywords and historical interaction request keywords of the two.
[0180] Extract the sets of appeal keywords L_new and L_cand from the new entry and the conflict candidate entry, respectively, and calculate the Jaccard similarity J_intent=|L_new∩L_cand| / |L_new∪L_cand|.
[0181] Step S194: Perform object consistency comparison processing on the core interaction object keywords and historical interaction object keywords of the two. When both the appeal consistency comparison processing result and the object consistency comparison processing result indicate consistency, determine that the new historical interaction round memory entry and the conflict candidate memory entry are duplicate memory entries.
[0182] Calculate the Jaccard similarity J_obj of the object keyword sets O_new and O_cand. If J_intent≥T_intent_sim and J_obj≥T_obj_sim, then determine it as a duplicate memory entry.
[0183] Step S195: When it is determined as a duplicate memory entry, compare the memory strength parameters of the new historical interaction round memory entry and the conflict candidate memory entry, retain the historical interaction round memory entry with the larger memory strength parameter, and remove the historical interaction round memory entry with the smaller memory strength parameter from the long-term interaction memory library.
[0184] Compare S_mem_new and S_mem_cand, retain the entry with the larger value, delete the entry with the smaller value, and synchronously update the main storage area and the vector index area.
[0185] Step S196: When the appeal consistency comparison processing result and the object consistency comparison processing result indicate inconsistency, determine that there is a memory conflict between the new historical interaction round memory entry and the conflict candidate memory entry, and mark both the new historical interaction round memory entry and the conflict candidate memory entry as memory entries to be resolved for conflicts.
[0186] If J_intent<T_intent_sim or J_obj<T_obj_sim, then determine that there is a memory conflict. Mark both the new entry and the conflict candidate entry as memory entries to be resolved for conflicts, and pause the automatic storage.
[0187] Step S197: Send the memory entries to be resolved for conflicts and their corresponding enhanced interaction intention representations and historical memory representation vectors to the artificial resolution terminal for conflict adjudication processing, and receive the conflict adjudication result returned by the artificial resolution terminal. The conflict adjudication result includes a retain entry identifier and a remove entry identifier.
[0188] Package the memory entries to be resolved for conflicts and send them to the artificial review interface. After the reviewer views the conflict details, select to retain or remove certain entries. Receive the returned adjudication result, which includes the identifier of the entry to be retained and the identifier of the entry to be removed.
[0189] Step S198: Based on the retained entry identifier and the removed entry identifier, perform retention and removal operations on the memory entries to be resolved, and update the storage status of memory entries in the long-term interactive memory bank.
[0190] Based on the ruling, perform the storage operation for reserved entries, perform the deletion operation for removed entries, and synchronously update the main storage area and vector index area.
[0191] Step S200, the method further includes a step of collecting and evaluating the interactive effect feedback of the response reasoning content.
[0192] For example, in step S210, after the response reasoning content is sent to the intelligent interactive terminal for interactive content presentation processing, the user's subsequent interactive behavior after receiving the response reasoning content is continuously monitored, and the user's subsequent interactive data stream within the preset feedback time window is collected.
[0193] After step S1512 is executed, a feedback time window with a preset duration of T_feedback is opened. During this period, subsequent user interaction data is captured as per step S110, forming the subsequent interaction data stream.
[0194] Step S220: Perform interaction intent parsing processing on the subsequent interaction data stream, identify the subsequent interaction request keywords and subsequent interaction object keywords expressed by the user after receiving the response reasoning content, and calculate the request matching degree between the subsequent interaction request keywords and the core interaction request keywords of the current interaction round.
[0195] Steps S120 to S130 are executed on the subsequent interaction data stream to extract the subsequent interaction request keyword L_follow and the subsequent interaction object keyword O_follow. The semantic similarity Sim_l between L_follow and the current core interaction request keyword L_current is calculated.
[0196] Step S230: Calculate the object matching degree between the keywords of the subsequent interaction objects and the keywords of the core interaction objects in the current interaction round.
[0197] Calculate the semantic similarity Simo between O_follow and the keyword O_current of the current core interaction object. If O_follow contains O_current or is a synonym of it, then Simo is 1; otherwise, the similarity is calculated using word vectors.
[0198] Step S240: Normalize the appeal matching degree and the object matching degree, and map the appeal matching degree and the object matching degree to the same preset numerical range to obtain the normalized appeal matching degree score and object matching degree score.
[0199] Using Min-Max normalization, Sim_l and Sim_o are mapped to the [0,1] interval to obtain Sim_l_norm and Sim_o_norm.
[0200] Step S250: Based on preset weighting coefficients, perform a weighted summation of the normalized request matching score and the object matching score to obtain the user's satisfaction score for the response reasoning content.
[0201] Preset weights w_l and w_o, with w_l + w_o = 1. Calculate the satisfaction score: Score = w_l * Sim_l_norm + w_o * Sim_o_norm.
[0202] Step S260: When the satisfaction score exceeds the preset satisfaction threshold, add positive feedback tags to the enhanced interaction intent representation and the response reasoning content corresponding to the current interaction round, and store the enhanced interaction intent representation and response reasoning content with added positive feedback tags as positive samples in the feedback sample library.
[0203] A preset satisfaction threshold T_satisfied is set. If Score ≥ T_satisfied, a positive feedback label 1 is added to the enhanced interaction intent representation and the response reasoning content of the current round, and stored in the feedback sample library.
[0204] Step S270: When the satisfaction score is lower than the preset dissatisfaction threshold, add negative feedback labels to the enhanced interaction intent representation and the response reasoning content corresponding to the current interaction round, and store the enhanced interaction intent representation and response reasoning content with added negative feedback labels as negative samples in the feedback sample library.
[0205] A preset unsatisfied threshold T_unsatisfied is set. If Score ≤ T_unsatisfied, a negative feedback label of 0 is added and stored in the feedback sample library.
[0206] Step S280: Periodically perform statistical analysis on the positive and negative samples in the feedback sample library, identify enhanced interaction intent representation patterns and response reasoning content patterns in the positive samples whose frequency exceeds a first preset frequency threshold, and mark the identified patterns as preferred interaction patterns.
[0207] Periodically perform cluster analysis on positive samples in the feedback sample library to identify frequently occurring intent-response patterns. Patterns that occur more frequently than a first preset threshold F_good are marked as preferred interaction patterns.
[0208] Step S290: Identify enhanced interaction intent representation patterns and response reasoning content patterns that appear more frequently than a second preset frequency threshold in negative samples, mark the identified patterns as interaction patterns to be optimized, and update and optimize the template library of the response content generation model according to the interaction patterns to be optimized.
[0209] Cluster analysis is performed on negative samples to identify frequently occurring intent-response patterns. Patterns with a frequency exceeding a second preset threshold F_bad are marked as interaction patterns to be optimized. For these patterns, corresponding templates in the response template library are modified or deleted, and better candidate templates are added.
[0210] Step S2100: Construct a feedback training dataset based on the positive and negative samples, and use the feedback training dataset to perform incremental training on the memory-enhanced inference network, so that the memory-enhanced inference network learns the user's feedback information on the interaction effect.
[0211] A certain proportion of positive and negative samples are extracted from the feedback sample library to construct a feedback training dataset. This dataset is used in the online update process of step S170, and feedback labels are introduced as weights when calculating the loss, so that the network learns to generate responses that are more likely to receive positive feedback.
[0212] When using the feedback training dataset for incremental training of the memory-enhanced inference network, a weighted loss function is employed. For positive samples, the cross-entropy loss generated by the response inference content is multiplied by a weight w_pos, which is set to 1.2; for negative samples, it is multiplied by a weight w_neg, which is set to 0.8. Simultaneously, the policy gradient method from reinforcement learning is introduced, using the satisfaction score as the reward signal to optimize the actions that generate high-satisfaction responses through gradient ascent. The optimizer remains Adam, with a learning rate adjusted to 5e-5, a batch size of 32, and 5 training epochs.
[0213] Figure 2This illustration shows a memory enhancement and inference system 100 for intelligent interaction provided in an embodiment of this application. It includes a processor 1001, a memory 1003, and program code stored in the memory 1003. The processor 1001 executes the program code to implement the steps of the memory enhancement and inference method for intelligent interaction. The processor 1001 and the memory 1003 are connected, for example, via a bus 1002. Optionally, the memory enhancement and inference system 100 for intelligent interaction may further include a transceiver 1004, which can be used for data interaction between this memory enhancement and inference system for intelligent interaction and other memory enhancement and inference systems for intelligent interaction, such as sending and / or receiving data. It should be noted that in actual scheduling, the transceiver 1004 is not limited to one, and the structure of this memory enhancement and inference system 100 for intelligent interaction does not constitute a limitation on the embodiments of this application. The memory 1003 is used to store the program code for executing the embodiments of this application, and its execution is controlled by the processor 1001. The processor 1001 is used to execute program code stored in the memory 1003 to implement the steps shown in the foregoing method embodiments.
[0214] This application provides a computer-readable storage medium storing program code, which, when executed by a processor, can implement the steps and corresponding content of the aforementioned method embodiments.
[0215] The above description is only an optional implementation method for some implementation scenarios of this application. It should be noted that for those skilled in the art, other similar implementation methods based on the technical concept of this application, without departing from the technical concept of this application, also fall within the protection scope of the embodiments of this application.
Claims
1. A memory enhancement and reasoning method for intelligent interaction, characterized in that, include: The system captures the user's original interaction data stream generated during continuous interaction by the intelligent interactive terminal, performs interaction event segmentation on the user's original interaction data stream to obtain multiple interaction event units, assigns an event occurrence time tag to each interaction event unit, and performs time sequence arrangement processing on the interaction event units based on the event occurrence time tag to generate an interaction event time sequence. The interaction content semantics and interaction operation type of each interaction event unit in the interaction event time sequence are analyzed. Based on the interaction content semantics and the interaction operation type, the interaction intent of the interaction event unit is initially determined to obtain an initial intent tag. Based on the event occurrence time tag and the initial intent tag, the interaction rounds of the interaction event unit are merged to generate an interaction round unit sequence carrying intent identifiers. Extract the core interaction request keywords and core interaction object keywords of each interaction round unit in the sequence of interaction round units. Based on the core interaction request keywords, perform knowledge association and expansion processing in a preset interaction knowledge base to obtain background support knowledge units. Based on the core interaction object keywords, perform object anchoring processing on the background support knowledge units to generate the interaction context knowledge set corresponding to the interaction round unit. The interactive context knowledge set is input into the memory-enhanced reasoning network for context knowledge encoding processing to generate a context knowledge encoding vector. The context knowledge encoding vector is semantically fused with the semantics of the interactive content of the interactive round unit to generate a fused memory representation vector. Based on the fused memory representation vector, the historical interactive round memory entries that match the current interactive round are retrieved from the long-term interactive memory bank. Extract historical interaction request keywords and historical interaction object keywords from the historical interaction round memory entries. Based on the historical interaction request keywords and historical interaction object keywords, perform intent completion processing on the core interaction request keywords and core interaction object keywords of the current interaction round to generate an enhanced interaction intent representation. Based on the enhanced interaction intent representation, generate response reasoning content for the current interaction round and send it to the intelligent interactive terminal for interaction content presentation processing.
2. The memory enhancement and reasoning method for intelligent interaction according to claim 1, characterized in that, The process of parsing the interaction content semantics and interaction operation type of each interaction event unit in the interaction event time sequence, performing preliminary interaction intent determination processing on the interaction event unit based on the interaction content semantics and the interaction operation type to obtain a preliminary intent tag, and performing interaction round merging processing on the interaction event unit based on the event occurrence time tag and the preliminary intent tag to generate an interaction round unit sequence carrying intent identifiers includes: For each interactive event unit, multimodal content parsing processing is performed to extract the text semantic content, touch semantic content, and gaze semantic content contained in the interactive event unit. The text semantic content, touch semantic content, and gaze semantic content are then semantically aligned and fused to construct the multimodal interactive content semantic representation corresponding to the interactive event unit. Based on the semantic representation of the multimodal interactive content, the interactive event unit is subjected to semantic classification processing of interactive content to determine the semantic category label to which the interactive event unit belongs. The touch operation events contained in the interactive event unit are subjected to operation type recognition processing to determine the interactive operation type of the interactive event unit based on the operation gesture type. The semantic category label and the interaction operation type are input into a pre-built intention preliminary determination model for comprehensive reasoning processing. The intention preliminary determination model performs rule matching processing on the semantic category label and the interaction operation type according to a preset intention determination rule library. When the semantic category label and the interaction operation type match a certain intention determination rule at the same time, the intention label corresponding to that intention determination rule is used as the preliminary intention label of the interaction event unit. After assigning the initial intent label to each interactive event unit in the interactive event time sequence, the interactive event units are initially clustered based on the initial intent label. Multiple consecutive interactive event units with the same initial intent label are clustered into candidate interactive round groups, and a corresponding candidate round identifier is assigned to each candidate interactive round group. For each candidate interaction round group, the time interval between adjacent interaction event units is processed to detect the continuity of the round. When the time interval between adjacent interaction event units within the candidate interaction round group exceeds a preset round interruption time threshold, the adjacent interaction event units that exceed the round interruption time threshold are divided into different candidate interaction round groups. For each segmented candidate interaction round group, a candidate round identifier is reassigned. Based on the reassigned candidate round identifier, all interaction event units in the interaction event time sequence are merged and reorganized. Interaction event units belonging to the same candidate round identifier are combined into the same interaction round unit. For each interaction round unit, a corresponding round start time tag and round end time tag are generated. The intention tag with the highest frequency among the preliminary intention tags of all interaction event units in the interaction round unit is used as the intention identifier of the interaction round unit. Finally, the interaction round unit sequence containing the round start time tag, the round end time tag and the intention identifier is generated.
3. The memory enhancement and reasoning method for intelligent interaction according to claim 1, characterized in that, The process involves extracting the core interaction request keywords and core interaction object keywords for each interaction round unit in the sequence of interaction round units; performing knowledge association and expansion processing in a preset interaction knowledge base based on the core interaction request keywords to obtain background supporting knowledge units; and performing object anchoring processing on the background supporting knowledge units based on the core interaction object keywords to generate the interaction context knowledge set corresponding to the interaction round unit, including: For each interaction round unit, multimodal content integration processing is performed to collect and integrate the text semantic content, touch semantic content and gaze semantic content of all interaction event units contained in the interaction round unit to generate the complete interaction content text of the interaction round unit; The complete interactive content text is segmented into multiple text sentence units, each text sentence unit is segmented into multiple text vocabulary units, each text vocabulary unit is tagged with part of speech to determine its part of speech category, and each text vocabulary unit is named entity recognition to identify entity reference information. Based on the part-of-speech tagging results, noun and verb lexical units are selected from all text lexical units as candidate keyword units. The frequency of each candidate keyword unit in the complete interactive content text is calculated by performing word frequency statistics on the candidate keyword units. The candidate keyword units are sorted in descending order according to their frequency of occurrence. A preset number of candidate keyword units with the highest frequency of occurrence are selected as preliminary screening keywords. The preliminary screening keywords are then subjected to semantic role labeling to determine the semantic role type that each preliminary screening keyword plays in the interaction round unit. Based on the semantic role type, word units belonging to the action role of the appeal are identified from the preliminary screening of keywords as the core interactive appeal keywords, and word units belonging to the object role of the appeal are identified from the preliminary screening of keywords as candidate core interactive object keywords. The candidate core interactive object keywords are processed by entity linking, and each candidate core interactive object keyword is mapped to the corresponding object node in the preset interactive object knowledge base to obtain the object attribute description information corresponding to each candidate core interactive object keyword. The importance of the candidate core interaction object keywords is evaluated based on the object attribute description information. The key score of each candidate core interaction object keyword in the interaction round unit is calculated, and the candidate core interaction object keyword with the highest key score is selected as the core interaction object keyword. The core interactive appeal keywords are input into the preset interactive knowledge base for concept matching processing. The interactive knowledge base is used to retrieve appeal concept nodes that are semantically similar to the core interactive appeal keywords. Starting from the appeal concept nodes, multiple related knowledge nodes are collected in the interactive knowledge base along the preset knowledge association path. All collected relevant knowledge nodes are deduplicated and filtered. The deduplicated relevant knowledge nodes are then relevance scored to calculate the semantic relevance score between each relevant knowledge node and the claim concept node. A preset number of relevant knowledge nodes with the highest semantic relevance scores are selected as candidate background support knowledge units. The core interactive object keywords are input into the interactive knowledge base for entity matching processing. Object entity nodes that are semantically similar to the core interactive object keywords are retrieved in the interactive knowledge base, and object attribute information associated with the object entity nodes stored in the interactive knowledge base is obtained. Based on the object attribute information, the candidate background support knowledge units are subjected to object relevance filtering. The semantic relevance between each candidate background support knowledge unit and the object entity node is calculated. Candidate background support knowledge units with semantic relevance exceeding a preset threshold are retained as background support knowledge units associated with the core interactive object keywords. All retained background supporting knowledge units are structured and organized. Each background supporting knowledge unit is classified and grouped according to its association with the requested concept node. A corresponding object anchoring tag is added to each background supporting knowledge unit. All background supporting knowledge units that have been classified, grouped and marked with object anchoring tags are combined into the interactive context knowledge set.
4. The memory enhancement and reasoning method for intelligent interaction according to claim 1, characterized in that, The process involves inputting the interactive contextual knowledge set into a memory-enhanced reasoning network for contextual knowledge encoding to generate a contextual knowledge encoding vector. This vector is then semantically fused with the semantic content of the interactive round unit to generate a fused memory representation vector. Based on this fused memory representation vector, historical interactive round memory entries matching the current interactive round are retrieved from the long-term interactive memory bank. This includes: Text content extraction processing is performed on each background support knowledge unit in the interactive context knowledge set to obtain the knowledge description text corresponding to each background support knowledge unit. The knowledge description text is then processed by text cleaning and sentence segmentation to divide it into multiple knowledge description statement units. Each knowledge description statement unit is input into the knowledge encoder of the memory-enhanced reasoning network for semantic vectorization processing. The knowledge encoder performs lexical embedding mapping and self-attention mechanism encoding on the knowledge description statement unit to generate a statement semantic vector corresponding to each knowledge description statement unit. Aggregate the semantic vectors of all knowledge description statements corresponding to the same background supporting knowledge unit, calculate the mean vector of all semantic vectors as the knowledge unit vector of the background supporting knowledge unit, and concatenate and combine the knowledge unit vectors of all background supporting knowledge units to generate the context knowledge encoding vector corresponding to the interactive context knowledge set. The semantic content of the interaction content of the interaction unit corresponding to the current interaction round is extracted from the sequence of interaction round units. The semantic content of the interaction content is stored in the form of a multimodal semantic representation of the interaction content. The multimodal semantic representation of the interaction content is input into the content encoder of the memory-enhanced inference network for semantic encoding processing and converted into an interaction content semantic vector with the same dimension as the contextual knowledge encoding vector. The contextual knowledge encoding vector and the interaction content semantic vector are input into the cross-modal fusion module of the memory-enhanced reasoning network for feature interaction processing. The attention weight distribution between the contextual knowledge encoding vector and the interaction content semantic vector is calculated. Based on the attention weight distribution, the interaction content semantic vector is weighted and adjusted to generate an attention-weighted interaction content semantic vector. The contextual knowledge encoding vector and the attention-weighted interactive content semantic vector are concatenated to generate a concatenated fusion vector. The concatenated fusion vector is then subjected to linear transformation and activation function processing. The dimensions of the concatenated fusion vector are mapped to a preset memory representation dimension space to generate the fused memory representation vector. Each historical interaction round memory entry stored in the long-term interactive memory bank is subjected to vectorized pre-indexing processing. When storing each historical interaction round memory entry into the long-term interactive memory bank, the historical interaction round memory entry is input into the memory enhancement inference network for encoding processing to generate the historical memory representation vector corresponding to the historical interaction round memory entry. The historical memory representation vector is associated with the storage address of the memory entry of the historical interaction round and stored in the vector index area of the long-term interaction memory bank. An approximate nearest neighbor search index based on spatial partitioning is constructed based on all historical memory representation vectors stored in the vector index area. The fusion memory representation vector of the current interaction round is input into the approximate nearest neighbor search index for fast retrieval processing to determine the target subspace to which the fusion memory representation vector belongs. The vector inverted index table of the target subspace is traversed to calculate the vector distance metric between the fusion memory representation vector and each historical memory representation vector. The first preset number of historical memory representation vectors with the smallest vector distance metric are selected as preliminary candidate memory vectors. Based on the storage address associated with the preliminary candidate memory vectors, the complete content data of the historical interaction round memory entries corresponding to each preliminary candidate memory vector is read from the long-term interactive memory bank. For each historical interaction round memory entry read, re-sort the entries based on relevance, calculate the matching score between each historical interaction round memory entry and the current interaction round, and select the second preset number of historical interaction round memory entries with the highest matching score as the historical interaction round memory entries that match the current interaction round.
5. The memory enhancement and reasoning method for intelligent interaction according to claim 1, characterized in that, The process of extracting historical interaction request keywords and historical interaction object keywords from the historical interaction round memory entries, performing intent completion processing on the core interaction request keywords and core interaction object keywords of the current interaction round based on the historical interaction request keywords and historical interaction object keywords to generate an enhanced interaction intent representation, generating response reasoning content for the current interaction round based on the enhanced interaction intent representation, and sending it to the intelligent interactive terminal for interaction content presentation processing includes: The complete content data of the historical interaction round memory entries is parsed, and the stored historical interaction request keyword field is directly extracted from the historical interaction round memory entries to obtain the core request keyword information expressed by the user during the historical interaction process; The stored historical interaction object keyword field is directly extracted from the historical interaction round memory entries to obtain the core object keyword information that the user focuses on during the historical interaction process. The historical interaction request keywords are semantically generalized and mapped to the corresponding request type node in the preset request type classification system. Obtain the parent request category information and the child request subclass information of the corresponding request type node, construct the request type hierarchical tree structure of the historical interaction request keywords, perform attribute expansion processing on the historical interaction object keywords, and query the complete object attribute set corresponding to the historical interaction object keywords in the preset interaction object knowledge base. The core interaction appeal keywords of the current interaction round and the historical interaction appeal keywords are subjected to appeal continuity detection processing. The semantic similarity between the core interaction appeal keywords and the historical interaction appeal keywords is calculated. When the semantic similarity exceeds the preset appeal continuity judgment threshold, it is determined that the current interaction appeal and the historical interaction appeal have appeal continuity relationship. When it is determined that the current interaction request and the historical interaction request have a request continuity relationship, the historical interaction request keyword is used as the main request keyword, and the core interaction request keyword of the current interaction round is used as the sub-request keyword. The request hierarchy inclusion relationship between the main request keyword and the sub-request keyword is determined according to the request type hierarchy tree structure of the historical interaction request keyword. The core interaction object keywords of the current interaction round and the historical interaction object keywords are subjected to object association detection processing to identify whether there is a direct or indirect object association relationship between the core interaction object keywords of the current interaction round and the historical interaction object keywords. The object association relationship includes the same object relationship, belonging to the same category relationship, and functional complementary relationship. Based on the results of the object association detection and the request continuity detection, intent completion processing is performed on the core interaction request keywords and the core interaction object keywords of the current interaction round. When there is a semantic missing in the core interaction request keywords, the missing request semantic information is extracted from the historical interaction request keywords to supplement them, and the completed core interaction request keywords are obtained. When the core interaction object keyword has missing attributes, the missing object attribute information is extracted from the complete object attribute set of the historical interaction object keyword to supplement it. The supplemented core interaction request keyword and core interaction object keyword are combined and encoded to generate an enhanced interaction intent representation that integrates historical interaction information. The enhanced interactive intent representation is input into the pre-built response content generation model and subjected to reasoning generation processing. Based on the completed core interactive appeal keywords, the model retrieves matching response templates from the preset response template library and selects the response template with the highest appeal type matching degree with the completed core interactive appeal keywords as the candidate response template. Based on the completed core interactive object keywords and the description information of the object association relationship, the fillable variable part in the candidate response template is filled with variables, and the completed core interactive object keywords and their associated object information are filled into the corresponding fillable variable positions to generate preliminary response text content; The initial response text content is optimized for fluency. Based on the description information of the continuity of the request, the referential relationship in the initial response text content is resolved. Based on the preset language expression rules, the sentence structure of the initial response text content is adjusted to generate response reasoning content that conforms to the natural language expression habits. The response reasoning content is sent to the display module of the smart interactive terminal for text presentation processing. The response reasoning content is displayed on the interactive interface of the smart interactive terminal in the form of a speech bubble. At the same time, the response reasoning content is sent to the speech synthesis module of the smart interactive terminal for speech synthesis processing to generate a corresponding response speech signal and play it through the speaker. The response reasoning content is associated with the enhanced interaction intent representation of the current interaction round and stored accordingly. The response reasoning content, the enhanced interaction intent representation, and the interaction event time sequence of the current interaction round are combined and encapsulated into a new historical interaction round memory entry. The new historical interaction round memory entry is stored in the long-term interaction memory bank.
6. The memory enhancement and reasoning method for intelligent interaction according to claim 4, characterized in that, The method further includes the steps of memory decay and reinforcement processing of the long-term interactive memory bank, specifically including: Configure an initial memory strength parameter and a latest access time tag for each historical interaction round memory entry in the long-term interactive memory bank. Whenever a historical interaction round memory entry is retrieved and output as a historical interaction round memory entry that matches the current interaction round, update the latest access time tag of the historical interaction round memory entry to the current time. An incremental enhancement operation is performed on the memory strength parameter of the historical interaction round memory entry, increasing the preset strength increment value, and the time interval length between the historical interaction round memory entry and the current time is calculated based on the latest access time tag of each historical interaction round memory entry. Based on the time interval length, a periodic decay operation is performed on the memory strength parameter of each historical interaction round memory entry. The decay coefficient is calculated according to the preset decay function, and the memory strength parameter is multiplied by the decay coefficient to obtain the decayed memory strength parameter. The memory intensity parameters of all historical interaction rounds in the long-term interactive memory bank are normalized, and the memory intensity parameters of each historical interaction round memory entry are mapped to a unified intensity value range to obtain normalized memory intensity parameters. Based on the normalized memory strength parameter, the historical interaction round memory entries stored in the long-term interactive memory bank are filtered, and the historical interaction round memory entries whose normalized memory strength parameter is lower than the preset memory elimination threshold are removed from the long-term interactive memory bank. The historical memory representation vector corresponding to the removed historical interaction round memory entry is deleted from the vector index area. The historical interaction round memory entries stored in the long-term interaction memory bank are subjected to memory integration processing to identify multiple historical interaction round memory entries with similar historical interaction request keywords and similar historical interaction object keywords. Multiple similar historical interaction round memory entries are merged to generate a new integrated memory entry. The historical interaction request keywords of the integrated memory entry are taken as the union of the historical interaction request keywords of multiple similar historical interaction round memory entries. The historical interaction object keywords of the integrated memory entry are taken as the union of the historical interaction object keywords of multiple similar historical interaction rounds of memory entries, and the memory strength parameter of the integrated memory entry is taken as the maximum value of the memory strength parameters of multiple similar historical interaction rounds of memory entries. The new integrated memory entry is stored in the long-term interactive memory bank, and a corresponding historical memory representation vector is generated for the new integrated memory entry to update the vector index area of the long-term interactive memory bank.
7. The memory enhancement and reasoning method for intelligent interaction according to claim 1, characterized in that, The method further includes a step of online updating and optimizing the memory-enhanced reasoning network, specifically including: Collect the enhanced interaction intent representation and the response reasoning content corresponding to the current interaction round as the current training sample, use the enhanced interaction intent representation as the input feature, use the response reasoning content as the expected output label, and store the current training sample in the online training sample buffer pool. When the number of training samples stored in the online training sample buffer pool reaches the preset batch training threshold, training samples of a preset batch size are randomly extracted from the online training sample buffer pool to form a batch training dataset. The enhanced interaction intent representation of each training sample in the batch training dataset is input into the memory-enhanced inference network for forward propagation processing to obtain the corresponding predicted response inference content. The loss function value between the predicted response inference content of each training sample and the expected output label is calculated. The average loss value is obtained by averaging the loss function values of all training samples in the batch training dataset based on the loss function value. The gradient information of each network layer in the memory-enhanced inference network is then calculated based on the average loss value using the backpropagation algorithm. The network weight parameters of the memory-enhanced inference network are updated and optimized based on the gradient information and the preset learning rate parameters. The stochastic gradient descent optimization algorithm is used to gradually adjust the network weight parameters to reduce the average loss value. After each update and optimization of the network weight parameters of the memory-enhanced inference network, the batch training dataset used in this update and optimization process is removed from the online training sample buffer pool, and the newly collected current training samples are stored in the online training sample buffer pool for subsequent batch training. The encoder part and cross-modal fusion module of the memory-enhanced inference network are periodically evaluated. The preset evaluation test sample set is input into the current version of the memory-enhanced inference network for inference processing to obtain the corresponding evaluation response inference content. The evaluation response reasoning content is compared with the standard response reasoning content in the evaluation test sample set to calculate the evaluation accuracy. When the evaluation accuracy is lower than the preset accuracy threshold, the network retraining process is triggered to perform global retraining and optimization of the memory-enhanced reasoning network.
8. The memory enhancement and reasoning method for intelligent interaction according to claim 1, characterized in that, The method further includes a step of dynamically expanding and updating the interactive knowledge base, specifically including: Real-time monitoring of the user's original interaction data stream received by the intelligent interactive terminal; identifying novel interaction requests and mentions of novel interaction objects that are not covered by the current interaction knowledge base from the user's original interaction data stream. Semantic clustering is performed on the novel interactive appeal expressions to cluster multiple novel interactive appeal expressions that express the same or similar appeals into the same novel appeal category, and a corresponding appeal category identifier is generated for each novel appeal category. The novel interactive object mention is subjected to entity recognition processing to identify the object name, object type and object attribute information corresponding to the novel interactive object mention, and a corresponding novel object entity identifier is generated for each novel interactive object mention. The novel claim category and the novel object entity identifier are sent to the manual review terminal for review and confirmation. The review and confirmation result returned by the manual review terminal is received. The review and confirmation result includes the claim category validity mark and the object entity validity mark. When the validity of the claim category is marked as valid, the novel claim category is added as a new claim concept node to the interactive knowledge base, and claim definition description information and claim category attribute information are configured for the new claim concept node; When the object entity validity mark is valid, the object entity corresponding to the novel object entity identifier is added as a new object entity node to the interactive knowledge base, and object attribute information is configured for the new object entity node. Based on the co-occurrence relationship between the novel interactive appeal expression and the novel interactive object mention in the user's original interactive data stream, an appeal-object association relationship is established between the new appeal concept node and the new object entity node; Periodically perform relationship mining on existing request concept nodes and existing object entity nodes in the interactive knowledge base, identify potential new relationships between existing request concept nodes and existing object entity nodes, and add the identified new relationships to the interactive knowledge base.
9. The memory enhancement and reasoning method for intelligent interaction according to claim 1, characterized in that, The method further includes a step of detecting and resolving memory conflicts in the long-term interactive memory bank, specifically including: Before storing new historical interaction round memory entries into the long-term interaction memory bank, the enhanced interaction intent representation of the new historical interaction round memory entries is compared with the historical memory representation vectors of existing historical interaction round memory entries in the long-term interaction memory bank for similarity calculation. When there is an existing historical interaction round memory entry whose enhanced interaction intent representation is more similar to the new historical interaction round memory entry than a preset conflict detection threshold, the existing historical interaction round memory entry is marked as a conflict candidate memory entry. Extract the core interaction request keywords and core interaction object keywords of the new historical interaction round memory entries, extract the historical interaction request keywords and historical interaction object keywords of the conflict candidate memory entries, and perform a request consistency comparison process on the core interaction request keywords and historical request keywords of the two. The core interaction object keywords and historical interaction object keywords of the two are compared for object consistency. When both the request consistency comparison result and the object consistency comparison result indicate that they are consistent, the new historical interaction round memory entry and the conflict candidate memory entry are determined to be duplicate memory entries. When a duplicate memory entry is identified, the memory strength parameter of the new historical interaction round memory entry is compared with the memory strength parameter of the conflict candidate memory entry. The historical interaction round memory entry with the larger memory strength parameter is retained, and the historical interaction round memory entry with the smaller memory strength parameter is removed from the long-term interaction memory bank. When the results of the consistency comparison of the request and the consistency comparison of the object are inconsistent, it is determined that there is a memory conflict between the new historical interaction round memory entry and the conflict candidate memory entry, and both the new historical interaction round memory entry and the conflict candidate memory entry are marked as conflict memory entries to be resolved. The conflict memory entries to be resolved, along with their corresponding enhanced interactive intent representations and historical memory representation vectors, are sent to a human resolution terminal for conflict adjudication. The conflict adjudication result returned by the human resolution terminal is received, and the conflict adjudication result includes a retained entry identifier and a removed entry identifier. Based on the retained entry identifier and the removed entry identifier, the memory entries with unresolved conflicts are retained and removed, and the storage status of the memory entries in the long-term interactive memory bank is updated.
10. A memory enhancement and reasoning system for intelligent interaction, characterized in that, The method includes a processor and a computer-readable storage medium storing machine-executable instructions that, when executed by the processor, implement the memory enhancement and reasoning method for intelligent interaction as described in any one of claims 1-9.
Citation Information
Patent Citations
Large language model intelligent interaction method and system with memory management capability
CN119200821A
Intention recognition response method and system based on forest farmer question and answer data
CN121542442A
Intelligent question and answer semantic understanding and enhanced rewriting optimization method based on multiple rounds of dialogues
CN121614598A
Voice receiving recognition error correction method for voice robot
CN121747548A
dialogue interface
JP6080137B1