Views
No views yet
1# Load the model and perform inference
2import tensorflow as tf
3model = tf.keras.models.load_model('imdb_lstm_model.h5')
4
5
6# Perform inference
7prediction = model.predict([text])
8
9# Get the predicted sentiment (e.g., 'Positive' or 'Negative')
10predicted_sentiment = "Positive" if prediction > 0.5 else "Negative"