Sentence analysis method and related device

By obtaining the sentence structure type and matching the corresponding parsing dimensions and grammatical rules for grammatical analysis, the problem of lack of sentence grammatical analysis function in dictionary products is solved, and accurate analysis of sentences and improvement of user experience are achieved.

CN120805895APending Publication Date: 2025-10-17HEFEI IFLYTEK TOYCLOUD TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510957815.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-11
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

Existing dictionary products cannot provide sentence grammatical analysis functions, resulting in users being unable to obtain sentence grammatical analysis results.

Method used

By obtaining the sentence structure type of the sentence to be parsed and matching the corresponding parsing dimensions and grammatical rules based on the type, multi-dimensional grammatical parsing results are generated, including part-of-speech tagging, sentence structure type and grammatical parsing results.

Benefits of technology

It achieves accurate grammatical analysis of different sentence structure types, improves users' understanding and mastery of sentences, and enhances user experience, especially in scenarios such as language learning and translation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120805895A_ABST
    Figure CN120805895A_ABST
Patent Text Reader

Abstract

The invention discloses a sentence analysis method and a related device, and relates to the field of sentence analysis, and the method comprises the steps: obtaining a to-be-analyzed sentence and a sentence structure type of the to-be-analyzed sentence, obtaining at least one analysis dimension corresponding to the sentence structure type, and a grammar rule matched with each analysis dimension, and performing grammar analysis on the to-be-analyzed sentence based on a grammar rule matched with the at least one analysis dimension to obtain a grammar analysis result corresponding to the at least one analysis dimension, and taking the grammar analysis result as the grammar analysis result of the to-be-analyzed sentence. According to the method and the device, sentence analysis can be performed, and the grammar rule is the rule matched with the analysis dimension, so that the grammar analysis result can be more accurate by performing grammar analysis of the corresponding analysis dimension based on the grammar rule.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of sentence parsing, and in particular to a sentence parsing method and related device. BACKGROUND

[0002] At present, users expect to obtain the grammatical analysis result of a sentence to be applied to the scenarios of language learning, teaching, translation, programming and the like. However, in the current dictionary products (such as a dictionary pen and an electronic dictionary), only the sentence queried by the user can be translated, and the sentence parsing function is lacked, so that the user cannot obtain the grammatical analysis result of the sentence by using the dictionary product. SUMMARY

[0003] In view of the above problems, the present application provides a sentence parsing method and related device to achieve the purpose of obtaining the grammatical analysis result of a sentence. The specific scheme is as follows:

[0004] The first aspect of the present application provides a sentence parsing method, comprising:

[0005] obtaining a to-be-parsed sentence and a sentence structure type of the to-be-parsed sentence;

[0006] obtaining at least one parsing dimension corresponding to the sentence structure type, and a grammatical rule respectively matched with each parsing dimension;

[0007] performing grammatical analysis on the to-be-parsed sentence based on the grammatical rule respectively matched with the at least one parsing dimension, to obtain the grammatical analysis result respectively corresponding to the at least one parsing dimension as the grammatical analysis result of the to-be-parsed sentence.

[0008] In a possible implementation, the grammatical rule respectively matched with each parsing dimension is a rule generated based on the part-of-speech combination rule respectively corresponding to each dimension value of the parsing dimension.

[0009] In a possible implementation, the obtaining process of the sentence structure type of the to-be-parsed sentence comprises:

[0010] performing part-of-speech tagging on the to-be-parsed sentence by using a preset part-of-speech tagging device to obtain a part-of-speech tagging sequence of the to-be-parsed sentence;

[0011] performing sentence structure parsing on the to-be-parsed sentence according to the part-of-speech tagging sequence to obtain the sentence structure type of the to-be-parsed sentence.

[0012] In a possible implementation, the performing part-of-speech tagging on the to-be-parsed sentence by using a preset part-of-speech tagging device to obtain a part-of-speech tagging sequence of the to-be-parsed sentence comprises:

[0013] performing part-of-speech tagging on the sentence to be parsed based on a part-of-speech tagger in the part-of-speech tagging apparatus to obtain an initial part-of-speech tagging sequence;

[0014] performing error part-of-speech correction on the initial part-of-speech tagging sequence based on a tagging rule in the part-of-speech tagging apparatus to obtain a part-of-speech tagging sequence of the sentence to be parsed.

[0015] In a possible implementation, the sentence structure type is one of a simple sentence, a subordinate compound sentence, and a parallel compound sentence.

[0016] The parsing dimensions corresponding to the simple sentence include one or more of the following dimensions: a sentence pattern, a sentence component, a tense, a voice, and a mood.

[0017] The parsing dimensions corresponding to the subordinate compound sentence include one or more of the following dimensions: a subordinate sentence type and a subordinate sentence leading word extraction.

[0018] The parsing dimensions corresponding to the parallel compound sentence include a conjunction word extraction.

[0019] In a possible implementation, the sentence pattern includes a declarative sentence.

