# Joint Extraction of Entities and Relations Based on Enhanced Span and Gate Mechanism
## 1 Introduction  
Entity and relation extraction is an essential approach to acquiring knowledge and represents a crucial step in knowledge extraction. It holds significant value in understanding both natural language and world knowledge. With the deepening research in knowledge extraction, entity and relation extraction has garnered considerable attention from scholars. The concept of entity and relation extraction was introduced more than twenty years ago. Its objective is to extract both named entities and the relationships between them from unstructured text, typically in the form of triplets. Early research on entity and relation extraction employed a pipeline-based approach [1; 2; 3], which decomposed the project into two attached tasks, namely, entity identification and relationship extraction. This means that all entities in the sentences must first be extracted, followed by the relationships within the sentences. Finally, relations are assigned to entity pairs. This method treats relation extraction as a relation classification problem. However, this method is prone to error propagation, as errors in the entity phase can be spread to the relation during the extraction phase. Additionally, the pipeline approach overlooks the interaction between the named entity recognition and relation extraction tasks, resulting in loss of information between the two subtasks. To address the aforementioned issues, researchers have proposed methods for joint entity and relation extraction. Initially, joint extraction methods relied on feature engineering [4]. However, with recent advancements in neural networks, the combination of neuralnetwork models [5] with pretrained language models [6] has garnered significant attention in the field of relation extraction. These approaches have shown remarkable progress, and have gradually become the primary method used for joint extraction. Current research on joint extraction of entities and relations has largely focused on addressing the challenges of relation overlap and nested entities. Relation overlap can be categorized into entity pair overlap and single-entity overlap. On the other hand, nested entities refer to the situation where multiple entity spans have the same start position and different end positions. A concrete example is shown in Figure 1.  
Currently, researchers have conducted extensive research on relation overlap and nested entities issues in joint entity and relation extraction. Among them, [PERSON] et al. [7] introduced the CasRel model, which employs a binary tagging strategy to model relations in the relation dataset. This model treats relations as a mapping function from the subject to the object. It first extracts the subject and then matches the object based on relation conditions, enabling the extraction of relation triplets. While the CasRel model effectively addresses relation overlap, it does not tackle nested entities. Furthermore, [PERSON] et al. [8] decomposed the entity and relation extraction task into two subtasks: head entity (HE) and tail entity relation (TER). They first extracted the head entities, then assigned related relationship and tail entities to each head entity. To address these subtasks, they decomposed them into multiple sequence labeling problems and utilized a hierarchical boundary labeler to predict the start and end positions of entities. To accommodate multi-span entities, they proposed a multi-span decoding algorithm. This approach achieved notable results; however, it is not able to handle entity overlap. In addition, [PERSON] et al. [9] proposed a span-based Transformer model for relation extraction. This model treats each entity as a span and can improve extraction efficiency through positive and negative sample training. After performing type classification for each span and filtering them based on length restrictions, the model assigns the corresponding relations.