Context learning-based Chinese semantic error detection system, product, medium and equipment

Through the DISCERN framework combining thinking chains and dependent syntax trees, the problems of weak generalization ability and insufficient multi-dimensional knowledge integration in Chinese semantic error detection are solved, and higher precision semantic error detection is achieved.

CN120449891APending Publication Date: 2025-08-08GUANGDONG UNIVERSITY OF FOREIGN STUDIES +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510626139.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-14
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

The prior art has problems such as weak generalization ability and insufficient integration of multi-dimensional knowledge in Chinese semantic error detection, and it is difficult to effectively deal with complex semantic structures and cross-paragraph semantic dependence scenarios.

Method used

Using the DISCERN framework, combining thinking chain prompting strategies and sample sample selection strategies of dependent syntax trees, additional context reference information is provided by mining semantic error mechanisms and integrating finer-grained semantic information.

Benefits of technology

It significantly improves the accuracy and performance of Chinese semantic error detection, improves the applicability and scalability of the model, and can accurately identify semantic errors in complex contexts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120449891A_ABST
    Figure CN120449891A_ABST
Patent Text Reader

Abstract

The invention discloses a Chinese semantic error detection system based on context learning, a product, a medium and equipment, and belongs to the technical field of artificial intelligence. According to the system, Chinese semantic error detection based on context learning is carried out by adopting a DISCERN framework; the DISCERN framework is specifically characterized in that a thinking chain-based prompt strategy and a dependency syntax tree-based example sample selection strategy are introduced into an existing pre-training language model; semantic information with finer granularity is effectively integrated through a mechanism of mining semantic errors based on a thinking chain prompt strategy; the most representative context learning example sample is selected through an example sample selection strategy based on a dependency syntax tree, so that additional supplementary targeted reference information is provided. According to the method, semantic information with finer granularity can be effectively integrated, and the capability of detecting Chinese semantic errors is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of artificial intelligence technology, and in particular relates to a Chinese semantic error detection system, product, medium and device based on context learning. Background Art

[0002] The problem of semantic errors in Chinese is a key challenge in natural language processing (NLP) because the types of semantic errors in Chinese are complex and diverse. These errors are difficult to identify with traditional text editing tools and often require a combination of professional knowledge and contextual information to accurately judge.

[0003] Current research in the field of Chinese semantic error detection mainly focuses on three directions: rule-based, neural network-based, and Transformer-based pre-training models.

[0004] Rule-based: Based on statistical theory and dependency analysis, it identifies the collocation relationship between words by analyzing large-scale corpora.

[0005] Based on neural network: By introducing pinyin and glyph information into the neural network model, complex semantic relationships are captured, improving the detection accuracy of spelling and semantic errors.

[0006] Transformer-based pre-training model: Advanced Transformer-based models such as BERT can effectively process long-distance semantic dependencies and adapt to complex semantic structures and diverse language environments.

[0007] The defects of the existing technology include:

[0008] 1) Limitations of rule-based methods: Rule-based methods have weak generalization capabilities when faced with complex semantic structures. For example, they may not be directly applicable when dealing with semantic dependencies across sentences or even paragraphs.

[0009] 2) Data and model architecture limitations: Neural network-based models are still limited by the quality of training data and model architecture when processing long-range dependent semantic structures.

[0010] 3) Insufficient integration of multi-dimensional knowledge: Although pre-trained models are trained using large-scale corpora, they may still lack the systematic integration of supplementary information such as professional knowledge and contextual dependencies. Summary of the Invention

[0011] The present invention aims to solve one of the technical problems in the above-mentioned related art at least to a certain extent.

[0012] To this end, the purpose of the present invention is to provide a Chinese semantic error detection system, product, medium and device based on context learning, which can effectively integrate more fine-grained semantic information and significantly improve the ability to detect Chinese semantic errors.

[0013] In order to solve the above-mentioned technical problems, the present invention is achieved as follows:

