Breakout of tfidf prep and calculation into function.