Sentence tense recognition method, device and readable storage medium based on dependency syntax

By performing dependency syntax analysis on sentences and obtaining dependency syntax information, the problem of low accuracy of sentence tense recognition in the existing technology is solved, and a higher accuracy is achieved.

CN112069800BActive Publication Date: 2025-01-24WEBANK (CHINA)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010964030.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-14
Publication Date
2025-01-24
Estimated Expiration
2040-09-14

AI Technical Summary

Technical Problem

In the prior art, the accuracy of sentence tense recognition is low, which is mainly due to the single basis, which leads to a high probability of misjudgment.

Method used

Based on the method of dependent clauses, by obtaining the analysis of the sentence and analyzing the dependent clause method, the dependent clause information of the statement is obtained, and the sentence recognition is performed.

Benefits of technology

Through the use of dependent syntactic information, a more sufficient basis for judgment is provided, which significantly improves the accuracy of sentence tense recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112069800B_ABST
    Figure CN112069800B_ABST
Patent Text Reader

Abstract

The present application discloses a sentence tense recognition method, device and readable storage medium based on dependency syntax, wherein the sentence tense recognition method based on dependency syntax comprises: obtaining a sentence to be parsed, and performing dependency syntax analysis on the sentence to be parsed, obtaining a dependency syntax analysis result corresponding to the sentence to be parsed, and then performing sentence tense recognition on the sentence to be parsed based on the dependency syntax analysis result, and obtaining a sentence tense recognition result. The present application solves the technical problem of low accuracy in sentence tense recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence in financial technology (Fintech), and in particular to a sentence tense recognition method, device and readable storage medium based on dependency syntax. Background Art

[0002] With the continuous development of financial technology, especially Internet technology finance, more and more technologies (such as distributed, blockchain, artificial intelligence, etc.) are applied in the financial field, but the financial industry also puts forward higher requirements on technology, such as higher requirements on the distribution of corresponding to-do items in the financial industry.

[0003] With the continuous development of computer software and artificial intelligence, the application fields of artificial intelligence are becoming more and more extensive. In the dialogue system based on artificial intelligence, in order to more accurately identify the semantics of the sentence, it is necessary to identify the tense of the sentence before classifying the intent of the sentence. At present, the tense of the sentence is usually judged based on the word information of the keywords in the original sentence. For example, "already" means past tense, "will" means future tense, etc. However, due to the single basis for judging the tense of the sentence, this method has a high probability of misjudgment. For example, suppose the sentence is "I want to listen to the song I won't cry anymore", the keyword "already" appears in the sentence, but the keyword does not mean past tense, which leads to a low accuracy rate of sentence tense recognition. Summary of the invention

[0004] The main purpose of the present application is to provide a sentence tense recognition method, device and readable storage medium based on dependency syntax, aiming to solve the technical problem of low accuracy of sentence tense recognition in the prior art.

[0005] To achieve the above-mentioned purpose, the present application provides a sentence tense recognition method based on dependency syntax, the sentence tense recognition method based on dependency syntax is applied to a sentence tense recognition device based on dependency syntax, and the sentence tense recognition method based on dependency syntax includes:

[0006] Obtaining a sentence to be parsed, and performing dependency syntactic analysis on the sentence to be parsed, to obtain a dependency syntactic analysis result corresponding to the sentence to be parsed;

[0007] Based on the dependency syntactic analysis result, sentence tense recognition is performed on the sentence to be parsed to obtain a sentence tense recognition result.

[0008] The present application also provides a sentence tense recognition device based on dependency syntax, wherein the sentence tense recognition device based on dependency syntax is a virtual device, and the sentence tense recognition device based on dependency syntax is applied to a sentence tense recognition device based on dependency syntax, and the sentence tense recognition device based on dependency syntax includes:

[0009] A dependency syntactic analysis module, used to obtain a sentence to be parsed, and perform dependency syntactic analysis on the sentence to be parsed to obtain a dependency syntactic analysis result corresponding to the sentence to be parsed;

[0010] The tense recognition module is used to perform sentence tense recognition on the sentence to be parsed based on the dependency syntactic analysis result to obtain a sentence tense recognition result.

[0011] The present application also provides a sentence tense recognition device based on dependency syntax, which is a physical device. The sentence tense recognition device based on dependency syntax includes: a memory, a processor, and a program of the sentence tense recognition method based on dependency syntax stored in the memory and executable on the processor. When the program of the sentence tense recognition method based on dependency syntax is executed by the processor, the steps of the sentence tense recognition method based on dependency syntax as described above can be implemented.

[0012] The present application also provides a readable storage medium, on which is stored a program for implementing a sentence tense recognition method based on dependency syntax. When the program for the sentence tense recognition method based on dependency syntax is executed by a processor, the steps of the sentence tense recognition method based on dependency syntax as described above are implemented.

[0013] The present application provides a sentence tense recognition method, device and readable storage medium based on dependency syntax. Compared with the technical means used in the prior art to judge the tense of a sentence based solely on the word information of the keywords themselves in the original sentence, the present application performs dependency syntax analysis on the sentence to be parsed after obtaining the sentence to be parsed, obtains the dependency syntax analysis result corresponding to the sentence to be parsed, thereby realizing the purpose of obtaining the dependency syntax information of the sentence to be parsed based on the method of dependency syntax analysis, and then, based on the dependency syntax analysis result, performs sentence tense recognition on the sentence to be parsed, thereby realizing the tense recognition of the sentence to be parsed based on the dependency syntax information. The purpose of parsing sentences to identify the tense of sentences, wherein the dependent syntactic information includes the word component information of each word in the sentence to be parsed, thereby achieving the purpose of identifying the tense of the sentence based on the word information of the keyword itself and the word component information of the keyword in the sentence, making the basis for judging the tense of the sentence more sufficient, overcoming the technical defect that when the tense of the sentence is judged based solely on the word information of the keyword itself in the original sentence in the prior art, the probability of misjudgment is high due to the single basis of the sentence tense of this method, thereby leading to a low accuracy rate of sentence tense recognition, thereby improving the accuracy rate of sentence tense recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0015] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0016] Figure 1 This is a flowchart of the first embodiment of the sentence tense recognition method based on dependency syntax of the present application;

[0017] Figure 2 A schematic diagram of a dependency tree corresponding to the sentence to be parsed in the sentence tense recognition method based on dependency syntax of this application;

[0018] Figure 3 This is a flow chart of a second embodiment of a sentence tense recognition method based on dependency syntax of the present application;

[0019] Figure 4 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present application.

[0020] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0021] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0022] The present application embodiment provides a sentence tense recognition method based on dependency syntax. In the first embodiment of the sentence tense recognition method based on dependency syntax of the present application, referring to Figure 1 , the sentence tense recognition method based on dependency syntax includes:

[0023] Step S10, obtaining a sentence to be parsed, and performing dependency syntactic analysis on the sentence to be parsed to obtain a dependency syntactic analysis result corresponding to the sentence to be parsed;

[0024] In this embodiment, it should be noted that the sentence tense recognition method based on dependency syntax is applied to a human-computer dialogue system, the sentence to be parsed is a sentence collected and preprocessed during human-computer dialogue, and the sentence tense recognition device based on dependency syntax includes a preset dependency syntax model, wherein the purpose of preprocessing is to remove meaningless words in the collected sentences, and the preset dependency syntax model is a pre-trained machine learning model for performing dependency syntax analysis on the sentences, wherein the process of dependency syntax analysis is the process of parsing the syntactic information of the sentences, wherein the syntactic information includes sentence information and word component information, for example, assuming the sentence is "Who am I", then after dependency syntax analysis, the sentence information indicates that the sentence is a subject-predicate-object sentence, and the word component information indicates that "I" is the subject, "is" is the predicate, and "who" is the object.

