A method and system for event prioritization assignment

By using Hidden Markov Models and context-aware sentiment analysis, the priority of work orders can be adjusted in real time, solving the passive response problem of traditional customer service models and improving customer service efficiency and satisfaction.

CN121073228BActive Publication Date: 2026-02-24SHANGHAI SUQING SOFTWARE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511621156.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-07
Publication Date
2026-02-24
Estimated Expiration
2045-11-07

AI Technical Summary

Technical Problem

Traditional customer service models, which rely on passive responses, lead to a backlog of work orders, low operational efficiency, and burnout among customer service staff, making it difficult to prevent customer dissatisfaction and declining satisfaction.

Method used

Hidden Markov Models (HMMs) are used for unsupervised training, combined with a context-aware sentiment analysis model, to track customer sentiment in real time and calculate negative escalation risk scores, and dynamically adjust work order priorities.

Benefits of technology

It enabled proactive customer service, improved the efficiency of solving key issues, reduced the time spent on repetitive tasks, and enhanced customer satisfaction and brand loyalty.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121073228B_ABST
    Figure CN121073228B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of customer service work order processing, and discloses an event priority sorting and allocating method and system, which comprises the following steps: converting historical multi-round conversation data into a numerical historical work order emotion score sequence set; training a hidden Markov model by using a Baum-Welch algorithm to learn core dynamic parameters of customer emotion evolution; calibrating an optimal calibrated risk score threshold; for each ongoing work order, real-time inferring a probability distribution of each hidden state and calculating a forward-looking negative upgrade risk score; when the negative upgrade risk score exceeds the calibrated risk score threshold, automatically triggering priority adjustment and generating an updated work order record. The application provides a quantifiable and probability prediction-based framework, and changes customer support from passive and post-response work order processing to active and pre-warning risk management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of customer service work order processing technology, and more specifically, to an event priority sorting and allocation method and system. Background Technology

[0002] In the modern customer service landscape, businesses face ever-increasing customer expectations that demand immediate, personalized support services with a consistent experience across multiple channels. Traditional customer support models are inherently reactive, relying on customers proactively contacting the company after encountering a problem. This model places support teams in a constant "firefighting" mode, intervening only after customers have already experienced inconvenience. This not only fails to prevent customer dissatisfaction at its root but also frequently leads to backlogs of work orders, operational inefficiencies, and staff burnout. To address these challenges, the industry is undergoing a fundamental strategic transformation from reactive to proactive service. At the heart of this new paradigm is moving beyond simply waiting for problem reports and leveraging data-driven signals to anticipate potential customer needs and friction points, intervening before issues escalate into serious dissatisfaction. Artificial intelligence technologies, particularly natural language processing and probabilistic models, are key enabling technologies for scaling and maximizing the effectiveness of this proactive service model. They provide businesses with the ability to gain insights from massive amounts of interaction data and take preventative measures.

[0003] In view of this, the present invention proposes an event priority sorting and allocation method and system to solve the above problems. Summary of the Invention

[0004] To overcome the aforementioned deficiencies of the prior art and achieve the above objectives, the present invention provides the following technical solution: an event priority sorting and allocation method, comprising:

[0005] Step S1: Incrementally collect and preprocess the collected raw multi-turn dialogue stream to obtain a set of structured dialogue sequences;

[0006] Step S2: Based on the structured dialogue sequence set and the pre-trained context-aware sentiment analysis model, perform context-aware round-by-round sentiment scoring to obtain the sentiment score sequence set of historical work orders.

[0007] Step S3: Based on the set of sentiment rating sequences from historical work orders, the predefined set of hidden states, and the configured hidden Markov model training convergence threshold. Given the maximum number of iterations configured for the Hidden Markov Model (HMM), the Baum-Welch Algorithm is used to perform unsupervised training on the HMM to obtain the initial state probability distribution. State transition probability matrix and emission probability distribution ;

[0008] Step S4 involves using the set of sentiment rating sequences from historical work orders, the collected labels of historical work order results, the predefined set of high-risk state definitions, and the initial state probability distribution obtained through training. State transition probability matrix and emission probability distribution Receiver operation characteristic curve analysis is performed to obtain the calibrated risk score threshold;

[0009] Step S5: For each work order in the collected ongoing work order stream, based on the pre-trained context-aware sentiment analysis model and the configured context window size... Initial state probability distribution State transition probability matrix Launch probability distribution A predefined set of high-risk status definitions and calibrated risk scoring thresholds are used to perform real-time sentiment tracking and risk prediction, and all results are aggregated to obtain a set of work order processing results.

[0010] Step S6: Based on the work order processing result set, update the priority of the corresponding work order in the collected original work order records to obtain the updated work order records.

[0011] Furthermore, the implementation method of step S3 includes: step S3S1, randomly initializing the initial state probability distribution based on the predefined number of hidden states. State transition probability matrix and emission probability distribution The parameters; Steps S3 and S2, when the improvement in the model's log-likelihood is greater than the configured Hidden Markov Model training convergence threshold. Furthermore, if the number of iterations is less than the maximum number of iterations configured for the Hidden Markov Model, the expectation maximization step is executed repeatedly to obtain the converged initial state probability distribution. State transition probability matrix and emission probability distribution .

[0012] Furthermore, the implementation method of step S4 includes: step S4S1, for each emotion rating sequence in the set of emotion rating sequences of historical work orders, performing reusable step hidden state probability distribution inference, based on the emotion rating sequence and the initial state probability distribution. State transition probability matrix and emission probability distribution Step S4S2 involves inferring the probability distribution of each current hidden state and summarizing the probability distributions of each current hidden state to obtain a set of hidden state probability distributions for historical work orders. Step S4S2 further involves performing a reusable negative escalation risk score calculation for each current hidden state probability distribution in the set of hidden state probability distributions for historical work orders, based on the probability distributions of the current hidden states and the state transition probability matrix. Based on a predefined set of high-risk status definitions, calculate the negative escalation risk score and summarize each negative escalation risk score to obtain a historical risk score sequence; in step S4S3, extract each negative escalation risk score in the historical risk score sequence and its corresponding work order ID to construct a flattened risk score list; in step S4S4, align the flattened risk score list with the collected historical work order result labels based on the work order ID to obtain a labeled risk score dataset; in step S4S5, based on the labeled risk score dataset, generate a receiver operation feature curve and determine the negative escalation risk score corresponding to the coordinate point closest to the upper left corner (0,1) on the receiver operation feature curve to obtain the calibrated risk score threshold.

[0013] Further, the implementation method of step S5 includes: for each work order in the collected ongoing work order stream, the following steps are executed cyclically: Step S5S1, extract the new user utterance from the structured dialogue sequence of the ongoing work order, and perform context-aware round-by-round emotion scoring to obtain the new emotion score; Step S5S2, check whether the ongoing work order already has an emotion score sequence. If it does, append the new emotion score to the end of the emotion score sequence. If it does not exist, use the new emotion score to create a new sequence to obtain the updated emotion score sequence; Step S5S3, perform reusable step hidden state probability distribution inference, based on the updated emotion score sequence and the initial state probability distribution. State transition probability matrix and emission probability distribution Infer and update the probability distribution of each hidden state; in steps S5 and S4, perform the reusable step of negative upgrade risk score calculation based on the probability distribution of each hidden state and the state transition probability matrix. Calculate the negative escalation risk score based on the predefined high-risk status definition set; Step S5S5: When the negative escalation risk score is greater than the calibrated risk score threshold, generate a work order processing result containing the new priority based on the ongoing work order and the configured priority escalation mapping; Step S5S6: Summarize all work order processing results generated in step S5S5 to obtain a work order processing result set.

[0014] Furthermore, the implementation method of steps S3S2 includes: when the improvement in the model's log-likelihood is greater than the configured Hidden Markov Model training convergence threshold... And when the number of iterations is less than the maximum number of iterations configured for the Hidden Markov Model, the following steps are executed repeatedly: Step S3S2S1, for each sentiment rating sequence in the set of sentiment rating sequences of historical work orders, the forward-backward algorithm is executed to calculate the forward probability matrix. and backward probability matrix Step S3S2S2, based on the forward probability matrix Backward probability matrix State transition probability matrix Launch probability distribution By combining the set of sentiment rating sequences from historical work orders, the expected statistic is calculated to obtain the expected probability set of the state. and the expected probability set of transitions Steps S3, S2, and S3 are based on the expected probability set of the state. Transition Expectation Probability Set Using the set of sentiment rating sequences from historical work orders, the parameters of the Hidden Markov Model are re-estimated to obtain the updated initial state probability distribution. Updated state transition probability matrix and the updated launch probability distribution Steps S3, S2, and S4 involve using the updated initial state probability distribution. Updated state transition probability matrix and the updated launch probability distribution Calculate the total log-likelihood of the Hidden Markov Model on the set of sentiment rating sequences of historical work orders, and record the difference between it and the previous iteration; in steps S3, S2, and S5, update the initial state probability distribution. Determined as the initial state probability distribution The updated state transition probability matrix Determined as the state transition probability matrix and the updated launch probability distribution Determined as the emission probability distribution This is used for the next loop iteration.

