# A Method for Classifying Information in Education Policy Texts Based on an Improved Attention Mechanism Model

Authors: Yutai Rao; Fan Yang
Journal: Wireless Communications and Mobile Computing
 (2022)

---

## Abstract

Text classification techniques in natural language processing can automatically classify text data in a more efficient way, saving human resources and costs. Therefore, text classification techniques can be applied to the automatic classification of education policy data to quickly locate and accurately find education policy data, thus realising the information management and visual analysis of education policy data. This paper proposes a text classification algorithm based on the attention mechanism of headline and body text according to the characteristics of education policy and introduces this algorithm in detail through a model diagram. The experimental comparison with existing classification algorithms verifies the superiority of the algorithm in the classification method of education policy text classification information.


---

## Body

## 1. Introduction

With the country’s vigorous promotion of education and the rapid development of information technology, education policy data is continuously expanding, and online education policy data has been quantified at sea [1]. In recent years, the national education system has been reformed to encourage local governments to implement locally appropriate education policies, further exacerbating the growth in the number of education policies [2]. The use of manual classification methods has become increasingly difficult to handle the growing amount of education policy data. In order to improve the efficiency of education policy classification and to achieve efficient management and utilisation of education policies, the issue of classification of education policy output has become an important issue [3].Textual analysis, especially of official documents, has a unique position in social science research. Marx, for example, based most of his work on the use of official publications and devoted most of his research time to the study of official documents [4]. Turgot also used the study of official texts in his numerous studies of the education system [5]. In social science research, text analysis, content analysis, and discourse analysis all have a textual orientation and are often substituted for or included in some studies; what are the differences and connections between the three? What is policy textual analysis? What does it mean for the development of education policy research in China and how can it be effectively applied are the questions that this paper seeks to answer [6].Content analysis can be defined simply as “the systematic, objective and quantitative analysis of information characteristics” [7]. Information generally consists of printed or written text but also includes photographs, cartoons, graphics, broadcasts, and oral communication. Content analysis as a research technique originated at the beginning of the 20th century, but fragmented research has been occurring for much longer. Content analysis has been described as the “statistical semantics of political discourse” [8]. The pioneer of policy science, Lasswell’s The Language of Politics was an influential study of political literature in the 1940s. Documentation refers to “official documents, letters, etc., or articles on political theory, current policy, academic research, etc.” [9]. Content analysis is sometimes also referred to as textual analysis, but in comparison, textual analysis is usually restricted to written texts [10].Policy, usually in textual form, is seen as an expression of political purpose, a statement by policy-makers of the course of action they intend to follow. When studying the process of policy-making, instrumentalists often see policy text analysis as an inquiry into the authorial purpose assumed to exist within the text [11]. However, a policy text is not the work of a single author or a single production process like a novel. It is the product of compromise between different stakeholders at various policy stages, which makes instrumentalist analysis of policy texts too “simple” [12].In modern societies, the state-controlled education system operates to maintain the power structure and order of society as a whole. The official state discourse in education policy (e.g., core curriculum, assessment systems, or school management) becomes an instrument and object of power [13]. Discourse is the embodiment of power and is about “what can be said, but also about who, when and where it is said with what authority [14]. Discourse is embedded in the use of meanings, propositions and words” [15]. Policy is not only a product of power but also a symbol of power and a reflection of social power structures. When policy is seen as an official discourse, it means that policy analysis at this point must not only reveal the power relations between the subject of the discourse and its object in the text but also, at the same time, account for the social structure in which such power relations are embedded; thus, discourse analysis undoubtedly expands the depth and breadth of analysis compared to the traditional analysis of policy texts. Traditional text (content) analysis lacks the attention to the complex power relations and structures behind the text, which is the focus of discourse analysis [16].The classification of education policy texts is a fine-grained classification; these texts all belong to subcategories under the broad category of education policy, and the differences between the various categories of texts are relatively small. It is often difficult to achieve fine-grained classification as opposed to coarse-grained classification problems, so it is important to make reasonable use of the characteristics of the data. Looking at the format of education policy, it can be seen that each education policy text contains two parts: a title and a body. The headline is a high level summary of the text and conveys accurate information, so when classifying an article containing a headline, it is often useful to use the headline to determine the general content of the article and then browse the text to classify it. In this paper, we model education policy texts according to the importance of the text and the title to obtain an optimal vector representation of the text, which can be used to effectively classify education policy texts [17].


