Adding functions for computing tfidf.