A Unified Empirical Risk Minimization Framework for Flexible N-Tuples Weak Supervision