Coder Social home page Coder Social logo

movie-review-sentiment-classifier's Introduction

title emoji colorFrom colorTo sdk sdk_version app_file pinned license
Movie Review Sentiment Classifier
🌖
pink
indigo
gradio
3.35.2
app.py
false
mit

Movie Review Sentiment Classifier

This project is a movie review sentiment classifier app that predicts the sentiment (positive or negative) of a given movie review. It utilizes a deep learning model with a 1D convolutional neural network architecture.

Demo

The deployed version of this project can be accessed at Hugging Face Spaces.

Installing Locally

To run this project locally, please follow these steps:

  1. Clone the repository:

    git clone https://github.com/soumya-prabha-maiti/movie-review-sentiment-classifier.git
    
  2. Navigate to the project folder:

    cd movie-review-sentiment-classifier
    
  3. Install the required libraries:

    pip install -r requirements.txt
    
  4. Run the application:

    python app.py
    
  5. Access the application in your web browser at the specified port.

Dataset

The Large Movie Review Dataset is used for training and testing the sentiment classifier. It contains movie reviews labeled with their corresponding sentiment (positive or negative). Please refer to the dataset's documentation for more information on its structure and usage.

Direct download link : https://ai.stanford.edu/~amaas/data/sentiment/aclImdb_v1.tar.gz

Model Architecture

The sentiment classifier model has the following architecture:

Model: "model_1"
_________________________________________________________________
Layer (type)                Output Shape              Param #
=================================================================
input_2 (InputLayer)        [(None, 1)]               0
text_vectorization (TextVec  (None, 500)              0
torization)
model (Functional)          (None, 1)                 2806273
|¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|
| input_1 (InputLayer)      [(None, None)]            0         |
|                                                               |
| embedding (Embedding)     (None, None, 128)         2560000   |
|                                                               |
| dropout (Dropout)         (None, None, 128)         0         |
|                                                               |
| conv1d (Conv1D)           (None, None, 128)         114816    |
|                                                               |
| conv1d_1 (Conv1D)         (None, None, 128)         114816    |
|                                                               |
| global_max_pooling1d (Globa  (None, 128)            0         |
| lMaxPooling1D)                                                |
|                                                               |
| dense (Dense)             (None, 128)               16512     |
|                                                               |
| dropout_1 (Dropout)       (None, 128)               0         |
|                                                               |
| predictions (Dense)       (None, 1)                 129       |
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
=================================================================
Total params: 2,806,273
Trainable params: 2,806,273
Non-trainable params: 0

The model architecture consists of a text vectorization layer, followed by an embedding layer, two 1D convolutional layers, and a global max-pooling layer. These layers are then connected to a dense layer and a final prediction layer.

Libraries Used

The following libraries were used in this project:

  • TensorFlow: To build sentiment classifier model.
  • Gradio: To create the user interface for the sentiment classifier.

License

This project is licensed under the MIT License.

movie-review-sentiment-classifier's People

Contributors

soumya-prabha-maiti 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.