Data enhancement method, device and readable storage medium based on dependency syntax
Obtaining word component information through dependency syntax analysis and performing targeted data enhancement solves the problem of semantic changes caused by random data enhancement in the existing technology, and improves the effect of data enhancement and semantic consistency.
Patent Information
- Application Number
- CN202010964029.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-14
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2040-09-14
AI Technical Summary
In the prior art, data enhancement operations are performed randomly, resulting in the semantics of sentences after data enhancement may change, which in turn causes the semantics to mismatch the original sentence label, resulting in poor data enhancement effect.
Obtain the word component information of the sentence to be analyzed through dependency syntax analysis, and conduct targeted data enhancement based on this information to ensure that the semantics of the data-enhanced sentences remain unchanged and the semantics match the original sentence tags.
The effect of data enhancement is improved, the semantic consistency and label matching of sentences after data enhancement are ensured, and the semantic change problem caused by random data enhancement in the existing technology is overcome.
Smart Images

Figure CN112069799B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence in financial technology (Fintech), and in particular to a data enhancement method, device and readable storage medium based on dependency syntax. Background Art
[0002] With the continuous development of financial technology, especially Internet technology finance, more and more technologies (such as distributed, blockchain, artificial intelligence, etc.) are applied in the financial field, but the financial industry also puts forward higher requirements on technology, such as higher requirements on the distribution of corresponding to-do items in the financial industry.
[0003] With the continuous development of computer software and artificial intelligence, the application fields of artificial intelligence are becoming more and more extensive. At present, a huge amount of training data is usually required when training natural language processing models, while the amount of data that can be collected by the model trainer itself is often small. In order to improve the training efficiency of the model, it is usually necessary to enhance the collected data to increase the amount of training data that can be used to train the natural language processing model. At present, random data enhancement is usually performed by randomly deleting, randomly exchanging and randomly replacing words in the collected original sentences. However, since the random data enhancement operation is performed randomly, there is a very high probability that the semantics of the sentence after data enhancement will change, which will lead to poor data enhancement effect. Summary of the invention
[0004] The main purpose of this application is to provide a data enhancement method, device and readable storage medium based on dependency syntax, aiming to solve the technical problem of poor data enhancement effect in the prior art.
[0005] To achieve the above object, the present application provides a data enhancement method based on dependency syntax, wherein the data enhancement method based on dependency syntax is applied to a data enhancement device based on dependency syntax, and the data enhancement method based on dependency syntax includes:
[0006] Acquire a sentence to be analyzed, and perform dependency syntactic analysis on the sentence to be analyzed to obtain word component information corresponding to the sentence to be analyzed;
[0007] Based on the word component information, data enhancement is performed on the sentence to be analyzed to obtain a data enhancement result.
[0008] The present application also provides a data enhancement device based on dependency syntax, wherein the data enhancement device based on dependency syntax is a virtual device, and the data enhancement device based on dependency syntax is applied to a data enhancement device based on dependency syntax, and the data enhancement device based on dependency syntax includes:
[0009] A dependency syntactic analysis module, used to obtain a sentence to be analyzed, and perform dependency syntactic analysis on the sentence to be analyzed to obtain word component information corresponding to the sentence to be analyzed;
[0010] The data enhancement module is used to perform data enhancement on the sentence to be analyzed based on the word component information to obtain a data enhancement result.
[0011] The present application also provides a data enhancement device based on dependency syntax, which is a physical device. The data enhancement device based on dependency syntax includes: a memory, a processor, and a program of the data enhancement method based on dependency syntax stored in the memory and executable on the processor. When the program of the data enhancement method based on dependency syntax is executed by the processor, the steps of the data enhancement method based on dependency syntax as described above can be implemented.
[0012] The present application also provides a readable storage medium, on which is stored a program for implementing a data enhancement method based on dependency syntax. When the program for the data enhancement method based on dependency syntax is executed by a processor, the steps of the data enhancement method based on dependency syntax as described above are implemented.
[0013] The present application provides a data enhancement method, device and readable storage medium based on dependency syntax. Compared with the technical means adopted in the prior art to perform random data enhancement by randomly deleting, randomly exchanging and randomly replacing words in the collected original sentences, the present application first obtains the sentence to be analyzed, and performs dependency syntax analysis on the sentence to be analyzed to obtain word component information corresponding to the sentence to be analyzed, thereby achieving the purpose of analyzing the word components of the sentence to be analyzed based on dependency syntax, and then performs data enhancement on the sentence to be analyzed based on the word component information to obtain the data enhancement result. It should be noted that since the data enhancement operation of the prior art is performed randomly, it will cause the data to be The semantics of the enhanced sentence will change, which will cause the semantics of the data-enhanced sentence to not match the label of the sentence to be analyzed. Therefore, in the present application, the sentence to be analyzed is targetedly data enhanced according to the word components of the sentence to be analyzed, which can ensure that the semantics of the sentence after data enhancement will not change, and thus the semantics of the data-enhanced sentence can match the label of the sentence to be analyzed. This overcomes the technical defect of the prior art of performing random data enhancement by randomly deleting, randomly exchanging and randomly replacing words in the collected original sentences, which will highly likely cause the semantics of the data-enhanced sentence to change, thereby resulting in poor data enhancement effect, thereby improving the effect of data enhancement. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0015] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0016] Figure 1 This is a flowchart of the first embodiment of the data enhancement method based on dependency syntax of the present application;
[0017] Figure 2 This is a flowchart of the second embodiment of the data enhancement method based on dependency syntax of the present application;
[0018] Figure 3 This is a flowchart of the third embodiment of the data enhancement method based on dependency syntax of the present application;
[0019] Figure 4 This is a flow chart of data enhancement for sentences to be analyzed based on a preset dependency syntax model in the data enhancement method based on dependency syntax of the present application;
[0020] Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present application.
[0021] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0022] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0023] The present application embodiment provides a data enhancement method based on dependency syntax. In the first embodiment of the data enhancement method based on dependency syntax of the present application, refer to Figure 1 , the data enhancement method based on dependency syntax includes:
[0024] Step S10, obtaining a sentence to be analyzed, and performing dependency syntactic analysis on the sentence to be analyzed to obtain word component information corresponding to the sentence to be analyzed;
[0025] In this embodiment, it should be noted that the data enhancement method based on dependency syntax is applied to a human-computer dialogue system, the sentence to be analyzed is a sentence replied by a user during a human-computer dialogue, and the data enhancement device based on dependency syntax includes a preset dependency syntax model, wherein the preset dependency syntax model is a pre-trained machine learning model for performing dependency syntax analysis on the sentence, wherein the process of dependency syntax analysis is the process of parsing the syntactic information of the sentence, wherein the syntactic information includes sentence information and word component information, wherein the word component information includes word components corresponding to each word to be analyzed in the sentence to be analyzed, wherein the word components include subject, predicate, object and attributive, etc. For example, assuming the sentence is "Who am I", after dependency syntax analysis, the sentence information indicates that the sentence is a subject-predicate-object sentence, and the word component information indicates that "I" is the subject, "is" is the predicate, and "who" is the object.
[0026] A sentence to be analyzed is obtained, and dependency syntactic analysis is performed on the sentence to be analyzed to obtain word component information corresponding to the sentence to be analyzed. Specifically, the sentence to be analyzed is obtained, and the sentence to be analyzed is input into the preset dependency syntactic model, and dependency relationship determination and dependency relationship type prediction are performed on the sentence to be analyzed respectively, so as to perform dependency syntactic analysis on the sentence to be analyzed. It should be noted that the purpose of performing dependency relationship determination is to determine whether there is a dependency relationship between words, and the purpose of dependency relationship type prediction is to predict the type of dependency relationship. For example, assuming that the sentence to be analyzed is a word In the sentence "ABC", where A, B and C are all words in the sentence to be analyzed, after performing dependency relationship identification, it can be determined that B depends on A, and C depends on B. After performing dependency relationship type prediction, it can be determined that the dependency relationship between A and B is a subject-predicate relationship, and the dependency relationship between B and C is a verb-object relationship, thereby obtaining word component information of the sentence to be analyzed. In one practicable manner, the steps of performing dependency relationship identification and dependency relationship type prediction on the sentence to be analyzed respectively to perform dependency syntactic analysis on the sentence to be analyzed, and obtaining word component information of the sentence to be analyzed include:
[0027] Dependency discrimination is performed on the sentence to be analyzed to obtain the dependency discrimination result corresponding to the sentence to be analyzed, and dependency type prediction is performed on the sentence to be analyzed to obtain the dependency type prediction result corresponding to the sentence to be analyzed, and then the dependency discrimination result and the dependency type prediction result are merged to obtain the dependency type label between words in the sentence to be analyzed, and then based on the dependency type label, the sentence information and word component information of the sentence to be analyzed can be determined, wherein the dependency discrimination result can be represented by a vector, and the dependency discrimination result in vector form is a dependency discrimination vector, and the dependency type prediction result can be represented by a matrix, and the dependency type prediction result in rectangular form is a dependency type prediction probability matrix, wherein the dependency discrimination vector is a vector for performing dependency discrimination. The dependency type prediction probability matrix is a matrix representation of the result obtained by performing dependency type prediction, and the value of each bit in the dependency type prediction probability matrix is a dependency type probability prediction vector between one word in the sentence to be analyzed and another word, wherein the value of each bit in the dependency type probability prediction vector is a probability value that the dependency relationship between one word in the sentence to be analyzed and another word belongs to a preset dependency relationship corresponding to the bit, wherein the preset dependency relationship includes a subject-predicate relationship, a verb-object relationship, etc. For example, assuming that the dependency type probability prediction vector between word A and word B is (0.1, 0.9), 0.1 indicates that the probability of the subject-predicate relationship between word A and word B is 10%, and 0.9 indicates that the probability of the verb-object relationship between word A and word B is 90%.
[0028] Step S20: Based on the word component information, data enhancement is performed on the sentence to be analyzed to obtain a data enhancement result.
[0029] In this embodiment, it should be noted that the word component information includes the word components of each word to be analyzed in the sentence to be analyzed, the purpose of the data enhancement is to expand the number of samples, the data enhancement result is a set of sentences obtained through data enhancement, and the sentence to be analyzed includes at least one word to be analyzed.
[0030] Based on the word component information, data enhancement is performed on the sentence to be analyzed to obtain a data enhancement result. Specifically, a preset number of words to be analyzed are selected from the sentence to be analyzed as words to be data enhanced, and then based on the word components corresponding to each of the words to be data enhanced, a corresponding data enhancement operation set is matched to each of the data enhanced words, and then a data enhancement operation in the corresponding data enhancement operation set is performed on each of the data enhanced words in the sentence to be analyzed to obtain a data enhanced sentence corresponding to the sentence to be analyzed, and then dependency syntactic analysis is performed again on the data enhanced sentence and the sentence to be analyzed to re-obtain the data enhanced sentence until the number of data enhanced sentences meets a preset threshold, and a sentence combination consisting of the sentence to be analyzed and each of the data enhanced sentences is taken as the data enhancement result, wherein the The data enhancement operations include synonym replacement, deletion and unchanged operations. The data enhancement operation set is a combination of data enhancement operations, and each data enhancement operation in the data enhancement operation set corresponds to an execution probability. For example, assuming that the data enhancement operation set S is a vector ((A, 0.4), (B, 0.4), (C, 0.2)), where A corresponds to a synonym replacement operation, 0.4 means that there is a 40% probability that a synonym replacement operation is performed on the words to be data enhanced corresponding to the data enhancement operation set S, B corresponds to a deletion operation, 0.4 means that there is a 40% probability that a deletion operation is performed on the words to be data enhanced corresponding to the data enhancement operation set S, C corresponds to unchanged, and 0.2 means that there is a 20% probability that the words to be data enhanced corresponding to the data enhancement operation set S remain unchanged.
[0031] The sentence to be analyzed includes at least one word to be analyzed.
[0032] The step of performing data enhancement on the sentence to be analyzed based on the word component information to obtain a data enhancement result comprises:
[0033] Step S21, determining the word component type corresponding to each of the words to be analyzed based on the word component information;
[0034] In this embodiment, based on the word component information, the word component type corresponding to each of the words to be analyzed is determined. Specifically, based on the word components corresponding to each of the words to be analyzed, the word component types corresponding to each of the words to be analyzed are determined respectively.
[0035] Step S22: Based on each of the word component types, data enhancement is performed on the sentence to be analyzed to obtain a data enhancement result.
[0036] In this embodiment, based on each of the word component types, data enhancement is performed on the sentence to be analyzed to obtain a data enhancement result. Specifically, a word to be data enhanced is randomly selected in the sentence to be analyzed, and a target word component type corresponding to the word to be data enhanced is determined in each of the word component types, and then based on the set to be data enhanced corresponding to the target word component type, any data enhancement operation in the set to be data enhanced is performed on the word to be data enhanced in the sentence to be analyzed to obtain a data enhancement sentence corresponding to the sentence to be analyzed, and then dependency syntactic analysis is re-performed on the sentence to be analyzed and the data enhancement sentence to generate a new data enhancement sentence again, until the number of data enhancement sentences meets a preset number threshold, and the set consisting of the sentence to be analyzed and each data enhancement sentence is taken as the data enhancement result.
[0037] The step of performing data enhancement on the sentence to be analyzed based on each word component type to obtain a data enhancement result includes:
[0038] Step S221, selecting a word to be data enhanced from each of the words to be analyzed, and determining a target word component type corresponding to the word to be data enhanced from each word component type;
[0039] In this embodiment, a word to be data enhanced is selected from each of the words to be analyzed, and a target word component type corresponding to the word to be data enhanced is determined in each word component type. Specifically, a word to be analyzed is randomly selected from each of the words to be analyzed as the word to be data enhanced, and the word component type corresponding to the word to be data enhanced is used as the target word component type.
[0040] Step S222, based on the word component type attribution of the target word component type, selecting a target data enhancement operation from a data enhancement operation set corresponding to the preset target component type;
[0041] In this embodiment, it should be noted that the word component type classification includes a preset first word component classification, a preset second word component classification and a preset third word component classification, wherein the preset first word component classification includes predicates and parallel components of predicates, the preset second word component classification includes attributives, adverbials, subjects, auxiliary modifiers, objects and indirect objects, etc., and the preset third word component classification includes complements, left and right additional relationship words, etc.
[0042] Based on the word component type affiliation of the target word component type, a target data enhancement operation is selected from the data enhancement operation set corresponding to the preset target component type. Specifically, the word component type affiliation of the target word component type is determined. If the target word component type belongs to the preset first word component classification, a synonym replacement operation is selected with a first selection probability in the first data enhancement operation set corresponding to the preset first word component classification, and a preserve unchanged operation is selected with a second selection probability. If the target word component type belongs to the preset second word component classification, a delete operation is selected with a third selection probability in the second data enhancement operation set corresponding to the preset first word component classification, a synonym replacement operation is selected with a fourth selection probability, and a preserve unchanged operation is selected with a fifth selection probability. If the target word component type belongs to the preset third word component classification, then In the third data enhancement operation set corresponding to the preset first word component classification, the synonym replacement operation is selected with the sixth selection probability, the preservation operation is selected with the seventh selection probability, the random exchange operation of the same type of words in the sentence is selected with the eighth selection probability, and the deletion operation is selected with the ninth selection probability, wherein the synonym replacement operation is a data enhancement operation of replacing the word to be data enhanced in the sentence to be analyzed with a synonym corresponding to the word to be data enhanced, the preservation operation represents an operation without changing the word to be data enhanced, the deletion operation is a data enhancement operation of directly deleting the word to be data enhanced in the sentence to be analyzed, and the random exchange operation of the same type of words in the sentence is a data enhancement operation of randomly exchanging the word to be data enhanced with the word to be analyzed in the sentence to be analyzed that has the same word component as the word to be data enhanced.
[0043] Step S223, performing the target data enhancement operation on the words to be data enhanced in the sentence to be analyzed to obtain the data enhancement result.
[0044] In this embodiment, the target data enhancement operation is performed on the words to be data enhanced in the sentence to be analyzed to obtain the data enhancement result. Specifically, the target data enhancement operation is performed on the words to be data enhanced in the sentence to be analyzed to obtain the data enhancement sentence corresponding to the sentence to be analyzed, and then the sentence to be analyzed and the data enhancement sentence are re-performed with dependency syntactic analysis to obtain the data enhancement sentence again, until the number of each of the data enhancement sentences meets a preset number threshold, and the set consisting of the data enhancement sentences and the sentence to be analyzed is taken as the data enhancement result.
[0045] In addition, it should be noted that, since the data enhancement operation in the prior art is performed randomly, there is a great probability that the semantics of the original sentence will change, and the semantics of the sentence will not match the label of the original sentence. For example, assuming that when performing sentiment analysis of a sentence, there is a labeled sentence to be analyzed "I hate this product", and the label is negative emotion. If the word randomly deleted during data enhancement is "hate", the sentence to be analyzed after data enhancement becomes "my product", and the semantics of the sentence changes, and the sentence becomes a neutral sentence, but its label is still negative emotion, which leads to the mismatch between the semantics of the sentence and the label of the sentence, and the effect of data enhancement is poor. In this embodiment, the word components of the sentence are analyzed by dependency syntax, and then based on the type of word components, the corresponding data enhancement operation is selected in a targeted manner, so that the semantics of the sentence will not change, and the semantics of the sentence and the label of the sentence are highly matched, thereby improving the effect of data enhancement. Since the word components of the sentence have been determined, the reason why the data enhancement operation does not change the semantics of the sentence can be explained, thereby improving the interpretability of the data enhancement and making the confidence of the data enhancement result higher.
[0046] The present embodiment provides a data enhancement method, device and readable storage medium based on dependency syntax. Compared with the technical means adopted in the prior art to perform random data enhancement by randomly deleting, randomly exchanging and randomly replacing words in the collected original sentences, the present embodiment first obtains the sentence to be analyzed, and performs dependency syntax analysis on the sentence to be analyzed to obtain word component information corresponding to the sentence to be analyzed, thereby achieving the purpose of analyzing the word components of the sentence to be analyzed based on dependency syntax, and then performs data enhancement on the sentence to be analyzed based on the word component information to obtain the data enhancement result. It should be noted that since the data enhancement operation in the prior art is performed randomly, it will cause the data to be The semantics of the enhanced sentence will change, which will cause the semantics of the data-enhanced sentence to not match the label of the sentence to be analyzed. Therefore, in this embodiment, the sentence to be analyzed is targetedly data enhanced according to the word components of the sentence to be analyzed, which can ensure that the semantics of the sentence after data enhancement will not change, and thus the semantics of the data-enhanced sentence can match the label of the sentence to be analyzed. This overcomes the technical defect of the prior art of performing random data enhancement by randomly deleting, randomly exchanging, and randomly replacing words in the collected original sentences, which will highly likely cause the semantics of the data-enhanced sentence to change, thereby resulting in poor data enhancement effect, thereby improving the effect of data enhancement.
[0047] Further, refer to Figure 2Based on the first embodiment of the present application, in another embodiment of the present application, the step of performing dependency syntactic analysis on the sentence to be analyzed and obtaining word component information corresponding to the sentence to be analyzed includes:
[0048] Step S11, vectorizing the statement to be analyzed to obtain a vectorized statement;
[0049] In this embodiment, the sentence to be analyzed is vectorized to obtain a vectorized sentence. Specifically, a word vector to be analyzed, a part-of-speech vector to be analyzed and a word position vector to be analyzed are generated corresponding to each word to be analyzed in the sentence to be analyzed, wherein the word vector to be analyzed is a coding vector representing the word to be analyzed, which is used to uniquely represent 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, and the word position vector to be analyzed is a coding vector representing the position of the word to be analyzed in the sentence to be analyzed, and then based on the word vector to be analyzed, the corresponding part-of-speech vector to be analyzed and the corresponding word position vector to be analyzed corresponding to each word to be analyzed, a vectorized word corresponding to each word to be analyzed is generated, and then a matrix composed of each of the vectorized words is used as the vectorized sentence.
[0050] The sentence to be analyzed includes at least one word to be analyzed, and the vectorized sentence includes at least one vectorized word.
[0051] The step of vectorizing the statement to be analyzed to obtain a vectorized statement comprises:
[0052] Step S111, obtaining a word vector to be analyzed, a corresponding part-of-speech vector to be analyzed, and a corresponding word position vector to be analyzed corresponding to the word to be analyzed;
[0053] In this embodiment, the word vector to be analyzed, the corresponding part-of-speech vector to be analyzed and the corresponding word position vector to be analyzed corresponding to the word to be analyzed are obtained. Specifically, based on a preset word vector generation model, the word to be analyzed is mapped to a preset vector space to obtain the word vector to be analyzed corresponding to the word to be analyzed, and the corresponding part-of-speech vector to be analyzed is matched for the word to be analyzed. Furthermore, based on the position of the word to be analyzed in the sentence to be analyzed, the word position vector to be analyzed corresponding to the word to be analyzed is generated.
[0054] 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.
[0055] 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. 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 to obtain the vectorized word, wherein the preset vectorized word calculation formula is as follows:
[0056]
[0057] Among them, X i is the vectorized word, E w is the word vector to be analyzed, E t is the part-of-speech vector to be analyzed, E p is the position vector of the word to be analyzed, It is the concatenation operation between vectors.
[0058] Step S12, based on a preset dependency determination model, performing dependency determination on the vectorized sentence to obtain a dependency determination result;
[0059] In this embodiment, it should be noted that the preset dependency syntax model includes a preset dependency relationship discrimination model, wherein the preset dependency relationship discrimination model is a machine learning model for determining whether there is a dependency relationship between words in the sentence to be parsed.
[0060] Based on a preset dependency discrimination model, dependency discrimination is performed on the vectorized sentence to obtain a dependency discrimination result. Specifically, the vectorized sentence is input into the preset dependency discrimination model, and dependency discrimination is performed on the vectorized sentence to determine whether there is a dependency relationship between words in the sentence to be analyzed, and a dependency discrimination result is obtained.
[0061] The preset dependency relationship discrimination model includes a first feature extraction model, a first fully connected network, a second fully connected network and a first dual affine transformation network.
[0062] The step of performing dependency analysis on the vectorized sentence based on the first dependency syntactic sub-model to obtain a dependency determination result includes:
[0063] Step S121, performing feature extraction on the vectorized sentence based on the first feature extraction model to obtain a first feature extraction result;
[0064] In this embodiment, it should be noted that the first feature extraction model is a neural network that extracts features from the vectorized sentence, and the first feature extraction model includes a Transformer model, an RNN network, a CNN network, and the like.
[0065] Based on the first feature extraction model, feature extraction is performed on the vectorized sentence to obtain a first feature extraction result. Specifically, the vectorized sentence is input into the first feature extraction model, feature extraction is performed on the vectorized sentence to obtain a first feature extraction matrix, and the first feature extraction matrix is used as the first feature extraction result.
[0066] Step S122, based on the first fully connected network and the second fully connected network, respectively fully connect the first feature extraction result to obtain a first sentence vector and a second sentence vector;
[0067] In this embodiment, based on the first fully connected network and the second fully connected network, the first feature extraction result is fully connected respectively to obtain a first sentence vector and a second sentence vector. Specifically, the first feature extraction matrix is input into the first fully connected network, the first feature extraction matrix is fully connected to obtain a first sentence vector, and the first feature extraction matrix is input into the second fully connected network, the first feature extraction matrix is fully connected to obtain a second sentence vector. It should be noted that the first sentence vector includes at least a prefix vector, which is used to represent the representation vector of the dependent word in the dependency relationship, and the second sentence vector includes at least a suffix vector, which is used to represent the representation vector of the dependent word in the dependency relationship. For example, assuming that word A depends on word B, the word representation vector corresponding to word B is the prefix vector, and the word representation vector corresponding to word A is the suffix vector.
[0068] Step S123, based on the first double affine transformation network, performing double affine transformation on the first sentence vector and the second sentence vector to obtain a dependency score matrix;
[0069] In this embodiment, based on the first double affine transformation network, the first sentence vector and the second sentence vector are subjected to double affine transformation to obtain a dependency score matrix. Specifically, the first sentence vector and the second sentence vector are input into the first double affine transformation network, and the first sentence vector and the second sentence vector are subjected to double affine transformation to calculate the probability score that there is a dependency relationship between each prefix vector in the first sentence vector and each suffix vector in the second sentence vector, so as to obtain the dependency score matrix, wherein the dependency score matrix is a score matrix composed of the probability scores that there is a dependency relationship between each prefix vector and each suffix vector.
[0070] Step S124: determining the dependency determination result based on the dependency score matrix.
[0071] In this embodiment, based on the dependency score matrix, the dependency judgment result is determined, specifically based on the preset maximum spanning tree algorithm, the maximum probability score and the maximum probability score that meet the preset score selection condition are selected in the dependency score matrix, and the dependency vector composed of the vectorized words corresponding to the dependency relationship corresponding to the maximum probability score and the corresponding target probability scores is used as the dependency judgment result, wherein the preset score selection condition includes a one-to-one correspondence between the words to be analyzed corresponding to each target probability score and the words to be analyzed in the sentence to be analyzed, etc. For example, assuming that each of the target probability scores is A and B, wherein the target probability score A represents the probability score of word b attached to word a, the target probability score B represents the probability score of word c attached to word b, and the vectorized word corresponding to word a is vector X, the vectorized word corresponding to word b is vector Y, and the vectorized word corresponding to word c is vector Z, and then the dependency vector is a vector (X, 1, 0, 0, 1, Y, 1, 0, 0, 1, Z), wherein (1, 0, 0, 1) indicates that there is a dependency relationship between words.
[0072] Step S13: Based on a preset dependency type prediction model and the dependency identification result, a dependency type prediction is performed on the vectorized statement to obtain a dependency type prediction result.
[0073] In this embodiment, it should be noted that the preset dependency syntax model includes a preset dependency relationship type prediction model, wherein the preset dependency relationship type prediction model is a machine learning model for predicting the dependency relationship type between words in the sentence to be parsed.
[0074] Based on the preset dependency type prediction model and the dependency discrimination result, the dependency type prediction is performed on the vectorized sentence to obtain a dependency type prediction result. Specifically, based on the preset dependency type prediction model, the dependency type prediction is performed on the vectorized sentence to obtain a dependency type probability score matrix, wherein it should be noted that there is a dependency type probability score vector on each bit in the dependency type probability score matrix, wherein the value on each bit of the dependency type probability score vector is the probability score of the preset dependency type. For example, assuming that the dependency type probability score vector is (A, B, C), and the first bit of the dependency type probability score vector corresponds to the subject-predicate relationship, and the second bit corresponds to the verb-object relationship. , the third position corresponds to a parallel relationship, then A is the probability score that the dependency relationship between the two words corresponding to the dependency relationship type probability score vector is a subject-predicate relationship, B is the probability score that the dependency relationship between the two words corresponding to the dependency relationship type probability score vector is a verb-object relationship, and A is the probability score that the dependency relationship between the two words corresponding to the dependency relationship type probability score vector is a subject-predicate relationship, and then based on the dependency discrimination result, each target dependency relationship type probability score vector is selected in the dependency relationship type probability score matrix, and then the dependency relationship type corresponding to the maximum value in each target dependency relationship type probability score vector is used as the target dependency relationship type, and then the dependency relationship type between the words of the sentence to be analyzed is obtained, that is, the dependency relationship type prediction result is obtained.
[0075] Wherein, the dependency relationship determination result includes a dependency relationship vector,
[0076] The step of performing dependency type prediction on the vectorized statement based on the preset dependency type prediction model and the dependency discrimination result to obtain the dependency type prediction result comprises:
[0077] Step S131, based on the preset dependency type prediction model, predict the dependency type of the vectorized sentence to obtain a dependency type probability score matrix;
[0078] In this embodiment, it should be noted that the preset dependency type prediction model includes a second feature extraction model, a third fully connected network, a fourth fully connected network and a second dual affine transformation network.
[0079] Based on the preset dependency type prediction model, the dependency type of the vectorized sentence is predicted to obtain a dependency type probability score matrix. Specifically, the vectorized sentence is input into a second feature extraction model, and feature extraction is performed on the vectorized sentence to obtain a second feature extraction matrix. The second feature extraction matrix is respectively input into a third fully connected network and a fourth fully connected network to obtain a third sentence vector and a fourth sentence vector corresponding to the second feature extraction matrix. The third sentence vector and the fourth sentence vector are input into a second double affine transformation network, and double affine transformation is performed on the third sentence vector and the fourth sentence vector to obtain the dependency type probability score matrix.
[0080] Step S132: fusing the dependency type probability score matrix and the dependency vector to obtain the dependency type prediction result.
[0081] In this embodiment, the dependency type probability score matrix and the dependency vector are fused to obtain the dependency type prediction result. Specifically, based on a preset fusion rule, each dependency type probability score vector in the dependency type probability score matrix is fused with the dependency vector to obtain a dependency type probability vector corresponding to each dependency type probability score vector, wherein the preset fusion rule includes weighted averaging, splicing, summing, etc., and the value on each bit of the dependency type probability vector is the probability of a preset dependency type, and the preset dependency types include subject-predicate relationship type, verb-object relationship type, and parallel relationship type, etc., and then the dependency type probability vectors are respectively calculated in each of the dependency types. The maximum probability value in the type probability vector is selected as the target dependency type probability, and then the dependency type corresponding to each maximum dependency type probability that meets the preset probability selection condition is determined among each of the target dependency type probabilities, and the dependency type corresponding to each maximum dependency type probability is used as the dependency type prediction result, wherein the preset probability selection condition includes a one-to-one correspondence between the words to be analyzed corresponding to each selected maximum dependency type probability and each word to be analyzed in the sentence to be analyzed. For example, assuming that the sentence to be analyzed is ABC, the preset probability selection condition is that the number of selected maximum dependency type probabilities is 2, and the words to be analyzed corresponding to each maximum dependency type probability can constitute the sentence to be analyzed ABC.
[0082] Step S14: determining the word component information based on the dependency type prediction result.
[0083] In this embodiment, the word component information is determined based on the dependency type prediction result. Specifically, based on the dependency type between words in the sentence to be analyzed, the word component of each word to be analyzed in the sentence to be analyzed is determined to obtain the word component information. For example, assuming that the sentence to be analyzed is ABC, wherein the dependency type between word A and word B is a subject-predicate relationship type, and the dependency type between word B and word C is a verb-object relationship type, then it can be determined that the sentence pattern of the sentence to be analyzed is a subject-predicate sentence pattern, the word component corresponding to word A is the subject, the word component corresponding to word B is the predicate, and the word component corresponding to word C is the object.
[0084] The present implementation provides a dependency syntactic analysis method based on machine learning. First, the sentence to be analyzed is vectorized to obtain a vectorized sentence. Then, based on a preset dependency discrimination model, dependency discrimination is performed on the vectorized sentence to obtain a dependency discrimination result, thereby achieving the purpose of determining whether there is a dependency relationship between words in the sentence to be analyzed. Then, based on a preset dependency type prediction model and the dependency discrimination result, dependency type prediction is performed on the vectorized sentence to obtain a dependency type prediction result, thereby achieving the purpose of predicting the dependency type between words in the sentence to be analyzed. Moreover, since the dependency type is predicted based on the predicted relationship discrimination result, it avoids the problem of various types of dependencies between words when the probability of the existence of a dependency relationship between words is extremely low. The probability of a preset dependency relationship of the type is high, which improves the accuracy of dependency type prediction, and further improves the accuracy of dependency syntactic analysis. Based on the dependency type prediction result, the word component information of the word to be analyzed can be determined, and based on the word component information, the sentence to be analyzed can be targeted for data enhancement, which can ensure that the semantics of the sentence after data enhancement will not change, and further ensure that the semantics of the sentence after data enhancement matches the label of the sentence to be analyzed, which overcomes the technical defect of the prior art of performing random data enhancement by randomly deleting, randomly exchanging and randomly replacing words in the collected original sentences, which will highly likely cause the semantics of the sentence after data enhancement to change, and further leads to poor data enhancement effect, thereby laying a foundation for improving the effect of data enhancement.
[0085] Further, refer to Figure 3 Based on the first and second embodiments of the present application, in another embodiment of the present application, the dependency syntax-based data enhancement method further includes:
[0086] Step A10, obtaining training data and a dependency syntactic model to be trained, wherein the training data includes training sentences and preset dependency type labels corresponding to the training sentences;
[0087] In this embodiment, it should be noted that the preset dependency type label is an identifier of the dependency relationship type between words in the pre-labeled training sentence, and the dependency syntactic model to be trained is an untrained dependency syntactic model.
[0088] Acquire training data and a dependency syntactic model to be trained, wherein the training data includes training sentences and preset dependency type labels corresponding to the training sentences. Specifically, acquire a labeled dependency syntactic analysis data set and a dependency syntactic model to be trained, collect the dependency syntactic analysis data set, and manually annotate the dependency syntactic analysis data set to obtain a manually annotated dependency syntactic analysis data set, and then merge the annotated dependency syntactic analysis data set and the manually annotated dependency syntactic analysis data set to obtain a training data set, so as to expand the number of training samples corresponding to the dependency syntactic model to be trained.
[0089] Step A20, inputting the training data into the dependency syntax model to be trained to perform dependency syntax analysis on the training sentence to obtain a type training prediction label;
[0090] In this embodiment, it should be noted that the training data at least includes a training sentence.
[0091] The training data is input into the dependency syntax model to be trained to perform dependency syntax analysis on the training sentences to obtain type training prediction labels. Specifically, based on the vectorization network in the dependency syntax model to be trained, the training sentences are vectorized to obtain vectorized training sentences. Then, based on the preset dependency discrimination model in the dependency syntax model to be trained, dependency discrimination is performed on the vectorized training sentences to obtain training dependency vectors. Then, based on the preset dependency type prediction model in the dependency syntax model to be trained, dependency type prediction is performed on the vectorized training sentences to obtain a training dependency type probability score matrix. Then, the training dependency vector and the training dependency type probability score matrix are combined to determine a type training prediction label, wherein the type training prediction label is an identifier of the dependency type corresponding to the training sentence.
[0092] Step A30, calculating a dependency syntax model error based on the type training prediction label and the preset dependency type label;
[0093] In this embodiment, based on the type training prediction label and the preset dependency type label, the dependency syntax model error is calculated. Specifically, the distance between the type training prediction label and the preset dependency type label is calculated to obtain the dependency syntax model error.
[0094] Step A40: Based on the dependency syntax model error, the dependency syntax model to be trained is updated until the dependency syntax model to be trained meets a preset update end condition, thereby obtaining a preset dependency syntax model.
[0095] In this embodiment, based on the dependency syntax model error, the dependency syntax model to be trained is updated until the dependency syntax model to be trained meets a preset update end condition, and a preset dependency syntax model is obtained. Specifically, based on the dependency syntax model error, gradient information is calculated, and the model parameters of the dependency syntax model to be trained are updated according to the gradient information by back propagation to obtain an updated dependency syntax model to be trained, and then it is determined whether the updated dependency syntax model to be trained meets the preset update end condition. If so, the updated dependency syntax model to be trained is used as the preset dependency syntax model. If not, the training sentences are re-acquired to re-train and update the model parameters of the updated dependency syntax model to be trained until the updated dependency syntax model to be trained meets the preset update end condition, wherein the preset update end condition includes reaching the maximum number of iterations and the convergence of the loss function.
[0096] Additionally, in one practicable manner, if Figure 4 The figure shows a flow chart of data enhancement for the sentence to be analyzed based on the preset dependency syntactic model, wherein it should be noted that the predicate and the parallel components of the predicate belong to the preset first word component classification, the attributive, adverbial, subject, auxiliary modifier, and object belong to the preset second word component classification, the operation of replacing synonyms with a certain probability or keeping unchanged corresponds to the first data enhancement operation set, the operation of replacing synonyms with a certain probability or deleting or keeping unchanged corresponds to the second data enhancement operation set, the operation of replacing synonyms with a certain probability or deleting or replacing with the same component word or keeping unchanged corresponds to the third data enhancement operation set, and the words to be analyzed that do not belong to the preset first word component classification and the preset second word component classification all belong to the preset third word component classification, and the data enhancement operations in the third data enhancement operation set are performed on them, and the judgment process of whether the data amount is sufficient is the judgment process of whether the number of data enhancement sentences meets the preset number threshold.
[0097] The present embodiment provides a training method for a preset dependency syntactic model, that is, obtaining training data and a dependency syntactic model to be trained, wherein the training data includes training sentences and preset dependency type labels corresponding to the training sentences, and then inputting the training data into the dependency syntactic model to be trained to perform dependency syntactic analysis on the training sentences to obtain type training prediction labels, and then calculating dependency syntactic model errors based on the type training prediction labels and the preset dependency type labels, and then updating the dependency syntactic model to be trained based on the dependency syntactic model errors until the dependency syntactic model to be trained meets the preset update end condition, and obtaining the preset dependency syntactic model, and then updating the dependency syntactic model based on the training data. The well-trained preset dependency syntactic model can be used to perform dependency syntactic analysis on the sentence to be analyzed to obtain the word component information corresponding to the sentence to be analyzed, and then based on the word component information, the sentence to be analyzed can be targetedly data enhanced, which can ensure that the semantics of the sentence after data enhancement will not change, and further ensure that the semantics of the sentence after data enhancement matches the label of the sentence to be analyzed, which overcomes the technical defect of the prior art of performing random data enhancement by randomly deleting, randomly exchanging and randomly replacing words in the collected original sentences, which will highly likely cause the semantics of the sentence after data enhancement to change, thereby resulting in poor data enhancement effect, and thus lays a foundation for improving the effect of data enhancement.
[0098] Reference Figure 5 , Figure 5 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present application.
[0099] like Figure 5 As shown, the data enhancement device based on dependency syntax may include: a processor 1001, such as a CPU, a memory 1005, and a communication bus 1002. The communication bus 1002 is used to realize the connection and communication between the processor 1001 and the memory 1005. The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may optionally be a storage device independent of the aforementioned processor 1001.
[0100] Optionally, the data enhancement device based on dependency syntax may also include a rectangular user interface, a network interface, a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, etc. The rectangular user interface may include a display screen (Display), an input submodule such as a keyboard (Keyboard), and the optional rectangular user interface may also include a standard wired interface and a wireless interface. The network interface may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).
[0101] Those skilled in the art will understand that Figure 5 The structure of the dependency syntax-based data enhancement device shown in the figure does not constitute a limitation on the dependency syntax-based data enhancement device, and may include more or less components than shown in the figure, or a combination of certain components, or a different arrangement of components.
[0102] like Figure 5 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, and a data enhancement program based on dependency syntax. The operating system is a program that manages and controls the hardware and software resources of the data enhancement device based on dependency syntax, and supports the operation of the data enhancement program based on dependency syntax and other software and / or programs. The network communication module is used to realize the communication between the components inside the memory 1005, and the communication with other hardware and software in the data enhancement system based on dependency syntax.
[0103] exist Figure 5 In the dependency syntax-based data enhancement device shown, the processor 1001 is used to execute the dependency syntax-based data enhancement program stored in the memory 1005 to implement the steps of any of the dependency syntax-based data enhancement methods described above.
[0104] The specific implementation of the data enhancement device based on dependency syntax in the present application is basically the same as the above-mentioned embodiments of the data enhancement method based on dependency syntax, and will not be repeated here.
[0105] The embodiment of the present application further provides a data enhancement device based on dependency syntax, wherein the data enhancement device based on dependency syntax is applied to a data enhancement device based on dependency syntax, and the data enhancement device based on dependency syntax includes:
[0106] A dependency syntactic analysis module, used to obtain a sentence to be analyzed, and perform dependency syntactic analysis on the sentence to be analyzed to obtain word component information corresponding to the sentence to be analyzed;
[0107] The data enhancement module is used to perform data enhancement on the sentence to be analyzed based on the word component information to obtain a data enhancement result.
[0108] Optionally, the data enhancement module includes:
[0109] A first determining unit, configured to determine a word component type corresponding to each of the words to be analyzed based on the word component information;
[0110] The data enhancement unit is used to perform data enhancement on the sentence to be analyzed based on each of the word component types to obtain a data enhancement result.
[0111] Optionally, the data enhancement unit includes:
[0112] A first determination subunit is used to select a word to be data enhanced from each of the words to be analyzed, and determine a target word component type corresponding to the word to be data enhanced from each word component type;
[0113] A selection subunit, configured to select a target data enhancement operation from a data enhancement operation set corresponding to the preset target component type based on the word component type attribution of the target word component type;
[0114] The data enhancement subunit is used to perform the target data enhancement operation on the words to be data enhanced in the sentence to be analyzed to obtain the data enhancement result.
[0115] Optionally, the dependency syntax analysis module includes:
[0116] A vectorization unit, used for vectorizing the statement to be analyzed to obtain a vectorized statement;
[0117] A dependency determination unit, configured to perform dependency determination on the vectorized sentence based on a preset dependency determination model to obtain a dependency determination result;
[0118] A dependency type prediction unit, configured to perform 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;
[0119] The second determining unit is used to determine the word component information based on the dependency relationship type prediction result.
[0120] Optionally, the dependency determination unit includes:
[0121] a feature extraction subunit, configured to perform feature extraction on the vectorized sentence based on the first feature extraction model to obtain a first feature extraction result;
[0122] A fully connected subunit, configured to fully connect the first feature extraction result based on the first fully connected network and the second fully connected network, respectively, to obtain a first sentence vector and a second sentence vector;
[0123] A double affine transformation subunit, configured to perform a double affine transformation on the first sentence vector and the second sentence vector based on the first double affine transformation network to obtain a dependency score matrix;
[0124] The second determining subunit is used to determine the dependency judgment result based on the dependency score matrix.
[0125] Optionally, the dependency type prediction unit includes:
[0126] A dependency type prediction subunit, configured to perform dependency type prediction on the vectorized sentence based on the preset dependency type prediction model to obtain a dependency type probability score matrix;
[0127] The fusion subunit is used to fuse the dependency type probability score matrix and the dependency vector to obtain the dependency type prediction result.
[0128] Optionally, the vectorization unit includes:
[0129] An acquisition subunit, used to acquire a word vector to be analyzed, a corresponding part-of-speech vector to be analyzed, and a corresponding word position vector to be analyzed corresponding to the word to be analyzed;
[0130] A generating subunit is used to generate 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.
[0131] Optionally, the dependency syntax-based data enhancement device further includes:
[0132] An acquisition module, used to acquire training data and a dependency syntactic model to be trained, wherein the training data includes training sentences and preset dependency type labels corresponding to the training sentences;
[0133] A training module, used for inputting the training sentence 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;
[0134] An error calculation module, used to calculate a dependency syntax model error based on the type training prediction label and the preset dependency type label;
[0135] An updating module is used to update 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 update end condition, thereby obtaining a preset dependency syntax model.
[0136] The specific implementation of the data enhancement device based on dependency syntax in the present application is basically the same as the above-mentioned embodiments of the data enhancement method based on dependency syntax, and will not be repeated here.
[0137] An embodiment of the present application provides a readable storage medium, and the readable storage medium stores one or more programs, and the one or more programs can also be executed by one or more processors to implement the steps of any of the dependency syntax-based data enhancement methods described above.
[0138] The specific implementation of the readable storage medium of the present application is basically the same as the above-mentioned embodiments of the data enhancement method based on dependency syntax, and will not be repeated here.
[0139] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent processing scope of the present application.
Claims
1. A data enhancement method based on dependency syntax, characterized in that: The data enhancement method based on dependency syntax includes: Acquire a sentence to be analyzed, and perform dependency syntactic analysis on the sentence to be analyzed to obtain word component information corresponding to the sentence to be analyzed; Based on the word component information, data enhancement is performed on the sentence to be analyzed to obtain a data enhancement result; The sentence to be analyzed includes at least one word to be analyzed. The step of performing data enhancement on the sentence to be analyzed based on the word component information to obtain a data enhancement result comprises: Based on the word component information, determining the word component type corresponding to each of the words to be analyzed; Based on each of the word component types, data enhancement is performed on the sentence to be analyzed to obtain a data enhancement result; Specifically, it includes: selecting a word to be enhanced from each of the words to be analyzed, and determining a target word component type corresponding to the word to be enhanced from each word component type; Based on the word component type attribution of the target word component type, a target data enhancement operation is selected from the data enhancement operation set corresponding to the target component type, wherein the word component type attribution includes a preset first word component classification, a preset second word component classification, and a preset third word component classification, the preset first word component classification includes a predicate and a parallel component of the predicate, the preset second word component classification includes an attributive, an adverbial, a subject, a conjunctive, and an object, and the preset third word component classification includes words to be analyzed that do not belong to the preset first word component classification and the preset second word component classification; Performing the target data enhancement operation on the words to be data enhanced in the sentence to be analyzed to obtain the data enhancement result; The step of selecting a target data enhancement operation from the data enhancement operation set corresponding to the target component type comprises: If the target word component type belongs to a preset first word component classification, then in a first data enhancement operation set corresponding to the preset first word component classification, a synonym replacement operation is selected with a first selection probability, and a keep unchanged operation is selected with a second selection probability; If the target word component type belongs to the preset second word component classification, then in the second data enhancement operation set corresponding to the preset first word component classification, a deletion operation is selected with a third selection probability, a synonym replacement operation is selected with a fourth selection probability, and a keep unchanged operation is selected with a fifth selection probability; If the target word component type belongs to the preset third word component classification, then in the third data enhancement operation set corresponding to the preset first word component classification, the synonym replacement operation is selected with the sixth selection probability, the unchanged operation is selected with the seventh selection probability, the random exchange operation of the same type of words in the sentence is selected with the eighth selection probability, and the deletion operation is selected with the ninth selection probability.
2. The method for data enhancement based on dependency syntax as claimed in claim 1, characterized in that: The step of performing dependency syntactic analysis on the sentence to be analyzed to obtain word component information corresponding to the sentence to be analyzed includes: Vectorizing the statement to be analyzed to obtain a vectorized statement; Based on a preset dependency determination model, performing dependency determination on the vectorized sentence to obtain a dependency determination result; Based on a preset dependency type prediction model and the dependency identification result, predict the dependency type of the vectorized statement to obtain a dependency type prediction result; The word component information is determined based on the dependency type prediction result.
3. The data enhancement method based on dependency syntax as claimed in claim 2, characterized in that: The preset dependency relationship discrimination model includes a first feature extraction model, a first fully connected network, a second fully connected network and a first dual affine transformation network. The step of performing dependency determination on the vectorized sentence based on a preset dependency determination model to obtain a dependency determination result includes: Based on the first feature extraction model, perform feature extraction on the vectorized sentence to obtain a first feature extraction result; Based on the first fully connected network and the second fully connected network, fully connect the first feature extraction result respectively to obtain a first sentence vector and a second sentence vector; Based on the first double affine transformation network, performing double affine transformation on the first sentence vector and the second sentence vector to obtain a dependency score matrix; Based on the dependency score matrix, the dependency determination result is determined.
4. The method for data enhancement based on dependency syntax as claimed in claim 2, characterized in that: The dependency determination result includes a dependency vector, The step of performing dependency type prediction on the vectorized statement based on the preset dependency type prediction model and the dependency discrimination result to obtain the dependency type prediction result comprises: Based on the preset dependency type prediction model, predict the dependency type of the vectorized sentence to obtain a dependency type probability score matrix; The dependency type probability score matrix and the dependency vector are fused to obtain the dependency type prediction result.
5. The data enhancement method based on dependency syntax as claimed in claim 2, characterized in that: The sentence to be analyzed includes at least one word to be analyzed, and the vectorized sentence includes at least one vectorized word. The step of vectorizing the statement to be analyzed to obtain a vectorized statement comprises: Obtain a word vector to be analyzed, a corresponding part-of-speech vector to be analyzed, and a corresponding word position vector to be analyzed corresponding to the word to be analyzed; 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.
6. The method for data enhancement based on dependency syntax as claimed in claim 1, characterized in that: The data enhancement method based on dependency syntax also includes: Acquire training data and a dependency syntactic model to be trained, wherein the training data includes training sentences and preset dependency type labels corresponding to the training sentences; Inputting the training sentence into the dependency syntax model to be trained to perform dependency syntax analysis on the training sentence to obtain a type training prediction label; Calculating a dependency syntactic model error based on the type training prediction label and the preset dependency type label; Based on the dependency syntactic model error, the dependency syntactic model to be trained is updated until the dependency syntactic model to be trained meets a preset update end condition, thereby obtaining a preset dependency syntactic model.
7. A data enhancement device based on dependency syntax, characterized in that: The data enhancement device based on dependency syntax includes: a memory, a processor, and a program stored in the memory for implementing the data enhancement method based on dependency syntax, The memory is used to store a program for implementing a data enhancement method based on dependency syntax; The processor is used to execute a program for implementing the dependency syntax-based data enhancement method to implement the steps of the dependency syntax-based data enhancement method as described in any one of claims 1 to 6.
8. A readable storage medium, characterized in that: The readable storage medium stores a program for implementing a data enhancement method based on dependency syntax, and the program for implementing a data enhancement method based on dependency syntax is executed by a processor to implement the steps of the data enhancement method based on dependency syntax as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Text classification method, terminal equipment and computer readable storage medium
CN111309920A