Radar text processing method and related device
Through the radar text processing model, combining part of speech and context characteristics, the problem of low accuracy in radar text classification processing in traditional methods is solved, and higher word classification accuracy and key information recognition capabilities are achieved.
Patent Information
- Application Number
- CN202410710370.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-03
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2044-06-03
AI Technical Summary
The correlation between words is not considered in traditional radar text processing methods, resulting in low accuracy of classification processing.
The radar text processing model is adopted, combining word part-of-speech and context features, and the radar text is processed through text preprocessing, semantic feature extraction, part-of-speech feature extraction, attention mechanism and classification module to improve the accuracy of word classification.
By combining part of speech and contextual characteristics, the accuracy of word classification processing in radar text is significantly improved, and the ability to identify key information in radar text is enhanced.
Smart Images

Figure CN119128574A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical fields of data processing and artificial intelligence, and specifically to a radar text processing method and related devices. Background Art
[0002] In modern warfare, electronic warfare plays a very important role. With the continuous progress and development of the times, it has gradually evolved from an initial means of support to a very important combat force. Many scientific research units and experts have focused on informatization and refined management, and have continuously proposed high-tech means to assist in the development of work. The use of systematic big data analysis systems to judge battlefield information has been widely used.
[0003] In terms of processing radar text, the traditional method usually uses the keyword label matching method to classify the words in the radar text. However, since the correlation between words is not taken into account during the classification process, the accuracy of classifying the words in the radar text is low. Summary of the invention
[0004] The embodiment of the present application provides a radar text processing method and related devices, which improves the accuracy of classifying words in radar text by adopting a radar text processing model combined with word parts of speech and context features for classification processing.
[0005] A first aspect of an embodiment of the present application provides a radar text processing method, which is applied to a radar text processing model, wherein the radar text processing model includes a text preprocessing module, a semantic feature extraction sub-model, a part-of-speech feature extraction sub-model, an attention mechanism module, and a classification module, and the method includes:
[0006] The radar text to be processed is processed by the text preprocessing module to obtain a first word vector set;
[0007] Performing contextual semantic feature extraction on each word vector in the first word vector set according to the word order of the radar text to be processed through a semantic feature extraction sub-model to obtain a first semantic feature set;
[0008] Perform word feature extraction on each word vector in the first word vector set by using the part-of-speech feature extraction sub-model to obtain a first part-of-speech feature set;
[0009] The attention mechanism module performs importance weighting processing on the first part-of-speech feature set and the corresponding semantic features in the first semantic feature set to obtain a second part-of-speech feature set;
[0010] The second part-of-speech features in the second part-of-speech feature set are concatenated with the first word vector set according to the word order of the radar text to be processed by a text preprocessing module to obtain a second word vector set;
[0011] Performing contextual semantic feature extraction on the second word vector set through a semantic feature extraction sub-model to obtain a second semantic feature set;
[0012] The second semantic feature set is subjected to label classification processing by a classification module to obtain a classification label corresponding to each first word vector in the first word vector set.
[0013] In this example, the radar text processing model is used to classify the words in the radar text to be processed in combination with word parts of speech and context features, thereby improving the accuracy of classifying the words in the radar text.
[0014] A second aspect of an embodiment of the present application provides a radar text processing model, the radar text processing model comprising a text preprocessing module, a semantic feature extraction sub-model, a part-of-speech feature extraction sub-model, an attention mechanism module and a classification module, wherein:
[0015] The text preprocessing module is used to process the radar text to be processed to obtain a first word vector set;
[0016] A semantic feature extraction sub-model, used for performing contextual semantic feature extraction on each word vector in the first word vector set according to the word order of the radar text to be processed, to obtain a first semantic feature set;
[0017] The part-of-speech feature extraction sub-model is used to extract word features from each word vector in the first word vector set to obtain a first part-of-speech feature set;
[0018] The attention mechanism module is used to perform importance weighting processing on the first part-of-speech feature set and the corresponding semantic features in the first semantic feature set to obtain a second part-of-speech feature set;
[0019] A text preprocessing module, configured to concatenate the second part-of-speech features in the second part-of-speech feature set with the first word vector set according to the word order of the radar text to be processed, so as to obtain a second word vector set;
[0020] A semantic feature extraction sub-model, used for extracting contextual semantic features from the second word vector set to obtain a second semantic feature set;
[0021] A classification module is used to perform label classification processing on the second semantic feature set to obtain a classification label corresponding to each first word vector in the first word vector set.
[0022] A third aspect of an embodiment of the present application provides a terminal, comprising a processor, an input device, an output device and a memory, wherein the processor, input device, output device and memory are interconnected, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the step instructions in the first aspect of the embodiment of the present application.
[0023] The fourth aspect of the embodiments of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the steps described in the first aspect of the embodiments of the present application.
[0024] A fifth aspect of the embodiments of the present application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute some or all of the steps described in the first aspect of the embodiments of the present application. The computer program product may be a software installation package. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] 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, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0026] Figure 1 A schematic diagram of a radar text processing model is provided for an embodiment of the present application;
[0027] Figure 2 A schematic flow chart of a radar text processing method is provided for an embodiment of the present application;
[0028] Figure 3 A schematic diagram of the structure of a terminal provided in an embodiment of the present application;
[0029] Figure 4 A structural schematic diagram of a radar text processing model is provided for an embodiment of the present application. DETAILED DESCRIPTION
[0030] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0031] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.
[0032] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments.
[0033] In order to better understand the service product determination method provided by the embodiment of the present application, the following first briefly introduces the scenario of applying the radar text processing method. The radar text to be processed in the embodiment of the present application can be a description text of the radar, or a data text of the radar, or a parameter text of the radar, etc. For example, the radar text to be processed can be "The AN / APG-90 radar currently in service in the United States is an important air defense system developed by Raytheon and installed on the F-16 combat platform. It is widely used in various military equipment. Its time characteristic is long-term validity, and the pulse width is 0.983us. Its repetition interval is 0.00531, the system is a Doppler pulse, and the frequency is I. It has become an important choice for many military equipment with its excellent performance and advanced technology. Its spatial characteristics are regional activity laws. "This is only an example and is not specifically limited.
[0034] After extracting the radar text, it is necessary to classify the words in the radar text, and then perform key information recognition and other processing on the classified words again to extract the core information in the radar text.
[0035] In terms of processing radar text, the traditional method is usually to classify the words in the radar text by matching the keywords. The classification process does not take into account the correlation between words, resulting in low accuracy in classifying the words in the radar text. In order to solve the above problem, the embodiment of the present application provides a radar text processing method, which improves the accuracy of classifying the words in the radar text by using a radar text processing model combined with word parts of speech and context features.
[0036] The following is a brief introduction to the radar text processing model that applies the radar text processing method. Figure 1 As shown in the figure, the radar text processing model includes a text preprocessing module, a semantic feature extraction sub-model, a part-of-speech feature extraction sub-model, an attention mechanism module and a classification module, among which:
[0037] The text preprocessing module can process the radar text to be processed to obtain the first word vector set. When processing the radar text to be processed, the radar text to be processed of the original unstructured data can be processed by sentence segmentation to obtain the sentences and words of the radar text to be processed; and then the vocabulary and part-of-speech composition in each sentence are further obtained. For the obtained words, the pre-trained model is used to encode the obtained words to obtain the word vector of the word. For the part of speech, the corresponding vector expression is obtained by random encoding. Therefore, each first word vector in the first word vector set includes the word vector and part-of-speech vector of the word.
[0038] The semantic feature extraction sub-model may include a bidirectional multi-layer LSTM. Specifically, when the part-of-speech feature is fused with other features, it is necessary to explore the LSTM hidden layer vector h i The relationship between the first part-of-speech feature set P, at this time h i It is necessary to be able to fully express the contextual information of the word in the sentence. After integrating the part-of-speech features, it is necessary to obtain the semantic expression of the word with the part-of-speech features during the learning process. Therefore, the traditional bidirectional LSTM is not applicable, and a layer of reverse LSTM needs to be added for learning. And because the part-of-speech features are related to each input of the forward LSTM, the two need to be performed alternately.
[0039] The multi-layer bidirectional LSTM model first passes through a reverse LSTM (b_1), whose input is the initialization vector set S, to obtain its hidden layer vector set. Construct a forward LSTM (f_1), whose input is the word vector q after incorporating part-of-speech features i , and obtain its hidden layer vector set. Concatenate the hidden layer vector sets of LSTM(b_1) and LSTM(f_1) to get set H. The hidden layer vector h in set H is iRepresents the context information of the i-th word in the sentence.
[0040] Since the fusion of part-of-speech features requires the previous hidden layer vector. Therefore, when inputting the first word vector, it is necessary to initialize a zero vector with the same dimension as the part-of-speech feature and concatenate it with the initialized word vector s1. After completing the forward LSTM, a new backward LSTM (b_2) needs to be established to learn the following information after the part-of-speech features are integrated. Take out the hidden layer vectors of the forward LSTM (f_1) and the backward LSTM (b_2) after the part-of-speech is integrated, and concatenate the two. The concatenated vector is set O, which is used as the input of the subsequent fully connected layer.
[0041] In the LSTM loop calculation process, the impact of invalid words on model learning also needs to be considered. The number of words read in at one time is fixed, so some sentences have blank words. In the learning process, a matrix Mask is needed. Mask sets the position of words with practical meaning to 1 and blank words to 0. In the process of network learning, by blocking blank words, the network can effectively prevent learning a large number of invalid features.
[0042] In addition, in the forward LSTM (f_1), the last hidden layer of the bidirectional RNN is concatenated as the hidden vector of the LSTM (f_1) input. The last hidden layer vector contains the initial understanding of the sentence in terms of part of speech, which can be used as external information to help subsequent learning. The fusion of part of speech features is to combine the part of speech features with the initial word vector s i+1 To perform fusion, we need to use the weight matrix Score obtained from the attention mechanism to multiply the vectors in the P set, add the multiplied vectors, and then add them to s i+1 Concatenate to get the new input q i+1 , as shown in the following formula.
[0043]
[0044] The part-of-speech feature extraction sub-model can be obtained by training the initial bidirectional RNN network model using corresponding samples. In specific use, the hidden layer vector set of the part-of-speech feature extraction sub-model can be used as the first part-of-speech feature set P.
[0045] The attention mechanism module performs importance-weighted processing on the first part-of-speech feature set and the corresponding semantic features in the first semantic feature set to obtain a second part-of-speech feature set.
[0046] The core function of the attention mechanism module is to selectively focus on input features in order to more effectively capture key information in the data. In this radar text processing application, the attention mechanism module dynamically adjusts its processing focus on information by calculating the interaction strength between different features, namely the attention weight. Specifically, the attention mechanism module receives the first part-of-speech feature set and the first semantic feature set as input, and uses a multi-head self-attention structure to evaluate the relevance and importance of each feature.
[0047] The attention mechanism module maps the input features to a high-dimensional space through a linear transformation layer to capture more complex feature relationships. At this stage, each input feature vector x is processed by a linear transformation W1x+b, where W1 is the weight matrix and b is the bias term.
[0048] Use the dot product attention mechanism to calculate the weight matrix between all features. In the dot product attention mechanism, the dot product of feature vectors is used to measure the similarity between them, and these similarities are normalized by a softmax function to calculate the final attention weight. Specifically, the attention weight can be determined by the method shown in the following formula:
[0049]
[0050] Attention(x i ,x j ) is the attention weight, W2 is a learnable parameter matrix specially designed for dot product attention, x i is the i-th element that needs to determine the attention weight, x j is the jth element that needs to determine the attention weight, x k is the kth element that needs to determine the attention weight. Therefore, the above method can strengthen the influence of important features while suppressing relatively unimportant information.
[0051] The obtained weight matrix is then used to weight the input features and generate a weighted feature representation, which concentrates on the most critical semantic and part-of-speech information in the current text processing task. Specifically, the weighted output feature is the sum of the products of the input features and their corresponding attention weights:
[0052]
[0053] Among them, z i is the parameter output by the weighted operation, x i is the i-th element that needs to determine the attention weight, x j is the jth element that needs to determine the attention weight.
[0054] In addition, residual connections and layer normalization steps are introduced to enhance the training stability of the model and accelerate convergence. Residual connections allow the original input features to be directly passed to the output layer, which helps to avoid training problems in deep networks. Layer normalization normalizes the output of each feature to ensure that the model output has a similar distribution at different training stages.
[0055] The classification module performs label classification processing on the second semantic feature set to obtain a classification label corresponding to each first word vector in the first word vector set.
[0056] See also Figure 2 , Figure 2 A schematic diagram of a radar text processing method is provided for an embodiment of the present application. Figure 2 As shown, the method is applied to a radar text processing model, which includes a text preprocessing module, a semantic feature extraction sub-model, a part-of-speech feature extraction sub-model, an attention mechanism module and a classification module. The radar text processing method includes:
[0057] S201. Process the radar text to be processed by the text preprocessing module to obtain a first word vector set.
[0058] Among them, the text preprocessing module can be to process the radar text to be processed to obtain the first word vector set. When processing the radar text to be processed, the radar text to be processed of the original unstructured data can be processed by sentence segmentation and word segmentation to obtain the sentences and words of the radar text to be processed; and then further obtain the vocabulary and part-of-speech composition in each sentence. For the obtained words, the pre-trained model is used to encode the obtained words to obtain the word vector of the word. For the part of speech, the corresponding vector expression is obtained by random encoding. Therefore, each first word vector in the first word vector set includes the word vector and part-of-speech vector of the word. The first word vector set S includes s1, s2, s3, ..., s n Among them, s i Represents the first word vector of the i-th word in the sentence.
[0059] S202. Perform contextual semantic feature extraction on each word vector in the first word vector set according to the word order of the radar text to be processed through a semantic feature extraction sub-model to obtain a first semantic feature set.
[0060] Each word vector in the first word vector set S can be operated through a multi-layer bidirectional LSTM model, and the vector corresponding to the hidden layer of the multi-layer bidirectional LSTM model is determined as the first semantic feature corresponding to the first word vector, thereby obtaining a first semantic feature set H, and the first semantic feature set H includes h1, h2, h3, ..., hn hi is the i-th first semantic feature, and the first semantic feature includes the word morphological features and the contextual semantic features of the word in the context of the sentence.
[0061] S203. Perform word feature extraction on each word vector in the first word vector set through the part-of-speech feature extraction sub-model to obtain a first part-of-speech feature set.
[0062] The part-of-speech feature extraction sub-model can be obtained by training the initial bidirectional RNN network model using corresponding samples. In specific use, the hidden layer vector set of the part-of-speech feature extraction sub-model can be used as the first part-of-speech feature set P.
[0063] The part-of-speech feature extraction sub-model can obtain the part-of-speech of each word in the corresponding radar text sentence.
[0064] S204. Perform importance-weighted processing on the first part-of-speech feature set and the corresponding semantic features in the first semantic feature set through the attention mechanism module to obtain a second part-of-speech feature set.
[0065] The relationship weight between the first part-of-speech feature set and the first semantic feature set can be obtained to obtain a first weight matrix, and then the first weight matrix and the first part-of-speech feature set are fused to obtain a second part-of-speech feature set.
[0066] When the first weight matrix is obtained, since the dimension of the first semantic feature in the first semantic feature set is different from the dimension of the first part-of-speech feature, the first semantic feature needs to be dimensionally processed so that the dimension of the second semantic feature obtained after processing is the same as the dimension of the first part-of-speech feature. By introducing the attention mechanism, the first part-of-speech feature and the corresponding first semantic feature are weighted to obtain the second part-of-speech feature, thereby improving the accuracy of subsequent processing.
[0067] S205. Concatenate the second part-of-speech features in the second part-of-speech feature set and the first word vector set according to the word order of the radar text to be processed through a text preprocessing module to obtain a second word vector set.
[0068] Among them, the method of splicing the second part-of-speech feature in the second part-of-speech feature set and the first word vector set according to the word order of the radar text to be processed can be: splicing the second part-of-speech feature with the word vector after the corresponding first word vector to obtain a second word vector.
[0069] For example, the second part-of-speech feature of the i-th part is represented by p i , the corresponding first word vector of the i-th word is s i , then p is used i With si+1 Concatenate to get the i-th second word vector.
[0070] S206. Perform context semantic feature extraction on the second word vector set through a semantic feature extraction sub-model to obtain a second semantic feature set.
[0071] The second word vector set is input into the semantic feature extraction sub-model for operation, and the hidden layer output of the semantic feature extraction sub-model is determined as an element in the second semantic feature set. The second semantic feature set can be specifically represented as O, and the second semantic feature set includes o1, o2, o3, ..., o n .
[0072] S207. Perform label classification processing on the second semantic feature set through a classification module to obtain a classification label corresponding to each first word vector in the first word vector set.
[0073] Among them, the elements in the second semantic feature set can be mapped to the label dimension to obtain the label distribution probability of each second semantic feature, and then the label distribution probability of each second semantic feature is subjected to label short-distance transfer to obtain the classification label corresponding to each second semantic feature, and finally the classification label corresponding to each second semantic feature is determined as the classification label corresponding to the corresponding first word vector, so that the classification label corresponding to the first word vector can be obtained.
[0074] The radar emitter and the different characteristics surrounding the radar emitter are described from three dimensions: radar system level, combat platform level, and radar emitter level, and the radar emitter and its surrounding characteristics are comprehensively described. These three levels are closely connected on the basis of being relatively independent of each other, forming a comprehensive and organic knowledge network, which is used to define the classification labels.
[0075] The specific entity relationship labels at the three levels are defined as shown in Table 1.
[0076] Radar radiation source level: Considering the characteristics of the radar itself and the project background, entity tags such as radar model, function, research and development unit, country, radar system, frequency, repetition interval, pulse width, etc. are defined; relationship tags such as purpose, developed in, affiliated to, radar system, frequency, repetition interval, pulse width, installed in, time characteristics, and space characteristics are defined.
[0077] Combat platform level: Considering the characteristics of the platform itself and the project background, the combat platform is divided into sea-based ships and air-based fighters. Entity tags such as platform model, radar model, manufacturer and country are specifically defined; relationship tags such as carrying, installation, purpose, belonging to and combat system are defined.
[0078] At the combat system level: considering the characteristics of the system itself and the project background, two types of entity tags, system name and platform model, are defined; relationship tags such as coordinated operations, intelligence support, and combat command are defined.
[0079] Table 1 Radar radiation source knowledge graph entity and relationship label definition table
[0080]
[0081]
[0082] After obtaining the entity tags and entity relationship tags, the entity tag set can also be expanded. Specifically, it can be:
[0083] According to the given key entity and relationship labels, entities containing the above keyword labels are expanded from the general knowledge graph to join the seed concept set, and then the association evaluation index PMI is used to confirm whether to join the seed concept set. Specifically, the method shown in the following formula can be used to determine whether the candidate concept d is added to the seed concept set:
[0084] R(d,C)=max{concept d,l ,l∈C}
[0085]
[0086] Where R(d, c) represents the semantic relevance between the candidate concept d and the seed concept set c. d,l is the relevance of concept d relative to seed concept l, P(d|l) is the co-occurrence probability between the candidate concept and the seed concept. PMI stands for point mutual information, which is used to measure the relevance between the candidate concept and the seed concept.
[0087] When the PMI is greater than the preset threshold, the candidate concept d is added to the seed concept set c. The seed concept set can be understood as an existing concept set, for example, the entity set corresponding to the radar radiation source. The candidate concept can be an entity extended from the general knowledge graph containing the above keyword tags.
[0088] Based on the above entity relationship label definition, the following triples are designed to represent the radar radiation source knowledge graph, as shown in Table 2.
[0089] In addition to the relatively independent three-level triples in the radar radiation source knowledge graph, the three levels are connected through the two triples of radar and platform <platform model, equipped, radar> and platform and system <system name, including, platform model>. Thus, type labels can be formed.
[0090] Table 3-2 Radar radiation source knowledge graph triple instance table
[0091]
[0092]
[0093]
[0094] In a possible implementation, the method of performing importance weighting processing on the first part-of-speech feature set and the corresponding semantic features in the first semantic feature set through the attention mechanism module to obtain the second part-of-speech feature set includes:
[0095] A1. Obtaining the relationship weights between the first part-of-speech feature set and the corresponding semantic features in the first semantic feature set through the attention mechanism module to obtain a first weight matrix;
[0096] A2. The first weight matrix and the first part-of-speech feature set are fused through the attention mechanism module to obtain the second part-of-speech feature set.
[0097] The first weight in the first weight matrix indicates the importance of the part of speech in affecting its semantic expression. The first weight matrix can be represented as Score. The first part of speech feature set can be represented as P.
[0098] The weight matrix Score can be multiplied by the first part-of-speech feature set P and then added to perform fusion processing to obtain a second part-of-speech feature set. The second part-of-speech feature in the second part-of-speech feature set can represent the part-of-speech context feature of the word in the context of the play.
[0099] Therefore, the first part-of-speech feature set can be processed by means of relationship weights to obtain a second part-of-speech feature set, thereby improving the accuracy of subsequent processing.
[0100] In a possible implementation, the method of obtaining the relationship weights between the first part-of-speech feature set and the corresponding semantic features in the first semantic feature set through the attention mechanism module to obtain a first weight matrix includes:
[0101] B1. Transforming the dimensions of the semantic features in the first semantic feature set by the attention mechanism module to obtain a second semantic feature set, wherein the dimensions of the second semantic features are the same as the dimensions of the first part-of-speech features in the first part-of-speech feature set;
[0102] B2. Concatenating the first part-of-speech feature in the first part-of-speech feature set with the corresponding second semantic feature through the attention mechanism module to obtain a first concatenated feature set;
[0103] B3, performing vectorization processing on the splicing features in the first splicing feature set through the attention mechanism module to obtain a splicing feature matrix;
[0104] B4, multiplying the initialization parameter matrix by the splicing feature matrix through the attention mechanism module to obtain a reference weight matrix;
[0105] B5. Normalize the reference weight matrix through the attention mechanism module to obtain the first weight matrix.
[0106] Among them, an important first weight matrix Score is required in the part-of-speech attention mechanism. The first weight matrix is used to indicate the influence on semantic understanding. Because the dimensions of hi and P do not match, hi needs to be transformed in dimension, and then the transformed hi and P are spliced. The spliced vector is mapped by a fully connected layer and becomes a vector with the same dimension as the first part-of-speech feature set P. The first spliced feature obtained after linear mapping is input into the activation function to obtain the spliced feature matrix. Here, the tanh function is used as the activation function. The initialization parameter matrix is used as the parameter for calculating the weight matrix, and multiplied with the spliced feature matrix to obtain the reference weight matrix. The reference weight matrix can express the influence of different parts of speech on semantics to a certain extent. The reference weight matrix is normalized to between 0 and 1 after the softmax function, and the first weight matrix Score is obtained at this time.
[0107] In a possible implementation, the method further includes:
[0108] C1. Use the Mask matrix to mark the blank words in the sample data to obtain the marked sample data;
[0109] C2. Using the labeled sample data to train the initial model to obtain the semantic feature extraction sub-model.
[0110] The semantic feature extraction sub-model can be a multi-layer bidirectional LSTM model. Figure 1 As shown in the figure, the semantic feature extraction sub-model first passes through a reverse LSTM (b_1), whose input is the initialization vector set S, to obtain its hidden layer vector set. Construct a forward LSTM (f_1), whose input is the word vector q after incorporating part-of-speech features i , and obtain its hidden layer vector set. Concatenate the hidden layer vector sets of LSTM(b_1) and LSTM(f_1) to get set H. The hidden layer vector h in set H is i Represents the context information of the i-th word in the sentence.
[0111] Since the fusion of part-of-speech features requires the previous hidden layer vector. Therefore, when inputting the first word vector, it is necessary to initialize a zero vector with the same dimension as the part-of-speech feature and concatenate it with the initialized word vector s1. After completing the forward LSTM, a new backward LSTM (b_2) needs to be established to learn the following information after the part-of-speech features are integrated. Take out the hidden layer vectors of the forward LSTM (f_1) and the backward LSTM (b_2) after the part-of-speech is integrated, and concatenate the two. The concatenated vector is set O, which is used as the input of the subsequent fully connected layer.
[0112] In the LSTM loop calculation process, the impact of invalid words on model learning also needs to be considered. The number of words read in at one time is fixed, so some sentences have blank words. In the learning process, a Mask matrix is needed. The Mask matrix sets the position of words with actual meaning to 1 and blank words to 0. In the process of learning the semantic feature extraction sub-model, the shielding of blank words can effectively prevent the semantic feature extraction sub-model from learning a large number of invalid features.
[0113] In addition, in the forward LSTM (f_1), the last hidden layer of the bidirectional RNN is concatenated as the hidden vector of the LSTM (f_1) input. The last hidden layer vector contains the initial understanding of the sentence in terms of part of speech, which can be used as external information to help subsequent learning. The fusion of part of speech features is to combine the part of speech features with the initial word vector s i+1 To perform fusion, we need to use the weight matrix Score obtained from the attention mechanism to multiply the vectors in the P set, add the multiplied vectors, and then add them to s i+1 Concatenate to get the new input q i+1 , as shown in the following formula.
[0114]
[0115] In a possible implementation, performing label classification processing on the second semantic feature set by a classification module to obtain a classification label corresponding to each first word vector in the first word vector set includes:
[0116] D1. Mapping the second semantic features in the second semantic feature set to a label dimension through a classification module to obtain a label distribution probability of each second semantic feature;
[0117] D2, perform label close-range transfer on the label distribution probability of each second semantic feature through the classification module to obtain the classification label corresponding to each second semantic feature;
[0118] D3. Determine the classification label corresponding to each second semantic feature as the classification label corresponding to the corresponding first word vector through the classification module.
[0119] Among them, when performing feature mapping, the classification module can map the second semantic feature to the label dimension through two fully connected layers to obtain the label distribution probability of each second semantic feature. The classification module inputs the label distribution probability of each second semantic feature into the CRF layer, and the CRF layer constrains the label short-distance transfer method to obtain the classification label corresponding to each second semantic feature.
[0120] For the above embodiments, please refer to Figure 3 , Figure 3 A schematic diagram of the structure of a terminal provided in an embodiment of the present application, as shown in the figure, includes a processor, an input device, an output device and a memory, the processor, the input device, the output device and the memory are interconnected, wherein the memory is used to store a computer program, the computer program includes program instructions, the processor is configured to call the program instructions, and the program includes instructions for executing the following steps;
[0121] The radar text to be processed is processed by the text preprocessing module to obtain a first word vector set;
[0122] Performing contextual semantic feature extraction on each word vector in the first word vector set according to the word order of the radar text to be processed through a semantic feature extraction sub-model to obtain a first semantic feature set;
[0123] Perform word feature extraction on each word vector in the first word vector set by using the part-of-speech feature extraction sub-model to obtain a first part-of-speech feature set;
[0124] The attention mechanism module performs importance weighting processing on the first part-of-speech feature set and the corresponding semantic features in the first semantic feature set to obtain a second part-of-speech feature set;
[0125] The second part-of-speech features in the second part-of-speech feature set are concatenated with the first word vector set according to the word order of the radar text to be processed by a text preprocessing module to obtain a second word vector set;
[0126] Performing contextual semantic feature extraction on the second word vector set through a semantic feature extraction sub-model to obtain a second semantic feature set;
[0127] The second semantic feature set is subjected to label classification processing by a classification module to obtain a classification label corresponding to each first word vector in the first word vector set.
[0128] The above mainly introduces the scheme of the embodiment of the present application from the perspective of the execution process on the method side. It is understandable that in order to realize the above functions, the terminal includes a hardware structure and / or software module corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments provided herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0129] The embodiment of the present application can divide the terminal into functional units according to the above method example. For example, each functional unit can be divided according to each function, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units. It should be noted that the division of units in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0130] In line with the above, see Figure 4 , Figure 4 A schematic diagram of the structure of a radar text processing model is provided for the embodiment of the present application. Figure 4 As shown, the radar text processing model includes a text preprocessing module 401, a semantic feature extraction sub-model 402, a part-of-speech feature extraction sub-model 403, an attention mechanism module 404 and a classification module 405, wherein:
[0131] The text preprocessing module 401 is used to process the radar text to be processed to obtain a first word vector set;
[0132] The semantic feature extraction sub-model 402 is used to extract contextual semantic features from each word vector in the first word vector set according to the word order of the radar text to be processed, so as to obtain a first semantic feature set;
[0133] The part-of-speech feature extraction sub-model 403 is used to extract word features from each word vector in the first word vector set to obtain a first part-of-speech feature set;
[0134] The attention mechanism module 404 is used to perform importance weighting processing on the first part-of-speech feature set and the corresponding semantic features in the first semantic feature set to obtain a second part-of-speech feature set;
[0135] The text preprocessing module 401 is used to concatenate the second part-of-speech features in the second part-of-speech feature set with the first word vector set according to the word order of the radar text to be processed, so as to obtain a second word vector set;
[0136] A semantic feature extraction sub-model 402 is used to extract contextual semantic features from the second word vector set to obtain a second semantic feature set;
[0137] The classification module 405 is used to perform label classification processing on the second semantic feature set to obtain a classification label corresponding to each first word vector in the first word vector set.
[0138] In one possible implementation, the attention mechanism module 404 is specifically used to:
[0139] Obtaining the relationship weights between the first part-of-speech feature set and the corresponding semantic features in the first semantic feature set to obtain a first weight matrix;
[0140] The first weight matrix is fused with the first part-of-speech feature set to obtain the second part-of-speech feature set.
[0141] In a possible implementation, in obtaining the relationship weights between the first part-of-speech feature set and the corresponding semantic features in the first semantic feature set to obtain the first weight matrix, the attention mechanism module 404 is specifically used to:
[0142] Performing dimension transformation on the semantic features in the first semantic feature set to obtain a second semantic feature set, wherein the dimension of the second semantic feature is the same as the dimension of the first part-of-speech feature in the first part-of-speech feature set;
[0143] Concatenate the first part-of-speech feature in the first part-of-speech feature set with the corresponding second semantic feature to obtain a first concatenated feature set;
[0144] Performing vectorization processing on the splicing features in the first splicing feature set to obtain a splicing feature matrix;
[0145] Multiplying the initialization parameter matrix by the concatenated feature matrix to obtain a reference weight matrix;
[0146] The reference weight matrix is normalized to obtain the first weight matrix.
[0147] In a possible implementation, the model is also used to:
[0148] The blank words in the sample data are marked by the Mask matrix to obtain the marked sample data;
[0149] The labeled sample data is used to train the initial model to obtain the semantic feature extraction sub-model.
[0150] In a possible implementation, the classification module 405 is specifically used to:
[0151] Mapping the second semantic features in the second semantic feature set to a label dimension to obtain a label distribution probability of each second semantic feature;
[0152] Perform label close-range transfer on the label distribution probability of each second semantic feature to obtain the classification label corresponding to each second semantic feature;
[0153] The classification label corresponding to each second semantic feature is determined as the classification label corresponding to the corresponding first word vector.
[0154] An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, and the computer program enables a computer to execute part or all of the steps of any radar text processing method recorded in the above method embodiments.
[0155] An embodiment of the present application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program enables a computer to execute part or all of the steps of any radar text processing method recorded in the above method embodiments.
[0156] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0157] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0158] In the several embodiments provided in the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the device or unit can be electrical or other forms.
[0159] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0160] In addition, the functional units in the various embodiments of the application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware or in the form of software program modules.
[0161] If the integrated unit is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a memory, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM), random access memory (RAM), mobile hard disk, disk or optical disk and other media that can store program codes.
[0162] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable memory, which can include: a flash drive, a read-only memory, a random access memory, a magnetic disk or an optical disk, etc.
[0163] The embodiments of the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of the present application. At the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A radar text processing method, characterized in that: The method is applied to a radar text processing model, which includes a text preprocessing module, a semantic feature extraction sub-model, a part-of-speech feature extraction sub-model, an attention mechanism module and a classification module. The method includes: The radar text to be processed is processed by the text preprocessing module to obtain a first word vector set; Performing contextual semantic feature extraction on each word vector in the first word vector set according to the word order of the radar text to be processed through a semantic feature extraction sub-model to obtain a first semantic feature set; Perform word feature extraction on each word vector in the first word vector set by using the part-of-speech feature extraction sub-model to obtain a first part-of-speech feature set; The attention mechanism module performs importance weighting processing on the first part-of-speech feature set and the corresponding semantic features in the first semantic feature set to obtain a second part-of-speech feature set; The second part-of-speech features in the second part-of-speech feature set are concatenated with the first word vector set according to the word order of the radar text to be processed by a text preprocessing module to obtain a second word vector set; Performing contextual semantic feature extraction on the second word vector set through a semantic feature extraction sub-model to obtain a second semantic feature set; The second semantic feature set is subjected to label classification processing by a classification module to obtain a classification label corresponding to each first word vector in the first word vector set.
2. The radar text processing method according to claim 1, characterized in that: The step of performing importance weighted processing on the first part-of-speech feature set and the semantic features corresponding to the first semantic feature set by the attention mechanism module to obtain a second part-of-speech feature set includes: Obtaining, by the attention mechanism module, the relationship weights between the first part-of-speech feature set and the corresponding semantic features in the first semantic feature set, to obtain a first weight matrix; The first weight matrix and the first part-of-speech feature set are fused through the attention mechanism module to obtain the second part-of-speech feature set.
3. The radar text processing method according to claim 2, characterized in that: The step of obtaining the relationship weights between the first part-of-speech feature set and the corresponding semantic features in the first semantic feature set through the attention mechanism module to obtain a first weight matrix includes: Performing dimension transformation on the semantic features in the first semantic feature set by the attention mechanism module to obtain a second semantic feature set, wherein the dimension of the second semantic feature is the same as the dimension of the first part-of-speech feature in the first part-of-speech feature set; The first part-of-speech feature in the first part-of-speech feature set is concatenated with the corresponding second semantic feature by the attention mechanism module to obtain a first concatenated feature set; Vectorizing the splicing features in the first splicing feature set by the attention mechanism module to obtain a splicing feature matrix; The initialization parameter matrix is multiplied by the concatenated feature matrix through the attention mechanism module to obtain a reference weight matrix; The reference weight matrix is normalized by the attention mechanism module to obtain the first weight matrix.
4. The radar text processing method according to any one of claims 1 to 3, characterized in that: The method further comprises: The blank words in the sample data are marked by the Mask matrix to obtain the marked sample data; The labeled sample data is used to train the initial model to obtain the semantic feature extraction sub-model.
5. The radar text processing method according to claim 4, characterized in that: The step of performing label classification processing on the second semantic feature set by the classification module to obtain a classification label corresponding to each first word vector in the first word vector set includes: Mapping the second semantic features in the second semantic feature set to a label dimension through a classification module to obtain a label distribution probability of each second semantic feature; The label distribution probability of each second semantic feature is transferred to a close distance through a classification module to obtain a classification label corresponding to each second semantic feature; The classification label corresponding to each second semantic feature is determined as the classification label corresponding to the corresponding first word vector through the classification module.
6. A radar text processing model, comprising a text preprocessing module, a semantic feature extraction sub-model, a part-of-speech feature extraction sub-model, an attention mechanism module and a classification module, wherein: The text preprocessing module is used to process the radar text to be processed to obtain a first word vector set; A semantic feature extraction sub-model, used for performing contextual semantic feature extraction on each word vector in the first word vector set according to the word order of the radar text to be processed, to obtain a first semantic feature set; The part-of-speech feature extraction sub-model is used to extract word features from each word vector in the first word vector set to obtain a first part-of-speech feature set; The attention mechanism module is used to perform importance weighting processing on the first part-of-speech feature set and the corresponding semantic features in the first semantic feature set to obtain a second part-of-speech feature set; A text preprocessing module, configured to concatenate the second part-of-speech features in the second part-of-speech feature set with the first word vector set according to the word order of the radar text to be processed, so as to obtain a second word vector set; A semantic feature extraction sub-model, used for extracting contextual semantic features from the second word vector set to obtain a second semantic feature set; A classification module is used to perform label classification processing on the second semantic feature set to obtain a classification label corresponding to each first word vector in the first word vector set.
7. The radar text processing model according to claim 6, characterized in that: The attention mechanism module is specifically used for: Obtaining the relationship weights between the first part-of-speech feature set and the corresponding semantic features in the first semantic feature set to obtain a first weight matrix; The first weight matrix is fused with the first part-of-speech feature set to obtain the second part-of-speech feature set.
8. The radar text processing model according to claim 7, characterized in that: In terms of obtaining the relationship weights between the first part-of-speech feature set and the corresponding semantic features in the first semantic feature set to obtain a first weight matrix, the attention mechanism module is specifically used to: Performing dimension transformation on the semantic features in the first semantic feature set to obtain a second semantic feature set, wherein the dimension of the second semantic feature is the same as the dimension of the first part-of-speech feature in the first part-of-speech feature set; Concatenate the first part-of-speech feature in the first part-of-speech feature set with the corresponding second semantic feature to obtain a first concatenated feature set; Performing vectorization processing on the splicing features in the first splicing feature set to obtain a splicing feature matrix; Multiplying the initialization parameter matrix by the concatenated feature matrix to obtain a reference weight matrix; The reference weight matrix is normalized to obtain the first weight matrix.
9. A terminal, characterized in that: The method comprises a processor, an input device, an output device and a memory, wherein the processor, the input device, the output device and the memory are interconnected, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the method according to any one of claims 1 to 5.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Part-of-speech and self-attention mechanism fused sentiment tendency classification method and system
CN110569508A
Chinese electronic medical record named entity recognition method and system based on attention mechanism
CN110866401A
Text sentiment classification method and system
CN111881291A
Text-based entity recognition method and related device
CN111950287A
Multi-input LSTM_CNN text classification method and system based on word attention mechanism
CN112507114A
Cited By
Knowledge graph generation method based on large language model
CN120258117A
