update calculate the freq of docs from dataset