An Empirical Bayes Approach to Frequency Estimation