[0020] In a case where the sentence to be parsed is an English sentence, the declarative sentence includes one or more of the following dimensions: a there be structure and a parallel predicate structure.

[0021] In a possible implementation, the method further includes:

[0022] determining whether the sentence to be parsed is a textbook sentence;

[0023] if not, obtaining a target textbook sentence of the same type as the sentence structure type of the sentence to be parsed;

[0024] obtaining a grammatical parsing result of the target textbook sentence by using the sentence parsing method in claim 1.

[0025] In a possible implementation, the method further includes:

[0026] outputting display of grammatical parsing process information of a target sentence, wherein the target sentence includes the sentence to be parsed and / or the target textbook sentence, and the grammatical parsing process information includes at least one of the following three levels of information: a part-of-speech tagging sequence, a sentence structure type, and a grammatical parsing result.

[0027] In a possible implementation, the outputting display of the grammatical parsing process information of the target sentence includes:

[0028] Output the syntax analysis process information of the target sentence in a preset display mode, wherein the preset display mode refers to a display mode in which one level information disappears and the next level information is displayed, and / or a display mode in which voice and text are output synchronously.

[0029] The second aspect of the present application provides a dictionary pen, comprising: a dictionary pen body, an input module and a processor arranged in the dictionary pen body;

[0030] The input module is configured to receive a sentence to be parsed.

[0031] The processor is configured to execute a computer program to enable the dictionary pen to implement the sentence parsing method of the first aspect or any implementation manner of the first aspect.

[0032] In a possible implementation, the dictionary pen further comprises a display screen arranged in the dictionary pen body.

[0033] The display screen is configured to output and display syntax analysis process information of a target sentence, wherein the target sentence comprises the sentence to be parsed and / or a target textbook sentence, and the syntax analysis process information comprises at least one of the following three level information: a part-of-speech tagging sequence, a sentence structure type, and a syntax analysis result.

[0034] The third aspect of the present application provides a computer program product, comprising computer readable instructions, when the computer readable instructions run on an electronic device, enabling the electronic device to implement the sentence parsing method of the first aspect or any implementation manner of the first aspect.

[0035] The fourth aspect of the present application provides an electronic device, comprising at least one processor and a memory connected with the processor, wherein:

[0036] The memory is configured to store a computer program.

[0037] The processor is configured to execute the computer program to enable the electronic device to implement the sentence parsing method of the first aspect or any implementation manner of the first aspect.

[0038] The fifth aspect of the present application provides a computer storage medium, the storage medium carries one or more computer programs, when the one or more computer programs are executed by an electronic device, the electronic device can implement the sentence parsing method of the first aspect or any implementation manner of the first aspect.

[0039] By the technical scheme, the sentence analysis method provided by the application considers that different sentences have different structure types, and users have different analysis requirements for sentences of different structure types. Therefore, the application pre-sets corresponding analysis dimensions for each sentence structure type. Then, when the sentence to be analyzed and the sentence structure type of the sentence to be analyzed are obtained, at least one analysis dimension corresponding to the sentence structure type of the sentence to be analyzed can be further obtained, and a grammar rule matched with each analysis dimension is matched respectively. The grammar analysis of the sentence to be analyzed is performed based on the grammar rule matched with at least one analysis dimension respectively, and the grammar analysis result corresponding to each analysis dimension is obtained as the grammar analysis result of the sentence to be analyzed. As can be seen, the application can analyze the sentence. Since the grammar rule is a rule matched with the analysis dimension, the grammar analysis of the corresponding analysis dimension based on the grammar rule can make the grammar analysis result more accurate. BRIEF DESCRIPTION OF DRAWINGS

[0040] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals can refer to the same or similar elements. It should be understood that the drawings are schematic, and the original and elements are not necessarily drawn according to the scale.

[0041] Figure 1 A system architecture schematic diagram for application of the application;

[0042] Figure 2 A flowchart of a sentence analysis method provided by the application;

[0043] Figure 3 A schematic diagram of an analysis dimension provided by the application;

[0044] Figure 4 A structure schematic diagram of a dictionary pen provided by the application;

[0045] Figure 5 A structure schematic diagram of a sentence analysis device provided by the application;

[0046] Figure 6 A structure schematic diagram of an electronic device provided by the application. DETAILED DESCRIPTION

[0047] The embodiments of the application are described below with reference to the accompanying drawings. The terms used in the embodiment part of the application are only used to explain the specific embodiments of the application, and are not intended to limit the application.

[0048] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0049] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, and this is merely a way of distinguishing the objects of the same attributes when describing them in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0050] The present application provides a sentence parsing method, which can be applied to scenarios where grammatical analysis of a sentence to be parsed is required.

[0051] For example, when students encounter unfamiliar sentences while learning a language, especially a non-native language, they can use the dictionary product based on this application to perform grammatical analysis on the unfamiliar sentences. The obtained grammatical analysis results can help students learn the language better.

