# A Novel Dual-Strategy Approach for Constructing Knowledge Graphs in the Home Appliance Fault Domain
## 3 Methodology
### Entity Linking and Relation Extraction Based on LLMs  
For traditional approaches using deep learning for entity linking and relation extraction tasks, several limitations exist. On the one hand, the lack of mature, large-scale fault datasets in the home appliance fault domain necessitates the use of extensive annotated data to train models for these tasks. Furthermore, such datasets must be meticulously designed and annotated for specific tasks, leading to high costs. On the other hand, the generalization ability of models is constrained by the diversity, quantity, and quality of training data. This limitation results in degraded performance when models encounter new domains or unseen data. Additionally, when dealing with different types of entities and relations, it may be necessary to retrain models or adjust parameters, thereby limiting their versatility and flexibility.  
In contrast, methods based on LLMs offer significant advantages in relation extraction tasks. These advantages stem from the fact that LLMs are pre-trained through unsupervised or weakly supervised learning approaches, which greatly reduces their dependence on annotated data. LLMs can learn rich linguistic knowledge and patterns from large volumes of unannotated text. Furthermore, because LLMs are pre-trained on massive and diverse multi-source datasets, they exhibit strong generalization capabilities, making them well-suited for tasks across various domains and scenarios. Even with limited annotated data, LLMs can achieve outstanding performance in relation extraction tasks. Additionally, by leveraging fine-tuning or prompt-based techniques, LLMs can quickly adapt to new task requirements without requiring structural modifications to the model.  
For the specialized domain of household appliance fault data, this study employs the ChatGLM4-plus model to perform entity linking and relation extraction tasks. First, the annotated dataset is used to establish a local knowledge base. Then, the recognized entity list, entity categories, and relationship types are provided as input data. Based on experimental requirements, different prompts are designed to guide the model in accomplishing entity linking and relation extraction tasks effectively.  
In terms of prompt design, this study adopts a progressive strategy to handle tasks incrementally through three steps: initializing the entity list, ontology linking, and relation extraction. Prior to issuing task-specific prompts, the process begins with initializing the entity list, which involves identifying entities through named entity recognition. Next, ontology linking is performed. The ontology linking phase starts with a task-specific prompt to ensure that the model has a clear understanding of the task at hand. Subsequently, specific input requirements are introduced, including domain restrictions and illustrative examples. Providing examples helps the model better learn and comprehend the requirements, thereby accelerating its understanding and improving its generalization ability. Finally, output standards are defined to ensure that the results are structured in formats such as JSON or HTML, facilitating further processing. After ontology linking, an additional prompt is issued based on the processed data to complete the relation extraction task. The detailed steps are illustrated in Figure 5.