English sentence conversion method, device, computer equipment and storage medium
Through dependent syntax analysis and part-of-speech annotation, the automatic conversion of English sentences into target sentence patterns is solved, and the problem of lack of automation tools in the existing technology is improved, and the efficiency and learning assistance effect of English sentence pattern conversion are improved.
Patent Information
- Application Number
- CN202110860337.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-26
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2041-07-26
AI Technical Summary
The lack of automation tools in the prior art assists students and teachers in English sentence conversion, resulting in inconvenience in learning and correction processes.
Through dependent syntax analysis and part-of-speech annotation, the dependent syntax analysis results and part-of-speech annotation results of English sentences are obtained, and the English sentences are automatically converted into the target sentence pattern based on these results.
It realizes automatic conversion of English sentence patterns, fills the gaps in automated assisted learning and teaching, and improves the efficiency of learning and correction.
Smart Images

Figure CN115688744B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an English sentence conversion method, apparatus, computer equipment, and storage medium. Background Art
[0002] In primary and junior high school English learning, sentence conversion questions often appear, such as converting affirmative sentences into negative sentences, declarative sentences into general questions, singular sentences into plural sentences, etc. At present, there are only empirical introductions to English sentence conversion, and there is a lack of automatic conversion tools to assist students in learning English sentence conversion or to assist teachers in correcting English sentence conversion questions. Summary of the Invention
[0003] Based on this, it is necessary to provide an English sentence conversion method, device, computer equipment and storage medium that can realize automatic conversion of English sentence patterns in response to the above technical problems.
[0004] A method for converting English sentences, comprising:
[0005] Get the English sentence to be converted;
[0006] Performing dependency syntactic analysis on the English sentence to be converted to obtain a dependency syntactic analysis result corresponding to the English sentence to be converted;
[0007] Performing part-of-speech tagging on the English sentence to be converted to obtain a part-of-speech tagging result corresponding to the English sentence to be converted;
[0008] The English sentence to be converted is converted into a target sentence pattern according to the dependency syntactic analysis result and the part-of-speech tagging result.
[0009] An English sentence pattern conversion device, comprising:
[0010] The acquisition module is used to obtain the English sentence to be converted;
[0011] A dependency syntactic analysis module, configured to perform dependency syntactic analysis on the English sentence to be converted, and obtain a dependency syntactic analysis result corresponding to the English sentence to be converted;
[0012] A part-of-speech tagging module is used to perform part-of-speech tagging on the English sentence to be converted, and obtain a part-of-speech tagging result corresponding to the English sentence to be converted;
[0013] The sentence pattern conversion module is used to convert the English sentence to be converted into a target sentence pattern according to the dependency syntax analysis result and the part-of-speech tagging result.
[0014] A computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0015] Get the English sentence to be converted;
[0016] Performing dependency syntactic analysis on the English sentence to be converted to obtain a dependency syntactic analysis result corresponding to the English sentence to be converted;
[0017] Performing part-of-speech tagging on the English sentence to be converted to obtain a part-of-speech tagging result corresponding to the English sentence to be converted;
[0018] The English sentence to be converted is converted into a target sentence pattern according to the dependency syntactic analysis result and the part-of-speech tagging result.
[0019] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:
[0020] Get the English sentence to be converted;
[0021] Performing dependency syntactic analysis on the English sentence to be converted to obtain a dependency syntactic analysis result corresponding to the English sentence to be converted;
[0022] Performing part-of-speech tagging on the English sentence to be converted to obtain a part-of-speech tagging result corresponding to the English sentence to be converted;
[0023] The English sentence to be converted is converted into a target sentence pattern according to the dependency syntactic analysis result and the part-of-speech tagging result.
[0024] The aforementioned English sentence pattern conversion method, apparatus, computer device, and storage medium obtain an English sentence to be converted; perform dependency syntactic analysis on the English sentence to be converted to obtain a dependency syntactic analysis result corresponding to the English sentence to be converted; perform part-of-speech tagging on the English sentence to be converted to obtain a part-of-speech tagging result corresponding to the English sentence to be converted; and convert the English sentence to be converted into a target sentence pattern based on the dependency syntactic analysis and part-of-speech tagging results corresponding to the English sentence to be converted. Thus, automatic English sentence pattern conversion can be achieved based on the dependency syntactic analysis and part-of-speech tagging results corresponding to the English sentence to be converted, thereby filling a gap in the application of automatic English sentence pattern conversion, for example, providing assistance in the learning or teaching process of English sentence pattern conversion. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 Schematic diagram of an application environment of an English sentence conversion method in an embodiment;
[0026] Figure 2 A schematic diagram of a flow chart of a method for converting English sentences in one embodiment;
[0027] Figure 3 is a schematic diagram of a dependency syntax tree in one embodiment;
[0028] Figure 4 1 is a flowchart of the steps of converting an English sentence to be converted into a target sentence pattern based on dependency parsing results and part-of-speech tagging results in one embodiment;
[0029] Figure 5 1 is a flow chart of a step of determining the auxiliary verb of an English sentence to be converted based on the dependency tag and part-of-speech tag of each word in the English sentence to be converted in one embodiment;
[0030] Figure 6 Schematic diagram of a sentence component tree in one embodiment;
[0031] Figure 7 1 is a structural block diagram of an English sentence conversion device in one embodiment;
[0032] Figure 8 is a diagram of the internal structure of a computer device in one embodiment;
[0033] Figure 9 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0035] The English sentence conversion method provided by this application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The user can access the program or platform that provides the English sentence conversion function through the terminal, and the server 104 can be the server of the program or platform. The terminal 102 or the server 104 obtains the English sentence to be converted and converts the English sentence to be converted into the target sentence pattern. It can be understood that the method can be applied to the terminal, and can also be applied to the server, and can also be applied to the system including the terminal and the server, and is implemented through the interaction between the terminal and the server. Among them, the terminal 102 can be but is not limited to various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and the server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.
[0036] In one embodiment, Figure 2 As shown, an English sentence conversion method is provided, which is applied to Figure 1 The terminal in is taken as an example to illustrate, including the following steps S202 to S208.
[0037] S202: Obtain an English sentence to be converted.
[0038] The English sentence to be converted can be an English sentence input by the user, or it can be a sentence obtained by preprocessing the English sentence input by the user. Preprocessing may include, but is not limited to, removing non-ASCII (American Standard Code for Information Interchange) characters, tabs, and extra whitespace from the sentence, and adding spaces between punctuation marks and words. This preprocessing can reduce potential interference in subsequent dependency parsing and part-of-speech tagging, thereby making the dependency parsing and part-of-speech tagging results more accurate.
[0039] S204: performing dependency syntactic analysis on the English sentence to be converted to obtain a dependency syntactic analysis result corresponding to the English sentence to be converted.
[0040] Dependency parsing is used to determine the dependency relationships between words in a sentence, such as subject-verb relationships, verb-object relationships, and so on. Any currently available or future-developed dependency parsing tool can be used to perform dependency parsing on the English sentence to be converted, obtaining the corresponding dependency parsing results. In one embodiment, the spacy tool is used to obtain the dependency parsing results.
[0041] The dependency syntax analysis result may include a dependency syntax tree, which represents the dependency relationship of all words in a sentence in the form of directed edges. Figure 3 As shown in the figure, taking the English sentence to be converted as "He has to take great responsibilities at home." as an example, the dependency syntax tree corresponding to the English sentence is shown. Among them, "S" represents the entire sentence, "ROOT" is the center word dependency label, the center word in the English sentence is "has", and the words at both ends of the arrow have a dependency relationship, and the arrow points from the dominant word to the subordinate word. For example, "He", "take" and "." are child nodes of the center word "has", "has" is the dominant word, and its subordinate words include "He", "take" and ".", "He" and "has" are in a subject-predicate relationship, the dependency label "nsubj" of "He" represents a noun subject, "take" and "responsibilities" are in a verb-object relationship, and the dependency label "dobj" of "responsibilities" represents a direct object.
[0042] Through dependency syntactic analysis, we can obtain the dependency tags of each word in the English sentence to be converted. The dependency tags of each word in the sentence "He has to take great responsibilities at home." are nsubj, root, aux, xcomp, amod, dobj, prep, pobj, and punct, respectively representing noun subject, central word, auxiliary verb, clause complement, adjective, direct object, preposition, prepositional object, and punctuation.
[0043] S206 , performing part-of-speech tagging on the English sentence to be converted, and obtaining a part-of-speech tagging result corresponding to the English sentence to be converted.
[0044] Part-of-speech tagging is used to assign a part of speech to each word in a sentence, such as verb, noun, adjective, preposition, etc. Any existing or future part-of-speech tagging tool can be used to tag the English sentence to be converted, obtaining the corresponding part-of-speech tagging results. In one embodiment, the spacy tool is used to obtain the part-of-speech tagging results.
[0045] Through part-of-speech tagging, we can obtain the part-of-speech label for each word in the English sentence to be converted. For example, the part-of-speech labels for the words in the sentence "He has to take great responsibilities at home" are PRP, VBZ, TO, VB, JJ, NNS, IN, and NN, representing personal pronouns, third-person singular verbs, the word to, verbs, adjectives, plural nouns, prepositions (in, at, by), and singular nouns, respectively. As you can see, part-of-speech labels not only reflect a word's part of speech but also its singular and plural forms.
[0046] S208: Convert the English sentence to be converted into a target sentence pattern according to the dependency syntax analysis result and the part-of-speech tagging result.
[0047] The target sentence pattern refers to the sentence type into which the English sentence to be converted needs to be converted, and can be set according to actual needs. For example, if the English sentence to be converted is an affirmative sentence, the target sentence pattern can be set to a negative sentence; if the English sentence to be converted is a declarative sentence, the target sentence pattern can be set to a general question sentence, an antonymic question sentence, and a special question sentence; if the English sentence to be converted is a singular sentence, the target sentence pattern can be set to a plural sentence. In other embodiments, the target sentence pattern can also be one or more sentence types set by default, including but not limited to affirmative sentences, negative sentences, general questions, antonymic questions, special questions, singular sentences, and plural sentences.
[0048] In the above-mentioned English sentence pattern conversion method, an English sentence to be converted is obtained; dependency syntactic analysis is performed on the English sentence to be converted to obtain a dependency syntactic analysis result corresponding to the English sentence to be converted; part-of-speech tagging is performed on the English sentence to obtain a part-of-speech tagging result corresponding to the English sentence to be converted; and based on the dependency syntactic analysis and part-of-speech tagging results, the English sentence to be converted is converted into a target sentence pattern. Based on the dependency syntactic analysis and part-of-speech tagging results corresponding to the English sentence to be converted, automatic English sentence pattern conversion can be achieved, thus filling a gap in the application of automatic English sentence pattern conversion, for example, providing assistance in the learning or teaching process of English sentence pattern conversion.
[0049] In one embodiment, the dependency parsing result includes the dependency tag of each word in the English sentence to be converted, and the part-of-speech tagging result includes the part-of-speech tag of each word in the English sentence to be converted. Figure 4 As shown, the step of converting the English sentence to be converted into the target sentence pattern according to the dependency syntax analysis result and the part-of-speech tagging result may specifically include the following steps S402 to S404.
[0050] S402: Determine the auxiliary verb of the English sentence to be converted based on the dependency tag and part-of-speech tag of each word in the English sentence to be converted.
[0051] In one embodiment, Figure 5 As shown, the step of determining the auxiliary verb of the English sentence to be converted according to the dependency tag and part-of-speech tag of each word in the English sentence to be converted may specifically include the following steps S502 to S510.
[0052] S502: Determine the word whose dependency tag in the English sentence to be converted is the central word dependency tag as the central word in the English sentence to be converted.
[0053] After obtaining the dependency tags of each word in the English sentence to be converted, select the center word dependency tag from it, such as Figure 3 As shown, the dependency tag ROOT is the central word dependency tag, and the word corresponding to the dependency tag ROOT (ie, "has") is determined as the central word in the English sentence to be converted.
[0054] S504, obtaining the child nodes of the central word.
[0055] The child nodes of the central word include words that have direct dependencies with the central word, such as Figure 3 As shown, the child nodes of the central word "has" include "He", "take" and ".".
[0056] S506: If the child node includes the first word, the first word is determined to be an auxiliary verb of the English sentence to be converted, and the part-of-speech tag of the first word is an auxiliary verb part-of-speech tag or the dependency tag of the first word is an auxiliary verb dependency tag.
[0057] The first word refers to a word whose part-of-speech tag is an auxiliary verb part-of-speech tag, or a word whose dependency tag is an auxiliary verb dependency tag. In one embodiment, if the part-of-speech tag of a word is MD (modal verb), the part-of-speech tag of the word is considered to be an auxiliary verb part-of-speech tag, and if the dependency tag of the word is aux (auxiliary verb) or auxpass (passive verb), the dependency tag of the word is considered to be an auxiliary verb dependency tag.
[0058] S508: If the child node does not include the first word and the central word is the first preset word, the central word is determined as the auxiliary verb of the English sentence to be converted.
[0059] The first preset word is specifically a be verb, such as am, is, are, was, were, etc.
[0060] S510: If the child node does not include the first word and the central word is not the first preset word, then determine the auxiliary verb of the English sentence to be converted based on the part-of-speech tag of the central word.
[0061] Specifically, if the part-of-speech tag of the central word is VBZ (i.e., the third person singular part-of-speech tag of the verb), the auxiliary verb of the English sentence to be converted is determined to be does; if the part-of-speech tag of the central word is VBD (i.e., the past tense part-of-speech tag of the verb), the auxiliary verb of the English sentence to be converted is determined to be did; in other cases, the auxiliary verb of the English sentence to be converted is determined to be do. Figure 3 As shown, the child nodes "He", "take" and "." of the central word "has" do not include the first word, and the central word "has" is not a be verb. The part-of-speech tag of the central word "has" is VBZ. Based on this, it can be determined that the auxiliary verb of the sentence "He has to take great responsibilities at home." is does.
[0062] S404 , based on the auxiliary verbs of the English sentence to be converted, performing conversion processing corresponding to the target sentence pattern on the English sentence to be converted, and obtaining the target sentence pattern corresponding to the English sentence to be converted.
[0063] In one embodiment, based on the auxiliary verbs of the English sentence to be converted, the English sentence to be converted is converted according to the target sentence pattern to obtain the target sentence pattern corresponding to the English sentence to be converted. The steps may specifically include: when the English sentence to be converted is an affirmative sentence, adding a negative word after the auxiliary verb of the English sentence to be converted; performing corresponding post-processing on the content to be adjusted in the English sentence to be converted to obtain a negative sentence corresponding to the English sentence to be converted, and the target sentence pattern includes a negative sentence.
[0064] Before performing sentence conversion, you can first determine whether the sentence structure of the English sentence to be converted is the same as the target sentence structure. If they are not, then perform sentence conversion. For example, you can first determine whether the English sentence to be converted is an affirmative or negative sentence based on the results of the dependency syntactic analysis of the English sentence to be converted. If the target sentence structure is a negative sentence, if the English sentence to be converted is already a negative sentence, you can return and prompt "The current sentence is already a negative sentence."
[0065] Specifically, if the child node of the central word in the English sentence to be converted includes a second word, the English sentence to be converted is determined to be a negative sentence; if the child node of the central word in the English sentence to be converted does not include the second word, the English sentence to be converted is determined to be an affirmative sentence. The second word is a preset negative word, or the part-of-speech tag of the second word is a negative word part-of-speech tag. The preset negative word is a word in a preset negative word list, including but not limited to not, n't. The second word refers to a word in a negative word list, or a word whose dependency tag is a negative word dependency tag. In one embodiment, if the part-of-speech tag of a word is neg (the dependency tag of the negative word not), the part-of-speech tag of the word is considered to be a negative word part-of-speech tag.
[0066] If the English sentence to be converted is an affirmative sentence, the negative word "not" or "n't" is first added after the auxiliary verb in the sentence to be converted. Then, the content in the sentence to be converted that needs to be adjusted is post-processed accordingly. The content to be adjusted here refers to the content that needs to be adjusted to convert the sentence from an affirmative sentence to a negative sentence, such as changing "some" to "any" or restoring the verb abbreviation "be" after adding "n't." Specifically, a word mapping table can be pre-established, which includes the words that need to be adjusted after various sentence patterns are converted and their corresponding adjusted words. This word mapping table can then be used to identify the words in the sentence to be converted that need to be adjusted and replace them with the corresponding adjusted words. For example, if the sentence to be converted is "He has to take great responsibilities at home.", its corresponding negative sentence is "He doesn't have to take great responsibilities at home."
[0067] In one embodiment, based on the auxiliary verb of the English sentence to be converted, the English sentence to be converted is converted according to the target sentence pattern to obtain the target sentence pattern corresponding to the English sentence to be converted. The steps may specifically include: when the English sentence to be converted is a negative sentence, deleting the negative word after the auxiliary verb of the English sentence to be converted; performing corresponding post-processing on the content to be adjusted in the English sentence to be converted to obtain the affirmative sentence corresponding to the English sentence to be converted, and the target sentence pattern includes an affirmative sentence.
[0068] If the sentence to be converted is negative, the system first removes the negative word (such as not or n't) following the auxiliary verb. It then performs post-processing on the content in the sentence that requires adjustment. This adjustment refers to the content needed to convert the sentence from a negative to an affirmative, such as changing "any" to "some." For example, if the sentence to be converted is "He doesn't have to take great responsibilities at home," the corresponding affirmative sentence would be "He has to take great responsibilities at home."
[0069] In one embodiment, the steps of: performing sentence component analysis on the English sentence to be converted to obtain the sentence components in the English sentence to be converted; performing conversion processing on the English sentence to be converted in accordance with the target sentence pattern based on the auxiliary verbs of the English sentence to be converted to obtain the target sentence pattern corresponding to the English sentence to be converted may specifically include: performing conversion processing on the English sentence to be converted in accordance with the target sentence pattern based on the auxiliary verbs and sentence components of the English sentence to be converted to obtain the target sentence pattern corresponding to the English sentence to be converted.
[0070] Sentence component analysis identifies the different components of a sentence, such as subject, predicate, object, predicate, attributive, adverbial, complement, and parenthetical. You can use any existing or future sentence component analysis tool to analyze the English sentence to be converted and obtain the corresponding sentence component analysis results. Sentence component analysis can supplement the results of dependency analysis, improve the completeness of sentence recognition, and ultimately enhance the accuracy of sentence conversion.
[0071] like Figure 6As shown in the figure, taking the English sentence "He has to take great responsibilities at home" as an example, the sentence component tree corresponding to the English sentence is shown. Among them, "S" represents the entire sentence, "He", "take", and "responsibilities" are the first subject (represented by Subject 0 in the figure), the first predicate (represented by Predicate 0 in the figure), and the first object (represented by Object 0 in the figure) of the sentence respectively.
[0072] In one embodiment, when the English sentence to be converted is a declarative sentence, based on the auxiliary verbs and sentence components of the English sentence to be converted, the English sentence to be converted is converted according to the target sentence pattern, and the step of obtaining the target sentence pattern corresponding to the English sentence to be converted can specifically include: when the first sentence component does not exist at the beginning of the English sentence to be converted, the auxiliary verb of the English sentence to be converted is moved to the beginning of the sentence, and the first sentence component includes one or more of adverbials and parentheses; corresponding post-processing is performed on the content to be adjusted in the English sentence to be converted to obtain a general question sentence corresponding to the English sentence to be converted, and the target sentence pattern includes a general question sentence.
[0073] The content that needs to be adjusted refers to the content needed to convert a sentence from a declarative sentence to a general question. For example, changing "some" to "any," changing the final punctuation to a question mark, and changing the original capital letter at the beginning of the sentence to lowercase (proper nouns are not changed). For example, the English sentence to be converted is "He has to take great responsibilities at home." There is no adverbial or parenthetical clause at the beginning of the sentence, and the corresponding general question is "Does he have to take great responsibilities at home?"
[0074] In one embodiment, when the English sentence to be converted is a declarative sentence, based on the auxiliary verbs and sentence components of the English sentence to be converted, the English sentence to be converted is converted according to the target sentence pattern, and the step of obtaining the target sentence pattern corresponding to the English sentence to be converted can specifically include: when there is a first sentence component at the beginning of the English sentence to be converted, the auxiliary verb of the English sentence to be converted is moved after the first sentence component, and the first sentence component includes one or more of adverbials and parentheses; corresponding post-processing is performed on the content to be adjusted in the English sentence to be converted to obtain a general question sentence corresponding to the English sentence to be converted, and the target sentence pattern includes a general question sentence.
[0075] The content that needs to be adjusted refers to the content needed to convert a sentence from a declarative sentence to a general question. For example, "some" should be changed to "any", the final punctuation should be changed to a question mark, and the original capital letter at the beginning of the sentence should be changed to lowercase (proper nouns should not be changed). For example, the English sentence to be converted is "Last year, I showed you a presentation." The initial "Lastyear" is an adverbial modifier, and the corresponding general question is "Last year, did I show you a presentation?"
[0076] In one embodiment, the following steps are also included: auxiliary annotation of the English sentence to be converted, obtaining an auxiliary label for each word in the English sentence to be converted, the auxiliary label being used to indicate the content described by the corresponding word; based on the auxiliary verbs and sentence components of the English sentence to be converted, performing conversion processing on the English sentence to be converted corresponding to the target sentence pattern, and obtaining the target sentence pattern corresponding to the English sentence to be converted. The steps may specifically include: based on the auxiliary verbs and sentence components of the English sentence to be converted, and the auxiliary label of each word, performing conversion processing on the English sentence to be converted corresponding to the target sentence pattern, and obtaining the target sentence pattern corresponding to the English sentence to be converted.
[0077] Auxiliary annotation is used to give an auxiliary tag to each word in the sentence, indicating whether the corresponding word describes a person, object, time, place, or organization. In one embodiment, the auxiliary tag is a supersense-tag. Any existing or future SuperSenseTagger model can be used to perform auxiliary annotation on the English sentence to be converted to obtain the supersense-tag of each word in the English sentence to be converted. For example, the supersense-tags of the words in the sentence "He has to take great responsibilities at home." are O, O, O, B-verb.possession, O, B-noun.act, O, B-noun.location, O, where "O" indicates unlabeled, "B-verb.possession" indicates the position where the verb phrase of possession begins, "B-noun.act" indicates the position where the noun phrase of action begins, and "B-noun.location" indicates the position where the noun phrase of location begins.
[0078] In one embodiment, when the English sentence to be converted is a declarative sentence, the English sentence to be converted is converted according to the target sentence pattern based on the auxiliary verbs and sentence components of the English sentence to be converted, as well as the auxiliary tags of each word, to obtain the target sentence pattern corresponding to the English sentence to be converted. Specifically, the steps may include: determining the subject pronoun corresponding to the subject based on the subject of the English sentence to be converted and the auxiliary tags corresponding to the subject; determining the interrogative sentence part based on the subject pronoun and the auxiliary verb of the English sentence to be converted, and adding the interrogative sentence part to the end of the English sentence to be converted; performing corresponding post-processing on the content to be adjusted in the English sentence to be converted to obtain the antonymic interrogative sentence corresponding to the English sentence to be converted, and the target sentence pattern includes the antonymic interrogative sentence.
[0079] First, the subject of the English sentence to be converted is obtained. Then, based on a preset list of male and female names and the subject's corresponding supersense tag, the subject is converted into a corresponding subject pronoun, such as "she," "he," "they," or "it." If the sentence to be converted is affirmative, the corresponding interrogative part is "auxiliary verb + not + subject pronoun"; if the sentence to be converted is negative, the corresponding interrogative part is "auxiliary verb + subject pronoun." The "needed adjustments" here refer to the content necessary to convert a sentence from a declarative sentence to an interrogative sentence, such as changing the final punctuation to a comma, adding the interrogative part, and then adding a question mark at the end. For example, if the sentence to be converted is "He has to take great responsibilities at home.", its corresponding interrogative sentence is "He has to take great responsibilities at home, doesn't he?"
[0080] In one embodiment, when the English sentence to be converted is a declarative sentence, based on the auxiliary verbs and sentence components of the English sentence to be converted, as well as the auxiliary tags of each word, the English sentence to be converted is converted corresponding to the target sentence pattern, and the step of obtaining the target sentence pattern corresponding to the English sentence to be converted can specifically include: obtaining a designated question part in the English sentence to be converted; determining a special question word based on the designated question part and the auxiliary tag corresponding to the designated question part, and replacing the designated question part based on the special question word; performing corresponding post-processing on the content to be adjusted in the English sentence to be converted, and obtaining a special question sentence corresponding to the English sentence to be converted, where the target sentence pattern includes a special question sentence.
[0081] When entering an English sentence to be converted, the user can specify a question part. Different question parts correspond to different special questions. The specified question part can be obtained by obtaining its index, where the index of the specified question part indicates the position of the specified question part in the English sentence to be converted, such as the first word.
[0082] After obtaining the specified question part, the type of the specified question part can be determined based on the dependency relationship and part-of-speech tag corresponding to the specified question part. Specifically, if the specified question part is a phrase, the phrase's governing word can be obtained based on the dependency relationship, and the phrase type, such as verb phrase, noun phrase, pronoun phrase, numeral phrase, adjective phrase, adverb phrase, prepositional phrase, etc., can be determined based on the governing word's part-of-speech tag. After obtaining the type of the specified question part, the special question word or special question sentence can be determined based on the type of the specified question part and the auxiliary tag corresponding to the specified question part.
[0083] In one embodiment, if the question is a verb phrase and is in the passive voice, the interrogative sentence is "What happened to + subject"; if the question is a verb phrase and is in the active voice, the interrogative sentence is "What do they say about + subject." Whether the sentence is in the passive or active voice can be determined by the dependency tag of the central word. Specifically, if the dependency tag of the central word is nsubjpass (i.e., a passive noun subject dependency tag), the sentence is in the passive voice; otherwise, it is in the active voice.
[0084] If the designated question part is a noun phrase and refers to a person, the special question word is who; if the designated question part is a noun phrase and refers to an object, the special question word is what; if the designated question part is a noun phrase and refers to time, the special question word is what time; if the designated question part is a noun phrase and refers to a place, the special question word is where.
[0085] If the designated question part is a prepositional phrase and indicates time, the special question word is what time; if the designated question part is a prepositional phrase and indicates place, the special question word is where; if the designated question part is a prepositional phrase and indicates reason, the special question word is why; if the designated question part is a prepositional phrase and indicates other situations besides time, place and reason, the special question word is how.
[0086] If the designated question part is a pronoun phrase and it is a personal pronoun, the special question word is who; if the designated question part is a pronoun phrase and it is an adjective possessive pronoun, the special question word is whose; if the designated question part is a pronoun phrase and it is a noun possessive pronoun, the special question word is what.
[0087] If the question part is an adjective phrase, you need to find the noun modified by the adjective. The special question words are what kind of or which.
[0088] If the question part is a numeral phrase and indicates time, the special question word is what time; if the question part is a numeral phrase and indicates quantity, you need to find a noun modified by quantity, and the special question word is how many or how much (such as money).
[0089] If the designated question part is the subject, directly replace it with a special question word. If the designated question part is not the subject, first convert the sentence into a general question sentence, then delete the designated question part, and then add the special question word before the auxiliary verb of the general question sentence. For how many, what kind of, and which, the modified nouns need to be placed before the auxiliary verb of the general question sentence.
[0090] The content that needs to be adjusted refers to the content needed to convert a sentence from a declarative sentence to a question, such as changing "some" to "any" or changing the final punctuation to a question mark. For example, if the English sentence to be converted is "He has to take great responsibilities at home.", if the question part is "He," the corresponding question is "Who has to take great responsibilities at home?"; if the question part is "great responsibilities," the corresponding question is "What does he have to take at home?"
[0091] In one embodiment, the method further includes the following steps: when the English sentence to be converted is an imperative sentence, determining the interrogative sentence part based on a preset sentence, and adding the interrogative sentence part to the end of the English sentence to be converted; performing corresponding post-processing on the content to be adjusted in the English sentence to be converted to obtain an antonymous interrogative sentence corresponding to the English sentence to be converted; wherein, when there is no subject in the English sentence to be converted and the child node of the central word does not include the second preset word, the English sentence to be converted is determined to be an imperative sentence.
[0092] The dependency tag of the second preset word is the dependency tag corresponding to "there" in the "there be" sentence pattern. That is, if there is no subject in the English sentence to be converted and expl (the dependency tag corresponding to "there" in the "there be" sentence pattern) is not present in the child node of the central word, the sentence to be converted is determined to be an imperative sentence. The content that needs to be adjusted refers to the content that needs to be adjusted to convert the sentence from an imperative sentence to an interrogative sentence, such as changing the final punctuation to a comma, adding the interrogative part, and then adding a question mark at the end of the sentence.
[0093] In one embodiment, the following steps are also included: when the English sentence to be converted does not meet the first condition, the subject, predicate, object, and predicate in the English sentence to be converted are converted into plural forms to obtain a plural sentence corresponding to the English sentence to be converted; wherein the first condition includes: there is a predicate in the sentence component of the English sentence to be converted and the predicate indicates quantity or a proper noun, and the subject, object, and predicate in the sentence component of the English sentence to be converted are all in plural form.
[0094] If the English sentence to be converted does not meet the first condition, it is considered singular and can be converted to plural. If the sentence contains a predicate that indicates quantity or a proper noun, the system will return a prompt stating "The current sentence is not suitable for plural conversion," thus avoiding the need to convert factual sentences into plural sentences, such as "Three plus two is five" or "My name is kate." If the subject, object, and predicate are all plural, the system will return a prompt stating "The current sentence is already plural." If the predicate is absent or is an adjective, the predicate is considered plural.
[0095] Convert the subject, predicate, object, and predicate in the English sentence to plural form. Specifically, convert the governing nouns of the subject, predicate, object, and predicate (non-adjective) to plural form. For uncountable nouns, words with the same singular and plural form remain unchanged, and words that are already plural remain unchanged. Attributives, adverbials, complements, parentheses, and clauses remain unchanged in both singular and plural form. For example, if the English sentence to be converted is "He has to take great responsibilities at home.", its corresponding plural form is "They have to take great responsibilities at home."
[0096] In one embodiment, the following steps are also included: when the English sentence to be converted does not meet the second condition, the subject, predicate, object, and predicate in the English sentence to be converted are converted into singular form to obtain a singular sentence corresponding to the English sentence to be converted; wherein the second condition includes: there is a predicate in the sentence component of the English sentence to be converted and the predicate indicates quantity or a proper noun, and the subject, object, and predicate in the sentence components of the English sentence to be converted are all in singular form.
[0097] If the English sentence to be converted does not meet the second condition, it is considered plural and can be converted to singular. If the sentence to be converted contains a predicate that indicates quantity or a proper noun, the system will return a message stating "The current sentence is not suitable for singular conversion." This prevents the conversion of factual sentences into singular sentences, such as "Three plus two is five" or "My name is kate." If the subject, object, and predicate in the sentence to be converted are all singular, the system will return a message stating "The current sentence is already singular."
[0098] Convert the subject, predicate, object, and predicate in the English sentence to singular form. Specifically, convert the governing nouns of the subject, predicate, object, and predicate (non-adjective) to singular form. For uncountable nouns, words with the same singular and plural forms remain unchanged, and words already in singular form remain unchanged. Attributives, adverbials, complements, parentheses, and clauses remain unchanged in singular and plural form. For example, if the English sentence to be converted is "They have to take great responsibilities at home.", its corresponding plural form is "He has to take great responsibilities at home."
[0099] Through the above embodiments, automatic conversion of English sentence patterns can be achieved, covering a variety of sentence pattern conversions such as affirmative sentences to negative sentences, negative sentences to affirmative sentences, declarative sentences to general interrogative sentences, declarative sentences to special interrogative sentences, declarative sentences to rhetorical interrogative sentences, imperative sentences to rhetorical interrogative sentences, singular sentences to plural sentences, and plural sentences to singular sentences, providing help in the learning or teaching process of English sentence pattern conversion.
[0100] It should be understood that, although the various steps in the various flow charts that the above-described embodiments relate to are shown in sequence according to the indications of the arrows, these steps are not necessarily performed in sequence according to the order indicated by the arrows. Unless clearly stated herein, the execution of these steps is not strictly limited in order, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the various flow charts that the above-described embodiments relate to can include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of the steps or stages in other steps or other steps.
[0101] In one embodiment, Figure 7 As shown, an English sentence pattern conversion device 700 is provided, comprising: an acquisition module 710, a dependency syntax analysis module 720, a part-of-speech tagging module 730 and a sentence pattern conversion module 740, wherein:
[0102] The acquisition module 710 is used to acquire the English sentence to be converted.
[0103] The dependency syntactic analysis module 720 is configured to perform dependency syntactic analysis on the English sentence to be converted, and obtain a dependency syntactic analysis result corresponding to the English sentence to be converted.
[0104] The part-of-speech tagging module 730 is used to perform part-of-speech tagging on the English sentence to be converted, and obtain a part-of-speech tagging result corresponding to the English sentence to be converted.
[0105] The sentence pattern conversion module 740 is used to convert the English sentence to be converted into a target sentence pattern according to the dependency syntax analysis results and the part-of-speech tagging results.
[0106] In one embodiment, the dependency syntactic analysis result includes the dependency tag of each word in the English sentence to be converted, and the part-of-speech tagging result includes the part-of-speech tag of each word in the English sentence to be converted; the sentence pattern conversion module 740 includes: an auxiliary verb determination unit and a sentence pattern conversion unit, the auxiliary verb determination unit is used to determine the auxiliary verbs of the English sentence to be converted based on the dependency tag and part-of-speech tag of each word in the English sentence to be converted; the sentence pattern conversion unit is used to perform conversion processing on the English sentence to be converted corresponding to the target sentence pattern based on the auxiliary verbs of the English sentence to be converted, and obtain the target sentence pattern corresponding to the English sentence to be converted.
[0107] In one embodiment, the auxiliary verb determination unit is specifically used to: determine the word whose dependency tag corresponds to the central word in the English sentence to be converted as the central word in the English sentence to be converted; obtain the child node of the central word; if the child node includes the first word, the first word is determined as the auxiliary verb of the English sentence to be converted, and the part-of-speech tag of the first word is the auxiliary verb part-of-speech tag or the dependency tag of the first word is the auxiliary verb dependency tag; if the child node does not include the first word and the central word is the first preset word, the central word is determined as the auxiliary verb of the English sentence to be converted; if the child node does not include the first word and the central word is not the first preset word, the auxiliary verb of the English sentence to be converted is determined according to the part-of-speech tag of the central word.
[0108] In one embodiment, the sentence pattern conversion unit is specifically used to: when the English sentence to be converted is an affirmative sentence, add a negative word after the auxiliary verb of the English sentence to be converted; perform corresponding post-processing on the content to be adjusted in the English sentence to be converted to obtain the negative sentence corresponding to the English sentence to be converted, and the target sentence pattern includes a negative sentence.
[0109] In one embodiment, the sentence pattern conversion unit is specifically used to: when the English sentence to be converted is a negative sentence, delete the negative word after the auxiliary verb of the English sentence to be converted; perform corresponding post-processing on the content to be adjusted in the English sentence to be converted to obtain the affirmative sentence corresponding to the English sentence to be converted, and the target sentence pattern includes an affirmative sentence.
[0110] In one embodiment, the sentence pattern conversion module 740 also includes a judgment unit, which is used to: if the child node of the central word in the English sentence to be converted includes a second word, then the English sentence to be converted is judged to be a negative sentence; if the child node of the central word in the English sentence to be converted does not include the second word, then the English sentence to be converted is judged to be an affirmative sentence; wherein the second word is a preset negative word, or the part-of-speech tag of the second word is a negative part-of-speech tag.
[0111] In one embodiment, the device also includes a sentence component analysis module for performing sentence component analysis on the English sentence to be converted to obtain the sentence components in the English sentence to be converted; the sentence pattern conversion module 640 is also used to: based on the auxiliary verbs and sentence components of the English sentence to be converted, perform conversion processing on the English sentence to be converted corresponding to the target sentence pattern to obtain the target sentence pattern corresponding to the English sentence to be converted.
[0112] In one embodiment, when the English sentence to be converted is a declarative sentence, the sentence pattern conversion module 640 is further used to: when the first sentence component does not exist at the beginning of the English sentence to be converted, move the auxiliary verb of the English sentence to be converted to the beginning of the sentence, and the first sentence component includes one or more of an adverbial and an interjection; perform corresponding post-processing on the content to be adjusted in the English sentence to be converted to obtain a general question sentence corresponding to the English sentence to be converted, and the target sentence pattern includes a general question sentence.
[0113] In one embodiment, when the English sentence to be converted is a declarative sentence, the sentence pattern conversion module 640 is further used to: when there is a first sentence component at the beginning of the English sentence to be converted, move the auxiliary verb of the English sentence to be converted after the first sentence component, and the first sentence component includes one or more of an adverbial and an interjection; perform corresponding post-processing on the content to be adjusted in the English sentence to be converted to obtain a general question sentence corresponding to the English sentence to be converted, and the target sentence pattern includes a general question sentence.
[0114] In one embodiment, the device also includes an auxiliary annotation module for performing auxiliary annotation on the English sentence to be converted, and obtaining an auxiliary label for each word in the English sentence to be converted, where the auxiliary label is used to indicate the content described by the corresponding word; the sentence pattern conversion module 740 is also used to: based on the auxiliary verbs and sentence components of the English sentence to be converted, and the auxiliary label of each word, perform conversion processing on the English sentence to be converted corresponding to the target sentence pattern, and obtain the target sentence pattern corresponding to the English sentence to be converted.
[0115] In one embodiment, when the English sentence to be converted is a declarative sentence, the sentence pattern conversion module 740 is further used to: determine the subject pronoun corresponding to the subject based on the subject of the English sentence to be converted and the auxiliary tag corresponding to the subject; determine the interrogative sentence part based on the subject pronoun and the auxiliary verb of the English sentence to be converted, and add the interrogative sentence part to the end of the English sentence to be converted; perform corresponding post-processing on the content to be adjusted in the English sentence to be converted, and obtain the antonymic interrogative sentence corresponding to the English sentence to be converted, and the target sentence pattern includes the antonymic interrogative sentence.
[0116] In one embodiment, when the English sentence to be converted is a declarative sentence, the sentence pattern conversion module 740 is further used to: obtain a designated question part in the English sentence to be converted; determine a special question word based on the designated question part and the auxiliary label corresponding to the designated question part, and replace the designated question part based on the special question word; perform corresponding post-processing on the content to be adjusted in the English sentence to be converted, and obtain a special question sentence corresponding to the English sentence to be converted, where the target sentence pattern includes a special question sentence.
[0117] In one embodiment, the sentence pattern conversion module 740 is further used to: when the English sentence to be converted is an imperative sentence, determine the interrogative sentence part based on a preset sentence, and add the interrogative sentence part to the end of the English sentence to be converted; perform corresponding post-processing on the content to be adjusted in the English sentence to be converted to obtain the antonymous interrogative sentence corresponding to the English sentence to be converted; wherein, when there is no subject in the English sentence to be converted and the child node of the central word does not include the second preset word, the English sentence to be converted is determined to be an imperative sentence.
[0118] In one embodiment, the sentence pattern conversion module 740 is also used to: when the English sentence to be converted does not meet the first condition, convert the subject, predicate, object, and predicate in the English sentence to be converted into plural form to obtain a plural sentence corresponding to the English sentence to be converted; wherein the first condition includes: there is a predicate in the sentence component of the English sentence to be converted and the predicate indicates quantity or a proper noun, and the subject, object, and predicate in the sentence component of the English sentence to be converted are all in plural form.
[0119] In one embodiment, the sentence pattern conversion module 740 is further used to: when the English sentence to be converted does not meet the second condition, convert the subject, predicate, object, and predicate in the English sentence to be converted into singular form to obtain a singular sentence corresponding to the English sentence to be converted; wherein the second condition includes: there is a predicate in the sentence component of the English sentence to be converted and the predicate indicates quantity or a proper noun, and the subject, object, and predicate in the sentence component of the English sentence to be converted are all in singular form.
[0120] The specific definition of the English sentence conversion device can be found in the definition of the English sentence conversion method above, which will not be repeated here. The various modules in the above-mentioned English sentence conversion device can be implemented in whole or in part by software, hardware, and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0121] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 8 As shown. The computer device includes a processor, a memory, and a network interface connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, it implements an English sentence conversion method.
[0122] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 9 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, an English sentence conversion method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad provided on the computer device housing, or an external keyboard, touchpad or mouse.
[0123] Those skilled in the art will understand that Figure 8 or Figure 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0124] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above-mentioned various method embodiments when executing the computer program.
[0125] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0126] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steps of each of the above-described method embodiments.
[0127] It should be understood that the terms "first," "second," and the like in the above embodiments are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Furthermore, in the description of this application, unless otherwise specified, "a plurality of" means at least two.
[0128] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0129] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0130] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
Claims
1. A method for converting English sentences, characterized in that: The method comprises: Get the English sentence to be converted; Performing dependency syntactic analysis on the English sentence to be converted to obtain a dependency syntactic analysis result corresponding to the English sentence to be converted, wherein the dependency syntactic analysis result includes a dependency label of each word in the English sentence to be converted; Performing part-of-speech tagging on the English sentence to be converted to obtain a part-of-speech tagging result corresponding to the English sentence to be converted, wherein the part-of-speech tagging result includes a part-of-speech tag for each word in the English sentence to be converted; Converting the English sentence to be converted into a target sentence pattern according to the dependency syntactic analysis result and the part-of-speech tagging result; Determine the word whose dependency tag corresponds to the central word in the English sentence to be converted as the central word in the English sentence to be converted; Get the child nodes of the central word; If the child node includes a first word, the first word is determined as an auxiliary verb of the English sentence to be converted, and the part-of-speech tag of the first word is an auxiliary verb part-of-speech tag or the dependency tag of the first word is an auxiliary verb dependency tag; If the child node does not include the first word and the central word is a first preset word, determining the central word as the auxiliary verb of the English sentence to be converted; If the child node does not include the first word and the central word is not the first preset word, determining the auxiliary verb of the English sentence to be converted according to the part-of-speech tag of the central word; Based on the auxiliary verbs of the English sentence to be converted, the English sentence to be converted is converted according to a target sentence pattern to obtain the target sentence pattern corresponding to the English sentence to be converted.
2. The method according to claim 1, characterized in that Based on the auxiliary verbs of the English sentence to be converted, the English sentence to be converted is converted according to a target sentence pattern to obtain a target sentence pattern corresponding to the English sentence to be converted, including any one of the following two items: Item 1: When the English sentence to be converted is an affirmative sentence, adding a negative word after the auxiliary verb of the English sentence to be converted; Performing corresponding post-processing on the content to be adjusted in the to-be-converted English sentence to obtain a negative sentence corresponding to the to-be-converted English sentence, wherein the target sentence pattern includes a negative sentence; Item 2: When the English sentence to be converted is a negative sentence, deleting the negative word after the auxiliary verb of the English sentence to be converted; Corresponding post-processing is performed on the content to be adjusted in the to-be-converted English sentence to obtain an affirmative sentence corresponding to the to-be-converted English sentence, wherein the target sentence pattern includes an affirmative sentence.
3. The method according to claim 2, characterized in that If the child node of the central word in the English sentence to be converted includes a second word, then the English sentence to be converted is determined to be a negative sentence; If the child node of the central word in the English sentence to be converted does not include the second word, then the English sentence to be converted is determined to be an affirmative sentence; The second word is a preset negative word, or the part-of-speech tag of the second word is a negative word part-of-speech tag.
4. The method according to claim 1, wherein Also includes: Performing sentence component analysis on the English sentence to be converted to obtain sentence components in the English sentence to be converted; Based on the auxiliary verbs of the English sentence to be converted, performing conversion processing corresponding to a target sentence pattern on the English sentence to be converted to obtain the target sentence pattern corresponding to the English sentence to be converted, including: Based on the auxiliary verbs and sentence components of the English sentence to be converted, the English sentence to be converted is converted according to the target sentence pattern to obtain the target sentence pattern corresponding to the English sentence to be converted.
5. The method according to claim 4, characterized in that When the English sentence to be converted is a declarative sentence, performing conversion processing corresponding to a target sentence pattern on the English sentence to be converted based on auxiliary verbs and sentence components of the English sentence to be converted to obtain a target sentence pattern corresponding to the English sentence to be converted includes any one of the following two items: Item 1: When there is no first sentence component at the beginning of the English sentence to be converted, moving the auxiliary verb of the English sentence to be converted to the beginning of the sentence, wherein the first sentence component includes one or more of an adverbial and an interjection; Performing corresponding post-processing on the content to be adjusted in the to-be-converted English sentence to obtain a general question sentence corresponding to the to-be-converted English sentence, wherein the target sentence pattern includes a general question sentence; Item 2: When there is a first sentence component at the beginning of the English sentence to be converted, moving the auxiliary verb of the English sentence to be converted to after the first sentence component, wherein the first sentence component includes one or more of an adverbial and an interjection; Corresponding post-processing is performed on the content to be adjusted in the to-be-converted English sentence to obtain a general question sentence corresponding to the to-be-converted English sentence, wherein the target sentence pattern includes a general question sentence.
6. The method according to claim 4, characterized in that Also includes: Perform auxiliary annotation on the English sentence to be converted to obtain an auxiliary label for each word in the English sentence to be converted, where the auxiliary label is used to indicate the content described by the corresponding word; Based on the auxiliary verbs and sentence components of the English sentence to be converted, the English sentence to be converted is converted according to the target sentence pattern to obtain the target sentence pattern corresponding to the English sentence to be converted, including: Based on the auxiliary verbs and sentence components of the English sentence to be converted, and the auxiliary labels of each word, the English sentence to be converted is converted according to the target sentence pattern to obtain the target sentence pattern corresponding to the English sentence to be converted.
7. The method according to claim 6, characterized in that When the English sentence to be converted is a declarative sentence, performing conversion processing corresponding to a target sentence pattern on the English sentence to be converted based on auxiliary verbs and sentence components of the English sentence to be converted and auxiliary labels of each word to obtain a target sentence pattern corresponding to the English sentence to be converted includes any one of the following two items: Item 1: Determining a subject pronoun corresponding to the subject according to the subject of the English sentence to be converted and the auxiliary tag corresponding to the subject; determining a question sentence part based on the subject pronoun and the auxiliary verb of the English sentence to be converted, and adding the question sentence part to the end of the English sentence to be converted; Performing corresponding post-processing on the content to be adjusted in the to-be-converted English sentence to obtain an antonymous question sentence corresponding to the to-be-converted English sentence, wherein the target sentence pattern includes an antonymous question sentence; Item 2: Obtaining a specified question part in the English sentence to be converted; determining a special question word according to the designated question part and the auxiliary tag corresponding to the designated question part, and replacing the designated question part based on the special question word; Corresponding post-processing is performed on the content to be adjusted in the to-be-converted English sentence to obtain a special question sentence corresponding to the to-be-converted English sentence, wherein the target sentence pattern includes a special question sentence.
8. The method according to claim 4, characterized in that Also includes: When the English sentence to be converted is an imperative sentence, determining a question part based on a preset sentence, and adding the question part to the end of the English sentence to be converted; Performing corresponding post-processing on the content to be adjusted in the to-be-converted English sentence to obtain an antonymous question sentence corresponding to the to-be-converted English sentence; When there is no subject in the English sentence to be converted and the child node of the central word does not include the second preset word, it is determined that the English sentence to be converted is an imperative sentence.
9. The method according to claim 4, characterized in that Also includes either of the following: Item 1: When the English sentence to be converted does not meet the first condition, converting the subject, predicate, object, and predicate in the English sentence to be converted into plural forms to obtain a plural sentence corresponding to the English sentence to be converted; The first condition includes: there is a predicate in the sentence component of the English sentence to be converted, and the predicate indicates quantity or a proper noun, and the subject, object, and predicate in the sentence component of the English sentence to be converted are all plural; Item 2: When the English sentence to be converted does not meet the second condition, converting the subject, predicate, object, and predicate in the English sentence to be converted into singular form to obtain a singular sentence corresponding to the English sentence to be converted; The second condition includes: there is a predicate in the sentence component of the English sentence to be converted and the predicate indicates quantity or a proper noun, and the subject, object and predicate in the sentence component of the English sentence to be converted are all in singular form.
10. An English sentence conversion device, characterized in that: The device comprises: The acquisition module is used to obtain the English sentence to be converted; A dependency syntactic analysis module, configured to perform dependency syntactic analysis on the English sentence to be converted, and obtain a dependency syntactic analysis result corresponding to the English sentence to be converted, wherein the dependency syntactic analysis result includes a dependency label for each word in the English sentence to be converted; a part-of-speech tagging module, configured to perform part-of-speech tagging on the English sentence to be converted, and obtain a part-of-speech tagging result corresponding to the English sentence to be converted, wherein the part-of-speech tagging result includes a part-of-speech tag for each word in the English sentence to be converted; A sentence pattern conversion module is used to convert the English sentence to be converted into a target sentence pattern according to the dependency syntactic analysis result and the part-of-speech tagging result; determine the word whose dependency tag corresponds to the central word in the English sentence to be converted as the central word in the English sentence to be converted; obtain a child node of the central word; if the child node includes a first word, determine the first word as the auxiliary verb of the English sentence to be converted, and the part-of-speech tag of the first word is an auxiliary verb part-of-speech tag or the dependency tag of the first word is an auxiliary verb dependency tag; if the child node does not include the first word and the central word is a first preset word, determine the central word as the auxiliary verb of the English sentence to be converted; if the child node does not include the first word and the central word is not the first preset word, determine the auxiliary verb of the English sentence to be converted according to the part-of-speech tag of the central word; based on the auxiliary verb of the English sentence to be converted, perform conversion processing corresponding to the target sentence pattern on the English sentence to be converted to obtain the target sentence pattern corresponding to the English sentence to be converted.
11. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 9 are implemented.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.
Citation Information
Patent Citations
Bidirectional mechanical translation method for sentence pattern conversion between Chinese language and foreign language
CN101131689A
Sentence converter and program thereof
JP2013077101A