sentimentdl_glove_imdb_en
In this introductory sample, we'll try to predict a sentiment (positive or negative) for customer reviews. In the world of machine learning, this type of prediction is known as binary classification.
Sentiment Classification - of IMDb User Reviews - using LSTM
An end-to-end toolkit on building a movie review sentiment classification LSTM model in Keras Deep Learning with model h5 file. Model is trained on IMDb Movie reviews source.
As part of model training, we have trained LSTM nodels, with reasoning as to why LSTMs are well suited to handle (sequential) text data.
Features List
- Modular project structure
- Python package setup configured, package available on pypi
- Connecting to MS SQL Databse by pyodbc, you can install latest MS SQL driver for python from here
- Logging and Exception handling to MS SQL by Calling Stored Procedures
MS SQL
You can find create table and stored Procedure scripts under "references" folder
Download Datasets
You can download required datasets from here and keep it in "data/raw" folder
Plan of Action
- Load IMDb Movie Reviews dataset (50,000 reviews)
- Pre-process dataset by removing special characters, numbers, etc. from user reviews + convert sentiment labels positive & negative to numbers 1 & 0, respectively
- Import GloVe Word Embedding to build Embedding Dictionary + Use this to build Embedding Matrix for our Corpus
- Model Training using Deep Learning in Keras for: LSTM Models and analyse model performance and results
- Last, perform predictions on real IMDb movie reviews
Steps to run on Windows
-
Prerequisites: Python 3.9 (ensure Python is added to PATH) + Git Client
-
Open GIT CMD >> navigate to working directory >> Clone this Github Repo (or download project files from GitHub directly)
git clone https://github.com/MusaddiqueHussainLabs/sentimentdl_glove_imdb_en.git -
Open Windows Powershell >> navigate to new working directory (cloned repo folder)
-
Run Project
-
Using Conda Environment:
conda env create -f conda_env_win.yml # create conda environment called 'app_env' conda env list # check if app_env is created conda activate app_env # activate app_env python main.py # run the project conda deactivate # close conda environment once done -
Using PIP + Virtualenv:
pip install virtualenv # install virtual environment virtualenv ENV # create virtual environment by the name ENV .\ENV\Scripts\activate # activate ENV pip install -r .\pip_requirements.txt # install project dependencies python main.py # run the project deactivate # close virtual environment once done
-
Bug / Feature Request
If you find a bug (the website couldn't handle the query and / or gave undesired results), kindly open an issue here by including your search query and the expected result.
References / Thanks
Big thanks to below authors:
Release files for mhlabs-sentiment 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mhlabs_sentiment-0.0.1.tar.gz | 53.6 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mhlabs_sentiment-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 107.3 MB
Release files / mhlabs_sentiment-0.0.1.tar.gz
| Download URL | mhlabs_sentiment-0.0.1.tar.gz |
|---|---|
| Size | 53.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5e998d988ab7036f2eee2d6e1c4a4e1f9fc12f9fb375b3250f124b5debdf3a75
|
|
BLAKE2b-256 checksum How to use checksums |
a98a4dc9f8f8968ffe9e482ae3d0f0300eab8bef78913ce27b82a72a4c3260e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.10
|
Release files / mhlabs_sentiment-0.0.1-py3-none-any.whl
| Download URL | mhlabs_sentiment-0.0.1-py3-none-any.whl |
|---|---|
| Size | 53.7 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b644e9431e7cf0e4375d29980ec3359d960fd76cc37225f5104e45c756baa4d6
|
|
BLAKE2b-256 checksum How to use checksums |
7ac2f1acae651e80acca1ed13e97428f4f51acec64f1d1c896268b1c8dd7639e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.10
|