[0014] The embodiment of the present invention provides a Chinese semantic error detection system based on context learning, wherein the system adopts a DISCERN framework to perform Chinese semantic error detection based on context learning;

[0015] The DISCERN framework specifically introduces a thought chain-based prompting strategy and a dependency syntactic tree-based example sample selection strategy into existing pre-trained language models. The thought chain-based prompting strategy explores the mechanisms of semantic errors and effectively integrates more fine-grained semantic information. The dependency syntactic tree-based example sample selection strategy selects the most representative contextual learning examples, thereby providing additional targeted reference information. The pre-trained language model is either the ChatGLM3 model or the Deepseek model.

[0016] In addition, the Chinese semantic error detection system based on context learning according to the present invention may also have the following additional technical features:

[0017] In some embodiments, the DISCERN framework includes:

[0018] The semantic error mechanism mining module is configured to use a prompt strategy based on thought chains to guide the model to infer the type and cause of semantic errors in input samples, and encapsulate them into predefined templates for subsequent processing;

[0019] An example selection module is configured to select the most appropriate context learning example samples that can provide targeted semantic information for the test samples;

[0020] The template filling output module is configured to fill multiple context learning example samples filtered by the example selection module into a template containing prompt words and target test samples, and perform semantic error detection on the target test samples.

[0021] In some embodiments, the example sample selection strategy based on the dependency syntax tree is specifically an example selection strategy based on a subtree kernel function, and the subtree kernel function is used to calculate the semantic and grammatical similarity between two sentences.

[0022] In some of the embodiments, the thought chain-based prompt strategy improves the model's understanding and judgment of erroneous semantic information by demonstrating the reasoning process of detecting semantic errors; the semantic error mechanism of sentences with semantic errors is mined, and the mined semantic error types and causes are embedded in the prompt template of semantic error detection, so that the model can intuitively learn how to obtain error location and trace the link that caused the error when judging and outputting the test samples, thereby improving the performance of the model's semantic error detection.

[0023] In some embodiments, the example selection module includes:

[0024] Segment the sentences with semantic errors in the training set and each sentence in the test set or semantic detection data and extract their dependency syntax trees;

[0025] Identify the dependencies of each word token and assign it a dependency label that indicates the type of relationship with its core word;

[0026] Based on the information obtained, a syntax tree is constructed;

[0027] The subtree kernel function is used to calculate the shared substructure of the syntactic trees of two sentences to quantify the semantic and grammatical similarity between the sentences;

[0028] According to the calculated dependency tree similarity scores, several most similar sentences are matched from the training samples to each sentence in the test set as context learning example samples.

[0029] In some of the embodiments, the syntax tree is represented by a mathematical directed acyclic graph.

[0030] In some embodiments, the template filling output module includes:

[0031] Mapping the context learning example samples selected by the example selection module to the structured template set constructed by the semantic error mechanism mining module, and extracting the semantic error type and error cause of the example sentence from the structured template set;

[0032] The semantic error type and error cause are filled into a predefined template containing prompt words and corresponding target detection samples.

[0033] An embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the content of the Chinese semantic error detection system based on context learning as described in any of the above items.

[0034] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the content of the Chinese semantic error detection system based on context learning as described in any one of the above items is implemented.

[0035] An embodiment of the present invention also provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the content of the Chinese semantic error detection system based on context learning as described in any one of the above items.

[0036] Compared with the prior art, the present invention has at least the following beneficial effects:

[0037] In an embodiment of the present invention, a Chinese semantic error detection method based on contextual learning is provided, which can accurately mine the mechanism of semantic errors: DISCERN uses a thought chain prompting strategy to gradually present semantic reasoning links during the detection process, intuitively revealing the potential causes of semantic errors in the text; this mechanism enables the model to learn how to locate errors more accurately, significantly improving detection accuracy;

