The invention relates to a method for constructing a subject textbook
knowledge graph by using a large
language model, and the method is realized through six steps: firstly, introducing a self-prompt framework, generating relation synonyms, synthesizing samples and
sentence variants through three rounds of dialogues, and providing rich semantic guidance for subsequent relation extraction; secondly, guiding a large
language model to accurately extract core knowledge point entities from teaching materials, exercises and PPT texts by means of a professional field instruction template; then, respectively extracting an attribute triple and a relation triple of the knowledge points by applying a multi-round dialogue mode and combining with a synthetic sample prompt; then, inputting the extracted triad into a
verification module, and ensuring the accuracy through iterative
verification; and finally, generating an entity embedding vector by utilizing an MPNet model subjected to subject knowledge fine adjustment, calculating entity similarity through a dynamic weighted
pooling mechanism, judging entity pairs with high similarity, performing knowledge fusion if the entity pairs represent the same concept, and otherwise, reasoning a potential missing relationship and complementing the
knowledge graph. According to the method, the
knowledge graph of the course of the specific subject can be automatically constructed from the unstructured text efficiently and accurately, and powerful support is provided for teaching and learning of related subjects.