[0052] For another example, when translating a text to be translated, a translator can use a dictionary product based on the present application to perform grammatical analysis on each sentence in the text to be translated, especially complex sentences. The obtained grammatical analysis results can help the translator translate more accurately.

[0053] For another example, in a programming scenario for SQL (Structured Query Language) queries, programmers can use a dictionary product based on this application to perform grammatical parsing on query statements described in natural language. The obtained grammatical parsing results can help programmers manually or automatically construct SQL query statements.

[0054] Of course, the above application scenarios are only examples and are not intended to limit this application.

[0055] See also Figure 1 , Figure 1 A schematic diagram of a system architecture of the present application is shown. The system may include a terminal 100 and a server 200. The server 200 may provide the method provided in the embodiment of the present application to one or more terminals.

[0056] The terminal 100 can be used alone to perform the sentence parsing method provided in the embodiments of the present application. In addition, the terminal 100 and the server 200 can be used cooperatively to perform the sentence parsing method provided in the embodiments of the present application.

[0057] Next, the product form of the terminal 100 is described. Figure 1

[0058] The terminal 100 in the embodiments of the present application can be a dictionary pen, a mobile phone, a tablet computer, a vehicle-mounted device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc., and the embodiments of the present application do not make any limitation in this regard.

[0059] The terminal 100 can include a radio frequency unit, a memory, an input unit, a display unit, a camera (optional), an audio circuit (optional), a speaker (optional), a microphone (optional), an earphone jack (optional), a processor, an external interface, a power supply, etc. Those skilled in the art can understand that the above components are only examples and do not constitute a limitation on the terminal or the multi-functional device, and more or fewer components can be included, or some components can be combined or different components can be included.

[0060] The input unit can be a touch screen, a camera, an infrared scanning head, etc. The input unit can receive an inputted sentence to be parsed, etc.

[0061] The display unit can be used to display the sentence to be parsed inputted by the user, the syntax parsing result provided to the user, etc.

[0062] The memory can be used to store software code related to the sentence parsing method, and the processor can execute the steps of the sentence parsing method, or can dispatch other units (such as the input unit and the display unit) to realize corresponding functions.

[0063] The radio frequency unit (optional) can be used to receive and send signals in the process of receiving or calling information. In the embodiments of the present application, the radio frequency unit can send the sentence to be parsed to the server 200, and receive the syntax parsing process information sent by the server 200, such as the syntax parsing result, etc.

[0064] It should be understood that the radio frequency unit is optional, and can be replaced by other communication interfaces, such as a network interface.

[0065] The terminal 100 further includes a power supply (such as a battery) for supplying power to each component.

[0066] ​The terminal 100 also includes an external interface, which may be a standard Micro USB interface or a multi-pin connector, and may be used to connect the terminal 100 to other devices for communication, or to connect a charger to charge the terminal 100.

[0067] The server 200 includes a bus, a processor, a communication interface, and a memory. The processor, the memory, and the communication interface communicate with each other via the bus.

[0068] Among them, the memory can be used to store software codes related to the sentence parsing method, the processor can execute each step of the sentence parsing method, and can also schedule other units to implement corresponding functions.

[0069] In order to enable those skilled in the art to better understand the present application, the sentence parsing method of the embodiment of the present application is described in detail below with reference to the accompanying drawings.

[0070] Reference Figure 2 , Figure 2 A flow chart of a sentence parsing method provided in an embodiment of the present application is shown as follows: Figure 2 As shown, the sentence parsing method may include:

[0071] Step S201: Obtain a sentence to be parsed and the sentence structure type of the sentence to be parsed.

[0072] Here, the sentence to be parsed refers to a sentence that needs to be parsed. For example, when a student encounters an unfamiliar sentence, in order to master the grammar of the unfamiliar sentence, the unfamiliar sentence can be used as a sentence to be parsed.

[0073] Here, the language of the sentence to be parsed can be a single language such as Chinese or English, or a multi-language such as a mixture of Chinese and English, and this application does not make any specific restrictions.

[0074] Taking an English sentence as an example, the sentence structure type of the sentence to be parsed can be one of a simple sentence, a subordinate compound sentence, and a parallel compound sentence. Here, a simple sentence consists of an independent subject-predicate structure (i.e., a subject and a predicate) and cannot be split into smaller clauses; a subordinate compound sentence consists of an independent clause (i.e., the main clause) and at least one subordinate clause (i.e., the dependent clause), which is connected to the independent clause by a subordinating conjunction (such as because, when, who, etc.); a parallel compound sentence consists of at least two independent clauses and at least one subordinate clause.

[0075] Step S202: Obtain at least one parsing dimension corresponding to the sentence structure type, and a grammatical rule that matches each parsing dimension.

[0076] In view of the fact that different sentence structure types can have different parsing requirements, and in different scenarios, different sentence structure types can also have different parsing requirements, in order to make the final parsing result more practical, the embodiment can preset different parsing dimensions for different sentence structure types, and preset grammar rules for each parsing dimension respectively.

