Overview
Dex is Scale’s document understanding service that enables:- Document Parsing - Convert any document (PDFs, DOCX, images, etc.) into structured JSON format
- Data Extraction - Extract specific information using custom schemas and prompts
- Project Management - Organize and isolate data with proper credential management
- File Management - Secure file upload and storage with cloud provider integration
Prerequisites
Before using this repository, ensure you have:- ✅ A valid Scale account with SGP (Scale General Platform) access
- ✅ Your SGP account ID and API key set as environment variables:
- ✅ VPN connection to Scale’s internal network
- ✅ Python 3.8+ installed
- ✅ Required Python packages (see Installation section)
Installation
1. Install Dex SDK
The Dex SDK can be installed from Scale’s internal CodeArtifact repository2. Alternative: Install from Local Wheels
If you have the wheel files locally:3. Install Additional Dependencies
Quick Start
1. Initialize Dex Client
2. Create a Project
3. Upload a Document
4. Parse the Document
5. Extract Structured Data
Troubleshooting
Common Issues
- VPN Connection Problems
-
Authentication Errors
- Verify
SGP_ACCOUNT_ID
andSGP_API_KEY
environment variables - Check that your Scale account has SGP access
- Verify
-
File Upload Issues
- Ensure file format is supported
- Check file size limits
- Verify file path is correct
-
Parsing Failures
- Check document quality (scanned documents may need higher resolution)
- Try different chunking methods
- Verify OCR engine compatibility
API Reference
DexClient
create_project()
- Create a new projectlist_projects()
- List all projects
Project
upload_file()
- Upload a documentlist_files()
- List uploaded files
DexFile
parse()
- Parse document to structured format
ParseResult
extract()
- Extract structured data using schemas
Contributing
When adding new test cases or examples:- Follow the existing notebook structure
- Include clear documentation and comments
- Test with various document types
- Update this README with new features or examples
Support
For issues or questions:- Check the troubleshooting section above
- Review the notebook examples
- Contact the Scale Dex team for technical support at #sgp-document-understanding-capability