Spaces:
Running
Running
| from fastapi import FastAPI | |
| import src.paraphrase.Paraphrase as Paraphrase | |
| import src.translate.Translate as Translate | |
| import nltk | |
| nltk.download('punkt') | |
| app = FastAPI(docs_url="/") | |
| def index(): | |
| return {"output": "HELLO!!!"} | |
| def paraphrase(text: str): | |
| resultValue, exception = Paraphrase.paraphraseParaphraseMethod(text) | |
| return {"request": text, "result": resultValue, "exception": exception} | |
| def translate(text: str): | |
| resultValue, exception = Translate.paraphraseTranslateMethod(text) | |
| return {"request": text, "result": resultValue, "exception": exception} | |