[0015] Furthermore, the implementation method of steps S3S2S1 includes: for each emotion rating sequence in the set of emotion rating sequences of historical work orders, the following steps are executed iteratively: Step S3S2S1S1, based on the emotion rating sequence and the initial state probability distribution State transition probability matrix and emission probability distribution The forward algorithm is recursively calculated to obtain the forward probability matrix. Steps S3S2S1S2 are based on the emotion rating sequence and the state transition probability matrix. and emission probability distribution The backward algorithm is recursively calculated to obtain the backward probability matrix. ;

[0016] The implementation method of step S3S2S2 includes: step S3S2S2S1, based on the forward probability matrix and backward probability matrix Calculate at each time step In state The expected probability is used to obtain the set of expected probabilities for the state. Step S3S2S2S2, based on the forward probability matrix Backward probability matrix State transition probability matrix Launch probability distribution Based on the set of sentiment rating sequences from historical work orders, calculate the sentiment rating at each time step. From state Transition to state The expected probability is used to obtain the transition expected probability set. ;

[0017] The implementation method of steps S3S2S3 includes: step S3S2S3S1, based on the state expectation probability set At time step The expected value is used to update the initial state probability distribution. The updated initial state probability distribution is obtained. Step S3S2S3S2, based on the expected probability set of the state and the expected probability set of transitions The accumulated value is used to update the state transition probability matrix. The updated state transition probability matrix is ​​obtained. Steps S3S2S3S3, based on the expected probability set of the state The launch probability distribution is updated using a weighted statistic of the set of sentiment rating sequences from historical work orders. The parameters are used to obtain the updated emission probability distribution. ;

[0018] Furthermore, the reusable step-based method for inferring the hidden state probability distribution includes: step R1S0, receiving the sentiment rating sequence; and step R1S1, executing the initialization step of the forward algorithm and calculating the initial forward probability vector. Step R1S2, from time step At the end of the emotion rating sequence, the induction step of the forward algorithm is executed cyclically to obtain the final forward probability matrix; in step R1S3, all elements in the last column of the final forward probability matrix are summed to obtain the total probability of the observation sequence; in step R1S4, each element in the last column of the final forward probability matrix is ​​divided by the total probability of the observation sequence to obtain the probability distribution of each hidden state.

[0019] The reusable step-based negative upgrade risk score calculation method includes: Step R2S0, receiving the probability distribution of each current hidden state, the state transition probability matrix, and the high-risk state definition set; Step R2S1, for each current state in the predefined hidden state set... The state transition probability matrix from state The probability of transitioning to each state in the set of high-risk states is summed to obtain the state. Upgrade risks; Step R2S2, each state The upgrade risk and the probability distribution of the current hidden states Corresponding probability Multiply, for The hidden state at time t, obtaining the state The weighted upgrade risk is calculated; in step R2S3, the weighted upgrade risks of all states are summed to obtain the negative upgrade risk score.

[0020] The implementation method of step R1S1 includes: step R1S1S1, extracting the first observation of the updated sentiment rating sequence. Step R1S1S2, based on the emission probability distribution and observed values For each state in the predefined set of hidden states Calculate its emission probability Step R1S1S3, for each state in the predefined set of hidden states The initial state probability distribution The corresponding initial probability Compared with the launch probability calculated in the previous step Multiply, we get Step R1S1S4, all states Combined into a single vector, we obtain the initial forward probability vector. ;

[0021] The implementation method of step R1S2 includes: from time step Towards the end of the updated sentiment rating sequence, repeat the following steps: Step R1S2S1, extract the current time step. Observations Step R1S2S2 involves taking each state in the predefined set of hidden states as the target state. Calculate the transition from all preceding states to the current state. And observed The joint probability is used to obtain the forward probability at the current time step. Steps R1S2S3 involve forward probabilities of all target states. Combine them into a vector and append it to the final forward probability matrix.

[0022] Furthermore, the implementation method of step R1S1S2 includes: for the emission probability distribution Neutral State Each Gaussian component of the associated Gaussian mixture model The following steps are executed repeatedly: Step R1S1S2S1, using Gaussian components. mean Covariance Matrix Calculate the observed values probability density value under Gaussian distribution Step R1S1S2S2 involves combining the calculated probability density values ​​with the Gaussian components. Mixed weights Multiply to obtain the weighted probability density value; after the loop ends, perform the following steps: Step R1S1S2S3, sum the weighted probability density values ​​of all Gaussian components to obtain the emission probability. .

[0023] Further, the implementation method of step S4S5 includes: step S4S5S1, extracting all unique risk score values ​​from the labeled risk score dataset and sorting them in ascending order to obtain a candidate threshold list; step S4S5S2, for each candidate threshold in the candidate threshold list, calculating the true positive rate and false positive rate corresponding to the candidate threshold using the labeled risk score dataset, combining the true positive rate and false positive rate corresponding to each candidate threshold into a coordinate point, and summing all the formed coordinate points to obtain the ROC curve data point set; step S4S5S3, for each data point in the ROC curve data point set, calculating the Euclidean distance between the data point and the ideal point (0, 1) to obtain a distance list; step S4S5S4, finding the minimum value in the distance list, locating the data point corresponding to the minimum value in the ROC curve data point set and the candidate threshold corresponding to the data point in the candidate threshold list, and determining this candidate threshold as the calibrated risk score threshold.

[0024] Further, the implementation method of step S5S5 includes: if the negative upgrade risk score is greater than the calibrated risk score threshold, then the following steps are performed: step S5S5S1, using the current priority of the ongoing work order as the key, searching for and obtaining its corresponding value in the configured priority upgrade mapping, and determining the value as the upgraded priority; step S5S5S2, constructing a work order processing result that includes the work order ID of the ongoing work order and the upgraded priority.

[0025] An event priority sorting and allocation system, implementing the aforementioned event priority sorting and allocation method, the system comprising:

[0026] The dialogue sequence module incrementally collects and preprocesses the collected raw multi-turn dialogue streams to obtain a set of structured dialogue sequences.

[0027] The emotion scoring module, based on a set of structured dialogue sequences and a pre-trained context-aware emotion analysis model, performs context-aware round-by-round emotion scoring to obtain a set of emotion scoring sequences for historical work orders.

[0028] The model parameter module is based on a set of sentiment rating sequences from historical work orders, a predefined set of hidden states, and a configured hidden Markov model training convergence threshold. Given the maximum number of iterations configured for the Hidden Markov Model (HMM), the Baum-Welch Algorithm is used to perform unsupervised training on the HMM to obtain the initial state probability distribution. State transition probability matrix and emission probability distribution ;

[0029] The scoring threshold module is based on a set of sentiment scoring sequences from historical work orders, collected historical work order result labels, a predefined set of high-risk state definitions, and an initial state probability distribution obtained through training. State transition probability matrix and emission probability distribution Receiver operation characteristic curve analysis is performed to obtain the calibrated risk score threshold;

[0030] The work order processing module, for each work order in the collected ongoing work order stream, uses a pre-trained context-aware sentiment analysis model and a configured context window size. Initial state probability distribution State transition probability matrix Launch probability distribution A predefined set of high-risk status definitions and calibrated risk scoring thresholds are used to perform real-time sentiment tracking and risk prediction, and all results are aggregated to obtain a set of work order processing results.

[0031] The priority module updates the priority of the corresponding work orders in the collected original work order records based on the work order processing result set, and obtains the updated work order records.

[0032] The beneficial effects of the event priority sorting and allocation method and system proposed in this invention are as follows:

[0033] First, by introducing a Hidden Markov Model to model customer emotions, this invention can go beyond the surface emotion rating of a single discourse and instead infer a more stable sequence of underlying emotional states that is closer to the real business situation. This effectively filters out instantaneous noise and ambiguity in the dialogue, thus providing a more reliable and robust basis for decision-making.

[0034] Secondly, the calculation of the negative escalation risk score provides a specific and quantifiable risk indicator for achieving proactive customer service. This risk indicator enables the invention to issue an early warning before the customer's emotions deteriorate to an irreversible level, allowing human intervention at critical moments, thereby effectively preventing customer churn and the spread of negative word-of-mouth.

[0035] Furthermore, this invention dynamically adjusts the priority of work orders based on negative escalation risk scores, ensuring that limited customer service resources can be accurately allocated to work orders with the highest risk and the greatest intervention value. This not only improves the efficiency of solving key problems, but also improves the overall work efficiency and productivity of customer service personnel by reducing the time spent on low-risk, repetitive tasks.

[0036] Ultimately, this invention transforms the intelligent work order system from a passive work order distribution tool into a proactive, real-time risk management platform, systematically improving customer satisfaction and brand loyalty by intervening in the early stages of experience impairment. Attached Figure Description

[0037] Figure 1 This is a flowchart illustrating an event priority sorting and allocation method according to the present invention.

[0038] Figure 2 This is a schematic diagram of the system modules of an event priority sorting and allocation system according to the present invention;

[0039] Figure 3 This is a schematic diagram illustrating an application scenario of the event priority sorting and allocation method of the present invention. Detailed Implementation

[0040] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0041] Example 1

[0042] See Figure 1 This embodiment describes an event priority sorting and allocation method, which includes steps S1 to S6.

[0043] This embodiment will elaborate on the end-to-end technical process of implementing a dynamic work order priority adjustment system. The entire process logically consists of two core stages: First, in an offline environment, a Hidden Markov Model is trained unsupervised using historical work order data, aiming to learn the inherent probabilistic laws governing the evolution of customer emotional states from the data; second, in an online real-time environment, this fully trained and calibrated model is applied to the collected ongoing work order flow to perform real-time emotional risk assessment, and based on the assessment results, generates and executes corresponding priority adjustment operations. For application scenarios of this invention's method, please refer to [link / reference needed]. Figure 3 .

[0044] Step S1: Incrementally collect and preprocess the collected raw multi-turn dialogue streams to obtain a set of structured dialogue sequences.

[0045] The implementation method of step S1 includes: Step S1S1, for each dialogue message in the collected original multi-turn dialogue stream, perform text normalization operation, including removing HTML tags and irrelevant system metadata, to obtain normalized message text. Step S1S2, recombine the normalized message text with the original timestamp and speaker role information, and group them according to work order ID to obtain a set of structured dialogue sequences.

[0046] The raw multi-turn dialogue stream was collected from the interaction log recording component of the customer service platform. Each time the system captures a user's or customer service representative's speech, this component generates a record. This record is quantified as a JSON object containing three key fields: a timestamp generated by the server upon receiving the message, conforming to the Unix timestamp standard; a string representing the speaker's role taken from a fixed enumeration set ['user', 'agent']; and the message text itself, encoded in UTF-8.

[0047] The structured dialogue sequence set generated in step S1 is a collection with work order IDs as keys and a list of dialogue turn objects sorted by time as values. Logically, the structured dialogue sequence set represents a normalized version of all original dialogue records after cleaning, sorting, and grouping. It transforms the unstructured dialogue stream into structured data that can be directly processed by a machine. The structured dialogue sequence set will serve as direct input to the next step, providing the pre-trained context-aware sentiment analysis model with the necessary text sequences containing complete context for sentiment scoring.

[0048] The original set of structured dialogue sequences consists of natural language text, a data format that cannot be directly used for subsequent time series probabilistic modeling. Therefore, before conducting deeper analysis, these text sequences must first be transformed into numerical sequences that can quantify emotional dynamics. Given the complexities of language, such as irony, context dependence, and domain-specific terminology, it is crucial to employ an advanced model capable of understanding the dialogue context to perform this transformation. This ensures that the generated numerical sequences accurately reflect the true fluctuations in emotion, rather than simple, misjudgment-prone estimates based on keyword matching.

[0049] Step S2: Based on the structured dialogue sequence set and the pre-trained context-aware emotion analysis model, perform context-aware round-by-round emotion scoring to obtain the emotion score sequence set of historical work orders.

[0050] The core of step S2 lies in utilizing a model with contextual understanding capabilities for sentiment analysis. Traditional sentiment analysis methods based on keywords or bag-of-words models cannot handle complex situations such as irony and contextual shifts. However, models based on the Transformer architecture (such as BERT), through their self-attention mechanism, can capture long-distance dependencies. When making predictions, inputting the current utterance along with the previous N rounds of dialogue history allows the model to better understand the dynamics of the dialogue and domain-specific terminology, thereby generating more accurate and robust sentiment scores. This continuous sequence of sentiment scores forms the observational basis for subsequent probabilistic inference using a Hidden Markov Model.

[0051] The technical rationale behind the pre-trained context-aware sentiment analysis model relied upon in step S2 stems from its core self-attention mechanism. This mechanism is mathematically proven to dynamically compute a weight distribution for each word in the input sequence, thus selectively and non-linearly focusing on the most relevant parts of the preceding dialogue when processing the current utterance. This enables it to capture complex contextual dependencies beyond fixed windows or linear sequences, forming the theoretical basis for its fundamental advantage over traditional sequence models (such as RNNs) in understanding dialogue history.

[0052] The implementation method of step S2 includes: Step S2S1, for each structured dialogue sequence in the set of structured dialogue sequences, extract all user utterances and call the pre-trained context-aware sentiment analysis model to score them, obtaining an unordered list of work order sentiment score tuples containing all work orders (each tuple contains work order ID, timestamp, and sentiment score). Step S2S2, based on the list of work order sentiment score tuples, group them by work order ID, and sort the tuples in each group in ascending order by timestamp, finally constructing a set of sentiment score sequences for historical work orders.

[0053] The pre-trained context-aware sentiment analysis model is a deep learning model asset based on a Transformer architecture (such as BERT). The generation of the pre-trained context-aware sentiment analysis model involves two training phases: first, pre-training on a public corpus containing massive amounts of general-purpose text to learn the general structure and semantics of language; second, fine-tuning on a proprietary dataset consisting of tens of thousands of manually annotated customer service dialogues to adapt it to the specific language style and emotional expression of the domain. Finally, the pre-trained context-aware sentiment analysis model is quantized and encapsulated into an independently callable service interface that accepts a JSON-formatted request and returns a floating-point number between -1.0 and 1.0 as the sentiment score.

[0054] The set of sentiment rating sequences for historical work orders generated in step S2 is a collection with work order IDs as keys and a list of floating-point numbers sorted by time as values. Logically, this set of sentiment rating sequences transforms the unstructured text dialogue history of each work order into a structured, quantified time series of sentiment trajectories. This set constitutes the "observation sequence" dataset necessary for the Hidden Markov Model to perform subsequent learning, and its quality directly determines the effectiveness of model training. The set of sentiment rating sequences for historical work orders will serve as the core training input for the Baum-Welch algorithm in step S3, used to learn the underlying dynamics of sentiment evolution.

[0055] Using historical work order sentiment rating sequences directly for decision-making presents a core problem: this sequence itself is volatile and may contain noise caused by model misjudgments or ambiguity in customer expression. A single negative rating does not necessarily represent a deterioration in the overall customer's condition. Therefore, to make more robust judgments, a method is needed to infer a smoother, more fundamental potential customer condition from these superficial and noisy observations. Hidden Markov Models (HMMs) are ideal probabilistic tools designed to solve this problem; they are inherently suitable for modeling systems with hidden states that are not directly observable but produce observable signals.

[0056] Step S3: Based on the set of sentiment rating sequences from historical work orders, the predefined set of hidden states, and the configured hidden Markov model training convergence threshold. Given the maximum number of iterations configured for the Hidden Markov Model (HMM), the Baum-Welch Algorithm is used to perform unsupervised training on the HMM to obtain the initial state probability distribution. State transition probability matrix and emission probability distribution .

[0057] Step S3 is one of the core innovations of this invention. Step S3 treats the customer's true emotions (such as "calm" and "worry") as a non-observable Markov process that evolves over time, while considering the observable emotion rating as the "emission symbol" of this process. Hidden Markov Models (HMMs) are ideal tools for establishing probabilistic relationships between such hidden states and observed values. Table 1 shows the definition and examples of HMM hidden states.

