Grammar analysis method and related device

By combining a pre-defined grammar knowledge base and a large language model, the problem of being unable to parse objects that exceed a fixed range in existing technologies has been solved, achieving more efficient and accurate grammar parsing, meeting the learning needs of different users, and improving the quality of grammar learning.

CN121809467APending Publication Date: 2026-04-07HEFEI IFLYTEK TOYCLOUD TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-22
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

The existing syntax parsing function can only use a preset syntax knowledge base for syntax parsing, which results in the inability to parse or the parsing of objects that exceed a fixed range, affecting the quality of users' syntax learning.

Method used

The method combines a pre-set grammar knowledge base with a large language model. First, the pre-set grammar knowledge base is queried. If the target object is not found, the large language model with grammar knowledge generation function is used for grammar analysis. The results can be generated by human experts through manual correction and personalized analysis prompts can be provided based on the user's learning stage information.

Benefits of technology

It improves the reliability and accuracy of grammar parsing, meets the learning needs of different users, and enhances the quality of grammar learning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121809467A_ABST
    Figure CN121809467A_ABST
Patent Text Reader

Abstract

The invention discloses a grammar analysis method and a related device, and relates to the technical field of language learning, a preset grammar knowledge base at least comprises a textbook grammar knowledge base, and the textbook grammar knowledge base comprises a first pre-stored object and grammar knowledge of the first pre-stored object; the first pre-stored object is a high-frequency object in a fixed teaching material range, the grammar analysis model is a large language model with a grammar knowledge generation function, after a target object input by a user is obtained, the target object is inquired from a preset grammar knowledge base, and when the target object is not inquired from the preset grammar knowledge base, the grammar analysis model is a large language model with a grammar knowledge generation function. The grammar analysis model is utilized to perform grammar analysis on the target object, the generated result of the grammar analysis model is obtained and serves as the grammar analysis result, and in the scheme, for the target object which cannot provide grammar analysis based on the preset grammar knowledge base, the grammar analysis of the target object by utilizing the large language model is supported; therefore, according to the scheme, the reliability of grammar analysis can be improved, and then the grammar learning quality of the user is guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of language learning technology, and in particular to a grammar parsing method and related apparatus. Background Technology

[0002] In today's increasingly globalized world, language learning (Chinese, French, Russian, Spanish, Arabic, English, etc.) is of paramount importance for personal development, international exchange, and cultural dissemination. With advancements in science and technology, electronic products (such as learning machines and dictionary pens) have emerged, incorporating language learning systems. These devices allow users to learn languages ​​more conveniently. For instance, with a dictionary pen, a simple scan of the desired object (character, word, sentence, etc.) produces the search results. Compared to traditional paper dictionaries and manually input electronic dictionaries, this method is far more convenient, significantly enhancing the ease of language learning for users.

[0003] Grammar is the set of rules governing the formation and use of words, phrases, and sentences in a language, primarily encompassing morphology and syntax. In language learning, grammar determines the accuracy of expression, helps users quickly grasp language rules, and enhances the systematic nature of comprehension and output. Users have a significant need to learn grammar during the language learning process. Therefore, it is particularly necessary to perform grammatical analysis on user-input queries to obtain grammatical knowledge, and then provide this knowledge to users to facilitate their grammar learning.

[0004] However, the existing syntax parsing function can only use a preset syntax knowledge base for syntax parsing. The preset syntax knowledge base only contains syntax knowledge of objects within a fixed range (such as textbooks). For objects outside the fixed range, it will result in the inability to parse them or syntax parsing errors, thus causing trouble for users' syntax learning.

[0005] Therefore, how to provide a syntax parsing method to improve the reliability of syntax parsing and thus ensure the quality of users' syntax learning has become a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0006] In view of the above problems, this application provides a syntax parsing method and related apparatus to improve the reliability of syntax parsing, thereby ensuring the quality of users' syntax learning. The specific solution is as follows:

[0007] The first aspect of this application provides a syntax parsing method, including:

[0008] Obtain the target object for syntax parsing from user input;

[0009] The target object is queried from a preset grammar knowledge base to obtain query results; the preset grammar knowledge base includes at least a textbook grammar knowledge base, which contains a first pre-stored object and its grammar knowledge; the first pre-stored object is a high-frequency object within a fixed textbook range;

[0010] When the query result indicates that the target object is not found in the preset grammar knowledge base, the target object is parsed using a grammar parsing model, and the generated result of the grammar parsing model is used as the grammar parsing result. The grammar parsing model is a large language model with grammar knowledge generation function.

[0011] In one possible implementation, after querying the target object from a preset grammar knowledge base and obtaining the query result, the method further includes:

[0012] When the query result indicates that the target object is found from the preset grammar knowledge base, the grammar parsing result is determined based on the grammar knowledge of the pre-stored objects that match the target object stored in the preset grammar knowledge base.

[0013] In one possible implementation, determining the syntax parsing result based on the syntax knowledge of pre-stored objects matching the target object stored in the preset syntax knowledge base includes:

[0014] Determine the user's academic level information;

