Skip to main content
PLOS One logoLink to PLOS One
. 2025 Jan 9;20(1):e0309050. doi: 10.1371/journal.pone.0309050

Exploration of designing an automatic classifier for questions containing code snippets—A case study of Oracle SQL certification exam questions

Hung-Yi Chen 1, Po-Chou Shih 2,*, Yunsen Wang 3
Editor: Vincenzo Bonnici4
PMCID: PMC11717213  PMID: 39787175

Abstract

This study uses the Oracle SQL certification exam questions to explore the design of automatic classifiers for exam questions containing code snippets. SQL’s question classification assigns a class label in the exam topics to a question. With this classification, questions can be selected from the test bank according to the testing scope to assemble a more suitable test paper. Classifying questions containing code snippets is more challenging than classifying questions with general text descriptions. In this study, we use factorial experiments to identify the effects of the factors of the feature representation scheme and the machine learning method on the performance of the question classifiers. Our experiment results showed the classifier with the TF-IDF scheme and Logistics Regression model performed best in the weighted macro-average AUC and F1 performance indices. The classifier with TF-IDF and Support Vector Machine performed best in weighted macro-average Precision. Moreover, the feature representation scheme was the main factor affecting the classifier’s performance, followed by the machine learning method, over all the performance indices.

Introduction

Question classification associates a class label in the testing criteria with a question. It is a subfield in the document classification. Compared to general documents, questions are shorter, which makes the question classification more challenging [1–3].

The classification of questions in learning assessment is one of the applications of the automatic classifier [2]. When building a test bank, teachers must classify the questions into different exam topics for assembling a test paper with a specific scope according to the testing purpose. For example, Bloom’s Taxonomy is a classification of educational objectives to assess students’ learning outcomes, including levels of remembering, understanding, applying, analyzing, evaluating, and creating. Questions could be classified using Bloom’s Taxonomy to assess the learner’s cognitive ability. Alternatively, questions could be classified according to the exam topics to assess the learner’s proficiency in specific subjects.

Classifying questions is more challenging for programming course exams because the question stem or options often contain code snippets in addition to the general text descriptions. The code snippets’ particular syntax, such as structure, symbols, and variables, increases the complexity of the question classification. Taking the Oracle SQL certification exam questions as an example, the question stem could describe the report’s requirements, and the options provide various SELECT statements. Or, the question stem could be a SQL code snippet, and the question’s options could list the descriptions of the code intent. The SQL code snippets contain keywords (such as SELECT, UPDATE, WITH, etc.), field names, table names, and literals. All these make the question classifier design more sophisticated.

Classifying SQL exam questions is to build a test bank for making test papers for learning assessment. Teachers can collect historical questions from different sources and classify them by the exam topic in the test bank. Then, they select questions on specific topics from the test bank when assembling a test paper according to the teaching progress. Classifying questions manually is time-consuming and increases the teaching workload for teachers. An automatic question classifier can help teachers build a test bank effortlessly and reduce the workload.

The Literature on the question classifier in learning assessment primarily focuses on classifying questions with pure text content according to cognitive levels [4, 5] or knowledge domains [6, 7]. However, there needs to be more discussion on the classifier for classifying questions with code snippets, and this study fills the gap in the literature.

The study contributes to teaching by helping teachers automatically classify historical questions to build a test bank. For example, one can apply our study’s results to the test bank management module of the automatic test paper assembling system developed by [8]. When importing questions, the system suggests possible topic labels to reduce the classification workload. Then, teachers will have more time to conduct formative or summative assessments to provide students with learning feedback and improve teaching quality.

The study aims to compare various question classifier designs to explore the effects of the feature representation schemes and machine learning methods on the classifier’s performance for classifying Oracle SQL certification exam questions. We use a factorial experimental design to identify the effects and the best combination of the feature representation schemes and machine learning methods in the metrics of weighted macro-average Area Under Curve (AUC), weighted macro-average F1 score, and weighted macro-average accuracy.

The rest of the paper is organized as follows. Section two reviews the literature on the question classifiers. Section three presents the research design, including the dataset, the feature representation schemes, the machine learning methods, the search for the optimal parameter for ML methods, the indicators for evaluation, and the experimental design. Section four describes the experiment results and discusses the findings. Finally, the last section concludes the study.

Literature review

Question classifiers classify a question to a class in a non-overlapping set of classes. It is the multi-label classification if a question has multiple class labels or the single-label classification if only one class label is allowed [9].

Most question classifications applied in the learning assessment belong to the single-label classification problem under the multi-class labels, for example, classifying questions to a cognitive level according to Bloom’s Taxonomy [10, 11]. The question length in the learning assessment is generally shorter than the length of other documents. Because of the shorter content, the design of the question classifier is more challenging than the document classifier’s [1–3].

Since the datasets, feature representation schemes, and machine learning methods impact the question classifiers, the remaining is divided into three subsections: Dataset, Feature Representation and Word Weights, and Machine Learning Methods.

Datasets

Classifier development depends on the dataset and the knowledge domain. A classifier developed from a dataset in one domain is challenging to apply to another [6]. Words in the dataset may have varying weights across classification schemes for various domains [4]. Besides, the class number of the classification scheme and the dataset size affect the classifier’s design [11, 12].

The literature’s datasets cover several domains, such as business and marketing, computer science, computer programming, and operating systems. Since classification depends highly on the knowledge domain, most studies adopt custom classification schemes [3], such as the schemes for the science subject test [6] or the biomedical exam [7]. There are also general classification schemes, such as Bloom’s Taxonomy [13] or Costa Levels of Questioning [14]. Table 1 summarizes the knowledge domains, classification schemes, and the sizes of the datasets from the literature to develop the question classifiers.

Table 1. The datasets and classification schemes used in the literature to develop question classifiers in various knowledge domains.

Dataset ID Year Compiler Knowledge Domain Num of Items Classification Framework Used by Other Studies
DS01 2011 [15] Multi-disciplines 272 Bloom’s Taxonomy (BT) 6 classes [10]
DS02 2012 [16] Multi-disciplines 600 BT 6 classes [12, 13, 17, 18]
DS03 2012 [19] Computer programming 100 BT 6 classes [20]
DS04 2013 [21] Computer science 654 BT 6 classes [11]
DS05 2017 [22] Business and marketing domains 181 BT 6 classes [12]
DS06 2017 [23] Operating systems 1000 Revised BT 6 classes -
DS07 2017 [24] Computer programming 100 BT 6 classes -
DS08 2017 [22] Multi-disciplines 415 BT 6 classes [4, 12]
DS09 2020 [13] Multi-disciplines 141 BT 6 classes -
DS10 2021 [10] Course Learning Outcomes (CLO) statements from course documents 829 BT 6 classes -
DS11 2021 [5] Software engineering 844 BT 6 classes -

Feature representation and word weights

The question’s feature representation is one factor that impacts the classifiers. Previous studies mostly use the Term Frequency-Inverse Document Frequency (TF-IDF) to extract features [3]. Lilleberg et al. [25] pointed out that using the TF-IDF and word embedding schemes (such as Word2Vec) simultaneously performs better than TF-IDF alone because word embedding complements the semantic information that the TF-IDF cannot capture. Mohammed and Omar [13] employed the Term Frequency (TF)-Inverse Document Frequency (IDF) based on Part-Of-Speech (POS), abbreviated as TFPOS-IDF, to determine the word weights. The TFPOS-IDF gives different weights to words based on their POS tags to modify the term frequency in the TF-IDF scheme. Then, Word2Vec is used to extract the semantic, dense features of the words and combine them with their TFPOS-IDF representations. The resultant question feature vectors are dense and can reduce computational complexity and improve learning performance [26].

When words have characteristics that identify a class in the classification scheme, allocating higher weights to these words in the representation scheme can improve the classification performance. When using Bloom’s Taxonomy to classify questions, the Enhanced TF-IDF (E-TFIDF) gives verbs more weight, followed by nouns and adjectives [18]. The TFPOS-IDF uses the same concept and further distinguishes the verb types to provide different weights. The TFPOS-IDF performs better than the E-TFIDF and TF-IDF when using the support vector machine [4]. Gani et al. [12] proposed the Enhanced TFPOS-IDF (ETFPOS-IDF), which distinguishes verbs into Bloom’s Taxonomy and supporting verbs and gives them different weights. Compared to TF-IDF, the ETFPOS-IDF can improve the accuracy and F1-Measure by 5.2% and 5.7%, respectively.

Machine learning models

Besides the dataset and the feature representation scheme, the machine learning model affects the classification performance. The support vector machine (SVM) is the most used model in the literature [3]. In most cases, SVM outperforms other models, including the k-Nearest Neighbor (k-NN) [17, 18, 23], Naive Bayes (NB) [17, 18], Linear Regression [13], and Random Forest [12]. But, as an exception case, Abduljabbar and Omar [20] pointed out that k-NN performs better than SVM and NB.

