Studies are exploring ways to improve medication adherence, with sentiment analysis (SA) being an underutilized innovation in pharmacy. This technique uses artificial intelligence (AI) and natural language processing to assess text for underlying feelings and emotions. This study aimed to evaluate the use of two SA models, Valence Aware Dictionary for Sentiment Reasoning (VADER) and Emotion English DistilRoBERTa-base (DistilRoBERTa), for the identification of patients' sentiments and emotions towards their pharmacotherapy. A dataset containing 320,095 anonymized patients' reports of experiences with their medication was used. VADER assessed sentiment polarity on a scale from - 1 (negative) to + 1 (positive). DistilRoBERTa classified emotions into seven categories: anger, disgust, fear, joy, neutral, sadness, and surprise. Performance metrics for the models were obtained using the sklearn.metrics module of scikit-learn in Python. VADER demonstrated an overall accuracy of 0.70. For negative sentiments, it achieved a precision of 0.68, recall of 0.80, and an F1-score of 0.73, while for positive sentiments, it had a precision of 0.73, recall of 0.59, and an F1-score of 0.65. The AUC for the ROC curve was 0.90. DistilRoBERTa analysis showed that higher ratings for medication effectiveness, ease of use, and satisfaction corresponded with more positive emotional responses. These results were consistent with VADER's sentiment analysis, confirming the reliability of both models. VADER and DistilRoBERTa effectively analyzed patients' sentiments towards pharmacotherapy, providing valuable information. These findings encourage studies of SA in clinical pharmacy practice, paving the way for more personalized and effective patient care strategies.