## 2. Related Work

Textual analysis or discourse analysis is a relatively common research method used in policy research at home and abroad. On the importance of discourse analysis in policy research, [18] states that “the primary focus on government activities rather than government rhetoric is a weakness in policy analysis.” Policy texts produce real social effects by creating and sustaining identities. In [19], Fairclough’s approach to critical discourse analysis was used in a study of equity in the education reform agenda in Queensland, Australia, where it was argued to be of particular value in examining multiple and conflicting discourses in policy texts, discursive shifts in policy implementation, and highlighting marginalised and hybrid discourses. In [20], using the term “policy text” as a “fuzzy” search in the “Education and Social Sciences General” section of the Chinese Journal Articles Database (1994-2008), 30 articles were retrieved. The search for the term “policy text” in the Chinese Journal of Literature database (1994-2008) yielded 30 relevant papers, of which 27 were analyses of educational policy texts. [21] combines the qualitative framing (discourse) analysis method of media communication research with quantitative analysis to study the agenda setting of education policy, but the quantitative textual analysis mainly focuses on media reports rather than policy texts. In [22], along the lines of the information communication theory of “policy is reflected by the public,” a combination of qualitative and quantitative bibliometric methods was used to analyse the discourse of letters from the public, proposals of the Chinese People’s Political Consultative Conference (CPPCC), and the Ministry of Education’s Political Daily on topics related to the national education policy and to explore the discursive communication characteristics of China’s education policy [23].With the development of computer science and related text analysis software, text analysis techniques have also continued to advance, which has made it possible to systematically analyse large-scale policy texts, thus helping to generate systematic policy knowledge and explore the internal logic of the production and developmental evolution of education policy texts [24]. The main task of policy research is to understand how policy evolves in order to improve the policy-making process in general [25]. The research path of text-based policy analysis helps to uncover and accumulate policy knowledge from texts and the historical context and social practices associated with them, which can then be used as a basis for developing indigenous policy theories or analytical frameworks, ultimately contributing to the improvement of education policy making while enriching our understanding of education policy and its processes [26].


### 2.1. Model Design

The text classification algorithm in this paper consists of a training phase and a prediction phase. The training phase is to construct a classifier with excellent classification performance, and the classifier constructed in the training phase is used in the prediction phase to classify education policy data. The specific process is shown in Figure1.Figure 1
The classification algorithm.The proposed text classification algorithm model based on the attention mechanism of headline and body text is shown in Figure2. The input of the network is a document D containing two parts, headline and body text, which are N×K and M×K word vectors, respectively, where N and M are the headline word length and body word length, respectively, and K is the dimensionality of the word vector. The output of the model is an element containing category information, using pkD,θ to denote the probability that a document belongs to category k, and θ is the set of parameters in the network. In this paper, the title and body features of the education policy are extracted using a cyclic structure as a convolutional layer in learning the feature representation of the words, and the vector representation of the title and body is obtained through a maximum pooling layer after obtaining the representation of the words. Finally, an attention mechanism is introduced to assign weights to the headline and body text according to their vector representations, which is used to calculate the vector representation of the whole document. The main parts are described as shown in Figure 2.Figure 2
Model of the classification algorithm.


### 2.2. Convolutional Layer

