CN112069800A - Sentence tense recognition method and device based on dependency syntax and readable storage medium - Google Patents

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

Info

Publication number
CN112069800A
CN112069800A CN202010964030.XA CN202010964030A CN112069800A CN 112069800 A CN112069800 A CN 112069800A CN 202010964030 A CN202010964030 A CN 202010964030A CN 112069800 A CN112069800 A CN 112069800A
Authority
CN
China
Prior art keywords
sentence
dependency
word
analyzed
temporal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010964030.XA
Other languages
Chinese (zh)
Inventor
汤耀华
周楠楠
杨海军
徐倩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
WeBank Co Ltd
Original Assignee
WeBank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN202010964030.XA priority Critical patent/CN112069800A/en
Publication of CN112069800A publication Critical patent/CN112069800A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/211Syntactic parsing, e.g. based on context-free grammar [CFG] or unification grammars
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/253Grammatical analysis; Style critique
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Machine Translation (AREA)

Abstract

The application discloses a sentence temporal recognition method, equipment and a readable storage medium based on dependency syntax, wherein the sentence temporal recognition method based on dependency syntax comprises the following steps: obtaining a sentence to be analyzed, performing dependency syntax analysis on the sentence to be analyzed to obtain a dependency syntax analysis result corresponding to the sentence to be analyzed, and further performing sentence tense recognition on the sentence to be analyzed based on the dependency syntax analysis result to obtain a sentence tense recognition result. The sentence tense recognition method and the sentence tense recognition system solve the technical problem of low sentence tense recognition accuracy.

Description

