I use the bert、roberta totally 2 different pre-trained models and using the gru、lstm、bilstm、textcnn、rnn、fnn totally 6 network to run. on the imdb datasets. Whitch is so useful for the fresh man.
The dataset.csv file is the imdb dataset, which has already been processed. The detailed processing can be found in the following article : DataPreProcessing
In addition to that, I've also covered the process of experimentation in detail on my blog, which you can take a look at if you're interested Experimenttation process CSDN_IMDB_Sentiment_Analysis
The network structure is as follows
Since IMDB data volume is very large, we use 10% of the data volume for training. The results are as follows
- Python = 3.9
- torch = 1.11.0
- numpy = 1.22.3
- transformers=4.19.2
git clone https://github.com/BeiCunNan/sentiment_analysis_Imdb.git
conda create -n sai python=3.9
conda activate sai
pip install -r requirements.txt
python main.py --method sai