[0025] A sentence to be parsed is obtained, and dependency syntactic analysis is performed on the sentence to be parsed to obtain a dependency syntactic analysis result corresponding to the sentence to be parsed. Specifically, the sentence to be parsed is obtained, and the sentence to be parsed is input into the preset dependency syntactic model, and dependency relationship discrimination and dependency relationship type prediction are performed on the sentence to be parsed respectively, so as to perform dependency syntactic analysis on the sentence to be parsed. It should be noted that the purpose of performing dependency relationship discrimination is to discriminate the dependency relationship between words, and the purpose of dependency relationship type prediction is to predict the type of dependency relationship. For example, assuming that the sentence to be parsed has The sentence is a sentence "ABC", where A, B and C are all words in the sentence to be parsed. After dependency relationship identification, it can be determined that B depends on A, and C depends on B. After dependency relationship type prediction, it can be determined that the dependency relationship between A and B is a subject-predicate relationship, and the dependency relationship between B and C is a verb-object relationship, thereby obtaining the dependency syntactic analysis result. In one practicable manner, the dependency relationship identification and dependency relationship type prediction are respectively performed on the sentence to be parsed to perform dependency syntactic analysis on the sentence to be parsed. The step of obtaining the dependency syntactic analysis result includes:

[0026] Dependency discrimination is performed on the sentence to be parsed to obtain the dependency discrimination result corresponding to the sentence to be parsed, and dependency type prediction is performed on the sentence to be parsed to obtain the dependency type prediction result corresponding to the sentence to be parsed, and then the dependency discrimination result and the dependency type prediction result are merged to obtain the dependency type label between words in the sentence to be parsed, wherein the dependency type label is an identifier of the dependency type, and then based on the dependency type label, the sentence information and word component information of the sentence to be parsed can be determined to obtain the dependency syntactic analysis result, wherein the dependency discrimination result can be represented by a vector, the dependency discrimination result in vector form is a dependency discrimination vector, and the dependency type prediction result can be represented by a matrix It is shown that the matrix form corresponding to the dependency type prediction result is a dependency type prediction probability matrix, wherein the value on each bit position in the dependency type prediction probability matrix is ​​a dependency type label probability prediction vector between one word and another word in the sentence to be parsed, wherein the value on each bit position in the dependency type prediction vector is a probability value that the dependency relationship between one word and another word in the sentence to be parsed belongs to the preset dependency relationship corresponding to the bit position, wherein the preset dependency relationship includes a subject-predicate relationship, a verb-object relationship, etc. For example, assuming that the dependency type label probability prediction vector between word A and word B is (0.1, 0.9), then 0.1 indicates that the probability of the subject-predicate relationship between word A and word B is 10%, and 0.9 indicates that the probability of the verb-object relationship between word A and word B is 90%.

[0027] In an implementable solution, the step of fusing the dependency vector with the dependency type prediction probability matrix to obtain dependency type labels between words in the sentence to be parsed includes:

[0028] Aggregate the dependency vector with each dependency type label probability prediction vector in the dependency type prediction probability matrix to obtain an aggregated vector corresponding to each dependency type label probability prediction vector, wherein the aggregation includes weighted summation, splicing and summation, etc., and then for each of the aggregated vectors, select the maximum bit value from the bit values ​​in the aggregated vector, and use the preset dependency label corresponding to the bit corresponding to the maximum bit value as the dependency type label corresponding to the dependency type label probability prediction vector.

[0029] The step of obtaining the statement to be parsed includes:

[0030] Step S11, obtaining a sentence to be processed, and identifying background components in the sentence to be processed;

[0031] In this embodiment, a sentence to be processed is obtained, and background components in the sentence to be processed are identified. Specifically, the sentence to be processed is obtained, and the word position of each word to be processed in the sentence to be processed is determined, wherein the word position includes a prefix position, a mid-sentence position, and a suffix position. Then, based on the word position of each word to be processed, a corresponding preset position background word set is matched for each word to be parsed. Then, based on the preset position background word set corresponding to each word to be parsed, each background word is determined in each word to be parsed, and each background word is used as the background component, wherein the preset position background word set includes a prefix position background word set, a mid-sentence position background word set, a background word set, and a background word set. and a suffix position background word set, wherein the prefix position background word set includes prefix position background words such as "also known as", "also known as", "for example", "for example", "I want to know", "I know", "I don't know", "I want to understand", "I want to understand", "I want to ask", "I want to ask", "May I ask", etc., the sentence position background word set includes sentence position background words such as "generally speaking", "wait a moment", "that", "please", etc., and the suffix position background word set includes suffix position background words such as "what's the matter", "do you know", "is that what you mean", "really", "is it", etc.

[0032] In addition, it should be noted that, in an practicable manner, the step of determining each background word in each of the words to be parsed based on the preset position background word set corresponding to each of the words to be parsed includes: performing the following steps for each of the words to be parsed:

[0033] The word to be analyzed is compared with each preset background word in the preset position background word set corresponding to the word to be analyzed to determine whether there is a preset background word consistent with the word to be analyzed in the preset position background word set corresponding to the word to be analyzed. If so, the word to be analyzed is used as a background word. If not, the word to be analyzed is not a background word.

[0034] Step S12, removing the background component from the sentence to be processed to obtain the sentence to be parsed.

[0035] In this embodiment, the background components are removed from the sentence to be processed to obtain the sentence to be parsed. Specifically, the background components in the sentence to be processed are removed to eliminate the background components that interfere with the sentence trunk extraction process in the sentence to be processed, and then the part of the sentence to be processed other than the background components is used as the sentence to be parsed to improve the accuracy of sentence trunk extraction.

[0036] Step S20: Based on the dependency syntactic analysis result, sentence tense recognition is performed on the sentence to be parsed to obtain a sentence tense recognition result.

[0037] In this embodiment, it should be noted that the dependency syntactic analysis result includes word component information of the sentence to be parsed, wherein the word component information is the word component of each word to be parsed in the sentence to be parsed, wherein the word component includes predicate, subject and adverbial, etc.

[0038] Based on the dependency syntactic analysis result, the sentence tense of the sentence to be parsed is identified to obtain a sentence tense identification result. Specifically, based on the word component information, the word component position of each of the words to be parsed in the sentence to be parsed is determined, wherein the word component position includes the predicate component position, the object component position and the adverbial component position, etc., and then the target word component position is determined in each of the word component positions, and a tense marker word is selected at the target word component position, and then it is determined whether the tense marker word and the target word component position simultaneously meet the preset tense conditions, so as to perform sentence tense recognition on the sentence to be parsed and obtain a sentence tense recognition result, wherein The preset tense conditions include past tense conditions, present tense conditions and future tense conditions, wherein the past tense conditions are used to determine whether the tense of the sentence is past tense, the present tense conditions are used to determine whether the tense of the sentence is present tense, and the future tense conditions are used to determine whether the tense of the sentence is future tense. The tense marker words are words representing the tense of the sentence, which are used to identify the tense of the sentence. The tense marker words include already, will, and in between. The sentence tense recognition result is a sentence tense label identified based on dependency syntax, which is used to identify the tense of the sentence. The sentence tense recognition result includes a past tense label, a present tense label and a future tense label.

