Function to set the document frequency for a TfIdf object.