This article presents a new algorithm that uses techniques from the field of artificial intelligence to automatically estimate the physical parameters of massive stars from a grid of stellar spectral models. This is the first grid to consider hydrodynamic solutions for stellar winds and radiative transport, containing more than 573 thousand synthetic spectra. The methodology involves grouping spectral models using deep learning and clustering techniques. The goal is to delineate the search regions and differentiate the “species” of spectra based on the shapes of the spectral line profiles. Synthetic spectra close to an observed stellar spectrum are selected using deep learning and unsupervised clustering algorithms. As a result, for each spectrum, we found the effective temperature, surface gravity, micro-turbulence velocity, and abundance of elements, such as helium and silicon. In addition, the values of the line force parameters were obtained. The developed algorithm was tested with 40 observed spectra, achieving 85% of the expected results according to the scientific literature. The execution time ranged from 6 to 13 min per spectrum, which represents less than 5% of the total time required for a one-to-one comparison search under the same conditions.