Separate TF-IDF computation for training and testing.