CoolFace
Apppublic

iphone12man/email-prioritization-env

sourceHugging Faceupdated 6mo agoView on Hugging Face
0likes
App README

Smart Email Prioritization System

An OpenEnv-compatible reinforcement learning environment for real-world email triage. It models how an agent prioritizes emails, extracts deadlines, classifies categories, and drafts suggested replies.

Features

  • —Priority classification (high, medium, low)
  • —Deadline extraction (normalized datetime output)
  • —Email categorization (work, college, personal, spam)
  • —Reply suggestion generation

Task Levels

  • —easy: priority only
  • —medium: deadline + category
  • —hard: priority + deadline + category + reply

Observation Space

Each observation contains:

  • —episode_id
  • —task_type
  • —current_time
  • —emails[], where each email includes:
  • —id
  • —sender
  • —subject
  • —body
  • —timestamp

Action Space

The agent outputs:

  • —email_id
  • —priority
  • —deadline (ISO-8601 or null)
  • —category
  • —suggested_reply

Actions are sent as:

json
{
  "actions": [
    {
      "email_id": "e1",
      "priority": "high",
      "deadline": null,
      "category": "work",
      "suggested_reply": "I will handle this and update you soon."
    }
  ]
}

Reward Function

Reward is task-aware and deterministic:

  • —Component scoring:
  • —priority exact match
  • —deadline exact/same-date/incorrect scoring
  • —category exact match
  • —reply keyword and length checks
  • —Penalties:
  • —missing actions
  • —extra actions
  • —invalid values
  • —missing or hallucinated deadlines
  • —Final reward is normalized to [0.0, 1.0].

Project Structure

text
email_env/
├── env/
│   ├── environment.py
│   ├── grader.py
├── inference.py
├── requirements.txt
├── Dockerfile
├── openenv.yaml
├── README.md

Setup (Docker)

bash
docker build -t email-env .
docker run email-env

Inference Usage

bash
python inference.py

Notes

  • —Uses OpenAI client with deterministic fallback logic when API is unavailable.
  • —Evaluation pipeline is deterministic for stable benchmark behavior.