[0039] The step of performing sentence tense recognition on the sentence to be parsed based on the dependency syntactic analysis result to obtain the sentence tense recognition result comprises:

[0040] Step S21, extracting the target sentence trunk of the sentence to be parsed based on the dependency syntactic analysis result;

[0041] In this embodiment, it should be noted that the dependency syntactic analysis result includes a prediction result based on a relationship label, wherein the dependency relationship label prediction result is an identifier of the dependency relationship type between words in the sentence to be parsed, wherein the dependency relationship type includes a subject-predicate relationship type, a verb-object relationship type, and a verb-complement structure type, etc.

[0042] Based on the dependency parsing result, extract the target sentence backbone corresponding to the sentence to be parsed. Specifically, based on the prediction result of the dependency relation label, determine the word components of each word to be parsed in the sentence to be parsed, and then based on the part of speech of each word to be parsed and the word components of each word to be parsed in the sentence to be parsed, determine the sentence pattern information of the sentence to be parsed. Herein, the part of speech is the nature of the word to be parsed itself. For example, the part of speech includes verbs, nouns, quantifiers, etc. The word component is the nature shown by the word to be parsed in the sentence to be parsed. For example, the word component includes subject, predicate, object, etc. Then, based on the sentence pattern information, select the target core word in the sentence to be parsed, and then based on the prediction result of the dependency relation type, select each target sentence backbone word associated with the target core word in the sentence to be parsed, and then form the target sentence backbone by combining the target core word and each target sentence backbone word.

[0043] Among them, the dependency parsing result includes the prediction result of the dependency syntax type label.

[0044] The steps of extracting the target sentence backbone of the sentence to be parsed based on the dependency parsing result include:

[0045] Step S211, determine the sentence pattern information corresponding to the sentence to be parsed based on the prediction result of the dependency syntax type label.

[0046] In this embodiment, to determine the sentence pattern information corresponding to the sentence to be parsed based on the prediction result of the dependency syntax type label, specifically, based on the dependency relation type between each word to be parsed in the sentence to be parsed, determine the word components of each word to be parsed, and then obtain the part of speech of each word to be parsed. Then, based on the part of speech and word components of each word to be parsed, perform sentence pattern discrimination on the words to be parsed to determine the sentence pattern information of the sentence to be parsed. Herein, the sentence pattern information is the identification information of the sentence pattern of the word to be parsed. The sentence patterns of the words to be parsed include verb-predicate sentences, noun-predicate sentences, adjective-predicate sentences, preposition-predicate sentences, serial verb sentences, double-object sentences, comparative sentences, passive sentences, ba-sentences, and pivotal sentences, etc. Among them, the verb-predicate sentence is a sentence with a verb as the predicate, the noun-predicate sentence is a sentence with a noun as the predicate, the adjective-predicate sentence is a sentence with an adjective as the predicate, the preposition-predicate sentence is a sentence with a preposition as the predicate, the serial verb sentence is a sentence with two consecutive verbs that do not dominate each other as the predicate, the double-object sentence is a sentence in which the dependency relation type corresponding to the predicate simultaneously includes the indirect object relation type and the verb-object relation type, the comparative sentence is a sentence in which the adverbial of the predicate starts with "bi", the passive sentence is a sentence in which the adverbial of the predicate starts with "bei", the ba-sentence is a sentence in which the adverbial of the predicate starts with "ba", and the pivotal sentence is a sentence in which the dependency relation type corresponding to the object is the pivotal type.

[0047] Step S212: extracting the target sentence trunk based on the sentence pattern information and the dependency syntactic type label prediction result.

[0048] In this embodiment, based on the sentence pattern information and the dependency syntax type label prediction result, the target sentence trunk is extracted. Specifically, based on the sentence pattern information, a target core word is selected from the words to be parsed in the sentence to be parsed, wherein the target core word is the word to be parsed that serves as the core predicate. For example, assuming that the sentence pattern information indicates that the sentence to be parsed is a verb predicate sentence, the verb on the predicate of the sentence to be parsed is the target core word. Then, based on the preset word component priority level and the dependency relationship type between words in the sentence to be parsed, each target sentence trunk word corresponding to the target core word is selected, and then the dependency syntax vector corresponding to the target core word and each target sentence trunk word is added. As the target sentence trunk, wherein the preset word component priority sentence is the word component that is preferentially extracted when extracting the sentence trunk, and it should be noted that in order to ensure that the semantics of the target sentence trunk are clear and concise, the number of extracted word components needs to be set in advance. For example, assuming that the pre-set extracted word components include subject, predicate and object, and the predicate is a verb, then based on the subject-predicate relationship type in the dependency relationship type, the subject corresponding to the target core word is determined as the target sentence trunk word, and based on the verb-object relationship type in the dependency relationship type, the subject corresponding to the target core word is determined as the target sentence trunk word, and then the target sentence trunk is composed of a subject, a predicate and an object.

[0049] In another embodiment, the step of extracting the target sentence body based on the sentence pattern information and the dependency syntactic type label prediction result includes:

[0050] Based on the sentence pattern information, the dependency relationship type between words in the sentence to be parsed, and the part of speech of each word to be parsed in the sentence to be parsed, a dependency tree corresponding to the sentence to be parsed is generated, and then based on the preset word component priority and the dependency tree, the target sentence trunk is extracted, wherein the preset word component priority is the priority of the extracted word component in the sentence trunk extraction process. In an implementable manner, the sentence to be parsed is "He was very disappointed and later took the civil servant examination for the Ministry of Finance several times", then as follows Figure 2 The figure shows a schematic diagram of the dependency tree corresponding to the sentence to be parsed, wherein ROOT represents the sentence to be parsed, m, a, u, r, nt, d, v, q and n are all part-of-speech labels, and ADV, RAD, ATT, HED, SBV, CMP and VOB are dependency type labels.

[0051] The step of extracting the target sentence trunk based on the sentence pattern information and the dependency syntactic type label prediction result comprises:

[0052] Step A10, determining the target core word corresponding to the sentence to be parsed based on the sentence pattern information;

[0053] In this embodiment, based on the sentence pattern information, the target core word corresponding to the sentence to be parsed is determined. Specifically, based on the sentence pattern information, the core predicate corresponding to the sentence to be parsed is determined, wherein the core predicate is the predicate that determines the sentence pattern information of the sentence to be parsed, and then the word to be parsed corresponding to the core predicate is used as the target core word.

[0054] Step A20, determining each target sentence stem word corresponding to the target core word based on the preset word component priority and the dependency syntax type label prediction result;

[0055] In this embodiment, it should be noted that the preset word component priority is the priority of the extracted word components in the sentence trunk extraction process, and the preset word component priority includes a preset first priority, a preset second priority and a preset third priority, wherein, in an implementable manner, the word components corresponding to the preset first priority include subject, predicate, object, adverbial and complement, the word components corresponding to the preset second priority include attributives, and the word components corresponding to the preset third priority include other word components except the word components corresponding to the preset first priority and the preset second priority.

[0056] Based on the preset word component priority and the prediction result of the dependency syntax type label, the target sentence stem words corresponding to the target core word are determined. Specifically, based on the dependency relationship type between words in the sentence to be parsed, the word components of each to-be-selected word corresponding to the target core word are determined, and then based on the number of layers of the preset word component priority, priority word components are selected from the word components of each to-be-selected word, and then the to-be-parsed words corresponding to each of the priority word components are used as the target sentence stem words. It should be noted that the first layer of the preset word component priority is the preset first priority, the second layer of the preset component priority is the preset second priority, and the third layer of the preset word component is the preset third priority.

[0057] Step A30, generating the target sentence stem based on the sentence pattern information, the target core words and each target sentence stem word.

[0058] In this embodiment, based on the sentence pattern information, the target core word and each of the target sentence stem words, the target sentence stem is generated. Specifically, the word component and part of speech of the target core word, as well as the word component and part of speech of each of the target sentence stem words are obtained, and then based on the sentence pattern information, the target core word, the part of speech and word component of the target core word, each of the target sentence stem words and the part of speech and word component corresponding to each of the target sentence stem words, the target sentence stem is generated. In one practicable manner, assuming that the sentence to be parsed is "He is very disappointed. Later, I took the civil service exam for the Department of Finance several times." The target sentence trunk is {sentence pattern: subject-predicate-object sentence, subject: [he, ATT: [very disappointed]], predicate: [take the exam, RAD: [got]], preposed object: [], object: [civil servant, ATT: Department of Finance]: COO: [], CMP: [several times], ADV: [later, again]}, where ATT is a label of the attributive-predicate relationship type, RAD is a label of the right-attached relationship type, COO is a label of the parallel relationship type, CMP is a label of the verb-complement structure type, and ADV is a label of the adverbial-predicate structure type.

[0059] In addition, it should be noted that since the sentence stem extraction is performed based on the sentence pattern information corresponding to the sentence to be parsed obtained through dependency syntactic analysis, the corresponding word components and the corresponding dependency relationship types between words, this embodiment can explain the reasons for the sentence stem extraction results, and the sentence stem extraction results are highly interpretable, and the confidence in the sentence stem extraction results is extremely high.

[0060] Step S22: Based on the target sentence trunk, sentence tense recognition is performed on the sentence to be parsed to obtain the sentence tense recognition result.

[0061] In this embodiment, based on the target sentence stem, sentence tense recognition is performed on the sentence to be parsed to obtain the sentence tense recognition result. Specifically, based on the word component information, the stem word component position corresponding to each sentence stem word in the target sentence stem is determined, wherein the stem word component position is the position of the word component corresponding to the sentence stem word. For example, assuming that the sentence stem word is the subject, the stem word component position is the subject position, and then the target stem word component position is determined in each of the stem word component positions, and a sentence stem tense marker word is selected at the target stem word component position, and then it is determined whether the sentence stem tense marker word and the target stem word component position simultaneously meet the preset tense conditions, so as to perform sentence tense recognition on the sentence to be parsed to obtain the sentence tense recognition result, wherein it is necessary to say It is obvious that compared with the sentence to be parsed, the target sentence trunk eliminates the words to be parsed that have little contribution to the sentence tense recognition, which can reduce the interference of the words to be parsed that have little contribution to the sentence tense recognition on the sentence tense recognition, and improve the accuracy of sentence tense recognition. For example, assuming that the sentence to be parsed includes adverbials A and adverbials B, when performing sentence tense recognition, it is necessary to determine the tense of the sentence based on the words to be parsed in the adverbial position, but because only adverbial A is related to the core predicate of the sentence, adverbial A contributes more to the tense determination of the entire sentence, and adverbial B contributes less to the tense determination of the entire sentence, and therefore it is necessary to extract the sentence trunk and eliminate adverbial B, and then determine the sentence tense only based on adverbial A in the target sentence trunk, which can reduce the interference with sentence tense recognition and improve the accuracy of sentence tense recognition.

[0062] The step of performing sentence tense recognition on the sentence to be parsed based on the target sentence trunk to obtain the sentence tense recognition result comprises:

[0063] Step B10, based on the preset keyword component positions, selecting tense-significant words in the target sentence trunk;

[0064] In this embodiment, it should be noted that the preset keyword component positions include adverbial component positions, predicate component positions, object component positions, right additional component positions, complement component positions, and the like.

[0065] Based on the preset keyword component position, a tense marker word is selected in the target sentence trunk. Specifically, the sentence trunk word at the preset keyword component position in the target sentence trunk is extracted as a to-be-recognized word, and it is determined whether the to-be-recognized word belongs to a preset tagging word set. If so, the to-be-recognized word is used as a tense marker word. In an implementable solution, the preset tagging word set in a table form is as follows:

[0066]

[0067]

[0068] Among them, the word position is the preset keyword component position.

[0069] Step B20, based on the tense landmark words and preset tense judgment priority information, perform sentence tense recognition on the sentence to be parsed to obtain the sentence tense recognition result.

[0070] In this embodiment, it should be noted that the preset tense judgment priority information includes word position priority and word information priority, wherein the word position priority is the order of the positions of each word component based on which the sentence tense judgment is made, and the word information priority is the order of the tenses represented by each word information based on which the sentence tense judgment is made, and the tense-marking words include at least one word to be parsed.

[0071] Based on the tense marker words and preset tense judgment priority information, sentence tense recognition is performed on the sentence to be parsed to obtain the sentence tense recognition result. Specifically, each marker word information of the tense marker words and each marker word component position corresponding to the tense marker words are obtained, and then based on the word position priority, the tense judgment based on the word information priority is performed on the marker word information of the words to be parsed at each marker word component position in turn to obtain the sentence tense recognition result. For example, assuming that the word position priority is to first determine the adverbial component position and then the predicate component position, and the word information priority is to first determine the past tense, then the future tense, and finally the present tense. Then the sentence tense recognition process is to first determine in turn whether the marker word information at the adverbial component position represents the past tense, future tense and present tense, and then determine in turn whether the marker word information at the predicate component position represents the past tense, future tense and present tense.

[0072] In an implementable scheme, for the same landmark word component position, it is usually first determined whether the landmark word information indicates past tense. If so, it indicates that the tense of the sentence to be parsed is past tense. If not, it is determined whether the landmark word information indicates future tense. If so, it indicates that the tense of the sentence to be parsed is future tense. If not, it is determined whether the landmark word information indicates present tense. If so, it indicates that the tense of the sentence to be parsed is present tense. If not, the tense of the sentence to be parsed is determined based on other landmark word component positions. For different landmark word component positions, the first priority in sentence tense determination is the adverbial component position, the second priority in sentence tense determination is the predicate component position, and the third priority in sentence tense determination is the right additional component position of the predicate, the complement component position and the sentence-end word position, etc.

[0073] Wherein, the step of performing sentence tense recognition on the sentence to be parsed based on the target sentence trunk and obtaining the sentence tense recognition result further includes:

[0074] Step C10, inputting the target sentence trunk into a preset sentence classification model, classifying the target sentence trunk, and obtaining a sentence classification label corresponding to the target sentence trunk;

[0075] In this embodiment, the target sentence trunk is input into a preset sentence classification model, the target sentence trunk is classified, and a sentence classification label corresponding to the target sentence trunk is obtained. Specifically, the target sentence trunk is vectorized to obtain a vectorized sentence trunk corresponding to the target sentence trunk, and then the vectorized sentence trunk is input into the preset sentence classification model, and the vectorized sentence trunk is tense classified to obtain the sentence classification label, wherein the sentence classification label is a label that identifies the tense of the sentence, wherein the sentence classification label includes a present tense type label, a past tense label, and a future tense label.

[0076] Step C20, based on the sentence classification label, perform sentence tense recognition on the sentence to be parsed to obtain the sentence tense recognition result.

