The invention relates to the technical field of recommendation algorithms, provides a graph
collaborative filtering course recommendation method based on interactive attention and comparative learning, and aims to solve the problem that a traditional recommendation
system is insufficient in modeling ability in a sparse interaction scene. The method comprises the following steps: firstly, constructing a user-course
bipartite graph, and utilizing a dynamic attention mechanism guided by an interactive opposite-end node: carrying out vector dot product through original embedding of the opposite-end node (for example, course embedding is used during user aggregation) and current embedding of a neighbor node, and generating an attention coefficient in combination with temperature parameter normalization; and multi-
level structure information aggregation is realized. Afterwards, local context features are fused through a multilayer graph convolutional network,
random noise disturbance is introduced to generate a multi-view comparison sample, the consistency of positive samples is maximized in combination with an InfoNCE
loss function, and the robustness of the model to
noise and sparse data is enhanced; and finally, optimizing user-course embedding in combination with Bayesian personalized sorting loss and comparison loss, and generating a personalized recommendation
list. According to the method, the key interaction relationship is screened through guided attention, the representation discrimination is improved in combination with comparative learning, and the recommendation precision in
cold start and data sparse scenes can be improved.