# Interrogative Sentences Recognition Based on the GRU Multiattentive Layer Model

Authors: Liu Liu
Journal: Mathematical Problems in Engineering
 (2022)

---

## Abstract

Understanding the question is the key point in the question answering system. Therefore, this paper designs a multi attention layer model, extracts some missing features from the storage module, and uses Gru unit to organize them reasonably. By using non-linear operations to combine the results of different attention layers, we can avoid extracting only the linear combination of memory modules. Effectively combine the process of problem understanding, including the classification of problem words, the vocabulary annotation of problem sentences, the identification of problem sentence patterns, the classification of problems and the identification of problem centers, the grammatical analysis of question sentences and the identification of question sentence patterns, so as to achieve problem understanding. Experimental results show that this method improves the accuracy of problem understanding.


---

## Body

## 1. Introduction

Question answer system (QA) can better meet the user’s retrieval need and can find out the answers the user needs faster, and is currently receiving a lot of attention [1]. QA systems generally consist of three main components: question understanding, information retrieval and answer extraction [2]. Question understanding, also known as sentence analysis, is a key step in a question and answer system, and its accuracy has a significant impact on how questions are answered. Question comprehension analyses the question information, including: the type of question, the centre of the question, the focus of the question, the constraints and the level of detail of the answer, and whether the answer is single [3].At present, questions are generally categorised by question phrases, such as a person, place, time, quantity, etc. [4], and then keywords are extracted and expanded. Although the method of classifying questions by question word phrases is easy, the understanding of the questions is relatively shallow, which reduces the accuracy of understanding [5]. Therefore, there have been a number of studies combining syntactic analysis to classify interrogative sentences. In [6], the classification of questions was extracted from syntactic structures based on Chinese dependency grammar, and in [7], syntactic trees based on phrase syntax were analysed using syntactic tree truncation to form syntactic fragments, and these studies have achieved good results.In this paper, based on the characteristics of context-independent phrase grammar, the syntactic tree of phrase syntax is analysed to obtain the syntactic structure of question sentences about the syntactic pattern, and then the similarity between the syntactic structure and the syntactic pattern is calculated, and finally the syntactic pattern of question sentences is identified according to the similarity, and then the question is understood [8]. The grammatical analysis of interrogative sentences is combined with the recognition of the sentence patterns of interrogative sentences to achieve problem understanding.


## 2. Related Work

Utterance recognition refers to the identification of specific entities with specific meanings from a natural text and the annotation of the location and type of the entities [9]. With the advancement of related research, the research object of utterance recognition has begun to shift from general knowledge text to certain special fields in industry, such as the recognition of proprietary organisation names in the field of telecommunications [10] and its application scope is [11] gradually expanding. Early approaches to recognize statements included rule-based and machine-learning approaches. Reference [12] chose multi-layer perceptron neural networks and LSTM models to extract utterances in medical records; [13] used LSTM models to recognize utterances in the medical field; [14] based on CNN was used to identify utterances in combat documents. Reference [15] constructed a CRFs-based product alias recognition model for manually annotated ancient materials of Fangzhi; [16] recognized place names in Zuo Shi Zhuan of the Spring and Autumn Period based on CRFs and MEMM, and used The State Language [17]as a validation corpus, and found that CRFs outperformed MEMM [18] used a Bi LSTM-CNN-CRF model for entity extraction as the basis for constructing a Chinese historical knowledge graph.


## 3. Methods and Steps for Understanding Interrogative Sentences

