# AgriMFLN: Mixing Features LSTM Networks for Sentiment Analysis of Agricultural Product Reviews
## 3 Materials and Methods
### Research Methods
#### 3.3.3 The Proposed Approach  
The structure diagram of the model proposed in this paper is shown in Figure 3.  
The flowchart of the model is described as follows:  
1. Data Acquisition and Preprocessing  
Data acquisition and preprocessing are crucial steps in building natural language processing models. In this process, the raw data needs to be cleaned by removing noise and invalid data, so that the processed data are cleaner and more reliable. Next, the lieba word segmentation tool for Chinese words is used to tokenize the text data into individual words, and then remove stop words and perform word frequency analysis to better understand the characteristics and structure of the text data. 2. Embedding Layer  
The embedding process is an important step in converting text data into vector representations. In this process, initial vectors are randomly generated and continuously updated during model training to effectively express the semantic information of the text. The embedding layer is used to convert the input discrete feature vectors into dense vector representations to facilitate the neural network's understanding of the input meaning. The main role of the embedding layer is to learn how to map input discrete features to continuous low-dimensional vector representations while maintaining the distance between similar features. In this experiment, the embedding process of words is included as part of the input vector for the LSTM layer, which maximally preserves the original structure of classical LSTM neural networks to handle text with long sequence features. After embedding and the process of back-propagation, each word is represented by an array of specific  
Figure 3: The Flowchart of AgriMFLN. dimensions, and the semantic relationship between words is also contained in the matrix generated by word embedding. Multi-Head Attention Layer  
Conducting the multi-head attention mechanism to extract semantic information from text aims to improve the performance of the model in processing sequential data. In the multi-head attention mechanism, the input vector is first split into multiple heads, and then each head undergoes independent linear transformation and attention calculation. Finally, the output vectors of each head are concatenated together and transformed linearly to obtain the final output vector. The benefit of this multi-head attention mechanism is that it allows the model to focus on different aspects of the input sequence simultaneously, thus better capturing the internal relationships within the text sequence. In this experiment, considering the multi-level information in agricultural product text, such as consumers' evaluation of their shopping experience from different aspects, may affect the overall sentiment of the sentence. Therefore, the design of the multi-head attention mechanism can assign different weights to information at different levels, allowing the model to simultaneously focus on different aspects of the sentence such as grammar and semantics, to better understand the meaning of the text and effectively express the semantic information of the sentence. As the multi-head attention mechanism can better focus on the important semantic information of text, this model proposes a feature fusion layer that combines the vectors generated from text embedding with those from multi-head attention and then inputs the fused vector to the LSTM layer for sentiment analysis of agricultural product reviews. Given the superior performance of LSTM neural networks in processing long sequences and extracting contextual features, and the fact that agricultural product reviews have varying lengths and rich contextual information, this experiment implements an LSTM layer for time-series text modeling of agricultural product reviews to learn long-term dependencies in the text. The advantage of an LSTM network is its ability to automatically learn long-term dependencies in the input sequence and control the flow of information more finely through gate mechanisms.