[0077] In this embodiment, based on the sentence classification label, sentence tense recognition is performed on the sentence to be parsed to obtain the sentence tense recognition result. Specifically, if the sentence classification label is a present tense type label, the sentence tense recognition result is that the sentence tense of the sentence to be parsed is present tense; if the sentence classification label is a past tense type label, the sentence tense recognition result is that the sentence tense of the sentence to be parsed is past tense; if the sentence classification label is a future tense type label, the sentence tense recognition result is that the sentence tense of the sentence to be parsed is future tense.

[0078] The present embodiment provides a sentence tense recognition method based on dependency syntax. Compared with the technical means used in the prior art to judge the tense of a sentence based solely on the word information of the keywords themselves in the original sentence, the present embodiment performs dependency syntax analysis on the sentence to be parsed after obtaining the sentence to be parsed, and obtains the dependency syntax analysis result corresponding to the sentence to be parsed, thereby realizing the purpose of obtaining the dependency syntax information of the sentence to be parsed based on the method of dependency syntax analysis, and then performing sentence tense recognition on the sentence to be parsed based on the dependency syntax analysis result, thereby realizing the sentence to be parsed based on the dependency syntax information. The purpose of sentence tense recognition is that the dependent syntactic information includes the word component information of each word in the sentence to be parsed, so as to achieve the purpose of sentence tense recognition based on the word information of the keyword itself and the word component information of the keyword in the sentence, so that the basis for judging the sentence tense is more sufficient, and the technical defect that the accuracy of sentence tense recognition is low is overcome when the tense of the sentence is judged based solely on the word information of the keyword itself in the original sentence in the prior art, because the sentence tense basis of this method is single, resulting in a high probability of misjudgment, thereby improving the accuracy of sentence tense recognition.

[0079] Further, refer to Figure 3 Based on the first embodiment of the present application, in another embodiment of the present application, the dependency syntax analysis result includes a dependency relationship type prediction result,

[0080] The step of performing dependency syntactic analysis on the sentence to be parsed to obtain a dependency syntactic analysis result corresponding to the sentence to be parsed comprises:

[0081] Step S11, vectorizing the statement to be parsed to obtain a vectorized statement;

[0082] In this embodiment, the sentence to be parsed is vectorized to obtain a vectorized sentence. Specifically, a word vector to be parsed, a part-of-speech vector to be parsed and a word position vector to be parsed corresponding to each word to be parsed in the sentence to be parsed are generated, wherein the word vector to be parsed is an encoding vector representing the word to be parsed, which is used to uniquely represent the word to be parsed, the part-of-speech vector to be parsed is an encoding vector representing the part of speech of the word to be parsed, and the word position vector to be parsed is an encoding vector representing the position of the word to be parsed in the sentence to be parsed, and then based on the word vector to be parsed, the corresponding part-of-speech vector to be parsed and the corresponding word position vector to be parsed corresponding to each word to be parsed, a vectorized word corresponding to each word to be parsed is generated, and then the matrix formed by each of the vectorized words is used as the vectorized sentence.

[0083] The sentence to be parsed includes at least one word to be parsed, and the vectorized sentence includes at least one vectorized word.

[0084] The step of vectorizing the statement to be parsed to obtain the vectorized statement comprises:

[0085] Step S111, obtaining a word vector to be parsed, a part-of-speech vector to be parsed and a position vector to be parsed corresponding to the word to be parsed;

[0086] In this embodiment, the word vector to be parsed, the corresponding part-of-speech vector to be parsed and the corresponding word position vector to be parsed corresponding to the word to be parsed are obtained. Specifically, based on a preset word vector generation model, the word to be parsed is mapped to a preset vector space, the word vector to be parsed corresponding to the word to be parsed is obtained, and the corresponding part-of-speech vector to be parsed is matched for the word to be parsed. Furthermore, based on the position of the word to be parsed in the sentence to be parsed, the word position vector to be parsed corresponding to the word to be parsed is generated.

[0087] Step S112, generating the vectorized word based on the word vector to be parsed, the part-of-speech vector to be parsed and the word position vector to be parsed.

[0088] In this embodiment, the vectorized word is generated based on the word vector to be parsed, the part-of-speech vector to be parsed, and the word position vector to be parsed. Specifically, the word to be parsed, the part-of-speech vector to be parsed, and the word position vector to be parsed are input into a preset vectorized word calculation formula to obtain the vectorized word, wherein the preset vectorized word calculation formula is as follows:

[0089]

[0090] Among them, X i is the vectorized word, E w is the word vector to be parsed, E t is the part-of-speech vector to be parsed, E p is the position vector of the word to be parsed, It is the concatenation operation between vectors.

[0091] Step S12, based on a preset dependency determination model, performing dependency determination on the vectorized sentence to obtain a dependency determination result;

[0092] In this embodiment, it should be noted that the preset dependency syntax model includes a preset dependency relationship discrimination model, wherein the preset dependency relationship discrimination model is a machine learning model for determining whether there is a dependency relationship between words in the sentence to be parsed.

[0093] Based on a preset dependency discrimination model, dependency discrimination is performed on the vectorized sentence to obtain a dependency discrimination result. Specifically, the vectorized sentence is input into the preset dependency discrimination model, and dependency discrimination is performed on the vectorized sentence to determine whether there is a dependency relationship between words in the sentence to be parsed, and a dependency discrimination result is obtained.

[0094] The preset dependency relationship discrimination model includes a first feature extraction model, a first fully connected network, a second fully connected network and a first dual affine transformation network.

[0095] The step of performing dependency determination on the vectorized sentence based on a preset dependency determination model to obtain a dependency determination result includes:

[0096] Step S121, performing feature extraction on the vectorized sentence based on the first feature extraction model to obtain a first feature extraction result;

[0097] In this embodiment, it should be noted that the first feature extraction model is a neural network that extracts features from the vectorized sentence, and the first feature extraction model includes a Transformer model, an RNN network, a CNN network, and the like.

[0098] Based on the first feature extraction model, feature extraction is performed on the vectorized sentence to obtain a first feature extraction result. Specifically, the vectorized sentence is input into the first feature extraction model, feature extraction is performed on the vectorized sentence to obtain a first feature extraction matrix, and the first feature extraction matrix is ​​used as the first feature extraction result.

[0099] Step S122, based on the first fully connected network and the second fully connected network, respectively fully connect the first feature extraction result to obtain a first sentence vector and a second sentence vector;

[0100] In this embodiment, based on the first fully connected network and the second fully connected network, the first feature extraction result is fully connected respectively to obtain a first sentence vector and a second sentence vector. Specifically, the first feature extraction matrix is ​​input into the first fully connected network, the first feature extraction matrix is ​​fully connected to obtain a first sentence vector, and the first feature extraction matrix is ​​input into the second fully connected network, the first feature extraction matrix is ​​fully connected to obtain a second sentence vector. It should be noted that the first sentence vector includes at least a prefix vector, which is used to represent the representation vector of the dependent word in the dependency relationship, and the second sentence vector includes at least a suffix vector, which is used to represent the representation vector of the dependent word in the dependency relationship. For example, assuming that word A depends on word B, the word representation vector corresponding to word B is the prefix vector, and the word representation vector corresponding to word A is the suffix vector.

[0101] Step S123: Based on the first double affine transformation network, perform double affine transformation on the first sentence vector and the second sentence vector to obtain a dependency score matrix;

[0102] In this embodiment, based on the first double affine transformation network, the first sentence vector and the second sentence vector are subjected to double affine transformation to obtain a dependency score matrix. Specifically, the first sentence vector and the second sentence vector are input into the first double affine transformation network, and the first sentence vector and the second sentence vector are subjected to double affine transformation to calculate the probability score that there is a dependency relationship between each prefix vector in the first sentence vector and each suffix vector in the second sentence vector, so as to obtain the dependency score matrix, wherein the dependency score matrix is ​​a score matrix composed of the probability scores that there is a dependency relationship between each prefix vector and each suffix vector.

