metadata
title: KARTE - 音声カルテ分析
emoji: 🎯
colorFrom: red
colorTo: pink
sdk: docker
app_port: 7860
pinned: false
KARTE - Audio Analysis for Medical Records
KARTE is a powerful application that generates medical records and customer service analysis from audio data. It combines advanced speech recognition with natural language processing to provide comprehensive insights.
Features
- 🎤 Audio Transcription: Converts audio files to text using OpenAI's Whisper model
- 📊 Style Analysis: Evaluates customer service style and communication quality
- 🔄 Flow Analysis: Analyzes conversation flow and structure
- 📝 Medical Record Generation: Creates structured medical records from conversations
- 🔒 Secure Authentication: Basic auth protection for sensitive data
- 📥 Export Functionality: Download analysis reports in JSON format
Technology Stack
- Streamlit: Web application framework
- OpenAI Whisper: Speech-to-text transcription
- Groq: Large language model for analysis
- Python: Core programming language
- Docker: Containerization
Environment Variables
Required environment variables:
BASIC_AUTH_USERNAME: Username for basic authenticationBASIC_AUTH_PASSWORD: Password for basic authenticationOPENAI_API_KEY: OpenAI API key for transcriptionGROQ_API_KEY: Groq API key for analysis
Usage
- Access the application through Hugging Face Spaces
- Log in using the provided credentials
- Upload an audio file (supported formats: MP3, WAV, M4A)
- Wait for transcription and analysis
- Review the generated insights and medical record
- Download the complete analysis report
Deploying to Hugging Face Spaces
Option 1: Using Streamlit SDK (Recommended)
Make sure your README.md has the correct metadata at the top: ```
title: KARTE - 音声カルテ分析 emoji: 🎯 colorFrom: red colorTo: pink sdk: streamlit sdk_version: 1.32.2 app_file: main.py pinned: false
Set up your environment variables in Hugging Face Spaces:
- Go to your Space settings
- Add the following secrets:
OPENAI_API_KEYGROQ_API_KEYBASIC_AUTH_USERNAMEBASIC_AUTH_PASSWORD
Push your code to the Hugging Face repository:
git add . git commit -m "Deploy Streamlit app" git push
Option 2: Using Docker (Advanced)
Update your README.md metadata to use Docker: ```
title: KARTE - 音声カルテ分析 emoji: 🎯 colorFrom: red colorTo: pink sdk: docker pinned: false
Make sure your Dockerfile is properly configured:
- Uses port 7860
- Sets up a non-root user
- Installs all dependencies including ffmpeg
- Properly sets environment variables
Set up your environment variables in Hugging Face Spaces as in Option 1
Push your code to the Hugging Face repository:
git add . git commit -m "Deploy Docker app" git push
Troubleshooting
If you encounter issues with deployment:
Start with the diagnostic app:
- Change the Dockerfile to use
test_app.pyinstead ofmain.py - This will help identify environment and dependency issues
- Change the Dockerfile to use
Check the Spaces logs for errors:
- Go to your Space → "Logs" tab
- Look for any error messages related to missing dependencies or environment variables
Common issues:
- Missing environment variables
- Missing system dependencies (like ffmpeg)
- Incorrect port configuration
- Memory or resource limitations
Development
To run locally:
- Clone the repository
- Install dependencies:
pip install -r requirements.txt - Set up environment variables
- Run the application:
streamlit run main.py
License
This project is licensed under the MIT License.