We also found advanced models used in the literature. Osadi et al. [24] proposed an ensemble learning by combining rule-based, SVM, k-NN, and NB models and aggregating these results with the majority voting method to classify questions to cognitive levels in Bloom’s Taxonomy. If the dataset is large enough, at least 500 questions, one may consider deep learning models for classifying questions, such as BERT [11], LSTM [10], and CNN [5], because the deep learning models perform better than machine learning models in large datasets. Table 2 summarizes the datasets and models used in the literature to develop question classifiers; Table 3 summarizes the performance of the winning models in different datasets.

Table 2. The datasets and the machine learning models used in the literature to develop question classifiers.

Dataset ID Year Feature Rep. Winning Models Compared models Note Literature
DS01 2011 TF-IDF Linear SVM - Single model [15]
DS02 2013 TF-IDF SVM Rule-based, k-NN, NB - [17]
DS03 2015 Mutual Information k-NN SVM, NB - [20]
DS07 2017 POS for the rule-based method; Word Vector of the WordNet for the other methods. Ensemble of Rule-based, SVM, k-NN, and NB with the majority voting algorithm and WordNet Similarity - - [24]
DS06 2017 - SVM k-NNs Feature representation scheme is not mentioned. [23]
DS02 2018 Enhanced TF-IDF SVM k-NN, NB - [18]
DS02, DS09 2020 TFPOS-IDF and Word Vector of the WordNet SVM k-NN, LOGREG - [13]
DS11 2021 - CNN LSTM - [5]
DS01, DS10 2021 - LSTM - Single model [10]
DS04 2021 - Google’s BERT - Single model [11]
DS02, DS05, DS08 2022 ETFPOS-IDF SVM ANN, RF The winning model has the highest average F1 score of three datasets. [12]

Abbreviations for machine learning models: SVM: Support Vector Machine; k-NN: k Nearest Neighbors; NB: Naïve Bayes; LOGREG: Logistics Regression; ANN: Artificial Neural Network; RF: Random Forest; LSTM: Long Short-Term Memory; CNN: Convolutional Neural Network

Table 3. The performance of the winning machine learning models in different datasets in the literature.

Dataset ID Year Feature Rep. Winning Model Accuracy AUC Macro F1 Macro Precision Macro Recall Literature
DS01 2011 TF-IDF Linear SVM 0.874 - 0.393 0.858 0.291 [15]
DS02 2013 TF-IDF SVM 0.923 - 0.711 - - [17]
DS02 2018 Enhanced TF-IDF SVM - - 0.860 0.866 0.861 [18]
DS02 2020 TFPOS-IDF and Word Vector of the WordNet SVM - - 0.897 0.902 0.897 [13]
DS02 2022 ETFPOS-IDF SVM - - 0.840 - - [12]
DS03 2015 Mutual Information k-NN - - 0.898 - - [20]
DS04 2021 - Google’s BERT 0.826 - - - - [11]
DS05 2022 ETFPOS-IDF SVM - - 0.748 - - [12]
DS06 2017 - SVM 0.362 0.690 0.496 0.990 0.362 [23]
DS07 2017 POS for the rule-based method; Word Vector of the WordNet for the other methods. Ensemble of Rule-based, SVM, k-NN, and NB with the majority voting algorithm and WordNet Similarity. - - 0.785 0.853 0.777 [24]
DS08 2022 ETFPOS-IDF SVM - - 0.699 - - [12]
DS09 2020 TFPOS-IDF and Word Vector SVM - - 0.837 0.856 0.844 [13]
DS10 2021 - LSTM 0.740 - 0.730 0.730 0.740 [10]
DS11 2021 - CNN 0.800 - - - - [5]
DS01 2011 TF-IDF Linear SVM 0.874 - 0.393 0.858 0.291 [15]

In summary, the design of the question classifier depends on the knowledge domain and the classification scheme. Previous studies on the question classifier in learning assessment mainly focus on classifying questions with pure text contents. Most studies use TF-IDF to extract features from the questions. Other proposed derived TF-IDF schemes give different weights to words according to the characteristics of the classification scheme to improve the performance. SVM is one of the machine learning models that performs well in most studies. Deep learning models perform better than machine learning models in large datasets. However, there needs to be more discussion on the classifiers that classify questions containing code snippets. This study fills the literature gap by extending the question classifier’s design to questions mixed with text and code snippets.

Methodology

The study adopts the experimental design method to explore the effects of the feature representation schemes and machine learning models on the performance of the question classifiers for questions containing code snippets.

The study has the following assumptions and criteria to classify questions in the dataset:

  • The topics in the question classification scheme have basic and advanced inter-dependency. The advanced topics cover the knowledge scope of the basic subjects.

  • If a question contains multiple topics, we will label the question as the most advanced topic.

  • This study employs the Oracle SQL Expert exam topics as the classification scheme [27]. The exam topics are organized in a two-level hierarchy. Each topic can be further divided into multiple sub-topics. However, due to the limited number of questions in the dataset, only the first-level topics are used in the study. The topics and the number of questions in each topic are shown in Table 4. In the table, higher topic numbers indicate more advanced topics.

Table 4. The first-level topics in the Oracle SQL Expert exam and the number of questions in each topic in the dataset.

Topic ID Exam Topic Count
08 Using Subqueries to Solve Queries 27
12 Use DDL to manage tables and their relationships 26
07 Displaying Data from Multiple Tables 18
03 Restricting and Sorting Data 18
05 Using Conversion Functions and Conditional Expressions 15
10 Managing Tables using DML statements 13
06 Reporting Aggregated Data Using Group Functions 12
02 Retrieving Data using the SQL SELECT Statement 8
09 Using SET Operators 8
14 Controlling User Access 6
11 Managing Indexes Synonyms and Sequences 6
04 Using Single-Row Functions to Customize Output 6
13 Managing Views 4
01 Relational Database concepts 4

Dataset

The dataset contains 171 questions written in English and formatted with Markdown syntax and symbols. The question content may contain general text descriptions, markdown symbols, and SQL code snippets. The code snippets may appear in the question stem or the answer options.

The text in the SQL code snippets can be further divided into several types:

  • SQL reserved words, e.g., CREATE TABLE, SELECT, INSERT, UPDATE, etc.

  • Literals, e.g., numbers, strings, date strings, etc.

  • Data type keywords

  • Operators

  • Pseudo-columns, e.g., NEXTVAL

  • Schema object names, e.g., names for the table, column, function, sequence, etc.

Questions in the dataset were annotated with the topic identifications according to the assumptions and criteria mentioned before. Table 4 summarizes the categorization. The topic, "Using Subqueries to Solve Queries," contains the most questions, a total of 27 items accounting for 15%. The two topics, "Managing Views" and "Relational Database concepts," all contain the least number of questions; each has four items, accounting for 2%. The dataset is highly unbalanced. The topic with the most questions is about six times more than the least.

Data preprocessing

The data are pre-processed before extracting the features according to the following steps:

  1. Lowercase conversion and removal of special symbols: Convert all texts to lowercase. Remove the Markdown syntax, such as the image syntax “!()[]” and the table syntax “—+—,” etc. However, the SQL operators, such as +, -, *, /, -, %, _, etc., are retained.

  2. Lemmatization: The study used the spaCy en_core_web_sm 3.6.0 package [28] for lemmatization.

  3. Revise the incorrect lemmatization results: For example, the column name “ord_no” is lemmatized to “ord _ no,” which loses the original meaning.

  4. Stop word removal: Remove the stop words from the content, but do not include the SQL keywords. This study used the NLTK package [29] to handle the stop words.

The study does not perform stemming in the pre-processing process because it makes words lose their original meanings and affects the classification performance. For example, the SELECT in the SQL statement and the "selecting" and "selection" in the general text will all be converted to "select" after stemming, which makes the context information lost.

Feature representation

The study considers three feature representation schemes commonly used in the literature: Term Frequency-Inverse Document Frequency (TF-IDF), Word2Vector, and FastText.

TF-IDF value indicates the importance of a word in a document. When a word appears only in a single document and has a high frequency, the word is an essential feature of the document. The TF-IDF value of word i in question j is fij = tfij×idfi, where tfij is the frequency of word i in question j, and idfi is the scarcity measure to the word across all documents. The higher the word scarcity, the larger the value of idfi.

The process of using TF-IDF to vectorize a question involves two steps. In the fitting step, the TF-IDF model is trained on the training dataset to build the vocabulary and calculate idfi for each word in the vocabulary. Then, in the transform step, the learned vocabulary and the idfi values are used to encode a new question to a vector. The word frequency in the new question is multiplied by each word’s idfi value to generate the question vector. Specifically, let V be the vocabulary. Then, the vector of the new question j′ is:

vj′→=[tf1j′,…,tfij′,…,tf|V|j′)×[idf1,…,idfi,…,idf|V|]T, (1)

where tfij, is the frequency of word i in new question j′ and i∈V.

The second considered scheme, Word2Vec, is a word embedding model in natural language processing. Word2Vec represents a word with a fixed-dimension vector. Two adjacent word vectors mean they have similar meanings. Compared with the TF-IDF scheme, Word2Vec can capture the word’s semantic meaning. The study used Google’s 300-dimensional pre-trained word embeddings [30].

