A chinese second language sentence component recognition method and system for teaching grammar

CN122987906APending Publication Date: 2026-10-27BEIJING LANGUAGE AND CULTURE UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611006151.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-07
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0007]本发明旨在提供一种面向教学语法的汉语二语句子成分识别方法和系统,解决现有依存句法映射方法在教学语法应用中存在的功能单位边界不稳、多层结构表达不足、结构结果不可直接用于语法点匹配等成分功能单位表达局限与多重语法功能表达局限问题

Benefits of technology

本发明能够稳定表达主语、谓语、宾语、定语、状语、补语等教学语法功能单位及其多层嵌套关系,减少依存句法映射误差,提高复杂句式下句子成分识别的完整性和可解释性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122987906A_ABST
    Figure CN122987906A_ABST
Patent Text Reader

Abstract

The application provides a Chinese second language sentence component recognition method and system facing teaching grammar, and belongs to the technical field of natural language processing and computer-aided language teaching, and comprises the following steps: retrieving grammar rules, structure templates and similar example sentences related to a Chinese sentence to be recognized from a pre-constructed teaching grammar knowledge base, and forming a teaching grammar knowledge context for subsequent Prompt construction calls; converting a teaching grammar component structure into a hierarchical structure linear output form that can be output by a generative language model; constructing a constrained Prompt comprising a teaching grammar knowledge context, hierarchical structure linear output format constraints, prohibited rules and a small amount of examples; generating a hierarchical sentence component structure according to the Prompt and calling the generative language model, and parsing the hierarchical sentence component structure into a candidate component interval set; performing legality verification on the candidate component interval set; and outputting a structured sentence component recognition result after the verification is passed. The application can accurately recognize Chinese second language sentence components directly facing teaching grammar.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of natural language processing and computer-aided language teaching technology, and specifically refers to a method and system for identifying sentence components in Chinese two sentences for teaching grammar. Background Technology

[0002] In international Chinese language education, stable sentence component identification results are needed for grammar point identification, textbook grading, learner ability diagnosis, and intelligent teaching feedback. Existing solutions typically map dependency parsing results to teaching grammar components or rely on trigger words, parts of speech, and rule templates to identify some grammar points. These solutions are effective for grammar points with fixed trigger word types, but they tend to suffer from structural deficiencies when dealing with grammar points that are determined based on sentence components.

[0003] First, dependency parsing uses the dependency relationship between terms as the basic unit, while sentence components in instructional grammar emphasize whole units with clear functional boundaries. For example, "newly bought mobile phone" can be used as a whole as an object in instructional grammar for the determination of "ba" sentences, and it also contains an attributive structure; dependency parsing often breaks it down into multiple word-level relationships, making it difficult for subsequent rules to reconstruct the complete component stably.

[0004] Secondly, instructional grammar allows multiple functional units within the same sentence to coexist at different levels. For example, a subject may contain an attributive, a predicate may contain an adverbial and a complement, and some structures may even serve multiple grammatical points simultaneously. A single dependency tree or a single-level tag sequence cannot fully express such multi-level coexistence relationships.

[0005] Furthermore, existing prompt-based large language model question answering methods mostly remain at the level of natural language interpretation or single generation, lacking knowledge retrieval for teaching grammar, output format constraints, hierarchical validity verification, and failure regeneration mechanisms. This can lead to problems such as missing labels, cross-nesting, boundary misalignment, and inconsistencies with teaching rules in the generated results.

[0006] Therefore, a sentence component recognition technology redesigned to meet the teaching grammar task objectives is needed, so that the model output space directly corresponds to the functional unit structure required by the teaching grammar, and can ensure the usability, interpretability and batch processing capability of the results through structural constraints. Summary of the Invention

[0007] This invention aims to provide a method and system for identifying sentence components in Chinese second language for teaching grammar, and to solve the problems of existing dependency syntax mapping methods in teaching grammar, such as unstable functional unit boundaries, insufficient expression of multi-level structures, and the inability of structural results to be directly used for grammar point matching, which are limited in expressing component functional units and multiple grammatical functions.

