Views
No views yet
predict_sentiment(review_text) function in the provided inference.py script.1from transformers import pipeline
2
3# Load the sentiment-analysis pipeline
4model_name = "your-username/imdb-lstm-sentiment-model" # Replace with your model's name
5sentiment_analyzer = pipeline("text-classification", model=model_name)
6
7# Test the model with a review
8review = "This movie was fantastic!"
9result = sentiment_analyzer(review)
10print(result)
11'''