In this study, we develop models to predict log10 of ≥2 MeV electron fluxes with 5-minute resolution at the geostationary orbit using the Long Short-Term Memory (LSTM) and transformer neural networks for next 1-hour, 3-hour, 6-hour, 12-hour, and 1-day predictions. The data of GOES-10 satellite from 2002 to 2003 are the training set, the data in 2004 are the validation set, and the data in 2005 are the test set. For different prediction time scales, different input combinations with four days as best offset time are tested and it is found that the transformer models perform better than the LSTM models, especially for higher flux values. The best combinations for the transformer models for next 1-hour, 3-hour, 6-hour, 12-hour, 1-day predictions are (log10 Flux, MLT), (log10 Flux, Bt, AE, SYM-H), (log10 Flux, N), (log10 Flux, N, Dst, Lm), and (log10 Flux, Pd, AE) with PE values of 0.940, 0.886, 0.828, 0.747, and 0.660 in 2005, respectively. When the low flux outliers of the ≥2 MeV electron fluxes are excluded, the PE (prediction efficiency) values for the 1-hour and 3-hour predictions increase to 0.958 and 0.900. By evaluating the prediction of ≥2 MeV electron daily and hourly fluences, the PE values of our transformer models are 0.857 and 0.961, respectively, higher than those of previous models. In addition, our models can be used for filling the data gaps of ≥2 MeV electron fluxes.