Relation Extraction (RE) is crucial for transforming text into structured knowledge. Recently, large Pre-trained Language Models (PLMs) have significantly advanced RE capabilities, becoming a dominant approach. However, effectively applying these powerful PLMs to RE still faces challenges, notably in task-specific alignment and handling the class imbalance common in RE scenarios. This paper proposes two innovations to address these issues: (1) a hybrid hard-soft prompt learning strategy that combines fixed, templated hard prompts for structural guidance with learnable, layer-wise soft prompts for adaptive attention modulation, better aligning PLMs with RE task requirements; and (2) a novel batch-dynamic focal loss mechanism that mitigates class imbalance by dynamically adjusting sample weights based on class frequencies within each training batch. The proposed approach was evaluated on the Chinese SanWen benchmark dataset. Experimental results demonstrate advanced performance, achieving a Macro-F1 score of 72.47%, significantly outperforming existing methods. Ablation studies confirm the substantial contributions of both the hybrid prompting and the dynamic loss components. Our work presents effective techniques for enhancing PLM-based RE by improving task adaptation and robustness to data imbalance.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Hybrid Hard-Soft Prompt Learning and Batch-Dynamic Loss for Relation Extraction

  • Yuqi Yuan,
  • Xiong Luo,
  • Yichao Li,
  • Wenbing Zhao

摘要

Relation Extraction (RE) is crucial for transforming text into structured knowledge. Recently, large Pre-trained Language Models (PLMs) have significantly advanced RE capabilities, becoming a dominant approach. However, effectively applying these powerful PLMs to RE still faces challenges, notably in task-specific alignment and handling the class imbalance common in RE scenarios. This paper proposes two innovations to address these issues: (1) a hybrid hard-soft prompt learning strategy that combines fixed, templated hard prompts for structural guidance with learnable, layer-wise soft prompts for adaptive attention modulation, better aligning PLMs with RE task requirements; and (2) a novel batch-dynamic focal loss mechanism that mitigates class imbalance by dynamically adjusting sample weights based on class frequencies within each training batch. The proposed approach was evaluated on the Chinese SanWen benchmark dataset. Experimental results demonstrate advanced performance, achieving a Macro-F1 score of 72.47%, significantly outperforming existing methods. Ablation studies confirm the substantial contributions of both the hybrid prompting and the dynamic loss components. Our work presents effective techniques for enhancing PLM-based RE by improving task adaptation and robustness to data imbalance.