In recent years, stratospheric airships have increasingly favored the use of the differential form of the main propeller for yaw control, as opposed to the control rudder surface approach common in low-altitude airships. Moreover, high-altitude airships exhibit characteristics such as large inertia and delayed control response, posing challenges to airship course control. Initially, a six-degree-of-freedom nonlinear dynamic model of an airship is established, followed by the design of a stratospheric airship yaw controller using Nonlinear Model Predictive Control (NMPC). Through the NMPC method, training samples of the stratospheric airship state to action are gathered, and a supervised learning approach is employed to train a neural network as the yaw controller for the airship. Simulation results demonstrate that the airship yaw controller based on NMPC exhibits minimal overshoot and nearly zero steady-state error, showcasing effective control performance albeit challenging for online control. On the other hand, the yaw controller developed using a neural network can achieve superior control performance and online control capability, although its effectiveness is contingent upon the yaw control performance achieved by the NMPC-designed controller.