feat[bert]: FastAPI interface
Browse files- ml-service/app.py +1 -2
- ml-service/nlp.py +1 -5
ml-service/app.py
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
# app.py
|
2 |
-
from fastapi import FastAPI
|
3 |
-
import uvicorn
|
4 |
from classifier import Classifier
|
5 |
import nlp
|
6 |
import logging
|
|
|
1 |
# app.py
|
2 |
+
from fastapi import FastAPI
|
|
|
3 |
from classifier import Classifier
|
4 |
import nlp
|
5 |
import logging
|
ml-service/nlp.py
CHANGED
@@ -1,8 +1,4 @@
|
|
1 |
# nlp.py
|
2 |
-
|
3 |
-
|
4 |
-
classifier = Classifier()
|
5 |
-
|
6 |
-
def sentiment_analysis(self, text:str, classifier):
|
7 |
sentiment = classifier.get_sentiment_label_and_score(text)
|
8 |
return sentiment
|
|
|
1 |
# nlp.py
|
2 |
+
def sentiment_analysis(classifier, text):
|
|
|
|
|
|
|
|
|
3 |
sentiment = classifier.get_sentiment_label_and_score(text)
|
4 |
return sentiment
|