[0103] Step S124: determining the dependency determination result based on the dependency score matrix.

[0104] In this embodiment, based on the dependency score matrix, the dependency judgment result is determined, specifically based on the preset maximum spanning tree algorithm, the maximum probability score and the maximum probability score that meet the preset score selection condition are selected in the dependency score matrix, and the dependency vector composed of the vectorized words corresponding to the dependency corresponding to the maximum probability score and the corresponding target probability scores is used as the dependency judgment result, wherein the preset score selection condition includes a one-to-one correspondence between the words to be parsed corresponding to each target probability score and the words to be parsed in the sentence to be parsed, etc. For example, assuming that each of the target probability scores is A and B, wherein the target probability score A represents the probability score of word b attached to word a, the target probability score B represents the probability score of word c attached to word b, and the vectorized word corresponding to word a is vector X, the vectorized word corresponding to word b is vector Y, and the vectorized word corresponding to word c is vector Z, and then the dependency vector is a vector (X, 1, 0, 0, 1, Y, 1, 0, 0, 1, Z), wherein (1, 0, 0, 1) indicates that there is a dependency relationship between words.

[0105] Step S13: Based on a preset dependency type prediction model and the dependency identification result, the dependency type prediction is performed on the vectorized statement to obtain the dependency type prediction result.

[0106] In this embodiment, the preset dependency syntax model includes a preset dependency relationship type prediction model, wherein the preset dependency relationship type prediction model is a machine learning model for predicting the dependency relationship type between words in the sentence to be parsed.

[0107] Based on the preset dependency type prediction model and the dependency discrimination result, the dependency type prediction is performed on the vectorized sentence to obtain the dependency type prediction result. Specifically, based on the preset dependency type prediction model, the dependency type prediction is performed on the vectorized sentence to obtain a dependency type probability score matrix, wherein it should be noted that there is a dependency type probability score vector on each bit in the dependency type probability score matrix, wherein the value on each bit of the dependency type probability score vector is the probability score of the preset dependency type. For example, assuming that the dependency type probability score vector is (A, B, C), and the first bit of the dependency type probability score vector corresponds to the subject-predicate relationship, and the second bit corresponds to the verb-object relationship. The third position corresponds to a parallel relationship, then A is the probability score that the dependency relationship between the two words corresponding to the dependency relationship type probability score vector is a subject-predicate relationship, B is the probability score that the dependency relationship between the two words corresponding to the dependency relationship type probability score vector is a verb-object relationship, and A is the probability score that the dependency relationship between the two words corresponding to the dependency relationship type probability score vector is a subject-predicate relationship, and then based on the dependency discrimination result, each target dependency relationship type probability score vector is selected in the dependency relationship type probability score matrix, and then the dependency relationship type corresponding to the maximum value in each target dependency relationship type probability score vector is used as the target dependency relationship type, and then the dependency relationship type between the words of the sentence to be parsed is obtained, that is, the dependency relationship type prediction result is obtained.

[0108] The step of performing dependency type prediction on the vectorized statement based on the preset dependency type prediction model and the dependency discrimination result to obtain the dependency type prediction result includes:

[0109] Step S131, based on the preset dependency type prediction model, predict the dependency type of the vectorized sentence to obtain a dependency type probability score matrix;

[0110] In this embodiment, it should be noted that the preset dependency type prediction model includes a second feature extraction model, a third fully connected network, a fourth fully connected network and a second dual affine transformation network.

[0111] Based on the preset dependency type prediction model, the dependency type of the vectorized sentence is predicted to obtain a dependency type probability score matrix. Specifically, the vectorized sentence is input into a second feature extraction model, and feature extraction is performed on the vectorized sentence to obtain a second feature extraction matrix. The second feature extraction matrix is ​​respectively input into a third fully connected network and a fourth fully connected network to obtain a third sentence vector and a fourth sentence vector corresponding to the second feature extraction matrix. The third sentence vector and the fourth sentence vector are input into a second double affine transformation network, and double affine transformation is performed on the third sentence vector and the fourth sentence vector to obtain the dependency type probability score matrix.

[0112] Step S132: fusing the dependency type probability score matrix and the dependency vector to obtain the dependency type prediction result.

[0113] In this embodiment, the dependency type probability score matrix and the dependency vector are fused to obtain the dependency type prediction result. Specifically, based on a preset fusion rule, each dependency type probability score vector in the dependency type probability score matrix is ​​fused with the dependency vector to obtain a dependency type probability vector corresponding to each dependency type probability score vector, wherein the preset fusion rule includes weighted averaging, splicing, summing, etc., and the value on each bit of the dependency type probability vector is the probability of a preset dependency type, and the preset dependency types include subject-predicate relationship type, verb-object relationship type, and parallel relationship type, etc., and then the dependency type probability vectors are respectively calculated in each of the dependency types. The maximum probability value in the type probability vector is selected as the target dependency type probability, and then the dependency type corresponding to each maximum dependency type probability that meets the preset probability selection condition is determined among each of the target dependency type probabilities, and the dependency type corresponding to each maximum dependency type probability is used as the dependency type prediction result, wherein the preset probability selection condition includes a one-to-one correspondence between the words to be parsed corresponding to each selected maximum dependency type probability and each word to be parsed in the sentence to be parsed. For example, assuming that the sentence to be parsed is ABC, the preset probability selection condition is that the number of the selected maximum dependency type probabilities is 2, and the words to be parsed corresponding to each maximum dependency type probability can constitute the sentence to be parsed ABC.

[0114] In addition, it should be noted that, in one embodiment, the preset dependency syntax model can be trained based on the following steps:

[0115] Step D10, obtaining training data and a dependency syntactic model to be trained, wherein the training data includes training sentences and preset dependency type labels corresponding to the training sentences;

[0116] In this embodiment, it should be noted that the preset dependency type label is an identifier of the dependency relationship type between words in the pre-labeled training sentence, and the dependency syntactic model to be trained is an untrained dependency syntactic model.

[0117] Acquire training data and a dependency syntactic model to be trained, wherein the training data includes training sentences and preset dependency type labels corresponding to the training sentences. Specifically, acquire a labeled dependency syntactic analysis data set and a dependency syntactic model to be trained, collect the dependency syntactic analysis data set, and manually annotate the dependency syntactic analysis data set to obtain a manually annotated dependency syntactic analysis data set, and then merge the annotated dependency syntactic analysis data set and the manually annotated dependency syntactic analysis data set to obtain a training data set, so as to expand the number of training samples corresponding to the dependency syntactic model to be trained.

[0118] Step D20, inputting the training data into the dependency syntax model to be trained to perform dependency syntax analysis on the training sentence to obtain a type training prediction label;

[0119] In this embodiment, it should be noted that the training data at least includes a training sentence.

[0120] The training data is input into the dependency syntax model to be trained to perform dependency syntax analysis on the training sentences to obtain type training prediction labels. Specifically, based on the vectorization network in the dependency syntax model to be trained, the training sentences are vectorized to obtain vectorized training sentences. Then, based on the preset dependency discrimination model in the dependency syntax model to be trained, dependency discrimination is performed on the vectorized training sentences to obtain training dependency vectors. Then, based on the preset dependency type prediction model in the dependency syntax model to be trained, dependency type prediction is performed on the vectorized training sentences to obtain a training dependency type probability score matrix. Then, the training dependency vector and the training dependency type probability score matrix are combined to determine a type training prediction label, wherein the type training prediction label is an identifier of the dependency type corresponding to the training sentence.

