How to build a model annotation tool with FastAPI, Quarto & Shiny for Python

Gordon Shotwell, Senior Software Engineer at Posit walks through an end-to-end machine learning workflow with Posit Team. This demo will give you a robust pattern for hosting and sharing models on Connect before you deploy them to a customer-facing system.

This will include:

  • How and why to use an API layer to serve and authenticate internal models
  • Why you should wrap your APIs in Python packages
  • Using Shiny for Python to build a data annotation app
  • Using Quarto to retrain models on a schedule

 

Timestamps:

1:27 – Quick overview of text classification model used in this example

2:15 – Overview of the people that will need to use the model (modellers, leadership, data team, annotators, other systems)

4:11 – Why APIs before UIs is a good rule

5:57 – What about Python packages?

8:23 – Advantages to using an API here

9:18 – Big picture overview of the workflow

11:17 – FastAPI on Posit Connect (Swagger interface)

15:55 – The way this model will be used (authorization by validating user)

19:00 – Building a delightful user experience by wrapping API in a package

25:07 – Quarto report for leadership team showing model statistics & deploying to Connect

26:34 – Retraining the model by scheduling Quarto doc on Connect

28:37 – Shiny for Python app for Annotators (people checking if model is producing correct results & helping improve the model)

35:28 – Overview / summary of this machine learning workflow

Subscribe to more inspiring open-source data science content.

We love to celebrate and help people do great data science. By subscribing, you'll get alerted whenever we publish something new.