Considering that words in a text are not isolated but are linked to words in their context, it is important to use the word and its contextual information to represent the meaning of the word together. This serves the purpose of disambiguating words and enables a more accurate understanding of their meaning. In this paper, we use a two-way long and short-term memory network to learn the contextual representation of words, including both left contextual information and right contextual information.Given a word in the textwi, ewi represents the word vector of the word. Definition clwi is learned as the left context vector of the word, using the LSTM to scan the text forward (front to back). crwi is its right context vector, learned by scanning the text backwards (backwards to forwards) using the LSTM. The left context of the first word of each document uses the same shared parameter crwi, and the right context of the last word shares parameter crwn. The left context of word wi is calculated using Equations (1) and (2) for left context clwi and right context crwi, respectively.
(1)clwi=fWlclwi−1+Wslewi−1,(2)crwi=fWrcrwi+1+Wsrewi+1.In Equation (1), ewi−1 is the word vector of word wi−1, and clwi−1 denotes the left context vector of the previous word wi−1. Wl is a matrix that converts the context hidden layer to the next hidden layer, Wsl is a matrix used to combine the semantics of the current word with the left context of the next word, and f is a nonlinear activation function. The parameters in Equation (1) are similar to those in Equation (2).Next, a word’s left-hand contextual information, word vector, and right-hand contextual information are concatenated to achieve disambiguation of the word by using contextual semantic information, calculated using Equation (3).
(3)xi=clwi;ewi;crwi.After obtaining a representation of each word, a linear transformation and an activation function are used to obtain a higher-level, potential semantic vector of words as the most useful feature when representing textual information, calculated using(4)yi2=tanhW2xi+b2.


### 2.3. Pooling Layer

The education policy document is modelled in two parts, the headline and the body, and the headline text and body text are learned separately after learning the underlying semantic information for each word. Pooling layers allow variable-length text to be transformed into fixed-length vectors and also capture more important information in the text. The common pooling layers are max-pooling and average pooling. In this paper, max-pooling is chosen because each word in the text has a different impact on the classification result. The average pooling approach was not used because only a few words and their combinations in the text have an impact on the semantics of the text. Therefore, when performing the text representation of the headline and body text, the potential semantic vectors of the words learned in the headline and body text are pooled uniformly for maximum pooling, with the formula shown in(5)y3=maxi=1nyi2.Maximum pooling captures important underlying semantic information in the text, reduces noise in the text, and results in a text representation that can be used as an important feature of the text.


### 2.4. Attention Layer and Output Layer

After going through the pooling layer and obtaining a vector representation of the title and the body, it is considered that both the title and the body are useful for the classification of education policy documents, but they do not have the same importance. The attention mechanism in deep learning can assign weights to the different parts according to their importance, thus enabling the exploitation of the important features. Therefore, the attention mechanism is used to assign attention weights to the title vector and the body vector as shown in Equations (6) and (7). After obtaining the weights for the title and body, the vector representation of the whole document is obtained by calculating the weighted sum of the title vector and the body vector with their respective attention weights as shown in Equation (8).
(6)ui=tanhW4yi3+b4,(7)αi=expuiTu4∑iexpuiTu4,(8)v=∑iαiyi3.After obtaining a final representation of an education policy document, similar to a traditional neural network, full connectivity is used as the output layer of the model.(9)y5=W5v+b5.Finally, the softmax function is used to output the probability of a document belonging to a class, using the following formula:(10)pi=expyi5∑k=1nexpy5.


### 2.5. Experimentation and Analysis

