Network virtual information is complex and ever-changing, and people’s value orientation and way of thinking are unknowingly assimilated into multiple network scenarios. In order to fully analyze the discourse evolution of ideological and political education, this paper proposes a methodology for early warning and assessment of public opinion on the Internet in colleges and universities. Firstly, the risk assessment index system for university network public opinion is constructed, and different types of events related to university network public opinion are selected for analysis. The risk assessment index weights are calculated using the entropy weight method. The closeness was computed using the TOPSIS method, and the gray correlation coefficient and degree were calculated according to the gray correlation theory. The risk assessment level is classified using the k-means clustering algorithm. Among the risk assessment indexes of university online public opinion, the most influential index on the risk of university online public opinion is the amount of original participation of public opinion, and the weight of this index is 0.12. The second index is the attention of the public opinion publisher and the index of the publisher’s attention, and the weights are 0.114 and 0.11, respectively. Among the six university online public opinion events, the closeness is the highest one of event 6, which is 0.5872, and the grey correlation coefficients are 0.4395, 0.4072, 0.4952, 0.3864, 0.5321, and 0.6412. The results of the events evaluated through the college’s online public opinion early warning match the degree of influence of the actual public opinion, which indicates that the method can accurately predict public opinion. Colleges and universities can formulate targeted strategies according to the risk level and the factors that have an important impact on the development of public opinion to prevent the discourse of ideological education in colleges and universities from developing in a negative direction.