[0015] From the grammatical knowledge of pre-stored objects that match the target object stored in the preset grammatical knowledge base, the target grammatical knowledge points that match the user's academic level information are determined as the grammatical parsing result.

[0016] In one possible implementation, the preset grammar knowledge base also includes a human expert grammar knowledge base, which includes a second pre-stored object and its grammar knowledge; the second pre-stored object is an object other than the high-frequency objects within the scope of the fixed textbook; the grammar knowledge of each second pre-stored object is the result of human expert grammar parsing.

[0017] In one possible implementation, after parsing the target object using a syntax parsing model and obtaining the generated result of the syntax parsing model as the syntax parsing result, the method further includes:

[0018] The generated results of the syntax parsing model are manually corrected to generate human expert syntax parsing results;

[0019] Obtain the grammar parsing result from the human expert, and store the target object and the grammar parsing result from the human expert into the human expert grammar knowledge base.

[0020] In one possible implementation, the step of using a syntax parsing model to parse the target object and obtaining the generated result of the syntax parsing model as the syntax parsing result includes:

[0021] Obtain the user's academic level information;

[0022] Generate syntax parsing prompts that match the user's learning stage information; the syntax parsing prompts include syntax parsing task description information that matches the user's learning stage information and the target object to be parsed;

[0023] The syntax parsing prompt is input into the syntax parsing model, and the generated result of the syntax parsing model is used as the syntax parsing result.

[0024] In one possible implementation, the grammar parsing task description information matching the user's learning stage information includes: parsing step description information, grammar parsing result output format description information, and grammar parsing result output example; the parsing step description information includes multiple parsing steps executed sequentially.

[0025] In one possible implementation, after obtaining the syntax parsing result, the method further includes:

[0026] The syntax parsing results are displayed to the user, and the display interface includes a syntax parsing result source identifier and / or a syntax knowledge point identifier;

[0027] The syntax parsing result source identifier is used to indicate that the syntax parsing result is generated by the syntax parsing model, or the syntax parsing result source identifier is used to indicate that the syntax parsing result is obtained from a preset syntax knowledge base;

[0028] The grammar point identifier has the function of jumping to the detailed explanation of the grammar point after being triggered.

[0029] A second aspect of this application provides a syntax parsing apparatus, comprising:

[0030] Acquisition unit 11 is used to acquire the target object to be parsed by the user input;

[0031] Query unit 12 is used to query the target object from a preset grammar knowledge base and obtain query results; the preset grammar knowledge base includes at least a textbook grammar knowledge base, which contains a first pre-stored object and its grammar knowledge; the first pre-stored object is a high-frequency object within a fixed textbook range;

[0032] The generation unit 13 is used to perform grammatical parsing on the target object using a grammatical parsing model when the query result indicates that the target object is not found from the preset grammatical knowledge base, and obtain the generation result of the grammatical parsing model as the grammatical parsing result. The grammatical parsing model is a large language model with grammatical knowledge generation function.

[0033] In one possible implementation, the device further includes:

[0034] The syntax parsing result determination unit is used to determine the syntax parsing result based on the syntax knowledge of pre-stored objects that match the target object stored in the preset syntax knowledge base when the query result indicates that the target object has been found in the preset syntax knowledge base after querying the target object from the preset syntax knowledge base.

[0035] In one possible implementation, the syntax parsing result determination unit is specifically used for:

[0036] Determine the user's academic level information;

[0037] From the grammatical knowledge of pre-stored objects that match the target object stored in the preset grammatical knowledge base, the target grammatical knowledge points that match the user's academic level information are determined as the grammatical parsing result.

[0038] In one possible implementation, the preset grammar knowledge base also includes a human expert grammar knowledge base, which includes a second pre-stored object and its grammar knowledge; the second pre-stored object is an object other than the high-frequency objects within the scope of the fixed textbook; the grammar knowledge of each second pre-stored object is the result of human expert grammar parsing.

[0039] In one possible implementation, the device further includes:

[0040] The manual correction unit is used to manually correct the generated result of the syntax parsing model after the target object is parsed using the syntax parsing model and the generated result of the syntax parsing model is obtained as the syntax parsing result, so as to generate a manual expert syntax parsing result.

[0041] The storage unit is used to obtain the grammar parsing result from the human expert and store the target object and the grammar parsing result from the human expert into the human expert grammar knowledge base.

[0042] In one possible implementation, the generating unit includes:

[0043] The learning stage information acquisition unit is used to acquire the user's learning stage information;

[0044] A syntax parsing prompt generation unit is used to generate syntax parsing prompts that match the user's learning stage information; the syntax parsing prompts include syntax parsing task description information that matches the user's learning stage information and the target object to be parsed;

[0045] The input unit is used to input the syntax parsing prompts into the syntax parsing model and obtain the generated result of the syntax parsing model as the syntax parsing result.

[0046] In one possible implementation, the grammar parsing task description information matching the user's learning stage information includes: parsing step description information, grammar parsing result output format description information, and grammar parsing result output example; the parsing step description information includes multiple parsing steps executed sequentially.

[0047] In one possible implementation, the device further includes:

