Commit
·
34a52a1
1
Parent(s):
1885be8
Add parameters
Browse files
app.py
CHANGED
|
@@ -31,12 +31,18 @@ from sinatools.morphology.morph_analyzer import analyze
|
|
| 31 |
|
| 32 |
class ALMARequest(BaseModel):
|
| 33 |
text: str
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
@app.post("/predict")
|
| 36 |
def predict(request: ALMARequest):
|
| 37 |
text = request.text
|
| 38 |
-
|
| 39 |
-
|
|
|
|
|
|
|
|
|
|
| 40 |
content = {
|
| 41 |
"resp": alma_output,
|
| 42 |
"statusText": "OK",
|
|
|
|
| 31 |
|
| 32 |
class ALMARequest(BaseModel):
|
| 33 |
text: str
|
| 34 |
+
language: str
|
| 35 |
+
task: str
|
| 36 |
+
flag: str
|
| 37 |
|
| 38 |
@app.post("/predict")
|
| 39 |
def predict(request: ALMARequest):
|
| 40 |
text = request.text
|
| 41 |
+
language = request.language
|
| 42 |
+
task = request.task
|
| 43 |
+
flag = request.flag
|
| 44 |
+
|
| 45 |
+
alma_output = analyze(text, language, task, str(flag))
|
| 46 |
content = {
|
| 47 |
"resp": alma_output,
|
| 48 |
"statusText": "OK",
|