An open API service indexing awesome lists of open source software.

https://github.com/shamil-t/sentiment-analysis-using-python-imdb-

Sentiment Analysis is to find the perspective ,view ,attitude or feeling of a speaker on a particular topic, event or interactionBasicaly its the analysis of an emotionally cahrged text. Here we try to analyzethe reviewsposted by people at Imdb. Further the reviews are processed analyzed using machine learning procedures, algorithms and other related aspets.
https://github.com/shamil-t/sentiment-analysis-using-python-imdb-

ai bagging imdb-dataset machine-learning naive-bayes-classifier python random-forest sentiment-analysis support-vector-machines

Last synced: 8 months ago
JSON representation

Sentiment Analysis is to find the perspective ,view ,attitude or feeling of a speaker on a particular topic, event or interactionBasicaly its the analysis of an emotionally cahrged text. Here we try to analyzethe reviewsposted by people at Imdb. Further the reviews are processed analyzed using machine learning procedures, algorithms and other related aspets.

Awesome Lists containing this project

README

          

# πŸ†‚πŸ…΄πŸ…½πŸ†ƒπŸ…ΈπŸ…ΌπŸ…΄πŸ…½πŸ†ƒ-πŸ…°πŸ…½πŸ…°πŸ…»πŸ†ˆπŸ†‚πŸ…ΈπŸ†‚-πŸ†„πŸ†‚πŸ…ΈπŸ…½πŸ…Ά-πŸ…ΏπŸ†ˆπŸ†ƒπŸ…·πŸ…ΎπŸ…½

The principal task of Sentiment Analysis is to find the perspective ,view ,attitude or feeling of a speaker on a particular topic, event or interactionBasicaly its the analysis of an emotionally cahrged text.
Here we try to analyzethe reviewsposted by people at Imdb. Further the reviews are processed
analyzed using machine learning procedures, algorithms and other related aspets.

### Algorithms Used

* Support Vector Machine Classifier - `linearSvc`
* Random Forest Classifer
* AdaBoost Classfier
* Naive Bayes Classifier - `MultinomialNB`
* Bagging Classifier

### Steps in Sentiment Analysis

1.Formation of Dataset
2.Processing of Data
3.Creation of Feature Vector
4.Classification

## πŸ…ΏπŸ†πŸ…΄ πŸ†πŸ…΄πŸ†€πŸ†„πŸ…΄πŸ†‚πŸ†ƒπŸ…ΈπŸ…΄πŸ†‚

### Environment Setup

-:> python 2.8 or above 3.x recommended

### Dataset

[Download DataSet from here](http://ai.stanford.edu/~amaas/data/sentiment/aclImdb_v1.tar.gz)
then put `aclImdb` folder to parent directory
#### File structure
![File structure](https://github.com/shamil-t/sentiment-analysis-using-python-IMDB-/blob/master/images/Files.png?raw=true)

### install modules

1.sklearn
```bash
pip install sklearn
```
2.pickle
```bash
pip install pickle-mixin
```
3.nltk
```bash
pip install nltk
```
in Python IDLE

``` bash
import nltk
nltk.download("stopwords")
```

4.numpy

```bash
pip install numpy
```

## πŸ…·πŸ…ΎπŸ††πŸ†† πŸ†ƒπŸ…Ύ πŸ†πŸ†„πŸ…½

`imdbReviews.py` generates `*.pkl` files which are the training and testing datasets.
First, set the dataset directory in the `imdbReviews.py`, then run the code.
```
python imdbReviews.py
```
now you will get two new .pkl files such as `test.pkl` & `train.pkl`
which are needed for `naive.py`, `svm.py`,`rfc.py`,`bagging.py`,`adaboost.py`.

#### To do prediction, run the following command.

```bash
python filname.py
```

`eg:-`

```bash
python naive.py
```

## ScreenShots

#### Ada Boost Classifier
![Ada Boost Classifier](https://github.com/shamil-t/sentiment-analysis-using-python-IMDB-/blob/master/images/adaboost.png?raw=true)

#### Bagging Classifier
![Bagging Classifier](https://github.com/shamil-t/sentiment-analysis-using-python-IMDB-/blob/master/images/bagging.png?raw=true)

#### Naive Bayes - MultinomialNB()
![Bagging Classifier](https://github.com/shamil-t/sentiment-analysis-using-python-IMDB-/blob/master/images/naive.png?raw=true)

#### Random Forest Classifier
![Random Forest Classifier](https://github.com/shamil-t/sentiment-analysis-using-python-IMDB-/blob/master/images/randomforest.png?raw=true)

#### Support Vector Machine - LinearSVC()
![Support Vector Machine](https://github.com/shamil-t/sentiment-analysis-using-python-IMDB-/blob/master/images/svm.png?raw=true)