Spaces:
Sleeping
Sleeping
| import pickle | |
| import pandas as pd | |
| class SentimentModel: | |
| def __init__(self, model_path='artifacts/model.pkl'): | |
| with open(model_path, 'rb') as f: | |
| self.model = pickle.load(f) | |
| def predict(self, text: str): | |
| pred = self.model.predict([text])[0] | |
| return "Positive" if pred == 1 else "Negative" |