[0038] In an embodiment of the present invention, a Chinese semantic error detection method based on contextual learning is provided, which can achieve information integration in the semantic space: through an example selection module based on a dependency syntax tree and a subtree kernel function, DISCERN can intelligently match example samples with highly relevant syntax and semantics for test samples and automatically integrate them into a standardized prompt template, thereby providing targeted contextual information for the large model, solving the problem of insufficient contextual semantic information or ambiguous context.

[0039] In the embodiment of the present invention, the provided Chinese semantic error detection method based on contextual learning can improve model performance: DISCERN surpasses existing models in multiple performance indicators, demonstrating its superior performance in Chinese semantic error detection tasks;

[0040] In the embodiment of the present invention, the provided Chinese semantic error detection method based on context learning is applicable and scalable: DISCERN not only improves the performance of Chinese semantic error detection tasks, but its modular architecture has good scalability. This methodology can also be extended to semantic error detection tasks in other languages.

[0041] Additional aspects and advantages of the present invention will be set forth in part in the description which follows and, in part, will be obvious from the description which follows, or may be learned by practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 A schematic diagram of the structure of a Chinese semantic error detection model based on context learning disclosed in one embodiment of the present invention;

[0043] Figure 2 A schematic diagram of a prompt template for mining a semantic error mechanism disclosed in one embodiment of the present invention;

[0044] Figure 3 A schematic diagram of a prompt template for semantic error detection disclosed in one embodiment of the present invention;

[0045] Figure 4 This is a schematic diagram of the structure of a semantic error mechanism mining module disclosed in one embodiment of the present invention;

[0046] Figure 5 This is a schematic diagram of the structure of a template filling output module disclosed in one embodiment of the present invention;

[0047] Figure 6 FIG1 is a performance fluctuation curve diagram of DISCERN and DISCERN w / o SEMM disclosed in one embodiment of the present invention when dealing with changes in the number of example samples K. FIG1 is a performance fluctuation curve diagram of DISCERN and DISCERN w / o SEMM disclosed in an embodiment of the present invention when dealing with changes in the number of example samples K. DETAILED DESCRIPTION

[0048] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0049] The embodiments of the present invention are described in detail below through specific embodiments and application scenarios with reference to the accompanying drawings.

[0050] In some embodiments of the present invention, a Chinese semantic error detection method based on context learning is provided. Through the Chinese semantic error detection framework DISCERN, an innovative solution is provided to the shortcomings of the existing technology. The framework introduces thought chain and context learning technology, which can effectively enhance the detection ability of Chinese semantic errors and further improve the recognition accuracy.

[0051] The present invention's Chinese semantic error detection method based on contextual learning significantly improves the ability to detect Chinese semantic errors and provides a new and effective method for semantic error detection by introducing a chain of thought (CoT) prompting strategy to framework-explore the mechanisms of semantic errors, thereby effectively integrating more fine-grained semantic information. Furthermore, a sample selection strategy based on a dependency syntax tree is employed to select the most representative contextual learning (ICL) examples from the training samples, providing additional, targeted reference information. The combination of these two strategies significantly improves the ability to detect Chinese semantic errors and provides a new and effective method for semantic error detection.

[0052] In some embodiments of the present invention, the DISCERN model framework includes a semantic error mechanism mining module, an example selection module, and a template filling output module. Figure 1 shown.

[0053] In some embodiments of the present invention, the semantic error mechanism mining module, based on the DISCERN framework, first encapsulates sentences with semantic errors in the training set using a predefined prompt word template. This template explicitly instructs the model to confirm the presence of semantic errors and requires it to analyze and list the specific semantic error types and their causes, which are then input into the larger model. The output of the larger model is then standardized and encapsulated into a structured template.

[0054] In some embodiments of the present invention, the example selection module uses the Language Technology Platform (LTP) to perform word segmentation and dependency parsing on sentences in the training and test sets, constructing syntax trees to capture the grammatical and semantic relationships between words. The similarity between these dependency trees is calculated using a subtree kernel function, and the K training examples with the most similar semantic and syntactic structures are selected for each test example as ICL examples.

