# Modeling Semantic-Aware Prompt-Based Argument Extractor in Documents
## 3 Approach
### Model for Dynamic Recognition of Event Types Based on Graph Neural Networks
#### 3.2.2 Heterogeneous Graph Construction  
We present a method for constructing a heterogeneous graph \(G\), which includes three types of nodes: entities, sentences, and documents. The purpose is to model the interaction relationships between sentences and entities. In the graph structure \(G=(V,E)\), the node set \(V\) consists of entities, sentences, and documents, while the edge set \(E\) is used to describe the associations between entities, entities and sentences, and documents and sentences. The initial embeddings of entity, sentence, and document nodes are constructed using different strategies. Entity node embeddings are obtained by averaging the word vectors within the entity, i.e., \(h_{e}^{(0)}=Mean_{j\in e}\{g_{j}\}\), while sentence node embeddings combine the maximum-pooled word vectors with positional embeddings, expressed as \(h_{s}^{(0)}=Max_{j\in s}\{g_{j}\}+SentPos(s)\). Document node embeddings are derived by aggregating sentence and entity embeddings within the document. To enhance representation, a multihead attention mechanism is applied. Sentence and entity embeddings are mapped to query, key, and value matrices, and then split into multiple attention heads. Each head computes attention scores, applies softmax normalization, and updates representations. The final embedding is generated by concatenating the results from all attention heads and passing them through a fully connected layer. The multihead attention mechanism can be described as follows:  
\[\text{MultiHeadAttention}(x)=\text{FC}((\text{Attention}(Q,K,V))_{1},\cdots,( \text{Attention}(Q,K,V))_{m}) \tag{6}\]  
where \(m\) indicates the number of attention heads. After computing the initial embedding vectors of sentences using multihead attention, we apply weighted pooling to aggregate these vectors along the document dimension, resulting in sentence-level document vectors. For entity embeddings, the word vectors within each entity are averaged to form a word embedding matrix of consistent size. Multihead attention is applied to the matrix, with outputs weighted and aggregated along the document dimension to produce word-level document vectors. These vectors are concatenated to form the document node's feature representation. The feature vector is then formally defined:  
\[\text{DocEmbedding}(X_{\text{sent}},X_{\text{token}})=[\text{Attention}(X_{ \text{sent}}),\text{Attention}(X_{\text{token}})] \tag{7}\]  
This model incorporates five types of edges to capture diverse interactions within the document:  
1. Sentence-sentence edges (S-S): These edges connect sentence nodes to model long-distance dependencies between sentences in a document. 2. Sentence-entity edges (S-E): These edges link sentences to all entities mentioned within them, capturing the contextual information of entities in the sentence. 3. Intra-sentence entity-entity edges (E-E intra): These edges connect different entities within the same sentence, indicating potential relationships between entities related to the same event. 4. Inter-sentence entity-entity edges (E-E inter): These edges link occurrences of the same entity across multiple sentences, facilitating the tracking and continuity of entities throughout the document. 5. Document-sentence edges (doc-S): These edges connect document nodes to sentence nodes, facilitating interactions between documents and sentences. By integrating these edge types, the model can effectively aggregate information from different nodes, improving the representation of long-distance dependencies between sentences and entities. This heterogeneous graph structure provides a holistic view for modeling interactions between entities and sentences, strengthening the document's overall structure. Furthermore, it enhances event-related information extraction by improving connections between documents and sentences. A multi-layer graph convolutional network (GCN) is utilized to capture global interactions within the graph, iteratively updating each node's representation across layers.