# A Large Language Model Driven Knowledge Graph Construction Scheme for Semantic Communication
## 3 Method  
In this section, an interactive semantic knowledge base construction method based on LLMs is proposed for semantic communication. The scheme consists of three components: public information collection, entity extraction and relationship analysis, and knowledge base generation, as shown in Figure 1.  
Stage 1: Public Information Collection  
The initial step involves assigning the primary task to LLMS to generate first-round output. Following this, operators sample the produced content to evaluate whether it complies with the specified requirements. In cases where discrepancies are detected, prompt engineering is employed to fine-tune the model through iterative refinement cycles. This iterative process persists until the corpus attains the predefined quality standards.  
Stage 2: Entity Extraction and Relationship Analysis  
a. Entity Extraction  
The LLMs extract entities to generate task-entity formatted data. Operators then randomly sample the output. For incomplete entity recognition or erroneous extraction results, prompt engineering guides iterative model adjustments until comprehensive and accurate entity identification is achieved.  
b. Relationship Analysis  
The relationship analysis task is delegated to the LLMs with integrated quantitative scoring principles, producing task-entity-score triples. These triples undergo operator verification through sampling reviews. When relationship interpretations deviate from practical observations, prompt-driven iterative refinement is implemented to obtain logically consistent triples.  
Stage 3: Knowledge Base Generation  
The system transforms validated triples into executable Knowledge base generated by Neo4j programs through LLM. Neo4j visualization is implemented via Python (version 3.9.2), followed by comprehensive CRUD operation testing (Create, Read, Update, Delete). If functional requirements remain unmet, prompt-based optimization is conducted to finalize an operational knowledge base.  
Our framework implements a knowledge base construction pipeline through LLM-mediated human-computer interaction. This improves knowledge base reliability through prompt engineering. The knowledge graph is visualized with Python and Neo4j. This framework completes the work of corpus collection, data preprocessing, and program writing through LLMs, which greatly improves the efficiency of the knowledge base construction and reduces labor cost. In addition, the output results are analyzed by manual sampling review, and the LLMs are fine-tuned by human-computer interaction through prompt engineering in order to improve accuracy. The complete workflow visualization is provided in Figure 2.  
In our prior research, the task knowledge base served as the foundation for task-oriented image semantic communication systems [16]. During semantic encoding/ decoding, it is essential to acquire the entity names and task relevance scores, necessitating a task knowledge graph structured as \"Task-Entity-Relevance Score\". This study implemented an LLM-powered construction pipeline comprising five stages: corpus acquisition, entity recognition, relevance assessment, graph generation, and continuous updating mechanisms.  
Figure 2: Flowchart of knowledge processing.