[0055] In some embodiments of the present invention, for the DISCERN framework, the template filling output module integrates selected example sentence test samples into predefined templates, constructs a standardized input structure and provides it to large language models (LLMs) for semantic error detection, thereby ensuring the consistency and interpretability of the model input and output.

[0056] Throughout the entire process, the output of each module is directly connected as the input of the next module. This design ensures seamless transmission and gradual refinement of information throughout the entire processing chain, thereby achieving efficient and accurate Chinese semantic error detection.

[0057] The working principle of the semantic error mechanism mining module:

[0058] The main goal of this module is to infer the types of semantic errors in the input samples and their causes, and encapsulate them into predefined templates for subsequent processing. CoT (chain of thought technology) is used to guide the large model to perform step-by-step reasoning and demonstrate the reasoning process. Specifically, the sentence X in the training set is input into LLMs. For sentences containing semantic errors (i.e., samples marked as "yes"), they are encapsulated into predefined templates, such as Figure 2As shown in Figure 2. This template explicitly instructs the model to confirm the existence of semantic errors and prompts the model to analyze and list the specific types of semantic errors and their causes in the input sentences. Subsequently, LLMs output binary labels C∈{0,1}, where 0 and 1 represent the absence and presence of semantic errors, respectively, a semantic error classification T, and a detailed explanation of the cause of the error R. For each sample i in the training set where LLMs output C equals 1, indicating the presence of a semantic error, a structured template Template is constructed. i =(X i , T i , R i ). These templates are grouped into a collection Where N represents the total number of semantic error samples.

[0059] Example of how the selection module works:

[0060] This module is responsible for selecting the most appropriate ICL examples for test samples. Conventional example selection strategies fail to provide targeted semantic information for LLMs. Therefore, we propose an example selection strategy based on a subtree kernel function, which aims to calculate the semantic and grammatical similarity between two sentences. The ICL examples selected using this strategy provide the model with more semantic information, helping to accurately detect semantic errors.

[0061] First, the sentences with semantic errors in the training set and each sentence in the test set are segmented and their dependency syntax trees are extracted. Specifically, for each sentence S in the training set and the test set, the present invention first segments it into a word sequence W = {w1, w2, ..., w n}, where each w i Represents a word tag in the sentence. Then LTP is used to identify each word tag w i The dependency relationship of and assign it a dependency label d i , the label means w i The type of relationship between the core word and the core word. These dependencies can be formalized as a set of bigrams where h i Indicates w i Based on this information, a syntax tree T can be constructed, which is mathematically represented as a directed acyclic graph (DAG) T = (V, E), where the node set V = {v1, v2, ..., v n} corresponds to word w i , edge set Indicates that from the core word to the subordinate word v i The dependency relationship r i .

[0062] Subsequently, the subtree kernel function is used to calculate the shared substructure of the syntax trees of the two sentences to quantify the semantic and grammatical similarity between the sentences. For two syntax trees T1 and T2, their similarity scores are calculated using the following subtree kernel function formula:

[0063]

[0064] Where N1 and N2 are the node sets of dependency trees T1 and T2 respectively, and k(n1, n2) is the recursive formula of the subtree kernel function, which is used to calculate the similarity between subtrees with nodes n1 and n2 as roots. If the labels of nodes n1 and n2 are different, then k(n1, n2) = 0, ensuring that only nodes with the same label contribute to the similarity. If both nodes are leaf nodes and their labels match, then k(n1, n2) = λ, where λ (0 < λ < 1) is a decay factor that controls the impact of the overall similarity by matching leaf nodes. If the labels of two nodes are the same and they have child nodes, the recursive formula can be expressed as:

[0065]

[0066] Among them, l represents the number of child nodes, c 1i and c 2i Represent the i-th child node of n1 and n2 respectively.

