A customer service dialogue text classification method based on hypergraph neural network
Patent Information
- Application Number
- CN202611136075.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-29
- Publication Date
- 2026-10-20
AI Technical Summary
[0003]客服对话通常具有多轮交互、角色交错及语义依赖复杂等特点,传统基于规则或浅层机器学习的方法依赖人工特征设计,难以适应非结构化、多样化的对话场景,且泛化能力有限;基于传统深度学习的方法虽然能够实现端到端特征学习,但通常基于序列建模框架,难以显式刻画坐席与客户之间的角色交互关系,忽略了对话中结构化关联信息的建模,导致语义表达能力不足;同时,在长序列对话场景下,现有方法容易出现长距离依赖衰减与关键信息捕获不足的问题,影响整体分类性能;此外,对话中不同角色发言的重要性存在显著差异,但现有模型往往未对角色差异性进行显式建模,使得语义贡献分布不均,限制了模型对复杂对话语境的准确理解能力
[0071]本发明针对客服对话文本在多轮交互、角色耦合与语义依赖建模中存在的结构表达不足、长距离依赖衰减以及角色差异性未显式刻画等问题,提出了一种基于角色导向异质超图神经网络的客服对话文本分类方法,通过构建以词汇为节点、以坐席与客户发言为超边的动态角色超图,实现对对话文本的结构化语义表达与角色交互关系的统一建模,在此基础上引入基于注意力机制的超边语义聚合与时序建模机制,对关键发言信息进行自适应加权强化,并结合改进LSTM网络对发言序列的上下文依赖关系进行建模,从而提升模型对复杂语境下语义信息的捕捉能力;同时,通过节点与超边之间的双向消息传递与多轮交替迭代更新机制,实现语义表示在结构层与时序层的协同优化,使模型能够自适应学习不同角色发言的重要性差异,增强对长文本、多轮对话场景的表达能力;最终通过对迭代优化后的超图表示进行图级融合,实现对客服对话语义的全局建模与精准分类。本发明在复杂客服对话场景下具有更强的语义表达能力与鲁棒性,显著提升了文本分类的准确性与稳定性,具有较高的工程应用价值。
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This invention relates to the fields of text classification and graph neural network technology, and in particular to a method for classifying customer service dialogue text based on hypergraph neural networks. Background Technology
[0002] With the continuous advancement of digital transformation, customer service dialogue texts, as a crucial information carrier for interaction between enterprises and users, have seen widespread attention given to automated understanding and intelligent classification technologies in scenarios such as work order management, intent recognition, and service quality optimization. However, existing customer service dialogue text classification methods mainly face the following problems:
[0003] Customer service dialogues are typically characterized by multi-turn interactions, overlapping roles, and complex semantic dependencies. Traditional rule-based or shallow machine learning methods rely on manual feature design, making them ill-suited for unstructured and diverse dialogue scenarios, and their generalization ability is limited. While traditional deep learning methods can achieve end-to-end feature learning, they are usually based on sequence modeling frameworks, making it difficult to explicitly characterize the role interaction relationship between agents and customers, and neglecting the modeling of structured relational information in the dialogue, resulting in insufficient semantic expression capabilities. At the same time, in long-sequence dialogue scenarios, existing methods are prone to long-distance dependency decay and insufficient capture of key information, affecting overall classification performance. Furthermore, the importance of different roles' speeches in a dialogue varies significantly, but existing models often fail to explicitly model these role differences, resulting in uneven distribution of semantic contributions and limiting the model's ability to accurately understand complex dialogue contexts.
[0004] Therefore, how to provide a customer service dialogue text classification method based on hypergraph neural networks is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] One objective of this invention is to propose a customer service dialogue text classification method based on a hypergraph neural network. This invention constructs a role-oriented heterogeneous hypergraph to achieve unified modeling of lexical-level semantic information and role-level interaction relationships in customer service dialogues. A dynamic hypergraph update mechanism characterizes the changing interaction structure between agents and customers throughout the dialogue rounds, thereby enhancing the ability to express complex dialogue contexts. Building upon this, an attention-based hyperedge semantic aggregation and an improved temporal modeling mechanism are introduced to achieve adaptive reinforcement of key semantic information and effective capture of dialogue temporal dependencies. Furthermore, an alternating iterative update mechanism between nodes and hyperedges enables collaborative optimization of multi-granularity semantic information, improving the model's robustness and generalization ability for long sequences and multi-role dialogue scenarios, thus achieving high-precision classification and stable recognition of customer service dialogue texts.
[0006] A customer service dialogue text classification method based on a hypergraph neural network according to an embodiment of the present invention includes the following steps:
[0007] S1. Clean and segment the customer service dialogue text to generate a preprocessed text sequence;
[0008] S2. Construct a role-oriented heterogeneous hypergraph based on the preprocessed text sequence, wherein words are used as nodes, the speech in each round of dialogue is used as a hyperedge, and the hyperedge is divided into agent hyperedge and customer hyperedge according to the speaking role; the role-oriented heterogeneous hypergraph is dynamically updated according to the semantic changes of the dialogue to generate a dynamic role hypergraph.
[0009] S3. Perform weighted aggregation based on the hyperedge hierarchical attention mechanism on the hyperedges in the dynamic role hypergraph to generate hyperedge semantic representations; construct hyperedge sequences according to the dialogue time order of the hyperedge semantic representations, and input them into an improved LSTM network for temporal modeling to output temporally enhanced hyperedge representations.
[0010] S4. Based on the temporally enhanced hyperedge representation, perform node-level attention-driven message passing computation on the nodes to generate node semantic representations;
[0011] S5. Based on the node semantic representation and the temporal enhanced hyperedge representation, perform an alternating iterative process of hyperedge update and node update, and output the iteratively optimized hypergraph representation;
[0012] S6. Extract the set of hyperedge semantic representations from the iteratively optimized hypergraph representation, and aggregate the set of hyperedge semantic representations to generate a dialogue-level graph representation;
[0013] S7. Based on the dialogue-level graph representation, perform classification processing, output customer service dialogue category results, and optimize the classification process parameters based on the cross-entropy loss function.
[0014] Optionally, S1 specifically includes:
[0015] The customer service system generates customer service dialogue text data that includes agent role identifiers, user role identifiers, and speaking turn information.
[0016] The customer service dialogue text data is parsed to extract the text content field;
[0017] The text content field is denoised by removing stop words, special characters, and invalid characters.
[0018] The denoised text content is segmented to generate a word sequence;
[0019] The word sequence is reorganized according to the original speaking order to form a preprocessed text sequence.
[0020] Optionally, S2 specifically includes:
[0021] The preprocessed text sequence is obtained, and the text sequence is divided according to the speaking turn information and the speaking role information to generate multi-turn dialogue segments;
[0022] The multi-turn dialogue segments are divided into agent speaking segments and customer speaking segments, and each segment is assigned a role identifier.
[0023] Construct an initial heterogeneous hypergraph by using words as nodes and each round of speech as a hyperedge;
[0024] The hyperedge is divided into agent hyperedge and customer hyperedge, forming a role-oriented heterogeneous hypergraph;
[0025] Establish the association between nodes and hyperedges based on the correspondence between words and nodes;
[0026] The node-hyperedge association structure is updated based on changes in dialogue semantics to generate a dynamic role hypergraph.
[0027] Optionally, updating the node and hyperedge association structure in the role-oriented heterogeneous hypergraph based on dialogue semantic changes specifically involves:
[0028] Obtain the semantic representations of nodes and hyperedges in the role-oriented heterogeneous hypergraph;
[0029] Based on the semantic similarity between the node semantic representation and the hyperedge semantic representation, the association weight between the node and the hyperedge is calculated.
[0030] The connection relationship between nodes and hyperedges is adjusted based on the association weights, and the association structure between nodes and hyperedges is updated.
[0031] Reconstruct the hyperedge composition relationship in the role-oriented heterogeneous hypergraph based on the updated node and hyperedge association structure;
[0032] The hypergraph structure is iteratively updated within a preset time window to generate a dynamic character hypergraph that changes with each dialogue round.
[0033] Optionally, S3 specifically includes:
[0034] Obtain the structure of each hyperedge in the dynamic role hypergraph. Each hyperedge is composed of a set of word nodes contained in the same round of speech. Based on the preset role identification information, the hyperedges are classified into types to form a set of agent hyperedges and a set of customer hyperedges.
[0035] For each set of nodes inside a hyperedge, a node feature vector matrix is constructed, and the node feature vector matrix is linearly mapped to obtain an initial node representation matrix.
[0036] The initial node representation matrix is weighted based on the hyperedge hierarchical attention mechanism. The weighting calculation includes similarity matching between the node representation vector and the trainable attention vector, and the node attention weight coefficient is obtained by a normalization function.
[0037] The node representation vectors inside the hyperedge are weighted and summed according to the node attention weight coefficients, and then the hyperedge type identification information is combined with the dimensional mapping transformation to obtain the semantic representation of the hyperedge.
[0038] Based on the joint interaction relationship between the hyperedge semantic representation and the node semantic representation, a role-aware semantic coupling matrix is constructed, and the hyperedge semantic representation is enhanced and updated based on the semantic matrix to generate an enhanced hyperedge semantic representation.
[0039] The enhanced hyperedge semantic representation is used to construct a hyperedge sequence according to the speaking round order, and then input into an improved LSTM network for temporal modeling to output a temporal enhanced hyperedge representation.
[0040] Optionally, the input to improve the LSTM network for time series modeling specifically includes:
[0041] An improved LSTM network structure is constructed, comprising an input layer, a cyclic state update layer, and an output mapping layer. The input layer receives a sequence of hyperedge vectors arranged in chronological order. The cyclic state update layer performs recursive computation at each time step. The output mapping layer performs linear mapping on the hidden states. A dual-channel information interaction structure is set in the cyclic state update layer, comprising a hyperedge state channel and a node state channel. The two types of state vectors are input in parallel within the same time step and participate in the state update computation.
[0042] During the state update process at time step t, a cross-channel semantic modulation mechanism is introduced for the input gate, forget gate, and output gate, respectively. The cross-channel semantic modulation mechanism is constructed based on the joint mapping result of the hyperedge state vector and the node state vector. Specifically, it includes concatenating the hyperedge state vector and the node state vector and performing linear transformation operations, and generating gate modulation coefficients through a normalization function. The gate modulation coefficients are applied to the calculation results of the input gate state, forget gate state, and output gate state, respectively.
[0043] The hyperedge hidden state of the current time step is updated based on the modulated input gate state, forget gate state and output gate state, and the memory unit state of the previous time step is combined to perform recursive calculation to form the hidden state vector corresponding to the current speaking round.
[0044] The hidden state vectors generated at all time steps are arranged in chronological order to form a hidden state sequence. Forward recursive calculation and backward recursive calculation are performed on the hidden state sequence to obtain a forward hidden state sequence and a backward hidden state sequence.
[0045] The forward hidden state sequence and the reverse hidden state sequence are concatenated along the feature dimension, and a linear transformation mapping is performed on the concatenated sequence.
[0046] Optionally, S4 specifically includes:
[0047] Obtain the temporal augmentation hyperedge representation, and determine the set of associated hyperedges corresponding to each node based on the association relationship between nodes and hyperedges;
[0048] A node-level attention mechanism is constructed based on the aforementioned set of associated hyperedges. The node-level attention mechanism generates attention weight coefficients by jointly calculating semantic relevance terms and structural constraint terms.
[0049] The semantic relevance term is calculated based on the dot product similarity after linear mapping of the node representation vector and the associated hyperedge representation vector, and a semantic matching score is generated by a nonlinear activation function.
[0050] The structural constraint terms are quantitatively modeled based on the connection frequency of nodes in the hypergraph and their co-occurrence distribution in different hyperedge sets.
[0051] The semantic matching score and structural constraint terms are weighted and fused to generate joint attention weight coefficients, and the associated hyperedge representation is weighted and summed to obtain the hyperedge weighted representation.
[0052] Based on the hyperedge weighted representation, message passing calculation is performed on the nodes, and the updated node semantic representation is output.
[0053] Optionally, S5 specifically includes:
[0054] Based on the node semantic representation and the temporal enhanced hyperedge representation, an alternating iterative process of node update and hyperedge update is performed;
[0055] In each iteration, the hyperedge feature update process based on the hyperedge hierarchical attention mechanism and the node feature update process based on the node hierarchical attention mechanism are executed sequentially.
[0056] The hyperedge attention modeling process and the node message passing process are jointly invoked to form a context attention-aware message passing mechanism;
[0057] The alternating iteration process is repeated according to the preset number of iteration rounds L, and the hyperedge features and node features are updated sequentially in each iteration round;
[0058] Output the hyperedge features and node features after the Lth iteration, where the Lth iteration hyperedge features are used as the updated hyperedge features and the Lth iteration node features are used as the updated node features;
[0059] The updated hyperedge features are then combined with node features to form an iteratively optimized hypergraph representation.
[0060] Optionally, S6 specifically includes:
[0061] Obtain the set of hyperedge semantic representations in the iteratively optimized hypergraph representation, and aggregate the set of hyperedge semantic representations to generate a dialogue-level graph representation;
[0062] The aggregation process includes an average-maximum fusion aggregation method based on an attention mechanism or a sequence aggregation method based on a bidirectional LSTM network;
[0063] When using the attention-based average-maximum fusion aggregation method, attention weights are calculated for each hyperedge semantic representation to obtain a weighted hyperedge semantic representation. Average pooling and maximum pooling operations are then performed on the weighted hyperedge semantic representation. The average pooling results and maximum pooling results are then fused to generate a dialogue-level graph representation.
[0064] When using a sequence aggregation method based on a bidirectional LSTM network, the set of hyperedge semantic representations is input into the bidirectional LSTM network in the order of speaking rounds for sequence modeling, and the output is a dialogue-level graph representation.
[0065] Optionally, S7 specifically includes:
[0066] The dialogue-level graph representation is input into a classifier, which includes a trainable weight matrix and a bias vector, and a linear transformation is performed on the dialogue-level graph representation to obtain a category prediction representation.
[0067] Based on the category prediction representation, the probability distribution of customer service dialogue categories is calculated using the Softmax function, and the corresponding category results are output.
[0068] The loss value between the probability distribution and the true label is calculated based on the cross-entropy loss function;
[0069] Based on the loss value, the parameters of the classifier are updated using a backpropagation algorithm, which includes a weight matrix and a bias vector, and the process is iteratively executed until convergence.
[0070] The beneficial effects of this invention are:
[0071] This invention addresses the problems of insufficient structural representation, long-distance dependency decay, and lack of explicit characterization of role differences in customer service dialogue texts, particularly in multi-turn interactions, role coupling, and semantic dependency modeling. It proposes a role-oriented heterogeneous hypergraph neural network-based classification method for customer service dialogue texts. By constructing a dynamic role hypergraph with words as nodes and agent and customer speech as hyperedges, it achieves unified modeling of the structured semantic expression and role interaction relationships in the dialogue text. Based on this, it introduces an attention-based hyperedge semantic aggregation and temporal modeling mechanism to adaptively weight and strengthen key speech information. Furthermore, it combines an improved LSTM network to model the contextual dependencies of speech sequences, thereby enhancing the model's ability to capture semantic information in complex contexts. Simultaneously, through bidirectional message passing and multi-turn iterative update mechanisms between nodes and hyperedges, it achieves collaborative optimization of semantic representation at the structural and temporal layers, enabling the model to adaptively learn the importance differences of different roles' speech and enhance its expressive ability in long texts and multi-turn dialogue scenarios. Finally, by performing graph-level fusion on the iteratively optimized hypergraph representation, it achieves global modeling and accurate classification of customer service dialogue semantics. This invention has stronger semantic expression capabilities and robustness in complex customer service dialogue scenarios, significantly improving the accuracy and stability of text classification, and has high engineering application value. Attached Figure Description
[0072] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0073] Figure 1 This is a flowchart of a customer service dialogue text classification method based on a hypergraph neural network proposed in this invention;
[0074] Figure 2 This is a schematic diagram of a heterogeneous hypergraph for a customer service dialogue text classification method based on a hypergraph neural network proposed in this invention.
[0075] Figure 3 This is a diagram illustrating the overall framework of a customer service dialogue text classification method based on a hypergraph neural network proposed in this invention. Detailed Implementation
[0076] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0077] refer to Figures 1-3 A customer service dialogue text classification method based on hypergraph neural networks includes the following steps:
[0078] S1. Clean and segment the customer service dialogue text to generate a preprocessed text sequence;
[0079] S2. Construct a role-oriented heterogeneous hypergraph based on the preprocessed text sequence, where words are used as nodes, the speech in each round of dialogue is used as a hyperedge, and the hyperedge is divided into agent hyperedge and customer hyperedge according to the speaking role; the role-oriented heterogeneous hypergraph is dynamically updated according to the semantic changes of the dialogue to generate a dynamic role hypergraph.
[0080] S3. Perform weighted aggregation based on the hyperedge hierarchical attention mechanism on the hyperedges in the dynamic role hypergraph to generate hyperedge semantic representations; construct hyperedge sequences according to the dialogue time order of the hyperedge semantic representations, and input them into an improved LSTM network for temporal modeling to output temporally enhanced hyperedge representations.
[0081] S4. Based on temporally enhanced hyperedge representation, perform node-level attention-driven message passing computation on nodes to generate node semantic representations;
[0082] S5. Based on node semantic representation and temporal enhanced hyperedge representation, perform an alternating iterative process of hyperedge update and node update, and output the iteratively optimized hypergraph representation;
[0083] S6. Extract the set of hyperedge semantic representations from the iteratively optimized hypergraph representation, and aggregate the set of hyperedge semantic representations to generate a dialogue-level graph representation;
[0084] S7. Classify the data based on the dialogue-level graph representation, output the customer service dialogue category results, and optimize the classification process parameters based on the cross-entropy loss function.
[0085] In this embodiment, S1 specifically refers to:
[0086] The customer service system generates customer service dialogue text data that includes agent role identifiers, user role identifiers, and speaking turn information.
[0087] Parse the customer service conversation text data to extract the text content fields;
[0088] Denoise the text content field by removing stop words, special characters, and invalid characters;
[0089] The denoised text content is segmented to generate a word sequence;
[0090] The word sequence is reorganized according to the original speaking order to form a preprocessed text sequence;
[0091] In the specific implementation process, customer service dialogue text data is obtained in real time through the API interface of the customer service business system. The data transmission adopts the HTTPS secure transmission protocol, and the data sampling time interval is set to 1 second to ensure the continuity and temporal consistency of the dialogue data.
[0092] In the customer service dialogue text data, each dialogue record contains agent role identifier, user role identifier and speaking round information. The maximum number of rounds in a single dialogue record is limited to 50 rounds, and the maximum text length of each round is limited to 200 words.
[0093] When parsing customer service dialogue text data, a JSON-based data parsing method is used to extract text content fields, and data records with abnormal or missing field structures are automatically identified and removed.
[0094] When denoising text content fields, a stop word list of approximately 1200 commonly used Chinese stop words is used for filtering. At the same time, emoticons, special characters, unstructured tags, and HTML tags in the text are uniformly removed.
[0095] When performing word segmentation on the denoised text content, a word segmentation tool driven by a combination of dictionary and statistical information is used, such as the Jieba word segmentation tool or its equivalent implementation. The dictionary size is no less than 50,000 entries to improve the coverage of domain vocabulary.
[0096] After generating the word sequence, the word sequence is restructured according to the original speaking order to ensure that the temporal order consistency error within the same dialogue does not exceed one time step, and the restructured result is output as a preprocessed text sequence.
[0097] The preprocessed text sequence is stored in a structured data cache with a cache update cycle of 10 minutes, which is used for subsequent calls and calculation inputs of the hypergraph building module.
[0098] In this embodiment, S2 specifically refers to:
[0099] Obtain the preprocessed text sequence, and divide the text sequence according to the speaking turn information and the speaking role information to generate multi-turn dialogue fragments;
[0100] The multi-turn dialogue segments are divided into agent speaking segments and customer speaking segments, and each segment is assigned a role identifier;
[0101] Construct an initial heterogeneous hypergraph by using words as nodes and each round of speech as a hyperedge;
[0102] The hyperedge is divided into agent hyperedge and customer hyperedge, forming a role-oriented heterogeneous hypergraph;
[0103] Establish the association between nodes and hyperedges based on the correspondence between words and nodes;
[0104] The node-hyperedge association structure is updated based on changes in dialogue semantics to generate a dynamic role hypergraph;
[0105] In the specific implementation process, computing resources are deployed on GPU-accelerated server clusters to support the construction and dynamic update processing of hypergraphs for large-scale customer service dialogue data;
[0106] When acquiring the preprocessed text sequence, the structured dialogue data output by the customer service business system is loaded in batches. The number of dialogues processed in a single batch is set to 64, the maximum length of each dialogue is limited to 512 words, and strict time alignment is performed according to the speaking round field.
[0107] When dividing the preprocessed text sequence based on the speaking round information and speaking role information, a single dialogue is divided into a maximum of 50 rounds of interaction segments. Each round of speech is processed as an independent semantic unit, and the timestamp accuracy is retained to the millisecond level for subsequent structural evolution analysis.
[0108] After dividing the dialogue into multiple rounds, the agent's speech segment and the customer's speech segment are respectively marked with role codes, where the agent's role code is set to [1,0] and the customer's role code is set to [0,1], which is used to distinguish the hyper-edge attributes of different role types;
[0109] When mapping each word in the preprocessed text sequence to a node, a static dictionary with a vocabulary size of 50,000 to 100,000 words is used for unified encoding, and low-frequency words are replaced with UNK. The maximum number of nodes is set to 20,000 per batch to control the computational scale.
[0110] When constructing the initial heterogeneous hypergraph, each round of speech is mapped to a hyperedge, and the association between nodes and hyperedges is stored in the form of a sparse adjacency matrix. The sparsity of the matrix is kept above 95% to reduce the computational complexity of the graph structure.
[0111] In the process of generating a role-oriented heterogeneous hypergraph, when dividing the hyperedges by role attributes, a role weight initialization mechanism is introduced. The initial weight of the agent hyperedge is set to 1.2, and the initial weight of the customer hyperedge is set to 1.0, which is used for weight bias in the subsequent attention calculation process.
[0112] When dynamically updating the relationship structure between nodes and hyperedges, a sliding time window mechanism is adopted. The window size is set to 5 rounds of dialogue and the sliding step size is set to 1 round. The temporal evolution characteristics of the semantic structure of the dialogue are captured by the rolling update method, thereby constructing a dynamic role hypergraph.
[0113] In this embodiment, updating the node and hyperedge association structure in the role-oriented heterogeneous hypergraph according to changes in dialogue semantics specifically involves:
[0114] Obtain the semantic representations of nodes and hyperedges in a role-oriented heterogeneous hypergraph;
[0115] Calculate the association weight between nodes and hyperedges based on the semantic similarity between the semantic representations of nodes and hyperedges.
[0116] The connection relationship between nodes and hyperedges is adjusted based on the association weight, and the association structure between nodes and hyperedges is updated.
[0117] Reconstruct the hyperedge composition relationship in the role-oriented heterogeneous hypergraph based on the updated node and hyperedge association structure;
[0118] The hypergraph structure is iteratively updated within a preset time window to generate a dynamic character hypergraph that changes with each dialogue round.
[0119] In the specific implementation process, when obtaining the semantic representation of nodes and the semantic representation of hyperedges in the role-oriented heterogeneous hypergraph, 128-dimensional vectors are used as the basic feature representations. The node representation and the hyperedge representation are both output by the previous layer network and subjected to L2 normalization to ensure the numerical stability of similarity calculation.
[0120] When calculating the semantic similarity between nodes and hyperedges, a cosine similarity function is used, and the similarity value range is constrained to [-1, 1]. At the same time, the temperature coefficient τ for similarity calculation is set to 0.07 to enhance the distribution discrimination.
[0121] When calculating association weights based on the semantic similarity between node semantic representations and hyperedge semantic representations, softmax normalization is applied to the similarity results so that the sum of the weights of each node within the same hyperedge is 1. The weight sparsity threshold is set to 0.05, and associations with values less than this threshold are set to zero to reduce redundant connections.
[0122] When adjusting the connection relationship between nodes and hyperedges based on association weights, a weighted connection mechanism is adopted to exponentially smooth the original edge weights, with the smoothing coefficient set to 0.3 to avoid drastic structural fluctuations.
[0123] After updating the node and hyperedge association structure, when reconstructing the hyperedge composition relationship, the structural difference between the current time step t and the historical time step t−1 is used as a constraint condition, and the structural change rate is controlled to not exceed 15% to ensure the stable evolution of the dynamic graph.
[0124] When iterating and updating the hypergraph structure within a preset time window, the window size is set to 5 rounds of dialogue, the sliding step size is set to 1 round, and a structural snapshot is saved after each window for subsequent training and backtracking analysis.
[0125] When outputting a dynamic character hypergraph, it is represented as a sparse tensor format and stored in a graph database.
[0126] In this embodiment, S3 specifically refers to:
[0127] Obtain the structure of each hyperedge in the dynamic role hypergraph. Each hyperedge is composed of a set of word nodes contained in the same round of speech. Based on the preset role identification information, the hyperedges are classified into types, forming a set of agent hyperedges and a set of customer hyperedges.
[0128] For each set of nodes inside a hyperedge, construct a node feature vector matrix and perform a linear mapping on the node feature vector matrix to obtain an initial node representation matrix;
[0129] The initial node representation matrix is weighted based on the hyperedge hierarchical attention mechanism. The weight calculation includes similarity matching between the node representation vector and the trainable attention vector, and the node attention weight coefficient is obtained through a normalization function.
[0130] The node representation vectors inside the hyperedge are weighted and summed based on the node attention weight coefficients, and then the hyperedge type identification information is combined with dimensional mapping transformation to obtain the semantic representation of the hyperedge.
[0131] Based on the joint interaction relationship between hyperedge semantic representation and node semantic representation, a role-aware semantic coupling matrix is constructed, and the hyperedge semantic representation is enhanced and updated based on the semantic matrix to generate an enhanced hyperedge semantic representation.
[0132] The enhanced hyperedge semantic representation is used to construct a hyperedge sequence according to the speaking round order, and then input into an improved LSTM network for temporal modeling, outputting a temporal enhanced hyperedge representation;
[0133] In the specific implementation process, when obtaining the hyperedges in the dynamic role hypergraph, the length of a single input dialogue sequence is limited to no more than 50 rounds of speech, the maximum number of lexical units per round of speech is set to 200, and the sequences are sorted according to timestamps accurate to the millisecond level to ensure the time consistency of the hyperedge sequence construction.
[0134] When performing weighted aggregation of nodes inside a hyperedge based on the hyperedge hierarchical attention mechanism, the node feature dimension is uniformly set to 128 dimensions, the number of attention heads is set to 8, and the dropout ratio is set to 0.2 to reduce overfitting and enhance generalization ability. At the same time, the attention weights are normalized by softmax so that the sum of the weights inside a single hyperedge is 1.
[0135] When constructing the role-aware semantic coupling matrix, the agent hyperedge and the customer hyperedge are mapped to the same semantic space respectively. The size of the coupling matrix is set to m×m (m is the number of hyperedges in the current round). Cosine similarity is used to calculate the basic semantic relevance. At the same time, a sparsity threshold of 0.05 is introduced to prune low-contribution interaction relationships to reduce computational redundancy.
[0136] When enhancing and updating the semantic representation of hyperedges based on the semantic matrix, a residual update strategy is adopted, and the fusion coefficient is set to 0.3, so that the enhanced hyperedge semantics can introduce cross-role interaction information while maintaining the stability of the original semantics.
[0137] When constructing the hyperedge sequence according to the speaking round order, the maximum sequence length is set to 100. Any part exceeding this length is truncated using a sliding window mechanism (window size 20, step size 1) to ensure temporal stability in long dialogue scenarios.
[0138] When improving the LSTM network for temporal modeling, the hidden layer dimension is set to 256, the batch size is set to 32, and a gradient pruning mechanism (threshold set to 5.0) is introduced to avoid gradient explosion during long sequence training.
[0139] When performing hyperedge messaging and fusing local attention weights and time-dependent weights, the time decay coefficient is set to 0.85 to enhance the weight of recent statements on the current semantics, while maintaining the long-term memory capacity of historical information.
[0140] The final output is a timing-enhanced hyperedge representation, realizing a standardized input interface across modules.
[0141] In this embodiment, inputting the improved LSTM network for time series modeling specifically includes:
[0142] An improved LSTM network structure is constructed, comprising an input layer, a recurrent state update layer, and an output mapping layer. The input layer receives the hyperedge sequence vector representation arranged in chronological order, the recurrent state update layer performs recursive computation at each time step, and the output mapping layer performs linear mapping on the hidden states. A dual-channel information interaction structure is set in the recurrent state update layer, including a hyperedge state channel and a node state channel. The two types of state vectors are input in parallel within the same time step and participate in the state update computation.
[0143] During the state update process at time step t, a cross-channel semantic modulation mechanism is introduced for the input gate, forget gate, and output gate respectively. The cross-channel semantic modulation mechanism is constructed based on the joint mapping result of the hyperedge state vector and the node state vector. Specifically, it includes concatenation operation and linear transformation operation on the hyperedge state vector and the node state vector, and generating gate modulation coefficients through a normalization function. The gate modulation coefficients are applied to the calculation results of the input gate state, forget gate state, and output gate state respectively.
[0144] The hyperedge hidden state of the current time step is updated based on the modulated input gate state, forget gate state and output gate state, and the memory unit state of the previous time step is combined to perform recursive calculation to form the hidden state vector corresponding to the current speaking round.
[0145] The hidden state vectors generated at all time steps are arranged in chronological order to form a hidden state sequence. The forward recursive calculation and the backward recursive calculation are performed on the hidden state sequence to obtain the forward hidden state sequence and the backward hidden state sequence.
[0146] The forward hidden state sequence and the backward hidden state sequence are concatenated along the feature dimension, and a linear transformation mapping is applied to the concatenated sequence.
[0147] In the specific implementation process, when inputting the improved LSTM network for time series modeling, the length of a single batch of input sequences is set to no more than 100 hyperedge time steps, and the hyperedge feature dimension corresponding to each time step is uniformly set to 128 dimensions to ensure computational consistency and numerical stability in the time series modeling process.
[0148] The improved LSTM network inherits the traditional bidirectional LSTM structure framework in its overall structure, and introduces a dual-channel information interaction mechanism between the hyperedge state and the node state in the cyclic state update process, so that the hyperedge semantic channel and the node semantic channel can perform parallel state input and collaborative update in the same time step.
[0149] During the state update process at time step t, a cross-channel semantic modulation mechanism is introduced for the input gate, forget gate, and output gate based on the dual-channel information interaction mechanism. The modulation coefficient of the gate parameter is set to an adaptive learning range between 0.2 and 0.5, and the gate output is dynamically adjusted through the joint state mapping relationship, thereby realizing the synchronous update and dynamic balance of the hyperedge semantic information and the node semantic information.
[0150] Based on the gated modulation results, the hyperedge states at different time steps are recursively updated and coupled and fused to generate a temporal hidden state sequence that is progressively aligned with the speaking rounds.
[0151] The temporal hidden state sequence is input into the forward and reverse bidirectional encoding paths for sequence modeling. The hidden layer dimension is set to 256, and a dropout regularization mechanism is introduced during the encoding process with a dropout ratio of 0.3 to reduce the risk of overfitting during model training.
[0152] The temporal feature representations obtained from forward encoding and backward encoding are dimensionally concatenated and fused, and then transformed through a linear mapping layer to generate a temporally enhanced hyperedge representation output. Compared to traditional LSTM or Transformer structures that only model unidirectional or static sequence relationships, this invention introduces cross-channel gating modulation and a dual-channel coupling mechanism, enabling the model to simultaneously capture semantic differences in roles and temporal evolution patterns. This results in stronger semantic stability, noise resistance, and classification robustness in complex multi-turn customer service dialogue scenarios.
[0153] In this embodiment, S4 specifically refers to:
[0154] Obtain the temporal augmentation hyperedge representation and determine the set of associated hyperedges for each node based on the relationship between nodes and hyperedges;
[0155] A node-level attention mechanism is constructed based on a set of associated hyperedges. The node-level attention mechanism generates attention weight coefficients by jointly calculating semantic relevance terms and structural constraint terms.
[0156] The semantic relevance term is calculated by performing linear mapping between the node representation vector and the associated hyperedge representation vector, and then generating a semantic matching score through a non-linear activation function.
[0157] Structural constraint terms are quantitatively modeled based on the connection frequency of nodes in the hypergraph and their co-occurrence distribution in different hyperedge sets.
[0158] The semantic matching score and structural constraint terms are weighted and fused to generate joint attention weight coefficients, and the associated hyperedge representations are weighted and summed to obtain the hyperedge weighted representation.
[0159] Message passing computation is performed on nodes based on hyperedge weighted representation, and the updated semantic representation of the nodes is output.
[0160] In the specific implementation process, the number of nodes processed in a single batch is set to no more than 20,000, the number of hyperedges is set to no more than 1,000, and the dimension of the representation vector of each node and hyperedge is uniformly set to 128 dimensions to ensure numerical consistency and computational stability in the node-level attention calculation process.
[0161] When obtaining the temporally enhanced superedge representation, the superedge representation is time-aligned according to the speaking round order, and a superedge sequence is constructed with time step t as the index. The maximum time step length is set to 100. For the part exceeding the length, a sliding window truncation mechanism is used to process it. The window size is set to 20 and the step size is set to 1.
[0162] When determining the set of associated hyperedges for each node, a sparse matrix is used to represent the connection relationship between the node and the hyperedge. An initial association graph structure is constructed based on the node-hyperedge co-occurrence relationship. At the same time, the maximum number of associated hyperedges for each node is limited to 50. Connections with an association weight of less than 0.05 are pruned to reduce redundant computational overhead.
[0163] When constructing the node-level attention mechanism, the attention calculation adopts a multi-head mechanism with 8 attention heads. The attention weights after the fusion of semantic relevance and structural constraint terms are normalized based on the softmax function so that the sum of the weights of the associated hyperedges corresponding to the same node is 1. At the same time, an enhancement coefficient of 0.2 is introduced for key hyperedges to increase their contribution ratio in weight allocation.
[0164] In the process of calculating the weighted representation of hyperedges, a weighted summation method is used to fuse the associated hyperedge representations, and the output results are normalized by L2 norm to stabilize the node input distribution and suppress numerical scale fluctuations.
[0165] In the node message passing calculation process, a residual update mechanism is introduced, with the residual fusion coefficient set to 0.3, to balance the proportional relationship between the original node representation and the updated information. In the update process, a joint modulation mechanism of node state and hyperedge state is introduced to adaptively adjust the node semantic update intensity within the learnable range of 0.2 to 0.6.
[0166] The final output is the updated node semantic representation, which is output as a 128-dimensional vector for further computation and processing in subsequent hypergraph structure layers.
[0167] In this embodiment, S5 specifically refers to:
[0168] Based on node semantic representation and temporal enhanced hyperedge representation, an alternating iterative process of node update and hyperedge update is performed;
[0169] In each iteration, the hyperedge feature update process based on the hyperedge hierarchical attention mechanism and the node feature update process based on the node hierarchical attention mechanism are executed sequentially.
[0170] The hyperedge attention modeling process and the node message passing process are jointly invoked to form a context attention-aware message passing mechanism;
[0171] The alternating iteration process is repeated according to the preset number of iteration rounds L, and the hyperedge features and node features are updated sequentially in each iteration round;
[0172] Output the hyperedge features and node features after the Lth iteration, where the hyperedge features of the Lth iteration are used as the updated hyperedge features, and the node features of the Lth iteration are used as the updated node features;
[0173] The updated hyperedge features are then combined with node features to form an iteratively optimized hypergraph representation.
[0174] In the specific implementation process, when performing the alternating iteration process, the number of iteration rounds L is set to 3 to 5 rounds, preferably 4 rounds;
[0175] In each iteration, the hyperedge feature update and node feature update are performed sequentially and completed within the same round to ensure the consistency of the hypergraph structure evolution;
[0176] The hyperedge feature update is implemented based on the hyperedge hierarchical attention mechanism. The number of attention heads is set to 8, the maximum number of associated nodes in each hyperedge is 50, and the attention weights are normalized by softmax so that the sum of weights in the same hyperedge is 1. At the same time, a key node enhancement coefficient of 0.2 is introduced.
[0177] Node feature updates are implemented based on a node-level attention mechanism. Each node has a maximum of 30 associated superedges, and association weights below 0.05 are pruned.
[0178] During the bidirectional information propagation process, a hyperedge feedback aggregation is performed after each round of node update, and the number of feedback aggregation iterations is set to 3 rounds to enhance the bidirectional semantic consistency between nodes and hyperedges.
[0179] In the process of cross-layer information interaction, a unified cross-layer attention fusion coefficient α is introduced, with a value ranging from 0.3 to 0.6, to balance the contributions of structural information and semantic information;
[0180] During the alternating iteration process, a residual update strategy is adopted for both hyperedge features and node features, with the residual coefficient set to 0.25 to alleviate the semantic degradation problem in deep iteration.
[0181] After each iteration, the hyperedge features and node features are subjected to L2 normalization to maintain the consistency of feature distribution across different iterations.
[0182] Finally, the Lth iteration result is output and used as the optimized hyperedge and node representation, which is then used to construct the iteratively optimized hypergraph representation.
[0183] In this embodiment, S6 specifically refers to:
[0184] Obtain the set of hyperedge semantic representations in the iteratively optimized hypergraph representation, and aggregate the set of hyperedge semantic representations to generate a dialogue-level graph representation;
[0185] Among them, the aggregation processing includes the average-maximum fusion aggregation method based on the attention mechanism or the sequence aggregation method based on the bidirectional LSTM network;
[0186] When using the attention-based average-max fusion aggregation method, attention weights are calculated for each hyperedge semantic representation to obtain a weighted hyperedge semantic representation. Average pooling and max pooling operations are then performed on the weighted hyperedge semantic representation. The average pooling results and max pooling results are then fused to generate a dialogue-level graph representation.
[0187] When using a sequence aggregation method based on a bidirectional LSTM network, the set of hyperedge semantic representations is input into the bidirectional LSTM network in the order of speaking rounds for sequence modeling, and the output is a dialogue-level graph representation;
[0188] In the specific implementation process, in the average-maximum fusion aggregation method based on the attention mechanism, attention weights are calculated for the semantic representation of each hyperedge. The number of attention heads is set to 8, and the weights are normalized by the softmax function so that the sum of all hyperedge weights is 1. Weakly correlated hyperedges with a weight of less than 0.05 are suppressed to reduce noise interference.
[0189] In the process of generating weighted hyperedge semantic representation, the attention weighting result is fused with the original hyperedge semantic representation, and the fusion coefficient is set to 0.3 to balance the contribution ratio of global semantic information and local key semantic information.
[0190] When performing average pooling and max pooling operations, the weighted hyperedge semantic representation is processed by average pooling and max pooling respectively. The pooling dimension is fixed at 128 dimensions, and the pooling result is processed by L2 normalization to eliminate the scale bias caused by different dialogue lengths.
[0191] In the average-maximum fusion process, the average pooling result and the maximum pooling result are weighted and fused at a ratio of 0.5:0.5, and a smoothing coefficient of 0.2 is introduced to weaken the impact of extreme values on the maximum pooling result, thereby improving the stability of the dialogue-level graph representation.
[0192] In the sequence aggregation method based on bidirectional LSTM network, the set of super-edge semantic representations is input into the bidirectional LSTM network in the order of speech rounds. The hidden layer dimension is set to 256, the maximum sequence length is set to 100, and the part exceeding the limit is processed by a sliding window truncation mechanism, where the window size is set to 20 and the step size is set to 1, so as to ensure the computational controllability and structural integrity in long dialogue scenarios.
[0193] Dropout regularization is introduced during sequence modeling, with the dropout ratio set to 0.3 and the gradient clipping threshold set to 5.0, to improve training stability and avoid gradient explosion in long sequence modeling.
[0194] The final output is a dialogue-level graph representation vector, with a uniform dimension of 512.
[0195] In this embodiment, S7 specifically refers to:
[0196] The dialogue-level graph representation is input into a classifier, which includes a trainable weight matrix and a bias vector. A linear transformation is performed on the dialogue-level graph representation to obtain a category prediction representation.
[0197] Based on category prediction representation, the probability distribution of customer service dialogue categories is calculated using the Softmax function, and the corresponding category results are output.
[0198] The loss value between the probability distribution and the true label is calculated based on the cross-entropy loss function.
[0199] The parameters of the classifier, including the weight matrix and bias vector, are updated using the backpropagation algorithm based on the loss value, and the process is iterated until convergence.
[0200] In the specific implementation process, when the dialogue-level graph representation is input into the classifier, the classifier adopts a fully connected neural network structure, in which the hidden layer dimension is set to 256, and the ReLU activation function is introduced into the hidden layer to achieve non-linear mapping processing. The output layer uses the Softmax function to normalize the category prediction results so that the sum of the probabilities of each category is 1.
[0201] In the process of calculating the loss function, the cross-entropy loss function is used to align the probability distribution of the classifier output with the true label on a sample-by-sample basis, and the loss value of each batch of samples is averaged to form the batch loss function.
[0202] During the backpropagation update process, the Adam optimizer is used to iteratively update the classifier parameters, with the learning rate set to 1e-3 and an L2 regularization constraint term introduced to constrain the update of the weight matrix in order to control the size of the classifier parameters.
[0203] During training, the maximum number of iterations is set to 50, and an early stopping strategy is introduced. Training is stopped when the validation set loss does not decrease for several consecutive iterations, in order to control the training time and stabilize the classifier convergence process.
[0204] During the classifier parameter update process, only the weight matrix and bias vector in the classifier are updated with gradients, while the parameters of other modules remain frozen.
[0205] In the performance evaluation process, precision, recall and F1 score are used to comprehensively evaluate the classifier, which is used to measure the classifier's recognition ability and robustness in customer service dialogue classification tasks.
[0206] This invention constructs a role-oriented heterogeneous hypergraph structure and combines a hyperedge-node dual-channel interaction mechanism with a context-attention-aware temporal modeling method to achieve a fine characterization and dynamic evolution modeling of the semantic relationships of multiple roles in customer service dialogues. It effectively overcomes the problems of insufficient role interaction modeling, weak long-range semantic dependency capture capability, and insufficient utilization of contextual information in traditional methods. It significantly improves the classification accuracy, stability, and generalization ability of complex multi-turn customer service dialogue scenarios, thereby improving the overall efficiency of automated customer service processing and work order diversion.
[0207] Example 1: To verify the feasibility of this invention in practice, it was tested in the real business data environment of a large internet company's customer service center. The test lasted one month, processing approximately 48,000 customer service dialogues daily. The business covered various scenarios including e-commerce after-sales service, payment issues, logistics inquiries, account anomalies, and complaints / suggestions. The average number of dialogue rounds ranged from 6 to 18. The text exhibited significant multi-role interaction characteristics and semantic jumps, and contained numerous non-standard expressions, colloquialisms, and cross-round references. Traditional text classification methods in such scenarios generally suffer from insufficient semantic understanding, inadequate utilization of role information, and weak long-sequence dependency modeling capabilities.
[0208] In this application scenario, customer service dialogue data is first collected in real time from the enterprise's customer service ticketing system and online chat system. All dialogues retain complete agent and customer role identifiers and timestamp information. The system deploys the method of this invention on a server cluster. After the input data passes through a preprocessing module, a standardized word sequence is generated, and a role-oriented heterogeneous hypergraph structure is further constructed. Words are used as nodes, each round of dialogue is used as a hyperedge, and the hyperedge type is classified according to the agent and customer roles. During dynamic updates, the system adjusts the relationship between nodes and hyperedges in real time according to semantic changes, so that the hypergraph structure can dynamically evolve with the progress of the dialogue, thereby more realistically reflecting the semantic changes in customer service dialogues.
[0209] In the hyperedge semantic modeling stage, the system constructs a hyperedge representation for each round of speech and uses an attention mechanism to weight and aggregate key semantic words, giving higher weight to important information in the representation. For example, in key phrases such as "refund application," "order not received," and "payment failed," the model automatically increases their attention weight to the range of 0.72 to 0.89, while the weight of common stop expressions such as "okay" and "let me see" drops to below 0.05, thus significantly improving the discriminative power of semantic expression. Based on this, the model introduces an improved LSTM structure to perform temporal modeling of the hyperedge sequence. In actual testing, it was found that for long dialogues with an average length exceeding 12 rounds, this structure can still maintain stable gradient propagation, significantly improving upon the semantic decay problem that occurs with traditional LSTM in long sequences.
[0210] During the alternating update process of the node layer and the super-edge layer, a dual-channel message passing mechanism is used to achieve synchronous semantic updates, ensuring that the semantics of nodes and roles evolve in a consistent manner. In actual operation, each dialogue undergoes an average of 3 rounds of iterative optimization, with a single dialogue reasoning time of approximately 18.6ms. This represents a 42.6% improvement in computational efficiency compared to the traditional GAT method (approximately 32.4ms), while also demonstrating superior performance in semantic representation stability.
[0211] In the classification output stage, the system inputs a 512-dimensional graph-level representation into a fully connected classifier for prediction, ultimately outputting customer service dialogue categories, including five major categories: "Refund," "Logistics," "Complaints," "Account Security," and "Inquiry." Validation was performed on a test set (12,000 manually labeled data points). The method achieved the following results: an overall classification accuracy of 92.8%, a 6.7 percentage point improvement over the traditional bidirectional LSTM network (86.1%); a Macro-F1 score of 91.5%, an 8.1 percentage point improvement over the TextCNN model (83.4%); and a classification accuracy of 90.2% for long dialogues (≥10 rounds), a 5.5 percentage point improvement over the traditional Transformer baseline model (84.7%), demonstrating stronger long-range dependency modeling and role semantic capture capabilities.
[0212] To further illustrate the technical effects of the present invention, the present invention is compared and analyzed with existing mainstream methods under the same dataset and experimental environment. The comparison results are shown in Table 1.
[0213] Table 1. Performance comparison results of different models in customer service dialogue classification task
[0214] Rule matching methods 71.3% 69.8% 66.4% 68.0% 5.2 TextCNN 85.6% 84.2% 83.1% 83.4% 12.8 Bidirectional LSTM 86.1% 85.7% 84.6% 85.1% 14.5 Transformer 88.4% 87.9% 87.2% 87.5% 28.7 GAT 89.2% 88.6% 88.1% 88.3% 32.4 Method of the present invention 92.8% 92.1% 91.8% 91.5% 18.6
[0215] As shown in Table 1, the experimental results of this invention demonstrate a significant overall performance improvement over traditional methods in customer service dialogue text classification tasks, achieving a superior balance between accuracy, recall, and model efficiency. In terms of classification accuracy, this invention achieves 92.8%, which is approximately 7.2%, 6.7%, and 4.4% higher than TextCNN's 85.6%, Bidirectional LSTM's 86.1%, and Transformer's 88.4%, respectively. This indicates that this invention uses a role-oriented heterogeneous hypergraph structure to more finely model the multi-role interaction relationships in customer service dialogues, enabling the model to more accurately capture the semantic dependencies between agents and customers, thereby significantly improving overall classification capabilities.
[0216] In terms of precision and recall, this invention achieves 92.1% and 91.8% respectively, significantly outperforming traditional deep learning models and the GAT method based on graph neural networks (88.6% and 88.1%). This result demonstrates that the hyperedge-node dual-channel interaction mechanism introduced in this invention effectively reduces misclassification and enhances the ability to identify minority class samples, exhibiting higher stability and robustness, especially in categories with ambiguous semantic boundaries such as "complaints" and "account anomalies." Furthermore, the combination of contextual attention and temporal augmented LSTM modeling allows the model to more fully utilize dialogue context information, effectively mitigating the information decay problem of traditional methods in long dialogue scenarios.
[0217] In terms of F1 score, this invention achieves 91.5%, a significant improvement compared to the Transformer model's 87.5% and the GAT model's 88.3%, demonstrating a superior balance between precision and recall. This is primarily due to the dynamic character hypergraph structure's ability to dynamically characterize dialogue semantics, enabling the model to continuously update the semantic states of nodes and hyperedges when handling complex multi-turn dialogues, thus avoiding the information lag problem caused by static modeling.
[0218] In terms of computational efficiency, the average inference time of this invention is 18.6ms / item, which is slightly higher than rule matching methods and TextCNN, but significantly better than Transformer (28.7ms) and GAT (32.4ms). This shows that while introducing a hypergraph structure and a multi-layer attention mechanism, this invention effectively reduces computational complexity by controlling the size of hyperedges, sparsening connections, and limiting the number of iterations, enabling the model to maintain high accuracy while still possessing good engineering deployability.
[0219] In summary, this invention not only significantly improves classification accuracy and F1 performance in customer service dialogue classification tasks, but also achieves a better balance between complex semantic modeling capabilities and computational efficiency, verifying its practical value and promotional significance in real customer service business scenarios.
[0220] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A customer service dialogue text classification method based on hypergraph neural networks, characterized in that, Includes the following steps: S1. Clean and segment the customer service dialogue text to generate a preprocessed text sequence; S2. Construct a role-oriented heterogeneous hypergraph based on the preprocessed text sequence, wherein words are used as nodes, the speech in each round of dialogue is used as a hyperedge, and the hyperedge is divided into agent hyperedge and customer hyperedge according to the speaking role; the role-oriented heterogeneous hypergraph is dynamically updated according to the semantic changes of the dialogue to generate a dynamic role hypergraph. S3. Perform weighted aggregation based on the hyperedge hierarchical attention mechanism on the hyperedges in the dynamic role hypergraph to generate hyperedge semantic representations; construct hyperedge sequences according to the dialogue time order of the hyperedge semantic representations, and input them into an improved LSTM network for temporal modeling to output temporally enhanced hyperedge representations. S4. Based on the temporally enhanced hyperedge representation, perform node-level attention-driven message passing computation on the nodes to generate node semantic representations; S5. Based on the node semantic representation and the temporal enhanced hyperedge representation, perform an alternating iterative process of hyperedge update and node update, and output the iteratively optimized hypergraph representation; S6. Extract the set of hyperedge semantic representations from the iteratively optimized hypergraph representation, and aggregate the set of hyperedge semantic representations to generate a dialogue-level graph representation; S7. Based on the dialogue-level graph representation, perform classification processing, output customer service dialogue category results, and optimize the classification process parameters based on the cross-entropy loss function.
2. The customer service dialogue text classification method based on a hypergraph neural network according to claim 1, characterized in that, Specifically, S1 is: Customer service dialogue text data, including agent role identifiers, user role identifiers, and speaking turn information, is generated by the customer service business system. The customer service dialogue text data is parsed to extract the text content field; The text content field is denoised by removing stop words, special characters, and invalid characters. The denoised text content is segmented to generate a word sequence; The word sequence is reorganized according to the original speaking order to form a preprocessed text sequence.
3. The customer service dialogue text classification method based on a hypergraph neural network according to claim 1, characterized in that, Specifically, S2 is: The preprocessed text sequence is obtained, and the text sequence is divided according to the speaking turn information and the speaking role information to generate multi-turn dialogue segments; The multi-turn dialogue segments are divided into agent speaking segments and customer speaking segments, and each segment is assigned a role identifier. Construct an initial heterogeneous hypergraph by using words as nodes and each round of speech as a hyperedge; The hyperedge is divided into agent hyperedge and customer hyperedge, forming a role-oriented heterogeneous hypergraph; Establish the association between nodes and hyperedges based on the correspondence between words and nodes; The node-hyperedge association structure is updated based on changes in dialogue semantics to generate a dynamic role hypergraph.
4. The customer service dialogue text classification method based on a hypergraph neural network according to claim 3, characterized in that, The specific steps for updating the node and hyperedge association structure in the role-oriented heterogeneous hypergraph based on dialogue semantic changes are as follows: Obtain the semantic representations of nodes and hyperedges in the role-oriented heterogeneous hypergraph; Based on the semantic similarity between the node semantic representation and the hyperedge semantic representation, the association weight between the node and the hyperedge is calculated. The connection relationship between nodes and hyperedges is adjusted based on the association weights, and the association structure between nodes and hyperedges is updated. Reconstruct the hyperedge composition relationship in the role-oriented heterogeneous hypergraph based on the updated node and hyperedge association structure; The hypergraph structure is iteratively updated within a preset time window to generate a dynamic character hypergraph that changes with each dialogue round.
5. The customer service dialogue text classification method based on a hypergraph neural network according to claim 1, characterized in that, Specifically, S3 is: Obtain the structure of each hyperedge in the dynamic role hypergraph. Each hyperedge is composed of a set of word nodes contained in the same round of speech. Based on the preset role identification information, the hyperedges are classified into types to form a set of agent hyperedges and a set of customer hyperedges. For each set of nodes inside a hyperedge, a node feature vector matrix is constructed, and the node feature vector matrix is linearly mapped to obtain an initial node representation matrix. The initial node representation matrix is weighted based on the hyperedge hierarchical attention mechanism. The weighting calculation includes similarity matching between the node representation vector and the trainable attention vector, and the node attention weight coefficient is obtained by a normalization function. The node representation vectors inside the hyperedge are weighted and summed according to the node attention weight coefficients, and then the hyperedge type identification information is combined with the dimensional mapping transformation to obtain the semantic representation of the hyperedge. Based on the joint interaction relationship between the hyperedge semantic representation and the node semantic representation, a role-aware semantic coupling matrix is constructed, and the hyperedge semantic representation is enhanced and updated based on the semantic matrix to generate an enhanced hyperedge semantic representation. The enhanced hyperedge semantic representation is used to construct a hyperedge sequence according to the speaking round order, and then input into an improved LSTM network for temporal modeling to output a temporal enhanced hyperedge representation.
6. The customer service dialogue text classification method based on a hypergraph neural network according to claim 5, characterized in that, The input to the improved LSTM network for time series modeling specifically includes: An improved LSTM network structure is constructed, comprising an input layer, a cyclic state update layer, and an output mapping layer. The input layer receives a sequence of hyperedge vectors arranged in chronological order. The cyclic state update layer performs recursive computation at each time step. The output mapping layer performs linear mapping on the hidden states. A dual-channel information interaction structure is set in the cyclic state update layer, comprising a hyperedge state channel and a node state channel. The two types of state vectors are input in parallel within the same time step and participate in the state update computation. During the state update process at time step t, a cross-channel semantic modulation mechanism is introduced for the input gate, forget gate, and output gate, respectively. The cross-channel semantic modulation mechanism is constructed based on the joint mapping result of the hyperedge state vector and the node state vector. Specifically, it includes concatenating the hyperedge state vector and the node state vector and performing linear transformation operations, and generating gate modulation coefficients through a normalization function. The gate modulation coefficients are applied to the calculation results of the input gate state, forget gate state, and output gate state, respectively. The hyperedge hidden state of the current time step is updated based on the modulated input gate state, forget gate state and output gate state, and the memory unit state of the previous time step is combined to perform recursive calculation to form the hidden state vector corresponding to the current speaking round. The hidden state vectors generated at all time steps are arranged in chronological order to form a hidden state sequence. Forward recursive calculation and backward recursive calculation are performed on the hidden state sequence to obtain a forward hidden state sequence and a backward hidden state sequence. The forward hidden state sequence and the reverse hidden state sequence are concatenated along the feature dimension, and a linear transformation mapping is performed on the concatenated sequence.
7. The customer service dialogue text classification method based on a hypergraph neural network according to claim 1, characterized in that, Specifically, S4 is: Obtain the temporal augmentation hyperedge representation, and determine the set of associated hyperedges corresponding to each node based on the association relationship between nodes and hyperedges; A node-level attention mechanism is constructed based on the aforementioned set of associated hyperedges. The node-level attention mechanism generates attention weight coefficients by jointly calculating semantic relevance terms and structural constraint terms. The semantic relevance term is calculated based on the dot product similarity after linear mapping of the node representation vector and the associated hyperedge representation vector, and a semantic matching score is generated by a nonlinear activation function. The structural constraint terms are quantitatively modeled based on the connection frequency of nodes in the hypergraph and their co-occurrence distribution in different hyperedge sets. The semantic matching score and structural constraint terms are weighted and fused to generate joint attention weight coefficients, and the associated hyperedge representation is weighted and summed to obtain the hyperedge weighted representation. Based on the hyperedge weighted representation, message passing calculation is performed on the nodes, and the updated node semantic representation is output.
8. The customer service dialogue text classification method based on a hypergraph neural network according to claim 1, characterized in that, Specifically, S5 is: Based on the node semantic representation and the temporal enhanced hyperedge representation, an alternating iterative process of node update and hyperedge update is performed; In each iteration, the hyperedge feature update process based on the hyperedge hierarchical attention mechanism and the node feature update process based on the node hierarchical attention mechanism are executed sequentially. The hyperedge attention modeling process and the node message passing process are jointly invoked to form a context attention-aware message passing mechanism; The alternating iteration process is repeated according to the preset number of iteration rounds L, and the hyperedge features and node features are updated sequentially in each iteration round; Output the hyperedge features and node features after the Lth iteration, where the Lth iteration hyperedge features are used as the updated hyperedge features and the Lth iteration node features are used as the updated node features; The updated hyperedge features are then combined with node features to form an iteratively optimized hypergraph representation.
9. The customer service dialogue text classification method based on a hypergraph neural network according to claim 1, characterized in that, Specifically, S6 is: Obtain the set of hyperedge semantic representations in the iteratively optimized hypergraph representation, and aggregate the set of hyperedge semantic representations to generate a dialogue-level graph representation; The aggregation process includes an average-maximum fusion aggregation method based on an attention mechanism or a sequence aggregation method based on a bidirectional LSTM network; When using the attention-based average-maximum fusion aggregation method, attention weights are calculated for each hyperedge semantic representation to obtain a weighted hyperedge semantic representation. Average pooling and maximum pooling operations are then performed on the weighted hyperedge semantic representation. The average pooling results and maximum pooling results are then fused to generate a dialogue-level graph representation. When using a sequence aggregation method based on a bidirectional LSTM network, the set of hyperedge semantic representations is input into the bidirectional LSTM network in the order of speaking rounds for sequence modeling, and the output is a dialogue-level graph representation.
10. A customer service dialogue text classification method based on a hypergraph neural network according to claim 1, characterized in that, Specifically, S7 is: The dialogue-level graph representation is input into a classifier, which includes a trainable weight matrix and a bias vector, and a linear transformation is performed on the dialogue-level graph representation to obtain a category prediction representation. Based on the category prediction representation, the probability distribution of customer service dialogue categories is calculated using the Softmax function, and the corresponding category results are output. The loss value between the probability distribution and the true label is calculated based on the cross-entropy loss function; Based on the loss value, the parameters of the classifier are updated using a backpropagation algorithm, which includes a weight matrix and a bias vector, and the process is iteratively executed until convergence.