CoolFace
Apppublic

TanujInsane/document-classification-env

sourceHugging Faceupdated 5mo agoView on Hugging Face
3likes
App README

๐ŸŒŒ 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

MetricTarget (Easy)Target (Hard)
Accuracy95%+30%+ (High Entropy)
SLA Compliance100%>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. This project adheres to the OpenEnv v1.0 Standard.

Developed for Advanced AI Agentic Coding Research.