Commit 9efacb80 authored by Ala Rouis's avatar Ala Rouis
Browse files

#55 fragemöglichkeit mit chatette generieren

parent e7cce475
......@@ -15,6 +15,9 @@ from app.utilities.models import nlp, bert_model, bert_tokenizer
from fastapi.exceptions import RequestValidationError
from fastapi.responses import JSONResponse
from fastapi.encoders import jsonable_encoder
from chatette.facade import Facade
import os
import json
class Item(BaseModel):
......@@ -23,6 +26,10 @@ class Item(BaseModel):
answer_style: str
class Item2(BaseModel):
input_path: str
app = FastAPI(
title="IntentFinder: NLP-API",
version="1.0",
......@@ -74,6 +81,21 @@ async def api_questionGenerator(item: Item):
)
@app.post("/chatette")
async def test(item2: Item2):
facade = Facade(
master_file_path=item2.input_path,
output_dir_path="./app/output",
force_overwriting=True
)
facade.run()
returnJson = open(os.path.join(
"./app/output/train/output.json"),
"r"
).read()
return json.loads(returnJson)
@app.get("/")
async def root():
return {"message": "nlp server is available"}
......
......@@ -77,4 +77,5 @@ scipy==1.6.2
protobuf==3.16.0
summarizer==0.0.7
bert-extractive-summarizer==0.7.1
sentencepiece==0.1.94
\ No newline at end of file
sentencepiece==0.1.94
chatette==1.6.3
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment