Skip to content

Natural Language Processing API based on Transformers models, FastAPI, SQLModel, PostgreSQL, Alembic & Docker

License

Notifications You must be signed in to change notification settings

NathaliaBarreiros/nlp_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Set environment variables

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.

Run project using Docker compose

$ docker-compose up --build

Run Alembic migrations

$ docker-compose exec nlp_fastapi_server alembic revision --autogenerate
$ docker-compose exec nlp_fastapi_server alembic upgrade head

Setup database with initial data

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

ERD Database model

Documentation: http://localhost:8000/docs

Preview

Tables preview on pgAdmin4

Inspiration and References

License

License

  • This project is licensed under the terms of the MIT license

About

Natural Language Processing API based on Transformers models, FastAPI, SQLModel, PostgreSQL, Alembic & Docker

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published