The Interface Region Imaging Spectrograph (IRIS) observes the chromosphere and the transition region to understand how the solar atmosphere is energized. Since its launch in 2014 it has recorded more than 18,000 data sets in the Mg II h&k spectral range. Recovering the physical information from these data is crucial to answer how energy is transferred from the lower layers of the solar atmosphere to the hot corona. We will demonstrate a new technique that applies to the Mg II h&k spectra that quickly (in a few minutes) enables the recovery of the thermodynamic information within the atmosphere. This new approach is based on several machine learning and artificial intelligence methods. In this workshop we will discuss the concepts, estimated errors, and limitations of the method and, in a hands-on environment, how to implement and execute the code we have developed.