Currently, YouTube has become one of the most significant online platforms, with billions of hours of video uploaded every day, attracting a vast user base. Recently, foreign reactionary forces and extremist organizations have exploited YouTube to disseminate videos undermining the Party, the State, and the Vietnamese military. This study focuses on analyzing Vietnamese subtitles collected from YouTube. By using machine learning algorithms, it conducts sentiment analysis and categorizes the subtitles of videos. This research provides a profound insight into the emotions and perspectives of the online community regarding content on YouTube, particularly those related to politics and society. The results of the study among four machine learning algorithms include Naive Bayes, Random Forest, Support Vector Machine, and Logistic Regression. Among them, the Random Forest algorithm has achieved the highest accuracy rate of 81%, surpassing the other three algorithms in analyzing the sentiments of subtitles from YouTube videos with negative content.Hiện nay, YouTube đã trở thành một trong những nền tảng trực tuyến quan trọng, với hàng tỷ giờ video được tải lên mỗi ngày, thu hút đông đảo người dùng. Gần đây, các lực lượng phản động và các tổ chức cực đoan từ nước ngoài đã tận dụng YouTube để lan truyền video chống phá Đảng, Nhà nước và Quân đội Việt Nam. Nghiên cứu này tập trung vào phân tích các phụ đề Tiếng Việt được thu thập từ YouTube. Bằng cách sử dụng các thuật toán học máy, thực hiện phân tích cảm xúc và phân loại phụ đề của các video. Nghiên cứu này mang lại cái nhìn sâu sắc về tâm trạng và quan điểm của cộng đồng mạng đối với nội dung trên YouTube, đặc biệt là những nội dung liên quan đến chính trị và xã hội. Kết quả của nghiên cứu giữa bốn thuật toán học máy, thuật toán Random Forest đã đạt tỷ lệ chính xác cao nhất là 81%, vượt trội so với ba thuật toán khác trong phân tích cảm xúc của các phụ đề từ video YouTube có nội dung tiêu cực.