[0008] The core technical problems that this invention aims to solve include: How to transform the problem of restoring Chinese sentence components from word-level dependency relations into the problem of interval set prediction with clear start and end positions, functional categories and hierarchical relationships.

[0009] How can we use a teaching grammar knowledge base to enhance the context of a large language model so that the model output conforms to the component division principles in the international Chinese education grammar system?

[0010] How to transform nestable sentence component structures into linear representations that can be stably output by generative models and parsed by machines.

[0011] How to perform label closure, boundary consistency, non-intersecting nesting, function combination, and teaching rule consistency checks on the generated results, and trigger regeneration or local correction when failure occurs.

[0012] How to output structured sentence components that can be directly accessed by grammar point recognition, text difficulty assessment, and teaching feedback systems.

[0013] On the one hand, a method for identifying sentence components in Chinese second language sentences oriented towards grammar instruction is provided, which includes: S1. Input preprocessing and index construction: Input the Chinese sentence to be recognized, and perform preprocessing and position index construction on the Chinese sentence; S2. Construction of a teaching grammar knowledge base: Construct a teaching grammar knowledge base that includes grammar rules, structural templates, and annotation examples; S3. Relevant knowledge retrieval and context enhancement: Retrieve grammar rules, structural templates and similar example sentences related to the Chinese sentence from the teaching grammar knowledge base, and organize the retrieval results to form a teaching grammar knowledge context for subsequent Prompt construction; S4. Linearized representation of hierarchical structure: Transforms the structure of grammatical components taught into a linear output form of hierarchical structure that can be output by a generative language model; S5. Constrained Prompt Construction: Construct a constrained Prompt that includes the teaching grammar knowledge context, hierarchical linear output format constraints, prohibition rules, and a small number of examples; S6. Generation of hierarchical sentence component structure: Based on the constrained Prompt, the generative language model is called to generate a hierarchical sentence component structure, and the hierarchical sentence component structure is parsed into a set of candidate component intervals; S7. Structural validity verification: Perform a validity verification on the set of candidate component intervals; S8. Error location and regeneration: When the verification fails, a feedback prompt is generated according to the error type, triggering a complete regeneration or local correction; S9. Result Standardization and Downstream Output: Output the structured sentence component recognition results after the verification is passed.

[0014] Optionally, S3 specifically includes: Retrieval features are extracted based on the word form clues, function words, structural trigger words, and candidate phrase types of the Chinese sentences; Using the aforementioned retrieval features as index conditions, one or more methods, such as keyword matching, rule index matching, structural template matching, and example sentence similarity matching, are employed to retrieve grammar rules, structural templates, and similar example sentences related to the current sentence from the teaching grammar knowledge base. The search results are organized to form a teaching grammar context for subsequent Prompt construction.

[0015] Optionally, the hierarchical linear output form includes nested label sequences or interval lists, preserving the text boundaries, functional categories, and parent-child inclusion relationships of sentence components.

[0016] Optionally, the prohibition rule explicitly requires the model to output a complete hierarchical structure, without omitting label closures, without generating overlapping intervals, and without outputting text inconsistent with the original sentence.

[0017] Optionally, the set of component intervals is represented as C = {c i}, each component c i = <l i , r i , t i , p i , a i >, where l i With r i t represents the start and end indices of a component in the input sentence. i Indicates the component category, with values ​​including one or more extended tags from subject, predicate, object, attributive, adverbial, and complement. i Indicates a parent component or hierarchical path. i This indicates additional attributes related to syntax point matching.

[0018] Optionally, the set of candidate component intervals must satisfy the following constraints: Continuity constraint: Each component corresponds to a continuous text interval in the original sentence; Functional constraints: Each section has a clearly defined instructional grammar function label; Hierarchical constraints: Components are allowed to contain each other but not to overlap; Cooperative constraint: Multiple functional components can exist in parallel in the same output while maintaining the consistency of the overall structure.

