SpanCoDy: A Contrastive and Dynamic Sampling Framework for Joint Entity and Relation Extraction

Published: 25 Aug 2025, Last Modified: 24 Apr 2026OpenReview Archive Direct UploadEveryoneCC BY 4.0
Abstract: Joint entity and relation extraction (joint ERE) aims to identify structured knowledge from unstructured text. However, span-based models often struggle with ambiguous boundaries, semantic overlap, and poor negative sample utilization.In this paper, we propose Span-based Contrastive and Dynamic Sampling Model (SpanCoDy), a span-based framework that enhances extraction performance through two improvements. First, we introduce a dynamic hard negative sampling strategy that jointly considers entity boundary overlap, positional distance, and span length to classify negative samples by difficulty level. By employing a length-aware grouping mechanism, SpanCoDy constructs more structurally diverse and informative training instances, significantly improving model robustness and generalization in complex entity settings. Second, we incorporate a contrastive learning objective based on entity pair representations, which encourages more discriminative and consistent entity encoding throughout the training process. Extensive experiments on benchmark datasets, including ACE04, ACE05 and SciERC, demonstrate that SpanCoDy achieves SOTA performance.These results validate the effectiveness of our approach in handling intricate entity recognition challenges and enhancing cross-domain generalization.
Loading