Predicting Ionic Charge and Formula Units of Ionic Compounds