feat[bert]: FastAPI interface
Browse files- ml-service/app.py +2 -2
ml-service/app.py
CHANGED
@@ -11,8 +11,8 @@ logging.basicConfig(level = logging.INFO)
|
|
11 |
app = FastAPI()
|
12 |
classifier = Classifier()
|
13 |
|
14 |
-
@app.post("/
|
15 |
-
|
16 |
try:
|
17 |
input_text = data["text"]
|
18 |
res = nlp.sentiment_analysis(classifier, input_text)
|
|
|
11 |
app = FastAPI()
|
12 |
classifier = Classifier()
|
13 |
|
14 |
+
@app.post("/predict")
|
15 |
+
def predict(data: dict):
|
16 |
try:
|
17 |
input_text = data["text"]
|
18 |
res = nlp.sentiment_analysis(classifier, input_text)
|