To address the issues of scarce tail-class samples, insufficient fitting of pre-trained language models, and the reliance on global static structures in existing graph-based methods for few-shot long-tail classification, a text classification method based on latent semantic clustering and graph interaction is proposed. Firstly, the language model is semantically warmed up using label descriptions to align texts and labels into a unified representation space. Secondly, learnable latent topic nodes are constructed through unsupervised clustering to serve as semantic relays between texts and labels, thereby alleviating the semantic sparsity of tail categories. Finally, an independent heterogeneous subgraph is dynamically constructed for each text instance, local information is aggregated via a graph neural network, and text representations are enhanced through a cross-attention mechanism. Experimental results on 5 benchmark datasets demonstrate that after integrating the proposed method with 3 fine-tuned baseline models (BERT, RoBERTa, and DeBERTa), the macro F1 score of the models is improved by 2.91 percentage points, and the macro tail F1 score is improved by 3.21 percentage points, showing a more significant enhancement in tail performance. Furthermore, its memory overhead is significantly lower than that of global graph methods, offering an effective and efficient solution for few-shot imbalanced classification.
文本分类作为自然语言处理(Natural Language Processing, NLP)的基础任务,广泛应用于新闻分类[1]、立场检测[2]等领域。随着深度预训练语言模型(Pre-trained Language Model, PLM)[3-4]的兴起,该领域取得了显著进展。然而在实际应用中,模型往往面临着少样本(Few-Shot)和长尾分布(Long-Tail Distribution)的严峻挑战。当某些类别仅有极少量标注样本时,依赖海量数据驱动的PLM难以在微调过程中建立鲁棒的判别边界,极易陷入过拟合或对频繁类别的偏好。
本实验对所有基线模型均进行了严格复现。所有基线模型均采用官方开源代码实现,超参数设置遵循官方默认配置,且统一采用与本文方法一致的数据划分策略。对基于PLM的BertGCN和PaSIG,二者均选用bert-base-uncased作为基础PLM架构。为确保实验结果的可靠性与稳定性,每组模型训练过程均采用不同的随机数种子独立运行,最终实验结果为5组独立实验结果的平均值。所有实验均在NVIDIA Tesla V100S GPU硬件平台上完成。
DEVLINJ, CHANGM W, LEEK, et al. BERT: pre-training of deep bidirectional transformers for language understanding[C]//Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers). Stroudsburg, USA: ACL, 2019:4171-4186.
[4]
LIUY H, OTT M, GOYALN, et al. RoBERTa: a robustly optimized BERT pretraining approach[DB/OL]. (2019-07-26)[2026-01-14].
[5]
FINNC, ABBEELP, LEVINES. Model-agnostic meta-learning for fast adaptation of deep networks[DB/OL]. (2017-07-18)[2026-01-14].
[6]
LIUX, JIK X, FUY C, et al. P-tuning: prompt tuning can be comparable to fine-tuning across scales and tasks[C]//Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics. Stroudsburg, USA: ACL, 2022:61-68.
[7]
SNELLJ, SWERSKYK, ZEMELR. Prototypical networks for few-shot learning[C]//Proceedings of the 31st International Conference on Neural Information Processing Systems. Red Hook, USA: Curran Associates Inc., 2017:4080-4090.
[8]
YAOL, MAOC S, LUOY. Graph convolutional networks for text classification[C]//Proceedings of the 33th AAAI Conference on Artificial Intelligence. Palo Alto, USA: AAAI Press, 2019:7370-7377.
[9]
LINY X, MENGY X, SUNX F, et al. BertGCN: transductive text classification by combining GNN and BERT[C]//Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021. Stroudsburg, USA: ACL, 2021:1456-1462.
[10]
ZHANGY F, YUX L, CUIZ Y, et al. Every document owns its structure: inductive text classification via graph neural networks[C]//Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics. Stroudsburg, USA: ACL, 2020:334-339.
[11]
DINGK Z, WANGJ L, LIJ D, et al. Be more with less: hypergraph attention networks for inductive text classification[C]//Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing. Stroudsburg, USA: ACL, 2020:4927-4936.
[12]
LIUY H, GUANR C, GIUNCHIGLIAF, et al. Deep attention diffusion graph neural networks for text classification[C]//Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing. Stroudsburg, USA: ACL, 2021:8142-8152.
[13]
WANGS Y, ZHOUG, LUJ C, et al. Pre-trained semantic interaction based inductive graph neural networks for text classification[C]//Proceedings of the 31st International Conference on Computational Linguistics. Stroudsburg, USA: ACL, 2025:812-827.
[14]
PIAOY H, LEES, LEED, et al. Sparse structure learning via graph neural networks for inductive document classification[C]//Proceedings of the 36th AAAI Conference on Artificial Intelligence. Palo Alto, USA: AAAI Press, 2022:11165-11173.
[15]
WANGY Z, WANGC X, ZHANJ Y, et al. Text FCG: fusing contextual information via graph learning for text classification[J]. Expert Systems with Applications, 2023,219:No.119658.
[16]
HEP C, LIUX D, GAOJ F, et al. DeBERTa: decoding-enhanced BERT with disentangled attention[DB/OL]. (2021-10-06)[2026-01-14].