In LDA topic modeling, the number of topics is chosen by the user in advance. This is sometimes cited as a shortcoming of LDA topic modeling since it's not always clear how many topics make sense for the data being analyzed. In practice, judgment and trial-and-error are required for choosing the number of topics that lead to good results.