Applications of process analytics and machine learning in pyrometallurgy and kraft pulping