[0077] Based on this, when the sentence structure type of the sentence to be parsed is obtained, the embodiment can further obtain at least one parsing dimension corresponding to the sentence structure type of the sentence to be parsed, and grammar rules respectively matched with each parsing dimension.

[0078] As introduced in the foregoing, in different scenarios, different sentence structure types can also have different parsing requirements, based on this, in one possible implementation, the embodiment can obtain the current parsing scenario information, and then obtain at least one parsing dimension corresponding to both the sentence structure type of the sentence to be parsed and the parsing scenario information.

[0079] Optionally, considering that each parsing dimension can have different dimension values, and different dimension values correspond to different word combination rules, based on this, the grammar rules respectively matched with each parsing dimension can be rules generated based on the word combination rules respectively corresponding to each dimension value of the parsing dimension.

[0080] For example, a parsing dimension is a sentence type dimension, the dimension values under the sentence type dimension include at least one of a statement, a question, an exclamation, an imperative and a reversed sentence, and the word combination rules respectively corresponding to the statement, the question, the exclamation, the imperative and the reversed sentence are different, therefore, the grammar rules matched with the sentence type dimension can be generated based on the different word combination rules.

[0081] In step S203, the sentence to be parsed is parsed based on the grammar rules respectively matched with the at least one parsing dimension, to obtain the grammar parsing result respectively corresponding to the at least one parsing dimension as the grammar parsing result of the sentence to be parsed.

[0082] Specifically, the embodiment can parse the sentence to be parsed based on the grammar rules matched with each parsing dimension, to obtain the grammar parsing result corresponding to the parsing dimension, thereby obtaining the grammar parsing result respectively corresponding to the at least one parsing dimension, and taking the grammar parsing result respectively corresponding to the at least one parsing dimension as the grammar parsing result of the sentence to be parsed.

[0083] Optionally, the grammar parsing result respectively corresponding to each parsing dimension can be a certain dimension value under each parsing dimension, or other content, which is not limited here.

[0084] The sentence analysis method provided in the application considers that different sentences have different structure types, and users have different analysis requirements for sentences of different structure types. Therefore, the application pre-sets a corresponding analysis dimension for each sentence structure type. Then, when the sentence to be analyzed and the sentence structure type of the sentence to be analyzed are obtained, at least one analysis dimension corresponding to the sentence structure type of the sentence to be analyzed can be further obtained, and a grammar rule matched with each analysis dimension is obtained. The grammar analysis of the sentence to be analyzed is performed based on the grammar rule matched with each analysis dimension, and the grammar analysis result corresponding to each analysis dimension is obtained as the grammar analysis result of the sentence to be analyzed. As can be seen, the application can perform sentence analysis. Since the grammar rule is a rule matched with the analysis dimension, the grammar analysis of the corresponding analysis dimension based on the grammar rule can make the grammar analysis result more accurate.

[0085] In some embodiments of the application, the process of obtaining the sentence structure type of the sentence to be analyzed in the foregoing step S201 is described in detail.

[0086] Optionally, the sentence structure prediction model can be pre-trained, and the sentence structure prediction model is used to predict the sentence structure of the sentence to be analyzed, and then the sentence structure type predicted by the model is obtained. Here, the sentence structure prediction model is trained using training sentences labeled with sentence structure type labels as training data. The labeled sentence structure type labels can be manually labeled or obtained by crawling the sentence structure types on the network and labeled.

[0087] It can be understood that the sentence structure prediction model is essentially a "black box". Although the predicted sentence structure type can be obtained, the prediction process lacks interpretability, resulting in low credibility of the prediction result.

[0088] Therefore, another method for obtaining the sentence structure type of the sentence to be analyzed is also provided in the embodiments of the application. The method uses a pre-set part-of-speech tagging device to perform part-of-speech tagging on the sentence to be analyzed to obtain a part-of-speech tagging sequence of the sentence to be analyzed, and then performs sentence structure analysis on the sentence to be analyzed according to the part-of-speech tagging sequence to obtain the sentence structure type of the sentence to be analyzed.

[0089] Optionally, the part-of-speech tagging device can be a part-of-speech tagger (for example, when the sentence to be analyzed is an English sentence, the part-of-speech tagger can be a Postagger tagger of NLTK (Natural Language Toolkit)), a tagging rule, or a combination of the two.

[0090] Taking the combination of the two as an example, the process of "performing part-of-speech tagging on the sentence to be parsed by using a preset part-of-speech tagging device to obtain a part-of-speech tagging sequence of the sentence to be parsed" can include: performing part-of-speech tagging on the sentence to be parsed based on a part-of-speech tagger in the part-of-speech tagging device to obtain an initial part-of-speech tagging sequence, and correcting the initial part-of-speech tagging sequence based on a tagging rule in the part-of-speech tagging device to obtain the part-of-speech tagging sequence of the sentence to be parsed.

