Sentiment analysis initially relied on traditional approaches such as data mining techniques and knowledge-based methods. Later, machine learning algorithms and deep learning approaches, including convolutional neural networks (CNN) and recurrent neural networks (RNN), improved sentiment analysis by extracting meaningful information from text.