Coder Social home page Coder Social logo

sentimentanalysiscomparison's Introduction

Sentiment Analysis Comparison

A comparison of different sentiment analysis models on a dataset of IMDB movie reviews.

Models

Transformers

LSTM

NLTK

Usage

Create a virtual environment and install the requirements.

python -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Run the script.

python main.py

Results

Model                                                                	Score       	Time        	Time per text	Params      
---------------------------------------------------------------------	------------	------------	------------	------------
JiaqiLee/imdb-finetuned-bert-base-uncased (109,483,778 params)       	0.9900      	23.38       	0.23        	   109483778
aychang/roberta-base-imdb (124,647,170 params)                       	0.9800      	25.72       	0.26        	   124647170
Flair (66,364,418 params)                                            	0.9200      	13.39       	0.13        	    66364418
distilbert-base-uncased-finetuned-sst-2-english (66,955,010 params)  	0.8900      	12.91       	0.13        	    66955010
cardiffnlp/twitter-roberta-base-sentiment-latest (124,647,939 params)	0.8500      	27.16       	0.27        	   124647939
Vader                                                                	0.6400      	0.40        	0.00        	           /
TextBlob                                                             	0.5900      	0.11        	0.00        	           /

On a GPU

Model                                                                	Time        	Time per text	Params      
---------------------------------------------------------------------	------------	------------	------------
JiaqiLee/imdb-finetuned-bert-base-uncased (109,483,778 params)       	1.74       	0.02        	   109483778
aychang/roberta-base-imdb (124,647,170 params)                       	1.77       	0.02        	   124647170
Flair (66,364,418 params)                                            	1.47       	0.01        	    66364418
distilbert-base-uncased-finetuned-sst-2-english (66,955,010 params)  	0.97       	0.01        	    66955010
cardiffnlp/twitter-roberta-base-sentiment-latest (124,647,939 params)	1.76       	0.02        	   124647939

(The first algorithm to run is always the slowest. For a fair comparison, experiment was run twice with different orders.)

Note

Torch needs to be installed with GPU support to enable faster execution. For more information, see here.

sentimentanalysiscomparison's People

Contributors

alexanderbelooussov avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.