howevertopics are often just an intermediate tool to another end now that we have an estimate for each document about how much of that document comes from each topicwe can compare the documents in topic space this simply means that instead of comparing word per wordwe say that two documents are similar if they talk about the same topics this can be very powerfulas two text documents that share few words may actually refer to the same topic they may just refer to it using different constructions (for exampleone may say the president of the united states while the other will use the name barack obamatopic models are useful on their own to build visualizations and explore data they are also very useful as an intermediate step in many other tasks at this pointwe can redo the exercise we performed in the previous and look for the most similar postbut by using the topics whereas previously we compared two documents by comparing their word vectorswe can now compare two documents by comparing their topic vectors for thiswe are going to project the documents to the topic space that iswe want to have vector of topics that summarizes the document since the number of topics ( is smaller than the number of possible wordswe have reduced dimensionality how to perform these types of dimensionality reduction in general is an important task in itselfand we have entirely devoted to this task one additional computational advantage is that it is much faster to compare vectors of topic weights than vectors of the size of the vocabulary (which will contain thousands of termsusing gensimwe saw before how to compute the topics corresponding to all documents in the corpustopics [model[cfor in corpusprint topics[ [( )( )( )( )we will store all these topic counts in numpy arrays and compute all pairwise distancesdense np zeros(len(topics) )floatfor ti, in enumerate(topics)