[0048] The display unit is used to display the syntax parsing result to the user after obtaining the syntax parsing result. The display interface includes a syntax parsing result source identifier and / or a syntax knowledge point identifier. The syntax parsing result source identifier is used to indicate that the syntax parsing result is generated by the syntax parsing model, or the syntax parsing result source identifier is used to indicate that the syntax parsing result is obtained from a preset syntax knowledge base. The syntax knowledge point identifier has the function of jumping to the detailed explanation of the syntax knowledge point after being triggered.

[0049] A third aspect of this application provides a computer program product including computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the syntax parsing method of the first aspect or any implementation thereof.

[0050] A fourth aspect of this application provides an electronic device, including at least one processor and a memory connected to the processor, wherein:

[0051] The memory is used to store computer programs;

[0052] The processor is used to execute the computer program so that the electronic device can implement the syntax parsing method of the first aspect or any implementation thereof.

[0053] The fifth aspect of this application provides a computer-readable storage medium carrying one or more computer programs that, when executed by an electronic device, enable the electronic device to perform the syntax parsing method described in the first aspect or any implementation thereof.

[0054] By means of the above technical solution, this application provides a syntax parsing method and related apparatus. The preset syntax knowledge base includes at least a textbook syntax knowledge base, which contains a first pre-stored object and its syntax knowledge. The first pre-stored object is a high-frequency object within a fixed textbook range. The syntax parsing model is a large language model with syntax knowledge generation function. After obtaining the target object to be parsed by the user input, the target object is first queried from the preset syntax knowledge base. When the target object is not found from the preset syntax knowledge base, the syntax parsing model is used to parse the target object, and the generation result of the syntax parsing model is used as the syntax parsing result. In this solution, for target objects that cannot be parsed based on the preset syntax knowledge base, the large language model is supported for syntax parsing. Therefore, this solution can improve the reliability of syntax parsing and thus ensure the quality of the user's syntax learning. Attached Figure Description

[0055] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.

[0056] Figure 1 A flowchart illustrating a syntax parsing method provided in an embodiment of this application;

[0057] Figure 2 This application provides an example diagram illustrating the grammar parsing results for different learning stages obtained based on a preset grammar knowledge base;

[0058] Figure 3 This application provides an example diagram illustrating the grammatical parsing results for different learning stages obtained based on a large language model;

[0059] Figure 4 This is a schematic diagram of the structure of a syntax parsing device provided in an embodiment of this application;

[0060] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0061] The embodiments of this application are described below with reference to the accompanying drawings. The terminology used in the implementation section of this application is for explaining specific embodiments only and is not intended to limit the scope of this application.

[0062] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.

[0063] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.

[0064] In today's increasingly globalized world, language learning (Chinese, French, Russian, Spanish, Arabic, English, etc.) is of paramount importance for personal development, international exchange, and cultural dissemination. With advancements in science and technology, electronic products (such as learning machines and dictionary pens) have emerged, incorporating language learning systems. These devices allow users to learn languages ​​more conveniently. For instance, with a dictionary pen, a simple scan of the desired object (character, word, sentence, etc.) produces the search results. Compared to traditional paper dictionaries and manually input electronic dictionaries, this method is far more convenient, significantly enhancing the ease of language learning for users.

[0065] Grammar is the set of rules governing the formation and use of words, phrases, and sentences in a language, primarily encompassing morphology and syntax. In language learning, grammar determines the accuracy of expression, helps users quickly grasp language rules, and enhances the systematic nature of comprehension and output. Users have a significant need to learn grammar during the language learning process. Therefore, it is particularly necessary to perform grammatical analysis on user-input queries to obtain grammatical knowledge, and then provide this knowledge to users to facilitate their grammar learning.

[0066] However, the existing syntax parsing function can only use a preset syntax knowledge base for syntax parsing. The preset syntax knowledge base only contains syntax knowledge of objects within a fixed range (such as textbooks). For objects outside the fixed range, it will result in the inability to parse them or syntax parsing errors, thus causing trouble for users' syntax learning.

[0067] To address the aforementioned issues, this application provides a syntax parsing method that improves the reliability of syntax parsing, thereby ensuring the quality of learning for users.

[0068] It should be noted that in this application, the grammar parsing can be the grammar parsing of any language type, including but not limited to Chinese, French, Russian, Spanish, Arabic, English, etc. There is no strict limitation in this application, and the specific settings can be made according to the needs of the scenario.

[0069] For ease of understanding, this application uses English as an example to explain the grammar parsing scheme in detail.

[0070] It should also be noted that the syntax parsing method of this application can be applied to electronic devices or servers with syntax parsing functions, such as mobile phones, tablets (e.g., learning machines), and scanning and recognition devices (e.g., dictionary pens). The embodiments of this application do not impose any restrictions on the specific type of electronic device.

[0071] The syntax parsing method of this application embodiment will be described in detail below with reference to the accompanying drawings.

[0072] Reference Figure 1 , Figure 1 This is a flowchart illustrating a syntax parsing method provided in an embodiment of this application, as shown below. Figure 1 As shown in the figure, the syntax parsing method provided in this application embodiment may include the following steps, which are described in detail below.

[0073] S101: Obtain the target object to be parsed by the user input;

[0074] In this application, the target object for grammar parsing refers to the content input by the user that requires querying its grammar knowledge. The target object can be obtained by scanning, taking a picture, or typing, etc. The specific input method is not strictly limited in this application and can be set according to the needs of the scenario.

[0075] In this application, the target object to be parsed can be a phrase, word, sentence, etc., and this application does not impose any limitations on it. Preferably, the target object to be parsed can be a sentence, such as the English sentence "Lily eats an apple after school every day."

[0076] S102: Query the target object from the preset grammar knowledge base to obtain the query result; the preset grammar knowledge base includes at least the textbook grammar knowledge base, which contains a first pre-stored object and its grammar knowledge; the first pre-stored object is a high-frequency object within a fixed textbook range;

[0077] In this application, the scope of fixed teaching materials can be the scope of teaching materials corresponding to instruction or the scope of teaching materials corresponding to language examinations, such as primary and secondary school English textbooks or the scope of teaching materials corresponding to English major examinations.

[0078] In this application, the first pre-stored object is a high-frequency object within a fixed textbook range, such as high-frequency sentences in primary school English textbooks. The grammatical knowledge of the first pre-stored object is obtained by human experts parsing the first pre-stored object, and therefore has high reliability.

[0079] In this application, querying the target object from a preset grammar knowledge base can be a query to determine whether there is a pre-stored object in the preset grammar knowledge base that matches the target object. Specifically, the matching similarity between the target object and each pre-stored object in the preset grammar knowledge base can be calculated. If the matching similarity between a pre-stored object in the grammar knowledge base and the target object meets a threshold, it is determined that there is a pre-stored object in the preset grammar knowledge base that matches the target object, that is, it is determined that the target object has been found from the preset grammar knowledge base. If the matching similarity between each pre-stored object in the grammar knowledge base and the target object does not meet the threshold, it is determined that there is no pre-stored object in the preset grammar knowledge base that matches the target object, that is, it is determined that the target object has not been found from the preset grammar knowledge base.

[0080] S103: When the query result indicates that the target object is not found from the preset grammar knowledge base, the target object is parsed using a grammar parsing model, and the generated result of the grammar parsing model is used as the grammar parsing result. The grammar parsing model is a large language model with grammar knowledge generation function.

[0081] In this application, the syntax parsing model can be any general-purpose large language model, or it can be a large language model that has been fine-tuned to acquire the function of generating grammatical knowledge. In this application, no limitation is made.

[0082] The syntax parsing method provided in this embodiment includes a preset syntax knowledge base that at least includes a textbook syntax knowledge base. This textbook syntax knowledge base contains a first pre-stored object and its syntax knowledge. The first pre-stored object is a high-frequency object within a fixed textbook range. The syntax parsing model is a large language model with syntax knowledge generation capabilities. After obtaining the target object to be parsed from the user's input, the method first queries the preset syntax knowledge base for the target object. If the target object is not found in the preset syntax knowledge base, the syntax parsing model is used to perform syntax parsing on the target object, and the generated result of the syntax parsing model is used as the syntax parsing result. In this solution, for target objects for which syntax parsing cannot be provided based on the preset syntax knowledge base, the large language model is supported for syntax parsing. Therefore, this solution can improve the reliability of syntax parsing, thereby ensuring the quality of the user's syntax learning.

[0083] In one possible implementation, after querying the target object from a preset grammar knowledge base and obtaining the query result, the method further includes:

[0084] When the query result indicates that the target object is found from the preset grammar knowledge base, the grammar parsing result is determined based on the grammar knowledge of the pre-stored objects that match the target object stored in the preset grammar knowledge base.

[0085] In one possible implementation, determining the syntax parsing result based on the syntax knowledge of pre-stored objects matching the target object stored in the preset syntax knowledge base includes:

[0086] S201: Determine the user's academic level information;

[0087] In this application, the user's educational stage information is used to determine the user's current educational stage, such as high school, junior high school, or primary school. Alternatively, the user's educational stage information can be used to determine which grade in junior high school (e.g., first year, second year, or third year) or which grade in high school. This application does not strictly limit this, and it can be set according to the specific needs of the scenario.

[0088] In this application, the user's educational stage information can be the user's age or educational level. This information can be entered by the user into an electronic device. This is not strictly limited in this embodiment and can be set according to the specific needs of the scenario. For example, if the electronic device is a dictionary pen, the pen can prompt the user to input or verify the accuracy of their educational stage information upon first use or each time the user uses it. Alternatively, the dictionary pen can prompt the user to verify the accuracy of their educational stage information at preset intervals. This is also not strictly limited in this embodiment and can be set according to the specific needs of the scenario.

[0089] S202: From the grammatical knowledge of pre-stored objects that match the target object stored in the preset grammatical knowledge base, determine the target grammatical knowledge points that match the user's academic level information as the grammatical parsing result.

[0090] In this application, the grammatical knowledge of the pre-stored objects that match the target object stored in the preset grammatical knowledge base may also include grammatical knowledge corresponding to different learning stages. Therefore, in this application, the target grammatical knowledge that matches the user's learning stage information may also be determined from the grammatical knowledge of the pre-stored objects that match the target object stored in the preset grammatical knowledge base as the grammatical parsing result.

[0091] Since different users possess different levels of knowledge, their needs for grammar learning also differ. In this application, for the same target object to be parsed, different grammar parsing results can be provided to users at different learning levels to meet the diverse needs of different users for grammar learning.

[0092] For easier understanding, please refer to Figure 2 , Figure 2 This application provides an example diagram illustrating the grammar parsing results for different learning stages obtained from a preset grammar knowledge base, as shown in the embodiments. Figure 2 As shown, the grammar analysis results are not the same for different learning stages.

[0093] In one possible implementation, the preset grammar knowledge base also includes a human expert grammar knowledge base, which includes a second pre-stored object and its grammar knowledge; the second pre-stored object is an object other than the high-frequency objects within the scope of the fixed textbook; the grammar knowledge of each second pre-stored object is the result of human expert grammar parsing.

[0094] After performing syntax parsing on the target object using the syntax parsing model and obtaining the generated result of the syntax parsing model as the syntax parsing result, the method further includes:

[0095] S301: Manually correct the generated results of the syntax parsing model to generate human expert syntax parsing results;

[0096] In this application, the generated result of the syntax parsing model can be input into the human expert intervention interface so that the human expert can manually correct the generated result of the syntax parsing model and generate the human expert syntax parsing result.

[0097] S302: Obtain the results of the human expert grammar parsing and store the target object and the results of the human expert grammar parsing in the human expert grammar knowledge base.

[0098] After storing the target object and the results of the human expert's grammar parsing in the human expert's grammar knowledge base, the target object can be used as a second pre-stored object, and its grammar knowledge can be stored in the human expert's grammar knowledge base. If other users also need to perform grammar parsing on the target object, they can quickly obtain the grammar parsing results by querying the pre-set grammar knowledge base. This not only ensures the reliability of the grammar parsing results but also further improves the efficiency of grammar parsing.

[0099] In one possible implementation, the step of using a syntax parsing model to parse the target object and obtaining the generated result of the syntax parsing model as the syntax parsing result includes:

[0100] S401: Obtain the user's academic level information;

[0101] In this application, the user's educational stage information is used to determine the user's current educational stage, such as high school, junior high school, or primary school. Alternatively, the user's educational stage information can be used to determine which grade in junior high school (e.g., first year, second year, or third year) or which grade in high school. This application does not strictly limit this, and it can be set according to the specific needs of the scenario.

[0102] In this application, the user's educational stage information can be the user's age or educational level. This information can be entered by the user into an electronic device. This is not strictly limited in this embodiment and can be set according to the specific needs of the scenario. For example, if the electronic device is a dictionary pen, the pen can prompt the user to input or verify the accuracy of their educational stage information upon first use or each time the user uses it. Alternatively, the dictionary pen can prompt the user to verify the accuracy of their educational stage information at preset intervals. This is also not strictly limited in this embodiment and can be set according to the specific needs of the scenario.

[0103] S402: Generate a syntax parsing prompt word that matches the user's learning stage information; the syntax parsing prompt word includes syntax parsing task description information that matches the user's learning stage information and the target object to be parsed; in one possible implementation, generating the syntax parsing prompt word that matches the user's learning stage information includes:

[0104] Obtain a grammar parsing prompt word template that matches the user's learning stage information. The grammar parsing prompt word template that matches the user's learning stage information includes grammar parsing task description information that matches the user's learning stage information and grammar parsing object filling slots.

[0105] The target object to be parsed is filled into the parsing object filling slot, generating a parsing prompt word corresponding to the user's learning stage information.

[0106] In this application, the grammar parsing prompt templates for different learning stages include different grammar parsing task descriptions. For example, the grammar parsing prompt template for primary school may include the following: "The parsing content can be based on the sentence and the key points and difficulties in primary school," and "The key points summary should include some grammar points that need to be paid attention to and mastered in primary school, as well as common fixed expressions. Pay special attention to extracting fixed expressions, and you can appropriately combine examples to explain them to help children quickly understand the key points." The grammar parsing prompt template for junior high school may include the following: "The parsing content can be based on the sentence and the middle school entrance examination points," and "The key points summary should be combined with the latest middle school entrance examination English examination guidelines of each province (city) and the 'Compulsory Education English Curriculum Standards' (2022)." The grammar knowledge requirements for Level 3 in the 2017 edition of the National College Entrance Examination (NCEE) should be used to judge the common test points and common mistakes in the NCEE, as well as common fixed expressions in junior high school. However, it is not necessary to mention words related to the new curriculum standards and test points. The grammar analysis prompts template for the high school level can include the following: "For the analysis content, you can judge based on the sentence situation and the NCEE test points." "The summary of key points should be combined with the latest NCEE English subject examination instructions and the grammar knowledge requirements in the NCEE English curriculum standards (2017 edition, 2020 revision), as well as the common test points and common mistakes in the NCEE, as well as common fixed expressions in high school. However, it is not necessary to mention words related to the new curriculum standards and test points."

[0107] In one possible implementation, the grammar parsing task description information matching the user's learning stage information includes: parsing step description information, grammar parsing result output format description information, and grammar parsing result output example; the parsing step description information includes multiple parsing steps executed sequentially.

[0108] In this application, the specific content of the parsing step description information, the specific format of the syntax parsing result output description information, and the specific form of the syntax parsing result output example can be set based on the requirements of the syntax parsing scenario, and this application does not impose any restrictions on this.

[0109] For ease of understanding, in this application, it is assumed that the grammar parsing object is an English sentence and the user's educational level is primary school. Therefore, the grammar parsing prompt word template can be as follows:

[0110] You are an experienced primary school English teacher. Please analyze the grammatical structure and components of the provided sentences scientifically, strictly following the steps below.

[0111] 1. First, determine if the sentence is a complete sentence. No output is needed; continue execution directly. If not, stop outputting: This is not a complete sentence.

[0112] 2. Next, the sentence translation is given. Then, the sentence is classified according to its structure: simple sentence, compound sentence, and complex sentence. No output is required. Select the corresponding case for the final output.

[0113] 3. Please strictly select grammar fields and tags from the "Syntax Analysis Fields" table. For example, if the sentence type is an existing sentence, the "there be" sentence type should not be displayed. Interrogative sentences can be judged to the last-level field of the table, but the judgment process and table classification should not be displayed. For example, it should conform to the "Category - Parallel Complex Sentences" classification in the table.

[0114] 4. Analyze the main components of the sentence without detailed breakdown. For example, in the object "short stories" and the modifier "short" (modifying the object "stories"), the modifier is a bit redundant. If necessary, it can be simply added in parentheses. For example, in the object "time to play it" (the infinitive phrase "to play it" acts as a post-modifier modifying "time"; "it" refers to the "a new basketball" mentioned earlier), the modifier is redundant.

[0115] 5. The analysis of sentence structure and specific components should not be contradictory. For example, if the sentence structure is subject-predicate, but the components are subject, predicate, and object (there is an extra object).

[0116] 6. For the analysis content, depending on the context of the sentence and the key points and difficulties in elementary school, you can use parentheses to provide concise supplementary explanations if necessary to aid understanding.

[0117] 7. Key Points Summary: This section summarizes grammar points and common fixed expressions that elementary school students need to pay attention to and master. Special attention should be paid to extracting fixed expressions, and examples can be used to explain them to help children quickly grasp the key points. The number of key points can be 1 to 3, with a maximum of 3. The total number of key points in the summary should not exceed 150 words.

[0118] 8. The output of components needs to be sorted in the following order: (subject, predicate, object, complement, predicate nominative, attributive, adverbial, appositive, conjunction, independent component).

[0119] If the sentence is a simple sentence, please output it according to the six fields: sentence category, sentence type, tense, components, and key points.

[0120] Example of output for simple sentence corresponding to grammar parsing results ×××.

[0121] If the sentence is of the "there be" structure, it needs to be output according to the fields of sentence category, sentence structure, tense, conjunction, components, and key points.

[0122] Example output of the syntax parsing result for the “there be” sentence pattern: ×××.

[0123] If the sentence is a compound sentence, first output the sentence category, structure, and coordinating conjunctions (if there are no coordinating conjunctions, this field will not be displayed), then distinguish the clauses, and then output the clause category, sentence type, tense, components, and key points summary for each clause.

[0124] Example of output for the grammar parsing result of coordinate sentences ×××.

[0125] If the sentence is a complex sentence with main and subordinate clauses, first output the sentence category and structure, then analyze the category, tense, and components of the main clause, followed by the category, tense, and components of the subordinate clause, and finally summarize the overall key points. Note the distinction between two cases:

[0126] (1) If the conjunction only serves to connect and has no meaning itself, the clause needs to be output according to four fields: category, tense, conjunction, and constituent.

[0127] Example ×××.

[0128] (2) If the introductory word functions as a sentence element in the subordinate clause, such as subject, object, predicate nominative, attributive, adverbial, complement, etc., the subordinate clause needs to be output according to the category, tense, element, and finally the overall key points.

[0129] Example ×××.

[0130] Based on the above rules, I input the sentence [×××]. Please provide the output content according to the format.

[0131] In this example, "Input sentence [×××]" is the grammar parsing object filling slot, and the rest is the grammar parsing task description information matched with the user's learning stage information. The grammar parsing task description information includes parsing step description information, which includes multiple parsing steps executed sequentially. For different sentence types, the corresponding grammar parsing result output format description information and grammar parsing result output examples are given.

[0132] S403: Input the syntax parsing prompt word into the syntax parsing model, and obtain the generation result of the syntax parsing model as the syntax parsing result.

[0133] Since different users possess different levels of knowledge, their needs for grammar learning also differ. In this application, for the same target object to be parsed, different grammar parsing results can be provided to users at different learning levels to meet the diverse needs of different users for grammar learning.

