Spaces:
Sleeping
Sleeping
from transformers import pipeline, AutoModelForSequenceClassification, AutoTokenizer | |
from typing import Any | |
class Sentiment: | |
def __init__(self, line: str) -> (list | list[Any] | Any | None): | |
model = AutoModelForSequenceClassification.from_pretrained("models/feel-it-italian-sentiment", local_files_only=True) | |
tokenizer = AutoTokenizer.from_pretrained("models/feel-it-italian-sentiment", local_files_only=True) | |
self.pipe = pipeline("text-classification", model=model, tokenizer=tokenizer) | |
self.result = self.pipe(line) | |