With the rapid development of information technology, there are many kinds of data. Due to the variability of unstructured data, the extraction of entity relationship is no longer based on rule. Therefore, this paper combines the pre-training model BERT with the two-way GRU neural network model, and adds an attention mechanism to complete the extraction of 12 groups of character relationships in this paper. The detailed extraction results are shown in Table 1. The F1 value of character relationship as “parent” is the highest, reaching 0.95; The F1 values of character relationships of “SELF”, “BROTHERS and SISTERS” and “CLASSMATES” all reached more than 0.9. The results show that the proposed model has certain advantages and high stability compared with other relationship extraction models.