Natural Language Processing API based on Transformers models, FastAPI, SQLModel, PostgreSQL, Alembic & Docker
This project is a Rest API which uses XLM-roBERTa-base model for emotion analysis in texts and Zero-shot SELECTRA model for zero-shot classification, both for Spanish language.
This project is based on FastAPI for the server, Alembic for database table migration, PostgreSQL as database and async SQLModel as ORM.
Before running the project with Docker, it is required to create an .env file on root folder and copy the content from .env.example according to the application configuration.
$ docker-compose up --build
$ docker-compose exec nlp_fastapi_server alembic revision --autogenerate
$ docker-compose exec nlp_fastapi_server alembic upgrade head
This creates a sample user on databasse with username: [email protected] and pass: admin
docker-compose exec nlp_fastapi_server python app/initial_data.py
You can connect to Database using pgAdmin4 and use the credentials from .env file. Database port on local machine has been configured to 5454 on docker-compose.yml file
Documentation: http://localhost:8000/docs
- fastapi-alembic-sqlmodel-async
- full-stack-fastapi-postgresql.
- fastapi-sqlmodel-alembic.
- sqlmodel-tutorial.
- This project is licensed under the terms of the MIT license