This study investigates the synergy between the virtual and real-world economies through e-commerce, where seller reputation is critical in guiding consumer decisions. As traditional businesses shift towards online retail, user reviews become essential, offering feedback to both sellers and potential buyers. Sentiment analysis through machine learning (ML) techniques presents significant advantages for consumers and retailers alike. This research proposes a novel approach combining bidirectional encoder representations from transformers (BERT) embeddings with an optimized XGBoost classification model to enhance sentiment analysis performance. A modified metaheuristic algorithm, derived from the firefly algorithm (FA), is introduced to optimize the model. Testing on publicly available datasets demonstrates that models optimized by this algorithm achieved a peak accuracy of .881336. Further statistical analyses substantiate these improvements, and SHAP interpretation on the best-performing model identifies key features impacting model predictions, shedding light on factors driving customer sentiment insights.