[0019] Optionally, the legality verification is implemented by program rules, or by a combination of rules and a discriminative model, including the following verification items: Tag validity check: Check whether only preset sentence component tags are used, and whether there are unclosed tags, incorrect tags, or missing nesting levels; Text consistency check: Compare the text after removing the labels with the input sentence to ensure that the model has not added, deleted, rewritten or misplaced the original sentence text; Boundary continuity check: Ensure that each component maps to a continuous interval of the input sentence, and do not allow a single component to be formed by splicing discontinuous segments; Non-cross-nested validation: For any two component intervals, only disjoint or inclusive relationships are allowed; l-intervals are not permitted. i < l j < r i < r j The intersection relationship; Functional combination verification: Check whether the combinations of subject-verb, verb-object, attributive-head, adverbial-head, verb-complement, pivot, and double object conform to the functional organization rules according to the teaching grammar rules; Completeness check: Checks whether the necessary components related to the grammar point to be identified are missing in the sentence, and outputs correction prompts for high-risk missing components.

[0020] On the other hand, a Chinese second-order sentence component recognition system for teaching grammar is provided, the system comprising: Input preprocessing and index building module: used to input the Chinese sentence to be recognized, and to preprocess and build the position index of the Chinese sentence; The teaching grammar knowledge base construction module is used to build a teaching grammar knowledge base that includes grammar rules, structure templates, and annotation examples. The relevant knowledge retrieval and context enhancement module is used to retrieve grammar rules, structural templates and similar example sentences related to the Chinese sentence from the teaching grammar knowledge base, and organize the retrieval results to form a teaching grammar knowledge context for subsequent Prompt construction. The hierarchical linearization representation module is used to convert the structure of the taught grammatical components into a hierarchical linear output form that can be output by a generative language model. Constrained Prompt Construction Module: Used to construct a constrained Prompt that includes the teaching grammar knowledge context, hierarchical linear output format constraints, prohibition rules, and a small number of examples; Sentence component hierarchical structure generation module: used to call the generative language model to generate a hierarchical sentence component structure based on the constrained Prompt, and parse the hierarchical sentence component structure into a set of candidate component intervals; Structural validity verification module: used to verify the validity of the candidate component interval set; Error location and regeneration module: When verification fails, it generates feedback prompts based on the error type, triggering overall regeneration or local correction; Results standardization and downstream output module: used to output structured sentence component recognition results after verification.

[0021] On the other hand, an electronic device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction, which is loaded and executed by the processor to implement the above-described method for identifying sentence components in Chinese two-sentence sentences for teaching grammar.

[0022] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction is stored in the storage medium, the at least one instruction being loaded and executed by a processor to implement the above-described method for identifying Chinese second-order sentence components for teaching grammar.

[0023] The beneficial effects of the technical solution provided by this invention include at least the following: This invention can stably express teaching grammatical functional units such as subject, predicate, object, attributive, adverbial, and complement, as well as their multi-level nested relationships, reduce dependency syntax mapping errors, and improve the completeness and interpretability of sentence component recognition in complex sentence structures.

[0024] The sentence component structure output by this invention can be directly used for grammar point recognition. For example, for sentences with the particle "ba", the structured result can be matched with the pattern "subject + ba + object 1 + verb + object 2"; for double object sentences, the pattern "subject + verb + give + object 1 + object 2" can be matched; for attributive phrases, the parent-child hierarchical path can be used to identify attributive or adverbial relationships.

[0025] Compared to dependency parsing post-processing, the output layer of this invention is the teaching grammatical component layer, reducing the conversion error from word-level dependency relations to teaching functional units. For sentences requiring multi-level analysis, both overall components and internal components can be retained in the same output, enabling multiple grammatical points to be matched in parallel. Specifically: 1. Improve the stability of functional unit boundaries: Directly output teaching grammatical components such as subject, predicate, object, attributive, adverbial, and complement, avoiding the loss of overall components caused by word-level dependency splitting.

[0026] 2. Supports parallel expression of multi-level structures: Allows legal nesting between components, and the same sentence can simultaneously retain the overall components and internal modifying components, adapting to multiple grammar points for joint judgment.

[0027] 3. Reduce the complexity of rule post-processing: Transform the complex mapping from dependency tree to teaching components into a structure generation and deterministic verification process, which facilitates engineering implementation and maintenance.

