# Joint Extraction of Entities and Relations Based on Enhanced Span and Gate Mechanism
## 2 Related Work  
### Span Extraction  
A span typically refers to a contiguous segment or range within a piece of text. It can represent a single word, an entity, a phrase, or a range. In the context of relation extraction tasks, a span often indicate the textual segment between the source entity and the target entity of a relation. For example, in the sentence \"[PERSON] works at Apple\" we can mark \"[PERSON]\" as the span representing the source entity and \"Apple\" as the span representing the target entity. The model can learn from this span to understand the relationship between these two entities as \"works at.\" The use of spans is not limited to relation extraction tasks; they can be used for tasks such as event extraction, semantic role marking, and more. In these tasks, spans can be used to mark the boundaries of entities, events, or semantic roles.  
The earliest examples of using spans to address tasks related to relation extraction include the work by [PERSON] et al. [11] in solving the Coreference resolution task. Coreference resolution mainly solves the problem of multiple references to a single entity. [PERSON] et al. [12] improved the representation of spans using a retrieval-based span-level graph and calculating the n-gram similarity as the distance between spans to address the issue of nested entities. [PERSON] et al. [13] proposed a span-level relation extraction model. This model first obtains specific spans through token embeddings, then calculates a score vector for the entity type of each obtained span. The span is assigned to the entity type with the highest score, and the relations between span pairs are finally determined based on the computed scores. The model is based on a bidirectional LSTM architecture. [PERSON] et al. [14] regarded entity extraction as a reading comprehension task. They used a pointer network to predict the start and end indices of spans, allowing for the extraction of target entity spans. The above studies demonstrate the early adoption of spans in various tasks related to relation extraction. Spans have been utilized for coreference resolution, addressing nested entities, improving span representation, and extracting entity span for relation extraction tasks.  
The span-based approach is effective in addressing the issue of nested entities, that is, where overlapping or nested entities exist within the text. By marking the start and end positions of entities, the structure of nested entities can be accurately captured. Consequently, this approach has been widely adopted by recent models such as Sport [9] and PURE [15], which perform entity and relation extraction based on spans. However, these span-based relation extraction methods typically employ an enumeration approach, in which all possible spans are generated and then recognized as entities. This leads to a large number of redundant span combinations, increasing the complexity of the model. With the aim of addressing this, in the present paper we adopt a pointer network method inspired by MRC for predicting the start and end positions of spans. Additionally, a one-to-many matching method is proposed to combine the predicted start and end positions to form target spans. In this way, the proposed approach can effectively handle nested entities and alleviate the issue of redundant span combinations.