This subsection first introduces the experimental environment and the experimental data, followed by a description of the text classification evaluation metrics used. The design of the experiments is then carried out, and information such as the parameters of the experiments is detailed. The experiments start with an analysis of the hyperparameter tuning of the algorithm, followed by two sets of experiments to verify the superiority of the algorithm in this paper compared to other algorithms.Four categories of education policy data are used in the experiments of this paper: compulsory and basic education, high school education, higher education, and vocational education. After data preprocessing, 16,663 pieces of experimental data were obtained for these four categories. Each education policy contains both title text and body information and belongs to a category manually labelled by Beida Faber. As there are few data containing multiple labels, only single-label categories are considered for classification in this paper. The summary table of the experimental data is shown in Table1.Table 1
Summary of experimental data.
CategoryTotalTraining set (80%)Test set (20%)Compulsory and basic education520941731044High school education26382110518Higher education563041821447Vocational education31562532614The headline text of education policies is generally short, and the number of headline words in all data is less than 30, so the algorithm in this paper uses a maximum headline length of 30 words. The statistical distribution of the number of words in the body text of the cleaned education policy dataset is shown in Figure3.Figure 3
Body text word count.Some education policies are very brief circulars, while others are comprehensive documents that need to be explained in detail. The maximum length of words in the text is used as a hyperparameter in this algorithm to reduce noise and improve performance. The maximum length of words in the text is used as a hyperparameter in this algorithm to reduce the noise data to improve the classification performance and also to reduce the waste of computational resources.For the selection of the comparison algorithm, the SVM algorithm in machine learning is chosen as the classifier, using word frequency inverse document frequency (tf-idf) as the word feature. The deep learning models were selected as CNN, RNN, and RCNN, using word vectors as word representations. For the experimental data processing, the data of the comparison algorithm is a simple splicing of the text of the education policy and the title as the input of the education policy text, while in this model, the text and the title are input as two parts of the education policy, and the optimal combination is obtained using an attention mechanism according to their importance to the classification.The algorithm designed in this paper takes into account the importance of the title and divides the education policy into two parts: the title and the body. The word vector dimension used is 300, the maximum length of the title is 30, and the maximum length of the body is 200. The hidden layer size of the loop structure is set to 512, the pooling layer uses the maximum pooling algorithm, the learning rate of the model is set to 0.0003, the optimisation algorithm uses the stochastic gradient descent algorithm, and the dropout is set to 0.7 to prevent overfitting. 10 iterations of training are performed, and the batch size is 6.4.4.Since the maximum length of the text was very unevenly distributed, the maximum length of the text was adjusted as a hyperparameter. The first two paragraphs in an education policy text are generally a summary of the content of the policy, and the later part is a detailed article-by-article description of the specific implementation. Therefore, in this paper, the length of the body text was selected starting from 100 and increasing by 100 each time, and the results of the experiment are shown in Figure4.Figure 4
Parameter selection for maximum body length.As can be seen in Figure4, the best classification performance is obtained when the maximum length of the text is chosen to be 200. This is because the first 200 words of most education policies contain a lot of information about the category of the education policy, while the later parts of the text mostly explain each article of the policy in detail, and it is often difficult to determine the category of the education policy through these explanations. When the number of words in the text is less than 200, it is difficult to represent the main information of the whole education policy data; when the number of words in the text is greater than 200, it will not only increase the computational workload of the model but also bring noise to affect the final classification effect. Therefore, the maximum length of the text in this paper is 200 words [27, 28].Considering that the input of this model is a word vector, when the dimension of the word vector is too large, it will cause sparse information of words and also cause a waste of computational resources, while if the dimension of the word vector is too low, it will be difficult to represent the meaning of words and affect the final classification result. In order to study the influence of word vector dimension on the classification performance, word vectors of different dimensions were selected for comparison in this paper. The experimental results are shown in Figure5.Figure 5
Effect of word vector dimensionality on classification results.As can be seen from Figure5, as the dimensionality of the word vectors increases, the results of the three evaluation indexes, precision, recall, and F1 value, first increase and then decrease. The best results can be obtained when the word vector dimension is 300. When the word vector dimension is less than 300, it is difficult to fully represent the semantic information of the words, while when the word vector dimension is greater than 300, it can fully represent the information of the words but also brings some noise, resulting in a slight error in the model during feature extraction. In summary, the final word vector dimension of 300 is chosen in this paper.Firstly, in order to verify the effectiveness of combining the title and body of the education policy in this paper, three different corpora of the education policy dataset, namely, the title, the body, and the combined title and body, were used as the classification model using the RCNN algorithm. The results are shown in Table2. The results show that the combined corpus of headline and body text in the education policy text outperformed the headline and body text alone in terms of accuracy, completeness, and F1.Table 2
Experimental comparison results for different corpus.
CorpusAccuracy (%)Recall rate (%)F1 value (%)Title72.574.372.4Text85.184.687.1Title and body splicing85.286.384.7As can be seen from Table2, the combination of text and headlines gives better results on all three evaluation measures than either the text or the headline corpus alone. The 72.9 per cent accuracy achieved when using only the title text indicates that the classification of education policies can be achieved using only the title text. When the headline and body text information are combined as input, the F1 value for the composite indicator is 0.8% higher than when using only the body text information, indicating that the use of the headline information improves the classification performance of education policies, confirming the importance of the headline text.To verify that the algorithm proposed in this paper can effectively exploit the headline text information of education policy documents and thus improve the performance of classification, in this paper, experiments are conducted on different algorithms using the education policy dataset, where the stitching of title and body text is input as a whole on SVM, TextCNN, TextRNN, and RCNN, while the title text and body text of each education policy document are input as two parts in the algorithm proposed in this paper. As shown in Table3, the statistical results of the experiments conducted by different algorithms on the education policy dataset are presented. As can be seen from Table 3, the model in this paper outperforms other classification models in terms of precision, recall, and F1 value, demonstrating that the model in this paper can make full use of the importance of the headline text to classify education policies.Table 3
Comparison of experimental results.
Algorithm modelAccuracy (%)Recall rate (%)F1 value (%)SVM82.182.283.9TextCNN85.284.685.1TextRNN85.181.484.5RCNN86.286..185.7Algorithm in this paper84.285.788.6From the experimental results in Table3, the following can be seen.
(1)
The experimental results on education policy data show that this paper’s classification algorithm based on the headline and body text attention mechanism is higher than other models in three aspects, accuracy, recall, and F1 value, and the F1 value in the comprehensive evaluation index is 0.9% higher than that on RCNN. The experimental results demonstrate that the model in this paper can better exploit the importance of headlines to classification and by using headline text can improve the performance of education policy text classification [29](2)
When comparing the model in the neural network with the machine learning method, the results of the three evaluation indexes are better than the traditional SVM method, and the model in this paper is 3.4% more accurate and 3.1% higher in F1 value than the SVM, which shows that deep learning can extract the deep semantic representation of the text through word vectors in feature extraction, which is better than the shallow features in traditional machine learning. The results are better than the shallow features in traditional machine learning(3)
The models based on convolutional structures can achieve better classification performance when modelling long texts such as education policies. The algorithm, RCNN, and TextCNN improved the F1 values by 1.6%, 0.7%, and 0.3%, respectively, over RNN, due to the fact that RNN focuses more on words that appear later in the text, while the important words in the education policy text are usually in the front part of the text, and words that appear later have relatively less impact on the classification results. Therefore, using RNN alone would be less effective