[0028] 4. Enhanced output interpretability: Each component contains text, boundaries, categories, hierarchical paths, and validation status, which can be directly used for teaching instructions and syntax point matching.

[0029] 5. Improve batch processing availability: Reduce illegal outputs caused by random generation of large language models through structural validity checks, error feedback, and regeneration mechanisms.

[0030] 6. Excellent scalability: The tag system, knowledge base, validation rules, and output format can all be expanded according to different teaching standards or grammar point libraries. Attached Figure Description

[0031] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying 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.

[0032] Figure 1 This is a flowchart of a method for identifying components of Chinese two-sentence sentences for teaching grammar, provided by an embodiment of the present invention; Figure 2 This is a flowchart illustrating the relevant knowledge retrieval and context enhancement process provided in this embodiment of the invention. Figure 3 This is a schematic diagram of the hierarchical interval set provided in an embodiment of the present invention; Figure 4 This is a block diagram of a Chinese two-sentence component recognition system for teaching grammar provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0033] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.

[0034] This invention defines the identification of sentence components in teaching grammar as a task of generating a hierarchical set of component intervals that satisfies the constraints of continuity, functionality, hierarchy, and synergy. This mainly includes: a knowledge enhancement mechanism that retrieves relevant rules and examples from a teaching grammar knowledge base and injects them into the generation context of a large language model; linearizing the hierarchical structure of sentence components into nested labels or interval lists, enabling the generative model to output parsable and verifiable structural results; a constrained Prompt construction method for the output of teaching grammar components, including task description, label system, teaching grammar knowledge context, hierarchical linear output format constraints, prohibition rules, and Few-shot examples; a deterministic verification mechanism that verifies the consistency of generated results with labels, text, boundaries, nesting, functional combinations, and teaching rules; a closed-loop optimization mechanism that triggers regeneration, local correction, or rule completion based on the type of verification error; and a structured output interface for grammar point identification, text difficulty assessment, and teaching feedback.

[0035] This invention provides a method for identifying sentence components in Chinese two-sentence sentences for teaching grammar. This method can be implemented by an electronic device, which can be a terminal or a server. Figure 1 The diagram shown is a flowchart of the method. The processing flow may include the following steps: S1. Input preprocessing and index construction: Input the Chinese sentence to be recognized, and perform preprocessing (character normalization, punctuation retention, optional word segmentation, etc.) and position index construction on the Chinese sentence; To avoid component boundary drift caused by different word segmentation strategies, this embodiment of the invention preferably uses character-level as the basic index, and can also record the mapping relationship between word-level index and character-level index.

[0036] S2. Construction of a teaching grammar knowledge base: Construct a teaching grammar knowledge base that includes grammar rules, structural templates, and annotation examples; Optionally, embodiments of the present invention construct a knowledge base based on the "International Chinese Language Education Chinese Proficiency Level Standards," the "International Chinese Language Education Chinese Proficiency Grammar Learning Handbook," "Modern Chinese," and manually annotated examples. The knowledge base includes at least the definitions of sentence components, structural rules such as subject-predicate, verb-object, attributive-head, adverbial-head, verb-complement, pivot, double object, and "ba" sentences, structural templates related to grammar point determination, and manually annotated example sentences.

[0037] S3. Relevant knowledge retrieval and context enhancement: Retrieve grammar rules, structural templates and similar example sentences related to the Chinese sentence from the teaching grammar knowledge base, and organize the retrieval results to form a teaching grammar knowledge context for subsequent Prompt construction; Optionally, such as Figure 2As shown, the embodiments of the present invention extract retrieval features based on the morphological cues of the input Chinese sentence (including the word itself, part of speech, word formation pattern, word length, and category information such as verbs, nouns, adjectives, adverbs, etc.), function words (including words with grammatical prompting effects such as prepositions, auxiliaries, conjunctions, adverbs, for example, "ba", "bei", "bi", etc.), structure trigger words (words or phrases that can directly indicate a specific syntactic structure), and candidate phrase types (such as attributive-head phrases, modifier-head phrases, etc.), and use the retrieval features as index conditions, adopting one or more of keyword matching, rule index matching, structure template matching, and example sentence similarity matching to retrieve grammatical rules, structure templates, and manually labeled similar example sentences related to the Chinese sentence from the pedagogical grammar knowledge base; then the retrieval results are organized to form a pedagogical grammar context for subsequent Prompt construction and invocation.

