## 1 Introduction
Fundamentally, the entity-relation joint extraction task is transformed into an entity and relation classification task based on span representation embedding in the method. Therefore, the representation embedding of spans has a significant impact on the model performance. Previous studies have optimized the span embedding representation to improve the performance of the model on entity and relation extraction [1; 6; 7; 13; 14; 16; 17; 18]. For instance, [PERSON] et al. [13] and [PERSON] et al. [1; 6] used Bi-LSTM to obtain global span representation, which enhanced span representation richness by encoding information of bidirectional sequential context in a span, and improved model effectiveness. DyGIE++ [7] and SpERT [14] used pre-training models to enhance span representation, fused span representation based on pre-training models trained on large-scale corpus, and made the span representation have more extensive and accurate semantic expression. However, most studies on span representation embedding currently ignore the multi-level grammatical structure information in text. Most multi-span representations used for relationship classification also adopted simple concatenation and lack detailed semantic expression of contextual words in spans. At the same time, although the pre-training models with an attention mechanism have been used for span-based joint entity-relation extraction methods to obtain initial word embeddings, existing models still lack dynamic attention weighting for complex span or span pair embeddings in entity recognition and relation extraction tasks. These issues significantly limit the performance of the span-based joint entity-relation extraction models. To address the aforementioned issues, the span-based joint entity and relation extraction model with multi-level lexical and attention on context features (ER-LAC) is proposed in this paper. In this model, multi-level lexical information, including coarse-grained and fine-grained lexicon features, is integrated into the span embedding representation for both NER and ER tasks. Coarse-grained and fine-grained lexical features are encoded at the span and token levels, respectively, and combined with the original span embeddings to form enriched span embeddings with lexical information. Furthermore, multi-head self-attention modules [19] are employed in both sub-tasks, dynamically weighting span representations based on the intrinsic correlations among different feature dimensions of the spans, to improve the performance of the model on named entity recognition and relation extraction. The proposed model has been comprehensively evaluated on three commonly used entity-relation extraction datasets, and it is observed that the proposed model achieves 0.84% and 0.96% F1 score improvements over the SOTA models in NER and RE sub-tasks, respectively. The main contributions of this work are listed as follows:  
1. A multi-level lexical feature embedding method enhanced for span embedding representation was proposed, which enhances the semantic expression ability of span embedding representation in entity recognition and relation extraction through coarse-grained and fine-grained lexical feature embedding encoding at the span level and token level. 2. A relation extraction submodule based on a transformer encoder structure with multi-head self-attention was proposed, which can enhance the model's relation extraction performance by extracting temporal information of words in span and allocating self-attention weights accordingly. 3. The proposed model was found to outperform other SOTA models in three commonly used entity-relation extraction datasets. In the remaining part of the paper, the related works that are relevant to the proposed method in this paper are introduced in Section 2. Then, in Section 3, a detailed description of the proposed method is provided. The experimental setup and results are presented and then a discussion of the method and experimental results is given in Section 4. Finally, in Section 5, the conclusion of this work is given.