The most well-supported model of the cosmos expands upon the Big Bang theory and introduces dark energy into a dark matter dominated universe. Massive objects bend the fabric of space-time and distort the light traveling from a background object towards Earth. This is known as gravitational lensing and its measurements allow us to constrain cosmological parameters, such as dark energy. Lensing measurements require an accurate mapping of the distances to galaxies. The distance to galaxies is often measured by obtaining spectroscopy and photometry. The Dark Energy Spectroscopic Instrument (DESI) intends to constrain the fraction of dark energy by obtaining the spectra of millions of galaxies. The spectra are then fed into the emission line modeling pipelines Redrock and FastSpecFit. However, discrepancies appear in both of these pipelines as the result from the pipelines can differ from one another. Through Visual Inspection (VI) we can assess the quality of the spectra. However, it is a time-consuming process. I aim to improve the accuracy of quality flag measurements assigned to spectra through a machine learning algorithm.The chi-squared values resulting from each model reveal relevant trends related to pipeline failures. Pinpointing inconsistencies within the pipelines can inform the machine learning algorithm on how to identify future failures. This will also streamline the VI process through a standardized set of quality flags that allows us to build a more homogenous set of calibration data. A complete distance calibration using photometric and spectroscopic data from the most expansive surveys to date will improve the certainty of gravitational lensing measurements and assess consistency of measurements from different surveys.