[0067] Finally, based on the calculated dependency tree similarity scores, K most similar sentences are matched from the training samples for each sentence in the test set as ICL examples, providing additional contextual dependency information for LLMs.

[0068] How the Template Fill Output Module works:

[0069] The main goal of this module is to fill the K ICL example samples selected by the example selection module into the template containing the prompt words and the target test sample, and perform semantic error detection on the target sample. The formatted template design is intended to effectively help LLMs extract meaningful information from the ICL examples and guide the output of the model, thereby improving the accuracy of semantic error detection and the stability of the model output. First, the ICL example sentences selected by the example selection module are mapped to the structured template set constructed by the semantic error mechanism mining module. from The semantic error type and error cause of the sample sentence are extracted. Then, the semantic error type and cause are filled into the predefined template containing the prompt word and the corresponding target detection sample, such as Figure 3 shown.

[0070] In some embodiments of the present invention, the thought chain prompt strategy helps improve the model's understanding and judgment of erroneous semantic information by showing the reasoning process of detecting semantic errors. Figure 4 and Figure 5 As shown in the figure, LLMs are used to mine the semantic error mechanisms of sentences with semantic errors. The mined semantic error types and causes are embedded in the prompt template for semantic error detection. This allows the large model to intuitively learn how to obtain error locations and trace the links where errors occur when judging and outputting test samples, thereby improving the performance of the model's semantic error detection.

[0071] In some embodiments of the present invention, the ICL strategy can effectively improve the semantic understanding ability of a large model by providing only a small number of examples to the model without the need for specific fine-tuning of the model. Figure 5 As shown in the figure, by matching each detection sample with a small number of highly semantically relevant ICL examples, this structural design can quickly introduce contextual information without additional model fine-tuning, improving the model's ability to understand complex semantic structures and error patterns. This approach ensures that even when there is little information or ambiguous context, the model can use external examples to make more detailed and accurate judgments, thereby improving the overall robustness of semantic error detection.

[0072] Embodiment 1:

[0073] Experimental settings and datasets:

[0074] Experiments used ChatGLM3-6B and DeepSeek-R1 to evaluate DISCERN and other ICL methods. The experiments were conducted using the CSED-R dataset, which contains 45,248 training samples, 2,160 validation samples, and 2,000 test samples. All experiments were conducted on an RTX 8000 graphics card.

[0075] Baseline method:

[0076] This example compares several established methods in the field of Chinese semantic error detection, including those based on general pre-trained models, those based on RoBERTa pre-training and syntax-related tasks (RoBERTa+DP, RoBERTa+DP+), and those based on RoBERTa fine-tuning and syntactic fusion models (Syntax-RoBERTa+DP, Syntax-RoBERTa+DP+). In addition, the common Jaccard-based ICL method is also compared.

[0077] Methods based on general pre-trained models: The ability of general pre-trained language models to perform Chinese semantic error detection tasks without being explicitly trained on specific task or dataset examples.

[0078] RoBERTa pre-training and syntax-related tasks: The RoBERTa model was first pre-trained using one million Wikipedia articles, using LTP tools to perform syntactic parsing to obtain sentence dependency structures. Subsequently, specialized pre-training tasks such as DP and DP were designed based on these dependency structures, enabling the model to acquire syntactic knowledge during the pre-training phase.

[0079] Methods based on RoBERTa fine-tuning and syntax fusion models: Using RoBERTa models fused with syntactic information as the base architecture, these models are then fine-tuned on the CSED-R dataset to improve their adaptability to the semantic error detection task. To evaluate the effectiveness of different methods, multiple fine-tuning strategies are used, including Syntax-RoBERTa and its variants that incorporate additional syntactic information.

[0080] Jaccard-based ICL method: The Jaccard-based ICL method refers to an example selection method based on word similarity. It calculates the ratio of the intersection and union of sentence segmentation sets and uses the Jaccard coefficient to identify the demonstration examples most relevant to the test sample.

