Sentiment analysis is becoming a very popular research technique. It can effectively identify hidden emotional trends in social networks to understand people’s opinions and feelings. This research therefore focuses on analyzing the sentiments of the public on the social media platform, YouTube, about the Thailand-China high-speed train project and the Laos-China Railway, a mega-project that is important to the country and a huge investment to develop transportation infrastructure. It affects both the economic and social dimensions of Thai people and is also an important route to connect the rail systems of ASEAN countries as part of the Belt and Road Initiative. We gathered public Thai reviews from YouTube using the Data Application Program Interface. This dataset was used to train six sentiment classifiers using machine learning and deep learning algorithms. The performance of all six models by means of precision, recall, F1-score and accuracy are compared to find the most suitable model architecture for sentiment classification. The results show that the transformer model with the WangchanBERTa language model yields best accuracy, 94.57%. We found that the use of a Thai language-specific model that was trained from a large variety of data sources plays a major role in the model performance and significantly increases the accuracy of sentiment prediction. The promising performance of this sentiment classification model also suggests that it can be used as a tool for government agencies to plan, make strategic decisions, and improve communication with the public for better understanding of their projects. Furthermore, the model can be integrated with any online platform to monitor people's sentiments on other public matters. Regular monitoring of public opinions could help the policy makers in designing public policies to address the citizens’ problems and concerns as well as planning development strategies for the country.