In order to solve the problem of web editing data mining effectively, a semantic network generation algorithm is proposed. First of all, on the basis of preprocessing the variant short text, the maximum matching distance between short text is calculated by using the dictionary to expand the semantics of the Chinese words, which is used as an index to measure the formal distance between short text. Finally, a weighted method is used to synthesize formal distance and unit semantic distance into text distance, which is applied to the clustering analysis of online comments. The length of the word list is used to punish the distance. Results show that the most popular query topics on the Internet are shopping 10%, entertainment 10%, pornography 12%, computer 9%, research 9%, healthy life 5%, travel 5%, games 5%, family medical 5%, sports 3%, personal economic plan 3%, holiday 1% and others. It is proved that the improved algorithm proposed in this paper is superior to other methods and the clustering performance is significantly improved.