apply tf-idf and pre-processing