[0091] Optionally, the process of performing part-of-speech tagging on the sentence to be parsed by the part-of-speech tagger can include: the part-of-speech tagger receiving the sentence to be parsed, passing the sentence to be parsed to a bottom pre-training model, predicting the part-of-speech tags of each word in the sentence to be parsed by the bottom pre-training model, and then returning the predicted part-of-speech tags to the part-of-speech tagger to obtain a part-of-speech tagging sequence composed of the part-of-speech tags of the respective words.

[0092] It can be understood that the part-of-speech tagger is a tool for automatically tagging parts of speech. For simple sentences, a relatively accurate part-of-speech tagging sequence can be obtained, but when the sentence to be parsed is complex, there can be cases of incorrect tagging by the part-of-speech tagger. Therefore, the present embodiment can take the part-of-speech tagging sequence obtained by the part-of-speech tagger as an initial part-of-speech tagging sequence, and then use a manually set tagging rule to identify and correct the incorrect tagging in the initial part-of-speech tagging sequence to obtain a part-of-speech tagging sequence with higher correctness as the part-of-speech tagging sequence of the sentence to be parsed.

[0093] As previously described, after obtaining the part-of-speech tagging sequence of the sentence to be parsed, the present embodiment can perform sentence structure parsing on the sentence to be parsed according to the part-of-speech tagging sequence to obtain the sentence structure type of the sentence to be parsed.

[0094] Taking the sentence to be parsed as an English sentence and the sentence structure type of the sentence to be parsed as one of a simple sentence, a subordinate complex sentence, and a parallel complex sentence, the present embodiment can first determine whether there is only one predicate verb in the part-of-speech tagging sequence of the sentence to be parsed, if so, determine that the sentence to be parsed is a simple sentence, otherwise, determine whether there is a subordinate conjunction or a parallel conjunction in the part-of-speech tagging sequence of the sentence to be parsed, if there is a subordinate conjunction, determine that the sentence to be parsed is a subordinate complex sentence, and if there is a parallel conjunction, determine that the sentence to be parsed is a parallel complex sentence.

[0095] The present embodiment first performs part-of-speech tagging on the sentence to be parsed, so that the sentence structure type of the sentence to be parsed can be explicitly inferred based on the part-of-speech tagging sequence, and the interpretability is stronger. At the same time, the present embodiment can reduce the error rate of part-of-speech tagging by combining the part-of-speech tagger and the tagging rule. Even if there is an incorrectly tagged word, it may not affect the final result of the present embodiment because it is not the word of interest of the present embodiment, thereby reducing the misrecognition rate of the sentence structure type.

[0096] In some embodiments of the present application, the parsing dimensions corresponding to the sentence structure types are introduced with the example of simple sentence, subordinate complex sentence and coordinate complex sentence.

[0097] Referring to Figure 3 FIG. 1 shows a schematic diagram of the parsing dimensions corresponding to the sentence structure types provided by the present application.

[0098] In one possible implementation, as Figure 3 The parsing dimensions corresponding to the simple sentence include one or more of the following dimensions: sentence pattern, sentence component, tense, voice and mood.

[0099] The sentence pattern is a basic mode of the sentence according to the grammatical structure, tone or function. Optionally, the sentence pattern dimension includes one or more of the following dimensions: declarative sentence, interrogative sentence, exclamatory sentence, imperative sentence and inverted sentence.

[0100] The declarative sentence includes one or more of the following dimensions: subject-predicate structure, subject-predicate-object, subject-predicate-object-object, subject-predicate-object-complement, subject-predicate-predicate, there be structure (the there be structure is only for the case that the sentence to be parsed is an English sentence) and coordinate predicate structure; the interrogative sentence includes one or more of the following dimensions: general interrogative sentence, special interrogative sentence, additional interrogative sentence (including antithetical additional interrogative sentence and non-antithetical additional interrogative sentence) and alternative interrogative sentence; the inverted sentence includes one or more of the following dimensions: complete inversion and partial inversion.

[0101] The sentence component is a basic unit of the sentence, which can be combined according to the grammatical rules to form a sentence or a phrase expressing complete semantics. Optionally, the sentence component dimension includes one or more of the following dimensions: subject, predicate, object, complement and complement.

[0102] The tense is a change of the verb form, which is used to represent the time (such as present, past, future, past future, etc.) and the manner (such as general, progressive, completed, completed progressive, etc.) of the occurrence of the action or state. Optionally, the tense dimension includes one or more of the following dimensions: general present tense, present progressive tense, present completed tense, present completed progressive tense, general past tense, past progressive tense, past completed tense, past completed progressive tense, general future tense, future progressive tense, future completed tense, future completed progressive tense, past future tense, past future progressive tense, past future completed tense and past future completed progressive tense.

[0103] The voice is used to describe the relationship between the subject and the predicate in the sentence. Optionally, the voice dimension includes one or more of the following dimensions: active voice and passive voice.

