Knowledge graph(KG)plays an important role in various natural language processing applications.To overcome the incompleteness of KG,some researchers proposed Knowledge Graph Completion(KGC)methods to predict the missing parts based on the existing entities and relations in the KG,which has drawn significant attention in recent years.Usually,traditional KGC methods perform well if there are sufficient training data.However,most of the relations lack enough entity pairs for training.In this context,KGC in few-shot scenarios has attracted more and more attention.But,most of the few-shot KGC methods might fail to consider the difference of each neighbor entity when dealing with neighbors.Moreover,most of the methods only consider the influence of direct neighbors and ignore the influence of indirect neighbors when learning entity and relation embeddings.As a result,they might fail to make full use of the structural information and content information of KG.This means that it will be difficult to obtain the accurate embeddings of entities and relations,which leads to low performance in KGC.To handle these drawbacks,this dissertation proposes a few-shot Knowledge Graph Completion Model based on global pre-training.On the one hand,for each entity in KG,its different neighbor entities and relations have different correlations.Additionally,there may also be noise in the neighbor of the entity.Therefore,combined with the graph structure of KG,this dissertation applies Graph Attention Network(GAT)to learn entity and relation embeddings in KG.This will accurately demonstrate as well as reflect the different importance of different neighbors and better capture entity features,relation features and semantic similarity in arbitrary neighbor.On the other hand,in KG,in addition to the neighbor information contained in the entity’s direct neighbor,the entity’s n-hop neighbor also contains implicit information.Therefore,this dissertation expands the GAT to n layers,and learns the n-hop neighbor information of entities by adding relation embedding,to represent the entities and relations more accurately in the background KG,and further improve the completion performance of the proposed method.To verify the effectiveness of the proposed method,this dissertation conducts experiments on two public datasets.The experimental results show that this method can improve the quality of entity and relation embeddings.Moreover,in comparison with other baseline models,the proposed method can achieve better results in commonly-used KGC evaluation indicators.Meanwhile,to further demonstrate the effectiveness of the proposed method in applications,this dissertation designs an agricultural knowledge question and answer system based on this method.The pre-trained model learns entity and relation embeddings more accurately,and the completion model helps the knowledge graph to be more complete.So the system will obtain answers more accurately in question answering tasks. |