[0038] S4. Linearized representation of hierarchical structure: Convert the pedagogical grammatical component structure into a linear output form of hierarchical structure that can be output by the generative language model; The preferred form of the embodiment of the present invention is a nested tag sequence, for example, <subject><attributive>all< / attributive>students< / subject>; an interval list form can also be adopted, for example, [{label:'subject',span:[0,3],text:'all students'}], which retains the text boundaries, functional categories and parent-child inclusion relationships of the sentence components.

[0039] S5. Constrained Prompt construction: Construct a constrained Prompt including the pedagogical grammar knowledge context, hierarchical structure linear output format constraints, prohibition rules and a small number of examples; Optionally, the constrained Prompt includes task description, tag system, pedagogical grammar knowledge context, hierarchical structure linear output format constraints, prohibition rules and a small number of examples, wherein the prohibition rules explicitly require the model to output a complete hierarchical structure, must not omit tag closures, must not generate cross intervals, and must not output text inconsistent with the original sentence.

[0040] S6. Generation of sentence component hierarchical structure: According to the constrained Prompt, call the generative language model to generate a hierarchical sentence component structure, and parse the hierarchical sentence component structure into a candidate component interval set; Optionally, the component interval set is expressed as C={c i}, each component c i =<l i , r i , t i , p i , a i >, where l i and r it represents the start and end indices of a component in the input sentence. i Indicates the component category, with values ​​including one or more extended tags from subject, predicate, object, attributive, adverbial, and complement. i Indicates a parent component or hierarchical path. i This indicates additional attributes related to syntax point matching.

[0041] Optionally, the set of candidate component intervals must satisfy the following constraints: Continuity constraint: Each component corresponds to a continuous text interval in the original sentence; Functional constraints: Each section has a clearly defined instructional grammar function label; Hierarchical constraints: Components are allowed to contain each other but not to overlap; Cooperative constraint: Multiple functional components can exist in parallel in the same output while maintaining the consistency of the overall structure.

[0042] like Figure 3 The diagram shown is a schematic diagram of the hierarchical interval set provided in an embodiment of the present invention.

[0043] S7. Structural validity verification: Perform a validity verification on the set of candidate component intervals; Optionally, the legality verification is implemented by program rules, or by a combination of rules and a discriminative model, including the following verification items: Tag validity check: Check whether only preset sentence component tags are used, and whether there are unclosed tags, incorrect tags, or missing nesting levels; Text consistency check: Compare the text after removing the labels with the input sentence to ensure that the model has not added, deleted, rewritten or misplaced the original sentence text; Boundary continuity check: Ensure that each component maps to a continuous interval of the input sentence, and do not allow a single component to be formed by splicing discontinuous segments; Non-cross-nested validation: For any two component intervals, only disjoint or inclusive relationships are allowed; l-intervals are not permitted. i < l j < r i < r j The intersection relationship; Functional combination verification: Check whether the combinations of subject-verb, verb-object, attributive-head, adverbial-head, verb-complement, pivot, and double object conform to the functional organization rules according to the teaching grammar rules; Completeness check: Checks whether the necessary components related to the grammar point to be identified are missing in the sentence, and outputs correction prompts for high-risk missing components.

[0044] S8. Error location and regeneration: When the verification fails, a feedback prompt is generated according to the error type, triggering a complete regeneration or local correction; For example, if the label is not closed, the label needs to be completed; if there is an intersection, the boundary needs to be redefined; if a key component is missing, the analysis needs to be re-analyzed around the specified structure.

[0045] Once the number of regenerations reaches the threshold, rule completion or manual review and marking can be enabled.

[0046] S9. Result Standardization and Downstream Output: Output the structured sentence component recognition results after the verification is passed.

