Skip to content

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

Notifications You must be signed in to change notification settings

BeiCunNan/Sentiment_Analysis_Imdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages