| from transformers import pipeline | |
| # Load the model once on import | |
| sentiment_pipeline = pipeline("sentiment-analysis") | |
| def get_sentiment(text): | |
| result = sentiment_pipeline(text) | |
| return result[0] | |
| from transformers import pipeline | |
| # Load the model once on import | |
| sentiment_pipeline = pipeline("sentiment-analysis") | |
| def get_sentiment(text): | |
| result = sentiment_pipeline(text) | |
| return result[0] | |