jflo commited on
Commit
7a1bfc8
·
1 Parent(s): e9cc7c5

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastapi import FastAPI
2
+ import pandas as pd
3
+ from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
4
+
5
+ app = FastAPI()
6
+
7
+ def classify_string(message):
8
+ analyzer = SentimentIntensityAnalyzer()
9
+ return analyzer.polarity_scores(message)
10
+
11
+ @app.get("/")
12
+ def greet_json():
13
+ return {"Hello": "World!"}
14
+
15
+ @app.get("/sentiment")
16
+ def sentiment_analysis(message: str):
17
+ analyzer = SentimentIntensityAnalyzer()
18
+ return analyzer.polarity_scores(message)