Based on the teaching material of "Robotics" course, this paper studied the automatic knowledge graph construction, including knowledge points extraction and knowledge point relation extraction. We proposed a new method of extracting the first-level, second-level, and third-level knowledge points as well as their prerequisite relations of knowledge points in the textbook. For the problem of insufficient knowledge of the pre-trained language model in the specific field, methods such as incremental pre-training and optimization of cost functions are employed to integrate subject knowledge into the pre-trained language model, thus improving its effectiveness. To overcome the problem that the traditional method of relationship extraction can not be applied directly to the extraction of teaching materials, a new scheme for knowledge point relationship extraction based on keyword relationship is proposed. The experimental data from textbooks shows that the F1 score of knowledge point extraction reaches 93%, considerably improved compared to the traditional model. Consequently, the knowledge point entity extraction and relationship extraction methods based on the pre-trained model can effectively extract structured information and facilitate the automatic construction of knowledge graphs.