text-classification / model /sentiment.py
manue
Refactor sentiment model initialization to simplify pipeline setup
1dc8930
raw
history blame
277 Bytes
from transformers import pipeline
from typing import Any
class Sentiment:
def __init__(self, line: str) -> (list | list[Any] | Any | None):
self.pipe = pipeline("text-classification", model='../feel-it-italian-sentiment')
self.result = self.pipe(line)