Coder Social home page Coder Social logo

hmohebbi / sentimentanalysis Goto Github PK

View Code? Open in Web Editor NEW
65.0 2.0 15.0 1.1 MB

(BOW, TF-IDF, Word2Vec, BERT) Word Embeddings + (SVM, Naive Bayes, Decision Tree, Random Forest) Base Classifiers + Pre-trained BERT on Tensorflow Hub + 1-D CNN and Bi-Directional LSTM on IMDB Movie Reviews Dataset

Jupyter Notebook 100.00%
bert sentimentanalysis embeddings svm cnn word2vec bow tf-idf random-forest lstm decision-tree tensorflow-hub

sentimentanalysis's Introduction

SentimentAnalysis

(BOW, TF-IDF, Word2Vec, BERT) Word Embeddings + (SVM, Naive Bayes, Decision Tree, Random Forest) Base Classifiers + Pre-trained BERT on Tensorflow Hub + 1-D CNN and Bi-Directional LSTM on IMDB Movie Reviews Dataset

Results for Base Classifiers

Rank Word Embedding Classifier Accuracy F1-Score
1 BERT Sentence Version (Mean Bert Features per Review) SVM 90.35 0.90
2 BERT Sentence Version (Mean Bert Features per Review) MLP 90.32 0.90
3 TFIDF with Stop Words SVM 89.59 0.90

Results for Deep Neural Networks

Rank Word Embedding Model Accuracy
1 BERT TensorFlow-HUB Bi-Directional LSTM 91.34
2 BERT Sentence Version (Mean Bert Features per Review) 1-D CNN 85.46

sentimentanalysis's People

Contributors

hmohebbi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sentimentanalysis's Issues

Raising error

Hi @hmohebbi thanks for sharing your code. I have a questionI appreciate if you can help me with that. I can run the coder for BOW and TFIDF however for word2vec and Bert keeps raising this error:

    530                 else:
--> 531                     array = np.asarray(array, order=order, dtype=dtype)
    532             except ComplexWarning:
    533                 raise ValueError("Complex data not supported\n"

ValueError: setting an array element with a sequence.```

Do you have any idea of what could be the reason?
I searched the net and they mentioning that this error will arise whenever the list has not been prepared correctly for example [2, [2,3]].
But I could not check where could be wrong.

BadZipFile File is not a zip file

ctx = mx.gpu(0)
bert = BertEmbedding(ctx=ctx)

This code is giving bad zip file error each time it is run I also tried doing it with glunlp. The error is as follows

BadZipFile Traceback (most recent call last)
in
1 ctx = mx.gpu(0)
----> 2 bert = BertEmbedding(ctx=ctx)

~\anaconda3\envs\gpu3\lib\zipfile.py in _RealGetContents(self)
1196 raise BadZipFile("File is not a zip file")
1197 if not endrec:
-> 1198 raise BadZipFile("File is not a zip file")
1199 if self.debug > 1:
1200 print(endrec)

BadZipFile: File is not a zip file

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.