/Sentiment_Analysis_Imdb

Using Bert/Roberta + LSTM/GRU/BiLSTM/TextCNN to do the sentiment analysis on the imdb datasets.

Primary LanguagePython

Sentiment_Analysis_Imdb

Introduction

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.

Dataset

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

Network

The network structure is as follows

Github版 IMDB

Result

Since IMDB data volume is very large, we use 10% of the data volume for training. The results are as follows

Snipaste_2022-11-21_16-04-03

Requirement

  • Python = 3.9
  • torch = 1.11.0
  • numpy = 1.22.3
  • transformers=4.19.2

Preparation

Clone

git clone https://github.com/BeiCunNan/sentiment_analysis_Imdb.git

Create an anaconda environment

conda create -n sai python=3.9
conda activate sai
pip install -r requirements.txt

Usage

python main.py --method sai