## 2.1. Model Design

The text classification algorithm in this paper consists of a training phase and a prediction phase. The training phase is to construct a classifier with excellent classification performance, and the classifier constructed in the training phase is used in the prediction phase to classify education policy data. The specific process is shown in Figure1.Figure 1
The classification algorithm.The proposed text classification algorithm model based on the attention mechanism of headline and body text is shown in Figure2. The input of the network is a document D containing two parts, headline and body text, which are N×K and M×K word vectors, respectively, where N and M are the headline word length and body word length, respectively, and K is the dimensionality of the word vector. The output of the model is an element containing category information, using pkD,θ to denote the probability that a document belongs to category k, and θ is the set of parameters in the network. In this paper, the title and body features of the education policy are extracted using a cyclic structure as a convolutional layer in learning the feature representation of the words, and the vector representation of the title and body is obtained through a maximum pooling layer after obtaining the representation of the words. Finally, an attention mechanism is introduced to assign weights to the headline and body text according to their vector representations, which is used to calculate the vector representation of the whole document. The main parts are described as shown in Figure 2.Figure 2
Model of the classification algorithm.


## 2.2. Convolutional Layer

Considering that words in a text are not isolated but are linked to words in their context, it is important to use the word and its contextual information to represent the meaning of the word together. This serves the purpose of disambiguating words and enables a more accurate understanding of their meaning. In this paper, we use a two-way long and short-term memory network to learn the contextual representation of words, including both left contextual information and right contextual information.Given a word in the textwi, ewi represents the word vector of the word. Definition clwi is learned as the left context vector of the word, using the LSTM to scan the text forward (front to back). crwi is its right context vector, learned by scanning the text backwards (backwards to forwards) using the LSTM. The left context of the first word of each document uses the same shared parameter crwi, and the right context of the last word shares parameter crwn. The left context of word wi is calculated using Equations (1) and (2) for left context clwi and right context crwi, respectively.
(1)clwi=fWlclwi−1+Wslewi−1,(2)crwi=fWrcrwi+1+Wsrewi+1.In Equation (1), ewi−1 is the word vector of word wi−1, and clwi−1 denotes the left context vector of the previous word wi−1. Wl is a matrix that converts the context hidden layer to the next hidden layer, Wsl is a matrix used to combine the semantics of the current word with the left context of the next word, and f is a nonlinear activation function. The parameters in Equation (1) are similar to those in Equation (2).Next, a word’s left-hand contextual information, word vector, and right-hand contextual information are concatenated to achieve disambiguation of the word by using contextual semantic information, calculated using Equation (3).
(3)xi=clwi;ewi;crwi.After obtaining a representation of each word, a linear transformation and an activation function are used to obtain a higher-level, potential semantic vector of words as the most useful feature when representing textual information, calculated using(4)yi2=tanhW2xi+b2.


