from model.model import Model class SentimentAnalysis(Model): def __init__(self) -> None: self.model_name = None self.tasks = "sentiment" self.load_model(model_name="crypter70/IndoBERT-Sentiment-Analysis" , tasks=self.tasks) def predict(self, sentences): outputs = super().predict(sentences, self.tasks) return { "result": outputs["label"], "score": outputs["score"] } sentiment = SentimentAnalysis()