# Entity Extraction of Key Elements in 110 Police Reports Based on Large Language Models
## 3 Materials and Methods
### Entity Alignment  
This study proposes a two-stage entity alignment method specifically designed for aligning entities within the four key elements, processing one type of element at a time while leveraging information from the other elements. The overall process is illustrated in Figure 3.  
Stage One: Preliminary Screening  
Input: The initial input consists of an entity list from one specific key element among the four. These entities are derived from the extraction results of the large language model and need to be unified and aligned.  
Embedding: This step is implemented by using the text-embedding API of ChatGPT. Utilizing ChatGPT's embedding API allows for effective vectorization while preserving a certain level of semantics [59], which also facilitates the use of a unified model for subsequent detailed screening with ChatGPT. Each entity is input into ChatGPT's API to generate a vector representation for each entity.  
Candidate Entity Set: Based on the embeddings generated by ChatGPT, we calculate the similarity between entities using cosine similarity to measure vector similarity. Through continuous testing, we select entity pairs with a similarity greater than 90% to form the candidate entity set. This method effectively filters out all key elements that need alignment, while significantly reducing the number of entities requiring detailed comparison, thereby enhancing the efficiency of subsequent processing.  
Stage Two: Detailed Screening  
Figure 3: ChatGPT-based entity alignment.  
Context Introduction: For each candidate entity pair, relevant information from the other three key elements is introduced as context to aid the large language model in judgment. This step aims to provide a broader context for each candidate entity pair, ensuring the alignment process considers the entities' positions and relationships within the overall system.  
Prompt Engineering: Based on the combined context, carefully designed prompts are created. These prompts are intended to guide ChatGPT to more accurately understand and handle the entity alignment task, fully utilizing its language comprehension capabilities.  
ChatGPT Entity Alignment: The designed prompts and combined context are input into ChatGPT. Utilizing ChatGPT's strong semantic understanding and reasoning abilities, entities are aligned more precisely. This step can handle complex semantic relationships and subtle differences.  
Final Output: The aligned entity results are processed by ChatGPT. To further ensure the accuracy and reliability of the results, a manual review step is introduced. Professionals review the automatically aligned results to verify the correctness of the matches and make corrections if necessary. The result list includes matched entity pairs after deep semantic analysis and context consideration.  
The final output is a thoroughly analyzed and aligned entity list. This method makes full use of ChatGPT's semantic understanding capabilities, not only for generating embeddings but also for the final entity alignment, fully leveraging the power of large language models. It considers the overall relationship of the four key elements without isolating individual entities. The two-stage design ensures both efficiency (preliminary screening) and accuracy (detailed screening), with manual review as the final safeguard to ensure reliability and practicality. This method is particularly suitable for complex entity alignment tasks that require deep semantic understanding and context consideration, effectively handling large-scale, multi-source, heterogeneous entity data.