Skip to content

Repository files navigation

MI Browse (Cornerstone)

A minimal FastAPI + Jinja application for exploring the Modality Cornerstone pilot dataset. The app loads Cornerstone session data from local JSON files and provides a small UI for browsing, filtering, and inspecting conversations and MI findings.

Quickstart

  1. Create and activate a virtual environment:
    python -m venv .venv
    source .venv/bin/activate
  2. Install dependencies:
    pip install -r requirements.txt
  3. (Optional) Configure environment overrides:
    cp .env.example .env
  4. Ensure Cornerstone data is available:
    • data/cornerstone_data/conversation_*.json
  5. Start the development server:
    uvicorn app.main:app --reload

The app will be available at http://127.0.0.1:8000/. Navigate to /datasets/cornerstone to browse sessions.

Key Features

  • Session view that groups turns into a readable transcript
  • Findings integration for MI skills evaluations (when present)
  • User-level views for reviewing MI skills across sessions

Cornerstone Data Layout

The app expects the following files under data/cornerstone_data/:

  • conversation_*.json - Raw conversation files used for browsing, findings, and progress reports

MI Skills Evaluation (Optional)

You can generate MI findings for Cornerstone conversations using the OpenAI API.

export OPENAI_API_KEY=your_key_here
python scripts/evaluate_mi_skills.py "data/cornerstone_data/conversation_*.json"

To inspect prompts and schemas without calling the API:

./scripts/test_prompts.sh

Progress Reports (Profiles)

After MI findings are generated, you can build per-user progress reports.

# List available users (from evaluated conversations)
python scripts/generate_progress_reports.py --list-users

# Generate a markdown-only report for a specific user
python scripts/generate_progress_reports.py --user "Full Name" --markdown-only

# Generate AI-assisted progress analysis for a specific user
python scripts/generate_progress_reports.py --user "Full Name"

# Generate AI-assisted reports for all users
python scripts/generate_progress_reports.py --all

Project Layout

app/                FastAPI application, templates, static assets
data/cornerstone_data/   Cornerstone JSON files
scripts/            Cornerstone data and evaluation helpers
tests/              Smoke tests for routes

Run the automated checks with:

PYTHONPATH=. pytest

PYTHONPATH is required so the test runner can import the local app package.

Known Limitations

  • Cornerstone data is unlabeled; MI findings are model-generated.
  • Findings availability depends on which conversations have been evaluated.

About

temporary clone of https://github.com/findmodality/modality_analysis

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages