mohammad0081 / IMDB_reviews_classifier

Sentiment Analysis on IMDB reviews dataset with multiple approaches

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IMDB-Reviews-Classifier

Overview: This code, developed by Mohammad Hassan Heydari, implements a classifier for IMDB movie reviews. It uses the Keras library and TensorFlow Datasets to train a model that can classify movie reviews as positive or negative.

Features:

  • Loads the IMDB reviews dataset from TensorFlow Datasets.
  • Preprocesses the data by tokenizing and padding the sequences.
  • Builds a sequential model using an embedding layer, followed by a flatten layer, and two dense layers.
  • Compiles the model with binary cross-entropy loss and the Adam optimizer.
  • Trains the model on the padded training data for 10 epochs, using the validation data for evaluation.

Usage:

  1. Install the required dependencies, including Keras, TensorFlow Datasets, and numpy.
  2. Load the IMDB reviews dataset using the tfds.load() function.
  3. Preprocess the data by converting it to sequences and padding them using the Tokenizer and pad_sequences functions.
  4. Build the sequential model with an embedding layer, flatten layer, and dense layers.
  5. Compile the model with binary cross-entropy loss and the Adam optimizer.
  6. Train the model using the fit() function, providing the padded training data and labels, as well as the validation data.

Contributions: Contributions to this project are welcome. If you would like to contribute, please follow the guidelines mentioned in the repository.

License: This code is released under an open-source license. Please refer to the license file in the repository for more information.

Contact: If you have any questions or feedback regarding this code, feel free to contact Mohammad Hassan Heydari at [heydari0081@gmail.com].

Please note that this is a general description, and you may need to customize it further based on your specific project details and preferences.

About

Sentiment Analysis on IMDB reviews dataset with multiple approaches


Languages

Language:Python 100.0%