Sentence tense recognition method and device based on dependency syntax and readable storage medium
Technical Field
The present application relates to the field of artificial intelligence of financial technology (Fintech), and in particular, to a sentence temporal recognition method, device and readable storage medium based on dependency syntax.
Background
With the continuous development of financial technologies, especially internet technology and finance, more and more technologies (such as distributed, Blockchain, artificial intelligence and the like) are applied to the financial field, but the financial industry also puts higher requirements on the technologies, such as higher requirements on the distribution of backlog of the financial industry.
With the continuous development of computer software and artificial intelligence, the application field of artificial intelligence is more and more extensive, in a dialog system based on artificial intelligence, in order to more accurately identify the semantics of a sentence, before the sentence is classified as intended, the tense of the sentence needs to be identified, at present, the tense of the sentence is usually judged based on the word information of the keyword itself in the original sentence, for example, "already" represents a past expression, "will" represents a future time, and the like.
Disclosure of Invention
The application mainly aims to provide a sentence temporal recognition method, a sentence temporal recognition device and a readable storage medium based on dependency syntax, and aims to solve the technical problem that the sentence temporal recognition accuracy rate is low in the prior art.
To achieve the above object, the present application provides a dependency syntax based sentence temporal recognition method applied to a dependency syntax based sentence temporal recognition apparatus, the dependency syntax based sentence temporal recognition method including:
obtaining a statement to be analyzed, and performing dependency syntax analysis on the statement to be analyzed to obtain a dependency syntax analysis result corresponding to the statement to be analyzed;
and carrying out sentence tense recognition on the sentence to be analyzed based on the dependency syntax analysis result to obtain a sentence tense recognition result.
The present application also provides a dependency syntax-based sentence temporal recognition apparatus, which is a virtual apparatus and is applied to a dependency syntax-based sentence temporal recognition device, the dependency syntax-based sentence temporal recognition apparatus including:
the dependency syntax analysis module is used for acquiring the statement to be analyzed and performing dependency syntax analysis on the statement to be analyzed to acquire a dependency syntax analysis result corresponding to the statement to be analyzed;
and the temporal recognition module is used for carrying out sentence temporal recognition on the sentence to be analyzed based on the dependency syntactic analysis result to obtain a sentence temporal recognition result.
The present application also provides a sentence tense recognition device based on dependency syntax, the sentence tense recognition device based on dependency syntax being an entity device, the sentence tense recognition device based on dependency syntax including: a memory, a processor, and a program of the dependency syntax based sentence temporal recognition method stored on the memory and executable on the processor, the program of the dependency syntax based sentence temporal recognition method being executable by the processor to implement the steps of the dependency syntax based sentence temporal recognition method as described above.
The present application also provides a readable storage medium having stored thereon a program for implementing a dependency syntax based sentence temporal recognition method, the program implementing the steps of the dependency syntax based sentence temporal recognition method as described above when executed by a processor.
Compared with the technical means of judging the tense of a sentence based on the word information of a keyword in an original sentence independently adopted in the prior art, the sentence temporal identification method based on the dependency syntax, the sentence temporal identification device and the readable storage medium have the advantages that after a sentence to be analyzed is obtained, the sentence to be analyzed is subjected to dependency syntax analysis to obtain a dependency syntax analysis result corresponding to the sentence to be analyzed, the sentence temporal identification method based on the dependency syntax analysis is further realized, the dependency syntax information of the sentence to be analyzed is obtained, the sentence temporal identification of the sentence to be analyzed is further performed on the sentence based on the dependency syntax analysis result, and the sentence temporal identification of the sentence to be analyzed based on the dependency syntax information is further realized, wherein the dependency syntax information comprises the word component information of each word in the sentence to be analyzed, and further, the purpose of identifying the tense of the sentence based on the word information of the keyword and the word component information of the keyword in the sentence can be realized, so that the judgment basis of the tense of the sentence is more sufficient, the technical defect that the judgment has higher probability of erroneous judgment and further the accuracy of sentence tense identification is lower due to the fact that the sentence tense basis is single when the tense of the sentence is judged based on the word information of the keyword in the original sentence in the prior art is overcome, and the accuracy of sentence tense identification is improved.
Drawings
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 application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art to obtain other drawings without inventive exercise.
FIG. 1 is a flowchart illustrating a first embodiment of a sentence temporal identification method based on dependency syntax according to the present application;
FIG. 2 is a schematic diagram of a dependency relationship tree corresponding to a sentence to be parsed in the sentence temporal identification method based on dependency syntax according to the present application;
FIG. 3 is a flowchart illustrating a second embodiment of a sentence temporal identification method based on dependency syntax according to the present application;
fig. 4 is a schematic device structure diagram of a hardware operating environment according to an embodiment of the present application.
The objectives, features, and advantages of the present application will be further described with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
In a first embodiment of the dependency-syntax-based sentence temporal recognition method according to the present application, referring to fig. 1, the dependency-syntax-based sentence temporal recognition method includes:
step S10, obtaining a statement to be analyzed, and performing dependency syntax analysis on the statement to be analyzed to obtain a dependency syntax analysis result corresponding to the statement to be analyzed;
in this embodiment, it should be noted that the sentence temporal recognition method based on dependency syntax is applied to a human-computer conversation system, the sentence to be parsed is a sentence collected and preprocessed during human-computer conversation, the sentence temporal recognition device based on dependency syntax includes a preset dependency syntax model, where preprocessing is performed to remove meaningless words from the collected sentence, the preset dependency syntax model is a pre-trained machine learning model used for performing dependency syntax analysis on the sentence, where the process of dependency syntax analysis is a process of parsing syntax information of the sentence, where the syntax information includes sentence formula information and word component information, for example, assuming that the sentence is "who is", after the dependency syntax analysis, the sentence formula information indicates that the sentence is a subject predicate, and the word component information indicates that "i" is a subject, "yes" is the predicate and "who" is the object.
Obtaining a sentence to be analyzed, performing dependency syntax analysis on the sentence to be analyzed to obtain a dependency syntax analysis result corresponding to the sentence to be analyzed, specifically, obtaining the sentence to be analyzed, inputting the sentence to be analyzed into the preset dependency syntax model, and performing dependency relationship judgment and dependency relationship type prediction on the sentence to be analyzed respectively to perform dependency syntax analysis on the sentence to be analyzed, wherein it should be noted that the dependency relationship judgment is performed for judging the dependency relationship between words, and the dependency relationship type prediction is performed for predicting the type of the dependency relationship, for example, assuming that the sentence to be analyzed is a sentence "ABC", wherein A, B and C are both words in the sentence to be analyzed, after the dependency relationship judgment, it can be determined that B depends on a, C depends on B, and after the dependency relationship type prediction is performed, determining that the dependency relationship between a and B is a predicate relationship, and the dependency relationship between B and C is a verb relationship, and further obtaining the dependency parsing result, wherein in an implementable manner, the step of performing dependency relationship determination and dependency relationship type prediction on the to-be-parsed sentence respectively to perform dependency parsing on the to-be-parsed sentence, and obtaining the dependency parsing result includes:
performing dependency relationship judgment on the sentence to be analyzed to obtain a dependency relationship judgment result corresponding to the sentence to be analyzed, performing dependency relationship type prediction on the sentence to be analyzed to obtain a dependency relationship type prediction result corresponding to the sentence to be analyzed, further fusing the dependency relationship judgment result and the dependency relationship type prediction result to obtain a dependency relationship type label between words in the sentence to be analyzed, wherein the dependency relationship type label is an identifier of a dependency relationship type, and further based on the dependency relationship type label, sentence formula information and word component information of the sentence to be analyzed can be determined to obtain the dependency analysis result, wherein the syntax relationship judgment result can be represented by a vector, and the dependency relationship judgment result in the form of a vector is a dependency relationship judgment vector, the dependency type prediction result may be represented by a matrix, where a matrix form corresponding to the dependency type prediction result is a dependency type prediction probability matrix, where a value on each bit in the dependency type prediction probability matrix is a dependency type label probability prediction vector between one word and another word in the to-be-parsed sentence, where a value on each bit in the dependency type prediction vector is a probability value that a dependency of one word and another word in the to-be-parsed sentence belongs to a preset dependency corresponding to the bit, where the preset dependency includes a predicate relationship, a power-guest relationship, and the like, for example, if the dependency type label probability prediction vector between a word a and B word is (0.1, 0.9), 0.1 indicates that a probability of a predicate between a word a and B word is 10%, 0.9 represents a 90% probability of a move-guest relationship between word a and word B.
In an implementable scheme, the step of fusing the dependency relationship vector and the dependency relationship type prediction probability matrix to obtain the dependency relationship type tag between words in the to-be-analyzed statement includes:
and aggregating the dependency relationship vector and each dependency relationship type label probability prediction vector in the dependency relationship type prediction probability matrix to obtain an aggregated vector corresponding to each dependency relationship type label probability prediction vector, wherein the aggregation comprises weighted summation, splicing, summation and the like, then selecting a maximum bit value from bit values in the aggregated vector for each aggregated vector, and using a preset dependency relationship label corresponding to a bit corresponding to the maximum bit value as a dependency relationship type label corresponding to the dependency relationship type label probability prediction vector.
Wherein, the step of obtaining the statement to be analyzed comprises:
step S11, acquiring a statement to be processed, and identifying a background component in the statement to be processed;
in this embodiment, a to-be-processed sentence is obtained, a background component in the to-be-processed sentence is identified, specifically, the to-be-processed sentence is obtained, and a word position of each to-be-processed word in the to-be-processed sentence is determined, where the word position includes a prefix position, a position in the sentence, and a suffix position, a corresponding preset position background word set is matched for each to-be-analyzed word based on the word position of each to-be-processed word, each background word is determined in each to-be-analyzed word based on the preset position background word set corresponding to each to-be-analyzed word, and each background word is used as the background component, where the preset position background word set includes a prefix position background word set, a position background word set in the sentence, and a suffix position background word set, where the prefix position background word set includes "also means", and, Also, prefix location context words such as "put to say", "i want to know", "i do not know", "i want to know a moment", "i want to solve", "i want to ask", "i ask" and the like, location context words such as "general", "put to the moment", "that", "troublesome", and the like, and suffix location context words such as "what", "you know", "is this meaning", "is", and "is not".
Additionally, it should be noted that, in an implementable manner, the step of determining each background word in each to-be-analyzed word based on the preset position background word set corresponding to each to-be-analyzed word includes: executing the following steps for each word to be analyzed:
and comparing the word to be analyzed with each preset background word in a preset position background word set corresponding to the word to be analyzed to judge whether a preset background word consistent with the word to be analyzed exists in the preset position background word set corresponding to the word to be analyzed, if so, taking the word to be analyzed as a background word, and if not, taking the word to be analyzed as a background word.
Step S12, removing the background component from the to-be-processed sentence, and obtaining the to-be-analyzed sentence.
In this embodiment, the background component is removed from the to-be-processed sentence to obtain the to-be-analyzed sentence, and specifically, the background component in the to-be-processed sentence is removed to remove the background component interfering with the sentence backbone extraction process in the to-be-processed sentence, so that the part of the to-be-processed sentence except the background component is used as the to-be-analyzed sentence to improve the accuracy of sentence backbone extraction.
Step S20, based on the dependency parsing result, performing sentence temporal recognition on the sentence to be parsed to obtain a sentence temporal recognition result.
In this embodiment, it should be noted that the dependency parsing result includes word component information of the to-be-parsed sentence, where the word component information is a word component of each to-be-parsed word in the to-be-parsed sentence, and the word component includes a predicate, a subject, and a state.
Performing sentence temporal recognition on the sentence to be parsed based on the dependency syntactic analysis result to obtain a sentence temporal recognition result, specifically, determining word component positions of the words to be parsed in the sentence to be parsed based on the word component information, wherein the word component positions include a predicate component position, an object component position, a state component position, and the like, further determining a target word component position in each word component position, selecting a temporal landmark word at the target word component position, further determining whether the temporal landmark word and the target word component position simultaneously satisfy a preset temporal condition to perform sentence temporal recognition on the sentence to be parsed to obtain a sentence temporal recognition result, wherein the preset temporal condition includes a past temporal condition, a present temporal condition, and a future temporal condition, the past tense condition is used for judging whether the tense of the sentence is past, the present tense condition is used for judging whether the tense of the sentence is present, the future tense condition is used for judging whether the tense of the sentence is future, the tense-signable words are words representing tenses of the sentence and used for identifying the tense of the sentence, the tense-signable words comprise previous, future and intermediate, the sentence tense identification result is a sentence tense label identified based on the dependency syntax and used for identifying the tense of the sentence, and the sentence tense identification result comprises a past tense label, a present tense label and a future tense label.
The sentence tense recognition is carried out on the sentence to be analyzed based on the dependency syntax analysis result, and the step of obtaining the sentence tense recognition result comprises the following steps:
step S21, extracting the target sentence backbone of the sentence to be analyzed based on the dependency syntax analysis result;
in this embodiment, it should be noted that, in this embodiment, the dependency syntax analysis result includes a prediction result according to a relationship tag, where the dependency tag prediction result is an identifier of a dependency relationship type between words in the to-be-parsed statement, and the dependency relationship type includes a predicate relationship type, a move-guest relationship type, a move-complement structure type, and the like.
Extracting a target sentence backbone corresponding to the to-be-analyzed sentence based on the dependency syntactic analysis result, specifically, determining word components of each to-be-analyzed word in the to-be-analyzed sentence based on the dependency relationship label prediction result, and further determining sentence pattern information of the to-be-analyzed sentence based on the part-of-speech of each to-be-analyzed word in the to-be-analyzed sentence and the word components of each to-be-analyzed word, wherein the part-of-speech is the property of the to-be-analyzed word, for example, the part-of-speech includes verbs, names, quantifiers, and the like, the word components are the property of the to-be-analyzed word expressed in the to-be-analyzed sentence, for example, the word components include subjects, predicates, objects, and the like, further based on the sentence pattern information, selecting a target core word in the to-be-analyzed sentence, further based on the dependency relationship type prediction result, selecting each target sentence backbone associated with the target core word in the to-be-, and then the target core words and the target sentence stem words are combined into the target sentence stem.
Wherein the dependent syntax analysis result includes a dependent syntax type tag prediction result,
the step of extracting the target sentence backbone of the sentence to be parsed based on the dependency parsing result includes:
step S211, determining sentence pattern information corresponding to the sentence to be analyzed based on the dependency syntax type label prediction result;
in this embodiment, sentence pattern information corresponding to the to-be-parsed sentence is determined based on the dependency syntax type tag prediction result, specifically, based on the dependency relationship type between the to-be-parsed words in the to-be-parsed sentence, word components of the to-be-parsed words are determined, and then the part of speech of the to-be-parsed words is obtained, and then, based on the part of speech and the word components of the to-be-parsed words, sentence pattern information of the to-be-parsed sentence is determined, where the sentence pattern information is the identification information of the sentence pattern of the to-be-parsed words, and the sentence pattern of the to-be-parsed words includes a declarative sentence, a nominal predicate sentence, an adjective predicate sentence, a prepositional predicate sentence, a linkage predicate sentence, a biobject sentence, a verb sentence, a verb predicate sentence, and a sentence, and the like, where the verb predicate sentence is a sentence with a verb as a predicate, the synonym predicate is a statement with a noun as a predicate, the adjective predicate is an adjective predicate, the prepositive predicate is a preposition predicate, the linkage statement is a statement with two consecutive unopposed verbs as predicates, the dual-object statement is a statement with a dependency type corresponding to a predicate and including both a time-object type and a verb-object type, the comparison statement is a statement with a state beginning with a "ratio" in the states of the predicate, the state beginning with a "called" is included in the states of the predicates, the state beginning with a "handle" in the states with the words as predicates, and the inclusive statement is a statement with a dependency type corresponding to the object as a inclusive type.
Step S212, extracting the target sentence backbone based on the sentence pattern information and the dependency syntax type label prediction result.
In this embodiment, the target sentence backbone is extracted based on the sentence pattern information and the dependency syntax type tag prediction result, specifically, a target core word is selected from the words to be parsed of the sentence to be parsed based on the sentence pattern information, where the target core word is a word to be parsed serving as a core predicate, for example, assuming that the sentence pattern information indicates that the sentence to be parsed is a verb predicate, a verb on a predicate of the sentence to be parsed is the target core word, and each target sentence backbone word corresponding to the target core word is selected based on a preset word component priority and a dependency relationship type between words in the sentence to be parsed, and then a dependency syntax vector corresponding to the target core word and each target sentence backbone word is used as the target sentence backbone, where the preset word component priority sentence is a word component preferentially extracted when the sentence backbone is extracted, it should be noted that, in order to ensure that the semantics of the target sentence backbone are clear and the degree of simplification is high, the number of the extracted word components needs to be preset, for example, assuming that the preset extracted word components include a subject, a predicate and an object and that the predicate is a verb, based on the type of the subject-predicate relationship in the dependency relationship type, the subject corresponding to the target core word is determined as the target sentence backbone, and based on the type of the verb-predicate relationship in the dependency relationship type, the subject corresponding to the target core word is determined as the target sentence backbone, and further the target sentence backbone is composed of the subject, the predicate and the object.
In another embodiment, the step of extracting the target sentence owner based on the sentence pattern information and the dependency syntax type tag prediction result includes:
generating a dependency relationship tree corresponding to the sentence to be analyzed based on the sentence pattern information, the dependency relationship type between the words in the sentence to be analyzed and the part of speech of each word to be analyzed in the sentence to be analyzed, further extracting the target sentence backbone based on the preset word component priority and the dependency relationship tree, wherein the preset word component priority is the priority of extracting word components in the sentence trunk extraction process, in a practical way, the sentence to be analyzed is "disappointed person who later considers the officer of the financial hall several times", and then the dependency tree corresponding to the sentence to be analyzed is shown in FIG. 2, the ROOT represents the statement to be analyzed, m, a, u, r, nt, d, v, q and n are labels of parts of speech, and the ADV, RAD, ATT, HED, SBV, CMP and VOB are labels of dependency relationship types.
Wherein the step of extracting the target sentence backbone based on the sentence pattern information and the dependency syntax type tag prediction result comprises:
step A10, determining a target core word corresponding to the sentence to be analyzed based on the sentence pattern information;
in this embodiment, a target core word corresponding to the to-be-analyzed sentence is determined based on the sentence pattern information, specifically, a core predicate corresponding to the to-be-analyzed sentence is determined based on the sentence pattern information, where the core predicate is a predicate that determines the sentence pattern information of the to-be-analyzed sentence, and the to-be-analyzed word corresponding to the core predicate is taken as the target core word.
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;
in this embodiment, it should be noted that the preset word component priority is a priority for extracting a word component in a sentence trunk extraction process, and the preset word component priority includes a preset first priority, a preset second priority and a preset third priority, where in an implementable manner, the word component corresponding to the preset first priority includes a subject, a predicate, an object, a shape and a complement, the word component corresponding to the preset second priority includes a predicate, and the word component corresponding to the preset third priority includes other word components except for the word component corresponding to the preset first priority and the preset second priority.
Determining each target sentence main word corresponding to the target core word based on a preset word component priority and the dependency syntax type label prediction result, specifically, determining a word component of each word to be selected corresponding to the target core word based on a dependency relationship type between words in the sentence to be analyzed, further selecting a priority word component from the word components of each word to be selected based on the number of layers of the preset word component priority, and further using the word to be analyzed corresponding to each priority word component as the target sentence main word, wherein it is required to be stated that a first layer of the preset word component priority is a preset first priority, a second layer of the preset component priority is a preset second priority, and a third layer of the preset word component is a preset third priority.
Step a30, generating the target sentence skeleton based on the sentence pattern information, the target core words and each target sentence skeleton word.
In this embodiment, the target sentence skeleton is generated based on the sentence pattern information, the target core word and each target sentence stem word, specifically, word components and parts of speech of the target core word and word components and parts of speech of each target sentence stem word are obtained, and then the target sentence skeleton is generated based on the sentence pattern information, the target core word, the parts of speech and word components of the target core word, the parts of speech and word components corresponding to each target sentence stem word and corresponding word components, where in an implementable manner, if the sentence to be analyzed is "very disappointed officer who later considers the financial hall several times", the target sentence skeleton is { sentence pattern: main and subordinate guest sentences, subject: [ He, ATT: [ quite disappointing ] ], predicate: [ test, RAD: [ to ] ], prepositive object [ ], object: [ officer, ATT: of the finance hall ]: COO: [] And (3) CMP: [ several times ], ADV: [ afterwards ] }, where ATT is a tag of a medium relationship type, RAD is a tag of a right additional relationship type, COO is a tag of a side-by-side relationship type, CMP is a tag of a complementary structure type, and ADV is a tag of a medium structure type.
Additionally, it should be noted that, since the sentence skeleton extraction is performed based on the sentence pattern information corresponding to the to-be-analyzed sentence obtained by the dependency syntax analysis, the corresponding word component, and the dependency relationship type between the corresponding words, the embodiment can explain the reason of the sentence skeleton extraction result, the interpretability of the sentence skeleton extraction result is strong, and the confidence of the sentence skeleton extraction result is very high.
Step S22, based on the target sentence skeleton, performing sentence temporal recognition on the sentence to be analyzed to obtain the sentence temporal recognition result.
In this embodiment, based on the target sentence stem, performing sentence temporal recognition on the to-be-parsed sentence to obtain the sentence temporal recognition result, and specifically, based on the word component information, determining a stem word component position corresponding to each sentence stem word in the target sentence stem, where the stem word component position is a position of a word component corresponding to the sentence stem word, for example, assuming that the sentence stem word is a subject, the stem word component position is a subject position, determining a target stem word component position in each stem word component position, selecting a sentence stem temporal landmark word in the target stem word component position, and further determining whether the sentence stem temporal landmark word and the target stem word component position satisfy a preset temporal condition at the same time to perform sentence temporal recognition on the to-be-parsed sentence, obtaining a sentence temporal recognition result, wherein, it is to be noted that the target sentence stem excludes a to-be-analyzed word with a small contribution degree to the sentence temporal recognition compared to the to-be-analyzed sentence, so as to reduce the interference of the to-be-analyzed word with a small contribution degree to the sentence temporal recognition, and improve the accuracy of the sentence temporal recognition, for example, if the to-be-analyzed sentence includes a state a and a state B, and when the sentence temporal recognition is performed, the temporal of the sentence is determined based on the to-be-analyzed word at the state position, but since only the state a is related to the core predicate of the sentence, the contribution degree of the state a to the temporal determination of the whole sentence is large, and the contribution degree of the state B to the temporal determination of the whole sentence is small, further, the state B needs to be removed by extracting the sentence stem, and further the sentence temporal determination of the sentence is performed based on only the state a in the target sentence stem, the interference to sentence temporal recognition can be reduced, and the accuracy of sentence temporal recognition is improved.
The sentence tense recognition is carried out on the sentence to be analyzed based on the target sentence backbone, and the step of obtaining the sentence tense recognition result comprises the following steps:
step B10, selecting a temporal landmark word from the target sentence backbone based on the preset keyword component position;
in this embodiment, the preset keyword component positions include a state component position, a predicate component position, an object component position, a right additional component position, a complement component position, and the like.
Selecting a temporal landmark word from the target sentence stem based on a preset keyword component position, specifically, extracting a sentence stem word at the preset keyword component position in the target sentence stem as a word to be recognized, and judging whether the word to be recognized belongs to a preset tagging word set, if so, taking the word to be recognized as the temporal landmark word, wherein in an implementable scheme, the preset tagging word set in a table form is as follows:
Figure BDA0002681069200000111
Figure BDA0002681069200000121
wherein, the word position is the preset keyword component position.
And step B20, carrying out sentence temporal recognition on the sentence to be analyzed based on the temporal landmark words and preset temporal judgment priority information, and obtaining the sentence temporal recognition result.
In this embodiment, it should be noted that the preset temporal judgment priority information includes a word position priority and a word information priority, where the word position priority is a sequence of positions of each word component according to which a sentence temporal judgment is performed, the word information priority is a sequence of temporal states represented by each word information according to which a sentence temporal judgment is performed, and the temporal landmark word at least includes a word to be analyzed.
Performing sentence temporal identification on the sentence to be analyzed based on the temporal landmark words and preset temporal judgment priority information to obtain a sentence temporal identification result, specifically, obtaining landmark word information of the temporal landmark words and landmark word component positions corresponding to the temporal landmark words, and further sequentially performing temporal judgment based on word information priority on the landmark word information of the word to be analyzed at the landmark word component positions based on the word position priority to obtain the sentence temporal identification result, for example, assuming that the word position priority is to judge a state component position first and then judge a predicate component position, and the word information priority is to judge a past time first and then judge a future time, and finally judge a present time, the sentence temporal identification process is to judge whether the landmark word information at the state component position represents the past time, a predicate component position first and then judge a predicate component position second in sequence, At the future time and the present time, it is further determined whether or not the landmark information at the predicate element position indicates the past time, the future time, and the present time in order.
In one possible implementation, for the same token component location, it is generally determined first whether the token information indicates the past, and if so, if not, judging whether the symbolic word information represents the future, if so, then the time state of the sentence to be analyzed is in the future, if not, whether the symbolic word information represents the present time is judged, if yes, then the tense of the sentence to be analyzed is present, if not, the tense of the sentence to be analyzed is judged based on the positions of other symbolic word components, and for different landmark word component positions, the first priority in sentence time-state judgment is the state component position, the second priority in sentence time-state judgment is the predicate component position, and the third priority in sentence time-state judgment is the right additional component position, the complement component position, the end word position and the like of the predicate.
Wherein, the step of performing sentence temporal recognition on the sentence to be analyzed based on the target sentence backbone to obtain the sentence temporal recognition result further comprises:
step C10, inputting the target sentence backbone into a preset sentence classification model, classifying the target sentence backbone, and obtaining a sentence classification label corresponding to the target sentence backbone;
in this embodiment, the target sentence backbone is input into a preset sentence classification model, the target sentence backbone is classified, sentence classification tags corresponding to the target sentence backbone are obtained, specifically, the target sentence backbone is vectorized, a vectorized sentence backbone corresponding to the target sentence backbone is obtained, the vectorized sentence backbone is input into the preset sentence classification model, the vectorized sentence backbone is temporally classified, and the sentence classification tags are obtained, wherein the sentence classification tags are temporal tags that identify tenses of sentences, and the sentence classification tags include current-time type tags, past-time tags, and future-time tags.
And step C20, carrying out sentence temporal recognition on the sentence to be analyzed based on the sentence classification label to obtain the sentence temporal recognition result.
In this embodiment, based on the sentence classification tag, sentence temporal recognition is performed on the sentence to be parsed, and the sentence temporal recognition result is obtained, specifically, if the sentence classification tag is a current temporal type tag, the sentence temporal recognition result is that the sentence temporal of the sentence to be parsed is current, if the sentence classification tag is a past temporal type tag, the sentence temporal recognition result is that the sentence temporal of the sentence to be parsed is past, and if the sentence classification tag is a future temporal type tag, the sentence temporal recognition result is that the sentence temporal of the sentence to be parsed is future.
Compared with the prior art which adopts a technical means of judging the tense of a sentence based on the word information of the keyword in the original sentence, the sentence temporal identification method based on the dependency syntax provided by the embodiment obtains the sentence to be analyzed, performs the dependency syntax analysis on the sentence to be analyzed to obtain the dependency syntax analysis result corresponding to the sentence to be analyzed, and further realizes the purpose of obtaining the dependency syntax information of the sentence to be analyzed based on the dependency syntax analysis method, and further performs the sentence temporal identification on the sentence to be analyzed based on the dependency syntax analysis result, so that the sentence temporal identification on the sentence to be analyzed based on the dependency syntax information can be realized, wherein the dependency syntax information comprises the word component information of each word in the sentence to be analyzed, and further the word information based on the keyword and the word component information of the keyword in the sentence can be realized simultaneously, the sentence temporal recognition is carried out, so that the judgment basis of the sentence temporal is more sufficient, the technical defect that the sentence temporal recognition accuracy is lower due to the fact that the probability of judging the sentence with misjudgment is higher and the sentence temporal recognition accuracy is lower because the sentence temporal basis is single when the temporal of the sentence is judged based on the word information of the keyword in the original sentence in the prior art is overcome, and the sentence temporal recognition accuracy is improved.
Further, referring to fig. 3, in another embodiment of the present application, based on the first embodiment of the present application, the dependency syntax analysis result includes a dependency type prediction result,
the step of performing dependency syntax analysis on the statement to be analyzed to obtain a dependency syntax analysis result corresponding to the statement to be analyzed includes:
step S11, vectorizing the statement to be analyzed to obtain a vectorized statement;
in this embodiment, the to-be-parsed sentence is vectorized to obtain a vectorized sentence, and specifically, a to-be-parsed word vector, a to-be-parsed part-of-speech vector, and a to-be-parsed word position vector corresponding to each to-be-parsed word in the to-be-parsed sentence are generated, wherein, the word vector to be analyzed is a coding vector representing the word to be analyzed and is used for uniquely representing the word to be analyzed, the part-of-speech vector to be analyzed is a coding vector representing the part of speech of the word to be analyzed, the position vector of the word to be analyzed is a coding vector representing the position of the word to be analyzed in the sentence to be analyzed, and generating a vectorization word corresponding to each word to be analyzed based on the word vector to be analyzed corresponding to each word to be analyzed, the corresponding part-of-speech vector to be analyzed and the corresponding position vector of the word to be analyzed, and taking a matrix formed by each vectorization word as the vectorization statement.
Wherein the to-be-analyzed sentence at least comprises a to-be-analyzed word, the vectorized sentence at least comprises a vectorized word,
the step of vectorizing the statement to be analyzed to obtain a vectorized statement comprises:
step S111, obtaining a word vector to be analyzed corresponding to the word to be analyzed, a corresponding part-of-speech vector to be analyzed and a corresponding word position vector to be analyzed;
in this embodiment, a to-be-analyzed word vector corresponding to the to-be-analyzed word, a corresponding to-be-analyzed part-of-speech vector, and a corresponding to-be-analyzed word position vector are obtained, specifically, a model is generated based on a preset word vector, the to-be-analyzed word is mapped to a preset vector space, the to-be-analyzed word vector corresponding to the to-be-analyzed word is obtained, the corresponding to-be-analyzed part-of-speech vector is matched for the to-be-analyzed word, and further, the to-be-analyzed word position vector corresponding to the to-be-analyzed word is generated based on the position of the to-be-analyzed word in the to-be-analyzed sentence.
Step S112, generating the vectorized word based on the word vector to be analyzed, the part-of-speech vector to be analyzed, and the word position vector to be analyzed.
In this embodiment, the vectorized word is generated based on the word vector to be analyzed, the part-of-speech vector to be analyzed, and the word position vector to be analyzed, and specifically, the word to be analyzed, the part-of-speech vector to be analyzed, and the word position vector to be analyzed are input into a preset vectorized word calculation formula, so as to obtain the vectorized word, where the preset vectorized word calculation formula is as follows:
Figure BDA0002681069200000151
wherein, XiFor the vectorized word, EwFor the word vector to be parsed, EtFor the part of speech vector to be resolved, EpFor the position vector of the word to be analyzed,
Figure BDA0002681069200000152
is a concatee operation between vectors.
Step S12, based on a preset dependency relationship discrimination model, performing dependency relationship discrimination on the vectorized statement to obtain a dependency relationship discrimination result;
in this embodiment, it should be noted that the preset dependency syntax model includes a preset dependency relationship determination model, where the preset dependency relationship determination model is a machine learning model for determining whether there is a dependency relationship between words in the to-be-parsed sentence.
And judging the dependence relationship of the vectorized statement based on a preset dependence relationship judgment model to obtain a dependence relationship judgment result, specifically, inputting the vectorized statement into the preset dependence relationship judgment model, and judging the dependence relationship of the vectorized statement to judge whether the dependence relationship exists between words in the statement to be analyzed to obtain the dependence relationship judgment result.
Wherein the preset dependency relationship distinguishing model comprises a first feature extraction model, a first fully connected network, a second fully connected network and a first affine-doubly transformed network,
the step of judging the dependence relationship of the vectorized statement based on the preset dependence relationship judging model to obtain the dependence relationship judging result comprises the following steps:
step S121, performing feature extraction on the vectorized statement based on the first feature extraction model to obtain a first feature extraction result;
in this embodiment, it should be noted that the first feature extraction model is a neural network that performs feature extraction on the vectorized statement, and the first feature extraction model includes a Transformer model, an RNN network, a CNN network, and the like.
And performing feature extraction on the vectorized statement based on the first feature extraction model to obtain a first feature extraction result, specifically, inputting the vectorized statement into the first feature extraction model, performing feature extraction on the vectorized statement to obtain a first feature extraction matrix, and taking the first feature extraction matrix as the first feature extraction result.
Step S122, based on the first fully-connected network and the second fully-connected network, respectively fully connecting the first feature extraction results to obtain a first sentence vector and a second sentence vector;
in this embodiment, the first feature extraction result is fully connected based on the first fully connected network and the second fully connected network, so as 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, so as to obtain a first sentence vector, the first feature extraction matrix is input into the second fully connected network, and the first feature extraction matrix is fully connected, so as to obtain a second sentence vector, where it is required to be noted that the first sentence vector includes at least one prefix vector for representing a representation vector of a word as a dependency in the dependency relationship, and the second sentence vector includes at least one suffix vector for representing a representation vector of a word as a dependency in the dependency relationship, for example, assuming that a word a is dependent on a word B, the word expression vector corresponding to the word B is a prefix vector, and the word expression vector corresponding to the word a is an end-of-word vector.
Step S123, based on the first affine-transformation network, carrying out affine-transformation on the first sentence vector and the second sentence vector to obtain a dependency relationship score matrix;
in this embodiment, based on the first affine-doubly-transformed network, the first sentence vector and the second sentence vector are subjected to affine-doubly-transformed to obtain a dependency score matrix, and specifically, the first sentence vector and the second sentence vector are input into the first affine-doubly-transformed network, and the first sentence vector and the second sentence vector are subjected to affine-doubly-transformed to calculate a probability score of a dependency relationship existing 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 probability scores of a dependency relationship existing between each prefix vector and each suffix vector.
Step S124, determining the dependency relationship determination result based on the dependency relationship score matrix.
In this embodiment, the dependency relationship determination result is determined based on the dependency relationship score matrix, specifically, based on a preset maximal spanning tree algorithm, a maximal probability score sum satisfying a preset score selection condition is selected from the dependency relationship score matrix, and a dependency relationship vector composed of vectorized words corresponding to the dependency relationship corresponding to the maximal probability score and corresponding target probability scores is used as the dependency relationship determination result, where the preset score selection condition includes that the to-be-analyzed words corresponding to the target probability scores correspond to the to-be-analyzed words in the to-be-analyzed sentence one-to-one, for example, each target probability score is assumed to be a and B, where a represents a probability score that a word B is attached to a word a, B represents a probability score that a word c is attached to a word B, and a word a corresponds to a vectorized word X, the word b corresponds to the vectorized word as a vector Y, the word c corresponds to the vectorized word as a vector Z, and the dependency relationship vector is a vector (X, 1, 0, 0, 1, Y, 1, 0, 0, 1, Z), where (1, 0, 0, 1) indicates that there is dependency relationship between words.
Step S13, based on a preset dependency type prediction model and the dependency determination result, performing dependency type prediction on the vectorized statement to obtain the dependency type prediction result.
In this embodiment, the preset dependency syntax model includes a preset dependency type prediction model, where the preset dependency type prediction model is a machine learning model for predicting a dependency type between words in a to-be-parsed sentence.
Performing dependency type prediction on the vectorized statement based on a preset dependency type prediction model and the dependency discrimination result to obtain a dependency type prediction result, and specifically, performing dependency type prediction on the vectorized statement based on the preset dependency type prediction model to obtain a dependency type probability score matrix, where it is required to be noted that a dependency type probability score vector exists at each bit in the dependency type probability score matrix, where a value at each bit of the dependency type probability score vector is a probability score of a preset dependency type, for example, assuming that the dependency type probability score vector is (a, B, C), and a first bit of the dependency type probability score vector corresponds to a primary predicate, the second bit corresponds to the verb relationship, the third bit corresponds to the parallel relationship, if A is the probability score of the dependency relationship between two words corresponding to the dependency relationship type probability score vector as the primary predicate relationship, B is the probability score of the dependency relationship between two words corresponding to the dependency relationship type probability score vector as the primary predicate relationship, A is the probability score of the dependency relationship between two words corresponding to the dependency relationship type probability score vector as the primary predicate relationship, then based on the dependency relationship determination result, each target dependency relationship type probability score vector is selected from the dependency relationship type probability score matrix, and then the relationship type corresponding to the maximum value in each target dependency relationship type probability score vector is used as the target dependency relationship type, so as to obtain the dependency relationship type between the words of the sentence to be analyzed, that is, and obtaining the prediction result of the dependency relationship type.
The step of performing dependency type prediction on the vectorized statement based on a preset dependency type prediction model and the dependency type discrimination result to obtain the dependency type prediction result includes:
step S131, based on the preset dependency relationship type prediction model, performing dependency relationship type prediction on the vectorized statement to obtain a dependency relationship type probability score matrix;
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 doubly-affine transformation network.
Based on the preset dependency type prediction model, performing dependency type prediction on the vectorized statement to obtain a dependency type probability score matrix, specifically, inputting the vectorized statement into a second feature extraction model, performing feature extraction on the vectorized statement to obtain a second feature extraction matrix, inputting the second feature extraction matrix into a third full-connection network and a fourth full-connection network respectively to obtain a third sentence vector and a corresponding fourth sentence vector corresponding to the second feature extraction matrix, inputting the third sentence vector and the fourth sentence vector into a second double affine transformation network, and performing double affine transformation on the third sentence vector and the fourth sentence vector to obtain the dependency type probability score matrix.
And S132, fusing the dependency relationship type probability score matrix and the dependency relationship vector to obtain the dependency relationship type prediction result.
In this embodiment, the dependency type probability score matrix and the dependency vector are fused to obtain the prediction result of the dependency type, and 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, where the preset fusion rule includes weighted average, concatenation, summation, and the like, a value at each bit of the dependency type probability vector is a probability of a preset dependency type, the preset dependency type includes a predicate type, a move-guest type, a parallel relationship type, and the like, and then a maximum probability value is selected from each dependency type probability vector as a target dependency type probability, and then determining a dependency relationship type corresponding to each maximum dependency relationship type probability which meets a preset probability selection condition in each target dependency relationship type probability, and taking the dependency relationship type corresponding to each maximum dependency relationship type probability as a dependency relationship type prediction result, wherein the preset probability selection condition comprises that the selected words to be analyzed corresponding to each maximum dependency relationship type probability are in one-to-one correspondence with each word to be analyzed in the sentence to be analyzed, for example, if the sentence to be analyzed is ABC, the preset probability selection condition is that the number of the selected probabilities of each maximum dependency relationship type is 2, and the words to be analyzed corresponding to each maximum dependency relationship type probability can form the sentence to be analyzed ABC.
Additionally, it should be noted that, in one embodiment, the preset dependency syntax model may be obtained by training based on the following steps:
step D10, obtaining training data and a dependency syntax model to be trained, wherein the training data comprises a training statement and a preset dependency type label corresponding to the training statement;
in this embodiment, it should be noted that the preset dependency type tag is a pre-labeled identifier of a dependency relationship type between words in a training sentence, and the dependency syntax model to be trained is an untrained dependency syntax model.
The method comprises the steps of obtaining training data and a dependency syntax model to be trained, wherein the training data comprises a training statement and a preset dependency type label corresponding to the training statement, specifically, obtaining a marked dependency syntax analysis data set and the dependency syntax model to be trained, collecting the dependency syntax analysis data set, manually marking the dependency syntax analysis data set to obtain a manually marked dependency syntax analysis data set, and further combining the marked dependency syntax analysis data set and the manually marked dependency syntax analysis data set to obtain a training data set so as to expand the number of training samples corresponding to the dependency syntax model to be trained.
Step D20, inputting the training data into the dependency syntax model to be trained, so as to perform dependency syntax analysis on the training sentence, and obtain a type training prediction label;
in this embodiment, it should be noted that the training data at least includes a training sentence.
Inputting the training data into the dependency syntax model to be trained, performing dependency syntax analysis on the training sentences to obtain type training prediction labels, specifically, vectorizing the training sentences based on a vectorization network in the dependency syntax model to be trained to obtain vectorized training sentences, further performing dependency relationship discrimination on the vectorized training sentences based on a preset dependency relationship discrimination model in the dependency syntax model to be trained to obtain training dependency relationship vectors, performing dependency relationship type prediction on the vectorized training sentences based on the preset dependency relationship type prediction model in the dependency syntax model to be trained to obtain training dependency relationship type probability score matrices, and further determining the type training prediction labels from the training dependency relationship vectors and the training dependency relationship type probability score matrices, and the type training prediction label is an identifier of a dependency relationship type corresponding to the training statement.
Step D30, calculating a dependency syntax model error based on the type training prediction label and the preset dependency type label;
in this embodiment, a dependency syntax model error is calculated based on the type training prediction tag and the preset dependency type tag, and specifically, a distance between the type training prediction tag and the preset dependency type tag is calculated to obtain a dependency syntax model error.
And D40, updating the dependency syntax model to be trained based on the dependency syntax model error until the dependency syntax model to be trained meets a preset updating ending condition, and taking the dependency syntax model to be trained as the preset dependency syntax model.
In this embodiment, the dependency syntax model to be trained is updated based on the dependency syntax model error until the dependency syntax model to be trained satisfies a preset update end condition, the dependency syntax model to be trained is used as the preset dependency syntax model, specifically, gradient information is calculated based on the dependency syntax model error, and the model parameter of the dependency syntax model to be trained is updated according to the gradient information in a back propagation manner, so as to obtain an updated dependency syntax model to be trained, and further, whether the updated dependency syntax model to be trained satisfies the preset update end condition is determined, if yes, the updated dependency syntax model to be trained is used as the preset dependency syntax model, and if not, a training sentence is obtained again, so as to train and update the updated model parameter of the dependency syntax model to be trained again, and until the updated dependency syntax model to be trained meets a preset updating end condition, wherein the preset updating end condition comprises the maximum iteration times, the loss function convergence and the like.
The implementation provides a dependency syntax analysis method based on machine learning, which comprises the steps of firstly vectorizing a sentence to be analyzed to obtain a vectorized sentence, further carrying out dependency relationship judgment on the vectorized sentence based on a preset dependency relationship judgment model to obtain a dependency relationship judgment result, further achieving the purpose of judging whether dependency relationship exists between words of the sentence to be analyzed, further carrying out dependency relationship type prediction on the vectorized sentence based on a preset dependency relationship type prediction model and the dependency relationship judgment result to obtain the dependency relationship type prediction result, further achieving the purpose of predicting the dependency relationship type between the words in the sentence to be analyzed, and avoiding the situation that the probability of dependency relationship among the words is extremely low because the dependency relationship type is predicted based on the prediction relationship judgment result, the probability of predicting various types of preset dependency relationships among words is high, the accuracy of dependency relationship type prediction is improved, the accuracy of dependency syntax analysis is improved, sentence temporal recognition can be performed on the sentence to be analyzed based on the dependency syntax analysis result, and the purpose of sentence temporal recognition on the sentence to be analyzed based on dependency syntax information can be realized, wherein the dependency syntax information comprises word component information of each word in the sentence to be analyzed, the purpose of sentence temporal recognition based on word information of a keyword and word component information of the keyword in the sentence at the same time can be realized, so that the judgment basis of sentence temporal is more sufficient, and when the temporal of the sentence is judged based on the word information of the keyword in the original sentence alone in the prior art is overcome, the method lays a foundation for the technical defect that the sentence tense basis is single, so that the probability of misjudgment is high, and the sentence tense recognition accuracy is low.
Referring to fig. 4, fig. 4 is a schematic device structure diagram of a hardware operating environment according to an embodiment of the present application.
As shown in fig. 4, the dependency syntax-based sentence temporal recognition apparatus may include: a processor 1001, such as a CPU, a memory 1005, and a communication bus 1002. The communication bus 1002 is used for realizing connection communication between the processor 1001 and the memory 1005. The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a memory device separate from the processor 1001 described above.
Optionally, the sentence temporal recognition device based on dependency syntax may further include a rectangular user interface, a network interface, a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, and the like. The rectangular user interface may comprise a Display screen (Display), an input sub-module such as a Keyboard (Keyboard), and the optional rectangular user interface may also comprise a standard wired interface, a wireless interface. The network interface may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface).
Those skilled in the art will appreciate that the dependency syntax-based sentence tense recognition device structure illustrated in FIG. 4 does not constitute a limitation on dependency syntax-based sentence tense recognition devices, and may include more or fewer components than illustrated, or some components in combination, or a different arrangement of components.
As shown in fig. 4, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, and a sentence temporal recognition program based on dependency syntax. The operating system is a program that manages and controls the dependency syntax based sentence temporal recognition device hardware and software resources, supporting the operation of the dependency syntax based sentence temporal recognition program, as well as other software and/or programs. The network communication module is used to implement communication between the components within the memory 1005, as well as communication with other hardware and software in the dependency syntax based sentence temporal recognition system.
In the dependency syntax based sentence temporal recognition apparatus shown in fig. 4, the processor 1001 is configured to execute a dependency syntax based sentence temporal recognition program stored in the memory 1005, and implement the steps of the dependency syntax based sentence temporal recognition method described in any one of the above.
The specific implementation of the sentence temporal recognition device based on the dependency syntax is basically the same as the embodiments of the sentence temporal recognition method based on the dependency syntax, and is not described herein again.
The embodiment of the present application further provides a dependency syntax based sentence temporal recognition apparatus applied to a dependency syntax based sentence temporal recognition device, including:
the dependency syntax analysis module is used for acquiring the statement to be analyzed and performing dependency syntax analysis on the statement to be analyzed to acquire a dependency syntax analysis result corresponding to the statement to be analyzed;
and the temporal recognition module is used for carrying out sentence temporal recognition on the sentence to be analyzed based on the dependency syntactic analysis result to obtain a sentence temporal recognition result.
Optionally, the temporal identification module includes:
the extraction submodule is used for extracting a target sentence backbone of the sentence to be analyzed based on the dependency syntax analysis result;
and the temporal recognition submodule is used for carrying out sentence temporal recognition on the sentence to be analyzed based on the target sentence backbone to obtain a sentence temporal recognition result.
Optionally, the temporal identification submodule includes:
the selecting unit is used for selecting a temporal landmark word from the trunk of the target sentence based on the preset keyword component position;
and the first identification unit is used for carrying out sentence temporal identification on the sentence to be analyzed based on the temporal landmark words and preset temporal judgment priority information to obtain a sentence temporal identification result.
Optionally, the temporal identifier module further comprises:
the classification unit is used for inputting the target sentence backbone into a preset sentence classification model, classifying the target sentence backbone and obtaining a sentence classification label corresponding to the target sentence backbone;
and the second identification unit is used for carrying out sentence temporal identification on the sentence to be analyzed based on the sentence classification label to obtain a sentence temporal identification result.
Optionally, the extraction submodule includes:
a first determining unit, configured to determine sentence pattern information corresponding to the sentence to be parsed, based on the dependency syntax type tag prediction result;
and the extraction unit is used for extracting the target sentence backbone based on the sentence pattern information and the dependency syntax type label prediction result.
Optionally, the extraction unit comprises:
the first determining subunit is used for determining a target core word corresponding to the sentence to be analyzed based on the sentence pattern information;
a second determining subunit, configured to determine, based on a preset word component priority and the dependency syntax type tag prediction result, each target sentence backbone word corresponding to the target core word;
a generating subunit, configured to generate the target sentence skeleton based on the sentence pattern information, the target core words, and each of the target sentence skeleton words.
Optionally, the dependency parsing module includes:
the vectorization submodule is used for vectorizing the statement to be analyzed to obtain a vectorized statement;
the dependency relationship judging submodule is used for judging the dependency relationship of the vectorized statement based on a preset dependency relationship judging model to obtain a dependency relationship judging result;
and the dependency relationship type prediction sub-module is used for carrying out dependency relationship type prediction on the vectorized statement based on a preset dependency relationship type prediction model and the dependency relationship judgment result to obtain the dependency relationship type prediction result.
Optionally, the dependency relationship determination sub-module includes:
the feature extraction unit is used for extracting features of the vectorization sentences based on the first feature extraction model to obtain a first feature extraction result;
a full-connection unit, configured to perform full-connection on the first feature extraction result based on the first full-connection network and the second full-connection network, respectively, to obtain a first sentence vector and a second sentence vector;
a double affine transformation unit configured to perform 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 relationship score matrix;
a second determining unit configured to determine the dependency relationship determination result based on the dependency relationship score matrix.
Optionally, the dependency type prediction sub-module includes:
the prediction unit is used for carrying out dependency relationship type prediction on the vectorization statement based on the preset dependency relationship type prediction model to obtain a dependency relationship type probability score matrix;
and the fusion unit is used for fusing the dependency relationship type probability score matrix and the dependency relationship vector to obtain the dependency relationship type prediction result.
The specific implementation of the sentence temporal recognition device based on the dependency syntax is basically the same as the above-mentioned embodiments of the sentence temporal recognition method based on the dependency syntax, and is not described herein again.
The embodiment of the application provides a readable storage medium, and the readable storage medium stores one or more programs, which are also executable by one or more processors for implementing the steps of any one of the above-mentioned dependency syntax based sentence temporal recognition methods.
The specific implementation of the readable storage medium of the present application is substantially the same as the embodiments of the sentence temporal identification method based on the dependency syntax, and is not described herein again.
The above description is only a preferred embodiment of the present application, and not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings, or which are directly or indirectly applied to other related technical fields, are included in the scope of the present application.

