Spaces:
Sleeping
Sleeping
File size: 568 Bytes
e1379c5 7106645 d4b1c2b e1379c5 7106645 |
1 2 3 4 5 6 7 8 9 10 11 |
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)
|