## 2.3. Pooling Layer

The education policy document is modelled in two parts, the headline and the body, and the headline text and body text are learned separately after learning the underlying semantic information for each word. Pooling layers allow variable-length text to be transformed into fixed-length vectors and also capture more important information in the text. The common pooling layers are max-pooling and average pooling. In this paper, max-pooling is chosen because each word in the text has a different impact on the classification result. The average pooling approach was not used because only a few words and their combinations in the text have an impact on the semantics of the text. Therefore, when performing the text representation of the headline and body text, the potential semantic vectors of the words learned in the headline and body text are pooled uniformly for maximum pooling, with the formula shown in(5)y3=maxi=1nyi2.Maximum pooling captures important underlying semantic information in the text, reduces noise in the text, and results in a text representation that can be used as an important feature of the text.


## 2.4. Attention Layer and Output Layer

After going through the pooling layer and obtaining a vector representation of the title and the body, it is considered that both the title and the body are useful for the classification of education policy documents, but they do not have the same importance. The attention mechanism in deep learning can assign weights to the different parts according to their importance, thus enabling the exploitation of the important features. Therefore, the attention mechanism is used to assign attention weights to the title vector and the body vector as shown in Equations (6) and (7). After obtaining the weights for the title and body, the vector representation of the whole document is obtained by calculating the weighted sum of the title vector and the body vector with their respective attention weights as shown in Equation (8).
(6)ui=tanhW4yi3+b4,(7)αi=expuiTu4∑iexpuiTu4,(8)v=∑iαiyi3.After obtaining a final representation of an education policy document, similar to a traditional neural network, full connectivity is used as the output layer of the model.(9)y5=W5v+b5.Finally, the softmax function is used to output the probability of a document belonging to a class, using the following formula:(10)pi=expyi5∑k=1nexpy5.


## 2.5. Experimentation and Analysis