Claims (11)

1. A sentence temporal recognition method based on dependency syntax is characterized in that the sentence temporal recognition method based on dependency syntax comprises the following steps:
obtaining a statement to be analyzed, and performing dependency syntax analysis on the statement to be analyzed to obtain a dependency syntax analysis result corresponding to the statement to be analyzed;
and carrying out sentence tense recognition on the sentence to be analyzed based on the dependency syntax analysis result to obtain a sentence tense recognition result.
2. The dependency syntax-based sentence temporal recognition method of claim 1, wherein the sentence temporal recognition of the sentence to be parsed based on the dependency syntax analysis result, and the obtaining of the sentence temporal recognition result comprises:
extracting a target sentence backbone of the sentence to be analyzed based on the dependency syntax analysis result;
and carrying out sentence tense recognition on the sentence to be analyzed based on the target sentence backbone to obtain a sentence tense recognition result.
3. The sentence temporal recognition method based on dependency syntax as claimed in claim 2, wherein the sentence temporal recognition is performed on the sentence to be parsed based on the target sentence stem, and the step of obtaining the sentence temporal recognition result comprises:
selecting a temporal landmark word from the target sentence backbone based on preset keyword component positions;
and carrying out sentence temporal recognition on the sentence to be analyzed based on the temporal landmark words and preset temporal judgment priority information to obtain a sentence temporal recognition result.
4. The sentence temporal recognition method based on dependency syntax as claimed in claim 2, wherein the sentence temporal recognition is performed on the sentence to be parsed based on the target sentence stem, and the step of obtaining the sentence temporal recognition result further comprises:
inputting the target sentence backbone into a preset sentence classification model, classifying the target sentence backbone, and obtaining a sentence classification label corresponding to the target sentence backbone;
and carrying out sentence temporal recognition on the sentence to be analyzed based on the sentence classification label to obtain a sentence temporal recognition result.
5. The dependency syntax-based sentence temporal recognition method of claim 2, wherein the dependency syntax analysis result includes a dependency syntax type tag prediction result,
the step of extracting the target sentence backbone of the sentence to be parsed based on the dependency parsing result includes:
determining sentence pattern information corresponding to the sentence to be analyzed based on the dependency syntax type label prediction result;
and extracting the target sentence backbone based on the sentence pattern information and the dependency syntax type label prediction result.
6. The dependency syntax-based sentence temporal recognition method of claim 5, wherein the step of extracting the target sentence stem based on the sentence pattern information and the dependency syntax type tag prediction result comprises:
determining a target core word corresponding to the sentence to be analyzed based on the sentence pattern information;
determining each target sentence main word corresponding to the target core word based on preset word component priority and the dependency syntax type label prediction result;
and generating the target sentence backbone based on the sentence pattern information, the target core words and each target sentence backbone word.
7. The dependency syntax-based sentence temporal recognition method of claim 1, wherein the dependency syntax analysis result includes a dependency type prediction result,
the step of performing dependency syntax analysis on the statement to be analyzed to obtain a dependency syntax analysis result corresponding to the statement to be analyzed includes:
vectorizing the statement to be analyzed to obtain a vectorized statement;
based on a preset dependency relationship judging model, judging the dependency relationship of the vectorized statement to obtain a dependency relationship judging result;
and performing dependency relationship type prediction on the vectorized statement based on a preset dependency relationship type prediction model and the dependency relationship judgment result to obtain the dependency relationship type prediction result.
8. The dependency syntax-based sentence temporal recognition method of claim 7, wherein the preset dependency relationship discrimination model comprises a first feature extraction model, a first fully-connected network, a second fully-connected network, and a first affine-double transformation network,
the step of judging the dependence relationship of the vectorized statement based on the preset dependence relationship judging model to obtain the dependence relationship judging result comprises the following steps:
performing feature extraction on the vectorization statement based on the first feature extraction model to obtain a first feature extraction result;
based on the first fully-connected network and the second fully-connected network, respectively fully connecting the first feature extraction results to obtain a first sentence vector and a second sentence vector;
based on the first affine-doubly-transformed network, carrying out affine-doubly transformation on the first sentence vector and the second sentence vector to obtain a dependency relationship score matrix;
and determining the dependency relationship discrimination result based on the dependency relationship score matrix.
9. The dependency syntax-based sentence temporal recognition method of claim 7, wherein the step of performing dependency type prediction on the vectorized sentence 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 relationship type prediction model, performing dependency relationship type prediction on the vectorized statement to obtain a dependency relationship type probability score matrix;
and fusing the dependency relationship type probability score matrix and the dependency relationship vector to obtain the dependency relationship type prediction result.
10. A dependency syntax-based sentence tense recognition device, characterized in that the dependency syntax-based sentence tense recognition device comprises: a memory, a processor, and a program stored on the memory for implementing the dependency syntax based sentence temporal recognition method,
the memory is used for storing a program for realizing a sentence temporal recognition method based on dependency syntax;
the processor is configured to execute a program implementing the dependency syntax based sentence temporal recognition method to implement the steps of the dependency syntax based sentence temporal recognition method according to any one of claims 1 to 9.
11. A readable storage medium having stored thereon a program for implementing a dependency syntax based sentence temporal recognition method, the program for implementing the dependency syntax based sentence temporal recognition method being executed by a processor to implement the steps of the dependency syntax based sentence temporal recognition method according to any one of claims 1 to 9.
CN202010964030.XA 2020-09-14 2020-09-14 Sentence tense recognition method and device based on dependency syntax and readable storage medium Pending CN112069800A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010964030.XA CN112069800A (en) 2020-09-14 2020-09-14 Sentence tense recognition method and device based on dependency syntax and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010964030.XA CN112069800A (en) 2020-09-14 2020-09-14 Sentence tense recognition method and device based on dependency syntax and readable storage medium

