{'fraction_non_alphanumeric': 0.029900332225913623, 'fraction_numerical': 0.0, 'mean_word_length': 5.243523316062176, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
LSTM Wastewater Quality Prediction Based on Attention Mechanism

In order to solve the problem that some key water quality pa-rameters in the wastewater treatment process cannot be obtained in real time, a long and short-term memory network water qual-ity prediction model (SSAA-LSTM) based on SSA and attention mechanism is proposed. The model takes historical data as in-put, constructs models to learn the internal dynamic change law of features, introduces the attention mechanism, assigns different weights to the hidden state of the long and short-term memory network (LSTM) by mapping weighting and learning parame-ter matrix, and uses the sparrow search optimization algorithm (SSA) to achieve the optimal selection of hyperparameters for this model. The high-latitude feature vectors are prone to the dimensional disaster problem, so the SSAA-LSTM model with principal component analysis(PCA-LSTM) is further proposed to reduce the dimensionality of the original data. Finally, the SSAA-LSTM model without principal component analysis (NPCA-LSTM) and the PCA-LSTM model are applied in wastewater quality prediction, and the results show that the PCA-LSTM model has the higher predictive ability.