Massive stars play key roles in many astrophysical processes. Deriving atmospheric parameters of massive stars is important to understand their physical properties and thus are key inputs to trace their evolution. Here we report our work on adopting the data-driven technique Stellar LAbel Machine (SLAM) with the non-LTE TLUSTY synthetic spectra as the training dataset to estimate the stellar parameters of LAMOST optical spectra for early-type stars. We apply two consistency tests to verify this machine learning method and compare stellar labels given by SLAM with that in literature for several objects having high-resolution spectra. We provide the stellar labels of effective temperature (T eff ), surface gravity (log g), metallicity ([M/H]), and projected rotational velocity (v sin i) for 3,931 and 578 early-type stars from LAMOST Low-Resolution Survey (LAMOST-LRS) and Medium-Resolution Survey (LAMOST-MRS), respectively. To estimate the average statistical uncertainties of our results, we calculated the standard deviation between the predicted stellar label and the pre-labeled published values from the high-resolution spectra. The uncertainties of the four parameters are σ(T eff ) = 2, 185K, σ(log g) = 0.29 dex, and σ(v sin i) = 11 km s −1 for MRS, and σ(T eff ) = 1, 642K, σ(log g) = 0.25 dex, and σ(v sin i) = 42 km s −1 for LRS spectra, respectively. We notice that parameters of T eff , log g and [M/H] can be better constrained using LRS spectra rather than using MRS spectra, most likely due to their broad wavelength coverage, while v sin i is constrained better by MRS spectra than by LRS spectra, probably due to the relatively accurate line profiles of MRS spectra.