Learning the operating method of NLP Natural language to deal with Film Review in Python
In this issue, the editor will bring you about the operation methods of learning NLP natural language processing film review in Python. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.
Overview
Starting today, we will start a journey of Natural language processing (NLP). Natural language processing enables processing, understanding, and use of human language to bridge the gap between machine language and human language.
RNN
RNN (Recurrent Neural Network), that is, cyclic neural network. Compared with CNN, RNN can help us better deal with sequence information and mine the relationship between before and after information. For tasks like NLP, there is a great correlation between the probabilities of the corpus before and after. For example: the probability of "it's a beautiful day tomorrow" > "tomorrow's weather basketball".
Weight sharing
Traditional neural network:
RNN:
The weight sharing of RNN is similar to that of CNN, sharing a weight at different times, which greatly reduces the number of parameters.
Calculation process
Calculation status (State)
Calculated output:
LSTM
LSTM (Long Short Term Memory), that is, long-term and short-term memory model. LSTM is a special RNN model, which solves the problem of gradient disappearance and gradient explosion in the process of long sequence training. Compared with ordinary RNN, LSTM can perform better in longer sequences. Compared to RNN with only one transitive state ht, LSTM has two transitive states: ct (cell state) and ht (hidden state).