Abstract:Relation extraction is a core technology to construct a knowledge graph. The complexity of Chinese grammar and sentence structure as well as the limited feature extraction and poor semantic representation of the existing neural network model restrict the relation extraction of Chinese entities. A relation extraction algorithm based on a BERT pretraining model is proposed in this study. It preprocesses the corpus by extracting keywords, entity pairs and entity type and integrating them to strengthen the semantic learning ability of the BERT model, greatly reducing the loss of semantic features. Results are obtained by a Softmax classifier, which show that this model is better than the existing neural network model. In particular, the model reaches a F1-score of 97.50% on the Chinese data set.