Spaces:
Sleeping
Sleeping
A newer version of the Gradio SDK is available:
5.14.0
metadata
title: TherapyNote
app_file: app.py
sdk: gradio
sdk_version: 5.9.0
organization: pxpab
Therapy Session Analysis Pipeline
A Python project that downloads YouTube therapy session captions and extracts structured information using LLMs, LangChain, and LangGraph.
Features
- Downloads captions from YouTube therapy sessions
- Extracts structured information using LLMs and LangChain
- Supports multiple note formats (SOAP, DAP, BIRP, etc.)
- Uses LangGraph for data extraction workflows
- Manages prompts in a dedicated "langhub" directory
- Integrates with LangSmith for conversation and run logging
Prerequisites
- Python 3.9+
- uv package manager
- OpenAI API key
- LangChain API key (for logging)
Installation
- Clone the repository:
git clone https://github.com/yourusername/therapy-session-analysis.git
cd therapy-session-analysis
- Install dependencies using uv:
uv pip install -r requirements.txt
- Set up environment variables:
export OPENAI_API_KEY="your-openai-key"
export LANGCHAIN_API_KEY="your-langchain-key"
export LANGCHAIN_TRACING_V2="true"
Project Structure
project/
βββ config/
β βββ __init__.py
β βββ settings.py
βββ langhub/
β βββ __init__.py
β βββ prompts/
β βββ __init__.py
β βββ therapy_extraction_prompt.yaml
βββ forms/
β βββ __init__.py
β βββ schemas.py
βββ utils/
β βββ __init__.py
β βββ youtube.py
β βββ text_processing.py
βββ models/
β βββ __init__.py
β βββ llm_provider.py
βββ main.py
βββ requirements.txt
βββ README.md
Usage
Run the main script:
python main.py
Note Formats
The system supports multiple therapy note formats:
- SOAP (Subjective, Objective, Assessment, Plan)
- DAP (Data, Assessment, Plan)
- BIRP (Behavior, Intervention, Response, Plan)
- And more...
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.