Text classification is fundamental in natural language processing (NLP), and Graph Neural Networks (GNN) are recently applied in this task. However, the existing graph-based works can neither capture the contextual word relationships within each document nor fulfil the inductive learning of new words. In this work, to overcome such problems, we propose TextING 1 for inductive text classification via GNN. We first build individual graphs for each document and then use GNN to learn the fine-grained word representations based on their local structures, which can also effectively produce embeddings for unseen words in the new document. Finally, the word nodes are incorporated as the document embedding. Extensive experiments on four benchmark datasets show that our method outperforms state-of-the-art text classification methods. Text classification is one of the primary tasks in the NLP field, as it provides fundamental methodologies for other NLP tasks, such as spam filter-ing, sentiment analysis, intent detection, and so forth. Traditional methods for text classification include Naive Bayes (Androutsopoulos et al., 2000), k-Nearest Neighbor (Tan, 2006) and Support Vector Machine (Forman, 2008). They are, however, primarily dependent on the hand-crafted features at the cost of labour and efficiency. There are several deep learning methods proposed to address the problem, among which Recurrent Neural Network (RNN) (Mikolov et al., 2010) and Convolutional Neural Network (CNN) (Kim, 2014) are essential ones. Based on them, extended models follow to leverage the classification performance, for instance, TextCNN (Kim,  The first two authors contribute equally to this work. 1 https://github.com/CRIPAC-DIG/TextING 2014), TextRNN (Liu et al., 2016) and TextRCNN (Lai et al., 2015). Yet they all focus on the locality of words and thus lack of long-distance and non-consecutive word interactions. Graph-based methods are recently applied to solve such issue, which do not treat the text as a sequence but as a set of co-occurrent words instead. For example, Yao et al. (2019) employ Graph Convolutional Networks (Kipf and Welling, 2017) and turns the text classification problem into a node classification one (TextGCN). Moreover, Huang et al. (2019) improve TextGCN by introducing the message passing mechanism and reducing the memory consumption. However, there are two major drawbacks in these graph-based methods. First, the contextual-aware word relations within each document are neglected. To be specific, TextGCN (Yao et al., 2019) constructs a single graph with global relations between documents and words, where fine-grained text level word interactions are not considered (Wu et al., 2019; Hu et al., 2019a,b). In Huang et al. (2019), the edges of the graph are globally fixed between each pair of words, but the fact is that they may affect each other differently in a different text. Second, due to the global structure, the test documents are mandatory in training. Thus they are inherently transductive and have difficulty with inductive learning, in which one can easily obtain word embeddings for new documents with new structures and words using the trained model. Therefore, in this work, we propose a novel Text classification method for INductive word representations via Graph neural networks, termed TextING. In contrast to previous graph-based approaches with global structure, we train a GNN that can depict the detailed word-word relations using only training documents, and generalise to new documents in test. We build individual graphs by applying the sliding window inside each document (Rousseau et al., 2015). The information of word nodes is propagated to their neighbours via the Gated Graph Neural Networks (Li et al., 2015, 2019), which is then aggregated into the document embedding. We also conduct extensive experiments to examine the advantages of our approach against baselines, even when words in test are mostly unseen (21.06% average gain in such inductive condition). Noticing a concurrent work (Nikolentzos et al., 2020) also reinforces the approach with a similar graph network structure, we describe the similarities and differences in the method section. To sum up, our contributions are threefold:  We propose a new graph neural network for text classification, where each document is an individual graph and text level word interactions can be learned in it. Our approach can generalise to new words that absent in training, and it is therefore applicable for inductive circumstances. We demonstrate that our approach outperforms state-of-the-art text classification methods experimentally. TextING comprises three key components: the graph construction, the graph-based word interaction, and the readout function. The architecture is illustrated in Figure 1. In this section, we detail how to implement the three and how they work. We construct the graph for a textual document by representing unique words as vertices and co-occurrences co-occurrences between words as edges, denoted as G = ( V , E ) where V is the set of vertices and E the edges. The co-occurrences describe the relationship of words that occur within a fixed-size sliding window (length 3 at default) and they are undirected in the graph. Nikolentzos et al. (2020) also use a sliding window of size 2. However, they include a particular master node connecting to every other node, which means the graph is densely connected and the structure information is vague during message passing. The text is preprocessed in a standard way, including tokenisation and stopword removal (Blanco and Lioma, 2012; Rousseau et al., 2015). Embeddings of the vertices are initialised with word features, denoted as h  R |V| d where d is the embedding dimension. Since we build individual graphs for each document, the word feature information is propagated and incorporated contextually during the word interaction phase. Upon each graph, we then employ the Gated Graph Neural Networks (Li et al., 2015) to learn the embeddings of the word nodes. A node could receive the information a from its adjacent neighbours and then merge with its own representation to update. As the graph layer operates on the first-order neighbours, we can stack such layer t times to achieve high-order feature interactions, where a node can reach another node t hops away. The formulas of the interaction are: a t = Ah t  1 W a , (1) z t =  (cid:0) W z a t + U z h t  1 + b z (cid:1) , (2) r t =  (cid:0) W r a t + U r h t  1 + b r (cid:1) , (3)  h t = tanh (cid:0) W h a t + U h ( r t  h t  1 ) + b h (cid:1) , (4) h t =  h t  z t + h t  1  (cid:0) 1  z t (cid:1) , (5) where A  R |V||V| is the adjacency matrix,  is the sigmoid function, and all W , U and b are trainable weights and biases. z and r function as the update gate and reset gate respectively to determine to what degree the neighbour information contributes to the current node embedding. After the word nodes are sufficiently updated, they are aggregated to a graph-level representation for the document, based on which the final prediction is produced. We define the readout function as: h v =  (cid:0) f 1 ( h tv ) (cid:1)  tanh (cid:0) f 2 ( h tv ) (cid:1) , (6) h G = 1 |V| X v V h v + Maxpooling ( h 1 ... h V ) , (7) where f 1 and f 2 are two multilayer perceptrons (MLP). The former performs as a soft attention weight while the latter as a non-linear feature transformation. In addition to averaging the weighted word features, we also apply a max-pooling function for the graph representation h G . The idea behind is that every word plays a role in the text and the keywords should contribute more explicitly. Finally, the label is predicted by feeding the graph-level vector into a softmax layer. We minimise the loss through the cross-entropy function:  y G = softmax ( Wh G + b ) , (8) L =  X i y G i log ( y G i ) , (9) where W and b are weights and bias, and y G i is the i -th element of the one-hot label. We also extend our model with a multichannel branch TextING-M, where graphs with local structure (original TextING) and graphs with global structure (subgraphs from TextGCN) work in parallel. The nodes remain the same whereas the edges of latter are extracted from the large graph (built on the whole corpus) for each document. We train them separately and make them vote 1:1 for the final prediction. Although it is not the inductive case, our point is to investigate whether and how the two could complement each other from micro and macro perspectives. In this section, we aim at testing and evaluating the overall performance of TextING. During the experimental tests, we principally concentrate on three concerns: (i) the performance and advantages of our approach against other comparable models, (ii) the adaptability of our approach for words that are never seen in training, and (iii) the interpretability of our approach on how words impact a document. Datasets. For the sake of consistency, we adopt four benchmark tasks the same as in (Yao et al., 2019): (i) classifying movie reviews into positive or negative sentiment polarities (MR) 2 , (ii) & (iii) classifying documents that appear on Reuters newswire into 8 and 52 categories (R8 and R52 respectively) 3 , (iv) classifying medical abstracts into 23 cardiovascular diseases categories (Ohsumed) 4 . Table 1 demonstrates the statistics of the datasets as well as their supplemental information. Baselines. We consider three types of models as baselines: (i) traditional deep learning methods including TextCNN (Kim, 2014) and TextRNN (Liu et al., 2016), (ii) simple but efficient strategies upon word features including fastText (Joulin et al., 2017) and SWEM (Shen et al., 2018), and (iii) graph-based methods for text classification including TextGCN (Yao et al., 2019) and Huang et al. (2019). Experimental Set-up. For all the datasets, the training set and the test set are given, and we randomly split the training set into the ratio 9:1 for actual training and validation respectively. The hyperparameters were tuned according to the performance on the validation set. Empirically, we set the learning rate as 0.01 with Adam (Kingma and Ba, 2015) optimiser and the dropout rate as 0.5. Some depended on the intrinsic attributes of the dataset, for example, the word interaction step and the sliding window size. We refer to them in the parameter sensitivity subsection. Regarding the word embeddings, we used the pre-trained GloVe (Pennington et al., 2014) 5 with 2 http://www.cs.cornell.edu/people/pabo/movie-review-data/ 3 http://disi.unitn.it/moschitti/corpora.htm 4 https://www.cs.umb.edu/smimarog/textmining/datasets/ 5 http://nlp.stanford.edu/data/glove.6B.zip Table 2: Test accuracy (%) of various models on four datasets. d = 300 as the input features while the out-of-vocabulary (OOV) words' were randomly sampled from a uniform distribution [-0.01, 0.01]. For a fair comparison, the other baseline models shared the same embeddings. Results. Table 2 presents the performance of our model as well as the baselines. We observe that graph-based methods generally outperform other types of models, suggesting that the graph model benefits to the text processing. Further, TextING ranks top on all tasks, suggesting that the individual graph exceeds the global one. Particularly, the result of TextING on MR is remarkably higher. Because the short documents in MR lead to a low-density graph in TextGCN, it restrains the label message passing among document nodes, whereas our individual graphs (documents) do not rely on such label message passing mechanism. Another reason is that there are approximately one third new words in test as shown in Table 1, which implies TextING is more friendly to unseen words. The improvement on R8 is relatively subtle since R8 is simple to fit and the baselines are rather satisfying. The proportion of new words is also low on R8. The multichannel variant also performs well on all datasets. It implies the model can learn different patterns through different channels. Under Inductive Condition. To examine the adaptability of TextING under inductive condition, we reduce the amount of training data to 20 labelled documents per class and compare it with TextGCN. Word nodes absent in the training set are masked for TextGCN to simulate the inductive condition. In this scenario, most of the words in the test set are unseen during training, which behaves like a rigorous cold-start problem. The result of both models on MR and Ohsumed are listed in Table 3. An average gain of 21.06% shows that TextING is much less impacted by the reduction of exposed Table 3: Accuracy (%) of TextGCN and TextING on MR and Ohsumed, where MR uses 40 labelled documents (0.5% of full training data) and Ohsumed uses 460 labelled documents (13.7% of full training data). words. In addition, a tendency of test performance and gain with different percentages of training data on MR is illustrated as Figure 2. TextING shows a consistent improvement when increasing number of words become unseen. Case Study. To understand what is of importance that TextING learns for a document, we further visualise the attention layer (i.e. the readout func-tion), illustrated as Figure 3. The highlighted words are proportional to the attention weights, and they show a positive correlation to the label, which interprets how TextING works in sentiment analysis. Parameter Sensitivity. Figure 4 exhibits the performance of TextING with a varying number of the graph layer on MR and Ohsumed. The result reveals that with the increment of the layer, a node could receive more information from high-order neighbours and learn its representation more accurately. Nevertheless, the situation reverses with a continuous increment, where a node receives from every node in the graph and becomes over-smooth. Figure 5 illustrates the performance as well as the graph density of TextING with a varying window size on MR and Ohsumed. It presents a similar trend as the interaction step's when the number of neighbours of a node grows. We proposed a novel graph-based method for inductive text classification, where each text owns its structural graph and text level word interactions can be learned. Experiments proved the effectiveness of our approach in modelling local word-word relations and word significances in the text. This work is supported by National Natural Science Foundation of China (U19B2038, 61772528) and National Key Research and Development Program (2018YFB1402600, 2016YFB1001000).
abstain abstain objective objective abstain result abstain abstain abstain abstain other abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain objective objective method abstain method abstain objective objective objective abstain method method abstain abstain abstain abstain abstain method method abstain objective other abstain abstain abstain method abstain method abstain abstain abstain abstain abstain method abstain abstain abstain abstain result abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain other abstain abstain abstain abstain result abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain result abstain abstain abstain abstain abstain abstain abstain objective abstain other