Compute tf idf with idf and tfidf cache independently