The last scheme, FastText, is also a word embedding model in natural language processing [31]. Instead of word vectors, FastText generates the embeddings of the n-gram characters that compose the word. When encountering an unknown word in the training dataset, FastText can split the word into multiple characters and combine the embeddings of these characters to generate the word embedding, which overcomes the Out-of-Vocabulary (OOV) problem.

We generate a question embedding by averaging the word embeddings for the question. Let vi→=[e1,…,ek,…,em] denote the embedding vector for word i, where ek is the k-th element in the embedding vector, and m is the embedding dimension. Additionally, let Vj be the set of words in question j. Then, the embedding vector for question j is:

vj→=∑i∈Vjvi→×1|Vj| (2)

Machine learning models

The study considers four commonly used models in the literature: Multinominal Naive Bayes (MNB), Logistics Regression (LOGREG), Linear Support Vector Machine (LSVM), and Support Vector Machine (SVM). The following describes the characteristics and parameters of each method.

MNB model has a high learning bias and is suitable for a small amount of data, commonly used as a baseline for comparison in the literature [32]. MNB’s parameter α≥0, a pseudo-count value, smooths the likelihood of a word in a class to avoid the zero-probability problem. The parameter makes the words not in the training samples have a non-zero probability of preventing zero probability in further computations. A more considerable α value results in a more significant smoothing effect and a simpler model.

LOGREG performs well in high-dimensional, sparse data. The parameter C controls the regularization strength when using L2 regularization in the LOGREG. A larger C value results in a smaller regularization strength and a more complex model [33].

LSVM is the most used method in the literature and performs very well [3]. Like the parameter in LOGREG, the parameter C controls the regularization strength when using L2 regularization in the LSVM.

Besides the linear classifiers of LOGREG and LSVM, the study also considers the non-linear classifier SVM adopting the Radial Basis Function (RBF) kernel. The RBF kernel has two parameters: C and γ. The parameter C controls the regularization strength to control the model complexity, as mentioned in the previous two classifiers. The parameter γ controls the influence of the training observations near the decision boundary since the observations near it determine the decision boundary. The larger the γ value is, the smaller the impact of the observations far from the decision boundary is, which has a smoother decision boundary [34].

Parameter optimization

This study employs stratified K-fold cross-validation to evaluate the generalization ability of the models in the learning phase. The stratified split of the training dataset ensures that each fold contains learning instances in all classes, which is suitable for the unbalanced dataset.

In our dataset, the 01 and 13 topics contain the fewest questions, with only four questions each. The stratified split divides the dataset into the training and test datasets. In the training dataset, the 01 and 13 topics contain only three questions each. Therefore, the study uses three-folds in the cross-validation to identify the model parameters with the best generalization ability.

This study uses the grid search to identify the model parameters to make a model with good generalization ability. The grid search performs cross-validation for each parameter combination and selects the best combination. The parameter search points for each model are set as follows:

  • MNB parameter α: logarithm scale interval [log10−2,log104], 20 equal parts.

  • C parameter in LOGREG, LSVM, and SVM: logarithm scale interval [log10−2,log1010], 20 equal parts.

  • γ parameter in SVM: logarithm scale interval [log10−9,log103], 13 equal parts.

When the grid search algorithm searches the best parameters, the study uses the One-versus-Rest (OvR) strategy to convert a multi-class into a binary classification problem. The study uses the Area Under the Curve (AUC) of the Receiver Operating Characteristic (ROC) to guide the search, as AUC is a simple and robust metric for comparing the effectiveness of classification models.

Evaluation metrics

The study measures the classifier performance with the following metrics: weighted precision, weighted F1-score, and weighted AUC because of the unbalanced question dataset in the study. The weighted metrics consider the class imbalance by weighting the class metrics by their proportion. Their metrics are presented as the following.

The recall rate measures the ability of the classifier to detect positive instances, given all positive instances that exist either in the true positive or false negative cases. Let TP be the number of true positive instances, FP be the number of false positive instances, TN be the number of true negative instances, and FN be the number of false negative instances, respectively. Under the One-vs-Rest (OvR) multiclass strategy, the recall rate for the class c is calculated as follows:

Rc=TPcTPc+FNc. (3)

Let wc be the proportion of the class c in the dataset. Then, the weighted macro-average recall rate for all classes is:

wR=∑c=1LwcRc, (4)

where L is the total classes in the dataset.

The precision rate measures the ability of the classifier to identify positive instances given all predicted positive instances composed of TP and FP cases. The precision rate of the class c is:

Pc=TPcTPc+FPc. (5)

Then, the weighted macro-average precision rate for all classes is:

wP=∑c=1LwcPc. (6)

The F1 score is the harmonic mean of the precision and recall rates, considering the balance between the precision and recall rates. When the precision and recall rates are not equal, the F1 score decreases. The F1 score of the class c is:

F1c=2*Pc*RcPc+Rc. (7)

Then, the weighted macro-average F1 score for all classes is:

wF1=∑c=1LwcF1c. (8)

The ROC curve is not affected by the imbalanced dataset and is suitable for evaluating classifiers. Plotting an ROC curve requires the true positive rate (TPR) and the false positive rate (FPR) as the X and Y axes, respectively. The TPR is the same as the recall rate. The area under the ROC curve (AUC) quantifies the classifier performance. A large AUC value indicates the TPR is higher than the FPR, which means the classifier performs better. A random guess classifier has an AUC value of 0.5, and a perfect classifier achieves 1.

The study employs the weighted macro-average FPR and TPR to calculate the AUC value of the model. The FPR of the class c is:

FPRc=FPcFPc+TNc. (9)

Then, the weighted macro-average FPR for all classes is:

wFPR=∑c=1CwcFPRc. (10)

Since the TPR is the same as the recall rate, the weighted macro-average TPR for all classes is the same as Eq (4).

The accuracy rate is biased in the unbalanced dataset because it is affected by the majority class [35]. Since the question dataset in the study is unbalanced, the study does not employ the accuracy rate for evaluation. Additionally, the study does not adopt the weighted macro-average recall rate since it equals to the accuracy rate.

Experiment design and data analysis procedure

Factors and responses

The study employs factorial experiments to examine the effects of feature representation schemes and machine learning models on the classifier’s performance. The experiment considers two factors and three responses, as shown in Table 5. The first factor is the feature representation scheme, which has three levels: TF-IDF, Word2Vec, and FastText.

Table 5. The factors and responses in the experiment.
Independent Variables Response Variables
Factors Levels
Feature Representation Schemes (FRS) TF-IDF: Term Frequency—Inverse Document Frequency wAUC: Weighted macro-average AUC.
Word2Vec: Google News pre-trained word embeddings with 300 dimensions wP: Weighted macro-average precision.
FastText: Facebook pre-trained word embeddings with 300 dimensions wF1: Weighted macro-average F1.
Machine Learning Models (MLM) LOGREG: Logistics Regression
MNB: Multinomial Naïve Bayes
LSVM: Linear Support Vector Machine
SVM: Support Vector Machine with Radial Basis Function (RBF) kernel

The second factor is the machine learning model, which has four levels: Logistics Regression, Multi-nominal Naive Bayes, Linear Support Vector Machine, and Support Vector Machine with the Radial Basis Function as the kernel.

The response variables include weighted macro-average AUC, weighted macro-average precision, and weighted macro-average F1 score.

The two factors result in 12 groups. The experiment replicates 300 trials for each group, resulting in 3600 trials in total.

Power analysis

This study conducts the power analysis to ensure the statistical significance of the experiment results using the G*Power software [36]. The power of the experiment is 1.000 under the following conditions: the type I error α = 0.05, the degrees of freedom of the factors (3−1)×(4−1) = 6, the sample size 3600, and the effect size η2 = 0.025.

Program implementation and data analysis tools

The study implements the classifiers and the grid search with the Scikit-Learn library [37]. R language and related packages are used for data analysis and plotting.

Analysis procedure and methods

The data analysis procedure is as follows:

  1. Descriptive statistics and data distribution analysis: Analyze the mean, standard deviation, skewness, and kurtosis of the three responses. The normal distribution and homogeneity of variance across groups are tested.

  2. Analysis of Variance: The parametric ANOVA is performed if the response variable meets the normal distribution and homogeneity of variance assumptions. Otherwise, the non-parametric Aligned Ranks Transformation ANOVA (ART ANOVA) is used. ART ANOVA, a non-parametric method, does not require the data to meet the above two assumptions. ART ANOVA can analyze the main and interaction effects [38, 39], which is more suitable than the Sheirer-Ray-Hare Test [40].

  3. Post-hoc Analysis: If the response variable meets the assumptions of the normal distribution and homogeneity of variance, the Tukey HSD post-hoc analysis is performed. Otherwise, the Aligned Ranks Transformation Contrast is used to find the differences and effect sizes between the levels of each factor.

  4. Effect Size measurements in ANOVA and t-test: η2 is employed to measure the effect size of a significant effect in ANOVA. The thresholds for small, medium, and large effect sizes are 0.01, 0.06, and 0.14, respectively. Cohen’s d measures the effect size of the t-test. The thresholds for small, medium, and large effect sizes are 0.2, 0.5, and 0.8, respectively.

