E-CARP: An Interpretable Text Classification Framework Based on Enhanced Context-Aware Reasoning Postprint
Zhang Yu, Wang Siying, Ding Qianhui
Submitted 2025-07-29 | ChinaXiv: chinaxiv-202508.00132

Abstract

This paper proposes an Enhanced Context-Aware Reasoning Framework (E-CARP) to improve the performance and interpretability of text classification tasks. The framework employs a fully endogenous parameterized memory network for storing domain knowledge and incorporates a dynamic relation reasoning mechanism to achieve efficient semantic understanding. Specifically, our method innovatively leverages the multi-head attention mechanism of pre-trained language models to dynamically activate keyword semantic features, thereby eliminating dependence on external knowledge bases; designs a lightweight template matching rule repository to support real-time recognition of complex semantic relations such as antonymy and intensification; and implements efficient implicit knowledge retrieval through trainable memory matrices and cosine similarity computation. Experiments on product review sentiment classification tasks demonstrate that E-CARP achieves 89.7% classification accuracy while reducing inference latency to 138 ms, yielding a 3.2× efficiency improvement over traditional external knowledge base-based methods. Ablation studies further validate the memory network's capability to capture long-tail domain knowledge, resulting in a 19.6% performance improvement in low-resource scenarios. Additionally, the framework enhances model decision interpretability through attention weight visualization and relation reasoning chain generation, providing a viable solution for text classification applications requiring high credibility in domains such as healthcare and law. This research offers a novel technical pathway for lightweight knowledge-enhanced NLP systems, holding significant theoretical value and practical implications.

Full Text

Preamble

E-CARP: An Enhanced Context-Aware Reasoning Framework for Interpretable Text Classification

Yu Zhang¹,², Siying Wang¹, Qianhui Ding¹

¹School of Intelligence Science and Technology & Beijing Key Laboratory of Super Intelligent Technology for Urban Architecture, Beijing University of Civil Engineering and Architecture, Beijing University of Civil Engineering and Architecture, Beijing 102616, China
²State Key Laboratory for GeoMechanics and Deep Underground Engineering, China University of Mining & Technology, Beijing 100083, China

Abstract

This paper proposes an Enhanced Context-Aware Reasoning Framework (E-CARP) to improve both performance and interpretability for text classification tasks. The framework employs a fully endogenous parametric memory network to store domain knowledge and integrates a dynamic relation reasoning mechanism to achieve efficient semantic understanding. Specifically, the method innovatively leverages the multi-head attention mechanism of pre-trained language models to dynamically activate semantic features of keywords, eliminating dependency on external knowledge bases; it designs a lightweight template matching rule library that supports real-time recognition of complex semantic relations such as antonymy and intensification; and achieves efficient implicit knowledge retrieval through a trainable memory matrix and cosine similarity computation.

Experiments on product review sentiment classification demonstrate that E-CARP maintains 89.7% classification accuracy while reducing inference latency to 138 ms, achieving a 3.2× efficiency improvement over traditional external knowledge base-based methods. Ablation studies further validate the memory network's capability to capture long-tail domain knowledge, resulting in a 19.6% improvement in classification performance under low-resource scenarios. Furthermore, the framework enhances model decision interpretability through attention weight visualization and reasoning chain generation, providing a viable solution for text classification applications in domains such as medicine and law that require high trustworthiness. This research offers a novel technical pathway for lightweight knowledge-enhanced NLP systems and holds significant theoretical value and practical implications.

Keywords: Text Classification; Context-Aware Reasoning; Memory Networks; Dynamic Relation Reasoning

Submission history

E-CARP: An Interpretable Text Classification Framework Based on Enhanced Context-Aware Reasoning Postprint