# A Novel Dual-Strategy Approach for Constructing Knowledge Graphs in the Home Appliance Fault Domain
## 4 Experiments
### Computational Complexity and Hardware Resources  
Computational complexity and hardware resource requirements of the proposed model are critical factors in evaluating its practicality for real-world applications. The trade-off between computational cost and performance highlights the importance of balancing model complexity with practical deployment constraints, especially in resource-limited environments. The RoBERTa-zh-Bilstm-Attn-CRF model involves multiple layers of computation, including pre-training with RoBERTa-zh, bidirectional lstm processing, multi-head attention mechanisms, and CRF-based sequence optimization. The pre-training layer, which utilizes RoBERTa-zh, is the most computationally intensive component due to its Transformer architecture and large parameter size. Training this model on a GPU with 12 GB of memory required approximately 8 h for 10 epochs, with each epoch processing the dataset of 3156 entries in around 48 min. The memory usage peaked at 10.5 GB during training, primarily due to the storage of intermediate attention weights and gradient updates. For the LLM-based relation extraction tasks, the ChatGLM4-plus model demonstrated higher computational demands compared to traditional deep learning models. Each inference step for relation extraction consumed an average of 3.2 s on the same GPU, with memory usage reaching 9 GB. This is attributed to the model's large-scale parameters and the need for extensive context processing during progressive prompting. Despite these requirements, the model's ability to generalize with limited annotated data offsets the computational costs by reducing the need for extensive manual labeling.  
To further evaluate the efficiency of each model, we compared the average running time of different models in entity recognition and relationship extraction tasks in a single batch (batch size = 16) under the same hardware environment (12 GB GPU). The results are shown in Table 8:  
From the above table, it can be seen that the RoBERTa-zh pre-training and attention mechanism resulted in a 62% increase in single batch processing time from 0.42 s to 6.8 s, but in exchange for a 3.87% increase in F1- score (Table 6). Although ChatGLM4 plus has the longest inference time of about 3.15 s per batch, its F1- score has increased by 4.99% compared to traditional models, from 81.34% to 86.33%. The model performance and inference time show non-linear growth: ChatGLM4 plus is only 22% slower than ChatGPT-4o, but the accuracy is improved by 18.3% (Table 7).  
To optimize resource utilization, future work could explore techniques such as model quantization, gradient checkpointing, or distributed training to reduce memory overhead  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Model** & **NER Task** & **RE Task** & **Total Time** \\ \hline Bert-BiLSTM & 0.42 & - & 6.2 h \\ RoBERTa-zh-BiLSTM & 0.47 & - & 6.8 h \\ RoBERTa-zh-BiLSTM-CRF & 0.51 & - & 7.5 h \\ RoBERTa-zh-BiLSTM-Attn-CRF & 0.68 & - & 8.0 h \\ Bert-BiLSTM-CRF (RE Baseline) & - & 0.89 & - \\ ChatGPT-3.5-turbo & - & 1.92 & - \\ ChatGPT-4o & - & 2.57 & - \\ ChatGLM3 & - & 2.31 & - \\ ChatGLM4-plus & - & 3.15 & - \\ \hline \hline \end{tabular}
\end{table}
Table 8: Computational efficiency comparison of models (time per batch in seconds).  
and accelerate inference. Additionally, deploying the model on specialized hardware or cloud-based platforms could further enhance scalability for applications.