For the concise, the nomenclatures in the S1 Appendix are used to express the statistical results.

Experiment results and discussion

Experiment results

Table 6 summarizes the experiment results for the three performance metrics. The factors FRS, MLM, and their interaction significantly affect the weight macro-average AUC with large effects. The classifier using the TF-IDF scheme with the LOGREG model achieves the best performance, with a mean of 93.812%. Next, in the metric of the weighted macro-average precision, FRS and MLM factors significantly affect the performance with large effect sizes and their interaction with the intermediate effect. The classifier with the TF-IDF schema and the SVM model performs best, with a mean of 72.574% on the weighted macro-average precision. Lastly, the factors FRS, MLM, and their interaction significantly affect the weighted macro-average F1-score with large effect sizes. The classifier using the TF-IDF scheme and the LOGREG model achieves the best mean, averaging 81.574% on the weighted macro-average F1-score. The following subsections present the details.

Table 6. Summary of the experiment results for the three performance metrics: weighted macro-average AUC (wAUC), weighted macro-average precision (wP), and weighted macro-average F1-score (wF1).

Metric: wAUC(%)
Effects F-Value Effect Size (η2) Magitude of Effec Size Best Level Mean of Metric
FRS 3423.550 0.656 Large TF-IDF 92.924
MLM 757.710 0.388 Large LOGREG 88.900
FRS:MLM 343.700 0.365 Large (TF-IDF, LOGREG) 93.812
Metric: wP(%)
FRS 774.470 0.302 Large TF-IDF 72.378
MLM 110.700 0.156 Large LSVM 70.632
FRS:MLM 191.160 0.138 Intermediate (TF-IDF, SVM) 72.574
Metric: wF1(%)
FRS 2329.630 0.565 Large TF-IDF 61.468
MLM 1320.740 0.525 Large LOGREG 57.929
FRS:MLM 217.990 0.267 Large (TF-IDF, LOGREG) 63.545

Weighted macro-average AUC (wAUC)

The mean, median, mode, standard deviation, skewness, and kurtosis of all wAUC values are 86.581%, 87.092%, 86.093%, 6.31, -0.699, and 0.273, respectively. The wAUC values do not distribute as the normal curve (Anderson-Darling Stat = 27.489 p <0.001) and do not have homogeneity of variance (Levene’s Test F = 33.844 < 2.2e-16); Fig 1 shows the wAUC distributions of the twelve groups. The groups in the TF-IDF levels have smaller variances than the others.

Fig 1. The distributions of the weighted macro-average AUC values for groups of various combinations of feature representation schemes and machine learning models.

Fig 1

Aligned Ranks Transformation ANOVA (ART ANOVA) was used to analyze the variances since the wAUC values do not meet the normality and homogeneity of variance assumptions.

The FRS factor (F = 3423.55, p < 2.22e-16, DF = 2), and the MLM factor (F = 757.71, p < 2.22e-16, DF = 3) were significant; so was the interaction (F = 343.70, p < 2.22e-16, DF = 6). The FRS factor generated the largest effect size (ηFRS2 = 0.656), followed by the MLM factor (ηMLM2 = 0.388) and the interaction (ηFRS:MLM2 = 0.365).

The means for the factors and their interaction are shown in Fig 2. In the FRS factor, the TF-IDF level performed the best (mT = 92.924), and the worst was the FastText level (mF = 82.934). The post-hoc analysis indicated that the TF-IDF produced a significantly larger effect size than the other two levels (tT−W = 67.404, p < 0.0001, dT−W = 3.05; tT−F = 75.269, p < 0.0001, dT−F = 2.09).

Fig 2. The mean analysis of the weighted macro-average AUC values for FRS, MLM factors, and their interactions.

Fig 2

For the MLM factor, LOGREG had the best mean (mL = 88.900), and MNB had the worst (mM = 82.671), as shown in Fig 2. The post-hoc analysis indicated that the LOGREG produced a significantly large effect size compared to the MNB (tL−M = 44.320, p < 0.0001, dL−M = 0.909). Although the mean of the LOGREG was greater than that of the LSVM, the effect size was significantly small (tL−LS = 17.439, p < 0.0001, dL−LS = 0.459). Likewise, the effect size between the LOGREG and SVM was significantly small (tL−S = 6.944,p < 0.0001, dL−S = 0.203).

For the interaction of FRS and MLM factors, the group with the best mean was (TF-IDF, LOGREG) with m(T,L) = 93.812, followed by (TF-IDF, MNB) with m(T,M) = 93.056, as shown in Fig 2. However, no significant difference existed between the two groups (t(T,L)−(T,M) = 3.597, p = 0.0170). The mean of the group (TF-IDF, LSVM) (m(T,LS) = 92.3) was close to that of the group (TF-IDF, SVM) (m(T,S) = 92.5), and no significant difference existed between the two groups (t(T,LS)−(T,S) = -1.062, p = 0.9961). The group with the worst mean was (FastText, MNB) with m(F,M) = 73.706. The effect size between the best and worst groups was significantly large (t(T,L)−(F,M) = 72.962, p < 0.0001, d(T,L)−(F,M) = 5.07).

Since the variance of wAUC values did not homogeneous across groups, the post-hoc analysis examined the effect sizes in the four quantiles, as shown in Fig 3. In Fig 3, The best group (TF-IDF, LOGREG) is set to be the reference group. The three horizontal dash lines denote the thresholds for the small, medium, and large effect sizes. The reference group has the best performance in all quantiles. The differences caused by the best group ranged from small to large effect sizes compared to the other groups.

Fig 3. The effect size analysis on the weighted macro-average AUC values in the four quantiles for the interactions between the FRS and MLM factors.

Fig 3

Weighted macro-average precision (wP)

The mean, median, mode, standard deviation, skewness, and kurtosis of all wP values are 66.284%, 67.232%, 70.172%, 9.553, -0.470, and -0.035, respectively. The wP values do not distribute as the normal curve (Anderson-Darling Stat = 13.4768, p < 0.001) and do not have homogeneity of variance (Levene’s Test F = 38.273, p < 2.2e-16). Fig 4 shows the wP distributions in all factor-level combinations. The data in the group (Word2Vec, MNB) is distributed as a bimodal curve. The groups with the TF-IDF scheme exhibit less variance than the others.

Fig 4. The distributions of the weighted macro-average precision values for groups of various combinations of feature representation schemes and machine learning models.

Fig 4

This study uses the non-parametric ART ANOVA to analyze the variances of the wP values. The FRS factor produced a significantly large effect size (F = 774.47, p < 2.22e-16, DF = 2, ηFRS2 = 0.302); So did the interaction of the FRS and MLM factors (F = 110.70, p < 2.22e-16, DF = 6, ηFRS:MLM2 = 0.156). However, the MLM factor produced a significantly medium effect size (F = 191.16, p < 2.22e-16, DF = 3, ηMLM2 = 0.138).

Fig 5 shows the mean analysis of the wP values for the FRS, MLM factors, and their interaction. In the FRS factor, the TF-IDF level contributed the best mean (mT = 72.378), and the worst was the FastText level (mF = 61.895). The post-hoc analysis indicated that the TF-IDF produced a significantly larger effect size than the FastText (tT−F = 37.769, p < 0.0001, dT−F = 1.33).

Fig 5. The mean analysis of the weighted macro-average precision values for FRS, MLM factors, and their interactions.

Fig 5

For the MLM factor, the LSVM level contributed the best mean (mLS = 70.632), and the worst was the MNB level (mM = 62.562), as shown in Fig 5. The post-hoc analysis indicated that their difference was significantly medium (tLS−M = 23.672, p < 0.0001, dLS−M = 0.795). Instead, the means of the LOGREG and SVM levels were close (mL = 66.184, mS = 76.76), and no significant difference existed between the two levels (tL−S = 1.565, p = 0.3988).

As for the interactions, the groups with the TF-IDF scheme but different machine learning models performed quite closely. There were no significant differences between the groups. The means for the various machine learning models from high to low were SVM (m(T,S) = 72.574), MNB (m(T,M) = 72.515), LOGREG (m(T,L) = 72.484), and LSVM (m(T,LS) = 71.939), given the TF-IDF scheme.

The worst group was (FastText, MNB) with m(F,M) = 51.584. Compared to the worst group, the best group (TF-IDF, SVM) generated a significantly large effect size (t(T,S)−(F,M) = 31.713, p < 0.0001, d(T,S)−(F,M) = 3.11).

As the variance of wP values was not evenly distributed among the groups, the post-hoc analysis examined the effect sizes within each quantile, as shown in Fig 6. The reference group is (TF-IDF, SVM) with the best mean of wP values among all groups. The reference group performed the best in the first two quantiles. But, in the third and fourth quantiles, the best groups become (TF-IDF, LOGREG) and (Word2Vec, MNB) respectively. In the fourth quantile, the group’s mean (Word2Vec, MNB) was greater than that of the reference group, and the effect size was significantly small (d(W,M)−(T,S)[4] = 0.264).

