Set the number of topics for the _convert_gensim_corpus2csr() method in the fit_transform() and transform() methods of LdaVectorizer in text.py. This enforces the same number of topics across training and testing.