In automated question and answer systems, only ad hock questions are generally studied. The distinctive feature of ad hock questions is the presence of question words, which are also closely related to the type of question asked and the answer to the question, and because of this, most question understanding methods currently use template matching to classify questions based on question word phrases. (1) In China, the same question can be asked in several different ways, and the position of the question word is very arbitrary. (2) Some interrogative phrases in Chinese do not clearly represent the type of question, and some sentences with the same interrogative phrase do not have the same type of question, e.g., “What is the reason for …?” This sentence is classified as “what” in terms of the question word, i.e., asking about something, but in fact the sentence is about the cause of something. (3) Due to the multiple meanings of the Chinese language itself, some sentences contain question words that are used for other purposes, and such sentences do not ask about anything at all, e.g., “He does not know everything.”In Chinese special interrogative sentences, the structure of interrogative sentences is characterised by interrogative phrases and some special words, as well as the word order in which the words appear in the sentence and other constituent features. The characteristic words of the interrogative sentence include the interrogative phrase in the interrogative sentence and the special words related to the type of interrogative sentence. When a person understands a question, he or she first identifies the characteristic words in the question, then classifies the question according to the characteristic words, the sentence type and the possible response pattern of the question, and in turn identifies the subject of the question. Therefore, in order to understand a question accurately, it is necessary to analyse the syntactic and even semantic aspects of the sentence, starting with the characteristic words and sentence patterns in the question. By identifying the syntactic patterns of interrogative sentences, it is possible to derive a classification of the question and to identify the centre of the question, etc. [19].Therefore, the analysis of interrogative sentences in this paper consists of three steps: classification of interrogative words, subordination of interrogative sentences and lexical annotation, identification of interrogative sentence patterns and classification of questions.


### 3.1. Classification of Question Words

A group of interrogative phrases with the same meaning and usage forms a type of interrogative.


### 3.2. Classification of Issues

