Spectral lines allow us to probe the thermodynamics of the solar atmosphere, but the shape of a single spectral line may be similar for different thermodynamic solutions. Multiline analyses are therefore crucial, but computationally cumbersome. We investigate correlations between several chromospheric and transition region lines to restrain the thermodynamic solutions of the solar atmosphere during flares. We used machine-learning methods to capture the statistical dependencies between 6 spectral lines sourced from 21 large solar flares observed by NASAs Interface Region Imaging Spectrograph (IRIS). The techniques are based on an information-theoretic quantity called mutual information (MI), which captures both linear and nonlinear correlations between spectral lines. The MI is estimated using both a categorical and numeric method, and performed separately for a collection of quiet Sun and flaring observations. Both approaches return consistent results, indicating weak correlations between spectral lines under quiet Sun conditions, and substantially enhanced correlations under flaring conditions, with some line-pairs such as Mg II and C II having a normalized MI score as high as 0.5. We find that certain spectral lines couple more readily than others, indicating a coherence in the solar atmosphere over many scale heights during flares, and that all line-pairs are correlated to the GOES derivative, indicating a positive relationship between correlation strength and energy input. Our methods provide a highly stable and flexible framework for quantifying dependencies between the physical quantities of the solar atmosphere, allowing us to obtain a three-dimensional picture of its state.