text-classification / model /sentiment.py
manue
Add initial project files including Dockerfile, app, sentiment model, requirements, and .gitignore
7106645
raw
history blame
285 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="MilaNLProc/feel-it-italian-sentiment")
self.result = self.pipe(line)