[0047] Optionally, embodiments of the present invention convert valid results into unified JSON, XML, tabular, or database records for use in automatic grammar point recognition, instructional explanation generation, text difficulty assessment, and learner feedback systems. The output also includes component text, start and end positions, category, hierarchical path, confidence level, triggering rules, and verification status, as shown in Table 1: Table 1

[0048] The present invention provides a method for identifying sentence components in Chinese two-sentence sentences for teaching grammar, as shown in Table 2: Table 2

[0049] This invention uses example sentences from authoritative grammar teaching materials such as "Grammar Learning Handbook" as a foundation to construct 700 test samples, covering different structural complexities at the elementary, intermediate, and advanced levels. The experiment uses dependency parsing tools (selecting the classic HanLP) + rule mapping as a baseline, and utilizes the methods of this invention (selecting classic large language models DeepSeek, Kimi, and Doubao). The experimental results are shown in Table 3. Table 3

[0050] The above results show that the embodiments of the present invention reduce the conversion error between dependency analysis and teaching grammar functional units by directly setting the output space to the hierarchical component structure required by teaching grammar; and improve the boundary stability and overall structural completeness in scenarios such as complex modifiers, "ba" sentences, pivot sentences, and double object sentences through knowledge enhancement and structure verification mechanisms.

[0051] Three specific implementation examples are given below: Example 1: Identification of multi-layered components in sentences The input sentence is "Dad gave the newly bought mobile phone to his younger sister." The system first retrieves teaching grammar rules related to "ba-construction", "modifier-head phrase" and "prepositional-object phrase", and then generates a constrained Prompt. In the model output, "Dad" is labeled as the subject, "gave the newly bought mobile phone" is labeled as an adverbial or prepositional-object structure, "the newly bought mobile phone" is labeled as the object, and internally, "newly bought" is labeled as an attributive. This result supports both the matching of the "ba" construction and the recognition of modifier-head phrases and prepositional-object phrases.

[0052] Example 2: Recognition of direct object and indirect object in a double-object sentence

[0053] The input sentence is "My sister gave me a mobile phone." According to the teaching rule of "subject + verb + gei + object 1 + object 2", the system recognizes "My sister" as the subject, "gave" as the predicate, "me" as the indirect object, and "a mobile phone" as the direct object, and can further recognize "a" as an attributive and "mobile phone" as the head component. Compared with the dependency parsing path, this output directly retains the object functional units required for teaching grammar.

[0054] Example 3: Regeneration after structure verification failure

[0055] If a cross or incorrectly closed structure such as "<subject>Outside the <attributive>sound< / subject>< / attributive>" appears in the model output result, the verification module identifies it as a tag nesting error, and generates a feedback prompt: "There is a tag closing sequence error in the output. Please keep the parent tag enclosing the child tag and do not change the original sentence text." The model regenerates a legal structure accordingly, for example, <subject><attributive>Outside the< / attributive> sound< / subject>.

[0056] Alternative implementations of the embodiments of the present invention: The generative language model can be a cloud large language model, a locally deployed large model, a fine-tuned dedicated model, or a combination of a rule generation model and a large language model.

[0057] Knowledge retrieval can adopt keyword matching, vector retrieval, grammar point trigger word retrieval, similar example sentence retrieval, or a fusion of multiple retrieval methods.

[0058] The output representation can adopt XML, JSON, parenthesized expressions, BIOES extended tags, tree structure objects or database records, as long as it can express the component boundaries, categories and hierarchical relationships.

[0059] The legality verification can be implemented by deterministic rules, and can also be assisted by introducing a classifier, a constraint decoder or a finite state automaton.

[0060] When the model reasoning cost is limited, rule templates can be used for recognition of simple sentences, and large language model structure generation can be enabled for complex sentences, so as to form a hierarchical processing scheme.