Fig 6. The effect size analysis on the weighted macro-average precision values in the four quantiles for the interactions between the FRS and MLM factors.

Fig 6

Weighted macro-average F1 (wF1)

The mean, median, mode, standard deviation, skewness, and kurtosis of all wF1 values are 50.829%, 53.342%, 58.216%, 12.796, -0.672, and 0.141, respectively. The wF1 values did not distribute as the normal curve (Anderson-Darling Stat = 37.477 p < 0.001) and were not evenly distributed among the groups (Levene’s Test F = 29.637 < 2.2e-16). Fig 7 shows the wF1 distributions in all factor-level combinations. A bimodal shape occurred in the group (Word2Vec, MNB). And, like the results in the wAUC and wP, the groups with the TF-IDF scheme caused less variance than the others.

Fig 7. The distributions of the weighted macro-average F1 values for groups of various combinations of feature representation schemes and machine learning models.

Fig 7

This study uses non-parametric ART ANOVA to analyze the variances since the distribution of wF1 values did not meet the assumptions for the parametric ANOVA. The FRS factor (F = 2329.63, p < 2.22e-16, DF = 2), the MLM factor (F = 1320.74, p < 2.22e-16, DF = 3), and their interaction (F = 217.99, p < 2.22e-16, DF = 6) were all statistically significant. The effect sizes of the FRS, MLM, and their interaction were large (ηFRS2 = 0.565, ηMLM2 = 0.525, ηFRS:MLM2 = 0.267).

The mean analysis of the factors and their interactions are shown in Fig 8. In the FRS factor, the TF-IDF level contributed the best mean (mT = 61.468), followed by the FastText level (mF = 45.396), and the worst was the Word2Vec level (mW = 45.623). As indicated by the post-hoc analysis, the TF-IDF generated a significantly larger effect size than the FastText (tT−F = 59.649, p < 0.0001, dT−F = 1.72). Nevertheless, no significant difference existed between the Word2Vec and FastText levels.

Fig 8. The mean analysis of the weighted macro-average F1 values for FRS, MLM factors, and their interactions.

Fig 8

As for the MLM factor, the best and worst levels were LOGREG (mL = 57.929) and MNB (mM = 41.938), respectively. Their difference in effect size was significantly large (tL−M = 52.077, p < 0.0001, dL−M = 1.330).

Fig 8 also shows the mean analysis of the interactions between the FRS and MLM factors. The best group was (TF-IDF, LOGREG) with mT,L = 63.545, and the worst was (FastText, MNB) with mF,M = 32.71. Additionally, their differences in effect size were significantly large (t(T,L)−(F,M) = 54.802, p < 0.0001, d(T,L)−(F,M) = 4.120).

Due to the uneven variance of wF1 values across the groups, the study examined the effect sizes within four quantiles, respectively, as shown in Fig 9. The figure uses the group (TF-IDF, LOGREG) with the best mean as the reference for comparing effect sizes. Unlike the case in the wP, the best group remained the same in all quantiles. Note that the effect sizes of all groups were almost flat from the first to fourth quantiles, except the group (Word2Vec, MNB). The exceptional group’s effect size increased after the second quantile.

Fig 9. The effect size analysis on the weighted macro-average F1 values in the four quantiles for the interactions between the FRS and MLM factors.

Fig 9

Discussion

The feature representation schema impacts the classifier’s performance the most, followed by the machine learning model and the interaction between the two, according to the experiment results. The feature representation schema converts the document/question features into numerical representations for machine learning models. Poor feature representations reduce the classifier’s performance. Many studies have focused on finding good feature representations to improve the classifier’s performance, such as the feature representation for question classification [12, 13, 18] or document classification [41, 42]. In the experiments, the feature representation schema factors had the largest effect size, consistent with the literature.

A good feature representation schema improves the classifier’s performance and consistency across different machine-learning models. As shown in the mean analysis of the interactions in Figs 2, 5, and 8, the TF-IDF scheme classifiers had better performance and smaller performance variances across different machine learning models than those with the Word2Vec and FastText schemes. That implies that the quality of the feature representation schema should be prioritized when designing a question classifier.

When comparing the feature representation schemas, the experiment results indicated that the classifiers with the TF-IDF scheme outperformed those with the Word2Vec and FastText schemes in all performance metrics. Martinčić-Ipšić et al. [43] found that the TF-IDF method is not inferior to the word embedding method. Dessí et al. [44] and Khanna et al. [45] also reported that the TF-IDF method outperformed the word embedding scheme in document classification, especially for short documents [46].

There might be two reasons for the inferior performance of the word embedding scheme in question classification. Firstly, although the word embedding scheme captures the semantics of words, it does not consider the importance of words in the feature representation [47]. Secondly, the pre-trained word embedding schemes used in the study might need to learn the vocabulary in the SQL syntax or the table or column names. The table or column names in the SQL syntax are often abbreviated or combined with multiple words to form new names. These abbreviations and the new names might cause out-of-vocabulary problems in the pre-trained word embedding schemes. As a result, these schemes might lose some domain knowledge and harm the feature representation quality.

Nevertheless, the word embedding scheme sometimes outperforms the TF-IDF scheme. Arora et al. [48] reported that the word embedding scheme outperformed the TF-IDF scheme in classifying the instances in the TagMyNews dataset. They trained its word embeddings instead of pre-trained ones. That implies that if word embeddings can effectively represent the semantic information in the knowledge domain, word embedding would be more effective than TF-IDF.

As for the machine learning models, no consensus is reached on which model performs the best in all performance metrics in the experiment. The logistic regression model outperformed the others in the weighted AUC and weighted F1 metrics; the linear support vector machine outperformed the others in the weighted precision metric, as indicated by the experiment results.

Many studies in question classification reported that the SVM model outperformed the others [12, 13, 15, 18, 23]. These studies mainly used the TF-IDF scheme. In the study’s experiment, when using the TF-IDF scheme, the logistic regression model outperformed the others in the weighted AUC and weighted F1 metrics, and so did the SVM model in the weighted precision metric. Our experiment results are partially consistent with the literature.

Does the SVM model outperform the logistic regression model in all cases? No consensus exists in the literature. Pranckevičius and Marcinkevičius [49] reported that the logistic regression model outperformed the SVM model in classifying text reviews using the TF-IDF scheme. Musa [50] reported that the logistic regression model outperformed the SVM model in predicting the relevance of heart disease.

Theoretically, the loss functions of the SVM and logistic regression models behave similarly. Hence, they should have similar performance. If the separation between class instances is clear, the SVM model would outperform the logistic regression model. On the other hand, if the class instances overlap, the logistic regression model would outperform the SVM model [34]. Empirically, Salazar et al. [51] reported that the data distribution impacts the performance of the two models. If the data distribution is univariate, the logistic regression model outperforms the SVM model. Otherwise, the SVM model outperforms the logistic regression model. The data distributions in all groups in the experiment were univariate. Hence, it is reasonable that the logistic regression model sometimes outperformed the SVM model.

To summarize the discussion, the factors that impact the performance of classifiers include (i) the data distribution, (ii) the quality of the feature representation schema, (iii) the machine learning model, and (iv) the parameter settings. Hence, one should first consider the feature representation schema. Then, choose the appropriate machine learning model, considering the data distribution. Finally, tune the parameter settings of the machine learning model to achieve the best performance.

Conclusion

The study explores factors that affect the design of automatic classifiers for questions containing code snippets through factorial experiments, taking Oracle SQL certification exam questions as examples. Our research results show that the TF-IDF and Logistics Regression classifier performed best in the weighted macro-average AUC and weighted macro-average F1; the classifier with TF-IDF and Support Vector Machine performed best in the weighted macro-average Precision. Besides, the experiment results indicate that the feature representation scheme produces a more significant effect size than the machine learning method on the performance of the question classifiers. A good feature representation scheme can improve the performance and consistency of different machine learning methods. In addition, logistic regression and SVM models performed better than the linear SVM and MNB models.

Based on the experiment results and literature, this study concludes that the data distribution, the quality of the feature representation scheme, the machine learning models, and the parameter settings of the models are the main factors affecting the performance of the classifiers for questions containing code snippets. The feature representation scheme should be the first factor when designing a question classifier. Upon deciding on the feature representation scheme, one then chooses the appropriate machine learning model, considering the data distribution. Finally, fine-tune the parameter settings of the machine learning model to achieve the best performance.

The contributions of this study are twofold. First, the study explores the design of automatic classifiers for questions containing code snippets. Hence, it fills the gap in the literature on question classification, which mainly focuses on questions with general text descriptions. Second, the study’s results enable teachers/practitioners to build a question classification system to suggest a topic for a question. That can help them automatically classify the collected historical questions to accelerate building a test bank and reduce teachers’/practitioners’ workload.

Due to the limited research resources, the study has the following limitations: (1) the number of questions in the dataset is 171. If the number of questions increases, other advanced models, such as neural networks or deep learning models, may be employed; (2) this study uses pre-trained word embedding schemes. The results might differ if self-trained word embedding schemes are used; (3) this study mainly discusses four machine learning models: logistic regression, SVM, linear SVM, and Multi-nominal Naive Bayes. Other machine learning models or ensemble learning methods may produce different results; (4) this study only focuses on SQL certification exam questions. Whether one can directly extend our research results to questions containing code snippets in other programming languages (such as Java, Python, etc.) needs further research.

