|
Download README.md from TanujInsane/document-classification-env: direct link, hf CLI and curl.
- Browser
- Download file 2.96 kB
-
https://huggingface.co/spaces/TanujInsane/document-classification-env/resolve/main/README.md
- Command line
-
hf download hf://spaces/TanujInsane/document-classification-env/README.md
-
curl -L -o README.md https://huggingface.co/spaces/TanujInsane/document-classification-env/resolve/main/README.md
2.96 kB
| title: Document Classification Env | |
| emoji: π | |
| colorFrom: blue | |
| colorTo: green | |
| sdk: docker | |
| app_file: app.py | |
| pinned: false | |
| # π Void Walkers: Intelligent Routing Environment | |
| **A premium, Gymnasium-compatible Document Classification Environment designed for AI Agentic Learning.** | |
| --- | |
| ## π Overview | |
| Void Walkers represents a state-of-the-art **Partially Observable Markov Decision Process (POMDP)** where agents learn to classify, route, and interact with complex customer support payloads. Unlike static datasets, this environment enforces real-world constraints: **SLA Time Pressure**, **Processing Costs**, and **Tool-Mediated Metadata Retrieval**. | |
| ### π Key Enhancements (v1.1) | |
| - **Synchronized Category Space**: Standardized 22 fine-grained categories across the environment, agent, and spec. | |
| - **Dynamic Reward Architecture**: Implemented real-time Speed Bonuses and Resource Costs in the `step()` loop. | |
| - **Rich State API**: Deep telemetry including `action_history` and `reward_history` for diagnostic observability. | |
| - **Live RL Training**: Integrated PyTorch-based Reinforcement Learning loop demonstrating agent improvement over time. | |
| --- | |
| ## π οΈ System Architecture | |
| ### 1. Environment: `DocumentClassificationEnv` | |
| The core logic resides in `environment.py`, implementing the standard `step()`, `reset()`, and `state()` API. | |
| - **Obs Space**: Dictionary containing raw `content`, `features` (100d), `urgency`, and `sla_remaining`. | |
| - **Action Space**: Discrete(24) β 22 labels + 2 tools (`Request Metadata`, `Escalate`). | |
| - **Reward Function**: | |
| $$R = \text{Accuracy} + \text{Speed Bonus} - \text{SLA Penalty} - \text{Processing Cost}$$ | |
| ### 2. Agent: `TicketAgent` | |
| A hybrid intelligence system: | |
| - **Baseline**: TF-IDF + Logistic Regression (pre-trained). | |
| - **RL Agent**: A neural policy that learns to map features to categories based on environment feedback. | |
| --- | |
| ## π Benchmarks & Learning | |
| | Metric | Target (Easy) | Target (Hard) | | |
| | :--- | :--- | :--- | | |
| | **Accuracy** | 95%+ | 30%+ (High Entropy) | | |
| | **SLA Compliance** | 100% | >85% | | |
| | **Latency** | <50ms | <1.0s | | |
| --- | |
| ## π Quick Start | |
| ### 1. Initialize Sandbox | |
| ```python | |
| from environment import DocumentClassificationEnv | |
| env = DocumentClassificationEnv(task_difficulty="medium") | |
| obs, info = env.reset() | |
| ``` | |
| ### 2. Execute Action | |
| ```python | |
| action = 1 # "Billing" | |
| obs, reward, done, truncated, info = env.step(action) | |
| ``` | |
| ### 3. Observe State | |
| ```python | |
| telemetry = env.state() | |
| print(f"Total Reward: {telemetry['total_reward']}") | |
| ``` | |
| --- | |
| ## π₯οΈ UI & Visualization | |
| Run the Gradio dashboard for interactive testing: | |
| ```bash | |
| python app.py | |
| ``` | |
| *Navigate to the **Reinforcement Learning** tab to witness the neural training sequence.* | |
| --- | |
| ## π Documentation & Spec | |
| Full specifications are defined in [openenv.yaml](./openenv.yaml). This project adheres to the **OpenEnv v1.0 Standard**. | |
| **Developed for Advanced AI Agentic Coding Research.** | |