[0134] For easier understanding, please refer to Figure 3 , Figure 3 This application provides an example diagram illustrating the grammatical parsing results for different learning stages obtained based on a large language model, as shown in the embodiments. Figure 3 As shown, the grammar analysis results are not the same for different learning stages.

[0135] In one possible implementation, after obtaining the syntax parsing result, the method further includes:

[0136] The syntax parsing results are displayed to the user, and the display interface includes a syntax parsing result source identifier and / or a syntax knowledge point identifier;

[0137] The syntax parsing result source identifier is used to indicate that the syntax parsing result is generated by the syntax parsing model, or the syntax parsing result source identifier is used to indicate that the syntax parsing result is obtained from a preset syntax knowledge base;

[0138] The grammar point identifier has the function of jumping to the detailed explanation of the grammar point after being triggered.

[0139] In this application, there are no strict limitations on the display method; it can be displayed in plain text, plain voice, text + voice, text + audio + video, etc.

[0140] In this application, if the syntax parsing result is the generation result of the syntax parsing model, then the syntax parsing result source identifier is used to indicate that the syntax parsing result is generated by the syntax parsing model; if the syntax parsing result is the syntax knowledge corresponding to the target object stored in the preset syntax knowledge base, then the syntax parsing result source identifier is used to indicate that the syntax parsing result is obtained from the preset syntax knowledge base.

[0141] For ease of understanding, please refer to Figure 2 and Figure 3 ,like Figure 2 and Figure 3 As shown, "The above content was analyzed by human experts" and "The above content was generated by AI" are the source identifiers of the grammar analysis results. The fields highlighted and underlined in the grammar analysis results are the grammar knowledge point identifiers, which can be clicked to jump to the detailed explanation of the grammar knowledge point.

[0142] The above describes a syntax parsing method provided by an embodiment of this application. The following describes the apparatus for performing the above syntax parsing method.

[0143] Please see Figure 4 , Figure 4 This is a schematic diagram of a syntax parsing device provided in an embodiment of this application. Figure 4 As shown, the syntax parsing device includes:

[0144] Acquisition unit 11 is used to acquire the target object to be parsed by the user input;

[0145] Query unit 12 is used to query the target object from a preset grammar knowledge base and obtain query results; the preset grammar knowledge base includes at least a textbook grammar knowledge base, which contains a first pre-stored object and its grammar knowledge; the first pre-stored object is a high-frequency object within a fixed textbook range;

[0146] The generation unit 13 is used to perform grammatical parsing on the target object using a grammatical parsing model when the query result indicates that the target object is not found from the preset grammatical knowledge base, and obtain the generation result of the grammatical parsing model as the grammatical parsing result. The grammatical parsing model is a large language model with grammatical knowledge generation function.

[0147] In one possible implementation, the device further includes:

[0148] The syntax parsing result determination unit is used to determine the syntax parsing result based on the syntax knowledge of pre-stored objects that match the target object stored in the preset syntax knowledge base when the query result indicates that the target object has been found in the preset syntax knowledge base after querying the target object from the preset syntax knowledge base.

[0149] In one possible implementation, the syntax parsing result determination unit is specifically used for:

[0150] Determine the user's academic level information;

[0151] From the grammatical knowledge of pre-stored objects that match the target object stored in the preset grammatical knowledge base, the target grammatical knowledge points that match the user's academic level information are determined as the grammatical parsing result.

[0152] In one possible implementation, the preset grammar knowledge base also includes a human expert grammar knowledge base, which includes a second pre-stored object and its grammar knowledge; the second pre-stored object is an object other than the high-frequency objects within the scope of the fixed textbook; the grammar knowledge of each second pre-stored object is the result of human expert grammar parsing.

[0153] In one possible implementation, the device further includes:

[0154] The manual correction unit is used to manually correct the generated result of the syntax parsing model after the target object is parsed using the syntax parsing model and the generated result of the syntax parsing model is obtained as the syntax parsing result, so as to generate a manual expert syntax parsing result.

[0155] The storage unit is used to obtain the grammar parsing result from the human expert and store the target object and the grammar parsing result from the human expert into the human expert grammar knowledge base.

[0156] In one possible implementation, the generating unit includes:

[0157] The learning stage information acquisition unit is used to acquire the user's learning stage information;

[0158] A syntax parsing prompt generation unit is used to generate syntax parsing prompts that match the user's learning stage information; the syntax parsing prompts include syntax parsing task description information that matches the user's learning stage information and the target object to be parsed;

[0159] The input unit is used to input the syntax parsing prompts into the syntax parsing model and obtain the generated result of the syntax parsing model as the syntax parsing result.

[0160] In one possible implementation, the grammar parsing task description information matching the user's learning stage information includes: parsing step description information, grammar parsing result output format description information, and grammar parsing result output example; the parsing step description information includes multiple parsing steps executed sequentially.

[0161] In one possible implementation, the device further includes:

[0162] The display unit is used to display the syntax parsing result to the user after obtaining the syntax parsing result. The display interface includes a syntax parsing result source identifier and / or a syntax knowledge point identifier. The syntax parsing result source identifier is used to indicate that the syntax parsing result is generated by the syntax parsing model, or the syntax parsing result source identifier is used to indicate that the syntax parsing result is obtained from a preset syntax knowledge base. The syntax knowledge point identifier has the function of jumping to the detailed explanation of the syntax knowledge point after being triggered.