[0081] Main experimental results:

[0082] Table 1 shows the performance comparison of the proposed DISCERN with various baseline methods, using ChatGLM3 and DeepSeek-R1 as the backbone models. It is worth noting that the general pre-trained models perform relatively poorly in the Chinese semantic error detection task. For example, ChatGLM3 has an ACC of 52.4% and an F1 score of 67.5%, which is significantly lower than specialized models such as RoBERTa+DP (ACC: 74.3%, F1 score: 74.3%) and Syntax-RoBERTa+DP (ACC: 74.4%, F1 score: 74.8%). For the DeepSeek-R1 model, its ACC (52.1%) and F1 score (60.4%) are also significantly lower than those of the specialized models. This shows that pre-trained language models designed for specific tasks have obvious advantages in the Chinese semantic error detection task. In an analysis of different ChatGLM3 enhancement methods, Jaccard-based ICL (ChatGLM3) achieved an ACC of 52.2% and an F1 score of 66.8%, which were slightly lower by 0.2% and 0.7% respectively compared to the original ChatGLM3 model (ACC: 52.4%, F1 score: 67.5%). In contrast, DISCERN (ChatGLM3) achieved an ACC of 54.6% and an F1 score of 67.6%, which were respectively improved by 2.2% and 0.1% compared to the backbone model ChatGLM3. For the DeepSeek-R1 model, DISCERN (DeepSeek-R1) achieved an ACC of 57.5% and an F1 score of 67.2%, which were significant improvements of 5.4% and 6.8% respectively compared to the backbone model DeepSeek-R1 (ACC: 52.1%, F1 score: 60.4%). Compared to Jaccard-based ICL (DeepSeek-R1, which achieved an ACC of 55.5% and an F1 score of 67.5%), DISCERN (DeepSeek-R1) achieved a 2.0% improvement in ACC (reaching 57.5%) while maintaining a similar F1 score (67.2%). Overall, DISCERN significantly improved model performance, surpassing traditional Jaccard-based ICL methods.

[0083] Table 1 Performance results of different models

[0084]

[0085]

[0086] Parameter exploration experiment and ablation experiment:

[0087] In order to explore the impact of the number of ICL sample samples K on model performance and the effectiveness of the semantic error mechanism mining module, a series of experiments were designed with K ranging from 1 to 4. At each K value, tests were performed under consistent computing resource configuration and model parameter settings to ensure the comparability of the results. These experiments were all conducted on ChatGLM3-6B. Figure 6 As shown in the figure, as the value of K increases, the DISCERN framework equipped with the semantic error mechanism mining module shows a significant monotonic decrease in both the F1 score and the ACC. In contrast, the DISCERN framework without the semantic error mechanism mining module (DISCERN w / o SEMM) shows only a slight decrease in these metrics, and its overall performance remains relatively stable. This result indicates that increasing the number of ICL demonstration samples after introducing the semantic error mechanism mining module actually leads to an information redundancy effect. Introducing too many samples introduces additional feature noise, which negatively affects the model's performance in the semantic error detection task.

[0088] Exploration experiments with different templates:

[0089] To explore the impact of prompt template design on the model's ability to correctly understand and solve the semantic error detection task, two different prompt templates were designed and their effects on the model's output were observed. Experimental results show that when using the templates in Table 2, regardless of the value of K, the model consistently predicts "no." This suggests that in the semantic error detection task, the model is highly sensitive to changes in the prompt word and may not correctly understand the task requirements. In contrast, when using the originally designed prompt template containing examples (i.e., "You are a Chinese semantic error detection system that can identify whether a sentence contains semantic errors"), the model is able to correctly distinguish sentences with semantic errors. This result demonstrates that accurate template design plays a key role in improving model performance.

[0090] Table 2 Different prompt word templates for semantic error detection

[0091]