[0061] like Figure 4 As shown in the figure, this invention also provides a Chinese second-order sentence component recognition system for teaching grammar, the system comprising: Input preprocessing and index building module: used to input the Chinese sentence to be recognized, and to preprocess and build the position index of the Chinese sentence; The teaching grammar knowledge base construction module is used to build a teaching grammar knowledge base that includes grammar rules, structure templates, and annotation examples. The relevant knowledge retrieval and context enhancement module is used to retrieve grammar rules, structural templates and similar example sentences related to the Chinese sentence from the teaching grammar knowledge base, and organize the retrieval results to form a teaching grammar knowledge context for subsequent Prompt construction. The hierarchical linearization representation module is used to convert the structure of the taught grammatical components into a hierarchical linear output form that can be output by a generative language model. Constrained Prompt Construction Module: Used to construct a constrained Prompt that includes the teaching grammar knowledge context, hierarchical linear output format constraints, prohibition rules, and a small number of examples; Sentence component hierarchical structure generation module: used to call the generative language model to generate a hierarchical sentence component structure based on the constrained Prompt, and parse the hierarchical sentence component structure into a set of candidate component intervals; Structural validity verification module: used to verify the validity of the candidate component interval set; Error location and regeneration module: When verification fails, it generates feedback prompts based on the error type, triggering overall regeneration or local correction; Results standardization and downstream output module: used to output structured sentence component recognition results after verification.

[0062] The present invention provides a Chinese two-sentence sentence component recognition system for teaching grammar, the functional structure of which corresponds to the Chinese two-sentence sentence component recognition method for teaching grammar provided in the present invention, and will not be described again here.

[0063] Figure 5This is a schematic diagram of the structure of an electronic device 500 provided in an embodiment of the present invention. The electronic device 500 may vary considerably due to different configurations or performance. It may include one or more central processing units (CPUs) 501 and one or more memories 502. The memory 502 stores at least one instruction, which is loaded and executed by the processor 501 to implement the steps of the above-mentioned method for identifying sentence components in Chinese two-sentence sentences for teaching grammar.

[0064] In an exemplary embodiment, a computer-readable storage medium is also provided, such as a memory including instructions that can be executed by a processor in a terminal to complete the aforementioned method for identifying sentence components in Chinese two-character sentences for instructional grammar. For example, the computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, or optical data storage device.

[0065] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0066] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for identifying sentence components in Chinese second language sentences for teaching grammar, characterized in that, The method includes: S1. Input preprocessing and index construction: Input the Chinese sentence to be recognized, and perform preprocessing and position index construction on the Chinese sentence; S2. Construction of a teaching grammar knowledge base: Construct a teaching grammar knowledge base that includes grammar rules, structural templates, and annotation examples; S3. Relevant knowledge retrieval and context enhancement: Retrieve grammar rules, structural templates and similar example sentences related to the Chinese sentence from the teaching grammar knowledge base, and organize the retrieval results to form a teaching grammar knowledge context for subsequent Prompt construction; S4. Linearized representation of hierarchical structure: Transforms the structure of grammatical components taught into a linear output form of hierarchical structure that can be output by a generative language model; S5. Constrained Prompt Construction: Construct a constrained Prompt that includes the teaching grammar knowledge context, hierarchical linear output format constraints, prohibition rules, and a small number of examples; S6. Generation of hierarchical sentence component structure: Based on the constrained Prompt, the generative language model is called to generate a hierarchical sentence component structure, and the hierarchical sentence component structure is parsed into a set of candidate component intervals; S7. Structural validity verification: Perform a validity verification on the set of candidate component intervals; S8. Error location and regeneration: When the verification fails, a feedback prompt is generated according to the error type, triggering a complete regeneration or local correction; S9. Result Standardization and Downstream Output: Output the structured sentence component recognition results after the verification is passed.

2. The method according to claim 1, characterized in that, S3 specifically includes: Retrieval features are extracted based on the word form clues, function words, structural trigger words, and candidate phrase types of the Chinese sentences; Using the aforementioned retrieval features as index conditions, one or more methods, such as keyword matching, rule index matching, structural template matching, and example sentence similarity matching, are employed to retrieve grammar rules, structural templates, and similar example sentences related to the current sentence from the teaching grammar knowledge base. The search results are organized to form a teaching grammar context for subsequent Prompt construction.