[0163] Each unit in the aforementioned syntax parsing device can be implemented entirely or partially through software, hardware, or a combination thereof. These units can be embedded in or independent of the processor in a computer device, or stored in the computer device's memory in software form, so that the processor can invoke and execute the operations corresponding to each unit.

[0164] This application also provides an electronic device in its embodiments. (See reference...) Figure 5The diagram illustrates a structural schematic suitable for implementing the electronic device in the embodiments of this application. The electronic device in the embodiments of this application may include, but is not limited to, fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 5 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0165] like Figure 5 As shown, the electronic device may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. When the electronic device is powered on, the RAM 603 also stores various programs and data required for the operation of the electronic device. The processing unit 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0166] Typically, the following devices can be connected to I / O interface 605: input devices 606 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 607 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 608 including, for example, memory cards, hard drives, etc.; and communication devices 609. Communication device 609 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 5 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.

[0167] This application also provides a computer program product including computer-readable instructions, which, when executed on an electronic device, cause the electronic device to implement any of the syntax parsing methods provided in this application.

[0168] This application also provides a computer-readable storage medium that carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any of the syntax parsing methods provided in this application.

[0169] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.

[0170] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0171] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.

[0172] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).

Claims

1. A syntax parsing method, characterized in that, include: Obtain the target object for syntax parsing from user input; The target object is queried from a preset grammar knowledge base to obtain the query results; The preset grammar knowledge base includes at least a textbook grammar knowledge base, which contains a first pre-stored object and its grammar knowledge; the first pre-stored object is a high-frequency object within a fixed textbook range; When the query result indicates that the target object is not found in the preset grammar knowledge base, the target object is parsed using a grammar parsing model, and the generated result of the grammar parsing model is used as the grammar parsing result. The grammar parsing model is a large language model with grammar knowledge generation function.

2. The method according to claim 1, characterized in that, After querying the target object from the preset syntax knowledge base and obtaining the query results, the method further includes: When the query result indicates that the target object is found from the preset grammar knowledge base, the grammar parsing result is determined based on the grammar knowledge of the pre-stored objects that match the target object stored in the preset grammar knowledge base.

3. The method according to claim 2, characterized in that, The step of determining the syntax parsing result based on the syntax knowledge of pre-stored objects matching the target object stored in the preset syntax knowledge base includes: Determine the user's academic level information; From the grammatical knowledge of pre-stored objects that match the target object stored in the preset grammatical knowledge base, the target grammatical knowledge points that match the user's academic level information are determined as the grammatical parsing result.

4. The method according to claim 1, characterized in that, The preset grammar knowledge base also includes a human expert grammar knowledge base, which includes a second pre-stored object and its grammar knowledge; the second pre-stored object is an object other than the high-frequency objects within the scope of the fixed teaching materials; the grammar knowledge of each second pre-stored object is the result of human expert grammar parsing.

5. The method according to claim 4, characterized in that, After parsing the target object using a syntax parsing model and obtaining the generated result of the syntax parsing model as the syntax parsing result, the method further includes: The generated results of the syntax parsing model are manually corrected to generate human expert syntax parsing results; Obtain the grammar parsing result from the human expert, and store the target object and the grammar parsing result from the human expert into the human expert grammar knowledge base.

6. The method according to claim 1, characterized in that, The step of using a syntax parsing model to parse the target object, and obtaining the generated result of the syntax parsing model as the syntax parsing result, includes: Obtain the user's academic level information; Generate syntax parsing prompts that match the user's learning stage information; the syntax parsing prompts include syntax parsing task description information that matches the user's learning stage information and the target object to be parsed; The syntax parsing prompt is input into the syntax parsing model, and the generated result of the syntax parsing model is used as the syntax parsing result.

7. The method according to claim 6, characterized in that, The grammar parsing task description information that matches the user's learning stage information includes: parsing step description information, grammar parsing result output format description information, and grammar parsing result output example; the parsing step description information includes multiple parsing steps that are executed sequentially.

8. The method according to any one of claims 1 to 7, characterized in that, After obtaining the syntax parsing result, the method further includes: The syntax parsing results are displayed to the user, and the display interface includes a syntax parsing result source identifier and / or a syntax knowledge point identifier; The syntax parsing result source identifier is used to indicate that the syntax parsing result is generated by the syntax parsing model, or the syntax parsing result source identifier is used to indicate that the syntax parsing result is obtained from a preset syntax knowledge base; The grammar point identifier has the function of jumping to the detailed explanation of the grammar point after being triggered.

9. A computer program product, characterized in that, It includes computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the syntax parsing method as described in any one of claims 1 to 8.

10. An electronic device, characterized in that, It includes at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program to enable the electronic device to implement the syntax parsing method as described in any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that, The storage medium carries one or more computer programs that, when executed by an electronic device, enable the electronic device to implement the syntax parsing method as described in any one of claims 1 to 8.