  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
({\tt 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 {\tt SLAM} with that in literature for
several objects having high-resolution spectra. We provide the stellar labels
of effective temperature ($T_\mathrm{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
$\sigma(T_\mathrm{eff}) = 2,185 $K, $\sigma(\log{g}) = 0.29$ dex, and
$\sigma(v\sin{i}) = 11\, \rm km\,s^{-1}$ for MRS, and $\sigma(T_\mathrm{eff}) =
1,642 $K, $\sigma(\log{g}) = 0.25$ dex, and $\sigma(v\sin{i}) = 42\, \rm
km\,s^{-1}$ for LRS spectra, respectively. We notice that parameters of
$T_\mathrm{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.