In the future, one can develop ensemble learning models to improve the performance of the classifiers. Alternatively, one can establish classifiers with the incremental learning method to learn new instances online to adapt to the pattern changes when adding new questions to the test bank.

Supporting information

S1 Appendix. Appendix nomenclatures to express the statistical results.

(DOCX)

pone.0309050.s001.docx (35.8KB, docx)

Data Availability

The final dataset and accompanying code are available on the Open Science Framework, DOI [10.17605/OSF.IO/83HSA] (https://doi.org/10.17605/OSF.IO/83HSA).

Funding Statement

The author(s) received no specific funding for this work.

References

  • 1.Li X, Roth D. Learning question classifiers: The role of semantic information. Nat Lang Eng. 2002;12(3):229–49. [Google Scholar]
  • 2.Sangodiah A, Muniandy M, Heng LE. Question classification using statistical approach: A complete review. J Theor Appl Inf Technol. 2015;71(3):386–95. [Google Scholar]
  • 3.Silva VA, Bittencourt I, Maldonado JC. Automatic question classifiers: A systematic review. IEEE Trans Learn Technol. 2019;12(4):485–502. [Google Scholar]
  • 4.Sangodiah A, Fui YT, Heng LE, Jalil NA, Ayyasamy RK, Meian KH. A comparative analysis on term weighting in exam question classification. 5th International Symposium on Multidisciplinary Studies and Innovative Technologies (ISMSIT); 2021: IEEE; 2021.
  • 5.Laddha MD, Lokare VT, Kiwelekar AW, Netak LD. Classifications of the summative assessment for revised Bloom’s taxonomy by using deep learning. Int J Latest Trends Eng Technol. 2021;69(3):211–8. [Google Scholar]
  • 6.Xu D, Jansen PA, Martin J, Xie Z, Yadav V, Madabushi HT, et al., editors. Multi-class hierarchical question classification for multiple choice science exams. Proceedings of the Twelfth Language Resources and Evaluation Conference; 2020; Marseille, France: European Language Resources Association (ELRA).
  • 7.Wasim M, Asim MN, Ghani Khan MU, Mahmood W. Multi-label biomedical question classification for lexical answer type prediction. J Biomed Inform. 2019;93:103143. doi: 10.1016/j.jbi.2019.103143 [DOI] [PubMed] [Google Scholar]
  • 8.Chen HY, Liu YC, Liu XQ, Chiu V. The development of an automatic test assembly system for a formative assessment in mastery learning instruction: Case of the SQL mastery course. IEEE Access. 2023;11:95974–88. [Google Scholar]
  • 9.Tsoumakas G, Katakis I. Multi-label classification: An overview. Int J Data Warehous. 2007;3(3):1–13. [Google Scholar]
  • 10.Shaikh S, Daudpotta SM, Imran AS. Bloom’s learning outcomes’ automatic classification using LSTM and pretrained word embeddings. IEEE Access. 2021;9:117887–909. [Google Scholar]
  • 11.Zhang J, Wong CP, Giacaman N, Luxton-Reilly A, editors. Automated classification of computing education questions using Bloom’s taxonomy. Proceedings of the 23rd Australasian Computing Education Conference; 2021.
  • 12.Gani MO, Ayyasamy RK, Alhashmi SM, Sangodiah A, Fui YT. ETFPOS-IDF: A novel term weighting scheme for examination question classification based on Bloom’s taxonomy. IEEE Access. 2022;10:132777–85. [Google Scholar]
  • 13.Mohammed M, Omar N. Question classification based on Bloom’s taxonomy cognitive domain using modified TF-IDF and word2vec. PLoS One. 2020;15(3):e0230442. doi: 10.1371/journal.pone.0230442 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 14.Shanthi P, Krishnamurthi I. A semantic approach for question classification using register linear based model. Middle-East J Sci Res. 2015;34(4):685–94. [Google Scholar]
  • 15.Yahya AA, Osama A. Automatic classification of questions into Bloom’s cognitive levels using support vector machines. The International Arab Conference on Information Technology; Naif Arab University for Security Science (NAUSS), Riyadh, Saudi Arabia2011.
  • 16.Yahya AA, Toukal Z, Osman A, editors. Bloom’s taxonomy–based classification for item bank questions using support vector machines. Modern Advances in Intelligent Systems and Tools; 2012; Berlin, Heidelberg: Springer. [Google Scholar]
  • 17.Yahya AA, Osman A, Taleb A, Alattab AA. Analyzing the cognitive level of classroom questions using machine learning techniques. Procedia Soc Behav. 2013;97:587–95. [Google Scholar]
  • 18.Mohammed M, Omar N. Question classification based on Bloom’s taxonomy using enhanced TF-IDF. Int J Adv Sci Eng Inf Technol. 2018;8(4–2):1679. [Google Scholar]
  • 19.Haris SS, Omar N. A rule-based approach in Bloom’s taxonomy question classification through natural language processing. 7th International Conference on Computing and Convergence Technology (ICCCT); Seoul, Korea (South): IEEE; 2012. p. 410–4.
  • 20.Abduljabbar DA, Omar N. Exam questions classification based on Bloom’s taxonomy cognitive level using classifiers combination. J Theor Appl Inf Technol. 2015;78:447–55. [Google Scholar]
  • 21.Sanders K, Ahmadzadeh M, Clear T, Edwards SH, Goldweber M, Johnson C, et al., editors. The canterbury questionbank: Building a repository of multiple-choice CS1 and CS2 questions. Proceedings of the ITiCSE Working Group Reports Conference on Innovation and Technology in Computer Science Education-Working Group Reports; 2013; Canterbury, England, United Kingdom: Association for Computing Machinery.
  • 22.Sangodiah A, Ahmad R, Ahmad WFW. Taxonomy based features in question classification using support vector machine J Theor Appl Inf Technol. 2017;95(12):2814–23. [Google Scholar]
  • 23.Patil SK, Shreyas MM. A comparative study of question bank classification based on revised Bloom’s taxonomy using SVM and K-NN. 2017 2nd International Conference On Emerging Computation and Information Technologies (ICECIT); Tumakuru, India: IEEE; 2017. p. 1–7.
  • 24.Osadi KA, Fernando M, Welgama WV. Ensemble classifier based approach for classification of examination questions into Bloom’s taxonomy cognitive levels. Int J Comput Appl. 2017;162:1–6. [Google Scholar]
  • 25.Lilleberg J, Zhu Y, Zhang Y. Support vector machines and word2vec for text classification with semantic features. 2015 IEEE 14th International Conference on Cognitive Informatics & Cognitive Computing (ICCI*CC)2015. p. 136–40.
  • 26.Vajjala S, Majumder B, Gupta A, Surana H. Practical natural language processing: O’Reilly Media; 2020. [Google Scholar]
  • 27.Oracle [Internet]. Oracle database SQL exam number: 1z0-071: Oracle University; [cited 2022 Sep 10]. Available from: https://education.oracle.com/oracle-database-sql/pexam_1Z0-071.
  • 28.spaCy [Internet]. En_core_web_sm: Trained pipelines for english [cited 2023 Aug 10]. 3.6.0:[Available from: https://spacy.io/models/en#en_core_web_sm].
  • 29.NLTK [Internet]. Natural language toolkit [cited 2023 Aug 10]. 3.8:[Available from: https://www.nltk.org/].
  • 30.Google [Internet]. Word2vec 2013 [cited 2023 Aug 10]. Available from: https://code.google.com/archive/p/word2vec/.
  • 31.Facebook Inc. [Internet]. Word vectors for 157 languages 2022 [cited 2023 Aug 30]. Available from: https://fasttext.cc/docs/en/crawl-vectors.html.
  • 32.Manning CD, Raghavan P, Schütze H. Introduction to information retrieval: Cambridge University Press; 2008. [Google Scholar]
  • 33.Müller AC, Guido S. Introduction to machine learning with python: O’Reilly; 2016. [Google Scholar]
  • 34.James G, Witten D, Hastie T, Tibshirani R. An introduction to statistical learning: With applications in R. 2nd ed. New York: Springer; 2021. [Google Scholar]
  • 35.Provost F, Fawcett T. Data science for business: O’Reilly Media; 2013. [Google Scholar]
  • 36.Faul F, Erdfelder E, Lang A-G, Buchner A. G*power 3: A flexible statistical power analysis program for the social, behavioral, and biomedical sciences. Behav Res Methods. 2007;39:175–91. doi: 10.3758/bf03193146 [DOI] [PubMed] [Google Scholar]
  • 37.Pedregosa F, Varoquaux G, Gramfort A, Michel V, Thirion B, Grisel O, et al. Scikit-learn: Machine learning in Python. J Mach Learn Res. 2011;12:2825–30. [Google Scholar]
  • 38.Wobbrock JO, Findlater L, Gergle D, Higgins JJ, editors. The aligned rank transform for nonparametric factorial analyses using only anova procedures. Proceedings of the SIGCHI conference on human factors in computing systems; 2011; New York, NY, USA: Association for Computing Machinery.
  • 39.Mangiafico S. Summary and analysis of extension program evaluation in R. version 1.20.05, revised 2023 ed: Rutgers Cooperative Extension, New Brunswick, NJ.; 2016.
  • 40.Toothaker LE, Chang H-s. On "the analysis of ranked data derived from completely randomized factorial designs". J Educ Behav Stat. 1980;5(2):169–76. [Google Scholar]
  • 41.Yetisgen-Yildiz M, Pratt W, editors. The effect of feature representation on MEDLINE document classification. AMIA Annual Symposium Proceedings; 2005: AMIA Symposium. [PMC free article] [PubMed]
  • 42.Yilmaz S, Toklu S. A deep learning analysis on question classification task using word2vec representations. Neural Comput Appl. 2020;32(7):2909–28. [Google Scholar]
  • 43.Martinčić-Ipšić S, Miličić T, Todorovski L. The influence of feature representation of text on the performance of document classification. Appl Sci. 2019;9(4):743. [Google Scholar]
  • 44.Dessí D, Helaoui R, Kumar V, Recupero DR, Riboni D. TF-IDF vs word embeddings for morbidity identification in clinical notes: An initial study. arXiv preprint arXiv:210509632. 2021. [Google Scholar]
  • 45.Khanna S, Tiwari B, Das P, Das AK. A comparative study on various text classification methods. In: Das AK, Nayak J, Naik B, Dutta S, Pelusi D, editors. Computational intelligence in pattern recognition. Singapore: Springer Singapore; 2020. p. 539–49. [Google Scholar]
  • 46.Piskorski J, Jacquet G, editors. TF-IDF character n-grams versus word embedding-based models for fine-grained event classification: A preliminary study. Proceedings of the Workshop on Automated Extraction of Socio-political Events from News; 2020; Marseille, France: European Language Resources Association (ELRA).
  • 47.Zhang T, Wang L, editors. Research on text classification method based on word2vec and improved TF-IDF. Advances in Intelligent Systems and Interactive Applications (IISA 2019); 2020: Springer, Cham. [Google Scholar]
  • 48.Arora M, Mittal V, Aggarwal P, editors. Enactment of TF-IDF and word2vec on text categorization. Proceedings of 3rd International Conference on Computing Informatics and Networks; 2021; Singapore: Springer Singapore.
  • 49.Pranckevičius T, Marcinkevičius V. Comparison of naive bayes, random forest, decision tree, support vector machines, and logistic regression classifiers for text reviews classification. Balt J Mod Comput. 2017;5(2):221–32. [Google Scholar]
  • 50.Musa AB. Comparative study on classification performance between support vector machine and logistic regression. Int J Mach Learn Cybern. 2012;4:13–24. [Google Scholar]
  • 51.Salazar DA, Vélez JI, Salazar JC. Comparison between SVM and logistic regression: Which one is better to discriminate? Rev Colomb Estad. 2012;35(SPE2):223–37. [Google Scholar]

Decision Letter 0

Vincenzo Bonnici

2 May 2024

PONE-D-24-07100Exploration of Designing an Automatic Classifier for Questions Containing Code Snippets - A Case Study of Oracle SQL Certification Exam QuestionsPLOS ONE

Dear Dr. Shih,

Thank you for submitting your manuscript to PLOS ONE. After careful consideration, we feel that it has merit but does not fully meet PLOS ONE’s publication criteria as it currently stands. Therefore, we invite you to submit a revised version of the manuscript that addresses the points raised during the review process.

Please submit your revised manuscript by Jun 16 2024 11:59PM. If you will need more time than this to complete your revisions, please reply to this message or contact the journal office at plosone@plos.org. When you're ready to submit your revision, log on to https://www.editorialmanager.com/pone/ and select the 'Submissions Needing Revision' folder to locate your manuscript file.

Please include the following items when submitting your revised manuscript:

  • A rebuttal letter that responds to each point raised by the academic editor and reviewer(s). You should upload this letter as a separate file labeled 'Response to Reviewers'.

  • A marked-up copy of your manuscript that highlights changes made to the original version. You should upload this as a separate file labeled 'Revised Manuscript with Track Changes'.

  • An unmarked version of your revised paper without tracked changes. You should upload this as a separate file labeled 'Manuscript'.

If you would like to make changes to your financial disclosure, please include your updated statement in your cover letter. Guidelines for resubmitting your figure files are available below the reviewer comments at the end of this letter.

If applicable, we recommend that you deposit your laboratory protocols in protocols.io to enhance the reproducibility of your results. Protocols.io assigns your protocol its own identifier (DOI) so that it can be cited independently in the future. For instructions see: https://journals.plos.org/plosone/s/submission-guidelines#loc-laboratory-protocols. Additionally, PLOS ONE offers an option for publishing peer-reviewed Lab Protocol articles, which describe protocols hosted on protocols.io. Read more information on sharing protocols at https://plos.org/protocols?utm_medium=editorial-email&utm_source=authorletters&utm_campaign=protocols.

We look forward to receiving your revised manuscript.

Kind regards,

Vincenzo Bonnici, PhD

Academic Editor

PLOS ONE

Journal requirements:

When submitting your revision, we need you to address these additional requirements.

1. Please ensure that your manuscript meets PLOS ONE's style requirements, including those for file naming. The PLOS ONE style templates can be found at

https://journals.plos.org/plosone/s/file?id=wjVg/PLOSOne_formatting_sample_main_body.pdf and

https://journals.plos.org/plosone/s/file?id=ba62/PLOSOne_formatting_sample_title_authors_affiliations.pdf

2. Please note that PLOS ONE has specific guidelines on code sharing for submissions in which author-generated code underpins the findings in the manuscript. In these cases, all author-generated code must be made available without restrictions upon publication of the work. Please review our guidelines at https://journals.plos.org/plosone/s/materials-and-software-sharing#loc-sharing-code and ensure that your code is shared in a way that follows best practice and facilitates reproducibility and reuse.

3. When completing the data availability statement of the submission form, you indicated that you will make your data available on acceptance. We strongly recommend all authors decide on a data sharing plan before acceptance, as the process can be lengthy and hold up publication timelines. Please note that, though access restrictions are acceptable now, your entire data will need to be made freely accessible if your manuscript is accepted for publication. This policy applies to all data except where public deposition would breach compliance with the protocol approved by your research ethics board. If you are unable to adhere to our open data policy, please kindly revise your statement to explain your reasoning and we will seek the editor's input on an exemption. Please be assured that, once you have provided your new statement, the assessment of your exemption will not hold up the peer review process.

[Note: HTML markup is below. Please do not edit.]

Reviewers' comments:

Reviewer's Responses to Questions

Comments to the Author

1. Is the manuscript technically sound, and do the data support the conclusions?

The manuscript must describe a technically sound piece of scientific research with data that supports the conclusions. Experiments must have been conducted rigorously, with appropriate controls, replication, and sample sizes. The conclusions must be drawn appropriately based on the data presented.

Reviewer #1: Yes

**********

2. Has the statistical analysis been performed appropriately and rigorously?

Reviewer #1: Yes

**********

3. Have the authors made all data underlying the findings in their manuscript fully available?

The PLOS Data policy requires authors to make all data underlying the findings described in their manuscript fully available without restriction, with rare exception (please refer to the Data Availability Statement in the manuscript PDF file). The data should be provided as part of the manuscript or its supporting information, or deposited to a public repository. For example, in addition to summary statistics, the data points behind means, medians and variance measures should be available. If there are restrictions on publicly sharing data—e.g. participant privacy or use of data from a third party—those must be specified.

Reviewer #1: Yes

**********

4. Is the manuscript presented in an intelligible fashion and written in standard English?

PLOS ONE does not copyedit accepted manuscripts, so the language in submitted articles must be clear, correct, and unambiguous. Any typographical or grammatical errors should be corrected at revision, so please note any specific errors here.

Reviewer #1: Yes

**********

5. Review Comments to the Author

Please use the space provided to explain your answers to the questions above. You may also include additional comments for the author, including concerns about dual publication, research ethics, or publication ethics. (Please upload your review as an attachment if it exceeds 20,000 characters)

Reviewer #1: The authors evaluate the factors that affect the design of a classifier for questions containing SQL code snippets using the public dataset from the Oracle SQL certification exam as benchmark.

Comments:

- Line 47. “Bloom Taxonomy” A definition and/or explanation can help the reader.

- L88. The Literature Review section is very poor and poorly edited, unless considering the following sections, it seems more like a piece of the Introduction. Perhaps it would be better to integrate the following sections (L97, L113, and L131) into this one.

- TF-IDF/TFPOS-IDF and subsequent. Acronyms must be introduced before using them.

- L97. “Training Data Set” Perhaps, is "Classification Schemes" a more appropriate title?

- L99. “a data set in a domain is challenging to apply to another domain” Is this transfer learning or fine-tuning?

- Table 1. The alignment of the lines is unclear and makes reading complicated.

- L118. TFPOS-IDF needs a short explanation. The same for ETF-IDF and ETFPOS-IDF.

- L127. Is E-TFIDF a typos or a new method?

- L166. This section title does not seem necessary.

- L192. “manually labeled the questions” Is that the second column of Table 4?

- L221-223. These three lines should be better contextualised.

- L234. “We generate the question embeddings by compositing the word embeddings.” How? This part needs a better explanation.

- L235. “Let vij , i = 1 ... nj denote the” does question j have exactly j words?

- L287. “as follows: The recall” A capital letter should not be used after a colon.

- L289. “instances from TP and FN instances” Acronyms must be introduced before using them.

- L292. In equation (1), what does c represent?

- L361. “the following nomenclatures” Consider whether to move it to a separate section or to the appendix.

- Section Experiment Results and Discussion. The figures are of very low quality and not readable. In addition, tables could be added to better summarise the results.

- L536-540. “TF-IDF scheme outperformed those with the Word2Vec and FastText schemes”, “with the TF-IDF scheme outperformed those with the Word2Vec and FastText” Unhelpful repetitions. This section should be better maintained.

- From L545 to L553. Can these results also be valid with applications that contain code from other languages, such as C++ or Java?

- L556. “classifying the instances in the TagMyNews dataset.” It seems quite obvious since it is a different context. Perhaps it should be better explained.

- Check references section. For instance, who is the author-editor of the first entry?

**********

6. PLOS authors have the option to publish the peer review history of their article (what does this mean?). If published, this will include your full peer review and any attached files.

If you choose “no”, your identity will remain anonymous but your review may still be made public.

Do you want your identity to be public for this peer review? For information about this choice, including consent withdrawal, please see our Privacy Policy.

Reviewer #1: No

**********

[NOTE: If reviewer comments were submitted as an attachment file, they will be attached to this email and accessible via the submission site. Please log into your account, locate the manuscript record, and check for the action link "View Attachments". If this link does not appear, there are no attachment files.]

While revising your submission, please upload your figure files to the Preflight Analysis and Conversion Engine (PACE) digital diagnostic tool, https://pacev2.apexcovantage.com/. PACE helps ensure that figures meet PLOS requirements. To use PACE, you must first register as a user. Registration is free. Then, login and navigate to the UPLOAD tab, where you will find detailed instructions on how to use the tool. If you encounter any issues or have any questions when using PACE, please email PLOS at figures@plos.org. Please note that Supporting Information files do not need this step.

PLoS One. 2025 Jan 9;20(1):e0309050. doi: 10.1371/journal.pone.0309050.r002

Author response to Decision Letter 0


14 May 2024

The authors sincerely appreciate the reviewers' valuable comments and suggestions for improving the manuscript's quality. We have provided the Response-to-Reviewer letter, which responds to the reviewer's comments point-by-point. The letter is attached as a file in the re-submission process.

Attachment

Submitted filename: 3-Response to Reviewers.docx

pone.0309050.s002.docx (34.9KB, docx)

Decision Letter 1

Vincenzo Bonnici

6 Aug 2024

Exploration of Designing an Automatic Classifier for Questions Containing Code Snippets - A Case Study of Oracle SQL Certification Exam Questions

PONE-D-24-07100R1

Dear Dr. Shih,

We’re pleased to inform you that your manuscript has been judged scientifically suitable for publication and will be formally accepted for publication once it meets all outstanding technical requirements.

Within one week, you’ll receive an e-mail detailing the required amendments. When these have been addressed, you’ll receive a formal acceptance letter and your manuscript will be scheduled for publication.

An invoice will be generated when your article is formally accepted. Please note, if your institution has a publishing partnership with PLOS and your article meets the relevant criteria, all or part of your publication costs will be covered. Please make sure your user information is up-to-date by logging into Editorial Manager at Editorial Manager® and clicking the ‘Update My Information' link at the top of the page. If you have any questions relating to publication charges, please contact our Author Billing department directly at authorbilling@plos.org.

If your institution or institutions have a press office, please notify them about your upcoming paper to help maximize its impact. If they’ll be preparing press materials, please inform our press team as soon as possible -- no later than 48 hours after receiving the formal acceptance. Your manuscript will remain under strict press embargo until 2 pm Eastern Time on the date of publication. For more information, please contact onepress@plos.org.

Kind regards,

Vincenzo Bonnici, PhD

Academic Editor

PLOS ONE

Additional Editor Comments (optional):

Reviewers' comments:

Reviewer's Responses to Questions

Comments to the Author

1. If the authors have adequately addressed your comments raised in a previous round of review and you feel that this manuscript is now acceptable for publication, you may indicate that here to bypass the “Comments to the Author” section, enter your conflict of interest statement in the “Confidential to Editor” section, and submit your "Accept" recommendation.

Reviewer #1: All comments have been addressed

Reviewer #2: All comments have been addressed

**********

2. Is the manuscript technically sound, and do the data support the conclusions?

The manuscript must describe a technically sound piece of scientific research with data that supports the conclusions. Experiments must have been conducted rigorously, with appropriate controls, replication, and sample sizes. The conclusions must be drawn appropriately based on the data presented.

Reviewer #1: Yes

Reviewer #2: Yes

**********

3. Has the statistical analysis been performed appropriately and rigorously?

Reviewer #1: Yes

Reviewer #2: Yes

**********

4. Have the authors made all data underlying the findings in their manuscript fully available?

The PLOS Data policy requires authors to make all data underlying the findings described in their manuscript fully available without restriction, with rare exception (please refer to the Data Availability Statement in the manuscript PDF file). The data should be provided as part of the manuscript or its supporting information, or deposited to a public repository. For example, in addition to summary statistics, the data points behind means, medians and variance measures should be available. If there are restrictions on publicly sharing data—e.g. participant privacy or use of data from a third party—those must be specified.

Reviewer #1: Yes

Reviewer #2: Yes

**********

5. Is the manuscript presented in an intelligible fashion and written in standard English?

PLOS ONE does not copyedit accepted manuscripts, so the language in submitted articles must be clear, correct, and unambiguous. Any typographical or grammatical errors should be corrected at revision, so please note any specific errors here.

Reviewer #1: Yes

Reviewer #2: Yes

**********

6. Review Comments to the Author

Please use the space provided to explain your answers to the questions above. You may also include additional comments for the author, including concerns about dual publication, research ethics, or publication ethics. (Please upload your review as an attachment if it exceeds 20,000 characters)

Reviewer #1: (No Response)

Reviewer #2: The comments are appropriately addressed. The grammar of the writeup was improved, compared with the previous version. There are no changes.

**********

7. PLOS authors have the option to publish the peer review history of their article (what does this mean?). If published, this will include your full peer review and any attached files.

If you choose “no”, your identity will remain anonymous but your review may still be made public.

Do you want your identity to be public for this peer review? For information about this choice, including consent withdrawal, please see our Privacy Policy.

Reviewer #1: No

Reviewer #2: Yes: Ramesh Kumar Ayyasamy

**********

Acceptance letter

Vincenzo Bonnici

23 Aug 2024

PONE-D-24-07100R1

PLOS ONE

Dear Dr. Shih,

I'm pleased to inform you that your manuscript has been deemed suitable for publication in PLOS ONE. Congratulations! Your manuscript is now being handed over to our production team.

At this stage, our production department will prepare your paper for publication. This includes ensuring the following:

* All references, tables, and figures are properly cited

* All relevant supporting information is included in the manuscript submission,

* There are no issues that prevent the paper from being properly typeset

If revisions are needed, the production department will contact you directly to resolve them. If no revisions are needed, you will receive an email when the publication date has been set. At this time, we do not offer pre-publication proofs to authors during production of the accepted work. Please keep in mind that we are working through a large volume of accepted articles, so please give us a few weeks to review your paper and let you know the next and final steps.

Lastly, if your institution or institutions have a press office, please let them know about your upcoming paper now to help maximize its impact. If they'll be preparing press materials, please inform our press team within the next 48 hours. Your manuscript will remain under strict press embargo until 2 pm Eastern Time on the date of publication. For more information, please contact onepress@plos.org.

If we can help with anything else, please email us at customercare@plos.org.

Thank you for submitting your work to PLOS ONE and supporting open access.

Kind regards,

PLOS ONE Editorial Office Staff

on behalf of

Dr. Vincenzo Bonnici

Academic Editor

PLOS ONE

Associated Data

    This section collects any data citations, data availability statements, or supplementary materials included in this article.

    Supplementary Materials

    S1 Appendix. Appendix nomenclatures to express the statistical results.

    (DOCX)

    pone.0309050.s001.docx (35.8KB, docx)
    Attachment

    Submitted filename: 3-Response to Reviewers.docx

    pone.0309050.s002.docx (34.9KB, docx)

    Data Availability Statement

    The final dataset and accompanying code are available on the Open Science Framework, DOI [10.17605/OSF.IO/83HSA] (https://doi.org/10.17605/OSF.IO/83HSA).


    Articles from PLOS ONE are provided here courtesy of PLOS

    RESOURCES