text-classification / model /sentiment.py
manue
Remove unused environment variable and improve error handling in analysis endpoint
7e8513d
raw
history blame
313 Bytes
from transformers import pipeline
from typing import Any
class Sentiment:
def __init__(self, line: str) -> (list | list[Any] | Any | None):
# self = this in C#
self.pipe = pipeline("text-classification", model="MilaNLProc/feel-it-italian-sentiment")
self.result = self.pipe(line)