Journal of Applied Science and Engineering

Published by Tamkang University Press

ESCI jase impact factor scopus logo open access rate of Scopus journal

Interpretable Artificial Intelligence Used to Diagnose Common Grammatical Errors in English Writing by Non-Native Engineering Researcher

Yafeng Liu

School of English Language and Culture, Xi’an Fanyi University, Xi’an 710105, China

Received: May 15, 2026
Accepted: July 24, 2026
Publication Date: August 22, 2026

上傳圖片

Architecture of TF–IDF and Logistic Regression-Based Grammatical Error Detection Framework

 Copyright The Author(s). This is an open access article distributed under the terms of the Creative Commons Attribution License (CC BY 4.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are cited.

Download Citation:  BibTeX | http://dx.doi.org/10.6180/jase.202611_34.065  

Download PDF

Grammatical error detection is an essential task in natural language processing that supports automated writing assistance and educational language assessment systems. This study proposes an explainable framework for identifying multiple categories of grammatical errors in English text. The model was evaluated using a dataset of 2,990 annotated English sentences containing both grammatically correct and erroneous structures across several error categories. The proposed framework integrates text pre-processing, Term Frequency–Inverse Document Frequency (TF–IDF) based word-level n-gram feature extraction, and a multi-class Logistic Regression (LR) classifier. The framework generates efficient numerical representations of textual data while capturing lexical, syntactic, and pragmatic characteristics for accurate grammatical error identification. To enhance transparency and interpretability, SHAP (SHapley Additive exPlanations) was employed to analyze feature importance and provide word-level explanations for classification decisions, thereby incorporating explainable artificial intelligence into grammar evaluation tasks. Experimental results demonstrate strong classification performance, achieving an accuracy of 0.9766, precision of 0.9376, recall of 0.9889, macro-average F1-score of 0.9603, and weighted F1-score of 0.9772. Furthermore, the Cohen’s Kappa coefficient of 0.9667 indicates a high level of agreement between predicted and actual labels, confirming the reliability of the proposed model. The combination of TF–IDF statistical text representation and interpretable logistic regression provides an effective, computationally efficient, and explainable solution for automated grammatical error identification.

Keywords: Grammatical Error Detection; Natural Language Processing; TF–IDF Feature Extraction; Logistic Regression; Explainable Artificial Intelligence; SHAP Interpretability

  1. [1] A. Musyafa, Y. Gao, A. Solyman, C. Wu, and S. Khan, (2022) “Automatic Correction of Indonesian Grammatical Errors Based on Transformer” Applied Sciences 12(20): 10380. DOI: 10.3390/app122010380.
  2. [2] H. Wei, (2025) “Design and Application of English Grammar Automatic Correction System Based on Machine Learning” Procedia Computer Science 261: 806–812. DOI: 10.1016/j.procs.2025.04.408.
  3. [3] P. R. Alapati et al., (2025) “Improving English Writing Skills Through NLP-Driven Error Detection and Correction Systems” International Journal of Advanced Computer Science and Applications 16(2): 1098–1100. DOI: 10.14569/IJACSA.2025.01602109.
  4. [4] N. Lin, H. Zhang, M. Shen, Y. Wang, S. Jiang, and A. Yang, (2025) “Corpus and Unsupervised Benchmark: Towards Tagalog Grammatical Error Correction” Computer Speech and Language 91: 101750. DOI: 10.1016/j.csl.2024.101750.
  5. [5] A. Yin, X. Ren, L. Yang, and M. Lu, (2026) “Decoding the Grammar of Heritage: A Machine Learning Framework for Sustainable and Adaptive Reuse of Venice’s Built Fabric” Journal of Engineering and Applied Science 73(1): 213. DOI: 10.1186/s44147-026-01045-z.
  6. [6] M. Karimiabdolmaleki, L. Farias Wanderley, M. Cutumisu, M. Rezazadeh, and C. Demmans Epp, (2025) “Negative Language Transfer Identification in the English Writing of Chinese and Farsi Native Speakers” International Journal of Artificial Intelligence in Education 35(4): 2215–2253. DOI: 10.1007/s40593-025-00468-8.
  7. [7] Q. Luo, (2024) “EMI Teachers’ Attitudes and Approaches towards Grammar Error and Professional Development Perspectives in Chinese Higher Education” International Journal of Social Science and Public Administration 3(3): 12–23. DOI: 10.62051/ijsspa.v3n3.02.
  8. [8] S. T. D. Handayani, (2024) “Grammar Mistakes of Engineering Students’ Research Titles Writing in English” Morfologi: Jurnal Ilmu Pendidikan Bahasa Sastra dan Budaya 2(5): 40–52. DOI: 10.61132/morfologi.v2i5.909.
  9. [9] Y. Zhang, H. Eto, and J. Cui, (2025) “Linguistic Challenges of Writing Papers in English for Scholarly Publication: Perceptions of Chinese Academics in Science and Engineering” PLOS ONE 20(5): e0324760. DOI: 10.1371/journal.pone.0324760.
  10. [10] M. H. Ghannam et al., (2025) “Investigating of AI Tools’ Enhancement on the English Writing Skills among Non-Native Speakers” Journal of Social Studies 31(3): 105–125. DOI: 10.20428/jss.v31i3.2731.
  11. [11] J. Li et al., (2024) “Exploring the Potential of Artificial Intelligence to Enhance the Writing of English Academic Papers by Non-Native English-Speaking Medical Students: The Educational Application of ChatGPT” BMC Medical Education 24(1): 736. DOI: 10.1186/s12909-024-05738-y.
  12. [12] H. K. Aladsani, A. A. Al-Dokhny, and A. M. Drwish, (2026) “Practices and Evaluation of Generative AI in English-Language Publication: Insights from Saudi Non-Native English-Speaking Researchers” SAGE Open 16(1): 1–18. DOI: 10.1177/21582440261420858.
  13. [13] F. Algobaei and E. Alzain, (2026) “Prompt Engineering for Non-Native English Learners: A Generative AI Approach to Personalised Language Feedback” Social Sciences and Humanities Open 13: 102341. DOI: 10.1016/j.ssaho.2025.102341.
  14. [14] L. M. Ramjan et al., (2024) “University Students’ Experiences with Non-First Language as the Medium of Instruction: A Mixed Method Study” Higher Education Research and Development 43(2): 406–420. DOI: 10.1080/07294360.2023.2234297.
  15. [15] H. Chen, (2022) “Identification of Grammatical Errors of English Language Based on Intelligent Translational Model” Mobile Information Systems 2022(1): 4472190. DOI: 10.1155/2022/4472190.
  16. [16] Kaggle. Grammatical Errors in English Writing. Kaggle Dataset. Accessed March 23, 2026. 2026. URL: https://www.kaggle.com/.