Spaces:
Sleeping
Sleeping
| #!/usr/bin/env python3 | |
| """ | |
| Pydantic models for medical document processing | |
| """ | |
| from pydantic import BaseModel, Field | |
| from typing import Dict, List, Any, Optional | |
| class TemplateAnalysis(BaseModel): | |
| """Model for template analysis results.""" | |
| sections: List[Dict[str, Any]] = Field( | |
| description="List of sections found in template") | |
| formatting: Dict[str, Any] = Field(description="Formatting information") | |
| document_info: Dict[str, str] = Field(description="Document metadata") | |
| class MedicalTranscription(BaseModel): | |
| """Model for medical transcription data.""" | |
| raw_text: str = Field(description="Raw transcription text") | |
| corrected_text: str = Field(description="Corrected and structured text") | |
| medical_data: Dict[str, Any] = Field( | |
| description="Extracted medical information") | |
| class SectionContent(BaseModel): | |
| """Model for section content.""" | |
| technique: str = Field(description="Technique section content") | |
| result: str = Field(description="Result section content") | |
| conclusion: str = Field(description="Conclusion section content") | |
| class InsertSectionsInput(BaseModel): | |
| """Model for inserting sections into documents.""" | |
| template_path: str | |
| sections: Dict[str, str] | |
| output_path: str | |
| title: str = None | |