3. The method according to claim 1, characterized in that, The hierarchical linear output format includes nested label sequences or interval lists, preserving the text boundaries, functional categories, and parent-child inclusion relationships of sentence components.

4. The method according to claim 1, characterized in that, The prohibition rules explicitly require the model to output a complete hierarchical structure, without omitting label closures, without generating overlapping intervals, and without outputting text inconsistent with the original sentence.

5. The method according to claim 1, characterized in that, The set of component intervals is represented as C={c i }, each component c i = <l i , r i , t i , p i , a i >, where l i With r i t represents the start and end indices of a component in the input sentence. i Indicates the component category, with values ​​including one or more extended tags from subject, predicate, object, attributive, adverbial, and complement. i Indicates a parent component or hierarchical path. i This indicates additional attributes related to syntax point matching.

6. The method according to claim 1, characterized in that, The set of candidate component intervals must satisfy the following constraints: Continuity constraint: Each component corresponds to a continuous text interval in the original sentence; Functional constraints: Each section has a clearly defined instructional grammar function label; Hierarchical constraints: Components are allowed to contain each other but not to overlap; Cooperative constraint: Multiple functional components can exist in parallel in the same output while maintaining the consistency of the overall structure.

7. The method according to claim 1, characterized in that, The legality verification is implemented by program rules, or by a combination of rules and a discrimination model, and includes the following verification items: Tag validity check: Check whether only preset sentence component tags are used, and whether there are unclosed tags, incorrect tags, or missing nesting levels; Text consistency check: Compare the text after removing the labels with the input sentence to ensure that the model has not added, deleted, rewritten or misplaced the original sentence text; Boundary continuity check: Ensure that each component maps to a continuous interval of the input sentence, and do not allow a single component to be formed by splicing discontinuous segments; Non-cross-nested validation: For any two component intervals, only disjoint or inclusive relationships are allowed; l-intervals are not permitted. i < l j < r i < r j The intersection relationship; Functional combination verification: Check whether the combinations of subject-verb, verb-object, attributive-head, adverbial-head, verb-complement, pivot, and double object conform to the functional organization rules according to the teaching grammar rules; Completeness check: Checks whether the necessary components related to the grammar point to be identified are missing in the sentence, and outputs correction prompts for high-risk missing components.

8. A Chinese second-order sentence component recognition system for teaching grammar, characterized in that, The system includes: Input preprocessing and index building module: used to input the Chinese sentence to be recognized, and to preprocess and build the position index of the Chinese sentence; The teaching grammar knowledge base construction module is used to build a teaching grammar knowledge base that includes grammar rules, structure templates, and annotation examples. The relevant knowledge retrieval and context enhancement module is used to retrieve grammar rules, structural templates and similar example sentences related to the Chinese sentence from the teaching grammar knowledge base, and organize the retrieval results to form a teaching grammar knowledge context for subsequent Prompt construction. The hierarchical linearization representation module is used to convert the structure of the taught grammatical components into a hierarchical linear output form that can be output by a generative language model. Constrained Prompt Construction Module: Used to construct a constrained Prompt that includes the teaching grammar knowledge context, hierarchical linear output format constraints, prohibition rules, and a small number of examples; Sentence component hierarchical structure generation module: used to call the generative language model to generate a hierarchical sentence component structure based on the constrained Prompt, and parse the hierarchical sentence component structure into a set of candidate component intervals; Structural validity verification module: used to verify the validity of the candidate component interval set; Error location and regeneration module: When verification fails, it generates feedback prompts based on the error type, triggering overall regeneration or local correction; Results standardization and downstream output module: used to output structured sentence component recognition results after verification.

9. An electronic device comprising a processor and a memory, wherein the memory stores at least one instruction, characterized in that, The at least one instruction is loaded and executed by the processor to implement the Chinese two-sentence component recognition method for teaching grammar as described in any one of claims 1-7.

10. A computer-readable storage medium storing at least one instruction, characterized in that, The at least one instruction is loaded and executed by the processor to implement the Chinese two-sentence component recognition method for teaching grammar as described in any one of claims 1-7.