Spaces:
Sleeping
Sleeping
File size: 512 Bytes
e1379c5 7106645 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("./feel-it-italian-sentiment")
tokenizer = AutoTokenizer.from_pretrained("./feel-it-italian-sentiment")
self.pipe = pipeline("text-classification", model=model, tokenizer=tokenizer)
self.result = self.pipe(line)
|