[0104] The above modalities are special forms of verbs, used to express hypotheses, wishes, suggestions, or situations contrary to facts, reflecting the subjective attitude of the speaker rather than objective facts. Optionally, the modalities include one or more of the following: present modality, past modality, and future modality.

[0105] In a possible implementation, as Figure 3 The parsing dimensions corresponding to the subordinate complex sentence include one or more of the following: relative clause type and relative pronoun extraction.

[0106] Optionally, the relative clause type includes one or more of the following: attributive clause (including restrictive attributive clause and non-restrictive attributive clause), adverbial clause, subject clause, object clause, predicate clause, appositive clause, and complement clause.

[0107] The above relative pronoun refers to the pronoun that leads the relative clause, adverbial clause, subject clause, object clause, predicate clause, appositive clause, and complement clause, and serves as a noun component in the clause. For example, that, whether, if, who, what, which, when, where, how, and the like in an English sentence are all relative pronouns.

[0108] In a possible implementation, as Figure 3 The parsing dimensions corresponding to the parallel complex sentence include: conjunction extraction.

[0109] The above conjunction refers to the word that connects two or more syntactically equal sentences, indicating parallelism, selection, transition, causality, progression, and the like. For example, and, but, so, however, furthermore, otherwise, and the like in an English sentence are all conjunctions.

[0110] Optionally, the above parsing dimensions can be applied to related scenarios of language learning and teaching. For example, in a teaching scenario, the teaching goal is to expect students to master the sentence pattern in a simple sentence, the sentence component, the tense, the voice, and the modality, the relative clause type and the relative pronoun extraction in a subordinate complex sentence, and the conjunction in a parallel complex sentence. In order to adapt to the teaching goal and the teaching demand, the above parsing dimensions can be obtained.

[0111] Of course, the above parsing dimensions can also be applied to other scenarios, which are not limited to the present application.

[0112] It should be further noted that the above parsing dimensions are only examples, and in addition, in related scenarios of language learning and teaching and other scenarios, the parsing dimensions can also be other, which are not specifically limited by the present application.

[0113] In summary, the embodiment provides all parsing dimensions of all sentence patterns, tenses, voices, moods, sentence components, subordinating conjunctions, subordinating conjunction types, and conjunctions. The embodiment performs grammar parsing based on the full parsing dimensions, so that the user can fully understand the grammar knowledge of the sentence to be parsed. In particular, in the related scenarios of language learning and teaching, the embodiment directly generates multi-dimensional grammar parsing results with teaching significance using the unique grammar rules, improves the user's understanding and mastery of the sentence to be parsed, and improves the user experience.

[0114] It can be understood that the user may have a rejection psychology when facing an unfamiliar sentence, resulting in a low acceptance of the unfamiliar sentence. Therefore, the user may not be able to fully learn the grammar knowledge in the unfamiliar sentence. Therefore, the embodiment can also determine whether the sentence to be parsed is a textbook sentence. If not, a target textbook sentence of the same type as the sentence structure type of the sentence to be parsed is obtained, and the grammar parsing result of the target textbook sentence is obtained using the sentence parsing method in the foregoing.

[0115] Optionally, the textbook sentence can be a sentence in a textbook related to the user portrait of the current user. For example, the current user is a student, and the textbook related to the user portrait of the current user can be a Chinese, mathematics, or English textbook. For another example, the current user is a translator, and the textbook related to the user portrait of the current user can be a translation textbook.

[0116] Compared with a non-textbook sentence, a textbook sentence is a more familiar sentence to the current user. Therefore, the current user has a higher acceptance of the grammar parsing result of the textbook sentence, so that the current user can more quickly master the grammar knowledge of the same type of sentence and improve the user experience.

[0117] In some embodiments of the present application, in order to further provide the user experience, the embodiment can output and display the grammar parsing process information of the target sentence, wherein the target sentence includes the sentence to be parsed and / or the target textbook sentence, and the grammar parsing process information includes at least one of the following three levels of information: part-of-speech tagging sequence, sentence structure type, and grammar parsing result.

[0118] Preferably, the part-of-speech tagging sequence, the sentence structure type, and the grammar parsing result are all output and displayed, so that the user can more accurately understand the grammar parsing result through the part-of-speech tagging sequence and the sentence structure type.

[0119] In a possible implementation, the embodiment can output and display the grammar parsing process information of the target sentence in a preset display mode.

[0120] Optionally, the preset display mode refers to a display mode in which one level of information disappears and the next level of information is displayed.

[0121] Among them, if the preset display method is to display the information of the next level after the information of one level disappears, then the optional display order of the part-of-speech tag sequence, sentence structure type, and grammatical parsing results is: first display the part-of-speech tag sequence, then display the sentence structure type after the part-of-speech tag sequence disappears, and finally display the grammatical parsing results after the sentence structure type disappears. This display method allows users to not only obtain grammatical parsing results, but also guide users to learn sentence parsing methods, allowing users to gradually master sentence parsing methods through multiple queries, thereby improving the efficiency and accuracy of users' self-parsing of sentences.