This subsection first introduces the experimental environment and the experimental data, followed by a description of the text classification evaluation metrics used. The design of the experiments is then carried out, and information such as the parameters of the experiments is detailed. The experiments start with an analysis of the hyperparameter tuning of the algorithm, followed by two sets of experiments to verify the superiority of the algorithm in this paper compared to other algorithms.Four categories of education policy data are used in the experiments of this paper: compulsory and basic education, high school education, higher education, and vocational education. After data preprocessing, 16,663 pieces of experimental data were obtained for these four categories. Each education policy contains both title text and body information and belongs to a category manually labelled by Beida Faber. As there are few data containing multiple labels, only single-label categories are considered for classification in this paper. The summary table of the experimental data is shown in Table1.Table 1
Summary of experimental data.
CategoryTotalTraining set (80%)Test set (20%)Compulsory and basic education520941731044High school education26382110518Higher education563041821447Vocational education31562532614The headline text of education policies is generally short, and the number of headline words in all data is less than 30, so the algorithm in this paper uses a maximum headline length of 30 words. The statistical distribution of the number of words in the body text of the cleaned education policy dataset is shown in Figure3.Figure 3
Body text word count.Some education policies are very brief circulars, while others are comprehensive documents that need to be explained in detail. The maximum length of words in the text is used as a hyperparameter in this algorithm to reduce noise and improve performance. The maximum length of words in the text is used as a hyperparameter in this algorithm to reduce the noise data to improve the classification performance and also to reduce the waste of computational resources.For the selection of the comparison algorithm, the SVM algorithm in machine learning is chosen as the classifier, using word frequency inverse document frequency (tf-idf) as the word feature. The deep learning models were selected as CNN, RNN, and RCNN, using word vectors as word representations. For the experimental data processing, the data of the comparison algorithm is a simple splicing of the text of the education policy and the title as the input of the education policy text, while in this model, the text and the title are input as two parts of the education policy, and the optimal combination is obtained using an attention mechanism according to their importance to the classification.The algorithm designed in this paper takes into account the importance of the title and divides the education policy into two parts: the title and the body. The word vector dimension used is 300, the maximum length of the title is 30, and the maximum length of the body is 200. The hidden layer size of the loop structure is set to 512, the pooling layer uses the maximum pooling algorithm, the learning rate of the model is set to 0.0003, the optimisation algorithm uses the stochastic gradient descent algorithm, and the dropout is set to 0.7 to prevent overfitting. 10 iterations of training are performed, and the batch size is 6.4.4.Since the maximum length of the text was very unevenly distributed, the maximum length of the text was adjusted as a hyperparameter. The first two paragraphs in an education policy text are generally a summary of the content of the policy, and the later part is a detailed article-by-article description of the specific implementation. Therefore, in this paper, the length of the body text was selected starting from 100 and increasing by 100 each time, and the results of the experiment are shown in Figure4.Figure 4
Parameter selection for maximum body length.As can be seen in Figure4, the best classification performance is obtained when the maximum length of the text is chosen to be 200. This is because the first 200 words of most education policies contain a lot of information about the category of the education policy, while the later parts of the text mostly explain each article of the policy in detail, and it is often difficult to determine the category of the education policy through these explanations. When the number of words in the text is less than 200, it is difficult to represent the main information of the whole education policy data; when the number of words in the text is greater than 200, it will not only increase the computational workload of the model but also bring noise to affect the final classification effect. Therefore, the maximum length of the text in this paper is 200 words [27, 28].Considering that the input of this model is a word vector, when the dimension of the word vector is too large, it will cause sparse information of words and also cause a waste of computational resources, while if the dimension of the word vector is too low, it will be difficult to represent the meaning of words and affect the final classification result. In order to study the influence of word vector dimension on the classification performance, word vectors of different dimensions were selected for comparison in this paper. The experimental results are shown in Figure5.Figure 5
Effect of word vector dimensionality on classification results.As can be seen from Figure5, as the dimensionality of the word vectors increases, the results of the three evaluation indexes, precision, recall, and F1 value, first increase and then decrease. The best results can be obtained when the word vector dimension is 300. When the word vector dimension is less than 300, it is difficult to fully represent the semantic information of the words, while when the word vector dimension is greater than 300, it can fully represent the information of the words but also brings some noise, resulting in a slight error in the model during feature extraction. In summary, the final word vector dimension of 300 is chosen in this paper.Firstly, in order to verify the effectiveness of combining the title and body of the education policy in this paper, three different corpora of the education policy dataset, namely, the title, the body, and the combined title and body, were used as the classification model using the RCNN algorithm. The results are shown in Table2. The results show that the combined corpus of headline and body text in the education policy text outperformed the headline and body text alone in terms of accuracy, completeness, and F1.Table 2
Experimental comparison results for different corpus.
CorpusAccuracy (%)Recall rate (%)F1 value (%)Title72.574.372.4Text85.184.687.1Title and body splicing85.286.384.7As can be seen from Table2, the combination of text and headlines gives better results on all three evaluation measures than either the text or the headline corpus alone. The 72.9 per cent accuracy achieved when using only the title text indicates that the classification of education policies can be achieved using only the title text. When the headline and body text information are combined as input, the F1 value for the composite indicator is 0.8% higher than when using only the body text information, indicating that the use of the headline information improves the classification performance of education policies, confirming the importance of the headline text.To verify that the algorithm proposed in this paper can effectively exploit the headline text information of education policy documents and thus improve the performance of classification, in this paper, experiments are conducted on different algorithms using the education policy dataset, where the stitching of title and body text is input as a whole on SVM, TextCNN, TextRNN, and RCNN, while the title text and body text of each education policy document are input as two parts in the algorithm proposed in this paper. As shown in Table3, the statistical results of the experiments conducted by different algorithms on the education policy dataset are presented. As can be seen from Table 3, the model in this paper outperforms other classification models in terms of precision, recall, and F1 value, demonstrating that the model in this paper can make full use of the importance of the headline text to classify education policies.Table 3
Comparison of experimental results.
Algorithm modelAccuracy (%)Recall rate (%)F1 value (%)SVM82.182.283.9TextCNN85.284.685.1TextRNN85.181.484.5RCNN86.286..185.7Algorithm in this paper84.285.788.6From the experimental results in Table3, the following can be seen.
(1)
The experimental results on education policy data show that this paper’s classification algorithm based on the headline and body text attention mechanism is higher than other models in three aspects, accuracy, recall, and F1 value, and the F1 value in the comprehensive evaluation index is 0.9% higher than that on RCNN. The experimental results demonstrate that the model in this paper can better exploit the importance of headlines to classification and by using headline text can improve the performance of education policy text classification [29](2)
When comparing the model in the neural network with the machine learning method, the results of the three evaluation indexes are better than the traditional SVM method, and the model in this paper is 3.4% more accurate and 3.1% higher in F1 value than the SVM, which shows that deep learning can extract the deep semantic representation of the text through word vectors in feature extraction, which is better than the shallow features in traditional machine learning. The results are better than the shallow features in traditional machine learning(3)
The models based on convolutional structures can achieve better classification performance when modelling long texts such as education policies. The algorithm, RCNN, and TextCNN improved the F1 values by 1.6%, 0.7%, and 0.3%, respectively, over RNN, due to the fact that RNN focuses more on words that appear later in the text, while the important words in the education policy text are usually in the front part of the text, and words that appear later have relatively less impact on the classification results. Therefore, using RNN alone would be less effective


## 3. Conclusions

This paper designs and implements a text classification algorithm based on the attention mechanism of the body and title, based on the fact that every education policy document contains two parts, the title and the body, and that the title often expresses the subject information of that document. Firstly, the education policy classification problem is introduced, as well as some characteristics of education policy data. The information in the headings of education policy texts is exploited. Then the data, setting, and evaluation metrics for the experiments are described. By comparing with different algorithms, the superiority of the text classification algorithm designed in this paper based on the headline and body text attention mechanism is demonstrated.



---

*Source: 5467572-2022-05-09.xml*