Machine Learning from Weak Supervision (An Empirical Risk Minimization Approach)