[0122] Optionally, the preset display mode may also be a display mode that uses simultaneous output of voice and text. Of course, this embodiment may also use a single display mode of voice or text, which is not specifically limited here.

[0123] The above introduces a sentence parsing method provided by an embodiment of the present application. The following will introduce a dictionary pen based on the above sentence parsing method.

[0124] Optional, see Figure 4 As shown in FIG, it is a schematic diagram of the structure of the dictionary pen provided by this application. Figure 4 The dictionary pen may include: a dictionary pen body 40, and an input module 401 and a processor 402 arranged in the dictionary pen body.

[0125] The input module 401 is used to receive the sentence to be parsed, and the processor is used to execute the computer program so that the dictionary pen can implement the sentence parsing method in the above embodiment.

[0126] Optionally, the input module 401 may include a scanning camera, an OCR (Optical Character Recognition) recognition unit, and may also include a microphone array. In addition, the input module 401 may also include other components, such as a fill light, etc., which are not specifically limited here.

[0127] For example, a scanning camera scans the sentence to be parsed to obtain a scanned image, and then a PCR recognition unit performs OCR recognition on the scanned image to obtain a recognized sentence to be parsed.

[0128] Optionally, the dictionary pen may further include a display screen 403 disposed within the dictionary pen body.

[0129] Optionally, the display screen 403 may be used to output display information, such as grammatical parsing process information of the target sentence, sentences to be parsed, etc.

[0130] In a possible implementation, the display screen 403 displays the syntax analysis process information of the target sentence in a similar manner to the display process in the previous sentence analysis method, and details can be referred to the previous description, which will not be repeated here.

[0131] To sum up, the dictionary pen provided in this embodiment can realize syntax analysis of a sentence to be analyzed, and through layer-by-layer display of the syntax analysis process information, the user can learn the sentence analysis method, and the user experience is improved.

[0132] Based on the sentence analysis method provided in the previous description, the present application further provides a device for executing the above sentence analysis method.

[0133] Please refer to Figure 5 , Figure 5 The structure of a sentence analysis device provided in the present application is shown in FIG. 5. As shown in FIG. 5, the sentence analysis device can include: Figure 5

[0134] The first obtaining unit 501 is configured to obtain a sentence to be analyzed and a sentence structure type of the sentence to be analyzed.

[0135] The second obtaining unit 502 is configured to obtain at least one analysis dimension corresponding to the sentence structure type, and a syntax rule matched with each analysis dimension.

[0136] The syntax analysis unit 503 is configured to perform syntax analysis on the sentence to be analyzed based on the syntax rule matched with each analysis dimension, to obtain a syntax analysis result corresponding to each analysis dimension as the syntax analysis result of the sentence to be analyzed.

[0137] The above modules in the sentence analysis device can be realized by software, hardware and combinations thereof in whole or in part. The above modules can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory in the computer device in software form, so as to be called and executed by the processor to perform the operations corresponding to the above modules.

[0138] In the present application, an electronic device is also provided, which can include at least one processor and a memory connected with the processor, wherein:

[0139] The memory is configured to store a computer program.

[0140] The processor is configured to execute the computer program, so that the electronic device can implement any of the sentence analysis methods provided in the present application.

[0141] Reference Figure 6 ​, which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present application. The electronic device in the embodiments of the present 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 6 The electronic device shown is merely an example and should not limit the functions and scope of use of the embodiments of the present application.

[0142] like Figure 6 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes based on programs stored in a read-only memory (ROM) 602 or programs 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 device 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.

[0143] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a memory card, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Figure 6 The electronic device is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.

[0144] An embodiment of the present application also provides a computer program product including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any one of the sentence parsing methods provided in the embodiments of the present application.

[0145] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium 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 sentence parsing method provided in the embodiment of the present application.

[0146] It should be noted that the apparatus embodiments described above are merely illustrative, and the units described as separate units can or can not be physically separate, and the units displayed as units can or can not be physical units, i.e., can be located in one place, or can be distributed to multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiment. In addition, the connection relationship between the modules in the apparatus embodiment provided in the present application indicates that there is a communication connection between them, which can be implemented as one or more communication buses or signal lines.

[0147] Through the description of the above embodiments, those skilled in the art can clearly understand that the present application can be realized by means of software and the necessary general hardware, and of course can also be realized by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. Generally, functions completed by computer programs can be easily realized by corresponding hardware, and the specific hardware structure for realizing the same function can also be various, such as analog circuit, digital circuit or special circuit, etc. However, for the present application, software program implementation is a better embodiment. Based on this understanding, the technical solutions of the present application can be embodied in the form of software products, which are stored in readable storage media, such as computer floppy disks, U disks, mobile hard disks, ROM, RAM, magnetic or optical disks, etc., including a plurality of instructions for making a computer device (which can be a personal computer, a training device, or a network device, etc.) execute the methods described in various embodiments of the present application.