There is a correspondence between question patterns and question types. An interrogative pattern may correspond to one or more question types, and a question type may correspond to multiple interrogative patterns. Question classification requires the identification of the question type to which an interrogative belongs as showed in Table1.Table 1
Classification of issues.
Interrogative parts of speechSentence patternProblem typeWho(VP + NP +P is + − (VP) TVP TNP + (say) + SWhoWhyS + is () + NP + - + VPWhyWhat is the reason?S + is + + S


## 3.1. Classification of Question Words

A group of interrogative phrases with the same meaning and usage forms a type of interrogative.


## 3.2. Classification of Issues

There is a correspondence between question patterns and question types. An interrogative pattern may correspond to one or more question types, and a question type may correspond to multiple interrogative patterns. Question classification requires the identification of the question type to which an interrogative belongs as showed in Table1.Table 1
Classification of issues.
Interrogative parts of speechSentence patternProblem typeWho(VP + NP +P is + − (VP) TVP TNP + (say) + SWhoWhyS + is () + NP + - + VPWhyWhat is the reason?S + is + + S


## 4. Combined Neural Network Based

This paper uses a combinatorial neural network model with four components: an input module, a memory module, an extraction module and an output module. For the input interrogative structureS=S1,…,Sde,…,SN, which Si=wi,pi1≤i≤N. Contains the words wi in position i and their lexical properties pi the aim of this paper is to identify whether the interrogative structure around Sde is omitted. In the first 3 modules, the same operation is performed on Figure 1 the words and lexical properties of the interrogative structure, and the results of both are combined in the output module. The first 3 modules are presented from a word perspective.Figure 1
Structure of the semantic omitted question structure recognition model.


### 4.1. Input Modules

By unsupervised learning methods, such as Skip-gram [20], a word vector lookup table is obtained L∈Rd×V where d is the dimension of the word vector and |V| is the length of the word vocabulary. In the input module, L is queried against the input sequence w=w1,w2,…,wN to obtain the corresponding word embedding representation sequence v=v1,v2,…,vN, where vi∈Rd1≤i≤N. If the current word does not exist in the word vector lookup table, the vector is represented by the special symbol “UNK,” which is randomly initialized.


### 4.2. Memory Modules

Bi-LSTM was chosen to obtain deep semantic-grammar information of the question structure, with a two-layer Bi-LSTM for lexical inputs and a single-layer Bi-LSTM for word inputs.The word embedding representation sequencev=v1,v2,…,vN is used as the initial input to the Bi-LSTM, which is encoded by the model to obtain an abstract representation of the question structure. For the word vector vi1≤i≤N, the vector representation is obtained in the first layer of the Bi-LSTM by the forward LSTM calculation h⟶tL and the vector representation is obtained in the backward LSTM calculation h⟶tL. If a total of L layers of the Bi-LSTM are used, this results in a memory module M∗=m1∗,m2∗,…,mN∗ and a memory segment mt∗=h⟶tL;h⟶tL1≤t≤N. [; ] means that the vectors are connected to form a vector, i.e. the output of the Lth layer of the forward LSTM and the backward LSTM is connected.


### 4.3. Extraction Module

The extraction module consists of two steps: the first step is to extract the omitted features of the question structure from the memory model; the second step is to organize the omitted features a rational way. Specifically, two extraction modes are adopted: GRU-based multi-attentive mechanism and Max-pooling.Multiple omitted features are extracted from the memory module by the multi-attentive layer and organised in a rational way of using GRU units. It is generally believed that as the number of layers in the network increases, the model is more capable of carving out more abstract feature information [21], which is more useful for recognising the structure of omitted types of question sentences. Multiple attention layers allow different positions of the input to be noticed in different layers [22]. The use of nonlinear operations to combine the results of different attention layers prevents the extraction from being a linear combination of memory modules only [23]. The structure of this extraction module is shown in Figure 2.Figure 2
GRU-based multi-layer attention layer extraction module.The input to the attention layert consists of memory fragment mj1≤j≤N, the previous hidden state of the GRU et−1, the word vector of the question sentence vde and the distance of word j from the relative position of the question sentence uj1≤j≤N. The word vector of the question and the previous hidden state of the GRU guide the calculation of the score of each memory fragment in the current attention layer, which helps to extract information related to the omission of the structure of the question. The relative position distance helps to obtain the syntactic and semantic association of word j with “of” [24].First calculate the attention score for each memory segmentmj1≤j≤N and the result of that attention layer ti:(1)gjt=Wattmj;et−1;vde;uj+batt,ajt=expgjt∑k=1Nexpgkt,it=∑j=1Najtmj,where, Watt is the weight parameter, shared by all attention layers, and batt is the bias term. Based on the experience of [25], the number of attention layers is set to 3.The GRU then applies a GRU unit between the attention layers, the last output of which organises all omitted features in a rational way, and uses this feature as the output of the extraction module.The most important omitted features are extracted using Max-pooling, the extraction structure of which is shown in Figure3. Max-pooling is an element-level operation [26] and is calculated as follows:(2)extractde=maxi=1Nmi.Figure 3
Extraction module based on Max-pooling.Since semantic omitted question structure recognition is a binary classification task, and the vector dimension of Max-pooling extraction is large, we add another layer of a feedforward neural network (FNN) and use its result as the output of Max-pooling extraction module.


### 4.4. Output Modules

In the output module, we connect the omitted features of the question structure based on words and lexemes and feed them into a soft max layer to obtain the final classification probability. The calculation formula is as follows:(3)pd=softmaxWsextractdew;extractdep+bs,where pd∈R2, Ws and bs are the parameters of the classification layer. The model uses a cross-entropy loss function, which is calculated as follows:(4)Loss=∑d∈D∑i∈Cyidlogpid.C is the type of interrogative structure,D is the training data set, pid is the probability that sample d belongs to type i obtained from the model in this paper, and y(d) is the label of sample d. We use back propagation to calculate the gradient of the parameters, Adam’s algorithm for neural network model optimization, and dropout for regularization [27].


## 4.1. Input Modules

By unsupervised learning methods, such as Skip-gram [20], a word vector lookup table is obtained L∈Rd×V where d is the dimension of the word vector and |V| is the length of the word vocabulary. In the input module, L is queried against the input sequence w=w1,w2,…,wN to obtain the corresponding word embedding representation sequence v=v1,v2,…,vN, where vi∈Rd1≤i≤N. If the current word does not exist in the word vector lookup table, the vector is represented by the special symbol “UNK,” which is randomly initialized.


## 4.2. Memory Modules

Bi-LSTM was chosen to obtain deep semantic-grammar information of the question structure, with a two-layer Bi-LSTM for lexical inputs and a single-layer Bi-LSTM for word inputs.The word embedding representation sequencev=v1,v2,…,vN is used as the initial input to the Bi-LSTM, which is encoded by the model to obtain an abstract representation of the question structure. For the word vector vi1≤i≤N, the vector representation is obtained in the first layer of the Bi-LSTM by the forward LSTM calculation h⟶tL and the vector representation is obtained in the backward LSTM calculation h⟶tL. If a total of L layers of the Bi-LSTM are used, this results in a memory module M∗=m1∗,m2∗,…,mN∗ and a memory segment mt∗=h⟶tL;h⟶tL1≤t≤N. [; ] means that the vectors are connected to form a vector, i.e. the output of the Lth layer of the forward LSTM and the backward LSTM is connected.


## 4.3. Extraction Module

The extraction module consists of two steps: the first step is to extract the omitted features of the question structure from the memory model; the second step is to organize the omitted features a rational way. Specifically, two extraction modes are adopted: GRU-based multi-attentive mechanism and Max-pooling.Multiple omitted features are extracted from the memory module by the multi-attentive layer and organised in a rational way of using GRU units. It is generally believed that as the number of layers in the network increases, the model is more capable of carving out more abstract feature information [21], which is more useful for recognising the structure of omitted types of question sentences. Multiple attention layers allow different positions of the input to be noticed in different layers [22]. The use of nonlinear operations to combine the results of different attention layers prevents the extraction from being a linear combination of memory modules only [23]. The structure of this extraction module is shown in Figure 2.Figure 2
GRU-based multi-layer attention layer extraction module.The input to the attention layert consists of memory fragment mj1≤j≤N, the previous hidden state of the GRU et−1, the word vector of the question sentence vde and the distance of word j from the relative position of the question sentence uj1≤j≤N. The word vector of the question and the previous hidden state of the GRU guide the calculation of the score of each memory fragment in the current attention layer, which helps to extract information related to the omission of the structure of the question. The relative position distance helps to obtain the syntactic and semantic association of word j with “of” [24].First calculate the attention score for each memory segmentmj1≤j≤N and the result of that attention layer ti:(1)gjt=Wattmj;et−1;vde;uj+batt,ajt=expgjt∑k=1Nexpgkt,it=∑j=1Najtmj,where, Watt is the weight parameter, shared by all attention layers, and batt is the bias term. Based on the experience of [25], the number of attention layers is set to 3.The GRU then applies a GRU unit between the attention layers, the last output of which organises all omitted features in a rational way, and uses this feature as the output of the extraction module.The most important omitted features are extracted using Max-pooling, the extraction structure of which is shown in Figure3. Max-pooling is an element-level operation [26] and is calculated as follows:(2)extractde=maxi=1Nmi.Figure 3
Extraction module based on Max-pooling.Since semantic omitted question structure recognition is a binary classification task, and the vector dimension of Max-pooling extraction is large, we add another layer of a feedforward neural network (FNN) and use its result as the output of Max-pooling extraction module.


## 4.4. Output Modules

In the output module, we connect the omitted features of the question structure based on words and lexemes and feed them into a soft max layer to obtain the final classification probability. The calculation formula is as follows:(3)pd=softmaxWsextractdew;extractdep+bs,where pd∈R2, Ws and bs are the parameters of the classification layer. The model uses a cross-entropy loss function, which is calculated as follows:(4)Loss=∑d∈D∑i∈Cyidlogpid.C is the type of interrogative structure,D is the training data set, pid is the probability that sample d belongs to type i obtained from the model in this paper, and y(d) is the label of sample d. We use back propagation to calculate the gradient of the parameters, Adam’s algorithm for neural network model optimization, and dropout for regularization [27].


## 5. Experimental Results and Analysis

In the experiment, the authors used BAIDU to search a total of 8,000 search results with various question phrases, and then selected 1,000 of these sentences as the test set by manually processing them to eliminate some repetitive and advertising sentences. The results were analysed using the methods described in this paper and are shown in Table2. Test 1 is the result of a full set test of these test questions. The results of Test 2 were obtained after eliminating the incorrectly analysed questions because the syntactic analysis procedure used in the test was not very accurate and had a large impact on the test results. The main reasons for the incorrect analysis in Test 2 are still related to the syntactic analysis.Table 2
Results of the experiment on the recognition of question patterns.
Number of sentencesCorrectly identify quantityCorrect rate(%)Test 1100062262.2Test 242141197.62Test 357921136.44The accuracy of the test is not particularly high as the set of questions used is from real sentences with nonquestioning uses of question words, but a comparison with a question classification method based on question words shows that it is an improvement over question classification methods based on question words. Table3 The main reason for incorrect question understanding is still syntactic analysis errors, but the results obtained are satisfactory. In addition, analysis of the misconceived sentences revealed that the number of questions with incorrect comprehension was 79, or 7.9% of the total test sentences, and 75.96% of the misconceived test sentences.Table 3
Results of the problem understanding experiment.
It is characterised by word and part of speech taggingCharacterized by sentence patternsClassification accuracy0.8850.896Problem understanding accuracy-0.622Table4 shows the experimental results compared with the baseline method, where ACC is the correct rate of all question structures, nonelided-F1 is the F1 value of nonelided question structures, and elided-F1 is the F1 value of elided question structures. It can be seen that the recognition performance of CRF is proportional to the size of the corpus, but GRU improves the recognition of elliptical question structures while seriously affecting the recognition of noneliminated types, while the performance of the proposed model is better than both CRF and GRU [28].Table 4
Experimental results compared to baseline method.
MethodData1Data2Data1ACCNonomitted-F1Omit-F1ACCNonomitted-F1Omit-F1ACCNon omitted-F1Omit-F1CRF0.93870.96770.38300.94070.96440.78190.94510.96490.8739GRU0.96010.97930.42680.91430.95220.58730.87370.92090.6873M3 + GRU-Att0.98770.99350.89290.98560.99170.94790.98380.98950.9642M3 + Max-pooling0.98580.99430.89960.98070.99170.94990.98500.99830.9667In the following, the role of each module in the model is analysed through comparative experiments. The network structure is detailed in Table5, where M1, M2 and M3 are the three settings of the memory module; L1 and L2 denote the use of single-layer and double-layer bidirectional LSTM neural networks in the memory module, respectively; None denotes that no extraction module is used, and the forward and backward memory fragments at the question position are directly connected as omitted features of the question structure and fed into the output layer; Att denotes that the result of the attention layer is essentially a linear combination of memory modules. If there is no nonlinear operation between multiple attention layers, the final result is still a linear combination of memory modules, so the multiple attention layers are replaced by a single attention layer.Table 5
Network structure settings.
Network structureWord memory modulePart of speech memory moduleExtraction moduleM3 + NoneL1L2NoneM3 + AttL1L2AttM1 + Max-poolingL1L1Max-poolingM2 + Max-poolingL2L2Max-poolingM3 + Max-poolingL1L2Max-poolingM3 + GRU-AttL1L2GRU-AttFigure4 shows that all models were able to classify question structures effectively, with a correct rate of over 97.5%. Figure 5 shows that all models were able to identify nonelided question structures effectively, with F1 values exceeding 98.5%. Figure 6 shows that as the corpus expands, the amount of data for omitted and nonoligible question structures gradually tends to balance out, and all models are getting better at recognising omitted question structures, while the performance of recognising nonoligible question structures is not significantly affected.Figure 4
Classification results for question structure.Figure 5
Nonomitted type recognition results.Figure 6
Omitted type recognition results.In this paper, we focus on the results of recognising the structure of omitted types of questions. The next experiments are based on Data3, as Figure6 shows that all models perform best on Data3. Table 5 shows the results of the comparison experiments using different memory module settings, and it can be seen that M3 + Max-pooling outperform M2 + Max-pooling. That is, from a world perspective, words contain both syntactic and semantic information and may not require complex models that are more inclined to learn semantic information, such as the two-layer Bi-LSTM.


## 6. Conclusions

In this paper, the question comprehension method is combined with the syntactic analysis of interrogative sentences, and the accuracy of question comprehension is improved. The analysis of semantics has not been addressed, and further analysis of the nonquestioning use of question words has not been done. Therefore, further work should be done to improve the accuracy of questionable understanding by combining the nonquestion use of question words, and to improve the analysis and understanding of question sentences at a higher and deeper level by combining the semantic analysis of question sentences.



---

*Source: 1354337-2022-03-29.xml*