Hotel living telephone voice classification method and system
By combining multi-level and multi-angle models, the problems of low efficiency and low accuracy in hotel in-stay telephone voice classification are solved, achieving high accuracy and high recall in customer complaint classification, supporting multi-label output, and meeting complex business needs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-17
- Publication Date
- 2026-05-08
AI Technical Summary
Existing hotel in-stay telephone voice classification methods suffer from problems such as low efficiency, low accuracy, high labor costs, inability to meet real-time requirements, inconsistent classification standards, and weak multi-label classification capabilities, leading to increased customer complaint management costs and extended service cycles.
It employs multi-level and multi-angle model joint processing, including speech transcription, text segmentation, sentence-level and whole-sentence-level classification, combined with rule engine arbitration. It uses models such as LSTM, DeepSpeech, BERT, and CRF for speech transcription and text segmentation, and utilizes knowledge base and large language model for multi-label output and rule design to achieve high accuracy and high recall in customer complaint classification.
It achieves high accuracy and high recall in customer complaint classification, reduces false positive rate, expands the application scenarios of customer complaint classification, improves the generalization ability of the model, supports multi-label output, and meets complex business needs.
Smart Images

Figure CN121996795A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of hotel customer complaint handling technology, and in particular to a method and system for classifying telephone voice messages during hotel stays. Background Technology
[0002] With the development of the hotel service industry, the efficiency and quality of customer telephone voice feedback processing directly affect customer satisfaction and loyalty. In the process of hotel operation and management, in response to the massive amount of customer communication data, the traditional customer complaint classification method mainly relies on manual processing. This classification model has the following significant defects: (1) The efficiency of manual processing is low, especially in meeting the real-time requirements during peak periods (such as holidays and large conferences), and the average response time is long; (2) The subjectivity of manual judgment is strong, resulting in inconsistent classification standards, and the probability of similar customer complaints being classified into different categories is very high; (3) The labor cost is high, accounting for a large proportion of the total expenditure on customer complaint management, and it is difficult to provide 24-hour service coverage, resulting in operational bottlenecks.
[0003] While some existing technologies employ automatic speech classification methods based on single models, they often suffer from the following drawbacks: (1) insufficient understanding of complex contexts, resulting in low classification accuracy; (2) lack of semantic ambiguity handling mechanisms, leading to the misclassification of complaints with conflicting meanings; (3) weak multi-label classification capabilities, failing to accurately identify complex feedback containing multiple demands; and (4) limited model generalization ability, resulting in unsatisfactory recall. These technical deficiencies directly lead to a large number of customer complaints being misclassified, necessitating secondary processing, which increases management costs and extends service cycles. Summary of the Invention
[0004] In view of the above-mentioned shortcomings of the current technology, the present invention provides a method for classifying telephone voice messages during hotel stays. Through multi-level and multi-angle model joint processing, it achieves high accuracy and high recall in customer complaint classification, meeting complex business needs.
[0005] To achieve the above objectives, the embodiments of the present invention adopt the following technical solutions:
[0006] A method for classifying hotel in-stay telephone voice messages includes the following steps:
[0007] Get the hotel's recorded phone calls during your stay;
[0008] Based on the speech-to-text model, the voice of the hotel stay telephone call is transcribed into the customer complaint text;
[0009] Based on the text segmentation model, the customer complaint text is segmented into sentences;
[0010] Based on sentence-level classification model and whole-sentence classification model, customer complaint texts are classified to obtain multiple customer complaint classification results;
[0011] We use a weighted voting system to evaluate various customer complaint classification results and then arbitrate based on a rule engine to obtain optimized customer complaint classification results.
[0012] According to one aspect of the present invention, the speech transcription model includes LSTM, DeepSpeech, or Conformer.
[0013] According to one aspect of the present invention, the text segmentation model includes: CRF, BiLSTM-CRF, or Bert.
[0014] According to one aspect of the present invention, the text segmentation model includes:
[0015] The input layer performs bidirectional context modeling on each character in the input text based on the BERT model, generating character-level context embeddings.
[0016] The intermediate layer processes character-level context embeddings based on the lattice structure flattening and self-attention mechanism of the Flat-Lattice Transformer model, generating enhanced embeddings that integrate lexical information.
[0017] The output layer generates text segmentation results based on the CRF model, using character-level context embeddings and enhanced embeddings that incorporate lexical information.
[0018] According to one aspect of the present invention, the hotel stay telephone voice classification method further includes:
[0019] The customer complaint text is segmented into sub-words using a word segmenter.
[0020] According to one aspect of the invention, the word segmenter includes: BiLSTM-CRF, Bert, or Tokenizer.
[0021] According to one aspect of the present invention, the sentence-level classification model includes:
[0022] The input processing layer processes the input text based on the pre-trained BERT model, generating a hidden state sequence rich in contextual information.
[0023] The classification layer generates classification results based on the hidden state sequence rich in contextual information and using a Softmax classifier.
[0024] According to one aspect of the present invention, the hotel stay telephone voice classification method further includes:
[0025] Build a knowledge base by slicing historical documents into vectors and storing them in the knowledge base;
[0026] The customer complaint text is vectorized, and the most relevant definitions, rules and examples are retrieved from the knowledge base to construct prompt words and design a prompt.
[0027] According to one aspect of the present invention, the step of weighting and voting on multiple customer complaint classification results and arbitrating based on a rule engine to obtain optimized customer complaint classification results includes:
[0028] Multiple sentence-level classification results and corresponding confidence scores are obtained, and aggregated or weighted to obtain the first customer complaint classification result and corresponding confidence scores.
[0029] Multiple sentence-level classification results and corresponding confidence scores are obtained, and then aggregated or weighted to obtain the second customer complaint classification results and corresponding confidence scores.
[0030] Based on the first customer complaint classification and its corresponding confidence level, and the second customer complaint classification and its corresponding confidence level, arbitration is conducted using a rule engine to obtain optimized customer complaint classification results.
[0031] A hotel in-stay telephone voice classification system, based on the hotel in-stay telephone voice classification method described above, includes:
[0032] The data acquisition module is used to acquire voice recordings from phone calls made during hotel stays.
[0033] The transcription module is used to transcribe hotel phone calls into customer complaint text based on a speech transcription model.
[0034] The sentence segmentation module is used to segment customer complaint texts into sentences based on a text sentence segmentation model;
[0035] The classification module is used to classify customer complaint texts based on sentence-fragment level classification models and whole sentence level classification models, and obtain various customer complaint classification results;
[0036] The arbitration module is used to perform weighted voting on multiple customer complaint classification results, and to conduct arbitration based on the rule engine to obtain optimized customer complaint classification results.
[0037] Advantages of implementing this invention:
[0038] This invention provides a method for classifying customer complaint voice messages during hotel stays. Through multi-level and multi-angle model joint processing, it achieves high accuracy and high recall in customer complaint classification. By collaborating with sentence-level and whole-sentence-level models, it optimizes the accuracy of customer complaint judgment and reduces false positives. It achieves multi-level customer complaint classification, expanding the application scenarios of customer complaint classification. Compared to a single model, it significantly improves classification performance and enhances the model's generalization ability. It supports customer complaint segmentation and multi-label output to meet complex business needs. Attached Figure Description
[0039] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0040] Figure 1 This is a flowchart of a hotel in-stay telephone voice classification method according to the present invention. Detailed Implementation
[0041] 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.
[0042] Example 1
[0043] like Figure 1 As shown, a method for classifying hotel room phone calls includes the following steps:
[0044] S1: Get the hotel's voice call during your stay.
[0045] Hotels can use the hotel management system's automatic recording function to retain service records when providing services such as answering inquiries and handling complaints, thereby obtaining the telephone voice data of guests during their stay.
[0046] S2: Based on the speech-to-text model, the voice of a hotel stay call is transcribed into a customer complaint text.
[0047] Specifically, speech-to-text models can employ end-to-end deep learning models. For example, LSTM (Long Short-Term Memory) networks effectively capture long-range dependencies in speech signals through gating mechanisms (input gate, forget gate, output gate); CTC (Connectionist Temporal Classification) models directly model the mapping from speech to text without explicit alignment, making them suitable for streaming recognition; Transducer models, combined with encoder-decoder architectures, support real-time, low-latency output; Whisper and Conformer models, based on the Transformer architecture, capture long-range dependencies through self-attention mechanisms, and so on.
[0048] In practice, first prepare the datasets corresponding to the speech and text, build a deep learning model for training, and obtain a trained speech-to-text model for speech-to-text tasks.
[0049] In practical applications, existing open-source or commercial models can be directly adopted to reduce development costs. For example, open-source models include: Whisper (OpenAI), based on the Transformer architecture, which offers strong multi-language support, robust noise resistance, and a low error rate (approaching commercial levels), supporting language recognition and timestamps; DeepSpeech (Mozilla), based on convolutional and RNN architectures, supporting multi-language and real-time recognition; and Wav2Vec (Meta), employing self-supervised learning, covering 40 languages, and supporting training on unlabeled data, etc. Commercial models include: Google's CloudSpeech-to-Text model, supporting multiple languages, enabling real-time streaming recognition, supporting automatic punctuation and formatting, and offering high accuracy and low latency; Amazon's AWS Transcribe model, supporting real-time and batch transcription; and Microsoft's Azure Speech model, supporting multiple languages and real-time and batch transcription, etc.
[0050] S3: Based on the text segmentation model, the customer complaint text is segmented into sentences.
[0051] Specifically, text segmentation models include: statistical machine learning models, which use labeled data to train classification models and determine whether each possible position in the text is a sentence boundary, such as Hidden Markov Model (HMM), Maximum Entropy Model (MaxEnt), Conditional Random Field (CRF), etc.; and deep learning models, which use neural networks to automatically learn text features and determine sentence boundaries, such as BiLSTM-CRF, Transformer, pre-trained language models (Bert, Roberta), etc.
[0052] In practice, first prepare a dataset of text sentences, build a machine learning or deep learning model for training, obtain a trained text sentence segmentation model, and then use the trained text sentence segmentation model to segment the customer complaint text.
[0053] In practical applications, existing open-source or commercial models can be directly adopted to reduce development costs. For example, open-source models can include SeqModel (open-sourced by Alibaba), Cross-Segment BERT (based on Cross SegmentAttention), text-splitter (a Rust / Python library), and so on. Commercial models can include nlp_bert_document-segmentation_chinese-base from DAMO Academy, RecursiveCharacterTextSplitter from the LangChain framework, and so on.
[0054] Finally, obtain the list of sentences [S1, S2, S3, ...] for the text segmentation.
[0055] S4: Based on sentence-level classification model and whole-sentence classification model, customer complaint texts are classified to obtain multiple customer complaint classification results.
[0056] This method employs a multi-model customer complaint classification fusion strategy, utilizing sentence-level and whole-sentence-level models to obtain various customer complaint classification results. It can perform customer complaint segmentation and multi-label output to meet the needs of complex business operations.
[0057] 1. Sentence-level classification model
[0058] Before performing sentence-by-sentence classification on customer complaint texts, preprocessing is required:
[0059] (1) Text cleaning: Remove irrelevant characters, HTML tags, etc. from the text.
[0060] (2) Word segmentation: Using a word segmenter, the customer complaint text is segmented into tokens (sub-words) to obtain a list of sentence fragments [F1, F2, F3, ...].
[0061] Specifically, word segmenters include: rule-based word segmenters, which segment according to a preset dictionary (such as the Chinese word segmentation tool jieba) and perform pattern matching and splitting using regular expressions; statistical word segmenters, which train probabilistic models using labeled data and perform word segmentation using statistical language features (such as word frequency and co-occurrence probability), such as Hidden Markov Models and N-gram Models; and deep learning-based word segmenters, which automatically learn text features using neural networks and achieve word segmentation through sequence labeling or sub-word segmentation, such as BiLSTM-CRF, BPE (Byte Pair Encoding), and WordPiece.
[0062] In practice, if a rule-based segmenter is used, the dictionary or regular expression is first set up according to the segmentation rules, and then the customer complaint text is segmented. If a statistical segmenter or a deep learning-based segmenter is used, a dataset for text segmentation is first prepared, a probability model or deep learning model is built for training, a trained segmenter is obtained, and then the trained segmenter is used to segment the customer complaint text.
[0063] In practical applications, existing open-source models or commercial models can also be directly adopted to reduce development costs. For example, open-source models can include: Jieba (a Chinese word segmentation component widely used in Python); ICTCLAS, developed by the Institute of Computing Technology of the Chinese Academy of Sciences, which is a Chinese lexical analysis system widely used in the field of Chinese information processing; HuggingFace Transformers, which provides pre-trained tokenizers (such as the Tokenizers of Bert and GPT), and so on. Commercial models can include: NLPIR Chinese Word Segmentation System (ICTCLAS 2013), the commercial version of ICTCLAS; Massive Chinese Intelligent Word Segmentation, developed by Massive Company, which provides Chinese word segmentation services with high accuracy and high performance, and so on.
[0064] Preferably, the tokenizer can also use a sliding window to slice the text, which is simple and easy to implement.
[0065] (3)Normalization: When the text sentence exceeds the maximum length (e.g., 512), it is truncated; when the text is less than the maximum length, PAD filling is performed (e.g., filling with 0).
[0066] When preprocessing the customer complaint text, special tokens need to be added:
[0067] [CLS]: Added at the beginning of the sentence, and its corresponding output vector is usually used for classification tasks.
[0068] [SEP]: Added at the end of the sentence or between sentences to distinguish different sentences.
[0069] Finally, generate a tensor for the customer complaint text:
[0070] Input IDs: The vocabulary ID corresponding to the Token.
[0071] Attention Mask: Distinguish real Tokens (1) and padding Tokens (0).
[0072] Token Type IDs (Segment IDs): Distinguish sentence A and sentence B (for single-sentence classification, usually all 0).
[0073] Specifically, for the sentence slice-level classification model, a deep learning-based model can be adopted, such as n-gram, LSTM (Long Short-Term Memory Network), BiLSTM (Bidirectional LSTM), Transformer, etc. In specific implementation, first prepare a dataset of text sentence slices and corresponding categories, construct a deep learning model for training to obtain a trained classification model, and then use the trained classification model to classify the customer complaint text slices to obtain classification results and corresponding probability values (as the confidence level in step S5).
[0074] Preferably, binary, triadic, and multi-classification models can be constructed to classify customer complaint text segments at multiple levels. For example, a binary classification model categorizes segments into complaints and non-complaints; a triadic model categorizes segments into complaints, customer needs, and inquiries; and a multi-classification model categorizes segments into complaints, customer needs, inquiries, praise, suggestions, claims, and technical support.
[0075] In practical applications, a binary classification model can be used first to preliminarily determine whether a sentence fragment in a customer complaint text belongs to a complaint; then a three-class or multi-class classification model can be used to further subdivide the sentence fragments that have been determined to be complaints or not.
[0076] Preferably, this method can also employ a BERT-based sentence-fragment classification model, comprising a two-layer structure:
[0077] (1) Input processing layer: Based on the pre-trained BERT model, the input text is processed to generate a hidden state sequence rich in contextual information.
[0078] The input IDs are converted into vectors; through the Transformer Encoder, multi-layer self-attention mechanism and feedforward neural network, a sequence of hidden states rich in contextual information is generated.
[0079] Extract the final hidden state (a 768-dimensional vector for Bert_base) corresponding to the special token [CLS], and treat it as a "semantic summary" of the entire input sequence.
[0080] (2) Classification layer: Based on the hidden state sequence rich in contextual information, the classification result is generated by the Softmax classifier.
[0081] Using a fully connected layer, the dimensions (768-dimensional) of the [CLS] vector are mapped to the number of categories in the classification. For example, binary classification: complaints, non-complaints; tri-class classification: complaints, customer needs, inquiries; multi-class classification: complaints, customer needs, inquiries, praise, suggestions, claims, technical support, etc.
[0082] Using a Softmax classifier, the output scores are converted into a probability distribution, where the sum of the probabilities of all classes is 1. The probability value corresponding to each class is used as the confidence level in step S5.
[0083] 2. Sentence-level classification model
[0084] Specifically, sentence-level classification models can employ deep learning-based models, such as n-grams, LSTM (Long Short-Term Memory), BiLSTM (Bidirectional LSTM), and Transformer. In practice, first prepare datasets containing complete text sentences and their corresponding categories and labels. Then, construct a deep learning model for training to obtain a trained classification model. Finally, use this trained model to classify the complete customer complaint text sentences, obtaining the classification results and corresponding probability values (which serve as the confidence level in step S5).
[0085] Preferably, models such as whole-sentence classification (binary, tri-classification, multi-classification, etc.), whole-sentence state multi-classification, and whole-sentence classification combined with multi-labels (whether whole-sentence binary classification with multi-labels or whole-sentence multi-classification with multi-labels) can be constructed to classify whole sentences in customer complaint texts at multiple levels. For example, the whole-sentence binary classification model classifies whole sentences into complaints and non-complaints; the whole-sentence state multi-classification classifies whole sentences into complaints, customer needs, inquiries, business opportunities, and others; the whole-sentence binary classification combined with multi-labels model classifies whole sentences into complaints and non-complaints, while providing sub-category labels such as criticism, claims, customer needs, and inquiries.
[0086] In practical applications, we can first use a combined model of whole sentence classification and multi-label classification to perform semantic classification and multi-label classification on whole sentences and output the results together; then use a whole sentence binary classification model to further optimize the accuracy of customer complaint identification and reduce false alarms; finally, we can also use a whole sentence state multi-classification model to identify the dialogue state, including customer complaints, customer needs, inquiries, business opportunities and others.
[0087] Preferably, the joint model for sentence classification and multi-labeling can also employ a fusion model that combines a knowledge base, retrieval enhancement prompts, and a large language model to predict speech type and multi-labeling. The specific implementation method is as follows:
[0088] (1) Knowledge base construction
[0089] Historical documents can be obtained from various data sources of the hotel, such as: historical work orders and solutions, including categorized customer complaints, inquiries and other cases; product manuals and rule documents, which clearly define product functions, terms of service, etc.; labeling guidelines and classification definitions, which clearly record detailed definitions, distinction boundaries and typical cases of complaint, customer needs, inquiries, business opportunities and other types; and typical example library, including typical dialogue fragments with various tag combinations.
[0090] Build a knowledge base by slicing historical documents into vectors and storing them in the knowledge base.
[0091] (2) Search and prompt keyword construction
[0092] The customer complaint text is vectorized, and the most relevant definitions, rules, and examples are retrieved from the knowledge base to construct enhanced prompt words for prompt design. Prompt design refers to guiding the model to generate expected output through carefully designed input instructions.
[0093] (3) Output of large language model
[0094] Large language models receive pre-constructed enhanced prompts and leverage their powerful understanding and reasoning capabilities to make judgments based on user input and retrieved knowledge. Specific large language models include: the GPT series (OpenAI), the LLaMA series (Meta), the Gemini series (Google DeepMind), and the Qwen3 series (Alibaba Cloud). In practical applications, the base model can be the lightweight, high-performance large language model qwen3-8b from Alibaba Cloud's Tongyi Qianwen team, which belongs to the Qwen3 series.
[0095] To obtain structured output results using a large language model, we can require the model to output in strict JSON format, which can then be parsed to obtain:
[0096] speech_type: Voice type / main category (e.g., "complaint").
[0097] Tags: A list of multiple tags (e.g., "Front desk service attitude", "Cleaning service professionalism").
[0098] confidence: the confidence level of the model itself.
[0099] Reasoning: Explainability, the model provides reasons for its judgments, which facilitates human review and trust building.
[0100] Compared with traditional classification models, the above fusion model has the following advantages:
[0101] (1) Highly flexible: When adding new categories or modifying definitions, only the knowledge base document needs to be updated, without retraining the model.
[0102] (2) High data utilization: A large number of unstructured documents (such as historical work orders and Wikis) can be used as knowledge sources.
[0103] (3) High interpretability: The answer comes with its own "reasoning basis" and can be traced back to the source of the retrieval, which solves the problem of the "black box" of the traditional model.
[0104] (4) Joint modeling: It naturally unifies the main classification and multi-label tasks into a single framework, and the large language model can understand the intrinsic relationship between them.
[0105] (5) Capable of handling complex cases: For complex cases that are ambiguous, ambiguous, or require comprehensive knowledge, the reasoning ability of large language models far exceeds that of traditional classifiers.
[0106] (6) Joint learning can improve the generalization ability of the model.
[0107] S5: Weighted voting is performed on multiple customer complaint classification results, and arbitration is conducted based on the rule engine to obtain optimized customer complaint classification results.
[0108] For example, in practical applications, step S4 uses sentence fragment binary classification, sentence fragment tri-classification, whole sentence classification and multi-label combination, whole sentence binary classification, and whole sentence state multi-classification models to classify customer complaint text sentence fragments or whole sentences in various ways, and obtains specific classification results, as shown in Table 2.
[0109] Model Output Confidence definition M1: Sentence Piece Classification {is_complaint: True / False} After applying Softmax, the probability value P_binary for the corresponding class M2: Three-category classification of sentence fragments {category: A / B / C} After applying Softmax, the probability value P_category for the corresponding category M3: Sentence Classification and Multi-Tag Integration {is_complaint: True / False,labels:[tag1, tag2, ...]} The binary classification part uses the Sigmoid function to output P_joint_binary, while the multi-label part uses the Sigmoid function output for each label. M4: Sentence-based binary classification {is_complaint: True / False} Use Sigmoid to output P_sentence_binary M5: Multiple Classifications of Sentence Status {state: Complaints / Customer Needs / Inquiries / Business Opportunities / Others} After using Softmax, the "Complaints" category
[0110] Table 2 Examples of various classification models
[0111] Specifically, step S5 includes:
[0112] S51: Obtain the various sentence-level classification results and corresponding confidence scores from step S4, and aggregate or weight them to obtain the first customer complaint classification result and corresponding confidence scores.
[0113] For multiple sentence-level classification results, the results can be directly aggregated. For the same sentence, if the classification results are the same, their confidence scores are averaged or weighted and summed. If the classification results are different, the classification result with higher confidence score is adopted. If the classification results are inclusive, the more detailed classification results are adopted.
[0114] For example, if we use the M1 sentence-based binary classification model (classifying sentences as complaints and non-complaints) and the M2 sentence-based triadic classification model (classifying sentences as complaints, customer needs, and inquiries), and input a sentence into both models, then the classification results are aggregated. If the sentence-based binary classification model results in (complaint, confidence 0.7) and the sentence-based triadic classification model results in (complaint, confidence 0.8), then the aggregated classification result for that sentence is (complaint, confidence 0.75), where the confidence level is the average of the confidence levels of the two classification results. If the sentence-based binary classification model results in (complaint, confidence 0.55) and the sentence-based triadic classification model results in (customer needs, confidence 0.7), then the aggregated classification result for that sentence is (customer needs, confidence 0.7). If the classification result of the sentence fragment binary classification model is (non-complaint, confidence 0.76) and the classification result of the sentence fragment tri-class classification model is (consultation, confidence 0.72), then the classification result of the aggregated sentence fragment is (consultation, confidence 0.72).
[0115] Furthermore, due to the impact of model calculations, the confidence scores of multi-class classification models may generally be lower than those of binary and tri-class classification models, and the confidence scores of tri-class classification models may generally be lower than those of binary classification models. Therefore, weighted processing of the confidence scores can be applied to obtain more accurate classification results. For example, if a sentence-fragment binary classification model or a sentence-fragment tri-class classification model is used, the confidence score of the tri-class classification model can be multiplied by a weight of 1.4.
[0116] Preferably, different sentence-level classification models can be used to classify customer complaint text sentences sequentially, first performing binary classification, and then, based on the results of the binary classification, performing tertiary or multi-class classification. For example, for the two sentence-level classification models exemplified in Table 2, the following aggregation method can be used:
[0117] (1) For each sentence fragment Fi, input the M1 sentence fragment binary classification model.
[0118] If M1(Fi).is_complaint==True and its confidence level P_binary>threshold θ1 (for example, it can be set to 0.6), then the sentence is considered valid evidence of customer complaint.
[0119] (2) Input the effective sentence fragment into the M2 sentence fragment three-classification model to obtain the sub-classes Ci (A / B / C) and their confidence scores P_category.
[0120] After traversing all sentence fragments, the first customer complaint classification result and the corresponding confidence level are obtained: Evidence = [(C1, P_c1), (C2, P_c2), ...].
[0121] S52: Obtain the various sentence-level classification results and corresponding confidence scores from step S4, and aggregate or weight them to obtain the second customer complaint classification results and corresponding confidence scores.
[0122] For multiple sentence-level classification results, the results can be directly aggregated. For the same sentence fragment, if the classification results are the same, the confidence scores are averaged or weighted and summed. If the classification results are different, the classification result with higher confidence is adopted. If the classification results are inclusive, the subdivided classification results are adopted.
[0123] For example, if we use the M3 whole-sentence classification and multi-label joint model, the M4 whole-sentence binary classification model, and the M5 whole-sentence state multi-classification model, and input a whole sentence into the three models, then aggregate the classification results. If the whole-sentence binary classification model results in (complaint, confidence 0.74), the whole-sentence classification and multi-label joint model results in [(complaint, confidence 0.8), (claim, 0.85)], and the whole-sentence state multi-classification model results in (complaint, confidence 0.75), then the aggregated classification result for the whole sentence is (complaint, confidence 0.76), where the confidence level is the average of the confidence levels of the three classification results.
[0124] Preferably, a weighted summation method can also be used to calculate the confidence score after aggregation of classification results. For example, the confidence score of the entire sentence is: Score_sentence = α * P_joint_binary + β * P_sentence_binary + γ * P_state_complaint, where α + β + γ = 1, representing adjustable weights. Initially, the weights can be set to (0.5, 0.3, 0.2), because M3 and M4 are models specializing in customer complaints and have higher weights. The weight of M3 can also be flexibly determined based on the performance of the large language model, or the optimal weight coefficients can be trained based on real labeled data.
[0125] S53: Based on the first customer complaint classification and its corresponding confidence level, and the second customer complaint classification and its corresponding confidence level, arbitration is conducted using the rule engine to obtain optimized customer complaint classification results.
[0126] In practical applications, a rule engine can be built by setting comprehensive processing rules for the two classification results based on model performance and actual needs to optimize the classification results. For example, the classification result with higher confidence can be used; classification results with confidence below a certain threshold can be discarded; the two classification results can be combined and weighted, and so on.
[0127] For example, the rules engine can be set to the following modes:
[0128] (1) Case 1: There is no evidence of sentence fragments and the confidence level of the whole sentence is low (strict mode).
[0129] Conditions: The first customer complaint classification result and the corresponding confidence score (Evidence) are empty, and the confidence score (Score_sentence) of the second customer complaint classification result is less than the threshold (T1) (T1 is high, for example, 0.7).
[0130] Verdict: Final, not a complaint.
[0131] Judgment logic: The finest-grained sentence fragment model found no points of complaint, and the whole sentence model also held a negative attitude, so it was determined to be negative.
[0132] (2) Scenario 2: There is evidence of a sentence fragment or the confidence level of the whole sentence is very high (recall mode).
[0133] Condition: Evidence is not empty, or Score_sentence > threshold T2 (T2 is very high, such as 0.9).
[0134] Verdict: Ultimately, it was a complaint.
[0135] Sub-categories determined:
[0136] If Evidence is not empty, the category with the most data in the statistical evidence set is taken as the final customer complaint type (votes can be weighted by confidence level).
[0137] If Evidence is empty (triggered only by high whole sentence confidence), the complaint type is marked as Unknown or the most likely type is inferred from the output of M3 / M5.
[0138] Judgment logic: As long as customer complaint evidence is found at a fine-grained level, or the whole sentence model is very certain, we consider it a complaint.
[0139] (3) Scenario 3: Conflict situation (no evidence for the sentence fragments but a certain degree of confidence for the whole sentence).
[0140] Condition: Evidence is empty, but Score_sentence >= T1.
[0141] Verdict: Tends to a loss, but logs will be kept for review.
[0142] Judgment logic: This situation may be due to the whole sentence model learning some implicit patterns that the sentence fragment model did not capture, or it may be a misjudgment. To ensure accuracy, we prioritize the sentence fragment evidence, but record this situation as a "suspicious sample" for subsequent model optimization.
[0143] (4) Final output
[0144] final_is_complaint: True / False (determined by the arbitration engine)
[0145] final_category: A / B / C / Unknown (determined by the arbitration engine)
[0146] final_tags: Taken from the multi-tag output of M3.
[0147] final_state: Taken from the state output of M5.
[0148] fusion_confidence: A comprehensive confidence level, for example, when judging it as a complaint, the maximum value of the average sentence confidence level and Score_sentence is taken.
[0149] The above-mentioned rule engine setup method has the following advantages:
[0150] (1) Accuracy priority: Through the dual protection of “sentence fragment evidence + high threshold”, false alarms are greatly reduced.
[0151] (2) No sacrifice of recall: Rule case 2 ensures that recall can be achieved as long as there is clear evidence or the model is very certain.
[0152] (3) High interpretability: The final judgment can be traced back to which sentence fragment was triggered, as well as the confidence level of each model, which facilitates manual review and problem localization.
[0153] (4) Flexible and adjustable: The threshold (θ1, T1, T2) and weight (α, β, γ) can be used as levers to fine-tune between accuracy and recall based on online feedback.
[0154] The beneficial effects of this embodiment are as follows:
[0155] This method achieves high accuracy and high recall in customer complaint classification through multi-level and multi-angle model joint processing; it optimizes the accuracy of customer complaint identification and reduces false positives by collaborating sentence-level and whole-sentence-level models; it realizes multi-level customer complaint classification, expanding the application scenarios of customer complaint classification; compared with a single model, it significantly improves classification performance and enhances the model's generalization ability; it supports customer complaint segmentation and multi-label output to meet complex business needs.
[0156] Example 2
[0157] like Figure 1 As shown, a method for classifying hotel room phone calls includes the following steps:
[0158] S1: Get the hotel's voice call during your stay.
[0159] Hotels can use the hotel management system's automatic recording function to retain service records when providing services such as answering inquiries and handling complaints, thereby obtaining the telephone voice data of guests during their stay.
[0160] S2: Based on the speech-to-text model, the voice of a hotel stay call is transcribed into a customer complaint text.
[0161] Specifically, speech-to-text models can employ end-to-end deep learning models. For example, LSTM (Long Short-Term Memory) networks effectively capture long-range dependencies in speech signals through gating mechanisms (input gate, forget gate, output gate); CTC (Connectionist Temporal Classification) models directly model the mapping from speech to text without explicit alignment, making them suitable for streaming recognition; Transducer models, combined with encoder-decoder architectures, support real-time, low-latency output; Whisper and Conformer models, based on the Transformer architecture, capture long-range dependencies through self-attention mechanisms, and so on.
[0162] In practice, first prepare the datasets corresponding to the speech and text, build a deep learning model for training, and obtain a trained speech-to-text model for speech-to-text tasks.
[0163] In practical applications, existing open-source or commercial models can be directly adopted to reduce development costs. For example, open-source models include: Whisper (OpenAI), based on the Transformer architecture, which offers strong multi-language support, robust noise resistance, and a low error rate (approaching commercial levels), supporting language recognition and timestamps; DeepSpeech (Mozilla), based on convolutional and RNN architectures, supporting multi-language and real-time recognition; and Wav2Vec (Meta), employing self-supervised learning, covering 40 languages, and supporting training on unlabeled data, etc. Commercial models include: Google's CloudSpeech-to-Text model, supporting multiple languages, enabling real-time streaming recognition, supporting automatic punctuation and formatting, and offering high accuracy and low latency; Amazon's AWS Transcribe model, supporting real-time and batch transcription; and Microsoft's Azure Speech model, supporting multiple languages and real-time and batch transcription, etc.
[0164] S3: Based on the text segmentation model, the customer complaint text is segmented into sentences.
[0165] Specifically, text segmentation models include: statistical machine learning models, which use labeled data to train classification models and determine whether each possible position in the text is a sentence boundary, such as Hidden Markov Model (HMM), Maximum Entropy Model (MaxEnt), Conditional Random Field (CRF), etc.; and deep learning models, which use neural networks to automatically learn text features and determine sentence boundaries, such as BiLSTM-CRF, Transformer, pre-trained language models (Bert, Roberta), etc.
[0166] In practice, first prepare a dataset of text sentences, build a machine learning or deep learning model for training, obtain a trained text sentence segmentation model, and then use the trained text sentence segmentation model to segment the customer complaint text.
[0167] In practical applications, existing open-source or commercial models can be directly adopted to reduce development costs. For example, open-source models can include SeqModel (open-sourced by Alibaba), Cross-Segment BERT (based on Cross SegmentAttention), text-splitter (a Rust / Python library), and so on. Commercial models can include nlp_bert_document-segmentation_chinese-base from DAMO Academy, RecursiveCharacterTextSplitter from the LangChain framework, and so on.
[0168] Preferably, this method can also employ an optimized text segmentation model based on the Bert Flat-LatticeTransformer sequence labeling method, comprising a three-layer structure: (1) Bert as a pre-trained input layer, which performs bidirectional context modeling on each character in the input text based on the Bert model to generate character-level context embeddings; (2) Flat-LatticeTransformer as a training intermediate layer, which processes the character-level context embeddings based on the lattice structure flattening and self-attention mechanism of the Flat-Lattice Transformer model to generate enhanced embeddings that integrate lexical information; (3) CRF (Conditional Random Field) as the final output layer, which generates text segmentation results based on the CRF model according to the character-level context embeddings and the enhanced embeddings that integrate lexical information. The specific structure is as follows:
[0169] BERT is trained using a deep bidirectional Transformer encoder representation. This architecture incorporates contextual information from both the left and right sides into each layer, allowing the trained BERT model to be easily transferred to other tasks. The core of BERT lies in its pre-training process. Simply put, the model extracts two sentences from the dataset, where sentence B has a 50% probability of being the next sentence of sentence A. These two sentences are then transformed into the input representation shown above. In the field of entity recognition, the tokens transformed by the BERT model are retained and used as input to a sequence recognition model, enabling transfer learning on top of the BERT model to achieve entity recognition. A commonly used BERT Chinese pre-trained model is Bert_base_chinese, which has 12 layers, 768 hidden state nodes, and 12 self-attention heads. Alternatively, the customer complaint text data provided in this method can be used as the training corpus for BERT to retrain your own Chinese pre-trained model.
[0170] The Flat-Lattice Transformer model adds a Flat-Lattice structure to the Transformer. The Transformer uses fully connected self-attention to model long-range dependencies in a sequence. Flat-Lattice assigns two position indices to a token (character or word): a head position and a tail position. Using these two indices, a grid is reconstructed from a set of tokens. Therefore, the Transformer can be used directly to model the entire grid input.
[0171] The Transformer is trained using labeled data to segment speech text into sentences. This method uses the BE labeling method, where B indicates no segmentation and E indicates segmentation, as shown in Table 1, which provides an example of segmentation.
[0172] sequence morning meal kind kind rich rich taste road good Corresponding tags B B B B B B E B B
[0173] Table 1 Examples of Sentence Segmentation
[0174] The Lattice structure is an effective method for Chinese named entity recognition. The lattice structure can utilize word information to reduce segmentation errors. Specifically, a sentence is matched against a dictionary containing an index dictionary and a thesaurus constructed in the second step, yielding latent words and a Lattice-like structure: considering not only individual characters in the sentence but also the possible word groups formed by each character. A Lattice is a directed acyclic graph, where the start and end characters of a word determine its position. Flat designs a clever positional encoding method to integrate the Lattice structure. For each character and word, two positional codes, head and tail, are constructed, allowing for the reconstruction of the original Lattice structure. Because of this, Flat can directly model the interaction between characters and all matched word information. Therefore, the Lattice structure can be flattened, transforming it from a directed acyclic graph into a planar Flat-Lattice Transformer structure. The Flat-Lattice Transformer employs relative position encoding from XLNet to calculate the attention score, using four relative distances to represent the relationship between two spans xi and xj in the lattice, while also considering the relationship between characters and words.
[0175]
[0176] Where d represents four types of relative distances; head and tail represent the head position code and tail position code, respectively.
[0177] Finally, after passing through the CRF output layer, the model predicts the category of each character. The categories are combined according to the word combination form, which is the result of entity recognition, i.e., the results of each indicator and its value. CRF is an undirected graphical model that, given a set of input random variables, obtains a conditional probability distribution model of another set of output random variables. It can be widely used in sequence labeling. Here, CRF uses the BIO labeling method, where one character corresponds to one label, where B represents the beginning of a word, I represents the middle of a word, and O represents other characters that are not the target indicator value. CRF calculation includes two parts: the emission probability matrix and the transition probability matrix. In the Flat-Lattice Transformer, the output of the Transformer layer is the score of all labels for each word, equivalent to the emission probability value of each word mapped to the label; the transition probability matrix A in CRF... ij Represents tag i Move to tag jThe transition probabilities are given. For the output tag sequence y corresponding to the input sequence X, a score is defined, where each score corresponds to a complete path. The Viterbi algorithm can be used for prediction to find the optimal path, which is the final prediction result of the output sequence.
[0178] Finally, obtain the list of sentences [S1, S2, S3, ...] for the text segmentation.
[0179] S4: Based on sentence-level classification model and whole-sentence classification model, customer complaint texts are classified to obtain multiple customer complaint classification results.
[0180] This method employs a multi-model customer complaint classification fusion strategy, utilizing sentence-level and whole-sentence-level models to obtain various customer complaint classification results. It can perform customer complaint segmentation and multi-label output to meet the needs of complex business operations.
[0181] 1. Sentence-level classification model
[0182] Before performing sentence-by-sentence classification on customer complaint texts, preprocessing is required:
[0183] (1) Text cleaning: Remove irrelevant characters, HTML tags, etc. from the text.
[0184] (2) Word segmentation: Using a word segmenter, the customer complaint text is segmented into tokens (sub-words) to obtain a list of sentence fragments [F1, F2, F3, ...].
[0185] Specifically, word segmenters include: rule-based word segmenters, which segment according to a preset dictionary (such as the Chinese word segmentation tool jieba) and perform pattern matching and splitting using regular expressions; statistical word segmenters, which train probabilistic models using labeled data and perform word segmentation using statistical language features (such as word frequency and co-occurrence probability), such as Hidden Markov Models and N-gram Models; and deep learning-based word segmenters, which automatically learn text features using neural networks and achieve word segmentation through sequence labeling or sub-word segmentation, such as BiLSTM-CRF, BPE (Byte Pair Encoding), and WordPiece.
[0186] In practice, if a rule-based segmenter is used, the dictionary or regular expression is first set up according to the segmentation rules, and then the customer complaint text is segmented. If a statistical segmenter or a deep learning-based segmenter is used, a dataset for text segmentation is first prepared, a probability model or deep learning model is built for training, a trained segmenter is obtained, and then the trained segmenter is used to segment the customer complaint text.
[0187] In practical applications, existing open-source models or commercial models can also be directly adopted to reduce development costs. For example, open-source models can include: Jieba (a Chinese word segmentation component widely used in Python); ICTCLAS, developed by the Institute of Computing Technology, Chinese Academy of Sciences, which is a Chinese lexical analysis system widely used in the field of Chinese information processing; HuggingFace Transformers, which provides pre-trained tokenizers (such as the Tokenizers of Bert and GPT), etc. Commercial models can include: NLPIR Chinese Word Segmentation System (ICTCLAS 2013), a commercial version of ICTCLAS; Massive Chinese Intelligent Word Segmentation, developed by Massive Company, which provides Chinese word segmentation services with high accuracy and high performance, etc.
[0188] Preferably, the tokenizer can also use a sliding window to slice the text, which is simple and easy to implement.
[0189] (3)Normalization: When the text sentence exceeds the maximum length (e.g., 512), it is truncated; when the text is less than the maximum length, PAD filling is performed (e.g., filling with 0).
[0190] When preprocessing the customer complaint text, special tokens need to be added:
[0191] [CLS]: Added at the beginning of the sentence, and its corresponding output vector is usually used for classification tasks.
[0192] [SEP]: Added at the end of the sentence or between sentences to distinguish different sentences.
[0193] Finally, generate a tensor for the customer complaint text:
[0194] Input IDs: The vocabulary ID corresponding to the Token.
[0195] Attention Mask: Distinguish real Tokens (1) and padding Tokens (0).
[0196] Token Type IDs (Segment IDs): Distinguish sentence A and sentence B (for single-sentence classification, usually all 0).
[0197] Specifically, for the sentence slice-level classification model, a deep learning-based model can be adopted, such as n-gram, LSTM (Long Short-Term Memory Network), BiLSTM (Bidirectional LSTM), Transformer, etc. In specific implementation, first prepare a dataset of text sentence slices and corresponding categories, construct a deep learning model for training to obtain a trained classification model, and then use the trained classification model to classify the customer complaint text slices to obtain classification results and corresponding probability values (as the confidence level in step S5).
[0198] Preferably, binary, triadic, and multi-classification models can be constructed to classify customer complaint text segments at multiple levels. For example, a binary classification model categorizes segments into complaints and non-complaints; a triadic model categorizes segments into complaints, customer needs, and inquiries; and a multi-classification model categorizes segments into complaints, customer needs, inquiries, praise, suggestions, claims, and technical support.
[0199] In practical applications, a binary classification model can be used first to preliminarily determine whether a sentence fragment in a customer complaint text belongs to a complaint; then a three-class or multi-class classification model can be used to further subdivide the sentence fragments that have been determined to be complaints or not.
[0200] Preferably, this method can also employ a BERT-based sentence-fragment classification model, comprising a two-layer structure:
[0201] (1) Input processing layer: Based on the pre-trained BERT model, the input text is processed to generate a hidden state sequence rich in contextual information.
[0202] The input IDs are converted into vectors; through the Transformer Encoder, multi-layer self-attention mechanism and feedforward neural network, a sequence of hidden states rich in contextual information is generated.
[0203] Extract the final hidden state (a 768-dimensional vector for Bert_base) corresponding to the special token [CLS], and treat it as a "semantic summary" of the entire input sequence.
[0204] (2) Classification layer: Based on the hidden state sequence rich in contextual information, the classification result is generated by the Softmax classifier.
[0205] Using a fully connected layer, the dimensions (768-dimensional) of the [CLS] vector are mapped to the number of categories in the classification. For example, binary classification: complaints, non-complaints; tri-class classification: complaints, customer needs, inquiries; multi-class classification: complaints, customer needs, inquiries, praise, suggestions, claims, technical support, etc.
[0206] Using a Softmax classifier, the output scores are converted into a probability distribution, where the sum of the probabilities of all classes is 1. The probability value corresponding to each class is used as the confidence level in step S5.
[0207] 2. Sentence-level classification model
[0208] Specifically, sentence-level classification models can employ deep learning-based models, such as n-grams, LSTM (Long Short-Term Memory), BiLSTM (Bidirectional LSTM), and Transformer. In practice, first prepare datasets containing complete text sentences and their corresponding categories and labels. Then, construct a deep learning model for training to obtain a trained classification model. Finally, use this trained model to classify the complete customer complaint text sentences, obtaining the classification results and corresponding probability values (which serve as the confidence level in step S5).
[0209] Preferably, models such as whole-sentence classification (binary, tri-classification, multi-classification, etc.), whole-sentence state multi-classification, and whole-sentence classification combined with multi-labels (whether whole-sentence binary classification with multi-labels or whole-sentence multi-classification with multi-labels) can be constructed to classify whole sentences in customer complaint texts at multiple levels. For example, the whole-sentence binary classification model classifies whole sentences into complaints and non-complaints; the whole-sentence state multi-classification classifies whole sentences into complaints, customer needs, inquiries, business opportunities, and others; the whole-sentence binary classification combined with multi-labels model classifies whole sentences into complaints and non-complaints, while providing sub-category labels such as criticism, claims, customer needs, and inquiries.
[0210] In practical applications, we can first use a combined model of whole sentence classification and multi-label classification to perform semantic classification and multi-label classification on whole sentences and output the results together; then use a whole sentence binary classification model to further optimize the accuracy of customer complaint identification and reduce false alarms; finally, we can also use a whole sentence state multi-classification model to identify the dialogue state, including customer complaints, customer needs, inquiries, business opportunities and others.
[0211] Preferably, the joint model for sentence classification and multi-labeling can also employ a fusion model that combines a knowledge base, retrieval enhancement prompts, and a large language model to predict speech type and multi-labeling. The specific implementation method is as follows:
[0212] (1) Knowledge base construction
[0213] Historical documents can be obtained from various data sources of the hotel, such as: historical work orders and solutions, including categorized customer complaints, inquiries and other cases; product manuals and rule documents, which clearly define product functions, terms of service, etc.; labeling guidelines and classification definitions, which clearly record detailed definitions, distinction boundaries and typical cases of complaint, customer needs, inquiries, business opportunities and other types; and typical example library, including typical dialogue fragments with various tag combinations.
[0214] Build a knowledge base by slicing historical documents into vectors and storing them in the knowledge base.
[0215] (2) Search and prompt keyword construction
[0216] The customer complaint text is vectorized, and the most relevant definitions, rules, and examples are retrieved from the knowledge base to construct enhanced prompt words for prompt design. Prompt design refers to guiding the model to generate expected output through carefully designed input instructions.
[0217] (3) Output of large language model
[0218] Large language models receive pre-constructed enhanced prompts and leverage their powerful understanding and reasoning capabilities to make judgments based on user input and retrieved knowledge. Specific large language models include: the GPT series (OpenAI), the LLaMA series (Meta), the Gemini series (Google DeepMind), and the Qwen3 series (Alibaba Cloud). In practical applications, the base model can be the lightweight, high-performance large language model qwen3-8b from Alibaba Cloud's Tongyi Qianwen team, which belongs to the Qwen3 series.
[0219] To obtain structured output results using a large language model, we can require the model to output in strict JSON format, which can then be parsed to obtain:
[0220] speech_type: Voice type / main category (e.g., "complaint").
[0221] Tags: A list of multiple tags (e.g., "Front desk service attitude", "Cleaning service professionalism").
[0222] confidence: the confidence level of the model itself.
[0223] Reasoning: Explainability, the model provides reasons for its judgments, which facilitates human review and trust building.
[0224] Compared with traditional classification models, the above fusion model has the following advantages:
[0225] (1) Highly flexible: When adding new categories or modifying definitions, only the knowledge base document needs to be updated, without retraining the model.
[0226] (2) High data utilization: A large number of unstructured documents (such as historical work orders and Wikis) can be used as knowledge sources.
[0227] (3) High interpretability: The answer comes with its own "reasoning basis" and can be traced back to the source of the retrieval, which solves the problem of the "black box" of the traditional model.
[0228] (4) Joint modeling: It naturally unifies the main classification and multi-label tasks into a single framework, and the large language model can understand the intrinsic relationship between them.
[0229] (5) Capable of handling complex cases: For complex cases that are ambiguous, ambiguous, or require comprehensive knowledge, the reasoning ability of large language models far exceeds that of traditional classifiers.
[0230] (6) Joint learning can improve the generalization ability of the model.
[0231] S5: Weighted voting is performed on multiple customer complaint classification results, and arbitration is conducted based on the rule engine to obtain optimized customer complaint classification results.
[0232] For example, in practical applications, step S4 uses sentence fragment binary classification, sentence fragment tri-classification, whole sentence classification and multi-label combination, whole sentence binary classification, and whole sentence state multi-classification models to classify customer complaint text sentence fragments or whole sentences in various ways, and obtains specific classification results, as shown in Table 2.
[0233] Model Output Confidence definition M1: Sentence Piece Classification {is_complaint: True / False} After applying Softmax, the probability value P_binary for the corresponding class M2: Sentence Phrase Classification {category: A / B / C} After applying Softmax, the probability value P_category for the corresponding category M3: Sentence Classification and Multi-Tag Integration {is_complaint: True / False,labels:[tag1, tag2, ...]} The binary classification part uses the Sigmoid function to output P_joint_binary, while the multi-label part uses the Sigmoid function output for each label. M4: Sentence-based binary classification {is_complaint: True / False} Use Sigmoid to output P_sentence_binary M5: Multiple Classifications of Sentence Status {state: Complaints / Customer Needs / Inquiries / Business Opportunities / Others} After using Softmax, the "Complaints" category
[0234] Table 2 Examples of various classification models
[0235] Specifically, step S5 includes:
[0236] S51: Obtain the various sentence-level classification results and corresponding confidence scores from step S4, and aggregate or weight them to obtain the first customer complaint classification result and corresponding confidence scores.
[0237] For multiple sentence-level classification results, the results can be directly aggregated. For the same sentence, if the classification results are the same, their confidence scores are averaged or weighted and summed. If the classification results are different, the classification result with higher confidence score is adopted. If the classification results are inclusive, the more detailed classification results are adopted.
[0238] For example, if we use the M1 sentence-based binary classification model (classifying sentences as complaints and non-complaints) and the M2 sentence-based triadic classification model (classifying sentences as complaints, customer needs, and inquiries), and input a sentence into both models, then the classification results are aggregated. If the sentence-based binary classification model results in (complaint, confidence 0.7) and the sentence-based triadic classification model results in (complaint, confidence 0.8), then the aggregated classification result for that sentence is (complaint, confidence 0.75), where the confidence level is the average of the confidence levels of the two classification results. If the sentence-based binary classification model results in (complaint, confidence 0.55) and the sentence-based triadic classification model results in (customer needs, confidence 0.7), then the aggregated classification result for that sentence is (customer needs, confidence 0.7). If the classification result of the sentence fragment binary classification model is (non-complaint, confidence 0.76) and the classification result of the sentence fragment tri-class classification model is (consultation, confidence 0.72), then the classification result of the aggregated sentence fragment is (consultation, confidence 0.72).
[0239] Furthermore, due to the impact of model calculations, the confidence scores of multi-class classification models may generally be lower than those of binary and tri-class classification models, and the confidence scores of tri-class classification models may generally be lower than those of binary classification models. Therefore, weighted processing of the confidence scores can be applied to obtain more accurate classification results. For example, if a sentence-fragment binary classification model or a sentence-fragment tri-class classification model is used, the confidence score of the tri-class classification model can be multiplied by a weight of 1.4.
[0240] Preferably, different sentence-level classification models can be used to classify customer complaint text sentences sequentially, first performing binary classification, and then, based on the results of the binary classification, performing tertiary or multi-class classification. For example, for the two sentence-level classification models exemplified in Table 2, the following aggregation method can be used:
[0241] (1) For each sentence fragment Fi, input the M1 sentence fragment binary classification model.
[0242] If M1(Fi).is_complaint==True and its confidence level P_binary>threshold θ1 (for example, it can be set to 0.6), then the sentence is considered valid evidence of customer complaint.
[0243] (2) Input the effective sentence fragment into the M2 sentence fragment three-classification model to obtain the sub-classes Ci (A / B / C) and their confidence scores P_category.
[0244] After traversing all sentence fragments, the first customer complaint classification result and the corresponding confidence level are obtained: Evidence = [(C1, P_c1), (C2, P_c2), ...].
[0245] S52: Obtain the various sentence-level classification results and corresponding confidence scores from step S4, and aggregate or weight them to obtain the second customer complaint classification results and corresponding confidence scores.
[0246] For multiple sentence-level classification results, the results can be directly aggregated. For the same sentence fragment, if the classification results are the same, the confidence scores are averaged or weighted and summed. If the classification results are different, the classification result with higher confidence is adopted. If the classification results are inclusive, the subdivided classification results are adopted.
[0247] For example, if we use the M3 whole-sentence classification and multi-label joint model, the M4 whole-sentence binary classification model, and the M5 whole-sentence state multi-classification model, and input a whole sentence into the three models, then aggregate the classification results. If the whole-sentence binary classification model results in (complaint, confidence 0.74), the whole-sentence classification and multi-label joint model results in [(complaint, confidence 0.8), (claim, 0.85)], and the whole-sentence state multi-classification model results in (complaint, confidence 0.75), then the aggregated classification result for the whole sentence is (complaint, confidence 0.76), where the confidence level is the average of the confidence levels of the three classification results.
[0248] Preferably, a weighted summation method can also be used to calculate the confidence score after aggregation of classification results. For example, the confidence score of the entire sentence is: Score_sentence = α * P_joint_binary + β * P_sentence_binary + γ * P_state_complaint, where α + β + γ = 1, representing adjustable weights. Initially, the weights can be set to (0.5, 0.3, 0.2), because M3 and M4 are models specializing in customer complaints and have higher weights. The weight of M3 can also be flexibly determined based on the performance of the large language model, or the optimal weight coefficients can be trained based on real labeled data.
[0249] S53: Based on the first customer complaint classification and its corresponding confidence level, and the second customer complaint classification and its corresponding confidence level, arbitration is conducted using the rule engine to obtain optimized customer complaint classification results.
[0250] In practical applications, a rule engine can be built by setting comprehensive processing rules for the two classification results based on model performance and actual needs. For example, the classification result with higher confidence can be used; classification results with confidence below a certain threshold can be discarded; the two classification results can be combined and weighted, and so on.
[0251] For example, the rules engine can be set to the following modes:
[0252] (1) Case 1: There is no evidence of sentence fragments and the confidence level of the whole sentence is low (strict mode).
[0253] Conditions: The first customer complaint classification result and the corresponding confidence score (Evidence) are empty, and the confidence score (Score_sentence) of the second customer complaint classification result is less than the threshold (T1) (T1 is high, for example, 0.7).
[0254] Verdict: Final, not a complaint.
[0255] Judgment logic: The finest-grained sentence fragment model found no points of complaint, and the whole sentence model also held a negative attitude, so it was determined to be negative.
[0256] (2) Scenario 2: There is evidence of a sentence fragment or the confidence level of the whole sentence is very high (recall mode).
[0257] Condition: Evidence is not empty, or Score_sentence > threshold T2 (T2 is very high, such as 0.9).
[0258] Verdict: Ultimately, it was a complaint.
[0259] Sub-categories determined:
[0260] If Evidence is not empty, the category with the most data in the statistical evidence set is taken as the final customer complaint type (votes can be weighted by confidence level).
[0261] If Evidence is empty (triggered only by high whole sentence confidence), the complaint type is marked as Unknown or the most likely type is inferred from the output of M3 / M5.
[0262] Judgment logic: As long as customer complaint evidence is found at a fine-grained level, or the whole sentence model is very certain, we consider it a complaint.
[0263] (3) Scenario 3: Conflict situation (no evidence for the sentence fragments but a certain degree of confidence for the whole sentence).
[0264] Condition: Evidence is empty, but Score_sentence >= T1.
[0265] Verdict: Tends to a loss, but logs will be kept for review.
[0266] Judgment logic: This situation may be due to the whole sentence model learning some implicit patterns that the sentence fragment model did not capture, or it may be a misjudgment. To ensure accuracy, we prioritize the sentence fragment evidence, but record this situation as a "suspicious sample" for subsequent model optimization.
[0267] (4) Final output
[0268] final_is_complaint: True / False (determined by the arbitration engine)
[0269] final_category: A / B / C / Unknown (determined by the arbitration engine)
[0270] final_tags: Taken from the multi-tag output of M3.
[0271] final_state: Taken from the state output of M5.
[0272] fusion_confidence: A comprehensive confidence level, for example, when judging it as a complaint, the maximum value of the average sentence confidence level and Score_sentence is taken.
[0273] The above-mentioned rule engine setup method has the following advantages:
[0274] (1) Accuracy priority: Through the dual protection of “sentence fragment evidence + high threshold”, false alarms are greatly reduced.
[0275] (2) No sacrifice of recall: Rule case 2 ensures that recall can be achieved as long as there is clear evidence or the model is very certain.
[0276] (3) High interpretability: The final judgment can be traced back to which sentence fragment was triggered, as well as the confidence level of each model, which facilitates manual review and problem localization.
[0277] (4) Flexible and adjustable: The threshold (θ1, T1, T2) and weight (α, β, γ) can be used as levers to fine-tune between accuracy and recall based on online feedback.
[0278] The beneficial effects of this embodiment are as follows:
[0279] This method can also employ an optimized text segmentation model, which can improve the accuracy of customer complaint text segmentation.
[0280] Example 3
[0281] A hotel in-stay telephone voice classification system, based on the hotel in-stay telephone voice classification method as described in Embodiment 1 or 2, includes:
[0282] The data acquisition module is used to acquire voice recordings from phone calls made during hotel stays.
[0283] The transcription module is used to transcribe hotel phone calls into customer complaint text based on a speech transcription model.
[0284] The sentence segmentation module is used to segment customer complaint texts into sentences based on a text sentence segmentation model;
[0285] The classification module is used to classify customer complaint texts based on sentence-fragment level classification models and whole sentence level classification models, and obtain various customer complaint classification results;
[0286] The arbitration module is used to perform weighted voting on multiple customer complaint classification results, and to conduct arbitration based on the rule engine to obtain optimized customer complaint classification results.
[0287] Example 4
[0288] A computer program product comprising a computer program that, when executed, implements the steps of the hotel stay telephone voice classification method as described in Embodiment 1 or 2.
[0289] Example 5
[0290] A readable storage medium storing a computer program as described in Embodiment 4, wherein when executed, the computer program implements the steps of the hotel stay telephone voice classification method as described in Embodiment 1 or 2.
[0291] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for classifying telephone voice messages during hotel stays, characterized in that, Includes the following steps: Get the hotel's recorded phone calls during your stay; Based on the speech-to-text model, the voice of the hotel stay telephone call is transcribed into the customer complaint text; Based on the text segmentation model, the customer complaint text is segmented into sentences; Based on sentence-level classification model and whole-sentence classification model, customer complaint texts are classified to obtain multiple customer complaint classification results; We use a weighted voting system to evaluate various customer complaint classification results and then arbitrate based on a rule engine to obtain optimized customer complaint classification results.
2. The hotel in-stay telephone voice classification method according to claim 1, characterized in that, The speech transcription model includes LSTM, DeepSpeech, or Conformer.
3. The hotel in-stay telephone voice classification method according to claim 1, characterized in that, The text segmentation models include: CRF, BiLSTM-CRF, or Bert.
4. The hotel in-stay telephone voice classification method according to claim 1, characterized in that, The text segmentation model includes: The input layer performs bidirectional context modeling on each character in the input text based on the BERT model, generating character-level context embeddings. The intermediate layer processes character-level context embeddings based on the lattice structure flattening and self-attention mechanism of the Flat-Lattice Transformer model, generating enhanced embeddings that integrate lexical information. The output layer generates text segmentation results based on the CRF model, using character-level context embeddings and enhanced embeddings that incorporate lexical information.
5. The hotel in-stay telephone voice classification method according to claim 1, characterized in that, The hotel in-stay telephone voice classification method also includes: The customer complaint text is segmented into sub-words using a word segmenter.
6. The hotel in-stay telephone voice classification method according to claim 5, characterized in that, The word segmenter includes: BiLSTM-CRF, Bert, or Tokenizer.
7. The hotel in-stay telephone voice classification method according to claim 1, characterized in that, The sentence-level classification model includes: The input processing layer processes the input text based on the pre-trained BERT model, generating a hidden state sequence rich in contextual information. The classification layer generates classification results based on the hidden state sequence rich in contextual information and using a Softmax classifier.
8. The hotel in-stay telephone voice classification method according to claim 1, characterized in that, The hotel in-stay telephone voice classification method also includes: Build a knowledge base by slicing historical documents into vectors and storing them in the knowledge base; The customer complaint text is vectorized, and the most relevant definitions, rules and examples are retrieved from the knowledge base to construct prompt words and design a prompt.
9. The hotel in-stay telephone voice classification method according to claim 1, characterized in that, The process of weighted voting on multiple customer complaint classification results and arbitration based on a rule engine to obtain optimized customer complaint classification results includes: Multiple sentence-level classification results and corresponding confidence scores are obtained, and aggregated or weighted to obtain the first customer complaint classification result and corresponding confidence scores. Multiple sentence-level classification results and corresponding confidence scores are obtained, and then aggregated or weighted to obtain the second customer complaint classification results and corresponding confidence scores. Based on the first customer complaint classification and its corresponding confidence level, and the second customer complaint classification and its corresponding confidence level, arbitration is conducted using a rule engine to obtain optimized customer complaint classification results.
10. A hotel in-stay telephone voice classification system, characterized in that, The hotel in-stay telephone voice classification method according to any one of claims 1 to 9 includes: The data acquisition module is used to acquire voice recordings from phone calls made during hotel stays. The transcription module is used to transcribe hotel phone calls into customer complaint text based on a speech transcription model. The sentence segmentation module is used to segment customer complaint texts into sentences based on a text sentence segmentation model; The classification module is used to classify customer complaint texts based on sentence-fragment level classification models and whole sentence level classification models, and obtain various customer complaint classification results; The arbitration module is used to perform weighted voting on multiple customer complaint classification results, and to conduct arbitration based on the rule engine to obtain optimized customer complaint classification results.