stanfordnlp/imdb
Viewer • Updated • 100k • 178k • 370
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.
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"