jflo's picture
Update app.py
ec02dbd
raw
history blame
355 Bytes
from fastapi import FastAPI
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
app = FastAPI()
@app.get("/")
def greet_json():
return {"Hello": "World!"}
@app.post("/sentiment")
def sentiment_analysis(message: str):
analyzer = SentimentIntensityAnalyzer()
return analyzer.polarity_scores("This is a positive message")