Abstract
With social media as the main channel for college students to express emotions, sentiment public opinion analysis in big data environments poses three core challenges to campus sentiment monitoring and psychological counseling: severe data noise interference, insufficient multi-attribute feature extraction, and the trade-off between recognition accuracy and inference efficiency. This paper proposes a university student public opinion prediction model integrating multi-attribute decision-making and BERT–Mamba. First, an anti-interference matching filter cleans raw data by filtering out advertisements and irrelevant comments to improve data quality. Second, a multi-attribute decision object model extracts quantifiable attributes covering media sources, themes, and temporal dimensions. Third, BERT generates textual sentiment representations, and a three-stage deep feature extraction architecture with Mamba balances accuracy and efficiency. Finally, multi-attribute features and sentiment representations are fused for dynamic public opinion prediction. Validated using the ChnSentiCorp Chinese sentiment analysis benchmark dataset and university student Weibo public opinion corpus, the model achieves 97.44% average sentiment recognition accuracy. It provides technical support for universities to understand student sentiment trends and address negative public opinions, with practical value for enhancing campus public opinion monitoring and assisting mental health counseling.
1. Introduction
As the primary institutions for cultivating young talent, universities face direct implications for campus safety, stability, and student mental health through the evolution of student sentiment expression and public opinion [1]. As social media platforms such as Douyin and campus forums become primary channels for students to share daily experiences and vent emotions, the boundary between emotional expression and public opinion dissemination has gradually blurred [2]. Therefore, accurately analyzing the evolution of student emotional sentiment and promptly identifying risks of negative sentiment diffusion have become critical challenges for transforming campus governance from reactive responses to proactive prevention in the new era.
The widespread adoption of big data technology presents new opportunities for analyzing emotional sentiment in higher education. On the one hand, vast social media datasets contain granular features of student emotional expressions, such as exam anxiety, career uncertainty, and social isolation, providing a data foundation for accurately perceiving student psychological states [3,4,5]. On the other hand, big data’s multidimensional correlation analysis capabilities hold promise for revealing the evolutionary patterns of public opinion moving from individual emotional venting to collective emotional resonance, and ultimately to the outbreak of risk events [6].
However, sentiment analysis of campus public opinion in universities still faces three core challenges under the big data environment. First, data cleaning lacks scenario-specific anti-interference ability. Campus data contain noise such as advertisements, duplicate comments, and meaningless symbols. General keyword-based and shallow classifier methods fail to distinguish students’ low-frequency implicit genuine sentiments from interference, leading to semantic feature distortion in follow-up analysis [7]. Second, multi-attribute feature fusion lacks systematic empirical support. Although existing studies integrate thematic, temporal, and propagation attributes for public opinion assessment, most campus-related works rely on empirical weight assignment without data-driven optimization and scenario validity verification, failing to capture multi-dimensional collaborative risk evolution patterns [8]. Third, it is difficult to balance fine-grained recognition accuracy and real-time inference efficiency. BERT pre-trained models based on the Transformer architecture have strong sentiment representation capability, but the quadratic complexity of the self-attention mechanism restricts long-sequence inference efficiency [9]. Lightweight CNN and LSTM models have fast inference speeds but struggle to identify implicit fine-grained sentiments such as anxiety and empathy. Existing studies on the fusion of BERT and Mamba state-space models have not been deeply integrated with the multi-attribute decision logic of campus public opinion [10].
To address the aforementioned issues, this paper proposes a university student public opinion prediction model integrating multi-attribute decision-making with BERT–Mamba. The specific steps are as follows: First, employ interference-resistant matching filter techniques to clean public opinion data. Design filters that match student sentiment expression patterns, using high-frequency topics such as “exams” and “dormitories” as reference templates. This maximizes the signal-to-noise ratio of genuine sentiment signals while filtering out irrelevant noise to enhance data quality. Second, a multi-attribute decision-making object model is constructed, treating campus public opinion as the decision target. A set of quantifiable attributes encompassing thematic, temporal, propagation, and user characteristics is extracted to uncover multidimensional correlations within public opinion data. Third, the BERT model is employed to obtain fine-grained sentiment representations of text. This is integrated with the Mamba module to design a three-stage deep feature extraction structure: “sentiment representation—multi-attribute fusion—state space inference”. The Mamba selective state space model captures long-term dependencies in public opinion sequences, optimizing inference efficiency while preserving BERT’s sentiment representation capabilities. Finally, by integrating multi-attribute public opinion features with sentiment representations and utilizing the joint prediction results from the fully connected layer, the model achieves dynamic forecasting of student public opinion, providing technological support for campus governance. The main contributions of this paper include the following:
- (1)
- Context-specific innovation: for the first time, this approach deeply integrates multi-attribute decision theory with sentiment analysis of university students’ public opinion, addressing analytical biases caused by generalized public opinion models that overlook students’ emotional characteristics and the multidimensional correlations within public opinion.
- (2)
- Technological integration innovation: Proposed a multi-attribute decision + BERT–Mamba fusion architecture. The multi-attribute model addresses multidimensional public opinion sentiment correlation mining, while the BERT–Mamba fusion resolves the trade-off between sentiment recognition accuracy and inference efficiency.
- (3)
- Performance and implementation innovation: Experiments validated using the THUNUS Chinese sentiment analysis dataset and microblog public opinion corpora from a university achieved an average sentiment recognition accuracy of 97.44%. Customized modules of anti-interference cleaning and multi-attribute features were designed for university scenarios, providing directly implementable technical solutions for campus public opinion monitoring and student psychological counseling.
2. Related Work
2.1. Current State of Multiple-Attribute Decision-Making Research
Multiple-attribute decision-making (MADM) achieves the comprehensive evaluation of alternatives by systematically integrating the multidimensional attribute information of decision objects. Early MADM research often treated attributes as independent single-dimensional evaluation units, focusing on integrating quantitative attributes through weighted summation. However, this approach overlooked contextual dependencies among attributes and uncertainties in real-world environments, leading to decision biases in fuzzy or dynamic scenarios. Addressing this limitation, Zhang et al. [11] focused on uncertain and linguistically ambiguous environments, proposing a context-dependent MADM method. By capturing semantic relationships among attributes, this approach effectively corrects decision biases caused by the traditional assumption of attribute independence, thereby enhancing decision accuracy in fuzzy scenarios.
To address the common issue of interval uncertainty in group decision-making, Yi et al. [12] proposed a MADM model based on random simulation. This model no longer relies on absolute scores for individual attributes but instead quantifies the relative merits of any two alternative options through random simulation. It converts interval uncertainty into comparable probability values, thereby optimizing the overall evaluation effect under interval information. To address the challenge of attribute integration in mixed information systems, Sun et al. [13] combined fuzzy pattern recognition with MADM, proposing a fuzzy pattern recognition MADM model for mixed information systems. This model categorizes attributes into natural and abstract groups, standardizes them, and uniformly maps them to membership degrees using membership functions, thereby resolving the difficulty of integrating mixed information.
To address semantic divergence in group decision-making, Xiao et al. [14] proposed an individual semantic space learning method based on historical decision data. By uncovering decision-makers’ semantic preferences, this approach effectively narrowed semantic discrepancies within group decisions. In educational applications, Yang et al. [15] addressed the hesitant fuzziness in evaluating university intelligent development by incorporating hesitant fuzzy sets into MADM, proposing a credibility-based MADM model. This model enhances the scientific rigor of university intelligent development assessments by integrating hesitant information through credibility-weighted aggregation of hesitant elements.
2.2. Current State of Sentiment Recognition Research
As a core task in the era of intelligent information, sentiment recognition aims to extract emotional features from multimodal information such as text, audio, and video, supporting precise decision-making in scenarios such as human–computer interactions and public opinion analysis.
With the widespread adoption of big data technologies, sentiment recognition has begun to integrate deeply with natural language processing, significantly enhancing its analytical capabilities for large-scale datasets. Yang et al. [16] explored pathways for merging sentiment recognition with big data analytics, employing multiple NLP methods to process massive text datasets and effectively uncover latent emotional tendencies. Jin et al. [17] further proposed a cloud-based hybrid data fusion framework to address the challenge of explosive growth in multimodal data, enabling the integration of sentiment information across diverse data sources.
However, data imbalance and domain adaptability remain key bottlenecks in emotion recognition. To address uneven data distribution, Bleyl et al. [18] employed text augmentation techniques to balance datasets. By incorporating domain-specific terminology and emoticons to expand the model’s vocabulary, they enhanced its ability to recognize internet slang and informal expressions. Chandra et al. [19] employed automated association of core emoticons such as “happy” and “sad” to assist sentiment classification, integrating traditional machine learning models such as LSTM, naive Bayes, and SVM for emotion detection.
Another prominent challenge is the mismatch between datasets: behavioral datasets feature richer and more explicit emotional characteristics, while spontaneous datasets are more realistic but exhibit subtler emotions. This discrepancy limits model generalization. To address this, Zhang et al. [20] proposed a multi-task learning approach. By jointly training emotion recognition and stylistic attributes (e.g., expression intensity and contextual style), the deficiencies of both behavioral and spontaneous data are effectively bridged.
2.3. Current State of Public Opinion Analysis Research
In today’s era of highly accessible information dissemination, public opinion has become a core governance challenge across all sectors due to its rapid diffusion and broad societal impact. Among these, police-related public discourse—directly linked to public safety and law enforcement credibility—has emerged as a prominent challenge facing public security work in the new era. To address this shortcoming, Wang et al. [21] developed the SPNIR model for police-related public opinion evolution based on multi-source network big data. This model delves into the dynamic mechanisms governing the generation, diffusion, and dissipation of police-related public sentiment, providing theoretical support for tracking opinion trends and formulating targeted strategies.
With the proliferation of social media, college students have emerged as core participants in online discourse: their viewpoints are expressed frequently and emotionally, and their value judgments are easily influenced by platform content. However, traditional public opinion analysis methods have limited depth in the semantic mining of campus texts, making it difficult to accurately capture the emotional tendencies of young people. Addressing this challenge, He et al. [22] proposed a data-driven framework for analyzing online university public opinions. They established a nonlinear relationship between latent features and the emotional orientation of campus public opinion, significantly enhancing the accuracy and efficiency of campus public opinion analysis.
However, existing internet public opinion monitoring methods still have obvious limitations: most focus on the periodic crawling of web page texts, with weak capabilities for identifying textual information and sentiment in multimodal content such as images and videos, making it difficult to cover complex public opinion scenarios. Building upon recent advancements in text recognition technology, Liu et al. [23] proposed a visual multimodal text recognition and sentiment analysis method for internet public opinion analysis. This approach overcomes the limitations of traditional text-dependent methods and enhances the processing capabilities for multimodal data.
Another critical challenge lies in the prevalence of uncivil behavior, misinformation, and even subversive speech on platforms such as Weibo. Efficiently identifying trending topics and enhancing the quality and effectiveness of government public opinion services have become pressing issues. Tang et al. [24] combined the K-means algorithm with co-occurrence analysis to achieve precise hot topic identification. Further, adopting a big data visualization perspective, they systematically optimized the entities, environment, methods, and presentation formats of government public opinion monitoring. By designing visualization models and solutions, they provided novel insights for governments to enhance the quality and efficiency of their public opinion services.
2.4. Summary Analysis
Multi-attribute decision-making, sentiment recognition, and public opinion research have formed mature technical approaches and application achievements in their respective fields. Multi-attribute decision-making has developed effective methods for semantic divergence resolution and hesitant information processing; sentiment recognition has been continuously optimized in feature extraction and generalization ability improvement; and public opinion research has made progress in evolution mechanism exploration and multimodal information recognition. These studies lay a solid theoretical foundation and provide technical references for campus sentiment public opinion analysis. However, for the specific task of dynamic prediction of university campus sentiment public opinion, the three types of methods have not yet formed a collaborative technical linkage, and there remain targeted gaps in scenario adaptation. The advantages and limitations of each method are presented in Table 1.
Table 1.
Analysis of existing methods.
Overall, existing studies have achieved breakthroughs in single technical dimensions: multi-attribute decision-making theory is equipped with a mature multi-dimensional information fusion framework, enabling systematic evaluation of structured attributes; sentiment recognition technology can extract fine-grained emotional signals from texts, providing a semantic basis for risk judgment; and public opinion analysis methods can characterize the law of communication evolution and support dynamic trend prediction. However, the three have not formed a complete chain of “sentiment semantic extraction, multi-attribute fusion decision-making, and dynamic risk prediction”. Furthermore, in view of the characteristics of university public opinions, such as high data noise, implicit emotional expression, and prominent scenario attributes, there is a lack of end-to-end adaptation solutions.
Therefore, to address the above gaps, this paper deeply integrates multi-attribute decision-making theory with deep sentiment recognition models. On the one hand, the matched filtering method is adopted to meet the data cleaning requirements of university public opinion, providing a high-quality data foundation for subsequent feature extraction. On the other hand, a multi-attribute decision-making index system covering themes, time, media, and user identity is constructed, and joint modeling of sentiment semantics and scenario attributes is realized with the BERT–Mamba architecture. Finally, a dynamic sentiment public opinion prediction model adapted to university scenarios is formed to provide technical support for campus governance.
3. Methods
3.1. Overall Construction
This paper proposed a multi-attribute sentiment prediction and analysis model for university student public opinion based on big data. Centered on the BERT–Mamba architecture, it integrates pre-trained semantic understanding, long-sequence dependency modeling, and multi-attribute scenario fusion modules to achieve collaborative optimization of fine-grained sentiment recognition and public opinion risk prediction. First, to address noise issues such as mixed advertising links, duplicate comments, and meaningless emoticons in university student public opinion data, an interference-resistant matching filter method was employed for data cleansing. Next, the cleaned data are structured as multi-attribute decision objects, extracting thematic structural features. Finally, the model first employs BERT for the global semantic encoding of public opinion texts, extracting deep initial sentiment features. Mamba is then introduced to capture contextual dependencies in long-sequence data, such as continuous comment chains. By integrating multi-attribute contextual factors, including topic, time, and user identity, the model cross-modally combines long-sequence sentiment features with contextual features into comprehensive features. Ultimately, the fusion prediction layer outputs fine-grained sentiment inclination and public opinion risk results for dual tasks, as shown in Figure 1.
Figure 1.
Overall structural diagram.
3.2. Data Cleaning via Anti-Interference Matching Filter
Student sentiment data in higher education institutions primarily originate from social media platforms, inevitably containing noise such as advertising links, duplicate comments, and meaningless emoticons. This noise obscures genuine student sentiment expressions, severely compromising the accuracy of subsequent sentiment feature extraction and prediction. To address this issue, this paper employs an anti-interference matched filtering method adapted to discrete text sequences based on the “signal–interference” separation principle to achieve noise removal. The core approach treats students’ genuine emotional expressions as useful signals and irrelevant information as interference signals. By designing reference templates that match students’ emotional expression patterns, the method maximizes the signal-to-noise ratio of useful signals.
First, the conversion mechanism from text to discrete-time signals is clarified: With a 1 h fixed sliding window, the occurrence frequency of students’ high-frequency emotional keywords in each window is counted to construct a discrete word frequency signal sequence in units of time steps. This converts unstructured text into one-dimensional discrete statistical sequences with equal time intervals, endows the convolution operation with a clear physical meaning of temporal correlation, and realizes the adaptation of continuous signal theory to text scenarios. The core of matched filtering is achieving precise alignment between the signal and the template through discrete convolution operations.
The output sequence is expressed as shown in Equation (1):
where x(t) denotes the signal sequence of the original public opinion text, characterized by the occurrence time and frequency of words, and h(t − τ) represents the reference template function, where τ is the time delay parameter. The reference template h(t − τ) is constructed based on high-frequency emotional topics among students. By statistically analyzing high-frequency keywords in university students’ public opinion data, the frequency distribution of these keywords is converted into a continuous-time template function. For instance, the keyword “exams” exhibits a significantly higher frequency in the week preceding exams compared to other periods. The template function correspondingly amplifies the signal weight during this period, enabling the filter to precisely match students’ emotional expression patterns.
Compared with traditional sparse vocabulary filtering methods (e.g., regular keyword matching and stop word list filtering), the proposed method has two core strengths. First, sparse vocabulary filtering relies on fixed discrete word lists and can only match explicit keywords, which tends to mistakenly delete low-frequency, implicit real emotional expressions and miss noise content in variant forms. By contrast, matched filtering performs identification based on the temporal distribution pattern of word frequency; it can capture implicit emotional expressions consistent with the template pattern and features stronger robustness to lexical variations and syntactic changes. Second, sparse vocabulary filtering only implements binary “retain–remove” judgments and cannot quantify the emotional signal intensity of text. Matched filtering, by comparison, can quantify the signal matching degree via the output signal-to-noise ratio, provide continuous credibility features for subsequent multi-attribute decision-making, and realize the linkage between the cleaning stage and the decision-making stage.
To quantify cleaning effectiveness, the output signal-to-noise ratio (SNR) metric is introduced to measure the separation degree between useful signals and noise after filtering, as shown in Equation (2):
where n(τ) represents the filtered noise signal. The objective of matched filtering is to maximize the output signal-to-noise ratio by optimizing the reference template h(t − τ). When emotional expressions matching the template, such as “The exam was too difficult” or “Dormitory hygiene is poor”, appear in the original text, the signal is significantly amplified. Conversely, irrelevant content such as “part-time job advertisements” or “requests for likes and shares”, which are not included in the template, is effectively suppressed as noise.
3.3. Feature Extraction for Multi-Attribute Integrated Decision-Making
After undergoing anti-interference matched filtering, as described in Section 3.2, the university student public opinion data have been cleansed of noise, such as advertising links, duplicate comments, and meaningless emoticons. However, multidimensional attributes, including topics, time, media, and user identity, remain in a dispersed state. These attributes serve both as contextual tags for student sentiment expression and as driving factors in the evolution of public opinion risks. To transform unstructured text into computable structured features, it is necessary to construct a multi-attribute integrated decision-making object model tailored to the university context, enabling the systematic extraction and correlation analysis of multidimensional features.
Treat the cleaned university student public opinion data as a set of multi-attribute decision objects U = {u1, u2, …, um}, where uk denotes the kth public opinion record. For the core feature dimensions of university public opinion, construct the attribute set F = {f1, f2, f3, f4}, corresponding, respectively, to topic attribute, time attribute, platform attribute, and user role attribute, as shown in Figure 2.
Figure 2.
Feature advance chart for multi-attribute integrated decision-making.
- (1)
- Topic Attributes: Content-Oriented Cluster Extraction
Topics represent the core content dimension of university public sentiment analysis. Dispersed sentiment texts must be grouped into semantically related topics using the k-means clustering algorithm. First, the TF-IDF algorithm converts each sentiment instance into a feature vector, as shown in Equation (3):
where TF(t, k) denotes the frequency of term t in the kth public opinion post, m represents the total number of posts, and N(t) indicates the number of posts containing term t. Based on the TF-IDF feature vector, public opinion is clustered into K thematic clusters C = {c1, c2, …, cK}. The thematic attribute value of the kth public opinion is defined as the cosine similarity with the center of its assigned cluster, as shown in Equation (4):
The higher the value, the stronger the semantic relevance between the public opinion and the topic cluster.
- (2)
- Time Attribute: Weighted Quantification of Time Period Patterns
Public opinion release times are divided into four segments: S = {s1, s2, s3, s4}, where s1 represents weekday class hours, s2 denotes weekday non-class hours, s3 covers late-night hours, and s4 corresponds to weekends. Based on a statistical analysis of historical public opinion intensity, each time period is assigned a weight ws(s∈S).
The weights of each period are determined via a two-stage approach combining data-driven optimization and expert validity verification to avoid the subjectivity of manual assignment:
The first stage is data optimization: taking the sentiment recognition mAcc of the validation set as the objective function, grid search under five-fold cross-validation is performed to optimize the weights of each period, with a weight search range of [0.1, 1.0] and a step size of 0.1, to automatically select the weight combination with optimal performance.
The second stage is expert validation: Five experts with academic ranks of associate professor or above, who have research backgrounds in university public opinion management and ideological and political education, are invited to conduct validity scoring on the scenario rationality of the weights. The intraclass correlation coefficient (ICC) of expert scores is 0.82, indicating a good level of inter-rater reliability. Disagreements in scoring are resolved through offline panel discussions to reach a consensus, and the final weight values are confirmed.
It should be noted that the above weight values are optimized based on social media public opinion data from domestic universities and present favorable internal validity under the research scenario, yet their external validity has certain boundaries. When the model is transferred to university groups of different education stages, different public opinion fields, or different regions, there will be significant differences in user expression habits and public opinion propagation rules, and the performance stability of the weights will decline accordingly, making them unable to be directly reused. For cross-scenario applications, adaptive re-estimation shall be carried out based on the annotated data of the target domain, or a dynamic weight learning mechanism shall be introduced to adapt to the data distribution characteristics of different scenarios.
The quantified value of the time attribute is expressed as shown in Equation (5):
where s(k) denotes the time slot to which the kth public opinion belongs. For instance, a post such as “Can’t sleep at all” published at 1 a.m. would be assigned a high weighting factor ws3 = 0.8, while a post such as “Looking for likes” published during class hours would receive a low weighting factor ws1 = 0.3. This approach captures the correlation between time slots and sentiment patterns.
- (3)
- Media and User Identity Attributes: Integration of Dissemination and Credibility
Media platforms determine the scope of public opinion dissemination, while user identity determines the credibility of sentiment. Both are quantified using a weighted assignment method, as shown in Equation (6):
where platform(k) denotes the publishing platform for the kth piece of public opinion, and wplatform(k) represents the dissemination weight for the corresponding platform, such as 0.7 for WeChat Moments and 0.9 for campus forums. user_role(k) indicates the role of the publisher, and wuser_role(k) signifies the credibility weight of the corresponding role.
The weights are determined by the same two-stage approach as the temporal attributes. First, data-driven optimization is conducted through grid search under five-fold cross-validation, with the weight search range set to [0.1, 1.0]. Second, the scenario rationality of the weights is verified by the aforementioned 5 domain experts. Their scenario adaptation boundaries and external validity characteristics are consistent with those of the temporal attributes, and adaptive calibration is also required for cross-domain applications. The finally optimized platform weights are 0.76 for Weibo Super Topics and 0.92 for campus BBS; the user role weights are 1.0 for ordinary students, 0.88 for student leaders, 0.45 for anonymous users, and 0.11 for marketing advertising accounts. The weight values are consistent with the actual dissemination scope of historical public opinion and the distribution of sentiment authenticity, ensuring the objectivity of the features.
Based on the quantitative assessment of attributes across the aforementioned four dimensions, a multi-attribute integrated decision-making object model is constructed, as shown in Equation (7):
where Oi represents the attribute category of university public opinion, and Ai denotes the quantified value of the corresponding attribute. This model transforms unstructured text data on university public opinion into a structured feature set, enabling the effective integration of multi-dimensional features.
3.4. Sentiment–Public Opinion Fusion Prediction with BERT–Mamba
Following the interference-resistant matching filter cleaning in Section 3.2 and multi-attribute feature extraction in Section 3.3, the sentiment data from college students have been transformed into a bimodal input format combining unstructured text sequences with structured attribute vectors. Traditional public opinion prediction models, primarily based on self-attention mechanisms, can capture semantic associations within text but suffer from quadratic scaling of inference complexity with sequence length for long public opinion sequences. While lightweight models offer efficient inference, they struggle to model long-range dependencies and fine-grained sentiment features. To address this challenge, this section proposes the BERT–Mamba fusion model: BERT extracts fine-grained sentiment representations, while Mamba’s selective state space model (SSM) efficiently captures long-term sequence dependencies. Finally, multi-attribute features are integrated to achieve joint prediction of sentiment and public opinion.
3.4.1. Extracting Fine-Grained Sentiment Representations from BERT
Sentiment serves as the core semantic driver of public opinion risk evolution, necessitating the extraction of fine-grained sentiment features of categories such as anxiety, pleasure, and dissatisfaction from cleaned public opinion texts. The BERT (Bidirectional Encoder Representations from Transformers) [25] bidirectional pre-trained language model processes the cleaned text Text(uk) (where uk denotes the kth public opinion record) obtained in Section 3.2. Its input undergoes tokenization and embedding layer processing.
First, convert Text(uk) into a token sequence t = [t1, t2, …, tL], where L is the text length. Add the special token [CLS] to aggregate global text features and [SEP] to separate text segments. Subsequently, the BERT input vector is constructed through a linear combination of token embeddings, position embeddings, and sentence embeddings, as shown in Equation (8):
where, TokenEmbed(.) denotes the pre-trained token embedding matrix, PosEmbed(.) represents position embeddings, and SegEmbed(.) signifies segment embeddings. Input Xinput(uk) into the BERT model, and extract the output of the [CLS] token as the fine-grained sentiment representation vector for the text, as shown in Equation (9):
where Vemotion(uk) ∈ Rdmodel and its dimensions align with the subsequent projection dimensions of multi-attribute features in Section 3.3, ensuring compatibility in feature fusion. For instance, the text “Studying until 3 a.m. during exam week, I just can’t memorize it all” yields a high response value for Vemotion(uk) on the “anxiety” emotional dimension, forming a semantic association with the thematic attribute f1(uk) “academic pressure” discussed in Section 3.3.
3.4.2. Mamba’s Three-Stage Deep Feature Extraction
To address the low long-sequence inference efficiency of BERT, the Mamba selective state space Model [26] is introduced after the BERT output layer to capture the contextual dependencies of long-sequence data, such as continuous comment chains, and a three-stage structure of long-sequence dependency capture, multi-attribute feature fusion, and joint prediction is designed, as shown in Figure 3.
Figure 3.
Three-stage architectural diagram of Mamba.
Long-term public opinion sequence evolution, such as comment chains {Text(u1), …, Text(uT)}, requires modeling long-range semantic associations. For instance, “Comment 1: ‘The exam was too difficult’, Comment 2: ‘I didn’t study either’, Comment 3: ‘I’m going to fail’” demonstrates a progressive escalation of anxiety. Mamba’s SSM captures long-term dependencies with linear complexity O(T) through a selective gating mechanism.
First, project the sentiment representation Vemotion(ut) output by BERT (where t = 1, 2, …, T denotes sequence time steps) onto Mamba’s input dimension dmamba, as shown in Equation (10):
where LinearP(.) denotes the linear projection layer. Subsequently, the selective gating vector Gt is computed to dynamically adjust the flow of information within the state space, as shown in Equation (11):
Among these, SiLU(.) denotes the sigmoid linear unit activation function. LinearG(.) represents the gated projection layer.
The core of Mamba lies in the linear transformation of the state space, achieving state updates through the diagonal matrix At (state decay coefficients) and the input projection Bt, as shown in Equation (12):
where st ∈ Rdstate is the state vector at time t, At = Diag(LinearA(Xt)) is a diagonal matrix, and Bt = LinearB(Xt) is the input projection matrix. Finally, the state vector is transformed into a long sequence of sentiment features through the output projection layer, as shown in Equation (13):
where the parameter matrix WO ∈ Rdmodel×dstate of LinearO(.) is defined. Thus, the long sequence {Vemotion(u1), …, Vemotion(uT)} is transformed into a feature sequence {O1, O2, …, OT}, incorporating long-range dependencies.
The thematic features f1(ut), temporal features f2(ut), media features f3(ut), and user identity features f4(ut) extracted in Section 3.3 serve as scenario-driven factors for public opinion risk (e.g., the combination “late-nighttime slot f2(ut) + campus forum f3(ut)” elevates the risk of public opinion diffusion). These must be fused with the long-sequence sentiment features Ot output by Mamba to complete the contextual information of public opinion.
First, construct a multi-attribute feature vector by directly reusing the quantization results from Section 3.3, as shown in Equation (14):
Subsequently, project Fattr(ut) onto the dmodel dimension to ensure dimensional matching with Ot, as shown in Equation (15):
Concatenate the long-sequence sentiment features Ot output by Mamba with the projected attribute features Fproj(ut), and extract cross-modal features through the fusion layer, as shown in Equations (16) and (17):
where Wfuse ∈ Rdmodel×2dmodel is the fusion layer parameter matrix, and GELU(.) denotes the Gaussian error linear unit activation function. Vfused(ut) ∈ Rdmodel represents the fused composite features.
The composite feature Vfused(ut) simultaneously outputs joint results of sentiment orientation and public opinion risk. Sentiment orientation is a fine-grained classification, such as anxiety, joy, and dissatisfaction; public opinion risk refers to ordinal diffusion levels with six ranks: Level 0 (no risk), Level 1 (low risk), Level 2 (medium-low risk), Level 3 (medium risk), Level 4 (medium-high risk), and Level 5 (high risk).
First, calculate the logits for sentiment orientation, as shown in Equation (18):
where WE ∈ RCe×dmodel, Ce = 4 denotes the number of sentiment categories, and bE ∈ RCe. This is converted into a probability distribution via the Softmax function, as shown in Equation (19):
where Pemotion(c|ut) denotes the probability that the tth public opinion belongs to sentiment category c. Similarly, the logits for public opinion risk are calculated as shown in Equations (20) and (21):
where WR ∈ RCr×dmodel, Cr = 6 denotes the number of risk ranks, and Prisk(r|ut) represents the probability that the t-th public opinion record belongs to risk level r.
To ensure the synergistic optimization of sentiment recognition and public opinion risk prediction, a multi-task loss function is employed to balance the training weights of both tasks. The risk task adopts ordinal cross-entropy loss, which fully exploits the ordinal information among risk levels and eliminates the defect of standard cross-entropy that ignores the progressive relationship between ranks, as shown in Equation (22):
The optimal value α = 0.6 is selected as the loss weight to prioritize the accuracy of sentiment recognition, and Le denotes the cross-entropy loss for sentiment classification, as shown in Equation (23):
Lr is the ordinal cross-entropy loss for ordinal risk classification, with the core logic of decomposing the six ordinal ranks into 5 binary classification subtasks, as shown in Equation (24):
where yr,k is the ordinal label of risk rank: yr,k = 1 if the true risk rank is greater than k; otherwise, it is 0; σ(.) denotes the sigmoid function; and zR,k is the logits output of the k-th ordinal binary classification subtask.
4. Experiments
4.1. Experimental Environment
The experimental environment was constructed around the core requirement of predicting the public opinions of university students, with specific configurations as shown in Table 2.
Table 2.
Experimental environment configuration.
The model parameter design revolves around a core architecture: the sentiment representation layer employs the “bert-base-chinese” pre-trained model, featuring a 12-layer Transformer encoder with 768-dimensional hidden layers and 12 attention heads. The [CLS] token output is utilized as the 768-dimensional sentiment feature vector for the text, tailored for fine-grained sentiment recognition.
The input dimension of the long-sequence modeling layer, Mamba, is aligned with BERT’s output at 768 dimensions. The diagonal decay matrix of the state space model is initialized with Softplus at −0.5. The selective gating vector is generated through a 256-dimensional linear layer with SiLU activation, enabling linear-time complexity dependency capture for long sequences (e.g., chains of 100 consecutive comments).
The fusion prediction layer projects multi-attribute features, such as topic, sentiment intensity, and dissemination scope, into a 768-dimensional space via a linear layer. These are then combined with Mamba outputs through a 768 × 1536 fusion matrix and subjected to GELU activation, yielding dual-task predictions for “sentiment orientation” and “public opinion risk”. During training, a batch size of 64 is employed, with the learning rate dynamically adjusted via cosine annealing. Model performance on the validation set is evaluated every 200 steps. The loss function combines sentiment classification cross-entropy and public opinion risk cross-entropy with a weight ratio of 0.6:0.4, prioritizing sentiment recognition accuracy. Total loss is optimized through weighted summation. An early stopping strategy is implemented: training terminates if the validation set F1 score fails to improve for three consecutive rounds, preventing model overfitting.
4.2. Experimental Dataset
The experimental dataset comprises two categories. The first is the public benchmark ChnSentiCorp Chinese Sentiment Analysis Dataset [27] for validating basic sentiment recognition capabilities, which is an independent public benchmark and is not included in the sample statistics of the self-built corpus. The second is a self-built corpus of university student public opinions for real-scenario verification, containing approximately 135,000 raw student comments collected from “Weibo Super Topics” and “Campus BBS Forums” of the university from January 2024 to June 2025 and covering typical public opinion themes such as academic pressure, campus services, and social activities. Table 3 presents the joint distribution statistics of sentiment orientation and public opinion risk for the real corpus.
Table 3.
Joint distribution of sentiment and risk in real-world corpus.
To avoid data leakage across users, events, and comment threads caused by the traditional random 8:1:1 split, this study adopts a strict splitting strategy with temporal order priority and triple isolation of authors, events, and threads for the self-built corpus. Based on the posting timestamps of samples, the first 80% of samples on the time axis are sorted into the training set, the middle 10% into the validation set, and the last 10% into the test set. During the splitting process, it is strictly enforced that there are no overlapping authors, no samples from the same public opinion event, and no related comments from the same discussion thread between the training set and the test set. This fundamentally eliminates performance overestimation caused by sample correlation and ensures that the experimental results conform to real-world deployment scenarios.
4.3. Evaluation Indicators
University sentiment public opinion analysis requires distinguishing four granular sentiment categories: “positive, negative, anxiety, and empathy”. This task faces sample imbalance issues. To comprehensively evaluate a model’s recognition capabilities across different sentiment categories, six key metrics are selected: precision, recall, F1 score, macro-average F1, micro-average F1, and average accuracy.
Precision: measures the model’s ability to “avoid misclassification”, i.e., the proportion of samples correctly classified as a specific sentiment category among those predicted to belong to it, as shown in Equation (25):
where TPi denotes the number of true positive samples for sentiment category i, and FPi denotes the number of false positive samples for category i.
Recall: measures the model’s ability to avoid “missing” true positives, i.e., the proportion of samples genuinely belonging to a certain sentiment category that are correctly predicted, as shown in Equation (26):
where FNi denotes the number of false negative samples in category i.
F1 score: the harmonic mean of precision and recall, balancing the trade-off between “false positives” and “false negatives” to more comprehensively reflect the recognition performance of single-category sentiment, as shown in Equation (27):
Macro-F1: the arithmetic mean of F1 scores across all sentiment categories, emphasizing the detection capability of minority sentiment classes such as “anxiety” to mitigate evaluation bias caused by sample imbalance, as shown in Equation (28):
where K = 4 represents the number of fine-grained sentiment categories.
Mean accuracy (mAcc): the arithmetic mean of accuracy rates across all sentiment categories, intuitively reflecting the model’s overall recognition capability for various sentiments, as shown in Equation (29):
where TNi denotes the number of true negative samples in category i.
Key attribute combination set: based on high-risk scenarios identified from university public opinion, six typical attribute combinations were selected (e.g., “Time = Late Night ∩ Topic = Academic Pressure”, “Time = Back-to-School Season ∩ Topic = Dormitory Services”, “User = Freshman ∩ Topic = Social Activities”), forming the combination set A = {A1, A2, …, A6}.
Combination Weight (wj): This assigns risk levels based on attribute combinations. For example, the anxiety associated with “late night + academic pressure” tends to trigger high-risk public opinion, with weight w1 = 0.2; the aversion linked to “back-to-school season + dormitory” often leads to medium-risk public opinion, with weight w2 = 0.15; the empathy sentiment of ‘freshmen + socializing’ is prone to trigger low-risk public opinion, with weight w3 = 0.1.
Therefore, multi-attribute coverage (MAC) [28] is the weighted average of sentiment recognition accuracy across all key attribute combinations, comprehensively measuring a model’s ability to uncover correlations. Higher values indicate stronger associative capabilities, as shown in Equation (30):
The PR metric [29] is introduced as an auxiliary continuous quantitative evaluation indicator to measure the numerical fitting degree of the model for the risk level of a public opinion record at a specific moment and is used to supplement the evaluation of the quantitative deviation of risk levels. Risk levels adopt discrete ordinal ranks from 0 to 5 (0 = no risk, 1 = low risk, …, 5 = high risk), as shown in Equation (31):
where Bi is the model prediction value, B is the actual value, and ε = 10−6 prevents the denominator from becoming zero when B = 0. This intuitively reflects the closeness between the predicted and actual values, with smaller errors indicating higher accuracy.
4.4. Experimental Analysis
4.4.1. Model Parameter Experiment
This experiment investigates the impact of batch_size on sentiment recognition performance. Six sets of batch_size values were set with gradually increasing gradients, and core sentiment recognition metrics were selected for comparison. The results are shown in Figure 4.
Figure 4.
Model parameter experiment.
When batch_size is small, the sample base for each parameter update is limited: on the one hand, excessive gradient noise makes the training process susceptible to interference from individual outlier samples. On the other hand, small batches struggle to cover fine-grained sentiments, resulting in insufficient feature learning for minority sentiment classes and a significant increase in misclassification rates for nuanced expressions.
When batch_size is excessively large, the averaging effect of samples diminishes the discernibility of sentiment details: statistical averaging across numerous samples blurs expressive distinctions, leading to increased misclassification rates. At batch_size = 64, sufficient gradients are provided for BERT’s Transformer layers to update attention weights and capture sentiment-related features, while simultaneously delivering stable inputs to Mamba’s state space model, preventing gradient fluctuations or loss of detail.
The weight coefficient of the sentiment classification loss in the multi-task loss is set as α, and the corresponding weight of the ordinal risk classification loss is 1 − α. Six groups of gradient values are set within the range of 0.3 to 0.8, with sentiment recognition mAcc and risk prediction Macro-F1 as the core evaluation metrics. All experiments are independently repeated five times, and the mean and standard deviation of each metric are reported. The results are shown in Table 4.
Table 4.
Experimental results of loss weight α.
The experimental results show that as α increases, the performance of both sentiment recognition and risk prediction presents a trend of first rising and then falling. When α = 0.6, the sentiment recognition accuracy reaches its peak, and the risk prediction performance is also at the optimal level, achieving the best comprehensive performance of the two tasks. When α is too small, the weight of the sentiment task is insufficient, leading to inadequate learning of deep semantic representations and indirectly restricting the effect of risk prediction. When α is too large, the guiding role of scenario attributes in the risk task is weakened, resulting in a decline in overall performance. The experimental results provide direct experimental evidence for the parameter selection of α = 0.6 and verify the rationality and optimality of the current weight setting.
4.4.2. Comparative Experiment
To verify the effectiveness of the proposed discrete matched filtering cleaning method, three mainstream text-cleaning baseline methods are selected for comparative experiments. The adaptability and advantages of the framework are verified from three dimensions: noise filtering capability, valid information retention capability, and downstream task gain. All experiments are independently repeated with five different random seeds. All metrics are reported as mean ± standard deviation, and paired two-tailed t-tests are performed to verify the statistical significance of performance differences with a significance level of p < 0.05. The results are shown in Table 5.
Table 5.
Performance comparison of different text-cleaning methods.
The experimental results verify the application value of the discrete matched filtering framework in text cleaning scenarios from two levels, mechanism rationality and performance effectiveness, and address the question regarding the adaptability of continuous signal models. First, the conversion method of word frequency serialization with temporal sliding windows provides a computable discrete signal carrier for matched filtering. Template convolution essentially performs correlation calculation on the temporal word frequency patterns of specific topics, rather than executing meaningless mathematical operations on discrete symbols, which completes the theoretical implementation in terms of modeling logic. Second, the performance comparison shows that the noise filtering accuracy of the proposed method is eight percentage points higher than that of the optimal baseline, and the valid information retention rate is six percentage points higher. Its core advantage lies in accurately distinguishing low-frequency genuine sentiment expressions from meaningless interference through topic templates, avoiding the common defect of rule-based and classifier-based methods that tend to mistakenly delete niche sentiment expressions. Statistical test results show that the improvements of the proposed method in all three metrics reach statistical significance (p < 0.05). The performance gaps are far larger than the range of experimental random fluctuations, proving that the improvement in cleaning effectiveness stems from the inherent mechanism advantages of the method rather than random variance. Finally, the performance gain of downstream tasks directly confirms the value of cleaning quality: after cleaning by the proposed method, the sentiment recognition mAcc is improved by 2.08 percentage points compared with the naive Bayes cleaning scheme, indicating that this method maximally preserves the integrity of sentiment semantics while filtering out noise and provides a higher-quality data foundation for subsequent feature extraction and prediction tasks.
To validate the superiority of the proposed BERT–Mamba sentiment recognition model, four classic baseline models were selected for comparative experiments, focusing on evaluating performance differences in fine-grained sentiment recognition tasks for campus public opinion.
TextCNN [30]: a local feature extraction model based on convolutional neural networks, excelling at capturing sentiment keywords in short texts.
BiLSTM [31]: a bidirectional long short-term memory network that models sequence dependencies through a recursive structure.
BERT-base [32]: a foundational Transformer pre-training model that learns global semantics through self-attention mechanisms.
RoBERTa-base [33]: an optimized BERT variant (featuring dynamic masking and larger batch sizes) that enhances pre-training semantic comprehension.
All models are independently trained and tested with five different random seeds. All metrics are reported as the mean ± standard deviation, and paired two-tailed t-tests are conducted to examine the performance difference between the proposed model and RoBERTa-base. Accordingly, the sentiment recognition performance comparison results for each model are shown in Table 6:
Table 6.
Performance comparative experiments.
Campus public opinion analysis often involves causal chains or turning points. Traditional models such as TextCNN, relying on n-gram local features, struggle to model such long-term dependencies and fail to grasp causal relationships, resulting in an mAcc of only 0.85. BiLSTM can process sequences, but its recursive structure suffers from gradient vanishing in long sequences, resulting in low “anxiety” recognition rates for comments exceeding 100 words and a Macro-F1 score of only 0.82. BERT-base and RoBERTa-base enhance semantic understanding through pre-training, but the Transformer’s self-attention mechanism exhibits complexity that grows quadratically with sequence length, diluting key sentiment information in long sequences. In contrast, BERT–Mamba employs Mamba’s linearly scaled state space model (SSM) to efficiently capture sentiment dependencies in long sequences. Mamba dynamically selects key sentences while preserving contextual relationships, achieving significantly higher accuracy (mAcc = 0.9744) on long comments compared to baselines.
Statistical test results verify the statistical reliability of the performance differences: the proposed model significantly outperforms the RoBERTa-base baseline in all five metrics (all p < 0.05). The mAcc standard deviation of RoBERTa-base is only 0.003, while the mAcc gap between the proposed model and this baseline reaches 3.44 percentage points, which is far beyond the normal range of random training fluctuations.
4.4.3. Ablation Experiment
To verify the necessity and quantitative contribution of the model’s core components, this paper designed ablation experiments targeting three core modules: BERT pre-trained semantic encoding, Mamba long-sequence state space modeling, and multi-attribute feature fusion. All variants are independently repeated with five different random seeds, and the mean and standard deviation of metrics are reported. Paired two-tailed t-tests are applied to verify the significance of performance differences between the full model and each ablation variant. By comparing the performance differences between the full model and each ablation variant, we independently verified the improvement value of each component on sentiment recognition accuracy, as shown in Table 7.
Table 7.
Ablation experiment.
As shown in the table, BERT pre-trained encoding has irreplaceable foundational semantic value. The mAcc of the Mamba-only variant (with BERT removed) is only 0.87, a decrease of 10.44 percentage points compared with the full model, and its precision and F1 score also drop to 0.85 and 0.84, respectively, fully demonstrating that pre-trained semantic representation is the core foundation of the model’s sentiment recognition capability.
Mamba long-sequence modeling plays a key enhancement role. The BERT-only variant (with Mamba removed) achieves a mAcc of 0.93, 4.44 percentage points lower than the full model, and its Macro-F1 drops to 0.90, verifying that Mamba is the core component for capturing long-sequence sentiment dependencies and compensating for the shortcomings of BERT in long-range semantic correlation.
Mamba has structural advantages over traditional sequence models. The BERT-LSTM variant (with Mamba replaced by BiLSTM) achieves a mAcc of 0.95, a decrease of 2.44 percentage points compared with the full model. The recursive structure of BiLSTM is prone to gradient vanishing in long sequences and cannot effectively capture long-range dependencies, while Mamba’s selective state space mechanism can actively focus on sentiment-critical sentences, making it more adaptable to the long-sequence characteristics of campus comments.
Multi-attribute feature fusion is one of the core gain sources of the model. After removing multi-attribute features, the mAcc of BERT–Mamba drops to 0.9520, 2.24 percentage points lower than the full model, and its Macro-F1 decreases by three percentage points, among which the F1 scores of implicit sentiment categories such as anxiety and empathy drop by 4.2 percentage points. The underlying logic is that text-only models can only capture literal semantics and cannot correct sentiment judgments by combining scene priors such as release time, communication platform, and user identity. For example, a subtle complaint posted late at night is easily misjudged as neutral by a text-only model but can be accurately identified as negative after integrating the weight of temporal attributes. Multi-attribute features supplement the model with a discriminative basis from the scenario dimension, effectively improving the recognition accuracy of implicit sentiments and edge samples.
Paired t-test results indicate that the performance differences between the full model and all ablation variants reach statistical significance (p < 0.05). Specifically, the mAcc drop of 2.24 percentage points after removing multi-attribute features is far larger than the range of experimental random fluctuations, verifying that the multi-attribute integration module brings a real and stable gain to model performance, which further supports its status as a core contribution.
4.4.4. Emotion Recognition Experiment
This experiment focuses on the precise identification of fine-grained sentiments in campus public opinion. Targeting four core sentiment categories in the dataset—positive (35%), negative (30%), anxiety (20%), and empathy (15%)—it compares the classification performance of the proposed BERT–Mamba model with baseline models, as shown in Figure 5.
Figure 5.
Emotion recognition experiment.
The experimental results clearly demonstrate BERT–Mamba’s strong adaptability to sentiment features in campus public opinion. For explicit sentiments that were positive and negative, the F1 scores reached 0.975 and 0.965, respectively, representing a three-percentage-point improvement over RoBERTa-base. For implicit sentiments of anxiety and empathy, the F1 scores reached 0.955 and 0.93, respectively, representing a five-percentage-point improvement over RoBERTa-base. The overall mean accuracy (mAcc) reached 0.9744, surpassing the optimal baseline model by 3.44 percentage points. This outcome directly addresses the core recognition challenge in campus public opinion analysis: fine-grained sentiment depends on contextual associations.
4.4.5. Multi-Attribute Overlay Experiment
Risk levels depend not only on single attributes such as “spread scale” or “sentiment intensity”, but also on combined factors such as “user influence”. Therefore, this experiment introduces multi-attribute coverage to measure the model’s ability to capture multiple drivers of public opinion risk. We selected traditional time series models (ARIMA) [34], recurrent sequence models (LSTM) [35], sentiment–sequence fusion models (BERT-LSTM) [36], and three contemporary efficient Transformer variants: Linformer [37], Performer [38], and Longformer [39], covering mainstream sequence modeling technology families to fully verify the multi-attribute modeling advantages of the proposed model in the current NLP landscape. All models are tested for five repeated experiments, with the mean and standard deviation reported. The significance of the difference between the proposed model and the Longformer baseline is also verified. To further verify the balance of attribute modeling from the internal mechanism of the model, we supplement attention weight distribution statistics and SHAP feature attribution analysis, quantify the contribution ratios of emotional semantic features, propagation temporal features, and user attribute features to the risk prediction output, and reveal the feature encoding bias of different models from the representation level. The results are shown in Table 8 and Table 9, respectively.
Table 8.
Multi-attribute coverage experiment.
Table 9.
Contribution ratios of multi-attribute features of each model.
The experiment closely follows the core logic of the “sentiment—propagation—user” multi-attribute collaborative driving of campus public opinion, and the multi-attribute coverage (MAC) results clearly highlight the scenario adaptability of BERT–Mamba.
According to the measured data, the traditional ARIMA only has basic fitting capabilities for propagation scale, with sentiment coverage and user influence coverage of only 0.72 and 0.58, respectively, and attribute omission easily leads to risk misjudgment. LSTM and BERT-LSTM gradually improve the coverage performance of the sentiment dimension through a recurrent structure and pre-trained semantics, but are limited by the long-distance dependency attenuation of recurrent structures and are insufficient for capturing dynamic signals, such as user influence mutations and propagation inflection points. The user influence coverage of BERT-LSTM is only 0.72, with a limited multi-attribute collaborative modeling effect.
Linformer, Performer, and Longformer optimize long-sequence inference efficiency through low-rank approximation, random feature mapping, and sliding window attention, respectively. Their overall coverage is further improved compared with the semantic–temporal fusion model. Combined with SHAP feature attribution and attention weight statistics, the internal feature allocation of the three models shows significant emotional bias: the contribution ratio of emotional semantic features to the model’s risk prediction output exceeds 55% for all three models, among which Longformer reaches 58.7%, while the contribution ratio of user attribute features is less than 22%. The weight allocation of the self-attention mechanism is highly concentrated on emotional words and semantically related fragments in the text, and the attention ratio to discrete attributes such as user identity markers and propagation node features is less than 25% of the total. This result directly confirms, from the internal representation level of the model, that such efficient Transformer variants have attention bias in the emotional semantic dimension. It is this imbalance of internal feature allocation that leads to significantly weaker coverage and modeling accuracy in the user attribute dimension than in the emotional dimension, and the three models fail to achieve a balanced and accurate capture of sentiment, propagation, and user attributes.
The capability of BERT–Mamba to capture propagation dynamics and user mutations is supported by corresponding experimental data: relying on the pre-trained semantic representation capability of BERT, its sentiment coverage reaches 0.92, maintaining the advantage of fine-grained sentiment recognition. With the temporal dynamic modeling capability of Mamba’s selective state space model, the propagation coverage and user influence coverage reach 0.89 and 0.87, respectively, which are three and eleven percentage points higher than those of the Longformer baseline, and the MAC index is 16 percentage points higher, directly verifying its effective capture of propagation evolution dynamics and sudden signals of user influence. From the feature attribution results, the contribution ratios of the three types of features of BERT–Mamba are 42.3%, 31.5%, and 26.2%, respectively, with a more balanced distribution. The state space modeling mechanism of Mamba effectively improves the encoding weight of propagation temporal and user attribute features and alleviates the emotional bias problem of traditional Transformer models. Statistical tests show that the proposed model significantly outperforms the Longformer baseline in all four coverage metrics (p < 0.05), and the performance improvement is statistically reliable. This full-dimensional and balanced multi-attribute capture capability can provide more comprehensive feature support for campus public opinion risk assessment and effectively reduce the misjudgment risk caused by single-attribute deviation.
4.4.6. Temporal Hidden-State Representation Experiment
To directly verify the capability of the Mamba module in encoding public opinion propagation dynamics and avoid indirect inference merely from downstream task accuracy, this section conducts a temporal hidden-state representation experiment. We computed the cosine distances of hidden vectors between adjacent timesteps and around public opinion inflection points for different models. Lower cosine distance indicates a stronger ability to distinguish temporal evolution differences within hidden spaces, reflecting a better temporal dynamic modeling capacity. The experimental results are presented in Table 10.
Table 10.
Temporal hidden-state representation similarity.
As shown in the experimental results, ARIMA yields high cosine distances for both metrics. It only models external statistical time series and cannot learn deep temporal representations fused by text and attributes. Recurrent models LSTM and BERT-LSTM achieve moderate improvement, yet are constrained by long-distance gradient decay and cannot adequately characterize abrupt information at inflection points. Efficient Transformer baselines obtain slight gains compared with recurrent models. Limited by sliding-window attention, they cannot fully capture continuous evolutionary correlations within long sequences, leading to limited improvements in temporal discrimination. BERT–Mamba achieves the lowest cosine distances on both metrics. It demonstrates that the selective state space mechanism of Mamba continuously updates and preserves historical propagation information. The model can clearly distinguish stable evolution stages and abrupt inflection stages in hidden representation spaces. High transmission reach on downstream tasks is no longer merely task-level performance and is directly supported by hidden-state evidence. Although Transformer variants excel at long-text modeling, encoding continuous temporal evolution is not their inherent strength. Mamba fills this gap and achieves joint optimization of semantic understanding and temporal dynamic modeling, providing internal representation-level evidence for public opinion risk identification.
4.4.7. Risk Evolution Prediction Experiment
This experiment focuses on the prediction of six ordinal risk levels of campus public opinion risk evolution, aiming to capture the dynamic changes of risk from Level 0 (no risk) to Level 5 (high risk) and provide a quantitative basis for intervention in campus management. Each piece of data is labeled with the ordinal risk level at the corresponding moment: 0 = no risk, 1 = low risk, 2 = medium-low risk, 3 = medium risk, 4 = medium-high risk, 5 = high risk. All models are independently tested with five different random seeds, all metrics are reported as mean ± standard deviation, and paired two-tailed t-tests are performed to verify the performance difference between the proposed model and the Transformer baseline. The results are shown in Table 11.
Table 11.
Risk evolution prediction experiment.
The experimental results fully validate the adaptability of BERT–Mamba to the evolution characteristics of campus public opinion risks, and its advantages focus on the logical core of the PR metric and the practical value of stage identification. The high PR performance (0.91) stems from the model’s precise deconstruction of the core logic: BERT extracts sentiment semantics and captures the cumulative sentiment intensity as risks emerge from scratch. For example, when the public opinion level rises from 0 to 5, the proportion of negative sentiment increases from 10% to 85%. The state space model of Mamba focuses on mutation nodes, avoiding the dilution of mutation signals caused by the limitation of sliding window weight distribution in efficient Transformer variants such as Longformer. In terms of stage identification, the high accuracy in the sprout stage (0.89) and burst stage (0.83) perfectly matches the demand of campus prevention and control.
Statistical test results verify the statistical reliability of performance differences: the proposed model significantly outperforms the Longformer baseline in all six metrics (all p < 0.05). Specifically, the accuracy gap in the burst stage reaches 16 percentage points, which is far beyond the range of experimental random fluctuations, indicating that BERT–Mamba’s capability to capture risk mutation nodes derives from stable architectural advantages rather than random training fluctuations.
For instance, in a “dormitory management” public opinion case with actual levels 0→2→4→5, BERT–Mamba predicted 0→1→4→5 with a relative error far smaller than that of Transformer (0→2→3→4), effectively preventing “over-intervention” or “missing outbreak detection”.
4.4.8. Inference Efficiency Comparison Experiment
This experiment focuses on the inference efficiency of the model in real-time campus public opinion monitoring scenarios. The core objective is to verify whether the model can meet the practical deployment requirements of “low latency and high throughput” while maintaining high prediction accuracy.
To ensure the equivalence of comparison and reproducibility of results, all deep semantic models are tested with end-to-end benchmarks on a single NVIDIA A100-SXM4-40 GB GPU under unified control variables: the input text sequence length is fixed at 256 (matching the average length of campus review texts), the batch size is set to 1 to simulate single-sample real-time inference in real scenarios, the numerical precision is FP32, and 100 sample warm-up runs are performed before testing to eliminate GPU cold start errors. The inference time statistics cover the whole process of text tokenization preprocessing, model forward propagation, and result output. Latency metrics are reported in both median and 95th percentile (P95), along with model parameter count and peak memory consumption. Among them, ARIMA is a pure statistical time series model that does not perform semantic encoding computation and is only used as a baseline reference for time series methods. The core equivalent comparison focuses on deep semantic architectures including BERT-LSTM, Longformer, and BERT–Mamba. The main experimental results are shown in Table 12.
Table 12.
Experiment comparing inference efficiency.
To further verify the efficiency and scalability in situations with long sequences, the throughput performance at sequence lengths of 128 and 512 is additionally tested. When the sequence length increases from 128 to 512, the SPS of Longformer drops from 357 to 168, with an attenuation of 52.9%, while the SPS of BERT–Mamba drops from 886 to 705, with an attenuation of only 20.4%, showing a significant advantage in efficiency and stability in long-sequence scenarios.
In terms of computational mechanism, BERT–Mamba does not have linear complexity across the entire pipeline: the front-end BERT encoder adopts the standard self-attention mechanism to extract semantic features, with a complexity of O(n2); the back-end temporal modeling module is replaced with a Mamba state space structure with O(n) linear complexity, which replaces the sliding-window sparse attention computation in Longformer that is still based on the self-attention framework. This significantly reduces computational overhead and memory usage in long-term temporal dependency modeling, which is the core source of efficiency improvement.
In terms of scenario adaptability, although ARIMA has extremely high efficiency, it completely ignores sentiment semantics, resulting in it failing to meet the core demand of risk identification. As a typical variant of the efficient Transformer, Longformer reduces the computational complexity of long sequences through sparse attention, but still does not break away from the essential self-attention computational framework, with obvious efficiency attenuation as sequence length expands, making it difficult to cope with the high-concurrency real-time update of “dozens of new data entries per second” in campus scenarios. Experimental results show that in the typical campus review scenario with a sequence length of 256, the throughput of BERT–Mamba is about 2.8 times that of the Longformer baseline, the median inference latency is only about 35% of the latter, and the peak memory usage is reduced by 27.9%. This balance between accuracy and efficiency perfectly matches the real-time demand of campus “early-stage intervention”. For example, when 50 new public opinion entries are added to the platform per second, BERT–Mamba can complete all inference within 0.06 s, avoiding missing the optimal intervention window due to latency and providing highly feasible technical support for real-time campus public opinion monitoring.
5. Discussion
The university public opinion prediction model integrating multi-attribute decision-making and BERT–Mamba proposed in this study achieves the expected performance in college student sentiment recognition and dynamic risk prediction, but it still has three distinct limitations. First, there are constraints in data coverage and modalities. The experimental data are only collected from Weibo super topics and campus BBS, excluding public opinion content from short-video platforms and private social scenarios; meanwhile, the data are mainly in pure text form without integrating multimodal emotional information such as images, audio, and video, making it difficult to fully cover the diverse online emotional expression patterns of college students. Second, the dynamic adaptability of the multi-attribute decision-making mechanism is insufficient. The weight calibration of topic, temporal, platform, and user attributes currently relies on expert experience and historical propagation data and lacks an adaptive weight adjustment mechanism for sudden public opinion events, which is prone to risk level evaluation deviation in extreme scenarios at the initial outbreak stage. Third, the scenario generalization ability of the model remains to be expanded. Validated only on the public opinion corpus of a single university, the model has not undergone cross-scenario migration tests in colleges of different educational levels and regions; moreover, it does not integrate students’ offline behavioral data, and the depiction of the transmission mechanism from individual emotion to group public opinion is still not thorough enough. Future research can be carried out around multimodal data fusion, dynamic weight learning, and cross-domain migration optimization.
6. Conclusions
This paper addresses core challenges in analyzing university students’ sentiment-based public opinion, including high dynamism, scenario dependency, and imbalance in fine-grained sentiment samples. It proposes a multi-attribute fusion prediction model centered on the BERT–Mamba architecture. The model extracts deep semantic features from text using BERT, leverages Mamba to capture contextual dependencies in long comment chains, and integrates scenario-driven factors such as topic, time, and user identity to construct cross-modal composite features. This enables fine-grained sentiment recognition and collaborative prediction of public opinion risk. Experimental validation demonstrates the model’s superior performance on the THUNUS public dataset and a custom corpus of 113,000 university public opinion instances. It significantly enhances F1 scores for minority sentiments such as anxiety and macro-average F1, effectively balancing precision and recall. By resolving context information loss in long sequences and establishing a collaborative framework, the model provides technical support for precise university public opinion management.
Although the model demonstrates strong performance in predicting university sentiment and public opinion, further refinement is needed in the following areas: The current multi-attribute weights are determined via a two-stage approach of data optimization combined with expert validation. They achieve favorable internal validity in university public opinion scenarios but lack external stability across domains and groups and require recalibration for transfer applications. Future work could incorporate self-supervised learning or reinforcement learning to achieve dynamic weight adaptation, enhancing adaptability to complex scenarios. Mamba’s state space dimension is currently fixed; future exploration should focus on dimension adaptation mechanisms to balance long-sequence modeling capability with model complexity. Existing data is limited to platforms such as Weibo and campus BBS; future integration of cross-platform heterogeneous data from WeChat, Douyin, etc., is needed to strengthen public opinion propagation path modeling. Combining student attendance, consumption, and other behavioral data can achieve multi-source fusion, enhancing the timeliness and accuracy of risk prediction. For scenarios with sparse samples, such as freshman adaptation periods and graduation seasons, small-sample learning methods can be explored to expand generalization capabilities, providing a more comprehensive technical solution for full-scenario coverage of university public opinion.
Author Contributions
B.C.: Methodology, Data curation, and Writing—original draft. Y.H.: Conceptualization, Writing—review and editing, and Formal analysis. All authors have read and agreed to the published version of the manuscript.
Funding
This research was funded by the Excellent Young Scholars Fund of Anhui Provincial Department of Education under Grant YQYB2023167 and Anhui Provincial Scientific Research Project under Grant 2025AHGXZK30353.
Institutional Review Board Statement
This study only uses publicly available aggregated social media data without personally identifiable information. It does not involve human subjects research or personal privacy information, thus satisfying the conditions for ethical review waiver and requiring no approval from the institutional review board.
Informed Consent Statement
All data used in this study are publicly available non-personally identifiable aggregated data and do not involve the collection of subjects’ personal information; accordingly, the requirement for informed consent is waived.
Data Availability Statement
The data presented in this study are included in the article. Further inquiries can be directed to the corresponding author.
Acknowledgments
During the preparation of this manuscript, the authors used AI for minor language editing, including spelling and grammar correction. The tool was not used for generating scientific content, data analysis, or conclusions. All content has been carefully reviewed and revised by the authors, who take full responsibility for the final manuscript.
Conflicts of Interest
The authors declare no conflicts of interest.
References
- Xie, J.; Zhang, S.; Lin, L. Prediction of network public opinion based on bald eagle algorithm optimized radial basis function neural network. Int. J. Intell. Comput. Cybern. 2022, 15, 260–276. [Google Scholar] [CrossRef] [Scilit]
- Haselswerdt, J. Mental Health Treatment Access: Experience, Hypotheticals, and Public Opinion. Milbank Q. 2025, 103, 100–129. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Zhang, D. Data Mining and Big Data in Social Media Public Opinion Monitoring. Media Commun. Res. 2023, 4, 44–51. [Google Scholar] [CrossRef] [Scilit]
- Hu, T.; Wang, S.; Luo, W.; Zhang, M.; Huang, X.; Yan, Y.; Liu, R.; Ly, K.; Kacker, V.; She, B.; et al. Revealing Public Opinion Towards COVID-19 Vaccines with Twitter Data in the United States: Spatiotemporal Perspective. J. Med. Internet Res. 2021, 23, e30854. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Guo, J. Deep learning approach to text analysis for human emotion detection from big data. J. Intell. Syst. 2022, 31, 113–126. [Google Scholar] [CrossRef] [Scilit]
- Kar, A.K.; Kushwaha, A.K. Facilitators and barriers of artificial intelligence adoption in business–insights from opinions using big data analytics. Inf. Syst. Front. 2023, 25, 1351–1374. [Google Scholar] [CrossRef] [Scilit]
- Christian, H.; Suhartono, D.; Chowanda, A.; Zamli, K.Z. Text based personality prediction from multiple social media data sources using pre-trained language model and model averaging. J. Big Data 2021, 8, 68. [Google Scholar] [CrossRef] [Scilit]
- Chang, V. An ethical framework for big data and smart cities. Technol. Forecast. Soc. Chang. 2021, 165, 120559. [Google Scholar] [CrossRef] [Scilit]
- Haque, M.U.; Dharmadasa, I.; Sworna, Z.T.; Rajapakse, R.N.; Ahmad, H. “I think this is the most disruptive technology”: Exploring Sentiments of ChatGPT Early Adopters using Twitter Data. arXiv 2022, arXiv:2212.05856. [Google Scholar]
- Gaur, L.; Afaq, A.; Solanki, A.; Singh, G.; Sharma, S.; Jhanjhi, N.; My, H.T.; Le, D.-N. Capitalizing on big data and revolutionary 5G technology: Extracting and visualizing ratings and reviews of global chain hotels. Comput. Electr. Eng. 2021, 95, 107374. [Google Scholar] [CrossRef] [Scilit]
- Zhang, Y.; Hao, Z.; Gong, Z.; Zhang, R. Context-dependent probabilistic linguistic multi-attribute decision-making methods. Appl. Intell. 2025, 55, 681. [Google Scholar] [CrossRef] [Scilit]
- Yi, P.; Wang, S.; Li, W. Stochastic-simulation-based multi-attribute group decision-making method under uncertain environment and the application. Appl. Intell. 2025, 55, 233. [Google Scholar] [CrossRef] [Scilit]
- Sun, Z.; Kong, X. Multi-attribute fuzzy pattern decision making based on information systems. Sci. Rep. 2023, 13, 1–16. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Xiao, J.; Zhu, W. Data-Driven Personalized Individual Semantic Space Learning Methods for Linguistic Multi-attribute Group Decision Making. Group Decis. Negot. 2025, 34, 1211–1233. [Google Scholar] [CrossRef] [Scilit]
- Yang, P.; Liu, P. Evaluation of Intelligence Level of University Based on Hesitant Fuzzy VIKOR Multi-attribute Decision-Making Method with Credibility. Int. J. Fuzzy Syst. 2025, 1–14. [Google Scholar] [CrossRef] [Scilit]
- Jin, H.; Sun, X.; Jin, Z.; Kim, Y.-G. Hybrid Data Fusion for Elegant Emotion Recognition in Cloud-Based Big Data Systems. In Proceedings of the 2025 International Conference on Multi-Agent Systems for Collaborative Intelligence (ICMSCI), Erode, India, 20–22 January 2025; pp. 60–65. [Google Scholar]
- Yang, Y.; Peng, W. Emotion Recognition and Big Data Analysis using Bert: Taking Natural Language Processing as an Example. In Proceedings of the 2024 Second International Conference on Networks, Multimedia and Information Technology (NMITCON), Bengaluru, India, 9–10 August 2024; pp. 1–6. [Google Scholar]
- Bleyl, D.; Buxton, E.K. Emotion recognition on stackoverflow posts using bert. In Proceedings of the 2022 IEEE International Conference on Big Data (Big Data), IEEE, Osaka, Japan, 17–20 December 2022; IEEE: New York, NY, USA, 2022; pp. 5881–5885. [Google Scholar]
- Chandra, P.; Ahammed, T.; Ghosh, S.; Emon, R.H.; Billah, M.; Ahamad, I.; Balaji, P. Contextual Emotion Detection in Text using Deep Learning and Big Data. In Proceedings of the 2022 Second International Conference on Computer Science, Engineering and Applications (ICCSEA), Gunupur, India, 8 September 2022; pp. 1–5. [Google Scholar]
- Zhang, H.; Mimura, M.; Kawahara, T.; Ishizuka, K. Selective Multi-Task Learning for Speech Emotion Recognition Using Corpora of Different Styles. In Proceedings of the ICASSP 2022—2022 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), Singapore, 23–27 May 2022; IEEE: New York, NY, USA, 2022; pp. 7707–7711. [Google Scholar]
- Wang, X.; Meng, Z.; Jia, N. Analysis of the Evolution of Police-Related Public Opinion Based on Multi-Source Online Public Opinion Big Data. In Proceedings of the 2024 International Conference on Industrial IoT, Big Data and Supply Chain (IIoTBDSC), Wuhan, China, 20–22 September 2024; pp. 185–190. [Google Scholar]
- He, M.; Ma, C.; Wang, R. A Data-Driven Approach for University Public Opinion Analysis and Its Applications. Appl. Sci. 2022, 12, 9136. [Google Scholar] [CrossRef] [Scilit]
- Liu, X.; Wei, F.; Jiang, W.; Zheng, Q.; Qiao, Y.; Liu, J.; Niu, L.; Chen, Z.; Dong, H. MTR-SAM: Visual Multimodal Text Recognition and Sentiment Analysis in Public Opinion Analysis on the Internet. Appl. Sci. 2023, 13, 7307. [Google Scholar] [CrossRef] [Scilit]
- Tang, M. Design of Visual Model and Solutions for Public Opinion Monitoring and Analysis for Big Data. In Proceedings of the 2021 Asia-Pacific Conference on Communications Technology and Computer Science, Shenyang, China, 22–24 January 2021; pp. 295–301. [Google Scholar]
- Zhu, Z.; Mao, K. Knowledge-based BERT word embedding fine-tuning for emotion recognition. Neurocomputing 2023, 552, 126488. [Google Scholar] [CrossRef] [Scilit]
- Gu, A.; Dao, T. Mamba: Linear-time sequence modeling with selective state spaces. arXiv 2023, arXiv:2312.00752. [Google Scholar]
- Cui, Y.; Che, W.; Liu, T.; Qin, B.; Yang, Z. Pre-training with whole word masking for Chinese BERT. IEEE/ACM Trans. Audio Speech Lang. Process. 2021, 29, 3504–3514. [Google Scholar] [CrossRef] [Scilit]
- Huang, I.B.; Keisler, J.; Linkov, I. Multi-criteria decision analysis in environmental sciences: Ten years of applications and trends. Sci. Total Environ. 2011, 409, 3578–3594. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Edlinger, M.; van Smeden, M.; Alber, H.F.; Wanitschek, M.; Van Calster, B. Risk prediction models for discrete ordinal outcomes: Calibration and the impact of the proportional odds assumption. Stat. Med. 2022, 41, 1334–1360. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Kim, Y. Convolutional neural networks for sentence classification. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), Doha, Qatar, 25–29 October 2014; pp. 1746–1751. [Google Scholar]
- Hochreiter, S.; Schmidhuber, J. Long short-term memory. Neural Comput. 1997, 9, 1735–1780. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Devlin, J.; Chang, M.W.; Leem, K.; Toutanova, K. Bert: Pre-training of deep bidirectional transformers for language understand-ing. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), Minneapolis, MN, USA, 2–7 June 2019; pp. 4171–4186. [Google Scholar]
- Liu, Y.; Ott, M.; Goyal, N.; Du, J.; Joshi, M.; Chen, D.; Levy, O.; Lewis, M.; Zettlemoyer, L.; Stoyanov, V. Roberta: A robustly optimized bert pretraining approach. arXiv 2019, arXiv:1907.11692. [Google Scholar]
- Ahmad, M.; Qamar, H.; Rehman, A.A.; Khan, R. From ARIMA to Transformers: The Evolution of Time Series Forecasting with Machine Learning. J. Asian Dev. Stud. 2025, 14, 219–233. [Google Scholar] [CrossRef] [Scilit]
- Cheng, X. An attention embedded DUAL-LSTM method for financial risk early warning of the three new board-listed companies. PeerJ Comput. Sci. 2023, 9, e1271. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Liu, C.; Yan, J.; Guo, F.; Guo, M. Forecasting the Market with Machine Learning Algorithms: An Application of NMC-BERT-LSTM-DQN-X Algorithm in Quantitative Trading. ACM Trans. Knowl. Discov. Data 2022, 16, 62. [Google Scholar] [CrossRef] [Scilit]
- Jin, Y.; Wu, Y.; Gao, Y.; Zhang, S.; Xu, S.; Wang, C.-X. LinFormer: A Linear-Based Lightweight Transformer Architecture for Time-Aware MIMO Channel Prediction. IEEE Trans. Wirel. Commun. 2025, 24, 7177–7190. [Google Scholar] [CrossRef] [Scilit]
- Kwon, Y.; Kim, D.; Ceylan, D.; Fuchs, H. Neural human performer: Learning generalizable radiance fields for human performance rendering. Adv. Neural Inf. Process. Syst. 2021, 34, 24741–24752. [Google Scholar]
- Yang, S.; Zhang, S.; Fang, M.; Yang, F.; Liu, S. A Hierarchical Representation Model Based on Longformer and Transformer for Extractive Summarization. Electronics 2022, 11, 1706. [Google Scholar] [CrossRef] [Scilit]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.




