Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,12 +1,7 @@
|
|
| 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():
|
|
@@ -15,4 +10,4 @@ def greet_json():
|
|
| 15 |
@app.post("/sentiment")
|
| 16 |
def sentiment_analysis(message: str):
|
| 17 |
analyzer = SentimentIntensityAnalyzer()
|
| 18 |
-
return analyzer.polarity_scores(message)
|
|
|
|
| 1 |
from fastapi import FastAPI
|
|
|
|
| 2 |
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
|
| 3 |
|
| 4 |
app = FastAPI()
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
@app.get("/")
|
| 7 |
def greet_json():
|
|
|
|
| 10 |
@app.post("/sentiment")
|
| 11 |
def sentiment_analysis(message: str):
|
| 12 |
analyzer = SentimentIntensityAnalyzer()
|
| 13 |
+
return analyzer.polarity_scores("This is a positive message")
|