Spaces:
Sleeping
Sleeping
Download server/models.py from kavyanshshakya/docforge-env: direct link, hf CLI and curl.
- Browser
- Download file 961 Bytes
-
https://huggingface.co/spaces/kavyanshshakya/docforge-env/resolve/main/server/models.py
- Command line
-
hf download hf://spaces/kavyanshshakya/docforge-env/server/models.py
-
curl -L -o models.py https://huggingface.co/spaces/kavyanshshakya/docforge-env/resolve/main/server/models.py
961 Bytes
| """Typed models for the DocForge environment.""" | |
| from __future__ import annotations | |
| from dataclasses import dataclass, field | |
| from typing import Any, Dict, Optional | |
| class DataExtractAction: | |
| extracted_json: str | |
| confidence_json: Optional[str] = None # Feature 9: per-field confidence scores {"field": 0.0-1.0} | |
| class DataExtractObservation: | |
| task_id: str | |
| difficulty: str | |
| raw_text: str | |
| schema_description: str | |
| feedback: str | |
| score: float | |
| steps_remaining: int | |
| category: str = "extraction" # extraction, cross_document, schema_free, etc. | |
| class DataExtractState: | |
| task_id: str = "" | |
| difficulty: str = "" | |
| raw_text: str = "" | |
| schema_description: str = "" | |
| gold_labels: Dict[str, Any] = field(default_factory=dict) | |
| best_score: float = 0.0 | |
| current_step: int = 0 | |
| max_steps: int = 5 | |
| done: bool = False | |
| task_type: str = "basic" | |
| category: str = "extraction" | |