A Machine Learning Framework to Predict Adverse Drug Reactions from Electronic Health Records