mathtext-fastapi / modules /sentiment.py
cetinca's picture
Initial commit
46f5320 verified
raw
history blame
228 Bytes
from transformers import pipeline
sentiment_obj = pipeline(task="sentiment-analysis", model="distilbert-base-uncased-finetuned-sst-2-english")
def sentiment(text):
# Returns sentiment value
return sentiment_obj(text)