[0092] Figure 6 The figure shows the performance fluctuation of DISCERN when dealing with changes in the number of sample K. As can be seen from the figure, when the number of examples is 1, the model reaches the highest score in F1 score and ACC. However, as the number of examples increases, the DISCERN framework shows a clear monotonic decrease in both F1 score and ACC indicators.

[0093] Parts of the present invention that are not described in detail may refer to the prior art or are well-known technologies to those skilled in the art, and this embodiment does not limit this and will not be described in detail here.

[0094] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are protected by the present invention.

Claims

1. A Chinese semantic error detection system based on context learning, characterized in that: The system adopts the DISCERN framework to perform Chinese semantic error detection based on context learning; The DISCERN framework specifically introduces a thought chain-based prompting strategy and a dependency syntactic tree-based example sample selection strategy into the existing pre-trained language model; uses the thought chain-based prompting strategy to explore the mechanism of semantic errors and effectively integrate more fine-grained semantic information; and uses the dependency syntactic tree-based example sample selection strategy to select the most representative contextual learning example samples, thereby providing additional supplementary targeted reference information.

2. The Chinese semantic error detection system based on context learning according to claim 1 is characterized in that: The DISCERN framework includes: The semantic error mechanism mining module is configured to use a prompt strategy based on thought chains to guide the model to infer the type and cause of semantic errors in input samples, and encapsulate them into predefined templates for subsequent processing; An example selection module is configured to select the most appropriate context learning example samples that can provide targeted semantic information for the test samples; The template filling output module is configured to fill multiple context learning example samples filtered by the example selection module into a template containing prompt words and target test samples, and perform semantic error detection on the target test samples.

3. The Chinese semantic error detection system based on context learning according to claim 1 is characterized in that: The example sample selection strategy based on the dependency syntax tree is specifically an example selection strategy based on a subtree kernel function, and the subtree kernel function is used to calculate the semantic and grammatical similarity between two sentences.

4. The Chinese semantic error detection system based on context learning according to claim 1 is characterized in that: The thought chain-based prompt strategy improves the model's understanding and judgment of erroneous semantic information by demonstrating the reasoning process of detecting semantic errors; it mines the semantic error mechanism of sentences with semantic errors, and embeds the mined semantic error types and causes into the prompt template for semantic error detection, so that the model can intuitively learn how to obtain error location and trace the link that caused the error when judging and outputting test samples, thereby improving the performance of the model's semantic error detection.

5. The Chinese semantic error detection system based on context learning according to claim 2 is characterized in that: The example selection module includes the following tasks: Segment the sentences with semantic errors in the training set and each sentence in the test set or semantic detection data and extract their dependency syntax trees; Identify the dependencies of each word token and assign it a dependency label that indicates the type of relationship with its core word; Based on the information obtained, a syntax tree is constructed; The subtree kernel function is used to calculate the shared substructure of the syntactic trees of two sentences to quantify the semantic and grammatical similarity between the sentences; According to the calculated dependency tree similarity score, several most similar sentences are matched from the training samples to each sentence in the test set as context learning example samples.

6. The Chinese semantic error detection system based on context learning according to claim 5 is characterized in that: The syntax tree is represented by a mathematical directed acyclic graph.

7. The Chinese semantic error detection system based on context learning according to claim 2 is characterized in that: The work content of the template filling output module includes: Mapping the context learning example samples selected by the example selection module to the structured template set constructed by the semantic error mechanism mining module, and extracting the semantic error type and error cause of the example sentence from the structured template set; The semantic error type and error cause are filled into a predefined template containing prompt words and corresponding target detection samples.

8. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the content of the Chinese semantic error detection system based on context learning as described in any one of claims 1 to 7 is realized.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the content of the Chinese semantic error detection system based on context learning as described in any one of claims 1 to 7 is realized.

10. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the content of the Chinese semantic error detection system based on context learning as described in any one of claims 1 to 7.