Narrow bandgap inorganic compounds are extremely important in many areas of physics. However, their basic parameter database for surface analysis is incomplete. Electron inelastic mean free paths (IMFPs) are important parameters in surface analysis methods, such as electron spectroscopy and electron microscopy. Our previous research has presented a machine learning (ML) method to describe and predict IMFPs from calculated IMFPs for 41 elemental solids. This paper extends the use of the same machine learning method to 42 inorganic compounds based on the experience in predicting elemental electron IMFPs. The in-depth discussion extends to including material dependence discussion and parameter value selections. After robust validation of the ML method, we have produced an extensive IMFP database for 12 039 narrow bandgap inorganic compounds. Our findings suggest that ML is very efficient and powerful for IMFP description and database completion for various materials and has many advantages, including stability and convenience, over traditional methods.