[0148] In the above embodiments, all or part can be realized by software, hardware, firmware or any combination thereof. When realized by software, it can be realized in the form of a computer program product in whole or in part.

[0149] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from one website, computer, training device or data center to another website, computer, training device or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be stored by the computer or a data storage device such as a training device, a data center, etc. integrated with one or more available media sets. The available media can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)), etc.

Claims

1. A sentence parsing method, characterized in that: include: Obtaining a sentence to be parsed and a sentence structure type of the sentence to be parsed; Acquire at least one parsing dimension corresponding to the sentence structure type, and a grammatical rule respectively matching each of the parsing dimensions; The sentence to be parsed is parsed based on grammatical rules that respectively match the at least one parsing dimension, and grammatical parsing results corresponding to the at least one parsing dimension are obtained as grammatical parsing results of the sentence to be parsed.

2. The sentence parsing method according to claim 1, wherein The grammatical rules respectively matched with each of the parsing dimensions are rules generated based on part-of-speech combination regularities respectively corresponding to the dimension values ​​of the parsing dimension.

3. The sentence parsing method according to claim 1, wherein The process of obtaining the sentence structure type of the sentence to be parsed includes: Using a preset part-of-speech tagging device to perform part-of-speech tagging on the sentence to be parsed, to obtain a part-of-speech tagging sequence of the sentence to be parsed; The sentence structure of the sentence to be parsed is parsed according to the part-of-speech tag sequence to obtain the sentence structure type of the sentence to be parsed.

4. The sentence parsing method according to claim 3, wherein: The method of using a preset part-of-speech tagging device to perform part-of-speech tagging on the sentence to be parsed to obtain a part-of-speech tagging sequence of the sentence to be parsed includes: Performing part-of-speech tagging on the sentence to be parsed based on the part-of-speech tagger in the part-of-speech tagging device to obtain an initial part-of-speech tagging sequence; Based on the tagging rules in the part-of-speech tagging device, incorrect parts of speech are corrected for the initial part-of-speech tagging sequence to obtain the part-of-speech tagging sequence of the sentence to be parsed.

5. The sentence parsing method according to claim 1, wherein: The sentence structure type is one of a simple sentence, a subordinate compound sentence and a parallel compound sentence; The parsing dimensions corresponding to the simple sentence include one or more of the following dimensions: sentence pattern, sentence component, tense, voice and subjunctive mood; The parsing dimensions corresponding to the subordinate complex sentence include one or more of the following dimensions: clause type and clause guide word extraction; The parsing dimensions corresponding to the parallel compound sentence include: conjunction extraction.

6. The sentence parsing method according to claim 5, characterized in that The sentence patterns include declarative sentences; In the case that the sentence to be parsed is an English sentence, the declarative sentence includes one or more of the following dimensions: a there be structure and a parallel predicate structure.

7. The sentence parsing method according to claim 1, wherein: Also includes: Determine whether the sentence to be parsed is a textbook sentence; If not, obtaining a target teaching material sentence of the same type of sentence structure as the sentence to be parsed; The sentence parsing method according to claim 1 is used to obtain the grammatical parsing result of the target textbook sentence.

8. The sentence parsing method according to claim 7, characterized in that Also includes: The output displays the grammatical parsing process information of the target sentence, wherein the target sentence includes the sentence to be parsed and / or the target teaching material sentence, and the grammatical parsing process information includes at least one of the following three levels of information: part-of-speech tagging sequence, sentence structure type and grammatical parsing result.

9. The sentence parsing method according to claim 8, characterized in that The output shows the grammatical parsing process information of the target sentence, including: The grammatical parsing process information of the target sentence is output and displayed in a preset display mode, wherein the preset display mode refers to a display mode in which the next level of information is displayed after one level of information disappears, and / or a display mode in which voice and text are output synchronously.

10. A dictionary pen, comprising: A dictionary pen body, an input module and a processor arranged in the dictionary pen body; The input module is used to receive the sentence to be parsed; The processor is used to execute a computer program so that the dictionary pen can implement the sentence parsing method as described in any one of claims 1 to 9.

11. The dictionary pen according to claim 10, characterized in that: Also includes: A display screen disposed within the dictionary pen body; The display screen is used to output and display grammatical parsing process information of a target sentence, wherein the target sentence includes the sentence to be parsed and / or the target teaching material sentence, and the grammatical parsing process information includes at least one of the following three levels of information: part-of-speech tagging sequence, sentence structure type, and grammatical parsing result.

12. An electronic device, characterized in that: comprising 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 so that the electronic device can implement the sentence parsing method according to any one of claims 1 to 9.

13. A computer storage medium, characterized in that The storage medium carries one or more computer programs, and when the one or more computer programs are executed by an electronic device, the electronic device can implement the sentence parsing method according to any one of claims 1 to 9.

14. A computer program product, characterized in that The method comprises computer-readable instructions, which, when executed on an electronic device, enable the electronic device to implement the sentence parsing method according to any one of claims 1 to 9.