Publications (1)

Publication Number Publication Date
CN112069800A true CN112069800A (en) 2020-12-11

Family

ID=73696746

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010964030.XA Pending CN112069800A (en) 2020-09-14 2020-09-14 Sentence tense recognition method and device based on dependency syntax and readable storage medium

Country Status (1)

Country Link
CN (1) CN112069800A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113011169A (en) * 2021-01-27 2021-06-22 北京字跳网络技术有限公司 Conference summary processing method, device, equipment and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6289302B1 (en) * 1998-10-26 2001-09-11 Matsushita Electric Industrial Co., Ltd. Chinese generation apparatus for machine translation to convert a dependency structure of a Chinese sentence into a Chinese sentence
JP2004287679A (en) * 2003-03-20 2004-10-14 Fuji Xerox Co Ltd Natural language processing system and natural language processing method and computer program
CN103617280A (en) * 2013-12-09 2014-03-05 苏州大学 Method and system for mining Chinese event information
CN104268133A (en) * 2014-09-11 2015-01-07 北京交通大学 Machine translation method and system
CN110377903A (en) * 2019-06-24 2019-10-25 浙江大学 A kind of Sentence-level entity and relationship combine abstracting method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6289302B1 (en) * 1998-10-26 2001-09-11 Matsushita Electric Industrial Co., Ltd. Chinese generation apparatus for machine translation to convert a dependency structure of a Chinese sentence into a Chinese sentence
JP2004287679A (en) * 2003-03-20 2004-10-14 Fuji Xerox Co Ltd Natural language processing system and natural language processing method and computer program
CN103617280A (en) * 2013-12-09 2014-03-05 苏州大学 Method and system for mining Chinese event information
CN104268133A (en) * 2014-09-11 2015-01-07 北京交通大学 Machine translation method and system
CN110377903A (en) * 2019-06-24 2019-10-25 浙江大学 A kind of Sentence-level entity and relationship combine abstracting method

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
ZHENGHUA LI等: "Joint Models for Chinese POS Tagging and Dependency Parsing", PROCEEDINGS OF THE 2011 CONFERENCE ON EMPIRICAL METHODS IN NATURAL LANGUAGE PROCESSING, 27 July 2011 (2011-07-27), pages 1180 - 1191 *
刘跃红: "问句依存句法及语义分析研究", 中国优秀硕士学位论文全文数据库信息科技辑(月刊), no. 05, 31 May 2012 (2012-05-31), pages 138 - 1610 *
董喜双;关毅;: "基于有监督学习的依存句法分析模型综述", 智能计算机与应用, no. 02, 1 April 2013 (2013-04-01) *
袁里驰;: "基于依存关系的句法分析统计模型", 中南大学学报(自然科学版), no. 06, 26 December 2009 (2009-12-26) *
郭艳华, 周昌乐: "一种汉语语句依存关系网分析策略与生成算法研究", 浙江大学学报(理学版), no. 06, 25 June 2000 (2000-06-25) *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113011169A (en) * 2021-01-27 2021-06-22 北京字跳网络技术有限公司 Conference summary processing method, device, equipment and medium
WO2022161122A1 (en) * 2021-01-27 2022-08-04 北京字跳网络技术有限公司 Minutes of meeting processing method and apparatus, device, and medium

