Word and Phrase Features in Graph Convolutional Network for Automatic Question Classification
Junyoung Lee Ninad Dixit Kaustav Chakrabarti S. Supraja


[
    [
    3 September 2024
====================

*Equal contribution

§ ABSTRACT 
Effective question classification is crucial for AI-driven educational tools, enabling adaptive learning systems to categorize questions by skill area, difficulty level, and competence. This classification not only supports educational diagnostics and analytics but also enhances complex tasks like information retrieval and question answering by associating questions with relevant categories. Traditional methods, often based on word embeddings and conventional classifiers, struggle to capture the nuanced relationships in natural language, leading to suboptimal performance. To address this, we propose a novel approach leveraging graph convolutional networks (GCNs), named Phrase Question-Graph Convolutional Network (PQ-GCN) to better model the inherent structure of questions. By representing questions as graphs—where nodes signify words or phrases and edges denote syntactic or semantic relationships—–our method allows GCNs to learn from the interconnected nature of language more effectively. Additionally, we explore the incorporation of phrase-based features to enhance classification accuracy, especially in low-resource settings. Our findings demonstrate that GCNs, augmented with these features, offer a promising solution for more accurate and context-aware question classification, bridging the gap between graph neural network research and practical educational applications.












§ INTRODUCTION


Question classification is vital in providing AI-driven education and training, assisting adaptive learning systems by categorizing questions into skill area or level of difficulty and competence, and providing educational diagnosis and analytics. Accurate automatic question classification also provides headway to more complex tasks such as information retrieval and question answering, in which the association of the given question with a certain category allows for retrieval of relevant contextual knowledge to formulate compatible answers. Traditional methods, relying on word embeddings and conventional classifiers, often struggle with capturing the nuanced relationships between words and phrases, leading to suboptimal classification performance. The complexity of natural language, especially in the context of educational and domain-specific questions, requires more sophisticated approaches that can understand and leverage the inherent structure of language.

Aside from text embeddings, graphs have recently been highlighted as a way to represent unstructured text data. Questions can be naturally represented as graphs, where nodes correspond to words or phrases, and edges capture the relationships between them, such as syntactic dependencies, semantic similarities, or proximity measures. This graph-based representation aligns perfectly with the strengths of graph convolutional network (GCN), which excels at learning from structured data. GCNs are designed to operate on graph-structured data, making them ideal for processing and understanding the interconnected nature of words and phrases within questions. This capability enables GCNs to capture the underlying structure and dependencies in a question, leading to more accurate and context-aware classification decisions. GCNs offer a promising solution by modeling the relationships between words, phrases, and their syntactic and semantic connections as graphs. This approach allows for a more nuanced and context-aware classification, bridging the gap between basic AI research and practical applications in education and beyond.

Question classification poses a unique problem even among the different types of text classification, as the amount of information available in a question tends to be limited compared to document-level text counterparts. While neither tackling the task of text classification with GCNs, nor automated question classification via artificial intelligence is new, our investigation aims to determine the feasibility of adapting GCNs for question classification. In particular, we explore additional phrase-based features in our proposed model, PQ-GCN, to enhance classification performance, and assess the effectiveness of these features in low-resource settings.



§ RELATED WORK




 §.§ Automatic Question Classification


One of the earliest works on Question Classification was in <cit.> which made use of support vector machines (SVMs) and explored a variety of features like lexical, synctactic, and semantic features. Another reference work by <cit.> also discusses usage of head words and hypernyms as features for SVM and maximum entropy (ME) algorithms. They demonstrated the effectiveness of statistical learning methods in classifying questions, while rule-based classification <cit.> via string matching in questions have also been explored in earlier works.

Following these works, a review of automatic question classifiers from 2012 to 2017 <cit.> revealed that there was an increase in the number of works proposing neural network-based methods, or using neural networks in combination with rule-based methods. The approaches range from concatenating pre-trained word embeddings to form a question embedding <cit.>, to combining CNN and LSTM in a hybrid model <cit.>, effectively balancing feature extraction and sequence modeling, and was shown to outperform traditional machine learning techniques and earlier deep learning models in classifying questions across various domains.




 §.§ Text Classification Using Text Graphs



TextGCN <cit.> pioneered approaching text classification as a node classification problem. Yao et al. constructs a corpus-level graph with document nodes and word nodes—pointwise mutual information (PMI) as word-word edge weights and text frequency-inverse document frequency (TF-IDF) as word-document edge weights—and applies a 2-layer GCN to obtain the class output. Several works propose similar graph construction and node initialization based on TextGCN, with more efficient or better regularized graph propagation <cit.>.

Other works have also explored multi-graphs instead of a single corpus-level graph. TensorGCN <cit.> builds a tensor graph from three separate graphs: semantic graph via word embeddings, syntactic graph via grammar parsing, and sequential graph via PMI values. Each of these graphs has different word-word edge weights while sharing the same TF-IDF values for word-document edge weights, and they undergo intra- and inter-graph propagation. ME-GCN <cit.> constructs a graph that has multi-dimensional word-word, word-document, and document-document edges, using Word2Vec and Doc2Vec embeddings and similarity scores. SHINE <cit.> uses 

While node classification is a transductive approach, where one needs to build a corpus-level graph consisting both train and test document nodes, InducT-GCN <cit.> extends the task into a inductive approach, where a training corpus graph is constructed first similarly to TextGCN, and any new test corpus is built as a virtual subgraph for inference.

Graph classification, in which you classify a document graph as opposed to a document node, has also been used as an inductive approach to text classification. Text-Level-GNN <cit.> uses a sliding window to build multiple graphs, each with a small number of nodes and edges, with trainable edge weights that are shared across the graphs for the same word pair. Huang et al. also uses a message passing mechanism instead of a GCN architecture, relying on aggregating neighbourhood information via max-pooling and combining them via weighted sums, instead of convolution functions. 
Graph Fusion Network <cit.> constructs four individual global word co-occurrence graphs, and each document is represented as with a set of four subgraphs. GCN is applied to each subgraph, and the resulting output is concatenated, passed through an MLP layer, and average-pooled to obtain the final document embedding.

There are also combinatory methods such as HyperGAT (Hypergraph Attention Networks) <cit.> building hypergraphs for each document to capture high-level interaction between words, consisting of sequential hyperedges connecting all words in a sentence and semantic hyperedges connecting top-K words with LDA-based topic modeling. Attention mechanism is utilized at both node- and edge-level to update representations.





§ WHY USE PHRASE FEATURES?


As with all text classification tasks, feature extraction from questions poses a particular challenge, as the features need to be representative of the questions and yet be domain-agnostic to be generalizable across different classification frameworks. We identify a research gap in adapting GCNs for question classification in the lack of question classification-specific feature extraction and graph construction methods. While works discussed in the previous section discuss word and document relationships, phrase relationships have not been explored in the context of text classification with graph representations. The effectiveness of phrases have been discussed in topic modeling for questions <cit.>, and this section outlines the rationale to explore phrase relationships as a crucial feature for question classification.



  
Capturing Meaningful Chunks of Information
Unlike individual words, phrases (e.g., noun phrases and verb phrases) often encapsulate more specific and contextually relevant information. Consider the question "How do enzymes function in the human body?" Here, the phrase "enzymes function" (verb phrase) and "human body" (noun phrase) are pivotal in identifying this as a biological process question, likely classified under "Biology" or "Physiology." The verb phrase indicates the action or process in question, while the noun phrase specifies the domain of interest. In the question "Describe the steps to solve a quadratic equation," the phrases "steps to solve" (verb phrase) and "quadratic equation" (noun phrase) are linked by their relevance to problem-solving in mathematics.

This also applies to question analysis with part-of-speech (POS) tags. POS tags help in identifying the grammatical structure, but they do not capture the full semantic context. For example, knowing that "role" is a noun does not reveal its specific relevance in a question about "electric circuits."



  
Intra-Question Relationships
By extracting phrases and analyzing their semantic embeddings, we can understand the relationship between different components of the question. For instance, in "What are the causes of the French Revolution?", the proximity and relationship between "causes" and "French Revolution" (via PPMI or other metrics) are key to categorizing this question under "History" or "Political Science."



  
Disambiguation and Contextualization
Phrases provide additional context that can help disambiguate words that might have multiple meanings. For instance, in "What is the role of the cell in an electric circuit?", the noun phrase "role of the cell" and its proximity to "electric circuit" helps to clarify that "cell" refers to a component of an electric circuit rather than a biological cell.

While word-level features such as embeddings and POS tags are foundational for understanding the basic structure and meaning of a question, phrase-level features offer a more comprehensive and contextually rich understanding. By extracting noun phrases and verb phrases and analyzing their semantic embeddings and relationships, one can capture the nuanced meaning and intent of questions, leading to more accurate and effective classification models.



§ METHODOLOGY




 §.§ Feature Extraction and Graph Construction


Given a corpus of question-label pair, we perform basic text cleaning which includes removal of contractions and punctuation. 

To construct meaningful graph representations from a corpus of question text, we selected several feature extraction techniques, each contributing uniquely to capturing different aspects of the textual data. A summary of the extracted features are provided in Table <ref>.







  
Words and PMI
We first tokenize the given question corpus by whitespace to obtain a unique set of words. A word-level graph is constructed, with word nodes connected by edges weighted with PMI values, representing local co-occurrence relationships. Specifically, we utilize positive PMI (PPMI), given by max(PMI(word_1, word_2), 0). Pre-trained word embeddings from word2vec <cit.> are also obtained for each word in the corpus, to be used as additional semantic information by concatenating with node embeddings.



  
Word-Level POS Tags
POS tags for each word is obtained via the default set from NLTK [<https://nltk.org>] and PPMI values between each pair of POS tags are calculated as edge weights for a POS tag graph.



  
Phrases and PMI
Phrases are extracted from each question text via regex matching for verb phrases and noun phrases with  [<https://spacy.io>] in Python, and a unique set of phrases in the corpus is obtained. Each question is represented as a sequence of verb phrases and noun phrases present in the text. Then a phrase-level graph (similar to the word-level graph) is constructed with PMI-weighted edges. Phrase embeddings are obtained from PhraseBERT <cit.> to provide additional semantic information.



  
Phrase-Level POS Tags
During the phrase extraction process above,  also provides word-level POS tags for each word in the extracted phrases. These word-level POS tags are concatenated to form phrase-level POS tags. For example, in the question "Discuss the main objective of layout design rules",  using the regex (ADJ)(NOUN), the noun phrase [main objective] is extracted, together with the phrase-level POS tag of (ADJ_NOUN). Then, the PPMI values between each pair of phrase-level POS tags are calculated as edge weights for a phrase-level POS tag graph.  



  
Named Entity Recognition (NER)
Named entities (e.g., people, organizations, locations) carry significant meaning and often denote key elements within a question. A list of named entities is obtained from the NELL knowledge base <cit.>, and is used to extract named entities via string matching. With the short text nature of questions, it is difficult to obtain multiple entities from a single question to calculate co-occurrence statistics. Hence, we utilize TransE embeddings <cit.> for each named entity and calculate the cosine similarity between embeddings of each pair of named entities, to be used as edge weights in constructing a named entity graph.

For all 5 graphs constructed above, the node features are initialized as one-hot vectors. By combining these diverse feature extraction methods, we construct a comprehensive and multi-faceted graph representation of the question text, capturing various semantic, syntactic, and named entity information crucial for question classification.





 §.§ Model Architecture


As we identify phrase-based features as the gap towards building a more robust automatic question classification model, we also identify a model architecture capable of incorporating phrase-based features as a modular add-on, as well as be able to consolidate the each graph of different node and edge types into a single question embedding. Initial approach was to concatenate of the outputs of 5 individual 2-layer GCNs, followed by a linear layer and softmax function. Various combinations of 2D convolution layers and pooling layers have also been experimented with, but ultimately we found that the final question embedding was not able to provide sufficient information for classification and performed worse than baseline models.

Following the initial exploration, we base our output layers largely on SHINE <cit.>, where a dynamic graph of question nodes and cosine similarity edges is learned from the individual GCN outputs and the nodes are classified via label propagation in a final GCN layer. The training parameters are kept the same as provided by Wang et al.. An overview of the feature extraction, graph construction, and model is provided in Figure <ref>.










§ EXPERIMENTS




 §.§ Datasets




  
NU This dataset was obtained from Najran University <cit.>, containing 596 questions with 3 class labels of different cognitive complexities. 



  
ARC This dataset was released as part of the A12 Reasoning Challenge <cit.>, consisting 279 questions labeled with 3 different reasoning capabilities.



  
LREC This is a collection of 345 middle school science questions, labeled with 3 different type of answers required by the respective questions <cit.>.



  
Bloom Bloom's Taxonomy <cit.> is one of the most well-established question classification frameworks used by educators. This dataset is a set of questions collected from different web sources, and manually classified into the six cognitive levels of Bloom's Taxonomy <cit.>.



  
TREC The Text REtrieval Conference (TREC) dataset contains ∼6000 questions from four sources—4,500 English questions published by USC <cit.>, about 500 manually constructed questions for a few rare classes, 894 TREC 8 and TREC 9 questions, and also 500 questions from TREC 10 which serves as the test set. These questions were manually labeled into 6 coarse and 50 fine class labels.

Aside from TREC, for which the dataset split was obtained from HuggingFace [<https://huggingface.co/datasets/CogComp/trec>], the train/test split was given by a pre-determined seed. 



 §.§ Performance Evaluation


We compare the performance of our proposed model with selected baseline models in Table <ref>, including vanilla CNN and Bi-LSTM for non-graph classification models.

PQ-GCN outperforms the baseline models in the macro-averaged evaluation on ARC, LREC, and TREC-coarse datasets, and second to the best performing model for NU and Bloom datasets. The improvement from the base SHINE model is also highlighted, as we have kept the original features as proposed by Wang et al., showing the effectiveness of phrase-based features in improving question classification capabilities.

While performance on TREC-fine drops compared to its coarse label counterpart across all models is expected due to the large number of labels, our proposed model suffers from a larger difference compared to models such as HyperGAT or ME-GCN. TREC-fine was extensively labeled and was included in experiments to determine model capability in a more extreme and granular question classification task. In realistic educational settings, it is unlikely to have a question set that is labeled as intently as TREC-fine. 















































































§ CONSIDERATIONS FOR SYSTEM IMPLEMENTATION


In this section, we outline possible considerations for practical deployment of the trained model.

Compared with Transformer-based models <cit.> which scale quadratically with sequence length, GCNs offer a less computationally extensive alternative to text embedding-based classification. This allows for greater accessibility to educators without access to appropriate compute resources. 

In addition, node classification-based question classification is quick to train as at every epoch, the corpus-level graph is passed through the network once to obtain the logits for all samples, unlike traditional neural networks where samples are passed into the network batch by batch. This allows for a quick refresh of the model based on any new data points or even a whole new dataset.

There is also no need for a lot of labels for label propagation via cosine similarity at the question-level dynamic graph—some may not have access to well-labeled set of questions nor the resources for manual labeling. This is a crucial factor for learning analytics systems, and the fact that the proposed model performs well in low-resource settings shows its potential in such environments.

The proposed features can be made modular to suit the question corpus in context i.e. each individual graph can be added or removed from the model input to build the dynamic question-level graph. This will allow for greater flexibility in deployment of the model in various settings.



§ CONCLUSION AND FUTURE WORKS


The proposed method on applying GCNs to question classification shows promising results in capturing the intricate word and phrase relationships within question text. The next steps involve refining the model for specific educational and AI-driven applications, such as adaptive learning platforms or automated tutoring systems. Future work will focus on optimizing the model for deployment at scale, ensuring they can handle large volumes of data and provide real-time classification on user-provided questions. In conclusion, we hope to provide sufficient basis for further research into feature extraction methods for graph neural networks, especially in automatic question classification.
























































































































































































































































































































































































































































































































































































































