[0121] Step D30, calculating a dependency syntax model error based on the type training prediction label and the preset dependency type label;

[0122] In this embodiment, based on the type training prediction label and the preset dependency type label, the dependency syntax model error is calculated. Specifically, the distance between the type training prediction label and the preset dependency type label is calculated to obtain the dependency syntax model error.

[0123] Step D40: Based on the dependency syntax model error, the dependency syntax model to be trained is updated until the dependency syntax model to be trained meets a preset update end condition, and the dependency syntax model to be trained is used as the preset dependency syntax model.

[0124] In this embodiment, based on the dependency syntax model error, the dependency syntax model to be trained is updated until the dependency syntax model to be trained meets the preset update end condition, and the dependency syntax model to be trained is used as the preset dependency syntax model. Specifically, based on the dependency syntax model error, gradient information is calculated, and the model parameters of the dependency syntax model to be trained are updated according to the gradient information by back propagation to obtain the updated dependency syntax model to be trained, and then it is determined whether the updated dependency syntax model to be trained meets the preset update end condition. If so, the updated dependency syntax model to be trained is used as the preset dependency syntax model. If not, the training sentences are re-acquired to re-train and update the model parameters of the updated dependency syntax model to be trained until the updated dependency syntax model to be trained meets the preset update end condition, wherein the preset update end condition includes reaching the maximum number of iterations and the convergence of the loss function.

[0125] This implementation provides a dependency syntactic analysis method based on machine learning. First, the sentence to be analyzed is vectorized to obtain a vectorized sentence. Then, based on a preset dependency discrimination model, dependency discrimination is performed on the vectorized sentence to obtain a dependency discrimination result, thereby achieving the purpose of determining whether there is a dependency relationship between words in the sentence to be analyzed. Then, based on a preset dependency type prediction model and the dependency discrimination result, dependency type prediction is performed on the vectorized sentence to obtain the dependency type prediction result, thereby achieving the purpose of predicting the dependency type between words in the sentence to be analyzed. Moreover, since the dependency type is predicted based on the predicted relationship discrimination result, the situation where the probability of the existence of a dependency relationship between words is extremely low, but the probability of predicting various types of preset dependency relationships between words is high is avoided. Occurrence improves the accuracy of dependency relationship type prediction, and further improves the accuracy of dependency syntactic analysis, and further based on the dependency syntactic analysis result, the sentence tense of the sentence to be parsed can be identified, and further the purpose of identifying the sentence tense of the sentence to be parsed based on dependency syntactic information can be achieved, wherein the dependency syntactic information includes the word component information of each word in the sentence to be parsed, and further the purpose of identifying the tense of the sentence based on both the word information of the keyword itself and the word component information of the keyword in the sentence can be achieved, so that the basis for judging the tense of the sentence is more sufficient, and lays a foundation for overcoming the technical defect that when judging the tense of a sentence based solely on the word information of the keyword itself in the original sentence in the prior art, due to the single sentence tense basis of this method, the probability of misjudgment is high, and further the accuracy of sentence tense recognition is low.

[0126] Reference Figure 4 , Figure 4 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present application.

[0127] like Figure 4 As shown, the sentence tense recognition device based on dependency syntax may include: a processor 1001, such as a CPU, a memory 1005, and a communication bus 1002. The communication bus 1002 is used to realize the connection and communication between the processor 1001 and the memory 1005. The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may optionally be a storage device independent of the aforementioned processor 1001.

[0128] Optionally, the sentence tense recognition device based on dependency syntax may also include a rectangular user interface, a network interface, a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, etc. The rectangular user interface may include a display screen (Display), an input submodule such as a keyboard (Keyboard), and the optional rectangular user interface may also include a standard wired interface and a wireless interface. The network interface may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).

[0129] Those skilled in the art will understand that Figure 4 The structure of the sentence tense recognition device based on dependency syntax shown in the figure does not constitute a limitation on the sentence tense recognition device based on dependency syntax, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0130] like Figure 4 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, and a sentence tense recognition program based on dependency syntax. The operating system is a program that manages and controls the hardware and software resources of the sentence tense recognition device based on dependency syntax, and supports the operation of the sentence tense recognition program based on dependency syntax and other software and / or programs. The network communication module is used to realize the communication between the components inside the memory 1005, and the communication with other hardware and software in the sentence tense recognition system based on dependency syntax.

[0131] exist Figure 4 In the device for sentence tense recognition based on dependency syntax shown, the processor 1001 is used to execute the sentence tense recognition program based on dependency syntax stored in the memory 1005 to implement the steps of any of the above-mentioned methods for sentence tense recognition based on dependency syntax.

[0132] The specific implementation of the sentence tense recognition device based on dependency syntax in the present application is basically the same as the various embodiments of the sentence tense recognition method based on dependency syntax mentioned above, and will not be repeated here.

[0133] The embodiment of the present application further provides a sentence tense recognition device based on dependency syntax, wherein the sentence tense recognition device based on dependency syntax is applied to a sentence tense recognition device based on dependency syntax, and the sentence tense recognition device based on dependency syntax includes:

[0134] A dependency syntactic analysis module, used to obtain a sentence to be parsed, and perform dependency syntactic analysis on the sentence to be parsed to obtain a dependency syntactic analysis result corresponding to the sentence to be parsed;

[0135] The tense recognition module is used to perform sentence tense recognition on the sentence to be parsed based on the dependency syntactic analysis result to obtain a sentence tense recognition result.

[0136] Optionally, the tense recognition module includes:

[0137] An extraction submodule, used for extracting the target sentence trunk of the sentence to be parsed based on the dependency syntactic analysis result;

[0138] The tense recognition submodule is used to perform sentence tense recognition on the sentence to be parsed based on the target sentence trunk to obtain the sentence tense recognition result.

[0139] Optionally, the tense recognition submodule includes:

[0140] A selection unit, configured to select tense-significant words from the target sentence trunk based on preset keyword component positions;

[0141] The first recognition unit is used to perform sentence tense recognition on the sentence to be parsed based on the tense landmark word and preset tense judgment priority information to obtain the sentence tense recognition result.

[0142] Optionally, the tense recognition submodule further includes:

[0143] A classification unit, configured to input the target sentence trunk into a preset sentence classification model, classify the target sentence trunk, and obtain a sentence classification label corresponding to the target sentence trunk;

[0144] The second recognition unit is used to perform sentence tense recognition on the sentence to be parsed based on the sentence classification label to obtain the sentence tense recognition result.

[0145] Optionally, the extraction submodule includes:

[0146] A first determining unit, configured to determine sentence pattern information corresponding to the sentence to be parsed based on the dependency syntactic type label prediction result;

[0147] An extraction unit is used to extract the target sentence trunk based on the sentence pattern information and the dependency syntactic type label prediction result.

[0148] Optionally, the extraction unit includes:

[0149] A first determination subunit is used to determine the target core word corresponding to the sentence to be parsed based on the sentence pattern information;

[0150] A second determination subunit is used to determine each target sentence stem word corresponding to the target core word based on a preset word component priority and the dependency syntactic type label prediction result;

[0151] A generating subunit is used to generate the target sentence stem based on the sentence pattern information, the target core word and each target sentence stem word.

[0152] Optionally, the dependency syntax analysis module includes:

[0153] A vectorization submodule, used for vectorizing the statement to be parsed to obtain a vectorized statement;

[0154] A dependency determination submodule, used to perform dependency determination on the vectorized sentence based on a preset dependency determination model to obtain a dependency determination result;

[0155] The dependency type prediction submodule is used to perform dependency type prediction on the vectorized statement based on a preset dependency type prediction model and the dependency discrimination result to obtain the dependency type prediction result.

[0156] Optionally, the dependency determination submodule includes:

[0157] A feature extraction unit, configured to perform feature extraction on the vectorized sentence based on the first feature extraction model to obtain a first feature extraction result;

[0158] A fully connected unit, configured to fully connect the first feature extraction result based on the first fully connected network and the second fully connected network, respectively, to obtain a first sentence vector and a second sentence vector;

[0159] A double affine transformation unit, configured to perform a double affine transformation on the first sentence vector and the second sentence vector based on the first double affine transformation network to obtain a dependency score matrix;

[0160] The second determining unit is used to determine the dependency relationship judgment result based on the dependency relationship score matrix.

[0161] Optionally, the dependency type prediction submodule includes:

[0162] A prediction unit, configured to perform dependency type prediction on the vectorized sentence based on the preset dependency type prediction model to obtain a dependency type probability score matrix;

[0163] A fusion unit is used to fuse the dependency type probability score matrix and the dependency vector to obtain the dependency type prediction result.

[0164] The specific implementation of the sentence tense recognition device based on dependency syntax in the present application is basically the same as the various embodiments of the sentence tense recognition method based on dependency syntax mentioned above, and will not be repeated here.

[0165] An embodiment of the present application provides a readable storage medium, and the readable storage medium stores one or more programs, and the one or more programs can also be executed by one or more processors to implement the steps of any of the above-mentioned sentence tense recognition methods based on dependency syntax.

[0166] The specific implementation of the readable storage medium of the present application is basically the same as the various embodiments of the above-mentioned sentence tense recognition method based on dependency syntax, and will not be repeated here.

[0167] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent processing scope of the present application.

Claims

1. A sentence tense recognition method based on dependency syntax, characterized in that: The sentence tense recognition method based on dependency syntax includes: Obtaining a sentence to be parsed, and performing dependency syntactic analysis on the sentence to be parsed, to obtain a dependency syntactic analysis result corresponding to the sentence to be parsed; Based on the dependency syntactic analysis result, performing sentence tense recognition on the sentence to be parsed to obtain a sentence tense recognition result; The step of performing sentence tense recognition on the sentence to be parsed based on the dependency syntactic analysis result to obtain the sentence tense recognition result comprises: Extracting the target sentence trunk of the sentence to be parsed based on the dependency syntactic analysis result; Based on the target sentence trunk, performing sentence tense recognition on the sentence to be parsed to obtain the sentence tense recognition result; The step of performing sentence tense recognition on the sentence to be parsed based on the target sentence trunk to obtain the sentence tense recognition result comprises: Based on the preset keyword component positions, tense marker words are selected in the target sentence trunk; wherein the preset keyword component positions include adverbial component positions, predicate component positions, object component positions, right additional component positions, and complement component positions; Based on the tense-marking words and the preset tense judgment priority information, the sentence to be parsed is subjected to sentence tense recognition to obtain the sentence tense recognition result; wherein the preset tense judgment priority information includes word position priority and word information priority, the word position priority is the order of positions of each word component based on which the sentence tense judgment is performed, and the word information priority is the order of tenses represented by each word information based on which the sentence tense judgment is performed; The step of performing sentence tense recognition on the sentence to be parsed based on the target sentence trunk to obtain the sentence tense recognition result further includes: Inputting the target sentence trunk into a preset sentence classification model, classifying the target sentence trunk, and obtaining a sentence classification label corresponding to the target sentence trunk; Based on the sentence classification label, sentence tense recognition is performed on the sentence to be parsed to obtain the sentence tense recognition result.

2. The sentence tense recognition method based on dependency syntax as claimed in claim 1, characterized in that: The dependency syntax analysis result includes a dependency syntax type label prediction result, The step of extracting the target sentence trunk of the sentence to be parsed based on the dependency syntactic analysis result comprises: Determining sentence pattern information corresponding to the sentence to be parsed based on the dependency syntactic type label prediction result; Based on the sentence pattern information and the dependency syntactic type label prediction result, the target sentence trunk is extracted.

3. The sentence tense recognition method based on dependency syntax as claimed in claim 2, characterized in that: The step of extracting the target sentence trunk based on the sentence pattern information and the dependency syntactic type label prediction result comprises: Based on the sentence pattern information, determining the target core word corresponding to the sentence to be parsed; Determine the target sentence stem words corresponding to the target core words based on the preset word component priority and the dependency syntactic type label prediction result; The target sentence stem is generated based on the sentence pattern information, the target core word and each of the target sentence stem words.

4. The sentence tense recognition method based on dependency syntax as claimed in claim 1, characterized in that: The dependency syntactic analysis result includes a dependency relationship type prediction result, The step of performing dependency syntactic analysis on the sentence to be parsed to obtain a dependency syntactic analysis result corresponding to the sentence to be parsed comprises: Vectorizing the statement to be parsed to obtain a vectorized statement; Based on a preset dependency determination model, performing dependency determination on the vectorized sentence to obtain a dependency determination result; Based on a preset dependency type prediction model and the dependency discrimination result, the dependency type prediction is performed on the vectorized statement to obtain the dependency type prediction result.

5. The sentence tense recognition method based on dependency syntax as claimed in claim 4, characterized in that: The preset dependency relationship discrimination model includes a first feature extraction model, a first fully connected network, a second fully connected network and a first dual affine transformation network. The step of performing dependency determination on the vectorized sentence based on a preset dependency determination model to obtain a dependency determination result includes: Based on the first feature extraction model, perform feature extraction on the vectorized sentence to obtain a first feature extraction result; Based on the first fully connected network and the second fully connected network, fully connect the first feature extraction result respectively to obtain a first sentence vector and a second sentence vector; Based on the first double affine transformation network, performing double affine transformation on the first sentence vector and the second sentence vector to obtain a dependency score matrix; Based on the dependency score matrix, the dependency determination result is determined.

6. The sentence tense recognition method based on dependency syntax as claimed in claim 4, characterized in that: The step of performing dependency type prediction on the vectorized statement based on the preset dependency type prediction model and the dependency discrimination result to obtain the dependency type prediction result comprises: Based on the preset dependency type prediction model, predict the dependency type of the vectorized sentence to obtain a dependency type probability score matrix; The dependency type probability score matrix and the dependency vector are fused to obtain the dependency type prediction result.

7. A sentence tense recognition device based on dependency syntax, characterized in that: The sentence tense recognition device based on dependency syntax includes: a memory, a processor, and a program stored in the memory for implementing the sentence tense recognition method based on dependency syntax. The memory is used to store a program for implementing a sentence tense recognition method based on dependency syntax; The processor is used to execute a program for implementing the method for identifying sentence tense based on dependency syntax, so as to implement the steps of the method for identifying sentence tense based on dependency syntax as claimed in any one of claims 1 to 6.

8. A readable storage medium, characterized in that: The readable storage medium stores a program for implementing a method for identifying sentence tense based on dependency syntax, and the program for implementing a method for identifying sentence tense based on dependency syntax is executed by a processor to implement the steps of the method for identifying sentence tense based on dependency syntax as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method and device for Chinese-English translation based on TParse

    CN109271647A

  • Sentence-level entity and relationship joint extraction method

    CN110377903A