Annotate Text

Text Annotation Web App

This project is a web-based tool for annotating LLM-generated text, built using FastHTML, HTMX, and Tailwind CSS, originally built by Alex Volkov in the fasthtml-examples repo

Key Technologies and Techniques

  1. FastHTML: A Python-based framework for building web applications with a focus on web fundamentals.
  2. HTMX: Used to create dynamic server-side content updates that allow interaction with the app without page reloads.
  3. Tailwind CSS: Tailwind classes are used throughout the HTML to style the app, providing a clean and responsive design.
  4. DaisyUI: A Tailwind CSS component library used for additional styling.

How It Works

Server-Side Logic

The app uses FastHTML to define routes and handle annotation logic on the server. Key routes include:

State Management

The app state is managed server-side using a SQLite database:

Dynamic Content

HTMX is used extensively to create a dynamic user interface:

Key Components

  1. Arrow Navigation: Allows users to move between annotation items.
  2. Annotation Buttons: Provides options to mark text as correct or incorrect.
  3. Notes Field: Allows users to add additional notes to each annotation.
  4. Text Display: Shows the LLM-generated text to be annotated.
  5. SQLite database integration

This app demonstrates the power of combining FastHTML, HTMX, and Tailwind CSS to create a responsive and efficient web application for text annotation tasks.