[0058] Since there are no labels for the true emotional states of each round in the historical dialogue, this is an unsupervised learning problem. The Baum-Welch algorithm is a standard approach for solving such problems; it is essentially a special case of the Expectation-Maximization (EM) algorithm on Hidden Models (HMMs). This algorithm learns the model's three core parameter sets by iteratively executing the E-step (expectation step, which uses a forward-backward algorithm to calculate the expectation of each hidden state at each time step under the current model parameters) and the M-step (maximization step, which re-estimates the model parameters based on the expectation statistics of the E-step) to maximize the total probability of the observed sequence set. A vector representing the initial probability of the client being in each hidden state at the start of a new conversation. State transition probability matrix. A square matrix containing elements Indicates the customer's emotions from state Transition to state The probability of emission. (Emission probability distribution) : Describes a state that is a hidden state Below, a specific emotion score was observed. probability .

[0059] Since emotion scores are continuous values, the emission probability distribution for each state... This cannot be represented using a simple discrete probability table; instead, a Gaussian mixture model (GMM) is used for modeling. This means that the emission probability distribution... It is a complex parameter object, in which a set of GMM parameters is defined for each hidden state, including the weights, mean and variance of each Gaussian component.

[0060] Compared to traditional methods that directly use emotion ratings, this invention uses probabilistic reasoning to infer a more stable and realistic underlying emotional state, effectively smoothing out noise and ambiguity from individual utterances, thus making more robust judgments.

[0061] Table 1 HMM Hidden State Definitions and Examples

[0062]

[0063] The parameter update formula of the Baum-Welch algorithm is to maximize the log-likelihood function of the observed data. The derived formula contains... A set of sentiment rating sequences representing complete historical work orders. Represents the given model parameters (Including initial state probability distribution) State transition probability matrix and emission probability distribution Under the condition of ), the joint probability of observing this dataset, and This is the logarithm of the probability. This formula defines the optimization objective of the Baum-Welch algorithm: to find model parameters that maximize the probability of the observed data occurring. The Baum-Welch algorithm guarantees that the likelihood of the model is non-decreasing after each iteration, thus enabling it to converge to a local optimum.

[0064] The implementation method of step S3 includes: step S3S1, randomly initializing the initial state probability distribution based on the predefined number of hidden states. State transition probability matrix and emission probability distribution The parameters. Steps S3 and S2: When the improvement in the model's log-likelihood, i.e., the log-likelihood function value, i.e., the difference between the total log-likelihood of the current iteration and the total log-likelihood of the previous iteration, is greater than the configured Hidden Markov Model training convergence threshold. Furthermore, if the number of iterations is less than the maximum number of iterations configured for the Hidden Markov Model, the expectation maximization step is executed repeatedly to obtain the converged initial state probability distribution. State transition probability matrix and emission probability distribution .

[0065] The predefined set of latent states originated from a qualitative study. This study, conducted by a panel of domain experts, identified and generalized typical, recurring discrete emotional phases in customer service interactions through topical analysis of a random sample of 500 archived work order dialogue records. These identified topics were then named, forming a final list of enumerated strings that ensured the latent states in the model had clear and interpretable business meaning.

[0066] Configured Hidden Markov Model Training Convergence Threshold The maximum number of iterations for the configured Hidden Markov Model (HMM) is a standard hyperparameter used to control the termination condition of the iterative optimization algorithm. Their specific values ​​are determined by observing the convergence behavior of the Baum-Welch algorithm on independent validation datasets. The maximum number of iterations for the configured HMM is set to a sufficiently large integer to ensure that the algorithm has enough iterations to reach convergence. The configured HMM training convergence threshold... It is then set to a sufficiently small positive floating-point number, which corresponds to the point where the growth curve of the model's log-likelihood on the validation set tends to flatten out, indicating that the performance improvement brought by further iterations has become negligible.

[0067] The implementation method of steps S3S2 includes: when the improvement in the model's log-likelihood is greater than the configured Hidden Markov Model training convergence threshold... And when the number of iterations is less than the maximum number of iterations configured for the Hidden Markov Model, the following steps are executed repeatedly: Step S3S2S1, for each sentiment rating sequence in the set of sentiment rating sequences of historical work orders, the forward-backward algorithm is executed to calculate the forward probability matrix. and backward probability matrix Steps S3 and S2 are based on the forward probability matrix. Backward probability matrix State transition probability matrix Launch probability distribution By combining the set of sentiment rating sequences from historical work orders, the expected statistic is calculated to obtain the expected probability set of the state. and the expected probability set of transitions Steps S3, S2, and S3 are based on the expected probability set of the state. Transition Expectation Probability Set Using the set of sentiment rating sequences from historical work orders, the parameters of the Hidden Markov Model are re-estimated to obtain the updated initial state probability distribution. Updated state transition probability matrix and the updated launch probability distribution Steps S3, S2, and S4 involve using the updated initial state probability distribution. Updated state transition probability matrix and the updated launch probability distribution Calculate the total log-likelihood of the Hidden Markov Model on the set of sentiment rating sequences of historical work orders, and record the difference between it and the previous iteration. Steps S3-S5 update the initial state probability distribution. Determined as the initial state probability distribution The updated state transition probability matrix Determined as the state transition probability matrix and the updated launch probability distribution Determined as the emission probability distribution This is used for the next loop iteration.

[0068] The implementation method of steps S3S2S1 includes: for each emotion rating sequence in the set of emotion rating sequences of historical work orders, the following steps are executed iteratively: Step S3S2S1S1, based on the emotion rating sequence and the initial state probability distribution State transition probability matrix and emission probability distribution The forward algorithm is recursively calculated to obtain the forward probability matrix. Steps S3S2S1S2 are based on the emotion rating sequence and the state transition probability matrix. and emission probability distribution The backward algorithm is recursively calculated to obtain the backward probability matrix. .

[0069] The implementation method of step S3S2S2 includes: step S3S2S2S1, based on the forward probability matrix and backward probability matrix Calculate at each time step In state The expected probability is used to obtain the set of expected probabilities for the state. Steps S3S2S2S2, based on the forward probability matrix Backward probability matrix State transition probability matrix Launch probability distribution Based on the set of sentiment rating sequences from historical work orders, calculate the sentiment rating at each time step. From state Transition to state The expected probability is used to obtain the transition expected probability set. .

[0070] The implementation method of steps S3S2S3 includes: step S3S2S3S1, based on the state expectation probability set At time step The expected value is used to update the initial state probability distribution. The updated initial state probability distribution is obtained. Step S3S2S3S2, based on the expected probability set of the state. and the expected probability set of transitions The accumulated value is used to update the state transition probability matrix. The updated state transition probability matrix is ​​obtained. Steps S3S2S3S3 are based on the expected probability set of the state. The launch probability distribution is updated using a weighted statistic of the set of sentiment rating sequences from historical work orders. The parameters of the Gaussian mixture model are used to obtain the updated emission probability distribution. .

[0071] The initial state probability distribution generated in step S3 State transition probability matrix and emission probability distribution These are three independent mathematical objects that collectively define a trained Hidden Markov Model. Initial state probability distribution. It is a probability vector, the state transition probability matrix. It is a square matrix, and the emission probability distribution These are a set of Gaussian mixture model parameters defined for each latent state. Logically, these three parameter sets together constitute the core prediction engine of the entire solution, encoding all the knowledge learned from historical data about the evolution of customer sentiment. These parameters will serve as the basis for all probability inferences and risk calculations in subsequent steps S4 and S5.

[0072] Step S3 employs the Baum-Welch algorithm, a standard method for finding maximum likelihood estimates of Hidden Markov Model (HMM) parameters when unlabeled data (i.e., hidden states are unknown) exists. This algorithm is a special case of the Expectation-Maximization (EM) algorithm, and its theoretical basis guarantees that the model's likelihood of the observed data is non-decreasing in each iteration. This characteristic ensures that the algorithm can stably converge to a locally optimal parameter solution, thus providing a solid theoretical basis and convergence guarantee for unsupervised learning tasks.

[0073] The reusable step-based method for inferring the hidden state probability distribution includes: step R1S0, receiving the sentiment rating sequence; and step R1S1, executing the initialization step of the forward algorithm and calculating the initial forward probability vector. Step R1S2, from time step At the end of the emotion rating sequence, the induction step of the forward algorithm is executed iteratively to obtain the final forward probability matrix. Step R1S3: Summate all elements in the last column of the final forward probability matrix to obtain the total probability of the observed sequence. Step R1S4: Divide each element in the last column of the final forward probability matrix by the total probability of the observed sequence to obtain the probability distribution of each hidden state.

[0074] Reusable step-based hidden state probability distribution inference is used to infer the potential emotional state of customers in real time. For an ongoing work order, the updated emotional rating sequence is updated whenever a new user dialogue is generated. At this time, it is necessary to use a pre-trained HMM model to calculate the posterior probability of the customer being in each hidden state, given that all current emotional ratings have been observed.

[0075] The forward algorithm is an efficient dynamic programming method for accomplishing this task. It calculates the forward probabilities recursively. That is, "in the model" Below, the observed sequence arrive And in time step In state The joint probability of "; where, Represents the forward probability, that is, given a model Under these conditions, observations were made from time step 1 to time step 2. sequence And in time step The system is in a state The joint probability at time, i.e. This formula defines the core computational objective of the forward algorithm, namely, at any given time step... The joint probability of the system being in a specific state and having generated the corresponding observation sequence forms the basis for all subsequent probability inferences.

[0076] By normalizing the final forward probabilities of all states, we can obtain... That is, the current time step The hidden state at that time The probability distribution. This probability distribution vector represents the system's confidence assessment of the customer's current potential emotional state and is the basis for subsequent risk prediction. This expression represents the probability distribution under a given model. and from time step 1 to time step Complete observation sequence Under these conditions, the system at the final time step In state The posterior probability. This formula is used to calculate the final inference result of the current customer's potential emotional state, that is, the system's confidence distribution of the customer's possible latent states. This represents the observation value at time step T.

[0077] The implementation method of step R1S1 includes: step R1S1S1, extracting the first observation of the updated sentiment rating sequence. Step R1S1S2, based on the emission probability distribution and observed values For each state in the predefined set of hidden states Calculate its emission probability Step R1S1S3 involves processing each state in the predefined set of hidden states. The initial state probability distribution The corresponding initial probability Compared with the launch probability calculated in the previous step Multiply, we get Step R1S1S4 involves all states... Combined into a single vector, we obtain the initial forward probability vector. .

[0078] The initialization formula for the forward algorithm is: In the formula, This represents the forward probability at time step 1. Representing state The initial probability, and Represents the state The first symbol observed The probability of emission. This represents the state at the start of time step 1, where the system is in state . (probability is) And from the state The first observation was launched. (probability is) The joint probability of ). This formula is used to initialize the recursive computation process of the forward algorithm, providing a starting point for subsequent time steps.

[0079] The implementation method of step R1S1S2 includes: for the emission probability distribution Neutral State Each Gaussian component of the associated Gaussian mixture model The following steps are executed repeatedly: Step R1S1S2S1, using Gaussian components. mean Covariance Matrix Calculate the observed values probability density value under this Gaussian distribution Step R1S1S2S2 involves combining the probability density value calculated in the previous step with the Gaussian component. Mixed weights Multiply the results to obtain the weighted probability density value. After the loop ends, perform the following steps: Step R1S1S2S3, sum the weighted probability density values ​​of all Gaussian components to obtain the emission probability. .

[0080] The probability density function of a Gaussian mixture model (GMM) is defined as the weighted sum of the probability density functions of its individual Gaussian components: In the formula, Representative observation value Total probability density under Gaussian mixture model It is the total number of Gaussian components in the mixture model. It is the first The mixing weights of Gaussian components, It is the first There are Gaussian components (with a mean of 1). The covariance matrix is ) at point The probability density value at a given point. This formula is used to calculate the probability density of a continuous observation (such as a sentiment rating) observed from a complex probability distribution composed of multiple Gaussian distributions. Steps R1S1S2 precisely implement the calculation of this formula.

[0081] The implementation method of step R1S2 includes: from time step Towards the end of the updated sentiment rating sequence, repeat the following steps: Step R1S2S1, extract the current time step. Observations Step R1S2S2 involves taking each state in the predefined set of hidden states as the target state. Calculate the transition from all preceding states to the current state. And observed The joint probability is used to obtain the forward probability at the current time step. Steps R1S2S3 involve forward probabilities of all target states. Combine them into a vector and append it to the final forward probability matrix.

[0082] The formula for the inductive step (or recursive step) of the forward algorithm is:

[0083] In the formula, This represents the total number of states. Represents the time step In state The forward probability, It is a time step In state The forward probability, From state to state The transition probability, It is in state The observed symbol The emission probability of the system at time step. This formula means: the system at time step... In state And observed The probability is equal to "at time step In any state The probability ( Multiply by the state Transition to state The probability ( ")" for all possible preceding states Summing, then multiplying by "from state" Emit observations The probability ( This formula is the core recursive step of the forward algorithm, used to efficiently derive the probability distribution of the current time step from the probability distribution of the previous time step.

[0084] The reusable step-based negative upgrade risk score calculation method includes: Step R2S0, receiving the probability distribution of each current hidden state, the state transition probability matrix, and the high-risk state definition set; Step R2S1, for each current state in the predefined hidden state set... The state transition probability matrix from state The probability of transitioning to each state in the set of high-risk states is summed to obtain the state. The risk of upgrades. Step R2S2, for each state The upgrade risk and the current time step The hidden state at that time The state in the probability distribution Corresponding probability Multiply, for The hidden state at time t, obtaining the state The weighted upgrade risk is calculated. Step R2S3: sum the weighted upgrade risks of all states to obtain the negative upgrade risk score.

[0085] The reusable step-based negative escalation risk score calculation is a key innovation for enabling proactive intervention. It utilizes a state transition probability matrix trained by Hidden Markov Models (HMMs) for forward prediction, rather than reacting only after a clear negative signal is detected, as is the case with traditional methods.

[0086] The calculation logic for the negative escalation risk score is based on the law of total probability. It calculates the risk score in the next round of dialogue ( In this context, the expected probability of a customer's emotional state transitioning to a predefined high-risk state is defined as follows: In the formula, Represents the time step The calculated negative escalation risk score, In time step The system is in a predefined set of hidden states. potential states in for The probability (i.e., an element in the probability distribution of the current hidden states). A predefined set of high-risk states; From state Transition to state The probability (i.e., the state transition probability matrix) (One of the elements). The reusable step negative escalation risk score calculation accurately implements this formula. This shifts the decision-making trigger point from "post-event confirmation" to "pre-event prediction," which is the core of achieving proactive service. This formula is used to quantify the probability that the emotional state of a work order will deteriorate to a high-risk state in the next round of dialogue, providing a forward-looking decision-making basis for proactive intervention.

[0087] The negative escalation risk score is a continuous probability value between 0 and 1. However, in actual business operations, a binary, either-or decision needs to be made: "Should priority escalation be triggered?" This necessitates setting a clear decision threshold to map the continuous risk score to discrete actions. Simply setting the threshold to 0.5 or any other arbitrary value usually fails to achieve the optimal balance between identifying genuine risks and avoiding false alarms. Therefore, logically, a systematic, data-driven approach is needed to determine this optimal threshold to ensure that the final decision-making strategy is the most efficient in terms of business operations.

[0088] Step S4 involves using the set of sentiment rating sequences from historical work orders, the collected labels of historical work order results, the predefined set of high-risk state definitions, and the initial state probability distribution obtained through training. State transition probability matrix and emission probability distribution Receiver operation characteristic curve analysis is performed to obtain the calibrated risk score threshold.

[0089] The negative escalation risk score is a continuous probability value, requiring a defined threshold to convert it into a binary decision signal of "need escalation" or "no escalation". Simply choosing 0.5 as the threshold is usually not optimal. The receiver operating characteristic (ROC) curve is a standard tool for selecting the optimal threshold.

[0090] ROC curves visualize the classifier's performance by plotting the relationship between the True Positive Rate (TPR) and the False Positive Rate (FPR) at all possible thresholds. The True Positive Rate is the proportion of work orders that correctly identify the need for escalation, while the False Positive Rate is the proportion of normal work orders that are incorrectly marked as needing escalation.

[0091] An ideal classifier's ROC curve will be as close as possible to the top left corner of the graph, corresponding to an FPR of 0 and a TPR of 1. Therefore, selecting the point on the curve that is closest to the (0,1) point in Euclidean distance is a common strategy to achieve a balance between TPR and FPR, and the risk score corresponding to this point is the calibrated risk score threshold.

[0092] The implementation method of step S4 includes: step S4S1, for each emotion rating sequence in the set of emotion rating sequences of historical work orders, performing reusable step hidden state probability distribution inference, based on the emotion rating sequence and the initial state probability distribution. State transition probability matrix and emission probability distribution The probability distribution of each current hidden state is inferred, and the probability distributions of each current hidden state are summarized to obtain the set of hidden state probability distributions for historical work orders. Step S4S2: For each current hidden state probability distribution in the set of hidden state probability distributions for historical work orders, a reusable negative escalation risk score calculation is performed, based on the probability distributions of the current hidden states and the state transition probability matrix. Based on a predefined set of high-risk status definitions, calculate the negative escalation risk score and summarize each negative escalation risk score to obtain a historical risk score sequence. Step S4S3: Extract each negative escalation risk score from the historical risk score sequence and its corresponding work order ID to construct a flattened risk score list. Step S4S4: Align the flattened risk score list with the collected historical work order result labels based on the work order ID to obtain a labeled risk score dataset. Step S4S5: Based on the labeled risk score dataset, generate a receiver operation feature curve and determine the risk score corresponding to the coordinate point on the curve closest to the top left corner (0, 1), obtaining the calibrated risk score threshold.

[0093] The collected historical work order results tags originate from a process combining automated rules and manual review. First, work orders that may have been escalated are automatically marked using preset rules, such as detecting explicit complaint keywords or repeated customer reopening of the work order. Subsequently, a team of quality assurance experts manually reviews these marked work orders and, based on clearly defined business standards, ultimately confirms whether the work order has genuinely undergone a service level upgrade. This final judgment is quantified as a Boolean value (true or false) and stored in a CSV file along with the corresponding work order ID for subsequent model calibration.

[0094] The predefined set of high-risk states is a subset of the predefined set of latent states, and its definition originates from a business strategy decision. It is jointly determined by senior management in customer service and risk management departments, identifying which of the defined potential emotional states (such as "frustration" or "anger") represent the level of customer dissatisfaction that poses a direct threat to the business, potentially leading to customer churn or damage to brand reputation. This decision is then formalized into a list of strings, serving as the basis for risk calculations.

[0095] The implementation method of steps S4S5 includes: Step S4S5S1, extracting all unique risk score values ​​from the labeled risk score dataset and sorting them in ascending order to obtain a candidate threshold list. Step S4S5S2, for each candidate threshold in the candidate threshold list, calculating the true positive rate and false positive rate corresponding to the candidate threshold using the labeled risk score dataset, combining the true positive rate and false positive rate corresponding to each candidate threshold into a coordinate point, and summing all the formed coordinate points to obtain the ROC curve data point set. Step S4S5S3, for each data point in the ROC curve data point set, calculating the Euclidean distance between the data point and the ideal point (0, 1) to obtain a distance list. Step S4S5S4, finding the minimum value in the distance list, locating the data point corresponding to the minimum value in the ROC curve data point set and the candidate threshold corresponding to the data point in the candidate threshold list, and determining this candidate threshold as the calibrated risk score threshold.

[0096] The calibrated risk score threshold generated in steps S4 and S5 is a single floating-point scalar. Logically, the calibrated risk score threshold represents an optimal decision boundary validated by empirical data, striking a balance between maximizing the identification of genuine risk tickets (true positives) and minimizing false alarms (false positives). The calibrated risk score threshold will serve as a key benchmark for real-time decision-making in the next step, S5, converting probabilistic negative escalation risk scores into deterministic "escalate" or "do not escalate" business operations.

[0097] Step S5: For each ongoing work order in the collected ongoing work order stream, based on the pre-trained context-aware sentiment analysis model and the configured context window size... Initial state probability distribution State transition probability matrix Launch probability distribution A predefined set of high-risk status definitions and calibrated risk score thresholds are used to perform real-time sentiment tracking and risk prediction, and all results are aggregated to obtain a set of work order processing results.

[0098] The implementation method of step S5 includes: for each ongoing work order in the collected ongoing work order stream, the following steps are executed cyclically: Step S5S1, extract the new user utterance from the structured dialogue sequence of the ongoing work order, and perform context-aware round-by-round emotion scoring to obtain the new emotion score. Step S5S2, check whether an emotion score sequence already exists for the ongoing work order. If it exists, append the new emotion score to the end of the emotion score sequence; if it does not exist, create a new sequence using the new emotion score to obtain the updated emotion score sequence. Step S5S3, perform reusable step hidden state probability distribution inference, based on the updated emotion score sequence and the initial state probability distribution. State transition probability matrix and emission probability distribution Infer and update the probability distribution of each hidden state. Step S5S4: Perform the reusable step of negative upgrade risk score calculation based on the probability distribution of each hidden state and the state transition probability matrix. Based on the predefined high-risk status definition set, calculate the negative escalation risk score. In step S5S5, when the negative escalation risk score is greater than the calibrated risk score threshold, generate a work order processing result containing the new priority based on the ongoing work order and the configured priority escalation mapping. In step S5S6, summarize all work order processing results generated in step S5S5 to obtain a work order processing result set.

[0099] The collected work order stream originates from a real-time message bus system (such as Apache Kafka or RabbitMQ), which is responsible for broadcasting various events occurring on the customer service platform. Whenever a new message is recorded for a work order in the "open" state, the system publishes an event. This event is quantified as a JSON-formatted data object, with a structure consistent with a single record in the original multi-turn conversation stream, but it is pushed and consumed as a near real-time data stream.

[0100] Configured context window size is a positive integer hyperparameter whose value was determined through systematic empirical testing. On a reserved validation dataset, researchers evaluated the pre-trained context-aware sentiment analysis model with varying context window sizes across different configurations by running a series of experiments. The prediction accuracy for each value (e.g., 1, 3, 5, 10). The final selected value represents the best trade-off between model prediction accuracy and computational latency per call.

[0101] Step S5 applies an offline-trained Hidden Markov Model (HMM) to the online, real-time data stream for state estimation and future prediction. This is a typical and mature application paradigm of HMM in time series analysis. The model's efficient inference algorithms, such as the forward pass algorithm, and the predictive state transition probability matrix learned from historical data contribute to its performance. This combination makes it an ideal technical tool for building dynamic online monitoring and early warning systems.

[0102] The implementation method of step S5S5 includes: if the negative upgrade risk score is greater than the calibrated risk score threshold, then the following steps are executed: Step S5S5S1, using the current priority of the ongoing work order as the key, search for and obtain its corresponding value in the configured priority upgrade mapping, and determine this value as the upgraded priority. Step S5S5S2, construct a work order processing result containing the work order ID of the ongoing work order and the upgraded priority.

[0103] The configured priority escalation mapping is a direct digital encoding of the event escalation path rules in the existing, written Standard Operating Procedures (SOPs) of the enterprise customer service department. These rules define a fixed workflow for work orders of different priorities when escalation is required. This business rule is quantified as a key-value pair mapping table stored in a JSON object for quick and unambiguous lookups within the application.

[0104] Step S6: Based on the work order processing result set, update the priority of the corresponding work order in the collected original work order records to obtain the updated work order records.

[0105] The implementation method of step S6 includes: For each work order processing result in the work order processing result set, the following steps are executed cyclically: Step S6S1, extract the work order ID and upgraded priority from the work order processing result. Step S6S2, search for the work order record that matches the work order ID in the collected original work order records. Step S6S3, update the priority field of the matching work order record to the upgraded priority. After the loop ends, the following steps are executed: Step S6S4, determine the collected original work order records that have undergone all the above priority updates as the updated work order records.

[0106] The raw ticket records collected originate from the core database of the Customer Relationship Management (CRM) system in the production environment. The generation of each raw ticket record is triggered by the creation event of a new customer service case. The record is quantified as a JSON document, where fields such as ticket ID are globally unique identifiers generated by the system (e.g., UUID), while references to the original multi-turn conversation flow point to the relevant conversation entries stored in another dataset.

[0107] The implementation of this invention begins with parsing and quantifying the unstructured, raw multi-turn dialogue stream, transforming it into a structured set of sentiment rating sequences from historical work orders. This numerical time-series data is then used to train a Hidden Markov Model, producing the core set of probability parameters (initial state probability distribution). State transition probability matrix Launch probability distribution These parameters, combined with historical label data, are used to calibrate a key post-calibration risk score threshold through receiver operation characteristic curve analysis. Finally, in the real-time phase, the products of all these offline training and calibrations are applied to the collected in-process work order flow. Through a series of probabilistic inferences and comparisons, a set of work order processing results is generated, ultimately manifesting as modifications to the collected original work order records, producing updated work order records, thus completing a full closed loop from raw data to final decision.

[0108] The core contribution of this invention lies in constructing a complete automated decision-making framework that learns from data and applies it to real-time prediction. By introducing a probabilistic model, it successfully transforms a subjective customer emotional state problem into an objective and quantifiable problem of future risk probability. This transformation not only improves the accuracy and robustness of decision-making but also provides a technical foundation for customer service operations to shift from a passive response model to a proactive risk management model, thereby achieving optimal resource allocation and a systematic improvement in customer experience.

[0109] The core innovation of this invention lies in reconstructing the risk assessment problem of customer service work orders from a traditional static classification task into a dynamic, probabilistic time series prediction problem. The fundamental principle is that the emotional ratings expressed by customers during conversations are merely a noisy, observable representation of their true emotional state; the real reasons determining their behavior, such as escalating to a complaint or leaving satisfied, are the unobservable, evolving latent emotional states. Therefore, the core strategy of this invention is to employ the classic probabilistic graphical model, the Hidden Markov Model, to explicitly establish the mathematical relationship between the invisible internal state and the visible external observation. Through unsupervised training on a large set of historical work order emotional rating sequences, this invention learns the inherent laws governing the evolution of emotional states, and these laws are solidified in the state transition probability matrix. This process signifies that the invention possesses a profound understanding of emotional dynamics. The ultimate breakthrough of this invention lies in its use of Hidden Markov Models to predict the future, rather than explaining the past. By calculating a negative escalation risk score—the expected probability that a customer will enter any high-risk state in the next round of conversation—the invention shifts the focus of decision-making from current emotions to predicting future emotions. This logical leap from classification to prediction provides a solid theoretical and technical foundation for realizing a business model transformation from passive response to proactive intervention.

[0110] Example 2

[0111] See Figure 2 As shown, this embodiment provides an event priority sorting and allocation system, the system including:

[0112] The dialogue sequence module incrementally collects and preprocesses the collected raw multi-turn dialogue streams to obtain a set of structured dialogue sequences.

[0113] The emotion scoring module, based on a set of structured dialogue sequences and a pre-trained context-aware emotion analysis model, performs context-aware round-by-round emotion scoring to obtain a set of emotion scoring sequences for historical work orders.

[0114] The model parameter module is based on a set of sentiment rating sequences from historical work orders, a predefined set of hidden states, and a configured hidden Markov model training convergence threshold. Given the maximum number of iterations configured for the Hidden Markov Model (HMM), the Baum-Welch Algorithm is used to perform unsupervised training on the HMM to obtain the initial state probability distribution. State transition probability matrix and emission probability distribution ;

[0115] The scoring threshold module is based on a set of sentiment scoring sequences from historical work orders, collected historical work order result labels, a predefined set of high-risk state definitions, and an initial state probability distribution obtained through training. State transition probability matrix and emission probability distribution Receiver operation characteristic curve analysis is performed to obtain the calibrated risk score threshold;

[0116] The work order processing module, for each ongoing work order in the collected ongoing work order stream, uses a pre-trained context-aware sentiment analysis model and a configured context window size. Initial state probability distribution State transition probability matrix Launch probability distribution A predefined set of high-risk status definitions and calibrated risk scoring thresholds are used to perform real-time sentiment tracking and risk prediction, and all results are aggregated to obtain a set of work order processing results.

[0117] The priority module updates the priority of the corresponding work orders in the collected original work order records based on the work order processing result set, and obtains the updated work order records.

[0118] For any parts not mentioned in this application, existing technologies may be used or referenced.

[0119] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.

[0120] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. An event priority sorting and allocation method, characterized in that, include: Step S1: Incrementally collect and preprocess the collected raw multi-turn dialogue stream to obtain a set of structured dialogue sequences; Step S2: Based on the structured dialogue sequence set and the pre-trained context-aware sentiment analysis model, perform context-aware round-by-round sentiment scoring to obtain the sentiment score sequence set of historical work orders. Step S3: Based on the set of sentiment rating sequences from historical work orders, the predefined set of hidden states, and the configured hidden Markov model training convergence threshold. Given the maximum number of iterations of the configured Hidden Markov Model (HMM), the Baum-Welch algorithm is used to perform unsupervised training on the HMM to obtain the initial state probability distribution. State transition probability matrix and emission probability distribution ; Step S4 involves using the set of sentiment rating sequences from historical work orders, the collected labels of historical work order results, the predefined set of high-risk state definitions, and the initial state probability distribution obtained through training. State transition probability matrix and emission probability distribution Receiver operation characteristic curve analysis is performed to obtain the calibrated risk score threshold; The implementation method of step S4 includes: step S4S1, for each emotion rating sequence in the set of emotion rating sequences of historical work orders, performing reusable step hidden state probability distribution inference, based on the emotion rating sequence and the initial state probability distribution. State transition probability matrix and emission probability distribution Step S4S2 involves inferring the probability distribution of each current hidden state and summarizing the probability distributions of each current hidden state to obtain a set of hidden state probability distributions for historical work orders. Step S4S2 further involves performing a reusable negative escalation risk score calculation for each current hidden state probability distribution in the set of hidden state probability distributions for historical work orders, based on the probability distributions of the current hidden states and the state transition probability matrix. Based on a predefined set of high-risk status definitions, calculate the negative escalation risk score and summarize each negative escalation risk score to obtain a historical risk score sequence; in step S4S3, extract each negative escalation risk score from the historical risk score sequence and its corresponding work order ID to construct a flattened risk score list; in step S4S4, align the flattened risk score list with the collected historical work order result labels based on the work order ID to obtain a labeled risk score dataset; in step S4S5, based on the labeled risk score dataset, generate a receiver operation feature curve and determine the negative escalation risk score corresponding to the coordinate point closest to the upper left corner (0,1) on the receiver operation feature curve to obtain the calibrated risk score threshold; The reusable step-based negative upgrade risk score calculation method includes: Step R2S0, receiving the probability distribution of each current hidden state, the state transition probability matrix, and the high-risk state definition set; Step R2S1, for each current state in the predefined hidden state set... The state transition probability matrix from state The probability of transitioning to each state in the set of high-risk states is summed to obtain the state. Upgrade risks; Step R2S2, each state The upgrade risk and the probability distribution of the current hidden states Corresponding probability Multiply, for The hidden state at time t, obtaining the state The weighted upgrade risk; step R2S3, sum the weighted upgrade risks of all states to obtain the negative upgrade risk score; Step S5: For each work order in the collected ongoing work order stream, based on the pre-trained context-aware sentiment analysis model and the configured context window size... Initial state probability distribution State transition probability matrix Launch probability distribution A predefined set of high-risk status definitions and calibrated risk scoring thresholds are used to perform real-time sentiment tracking and risk prediction, and all results are aggregated to obtain a set of work order processing results. Step S6: Based on the work order processing result set, update the priority of the corresponding work order in the collected original work order records to obtain the updated work order records.

2. The event priority sorting and allocation method according to claim 1, characterized in that, The implementation method of step S3 includes: step S3S1, randomly initializing the initial state probability distribution based on the predefined number of hidden states. State transition probability matrix and emission probability distribution The parameters; Steps S3 and S2, when the improvement in the model's log-likelihood is greater than the configured Hidden Markov Model training convergence threshold. Furthermore, if the number of iterations is less than the maximum number of iterations configured for the Hidden Markov Model, the expectation maximization step is executed repeatedly to obtain the converged initial state probability distribution. State transition probability matrix and emission probability distribution .

3. The event priority sorting and allocation method according to claim 1, characterized in that, The implementation method of step S5 includes: for each work order in the collected ongoing work order stream, the following steps are executed cyclically: Step S5S1, extract the new user utterance from the structured dialogue sequence of the ongoing work order, and perform context-aware round-by-round emotion scoring to obtain the new emotion score; Step S5S2, check whether the ongoing work order already has an emotion score sequence. If it does, append the new emotion score to the end of the emotion score sequence. If it does not exist, use the new emotion score to create a new sequence to obtain the updated emotion score sequence; Step S5S3, perform reusable step hidden state probability distribution inference, based on the updated emotion score sequence and the initial state probability distribution. State transition probability matrix and emission probability distribution Infer and update the probability distribution of each hidden state; in steps S5 and S4, perform the reusable step of negative upgrade risk score calculation based on the probability distribution of each hidden state and the state transition probability matrix. Calculate the negative escalation risk score based on the predefined high-risk status definition set; Step S5S5: When the negative escalation risk score is greater than the calibrated risk score threshold, generate a work order processing result containing the new priority based on the ongoing work order and the configured priority escalation mapping; Step S5S6: Summarize all work order processing results generated in step S5S5 to obtain a work order processing result set.

4. The event priority sorting and allocation method according to claim 2, characterized in that, The implementation method of steps S3S2 includes: when the improvement in the model's log-likelihood is greater than the configured Hidden Markov Model training convergence threshold... And when the number of iterations is less than the maximum number of iterations configured for the Hidden Markov Model, the following steps are executed repeatedly: Step S3S2S1, for each sentiment rating sequence in the set of sentiment rating sequences of historical work orders, the forward-backward algorithm is executed to calculate the forward probability matrix. and backward probability matrix Step S3S2S2, based on the forward probability matrix Backward probability matrix State transition probability matrix Launch probability distribution By combining the set of sentiment rating sequences from historical work orders, the expected statistic is calculated to obtain the expected probability set of the state. and the expected probability set of transitions Steps S3, S2, and S3 are based on the expected probability set of the state. Transition Expectation Probability Set Using the set of sentiment rating sequences from historical work orders, the parameters of the Hidden Markov Model are re-estimated to obtain the updated initial state probability distribution. Updated state transition probability matrix and the updated launch probability distribution Steps S3, S2, and S4 involve using the updated initial state probability distribution. Updated state transition probability matrix and the updated launch probability distribution Calculate the total log-likelihood of the Hidden Markov Model on the set of sentiment rating sequences of historical work orders, and record the difference between it and the previous iteration; in steps S3, S2, and S5, update the initial state probability distribution. Determined as the initial state probability distribution The updated state transition probability matrix Determined as the state transition probability matrix and the updated launch probability distribution Determined as the launch probability distribution This is used for the next loop iteration.

5. The event priority sorting and allocation method according to claim 4, characterized in that, The implementation method of steps S3S2S1 includes: for each emotion rating sequence in the set of emotion rating sequences of historical work orders, the following steps are executed iteratively: Step S3S2S1S1, based on the emotion rating sequence and the initial state probability distribution State transition probability matrix and emission probability distribution The forward algorithm is recursively calculated to obtain the forward probability matrix. Steps S3S2S1S2 are based on the emotion rating sequence and the state transition probability matrix. and emission probability distribution The backward algorithm is recursively calculated to obtain the backward probability matrix. ; The implementation method of step S3S2S2 includes: step S3S2S2S1, based on the forward probability matrix and backward probability matrix Calculate at each time step In state The expected probability is used to obtain the set of expected probabilities for the state. Step S3S2S2S2, based on the forward probability matrix Backward probability matrix State transition probability matrix Launch probability distribution Based on the set of sentiment rating sequences from historical work orders, calculate the sentiment rating at each time step. From state Transition to state The expected probability is used to obtain the transition expected probability set. ; The implementation method of steps S3S2S3 includes: step S3S2S3S1, based on the state expectation probability set At time step The expected value is used to update the initial state probability distribution. The updated initial state probability distribution is obtained. Step S3S2S3S2, based on the expected probability set of the state and the expected probability set of transitions The accumulated value is used to update the state transition probability matrix. The updated state transition probability matrix is ​​obtained. Steps S3S2S3S3, based on the expected probability set of the state The launch probability distribution is updated using a weighted statistic of the set of sentiment rating sequences from historical work orders. The parameters are used to obtain the updated emission probability distribution. .

6. The event priority sorting and allocation method according to claim 1, characterized in that, The reusable step-based method for inferring the hidden state probability distribution includes: step R1S0, receiving the sentiment rating sequence; and step R1S1, executing the initialization step of the forward algorithm and calculating the initial forward probability vector. Step R1S2, from time step At the end of the emotion rating sequence, the induction step of the forward algorithm is executed cyclically to obtain the final forward probability matrix; in step R1S3, all elements in the last column of the final forward probability matrix are summed to obtain the total probability of the observation sequence; in step R1S4, each element in the last column of the final forward probability matrix is ​​divided by the total probability of the observation sequence to obtain the probability distribution of each hidden state.

7. The event priority sorting and allocation method according to claim 6, characterized in that, The implementation method of step R1S1 includes: Step R1S1S1, extracting the first observation of the updated sentiment rating sequence. Step R1S1S2, based on the emission probability distribution and observed values For each state in the predefined set of hidden states Calculate its emission probability Step R1S1S3: For each state in the predefined set of hidden states... The initial state probability distribution The corresponding initial probability Compared with the launch probability calculated in the previous step Multiply, we get Step R1S1S4, all states Combined into a single vector, we obtain the initial forward probability vector. ; The implementation method of step R1S2 includes: from time step Towards the end of the updated sentiment rating sequence, repeat the following steps: Step R1S2S1, extract the current time step. Observations Step R1S2S2 involves taking each state in the predefined set of hidden states as the target state. Calculate the transition from all preceding states to the current state. And observed The joint probability is used to obtain the forward probability at the current time step. Steps R1S2S3 involve forward probabilities of all target states. Combine them into a vector and append it to the final forward probability matrix.

8. The event priority sorting and allocation method according to claim 7, characterized in that, The implementation method of step R1S1S2 includes: for the emission probability distribution Neutral State Each Gaussian component of the associated Gaussian mixture model The following steps are executed repeatedly: Step R1S1S2S1, using Gaussian components. mean Covariance Matrix Calculate the observed values probability density value under Gaussian distribution Step R1S1S2S2 involves combining the calculated probability density values ​​with the Gaussian components. Mixed weights Multiply to obtain the weighted probability density value; after the loop ends, perform the following steps: Step R1S1S2S3, sum the weighted probability density values ​​of all Gaussian components to obtain the emission probability. .

9. The event priority sorting and allocation method according to claim 1, characterized in that, The implementation method of steps S4S5 includes: Step S4S5S1, extracting all unique risk score values ​​from the labeled risk score dataset and sorting them in ascending order to obtain a candidate threshold list; Step S4S5S2, for each candidate threshold in the candidate threshold list, calculating the true positive rate and false positive rate corresponding to the candidate threshold using the labeled risk score dataset, combining the true positive rate and false positive rate corresponding to each candidate threshold into a coordinate point, and summing all the formed coordinate points to obtain the ROC curve data point set; Step S4S5S3, for each data point in the ROC curve data point set, calculating the Euclidean distance between the data point and the ideal point (0, 1) to obtain a distance list; Step S4S5S4, finding the minimum value in the distance list, locating the data point corresponding to the minimum value in the ROC curve data point set and the candidate threshold corresponding to the data point in the candidate threshold list, and determining this candidate threshold as the calibrated risk score threshold.

10. The event priority sorting and allocation method according to claim 3, characterized in that, The implementation method of step S5S5 includes: if the negative upgrade risk score is greater than the calibrated risk score threshold, then the following steps are performed: Step S5S5S1, using the current priority of the ongoing work order as the key, find and obtain its corresponding value in the configured priority upgrade mapping, and determine the value as the upgraded priority; Step S5S5S2, construct a work order processing result containing the work order ID of the ongoing work order and the upgraded priority.

11. An event priority sorting and allocation system, characterized in that, A system for implementing the event priority sorting and allocation method according to any one of claims 1-10, comprising: The dialogue sequence module incrementally collects and preprocesses the collected raw multi-turn dialogue streams to obtain a set of structured dialogue sequences. The emotion scoring module, based on a set of structured dialogue sequences and a pre-trained context-aware emotion analysis model, performs context-aware round-by-round emotion scoring to obtain a set of emotion scoring sequences for historical work orders. The model parameter module is based on a set of sentiment rating sequences from historical work orders, a predefined set of hidden states, and a configured hidden Markov model training convergence threshold. Given the maximum number of iterations of the configured Hidden Markov Model (HMM), the Baum-Welch algorithm is used to perform unsupervised training on the HMM to obtain the initial state probability distribution. State transition probability matrix and emission probability distribution ; The scoring threshold module is based on a set of sentiment scoring sequences from historical work orders, collected historical work order result labels, a predefined set of high-risk state definitions, and an initial state probability distribution obtained through training. State transition probability matrix and emission probability distribution Receiver operation characteristic curve analysis is performed to obtain the calibrated risk score threshold; The work order processing module, for each work order in the collected ongoing work order stream, uses a pre-trained context-aware sentiment analysis model and a configured context window size. Initial state probability distribution State transition probability matrix Launch probability distribution A predefined set of high-risk status definitions and calibrated risk scoring thresholds are used to perform real-time sentiment tracking and risk prediction, and all results are aggregated to obtain a set of work order processing results. The priority module updates the priority of the corresponding work orders in the collected original work order records based on the work order processing result set, and obtains the updated work order records.

Citation Information

Patent Citations

  • Large-model complaint intention recognition method based on sentiment analysis

    CN120146056A

  • Enterprise audit risk assessment method and system based on hidden Markov model

    CN120410753A