Similar Documents

Publication Publication Date Title
CN109710744B (en) Data matching method, device, equipment and storage medium
CN112069801A (en) Sentence backbone extraction method, equipment and readable storage medium based on dependency syntax
CN110727779A (en) Question-answering method and system based on multi-model fusion
CN111460250B (en) Image data cleaning method, image data cleaning device, image data cleaning medium, and electronic apparatus
CN111026842A (en) Natural language processing method, natural language processing device and intelligent question-answering system
CN111581361A (en) Intention identification method and device
CN112084793B (en) Semantic recognition method, device and readable storage medium based on dependency syntax
KR102138130B1 (en) Apparatus and method for answering question based on conceptual graph
CN108038208B (en) Training method and device of context information recognition model and storage medium
WO2022048194A1 (en) Method, apparatus and device for optimizing event subject identification model, and readable storage medium
US11461613B2 (en) Method and apparatus for multi-document question answering
CN109933792A (en) Viewpoint type problem based on multi-layer biaxially oriented LSTM and verifying model reads understanding method
CN113806582B (en) Image retrieval method, image retrieval device, electronic equipment and storage medium
CN112069799A (en) Dependency syntax based data enhancement method, apparatus and readable storage medium
WO2020164336A1 (en) Method and device for extracting main word by means of reinforcement learning
US20210248425A1 (en) Reinforced text representation learning
CN114896395A (en) Language model fine-tuning method, text classification method, device and equipment
CN114492601A (en) Resource classification model training method and device, electronic equipment and storage medium
CN114647713A (en) Knowledge graph question-answering method, device and storage medium based on virtual confrontation
CN112420125A (en) Molecular attribute prediction method and device, intelligent equipment and terminal
CN111626291A (en) Image visual relationship detection method, system and terminal
CN113869609A (en) Method and system for predicting confidence of frequent subgraph of root cause analysis
CN112599211B (en) Medical entity relationship extraction method and device
CN112069800A (en) Sentence tense recognition method and device based on dependency syntax and readable storage medium
CN113705207A (en) Grammar error recognition method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination