High-precision intention recognition method based on semantic enhancement and error correction mechanism
By combining semantic enhancement and error correction mechanisms, the low accuracy of existing intent recognition technologies in complex contexts and noisy data is solved, achieving high-precision intent recognition and multi-turn dialogue optimization, and improving recognition efficiency and interpretability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-26
- Publication Date
- 2026-04-03
AI Technical Summary
Existing intent recognition technologies have low accuracy when dealing with complex contexts and noisy data, and lack semantic understanding and error correction capabilities, resulting in a decline in recognition accuracy.
Employing semantic enhancement and error correction mechanisms, this approach combines error correction processing, knowledge graph enhancement, context fusion, and a Transformer encoder with multi-head attention and a feedforward network for feature extraction, outputting the intent with the highest confidence.
It significantly improves the accuracy of intent recognition, especially in complex contexts and multi-turn dialogue scenarios, enhancing error robustness and recognition efficiency, and improving the interpretability of recognition results.
Smart Images

Figure CN121787430A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of natural language processing technology, specifically to a high-precision intent recognition method based on semantic enhancement and error correction mechanisms. Background Technology
[0002] Intent recognition is one of the core tasks in natural language processing, aiming to understand the true intent of user input text. Existing intent recognition technologies mainly include: rule-based methods: identifying user intent through predefined rules and keyword matching, such as regular expression matching and template matching. Traditional machine learning-based methods: utilizing classifiers such as SVM and Naive Bayes, combined with feature extraction methods such as TF-IDF and Word2Vec for intent classification. Deep learning-based methods: employing pre-trained language models such as BERT and RoBERTa for intent recognition, achieving domain-specific intent classification through fine-tuning. Existing technologies suffer from the following main drawbacks: Insufficient semantic understanding: Existing methods often focus only on surface semantics, lacking the ability to understand complex contexts and implicit intents, leading to decreased accuracy when handling colloquialisms, omissions, and pronoun references. Lack of error correction mechanisms: User input often contains spelling errors, grammatical errors, or slips of the tongue; existing systems are poorly robust to this type of noisy data, and erroneous input directly affects recognition accuracy. Therefore, further research is urgently needed. Summary of the Invention
[0003] The purpose of this application is to provide a high-precision intent recognition method based on semantic enhancement and error correction mechanisms, the specific technical solution of which is as follows:
[0004] A high-precision intent recognition method based on semantic enhancement and error correction mechanisms includes: S1, acquiring and preprocessing the original input text; S2, performing error correction processing on the input text in S1 to obtain a pre-corrected text vector; S3, using a knowledge graph to semantically enhance the corrected text vector obtained in S2 to obtain an enhanced text vector; S4, acquiring the context information of the original input text in S1, and fusing the enhanced text vector obtained in S3 with the context vector to obtain a fused text vector; S5, using a 12-layer Transformer encoder to extract features from the fused text vector obtained in S4; S6, calculating the probability distribution of each intent based on the features extracted in S5 and the intent category, and outputting the intent with the highest confidence.
[0005] In S6, a confidence threshold is preset. When the intent with the highest confidence level is lower than the preset threshold, the process returns to S2 for clarification.
[0006] Preprocessing in S1 includes removing special characters and applying a unified encoding format.
[0007] The error correction process in S2 includes: S2.1, using a spelling error detection and correction algorithm based on edit distance and language model probability; S2.2, using a sequence labeling model for syntax error detection and correction.
[0008] Semantic enhancement in S3 includes: S3.1 Extracting entity relation triples from the domain knowledge base, linking the corrected text vectors obtained in S2 with the knowledge graph to extract relevant knowledge subgraphs; S3.2 Encoding the knowledge subgraphs extracted in S3.1 using a graph neural network to generate knowledge vectors; S3.3 Using an attention mechanism to fuse the corrected text vectors obtained in S2 and the knowledge vectors generated in S3.2.
[0009] In S3.3, the fusion weights are dynamically adjusted through learnable parameters.
[0010] The context fusion process in S4 includes: S4.1, collecting N rounds of dialogue records from the original input text in S1; S4.2, using a hierarchical attention network to process the N rounds of dialogue and construct context vectors; S4.3, fusing the enhanced text vectors obtained in S3 with the context vectors constructed in S4.2.
[0011] Each layer of the Transformer encoder in S5 includes a multi-head attention and feedforward network, with a dropout rate set to 0.1.
[0012] The calculation of the probability distribution of each intent in S6 includes: S6.1, inputting the feature vector extracted in S5 into the classification head and outputting the intent category distribution; S6.2, calculating the confidence level of each intent category based on the intent category distribution in S6.1.
[0013] The beneficial effects of this application are as follows: By combining semantic enhancement and error correction mechanisms, it achieves the following technical advantages compared to existing technologies: Significantly improved recognition accuracy: On standard datasets, intent recognition accuracy is significantly improved compared to traditional methods, with even more pronounced improvements in complex contexts. Enhanced error robustness: The system maintains high recognition accuracy even with inputs containing spelling and grammatical errors. Optimized multi-turn dialogue performance: In multi-turn dialogue scenarios, intent recognition accuracy reaches a high level, significantly improved compared to single-turn processing. Improved inference efficiency: Through model compression and caching mechanisms, the average time consumed per recognition is significantly reduced, meeting the needs of real-time interaction. Enhanced interpretability: The introduction of knowledge graphs makes the recognition results more interpretable, facilitating debugging and optimization. Attached Figure Description
[0014] Figure 1 This is a flowchart illustrating the application process.
[0015] Figure 2 This is a system framework diagram for this application. Detailed Implementation
[0016] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to specific embodiments and accompanying drawings. It should be understood that these descriptions are merely exemplary and not intended to limit the scope of this application. Furthermore, descriptions of well-known structures and technologies are omitted in the following description to avoid unnecessarily obscuring the concepts of this application.
[0017] like Figure 1 As shown, a high-precision intent recognition method based on semantic enhancement and error correction mechanisms includes:
[0018] S1. Collect the raw input text and preprocess it. Specifically, preprocessing includes removing special characters and standardizing the encoding format.
[0019] S2. Perform error correction processing on the input text in S1 to obtain a pre-corrected text vector. Specifically, the error correction processing includes: S2.1. Using a spelling error detection and correction algorithm based on edit distance and language model probability; in practice, the edit distance threshold is set to 2, and an n-gram language model (n=3) is used to calculate the probability of candidate words, selecting the candidate word with the highest probability for replacement. S2.2. Using a sequence labeling model for syntax error detection and correction. In practice, the temperature parameter is set to 0.7, and the beam search width is set to 5.
[0020] S3. The corrected text vector obtained in S2 is semantically enhanced using a knowledge graph to obtain an enhanced text vector. Specifically, the semantic enhancement includes: S3.1. Extracting entity relation triples from the domain knowledge base, linking the corrected text vector obtained in S2 with the knowledge graph to extract relevant knowledge subgraphs (limited to 2 hops). S3.2. Encoding the knowledge subgraphs extracted in S3.1 using a graph neural network to generate knowledge vectors (dimension: 768). S3.3. Fusing the corrected text vector obtained in S2 and the knowledge vector generated in S3.2 using an attention mechanism. The fusion weights are dynamically adjusted using learnable parameters.
[0021] S4. Collect the context information of the original input text in S1, and fuse the enhanced text vector obtained in S3 with the context vector to obtain a fused text vector. Specifically, the context fusion includes: S4.1. Collect N rounds of dialogue records (N defaults to 5) of the original input text in S1; in practice, a sliding window mechanism is used, with a window size of 512 tokens. S4.2. Use a hierarchical attention network to process the N rounds of dialogue; in practice, the first layer is intra-round attention, capturing key information in each round of dialogue; the second layer is inter-round attention, modeling the dialogue evolution relationship; thus constructing the context vector. S4.3. Fuse the enhanced text vector obtained in S3 with the context vector constructed in S4.2. In practice, a gating mechanism is used to control the information flow, and the gating parameter is activated by a sigmoid function.
[0022] S5. Use a 12-layer Transformer encoder to extract features from the fused text vectors obtained in S4. Specifically, each Transformer encoder layer includes multi-head attention (8 heads) and a feedforward network, with a dropout rate set to 0.1.
[0023] S6. Calculate the probability distribution of each intent based on the features extracted in S5 and the intent categories, and output the intent with the highest confidence. Specifically, calculating the probability distribution of each intent includes: S6.1. Inputting the feature vector extracted in S5 into the classification head (two-layer fully connected network), and outputting the intent category distribution. In practical applications, the intermediate layer dimension is 1024, and the activation function is ReLU; the output layer dimension is the number of intent categories, and softmax activation is used. S6.2. Based on the intent category distribution in S6.1, calculate the confidence of each intent category. A preset confidence threshold is set; when the intent with the highest confidence falls below the preset threshold, return to S2 for clarification.
[0024] Furthermore, the above methods undergo post-processing and optimization. Specifically: Result verification uses a rule engine to check the reasonableness of the intent and verifies the results based on business logic constraints. Model adaptive updating involves collecting user feedback data and using an online learning algorithm for parameter fine-tuning, with a learning rate set to 1e-5 and a batch size of 32. Caching mechanism establishes an intent recognition result cache using an LRU strategy, with a cache size of 10,000 entries, and directly returning cached results when the similarity threshold is 0.95.
[0025] like Figure 2 As shown, a high-precision intent recognition system based on semantic enhancement and error correction mechanisms is constructed using the above method, and includes the following components:
[0026] Component 1: User input module, which receives raw text input.
[0027] Component 2: Error correction module, which performs spelling and grammar correction.
[0028] Component 3: Semantic enhancement module, which integrates knowledge graph information.
[0029] Component 4: Context fusion module, which handles dialogue history.
[0030] Component 5: Domain knowledge base, which provides entity relationship triples and knowledge subgraphs for the semantic enhancement module (Component 3), and enables querying and knowledge return through bidirectional data flow.
[0031] Component 6: Feature extraction layer, using a 12-layer Transformer encoder, receives fused information from the error correction module, semantic enhancement module, and context fusion module.
[0032] Component 7: Intent classifier, multi-layer fully connected network.
[0033] Component 8: Result Validation Module, Rule Engine Validation.
[0034] Component 9: Caching mechanism, LRU cache optimization.
[0035] Component 10: Intent output module, outputs the recognition results.
[0036] To make this application easier to understand, specific application examples are given below.
[0037] This embodiment uses an intelligent customer service system as the application scenario.
[0038] Software environment: Ubuntu 20.04, Python 3.8, PyTorch 1.10, Neo4j 4.4
[0039] System initialization: Load the pre-trained BERT-base-chinese model as the base encoder; construct a domain knowledge graph containing 100,000 entity nodes and 500,000 relation edges; initialize the error correction dictionary containing 50,000 common error-correct word pairs; set the cache size to 10,000 records.
[0040] Online Processing Flow: User input: "I want to return this product review" (including spelling errors). Error correction: The system detects "product review" as an incorrect word, calculates candidate words ["product", "product review", "product review"] using edit distance, and selects "product" as the corrected result based on the probability of the n-gram language model. Corrected text: "I want to return this product". Semantic enhancement: Identifies the entity "return" from the knowledge graph, extracts relevant knowledge subgraphs: return -> belongs to -> after-sales service; return -> needs -> order number; return -> time limit -> 7 days; generates a 768-dimensional knowledge vector and fuses it with the original text vector. Context fusion: Extracts the first 5 rounds of dialogue records, discovers that the user previously mentioned the order number "20240101001". Generates a context vector containing historical information through a hierarchical attention mechanism. Intent recognition: After 12 layers of Transformer encoding, the classifier outputs: return application -0.92 (confidence), product inquiry -0.05, complaint suggestion -0.03. The output shows a confidence level of 0.92 > 0.85, directly outputting the intent category "Return Request" and triggering subsequent return process guidance.
[0041] Performance test results: Tested on 1000 real customer service dialogue samples, the intent recognition accuracy was -96.3%, the average response time was -43ms, the error correction success rate was -94.5%, and the cache hit rate was -35.2%.
[0042] Explanation of English abbreviations and terms:
[0043] - BERT: Bidirectional Encoder Representations from Transformers.
[0044] - GCN: Graph Convolutional Network.
[0045] - LRU: Least Recently Used (cache eviction policy).
[0046] - TF-IDF: Term Frequency-Inverse Document Frequency.
[0047] - SVM: Support Vector Machine.
[0048] - ReLU: Rectified Linear Unit (activation function).
[0049] - Adam: Adaptive Moment Estimation (an optimization algorithm).
Claims
1. A high-precision intent recognition method based on semantic enhancement and error correction mechanisms, characterized in that, include: S1. Collect the original input text and perform preprocessing; S2. Perform error correction processing on the input text in S1 to obtain a corrected text vector after preliminary correction; S3. Use a knowledge graph to semantically enhance the corrected text vector obtained in S2 to obtain an enhanced text vector; S4. Collect the context information of the original input text in S1, and fuse the enhanced text vector obtained in S3 with the context vector to obtain the fused text vector; S5. Use a 12-layer Transformer encoder to extract features from the fused text vector obtained in S4; S6. Calculate the probability distribution of each intent based on the features and intent categories extracted in S5, and output the intent with the highest confidence.
2. The high-precision intent recognition method based on semantic enhancement and error correction mechanism as described in claim 1, characterized in that, In step S6, a confidence threshold is preset. When the intention with the highest confidence level is lower than the preset threshold, the process returns to step S2 for clarification.
3. The high-precision intent recognition method based on semantic enhancement and error correction mechanism as described in claim 1, characterized in that, The preprocessing in S1 includes removing special characters and standardizing the encoding format.
4. The high-precision intent recognition method based on semantic enhancement and error correction mechanism as described in claim 3, characterized in that, The error correction process in S2 includes: S2.
1. A spelling error detection and correction algorithm based on edit distance and language model probability is used. S2.
2. Use sequence labeling model for syntax error detection and correction.
5. The high-precision intent recognition method based on semantic enhancement and error correction mechanism as described in claim 4, characterized in that, When performing semantic enhancement in S3, the following are included: S3.1 Extract entity relation triples from the domain knowledge base, link the corrected text vector obtained in S2 with the knowledge graph to extract relevant knowledge subgraphs; S3.
2. Use a graph neural network to encode the knowledge subgraph extracted in S3.1 to generate a knowledge vector; S3.
3. Use an attention mechanism to fuse the corrected text vector obtained in S2 and the knowledge vector generated in S3.
2.
6. The high-precision intent recognition method based on semantic enhancement and error correction mechanism as described in claim 5, characterized in that, In S3.3, the fusion weights are dynamically adjusted through learnable parameters.
7. The high-precision intent recognition method based on semantic enhancement and error correction mechanism as described in claim 5, characterized in that, The context fusion process in S4 includes: S4.1 Collect N rounds of dialogue records of the original input text in S1; S4.
2. Use a hierarchical attention network to process N rounds of dialogue and construct context vectors; S4.
3. The enhanced text vector obtained in S3 is fused with the context vector constructed in S4.
2.
8. The high-precision intent recognition method based on semantic enhancement and error correction mechanism as described in claim 7, characterized in that, Each Transformer encoder layer in S5 includes a multi-head attention and feedforward network, with a dropout rate set to 0.
1.
9. The high-precision intent recognition method based on semantic enhancement and error correction mechanism as described in claim 8, characterized in that, The calculation of the probability distribution of each intention in S6 includes: S6.1 Input the feature vector extracted in S5 into the classification head and output the intention category distribution; S6.
2. Based on the intent category distribution in S6.1, calculate the confidence level of each intent category.