Sequence labeling method and device based on deep conversion architecture
The deep conversion architecture enhanced by global information solves the problems of shallow hidden layer state conversion process and insufficient global information in the existing technology, and achieves higher sequence labeling accuracy and application performance.
Patent Information
- Application Number
- CN201910486896.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-06-05
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2039-06-11
AI Technical Summary
Existing sequence annotation models have a shallow state transition process in adjacent hidden layers in language sequences, making it difficult to extract rich linguistic features, and the position of each word does not adequately represent global information, resulting in low prediction accuracy.
A method based on deep transformation architecture with global information enhancement is adopted to perform deep transformation encoding and information aggregation by reading the embedded representation of the language sequence, obtain the global word embedding representation, enhance the state transition process of the recurrent neural network, and strengthen the gating through linear transformation A deep transformation recurrent network composed of recurrent units and transformation gated recurrent units is used for encoding.
It improves the prediction accuracy of sequence annotation, can more accurately identify named entities, syntax blocks and other information, and optimizes the performance of related application systems.
Smart Images

Figure CN110196967B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of sequence labeling, and in particular to a sequence labeling method and device based on a deep conversion architecture. Background Art
[0002] Sequence labeling is the basic work of natural language processing and also a challenging problem in natural language processing. It mainly includes part-of-speech tagging, named entity recognition, etc. For example, the main task of named entity recognition is to identify proper nouns such as names of people, places, and organizations, and meaningful time and date phrases in the text. The sequence labeling task is an important part of information extraction, and its effect has a great impact on machine translation, intelligent dialogue systems, etc.
[0003] At present, the main models of sequence tagging are divided into traditional machine learning models and neural network models. In recent years, compared with traditional machine learning models, neural network models have achieved better results in sequence tagging tasks. Huang et al.'s "Bidirectional LSTM-CRF Models for Sequence Tagging" first applied the bidirectional long short-term memory LSTM network to sequence tagging tasks. With the assistance of a small number of artificial features, the network's effect far exceeds that of traditional machine learning models. Since then, the idea of adding new character-level features or language model features to the bidirectional LSTM architecture has emerged. For example, Lample proposed using LSTM to extract character-level morphological features. This work "Neural Architectures for Named Entity Recognition" was published in NAACL-2016. Peter proposed using neural language models as additional word embedding representations. This work "Semi-supervised sequence tagging with bidirectional language models" was published in ACL-2017.
[0004] However, in the above-mentioned prior art, the transition process between adjacent hidden layer states is shallow and insufficient to extract rich linguistic features. In addition, the prior art does not adequately represent the global information of the position of each word in the language sequence, making it difficult to make accurate predictions for the current word. Summary of the invention
[0005] In view of this, the present disclosure provides a sequence labeling method and device based on deep conversion with global information enhancement.
[0006] According to a first aspect of the present disclosure, a method for language sequence labeling is provided. The method comprises: reading a first embedding representation of a language sequence, the first embedding representation of the language sequence comprising a character-level word embedding representation, a pre-trained word embedding representation and a global word embedding representation. The first embedding representation of the read language sequence is subjected to a first deep conversion encoding to obtain a set of hidden layer states; and the set of hidden layer states is decoded to obtain a labeling result of the language sequence. The global word embedding representation is a global context representation for the language sequence obtained by pre-encoding calculation. In some embodiments, the global word embedding representation is obtained by the following steps: reading a second embedding representation of the language sequence, the second embedding representation of the language sequence comprising a character-level embedding representation and a pre-trained word embedding representation. The second embedding representation of the read language sequence is subjected to a second deep conversion encoding and information aggregation to obtain a global word embedding representation.
[0007] In some embodiments, performing the first deep transform encoding includes: performing the first deep transform encoding on the read language sequence embedding representation in both forward and reverse directions respectively.
[0008] In some embodiments, performing the first depth conversion encoding in both the forward and reverse directions includes: concatenating the depth conversion encoding results in the forward and reverse directions.
[0009] In some embodiments, performing the first deep transform encoding includes: performing the first deep transform encoding through a deep transform recurrent network consisting of a linear transformation reinforced gated recurrent unit L-GRU and a transformation gated recurrent unit T-GRU.
[0010] In some embodiments, performing the second deep conversion encoding includes: performing deep conversion encoding on the read language sequence embedding representation in both forward and reverse directions respectively.
[0011] In some embodiments, performing the second depth conversion encoding in both the forward and reverse directions includes: concatenating the depth conversion encoding results in the forward and reverse directions.
[0012] In some embodiments, performing the second deep transform encoding includes: performing the second deep transform encoding through a deep transform recurrent network composed of a linear transformation enhanced gated recurrent unit L-GRU and a transformation gated recurrent unit T-GRU.
[0013] In some embodiments, information aggregation may be average pooling or maximum pooling.
[0014] According to a second aspect of the present disclosure, a device for language sequence labeling is provided. The device includes a sequence labeling encoder and a sequence labeling decoder. The sequence labeling encoder includes a first reading module and a first deep conversion module. The first reading module is configured to read a first embedding representation of a language sequence. The first embedding representation of the language sequence includes a character-level word embedding representation, a pre-trained word embedding representation, and a global word embedding representation. The first deep conversion module is configured to perform a first deep conversion encoding on the read first embedding representation of the language sequence to obtain a set of hidden layer states. The sequence labeling decoder is configured to decode the set of hidden layer states to obtain a labeling result of the language sequence. The global word embedding representation is a global context representation for the language sequence obtained by pre-encoding calculation.
[0015] In some embodiments, the device also includes a global information encoder, which is used to obtain a global word embedding representation. The global information encoder includes a second reading module, a second deep conversion module and an information aggregation module. The second reading module is configured to read a second embedding representation of a language sequence, and the second embedding representation of the language sequence includes a character-level embedding representation and a pre-trained word embedding representation. The second deep conversion module and the information aggregation module are configured to perform a second deep conversion encoding and information aggregation on the second embedding representation of the read language sequence to obtain a global word embedding representation.
[0016] In some embodiments, the first deep conversion module performing the first deep conversion encoding includes: performing the first deep conversion encoding on the read language sequence embedding representation in both forward and reverse directions.
[0017] In some embodiments, performing the first depth conversion encoding in both the forward and reverse directions includes: concatenating the depth conversion encoding results in the forward and reverse directions.
[0018] In some embodiments, the first deep conversion module includes a deep conversion recurrent network consisting of a linear transformation enhancement gated recurrent unit L-GRU and a transformation gated recurrent unit T-GRU for performing the first deep conversion encoding.
[0019] In some embodiments, the second deep conversion module and the information aggregation module perform the second deep conversion encoding including: performing the second deep conversion encoding on the read language sequence embedding representation in both the forward direction and the reverse direction respectively.
[0020] In some embodiments, performing the second depth conversion encoding in both the forward and reverse directions includes: concatenating the depth conversion encoding results in the forward and reverse directions.
[0021] In some embodiments, the second deep conversion module and the information aggregation module include a deep conversion recurrent network consisting of a linear transformation enhancement gated recurrent unit L-GRU and a conversion gated recurrent unit T-GRU for performing second deep conversion encoding.
[0022] In some embodiments, information aggregation may be average pooling or maximum pooling.
[0023] According to a third aspect of the present disclosure, a computing device is provided. The computing device includes a memory and a processor. The memory is configured to store computer executable instructions. The processor is configured to execute any of the methods described above when the computer executable instructions are executed by the processor.
[0024] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, which stores computer-executable instructions. When the computer-executable instructions are executed, any of the methods described above is executed.
[0025] The sequence tagging method and device based on the deep conversion architecture enhanced by global information provided by the present disclosure deepens the conversion process between adjacent states of the recurrent neural network. At the same time, the local information of each word is enhanced through the global information encoder, a more comprehensive feature representation is obtained, and the accuracy of the prediction is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Embodiments of the present disclosure will now be described in more detail and with reference to the accompanying drawings, in which:
[0027] Figure 1 A schematic diagram of an application scenario in which sequence labeling is used as an underlying technology according to an embodiment of the present disclosure is shown;
[0028] Figure 2 A schematic diagram of an application scenario in which sequence labeling is used as an underlying technology according to another embodiment of the present disclosure is shown;
[0029] Figure 3 A schematic diagram of an encoder-decoder architecture for sequence labeling in the prior art is shown;
[0030] Figure 4 A sequence annotation architecture diagram based on deep conversion with global information enhancement according to an embodiment of the present disclosure is shown;
[0031] Figure 5 A flowchart of a method for language sequence tagging according to an embodiment of the present disclosure is schematically shown;
[0032] Figure 6 A flowchart of a method for language sequence tagging according to another embodiment of the present disclosure is schematically shown;
[0033] Figure 7A schematic diagram of a device for language sequence tagging according to an embodiment of the present disclosure is schematically shown;
[0034] Figure 8 A schematic diagram schematically shows a device for language sequence tagging according to another embodiment of the present disclosure;
[0035] Fig. 9 An example system is illustrated that includes an example computing device that represents one or more systems and / or devices that may implement the various techniques described herein. DETAILED DESCRIPTION
[0036] The following description provides specific details for fully understanding and implementing various embodiments of the present disclosure. It should be understood by those skilled in the art that the technical solutions of the present disclosure can be implemented without some of these details. In some cases, some well-known structures and functions are not shown or described in detail to avoid unnecessarily obscuring the description of the embodiments of the present disclosure. The terms used in the present disclosure are understood in their broadest reasonable manner, even if they are used in conjunction with specific embodiments of the present disclosure.
[0037] First, some terms involved in the embodiments of the present disclosure are explained to facilitate understanding by those skilled in the art:
[0038] Deep Transformation (DT): A neural network structure that uses multi-level nonlinear recurrent units to increase the processing depth between multiple adjacent time steps.
[0039] Named Entity Recognition (NER): refers to the identification of entities with specific meanings in text, including names of people, places, institutions, proper nouns, etc. Named entity recognition is an important basic tool in application fields such as information extraction, question-answering systems, syntactic analysis, and machine translation.
[0040] Recurrent Neural Network (RNN): A type of recurrent neural network that takes sequence data as input, recursively in the direction of sequence evolution, and all nodes (recurrent units) are connected in a chain.
[0041] Long Short-Term Memory (LSTM): A time-recurrent neural network that is suitable for processing and predicting events with relatively long intervals and delays in time series.
[0042] Gated recurrent unit GRU: It is a variant of LSTM. GRU maintains the effect of LSTM and has a simpler structure, which is very helpful for the vanishing gradient in RNN. The hidden layer state at time t is calculated as follows: where ⊙ is the element-wise product. Candidate activation and passed Calculate, where W is the network parameter to be learned, x tis the input encoding vector at time t, r t is the reset gate. t and update the gate z t The calculation is as follows:
[0043] r t =σ(W xr x t +W hr h t-1 ) (1)
[0044] z t =σ(W xz x t +W hz h t-1 ) (2).
[0045] Transformation Gated Recurrent Unit T-GRU: T-GRU is a type of gated recurrent unit that does not appear in the first layer of a deep transformation network and therefore does not have the input encoding vector x like GRU. t , the hidden layer state at time t is calculated as follows:
[0046]
[0047] Reset gate r t and update the gate z t The calculation is as follows:
[0048] r t =σ(W hr h t-1 ) (5)
[0049] z t =σ(W hz h t-1 ) (6)
[0050] Among them, W is the network parameter to be learned.
[0051] Linear transformation enhanced gated recurrent unit L-GRU: L-GRU is a type of gated recurrent unit, and its hidden layer state at time t is calculated as follows:
[0052]
[0053] Among them, candidate activation The calculation is as follows:
[0054]
[0055] Reset gate r t , update gate z tSame as above equations (1) and (2), linear transformation gate l t The calculation of is as follows:
[0056] l t =σ(W xl x t +W hl h t-1 ) (9).
[0057] Figure 1 and Figure 2 The following diagrams illustrate two application scenarios of sequence labeling as its underlying technology. Sequence labeling is usually used as a low-level processing application to solve problems such as Chinese word segmentation, part-of-speech tagging, and named entity recognition. The sequence labeling task is an important part of information extraction, which can be specifically applied to machine translation, intelligent dialogue systems, etc. Figure 1 The figure schematically shows an application scenario of an intelligent dialogue system in which the present disclosure can be applied as an underlying technology, and specifically shows a human-computer interaction interface. In this interaction interface, the user can input a language sequence consisting of voice or text. The machine can understand the user's intention, such as what the user's question is, by performing sequence annotation analysis on the language sequence input by the user in the background, such as "Where is the bathroom?". By providing corresponding replies to user questions by the machine, such as "On the second, third, and fourth floors of the mall", an intelligent dialogue between the machine and the user can be achieved. As understood by those skilled in the art, the present disclosure can also be applied to a variety of other scenarios where language sequences need to be analyzed.
[0058] Sequence labeling is used to label linear input sequences, such as the sequence X = x 1 ,x 2 ,…x n Each element in is added with a label set Y=y 1 ,y 2 ,…y n A label in the sequence. The essence of sequence labeling is to classify each element in the linear sequence. For example, for the input language sequence: Einstein was born in Germany. In the part-of-speech analysis task, the elements are labeled with part-of-speech labels, and the output results are: Einstein [noun], born [verb], in [preposition], Germany [noun]. In the entity recognition task, the named entities are labeled, and the output results are Einstein [name], Germany [organization name].
[0059] Figure 2 The present disclosure is schematically shown as a machine translation application scenario in which the underlying technology can be applied, and a human-computer interaction interface is specifically shown. In this interface, the language sequence entered in the left box can be translated into the language sequence in the right box using the background service provided by the technology provider. For example Figure 2 In the example, if the Chinese text "I will go to Beijing tomorrow" is input on the left, then after processing such as sequence annotation as one of the underlying technologies, "I'm going to Beijing tomorrow" is output in the right box. The sequence annotation processing in the present invention can be used as an underlying application to analyze and process the input language in the background.
[0060] In sequence labeling tasks, the core architecture is the encoder-decoder scheme. The encoder processes variable-length input and creates a fixed-length vector representation. The decoder generates a variable-length sequence (target sequence) based on the encoded representation. Figure 3 A schematic diagram of the encoder-decoder architecture for sequence tagging is shown in Figure 3 As shown in , taking part-of-speech analysis in sequence tagging as an example, the variable length input to the encoder is X = x 1 ,x 2 ,…x n , the encoded representation of the encoder output is [z 1 ,z 2 ,…z d ], the variable length sequence output by the decoder is Y=y 1 ,y 2 ,…y n .
[0061] Figure 4 The diagram shows a sequence annotation architecture diagram based on deep transformation with global information enhancement according to an embodiment of the present disclosure. The language sequence to be processed is x 1 ,x 2 ,…x n , each item x n Identify a word in the language sequence to be processed. Taking the bidirectional deep conversion of the language sequence as an example, the forward x 1 ,x 2 ,…x n and reverse x n ,x n-1 ,…x 1 The language sequence is deeply converted in order. Figure 4 The right-shaded squares in the figure indicate forward (left to right) depth conversion DT units, the left-shaded squares indicate backward (right to left) depth conversion units, the unshaded squares indicate unidirectional DT units, and the rounded squares indicate word embeddings.
[0062] The global information encoder 401 reads the character-level word embedding representation c 1 ,c 2 ,…c n and the pre-trained word embedding representation w 1 ,w 2 ,…wn The second embedding representation of the language sequence. The character-level word embedding representation c n and the pre-trained word embedding representation w n correspond to the sub-words x n in the input language sequence respectively. The character-level word embedding c n is a word vector learned at the character level and is obtained by performing convolutional processing on the sub-word x n at the character level. The pre-trained word vector is found by looking up in the pre-trained stored word vector table according to the sub-word x n . In one example, the pre-trained word vector representation of the text sequence "I am at home" means that: I = [0.5486464, 0.14654642, …, 0.4489789] is a 300-dimensional vector; similarly, "am" and "at home" are also 300-dimensional vectors respectively. For c n corresponding to the sub-word x n and w n , they are concatenated to form the second embedding representation of the language sequence. Then, the second embedding representation of the read language sequence is subjected to deep transformation encoding. In one embodiment, the deep transformation encoding is performed bidirectionally. In the network architecture of the deep transformation encoding, the deep transformation unit 4011 in the bottom layer uses an L-GRU unit, and the deep transformation units in the remaining layers use T-GRU units. In Figure 4 the example shown, the number of layers of the T-GRU unit used is 1. As can be understood by those skilled in the art, other numbers of layers of the T-GRU unit can also be used, typically 2 - 3 layers. The concatenation 4012 targets the results of the forward and reverse deep transformation processing for the same sub-word x n , and the global word embedding vector g is obtained by reducing the dimension through the information aggregation processing 4013. In one embodiment, the information aggregation processing may include average pooling, max pooling, or an attention mechanism.
[0063] The sequence labeling encoder 402 enhances the language sequence embedding representation by using the global word embedding vector g output by the global information encoder 401. Exemplarily, the sequence labeling encoder 402 reads the first embedding representation of the language sequence including the character-level word embedding representations c 1 , c 2 , … c n , the pre-trained word embedding representations w 1 , w 2 , … w n and the global word embedding vectors g, g, … g. The character-level word embedding representation c n and the pre-trained word embedding representation w n correspond to the sub-words x n in the input language sequence respectively. For c n corresponding to the sub-word xn 、w n and the global word embedding vector g are concatenated to form the first embedding representation of the language sequence. Specifically, consider a language sequence X with n words = {x 1 , x 2 , …, x n}, the sequence tagging encoder 402 of the present invention first connects three primary embedding c t , w t and g to capture each word representation x t =[c t ;w t ; g]. Character-level word embedding representation c t It is obtained based on the recurrent convolutional network (CNN). The pre-trained word embedding representation w t It is obtained by looking up from a lookup table, which is proposed by Glove. The global word embedding representation is a global context representation for a language sequence obtained by pre-encoding calculation. In one embodiment, the global word embedding representation g is extracted from a bidirectional deep transformation network DT.
[0064] The sequence tag encoder 402 then performs deep transformation encoding on the first embedded representation of the input language sequence. In one embodiment, the deep transformation encoding is performed bidirectionally. In the network architecture of the deep transformation encoding, the deep transformation unit in the bottom layer adopts the L-GRU unit, and the deep transformation units in the remaining layers adopt the T-GRU unit. Figure 4 In the example shown in , the number of T-GRU unit layers used is usually 2-5. As those skilled in the art will appreciate, other numbers of T-GRU units may also be used. Compared with the global information encoder 401, the number of L-GRU layers used by the sequence tag encoder 402 is 1. n The results of forward and reverse deep conversion processing obtain the abstract representation of the hidden layer state corresponding to each word.
[0065] The sequence labeling decoder 403 converts the hidden layer state h obtained by the sequence labeling encoder 402 into t and the label information y for the previous moment t-1 Decode and get a set of corresponding hidden layer states s t Next, the hidden layer state s is obtained t and the label information y at the previous moment t-1 Linear transformation and softmax operation are performed to obtain the label prediction result of each word. The sequence labeling decoder 403 adopts a unidirectional structure, and the structure of its recurrent neuron DT is similar to that of the recurrent neuron DT in the global information encoder 401 and the sequence labeling encoder 402. The first layer of the deep conversion neural network (see Figure 4 4031) in is L-GRU, and the remaining layers of the deep conversion neural network are T-GRU. Figure 4 In the example shown in , the number of T-GRU unit layers used by the sequence labeling decoder 403 is usually 2-5. As those skilled in the art will appreciate, T-GRU units of other numbers of layers may also be used.
[0066] Figure 5 The flowchart 500 of the method for language sequence tagging according to an embodiment of the present disclosure is schematically shown. In step 501, the sequence tagging encoder reads a first embedding representation of a language sequence, and the first embedding representation of the language sequence includes a character-level embedding representation c n , pre-trained word embedding representation w n And the global word embedding representation g. For each subword x n , and the corresponding character-level embedding representation c n , pre-trained word embedding representation w n It is concatenated with the global word embedding representation g. The global word embedding representation g is a global context representation for the language sequence obtained by pre-encoding calculation.
[0067] In step 502, the language sequence embedding representation read in step 501 is subjected to a first deep conversion encoding to obtain a set of hidden layer states. In one embodiment, the first deep conversion encoding includes performing a bidirectional deep conversion on the read language sequence embedding representation, i.e., a forward deep conversion from left to right and a reverse deep conversion from right to left. For the bidirectional deep conversion, the forward and reverse deep conversion encoding results need to be spliced. In the network architecture of the first deep conversion encoding, the deep conversion unit in the bottom layer adopts the L-GRU unit, and the deep conversion units in the remaining layers adopt the T-GRU unit. In an example, the number of T-GRU unit layers adopted is typically 2-5. As those skilled in the art will appreciate, T-GRU units of other numbers of layers may also be adopted.
[0068] In step 503, the hidden layer state is decoded to obtain a labeling result of the language sequence.
[0069] Figure 6 A flowchart 600 of a method for language sequence tagging according to another embodiment of the present disclosure is schematically shown. Figure 6 exist Figure 5 Steps 601 and 602 are added on the basis of the method flow. Figure 6 Steps 603, 604 and 605 in Figure 5 501, 502 and 503 are the same, so please refer to the above Figure 5 Description of steps 501, 502 and 503 in FIG.
[0070] In step 601, a second embedding representation of a language sequence is read, and the second embedding representation of the language sequence includes a character-level embedding representation and a pre-trained word embedding representation. n and the pre-trained word embedding representation w n Respectively with the subword x in the input language sequence n Corresponding. Character-level word embedding c n It is a word vector learned at the character level, which is obtained by subword x n The pre-trained word vector is obtained by performing convolution processing on the character level. n It is found in the pre-trained and stored word vector table.
[0071] In step 602, the second embedding representation of the read language sequence is subjected to a second deep conversion coding and information aggregation to obtain a global word embedding representation. In one embodiment, the second deep conversion coding includes performing deep conversion coding on the read language sequence embedding representation in two directions, namely, forward from left to right and reverse from right to left. In the case of performing deep conversion coding in both the forward and reverse directions, the results of the deep conversion in the forward and reverse directions are spliced, and then information aggregation is performed. Information aggregation may include maximum pooling, average pooling, or an attention mechanism. The second deep conversion coding is performed by a deep conversion recurrent network consisting of a linear transformation enhanced gated recurrent unit L-GRU and a conversion gated recurrent unit T-GRU. Wherein the L-GRU is located in the first layer of the recurrent unit in the deep conversion recurrent network, and the T-GRU is located in the other layers of the recurrent unit in the deep conversion recurrent network. In one embodiment, the number of layers of the T-GRU in the first deep conversion recurrent network is 1. As understood by those skilled in the art, the second deep recurrent network may have other numbers of T-GRU layers, such as 2-3 layers.
[0072] Figure 7 A schematic diagram of an apparatus 700 for language sequence labeling according to an embodiment of the present disclosure is schematically shown. The apparatus 700 for language sequence labeling includes: a sequence labeling encoder 701 and a sequence labeling decoder 702. The sequence labeling encoder 701 includes a first reading module 7011 and a first deep conversion module 7012. The first reading module 7011 is configured to read a first embedding representation of a language sequence, wherein the first embedding representation of the language sequence includes a character-level word embedding representation, a pre-trained word embedding representation, and a global word embedding representation. The first deep conversion module 7012 performs a first deep conversion encoding on the first embedding representation of the read language sequence to obtain a set of hidden layer states.
[0073] The sequence labeling decoder 702 is configured to decode the group of hidden layer states to obtain a labeling result of the language sequence.
[0074] Figure 8 The schematic diagram of a device 800 for language sequence labeling according to another embodiment of the present disclosure is schematically shown. The device 800 for language sequence labeling includes: a global information encoder 801, a sequence labeling encoder 802 and a sequence labeling decoder 803. The global information encoder 801 includes a second reading module 8011 and a second deep conversion module and an information aggregation module 8012. The second reading module 8011 is configured to read the second embedding representation of the language sequence. The second embedding representation of the language sequence includes a character-level embedding representation and a pre-trained word embedding representation. The second deep conversion module and the information aggregation module 8012 perform a first deep conversion encoding and information aggregation on the first embedding representation of the read language sequence to obtain a global word embedding representation. The global information encoder can perform bidirectional deep conversion encoding, that is, left-to-right conversion encoding and right-to-left deep conversion encoding. There is no other difference in the bidirectional deep conversion encoding except that the input sequence direction is different. The following is an example of a unidirectional conversion encoder. L represents the depth of the conversion encoder. At the time i, the depth is .j. The hidden state of the deep conversion encoder is calculated as follows:
[0075]
[0076] After deep encoding, the state corresponding to the i-th word is In the same way, the deep conversion codes of the two directions are calculated, and the hidden states obtained by encoding the two directions are concatenated to obtain the final encoding representation corresponding to the i-th word. Finally, the encoded representation of each word is averaged and pooled to obtain the final global representation of the entire sentence.
[0077] The sequence tag encoder 802 includes a first reading module 8021 and a first deep conversion module 8022. The first reading module 8021 is configured to read a first embedding representation of a language sequence. The first embedding representation of a language sequence includes a character-level word embedding representation, a pre-trained word embedding representation, and a global word embedding representation. The first deep conversion module 8022 performs a first deep conversion encoding on the first embedding representation of the read language sequence to obtain a set of hidden layer states.
[0078] The sequence labeling decoder 803 is configured to decode the group of hidden layer states to obtain a labeling result of the language sequence.
[0079] Compared with the traditional bidirectional LSTM model, the sequence labeling scheme of the present invention shows better labeling effect, and can more accurately identify the named entities, grammatical blocks, parts of speech and other information in the sentence, thereby optimizing the existing related application systems, such as the small and micro dialogue system.
[0080] F1 is an average indicator of accuracy and return rate commonly used in the industry. Taking the annotation indicator F1 of sequence labeling as an example, actual tests show that the scheme of the present invention has achieved an improvement in F1 value in many aspects. Table 1 schematically shows the comparison of F1 performance of various schemes in named entity recognition and grammatical block recognition.
[0081] Model Named Entity Recognition F1 Syntax block identification Fl Current best benchmark 91.64 95.29 The present invention 91.96(+0.32) 95.43(+0.14) The present invention + BERT 93.47(+1.83) 97.30(+2.01)
[0082] Table 1.
[0083] As shown in Table 1, for named entity recognition in sequence labeling, the solution of the present invention improves the F1 value by 0.32 on the basis of 91.64 in the prior art; for fast grammar recognition in sequence labeling, the F1 value is improved by 0.14 on the basis of 95.29 in the prior art.
[0084] In addition, integrating BERT (Bidirectional Encoder Representations from Transformers) on the basis of the present invention will further improve the performance.
[0085] Model Parameter quantity Named Entity Recognition F1 Stacked Recurrent Neural Networks 8.4M 90.94 The present invention 7.4M 91.96(+1.02)
[0086] Table 2.
[0087] Table 2 shows the performance comparison with stacked recurrent neural networks. First, although stacked recurrent neural networks can handle very deep structures, the transition depth between continuous hidden layer states at the word level is still shallow. Secondly, in stacked recurrent neural networks, the hidden layer states along the sequence axis are simply fed to the corresponding positions of the high-level, that is, only position-aware features are transmitted in the deep architecture. In the present disclosure, the internal states of all word positions in the global encoder are transformed into a vector of a fixed size. Compared with stacked recurrent neural networks, this context-aware representation provides more general and more informative features of sentences. In order to obtain a more rigorous comparison, a stacked recurrent neural network with similar parameter values to the present invention is used. According to the numerical stacked recurrent neural network in Table 2, there is still a big gap between the stacked recurrent neural network and the technical solution of the present invention. As shown in Table 2, the present invention achieves better performance than the stacked recurrent neural network with a smaller amount of parameters. As shown in the figure, for the named entity recognition F1 column, the F1 of the present invention is 91.96, which is 1.02 higher than the stacked recurrent neural network. Thus, it is confirmed that the technical solution of the present invention can effectively utilize global information to learn more useful representations of sequence labeling tasks.
[0088]
[0089] Table 3.
[0090] Table 3 shows the results of the model ablation experiment, that is, after removing the character-level convolutional network (i.e. Figure 4 4021 in), pre-trained word vectors (i.e. Figure 4 4022 in), global information (i.e. Figure 4 4023) and the deep transfer recurrent network DT ( Figure 4 4024) in the case of retaining the other three neural network architecture components, the F1 value for the named entity recognition task is obtained. It can be seen that when all four parts are present, the highest F1 value is 91.96, which is higher than 90.94 when the character-level convolutional network is ablated, 88.59 when the pre-trained word vector is ablated, 91.60 when the global information is ablated, and 91.42 when the deep transfer recurrent network is ablated. It can be seen that the performance of the technical solution disclosed in the present invention is higher than other ablation solutions.
[0091] Although the present invention uses global word embedding information to strengthen the input of the sequence labeling encoder. It can also be used as the input of the sequence labeling decoder, as the input of the softmax classification layer, and other ways to strengthen the global word embedding information. The first scheme has the best effect. After the global information representation and the multi-granularity word vector are spliced, it is used as the input of the sequence labeling encoder. After complex combination calculations, each word position can learn a more specific and richer representation, thereby improving the overall effect of the model. In the latter two schemes, the feature space of global information and other hidden states is similar.
[0092] Fig. 9 An example system 900 is illustrated, which includes an example computing device 910 that represents one or more systems and / or devices that may implement the various techniques described herein. Computing device 910 may be, for example, a server of a service provider, a device associated with a client (e.g., a client device), a system on a chip, and / or any other suitable computing device or computing system. Figure 7 Apparatus 700 for language sequence tagging or Figure 8 The apparatus 800 for language sequence tagging may take the form of a computing device 910. Alternatively, the apparatuses 700 and 800 for language sequence tagging may be implemented as a computer program in the form of a sequence tagging application 916.
[0093] The example computing device 910 as shown includes a processing system 911, one or more computer-readable media 912, and one or more I / O interfaces 913 that are communicatively coupled to each other. Although not shown, the computing device 910 may also include a system bus or other data and command transmission system that couples various components to each other. The system bus may include any one or combination of different bus structures, such as a memory bus or memory controller, a peripheral bus, a universal serial bus, and / or a processor or local bus utilizing any one of a variety of bus architectures. Various other examples are also contemplated, such as control and data lines.
[0094] Processing system 911 represents the functionality of performing one or more operations using hardware. Thus, processing system 911 is illustrated as including hardware elements 914 that may be configured as processors, functional blocks, and the like. This may include other logic devices implemented in hardware as application specific integrated circuits or formed using one or more semiconductors. Hardware elements 914 are not limited by the materials from which they are formed or the processing mechanisms employed therein. For example, a processor may be composed of (multiple) semiconductors and / or transistors (e.g., electronic integrated circuits (ICs)). In such a context, processor executable instructions may be electronic executable instructions.
[0095] Computer-readable media 912 is illustrated as including memory / storage 915. Memory / storage 915 represents memory / storage capacity associated with one or more computer-readable media. Memory / storage 915 may include volatile media (such as random access memory (RAM)) and / or non-volatile media (such as read-only memory (ROM), flash memory, optical disks, magnetic disks, etc.). Memory / storage 915 may include fixed media (e.g., RAM, ROM, fixed hard drives, etc.) and removable media (e.g., flash memory, removable hard drives, optical disks, etc.). Computer-readable media 912 may be configured in various other ways as further described below.
[0096] One or more I / O interfaces 913 represent functionality that allows a user to input commands and information to the computing device 910 and optionally also allows information to be presented to the user and / or other components or devices using various input / output devices. Examples of input devices include a keyboard, a cursor control device (e.g., a mouse), a microphone (e.g., for voice input), a scanner, touch functionality (e.g., a capacitive or other sensor configured to detect physical touch), a camera (e.g., that can detect motion that does not involve touch as gestures using visible or invisible wavelengths (such as infrared frequencies), etc.). Examples of output devices include a display device (e.g., a projector), a speaker, a printer, a network card, a tactile response device, etc. Thus, the computing device 910 can be configured in various ways as further described below to support user interaction.
[0097] The computing device 910 also includes a sequence tagging application 916. The sequence tagging application 916 may be, for example, Figure 5 The software examples of the apparatuses 700 and 800 for language sequence tagging described herein are used, and the techniques described herein are implemented in combination with other elements in the computing device 910 .
[0098] Various techniques may be described herein in the general context of software hardware elements or program modules. Generally, these modules include routines, programs, objects, elements, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The terms "module", "function" and "component" as used herein generally represent software, firmware, hardware or a combination thereof. The features of the techniques described herein are platform-independent, meaning that these techniques can be implemented on a variety of computing platforms with a variety of processors.
[0099] An implementation of the described modules and techniques may be stored on or transmitted across some form of computer-readable media. Computer-readable media may include a variety of media accessible by computing device 910. By way of example and not limitation, computer-readable media may include “computer-readable storage media” and “computer-readable signal media.”
[0100] In contrast to a simple signal transmission, carrier wave, or signal itself, "computer-readable storage medium" refers to a medium and / or device capable of persistently storing information, and / or a tangible storage device. Therefore, a computer-readable storage medium refers to a non-signal-bearing medium. Computer-readable storage media include hardware such as volatile and non-volatile, removable and non-removable media and / or storage devices implemented in a method or technology suitable for storing information (such as computer-readable instructions, data structures, program modules, logic elements / circuits, or other data). Examples of computer-readable storage media may include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical storage device, hard disk, cassette, magnetic tape, magnetic disk storage device or other magnetic storage device, or other storage device, tangible medium, or article of manufacture suitable for storing desired information and accessible by a computer.
[0101] "Computer-readable signal media" refers to signal-bearing media that is configured to send instructions to the hardware of the computing device 910, such as via a network. Signal media typically can embody computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave, data signal, or other transport mechanism. Signal media also include any information transfer media. The term "modulated data signal" refers to a signal that encodes the information in the signal in such a manner to set or change one or more of its characteristics. By way of example and not limitation, communication media include wired media such as a wired network or direct connection and wireless media such as acoustic, RF, infrared and other wireless media.
[0102] As previously described, hardware elements 914 and computer-readable media 912 represent instructions, modules, programmable device logic, and / or fixed device logic implemented in hardware form, which in some embodiments can be used to implement at least some aspects of the technology described herein. Hardware elements can include integrated circuits or systems on a chip, application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), complex programmable logic devices (CPLDs), and other implementations in silicon or components of other hardware devices. In this context, hardware elements can be used as processing devices for executing program tasks defined by instructions, modules, and / or logic embodied by hardware elements, as well as hardware devices for storing instructions for execution, such as the computer-readable storage media described previously.
[0103] The aforementioned combination may also be used to implement the various techniques and modules described herein. Therefore, software, hardware or program modules and other program modules may be implemented as one or more instructions and / or logic embodied on some form of computer-readable storage medium and / or by one or more hardware elements 914. The computing device 910 may be configured to implement specific instructions and / or functions corresponding to the software and / or hardware modules. Therefore, for example, by using a computer-readable storage medium and / or hardware element 914 of a processing system, the module may be implemented as a module executable by the computing device 910 as software, at least in part, in hardware. Instructions and / or functions may be executable / operable by one or more articles (e.g., one or more computing devices 910 and / or processing systems 911) to implement the techniques, modules and examples described herein.
[0104] In various embodiments, computing device 910 can adopt various different configurations. For example, computing device 910 can be implemented as a computer-type device including a personal computer, a desktop computer, a multi-screen computer, a laptop computer, a netbook, etc. Computing device 910 can also be implemented as a mobile device-type device including mobile devices such as mobile phones, portable music players, portable game devices, tablet computers, multi-screen computers, etc. Computing device 910 can also be implemented as a television-type device, which includes a device with or connected to a generally larger screen in a casual viewing environment. These devices include televisions, set-top boxes, game consoles, etc.
[0105] The techniques described herein may be supported by these various configurations of computing device 910 and are not limited to the specific examples of the techniques described herein. Functionality may also be implemented in whole or in part on the "cloud" 920 by using a distributed system, such as through a platform 922 as described below.
[0106] Cloud 920 includes and / or represents a platform 922 for resources 924. Platform 922 abstracts the underlying functionality of the hardware (e.g., servers) and software resources of cloud 920. Resources 924 may include applications and / or data that may be used when executing computer processing on a server remote from computing device 910. Resources 924 may also include services provided over the Internet and / or over a subscriber network such as a cellular or Wi-Fi network.
[0107] The platform 922 may abstract resources and functionality to connect the computing device 910 with other computing devices. The platform 922 may also be used to abstract hierarchies of resources to provide hierarchies of corresponding levels of demand encountered for resources 924 implemented via the platform 922. Thus, in an interconnected device embodiment, the implementation of the functionality described herein may be distributed throughout the system 900. For example, functionality may be implemented in part on the computing device 910 and through the platform 922 that abstracts the functionality of the cloud 920.
[0108] It should be understood that, for the sake of clarity, embodiments of the present disclosure are described with reference to different functional modules. However, it will be apparent that, without departing from the present disclosure, the functionality of each functional module can be implemented in a single module, in multiple modules, or as a part of other functional modules. For example, functionality that is described as being performed by a single module can be performed by multiple different modules. Therefore, reference to a specific functional module is only considered as a reference to a suitable module for providing the described functionality, rather than indicating a strict logical or physical structure or organization. Therefore, the present disclosure can be implemented in a single module, or can be physically and functionally distributed between different modules and circuits.
[0109] It will be understood that although the first, second, third, etc. terms may be used to describe various devices, elements, or parts in this article, these devices, elements, or parts should not be limited by these terms. These terms are only used to distinguish one device, element, or part from another device, element, or part.
[0110] Although the present disclosure has been described in conjunction with some embodiments, it is not intended to be limited to the specific form set forth herein. On the contrary, the scope of the present disclosure is limited only by the appended claims. Additionally, although individual features may be included in different claims, these may possibly be advantageously combined, and inclusion in different claims does not imply that the combination of features is not feasible and / or advantageous. The order of features in the claims does not imply any specific order in which the features must work. In addition, in the claims, the word "comprising" does not exclude other elements, and the indefinite article "a" or "an" does not exclude a plurality. The figure marks in the claims are provided only as clear examples and should not be interpreted as limiting the scope of the claims in any way.
Claims
1. A method for language sequence tagging, comprising: Reading a first embedding representation of a language sequence, wherein the first embedding representation of the language sequence includes a character-level word embedding representation, a pre-trained word embedding representation, and a global word embedding representation; Performing a first deep transform encoding on the first embedding representation of the read language sequence to obtain a set of hidden layer states; as well as Decoding the set of hidden layer states to obtain a labeling result of the language sequence, The global word embedding representation is a global context representation for a language sequence obtained by pre-encoding calculation; The global word embedding representation is obtained by the following steps: reading a second embedding representation of a language sequence, wherein the second embedding representation of the language sequence includes a character-level embedding representation and a pre-trained word embedding representation; performing a second deep conversion encoding and information aggregation on the second embedding representation of the read language sequence to obtain the global word embedding representation; and The first deep conversion coding includes: performing the first deep conversion coding through a deep conversion recurrent network composed of a linear transformation enhanced gated recurrent unit L-GRU and a transformation gated recurrent unit T-GRU.
2. The method according to claim 1, wherein performing the first depth conversion encoding comprises: The read language sequence embedding representation is subjected to a first deep transformation encoding in both forward and reverse directions.
3. The method of claim 2, wherein performing the first depth conversion encoding in both the forward and reverse directions comprises: Concatenate the deep transform encoding results in the forward and reverse directions.
4. The method according to claim 1, wherein performing the second depth conversion encoding comprises: The read language sequence embedding representation is deeply transformed and encoded in both forward and reverse directions.
5. The method of claim 4, wherein performing the second depth conversion encoding in both the forward and reverse directions comprises: Concatenate the deep transform encoding results in the forward and reverse directions.
6. The method according to claim 1, wherein performing the second depth conversion encoding comprises: The second deep transform encoding is performed through a deep transform recurrent network composed of a linear transform reinforced gated recurrent unit L-GRU and a transformation gated recurrent unit T-GRU.
7. The method according to claim 1, wherein the information aggregation can be average pooling or maximum pooling.
8. A device for language sequence tagging, comprising: Sequence tagging encoder, including: A first reading module is configured to read a first embedding representation of a language sequence, wherein the first embedding representation of the language sequence includes a character-level word embedding representation, a pre-trained word embedding representation, and a global word embedding representation. A first deep conversion module is configured to perform a first deep conversion encoding on the first embedding representation of the read language sequence to obtain a set of hidden layer states, wherein the first deep conversion module includes a deep conversion recurrent network composed of a linear transformation reinforcement gated recurrent unit L-GRU and a conversion gated recurrent unit T-GRU for performing the first deep conversion encoding; and A sequence labeling decoder is configured to decode the group of hidden layer states to obtain a labeling result of the language sequence, and a global information encoder is used to obtain the global word embedding representation, including: A second reading module is configured to read a second embedding representation of the language sequence, wherein the second embedding representation of the language sequence includes a character-level embedding representation and a pre-trained word embedding representation, A second deep conversion module and an information aggregation module are configured to perform a second deep conversion encoding and information aggregation on the second embedding representation of the read language sequence to obtain the global word embedding representation; The global word embedding representation is a global context representation for a language sequence obtained by pre-encoding calculation.
9. The apparatus according to claim 8, wherein the first depth conversion module performs the first depth conversion encoding comprising: The read language sequence embedding representation is subjected to a first deep transformation encoding in both forward and reverse directions.
10. A non-transitory computer readable medium of computer program instructions, which, when executed by a processor, causes the processor to perform the method according to any one of claims 1 to 7.
11. A computing device comprising a processor and a memory having a computer program stored thereon, the computer program being configured to, when executed on the processor, cause the processor to perform the method of any one of claims 1 to 7.
