Fit LDA at each number of topics in a range and see which number the perplexity and coherence scores point to.
How many LDA topics? Perplexity and coherence
The problem of choosing a number
LDA needs to be told how many topics to find, and the choice changes the result. Too few and themes are lumped together, too many and one theme is spread over several topics. This tool fits a model at every number in a range and measures each one, so the choice can be argued for.
What each measure tells you
Coherence (c_v and u_mass) asks whether the top words of a topic belong together, and comes closest to what a reader would say. Perplexity asks how well the model predicts the text: look for the point where its fall levels off. Silhouette asks how cleanly passages separate by topic. BIC and AIC weigh the fit against the number of topics.
Reading the recommendation
The recommended number takes the coherence peak first, then the perplexity elbow, then the silhouette peak, and the report shows what each of them points to. When they agree, the choice is easy. When they do not, take two or three candidates, fit LDA at each and keep the one whose topics you can name.
Topics and clusters
What a pile of documents is about, without reading every one.
LDA topic modeling: Fit a classic LDA model over all your files and get the topics, their words, and the mix of topics in each document.
LDA with topic names: Fit an LDA model to each file on its own and get its topics, each with a short name.
BERTopic topic clustering: Cut the text into passages, cluster them by meaning, and get named topics with their keywords and typical passages.
Text clustering: Sort a set of short texts into groups of similar content, with the keywords and size of each group.
Principal components of a text: Boil the vocabulary of a text down to a few principal components, see which words pull each one and where each passage falls, and get a name for each component.
Latent semantic analysis: Find the hidden topics of a text by latent semantic analysis, with the words and typical passages of each, the passages that stray, and how close the topics are.
Expectation mining: Find what the writers of reviews, comments or survey answers expect and ask for, sorted into types, with how positive and how urgent each one is and the keywords behind it.
Knowledge graph: Get the people, organizations and concepts a text names and the relations between them as a graph you can explore, with the sentence behind every relation, the topics they form and a work outline.
Storylines and what comes next: From a table of posts with timestamps, get the topics, the storylines they form, the moments when the number of posts jumped and what drove each jump, and a projection of what may come next for the most active storylines.
Event timeline: List the events in a text in chronological order, each with its date, place, actors and source sentence, grouped into phases with the turning points marked, and read a short account of how it all unfolded.
Causal relations: Get the cause-and-effect relations a text states outright, each as the cause and the effect in the text's own words with the sentence it came from, drawn as a network and as chains, with a short account of what leads to what.
Position analysis: See who supports, opposes, questions or calls for what in a text, backed by direct quotes, and who is in conflict or working together, drawn as a network with a short summary of the main findings.
Text classification: Sort texts into categories, either the IPTC Media Topics that news agencies use or a list of your own, with how probable each one is and the sentence that shows it.