Improved the speed of tf-idf calculation

Added words of the vocabulary only if they are present more than 3 times in the corpus.