Skip to content

About

API for ranking text embeddings

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

39 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Decision support api

Description

The Decision Support API module is designed for a startup acceleration platform, assisting in ranking help measures for the current project using sBERT embeddings and cosine distance.

Main features:

  • Asynchronous API with swagger documentation
  • Caching with Redis
  • Interaction with the database using SQLalchemy and async driver aiomysql
  • Migrations using Alembic
  • Module for converting data from a database into text with ORM
  • Module for text preprocessing
  • Module for text ranking using sBERT embedding and cosine distance
  • Autotests for API and database with pytest (with full database creation)
  • Logging with Python JSON logger
  • Sentry integration
  • Monitoring with Grafana
  • Linters with GitHub CI
  • Fully containerized application

Preparing environment and docker

  • Change .env data to your development database configuration

  • Change .env.prod data to your production database configuration

  • Replace docker-compose db service with a real database

Running server

Using Docker compose

  • Run services

    docker-compose up
  • Bring services down

    docker-compose down

go to the local host address: http://127.0.0.1:8000/

Using python virtual machine

  1. Create a Python virtual environment and activate it.

  2. Go to the folder with main.py

    cd backend
  3. Install requirements:

    python3 -m pip install --user -r requirements.txt
  4. Run pytest

    pytest
  5. Run server using gunicorn:

    uvicorn main:app --reload

go to the local host address: http://127.0.0.1:8000/

About

API for ranking text embeddings

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages