Pankaj001's picture
adding documentation
1bc2fda verified
metadata
license: apache-2.0
datasets:
  - imdb
metrics:
  - accuracy
pipeline_tag: text-classification

LSTM Text Classification Model for Sentiment Analysis

This repository contains a Long Short-Term Memory (LSTM) text classification model trained on the IMDB dataset for sentiment analysis. The model has achieved an accuracy of 96% on the test dataset and is available for use as a TensorFlow model.

Model Details

  • Architecture: Long Short-Term Memory (LSTM) Neural Network
  • Dataset: IMDB Movie Reviews (Sentiment Classification)
  • Accuracy: 96%

Usage

You can use this model for sentiment analysis tasks. Below are some code snippets to help you get started:

# Load the model and perform inference
import tensorflow as tf
model = tf.keras.models.load_model('imdb_lstm_model.h5')


# Perform inference
prediction = model.predict([text])

# Get the predicted sentiment (e.g., 'Positive' or 'Negative')
predicted_sentiment = "Positive" if prediction > 0.5 else "Negative"