Public sentiment within social networks exerts a profound influence on societal dynamics, underscoring the increasing demand for accurate public opinion prediction. Most existing methods predominantly measure sentiment by quantifying user sentiments individually, overlooking group-level factors that crucially contribute to public sentiment. Thus, based on our finding that public sentiment is primarily shaped by user-group interactions and their interplay with evolving topics, we innovatively model the forming process of public sentiment at the group level. In this paper, we propose the Topic and Role Enhanced Group-level Public Sentiment Prediction model (TRESP), capturing the intricate interplay among sentiment, topic, and role. Specifically, an LSTM neural network is firstly leveraged to trace the temporal correlations between topics and sentiment shifts, yielding a topic-informed content sentiment representation. Subsequently, a specially crafted hierarchical attention network captures social and role attributes, representing the overarching social group environment. Finally, we predict future public sentiment by merging the derived group sentiment representation with the group social representation, demonstrating a holistic insight into the sentiment trajectory. Extensive experiments were conducted on two real-world datasets of over 30,000 tweets collected from more than 14,000 users to validate our model. Notably, our model significantly outperforms the state-of-the-art approaches in public sentiment prediction, indicating the importance and effectiveness of encapsulating interactions both within and among user subgroups.