Spaces:
Sleeping
Sleeping
File size: 10,156 Bytes
753b5ee | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 | """
email_data.py β Curated email dataset for the three task levels.
Each email has ground-truth labels used by the graders.
Fields:
email_id, subject, body, sender,
gt_category, gt_priority, gt_department,
gt_reply_keywords β list of words that MUST appear in a good reply
task_level
"""
from typing import List
from dataclasses import dataclass, field
@dataclass
class Email:
email_id: str
subject: str
body: str
sender: str
gt_category: str
gt_priority: str
gt_department: str
gt_reply_keywords: List[str]
task_level: str
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# EASY EMAILS β category + priority + department (no reply needed)
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
EASY_EMAILS: List[Email] = [
Email(
email_id="E001",
subject="Congratulations! You've won $1,000,000!",
body=(
"Dear Friend, You have been selected as the lucky winner of our "
"international lottery. Click here to claim your prize immediately. "
"Send us your bank details to process the transfer."
),
sender="winner@totally-legit-lottery.ru",
gt_category="spam",
gt_priority="low",
gt_department="support",
gt_reply_keywords=[],
task_level="easy",
),
Email(
email_id="E002",
subject="Invoice #4821 β Payment Overdue",
body=(
"Hi, I noticed that invoice #4821 for $3,200 issued on March 1st "
"has not been paid yet. The due date was March 15th. Could you "
"please arrange payment or let me know if there's an issue?"
),
sender="accounts@vendorcorp.com",
gt_category="billing",
gt_priority="high",
gt_department="finance",
gt_reply_keywords=[],
task_level="easy",
),
Email(
email_id="E003",
subject="Cannot login to the dashboard",
body=(
"Hi support team, I've been unable to log into the dashboard since "
"this morning. I've tried resetting my password twice but still get "
"an 'invalid credentials' error. My username is john.doe@company.com."
),
sender="john.doe@company.com",
gt_category="technical",
gt_priority="high",
gt_department="engineering",
gt_reply_keywords=[],
task_level="easy",
),
Email(
email_id="E004",
subject="Annual leave request β 3 days",
body=(
"Dear HR, I would like to request 3 days of annual leave from "
"April 14 to April 16. I have 12 days remaining in my balance. "
"Please let me know if this is approved. Thanks, Sarah."
),
sender="sarah.jones@company.com",
gt_category="hr",
gt_priority="medium",
gt_department="hr",
gt_reply_keywords=[],
task_level="easy",
),
Email(
email_id="E005",
subject="Office supplies order",
body=(
"Hi, we're running low on printer paper and pens in office 3B. "
"Could someone arrange a restock? We typically order from OfficeMax. "
"Nothing urgent, just flagging before we run out."
),
sender="mike.brown@company.com",
gt_category="general",
gt_priority="low",
gt_department="support",
gt_reply_keywords=[],
task_level="easy",
),
]
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# MEDIUM EMAILS β classification + short professional reply
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
MEDIUM_EMAILS: List[Email] = [
Email(
email_id="M001",
subject="Double charge on my account",
body=(
"Hello, I was charged twice for my subscription on April 3rd β "
"two charges of $49.99 each appear on my credit card statement. "
"Order numbers: ORD-8821 and ORD-8822. Please refund the duplicate "
"charge as soon as possible. My account email is lisa@example.com."
),
sender="lisa@example.com",
gt_category="billing",
gt_priority="urgent",
gt_department="finance",
gt_reply_keywords=["apologize", "refund", "investigate", "24", "48"],
task_level="medium",
),
Email(
email_id="M002",
subject="API rate limit errors in production",
body=(
"Hi engineering team, we are hitting 429 rate limit errors on the "
"/api/v2/data endpoint in production since 14:00 UTC today. "
"Our integration handles ~500 requests/minute which was previously "
"fine. No changes were made on our side. This is impacting live "
"customers. Please investigate urgently."
),
sender="devops@clientbusiness.com",
gt_category="technical",
gt_priority="urgent",
gt_department="engineering",
gt_reply_keywords=["investigate", "team", "update", "priority", "contact"],
task_level="medium",
),
Email(
email_id="M003",
subject="Harassment complaint β requires immediate attention",
body=(
"I need to formally report that I have been experiencing workplace "
"harassment from a colleague in my department. This has been ongoing "
"for 3 weeks. I have documented instances with dates. I would like "
"to speak with someone in HR confidentially as soon as possible."
),
sender="anonymous.employee@company.com",
gt_category="hr",
gt_priority="urgent",
gt_department="hr",
gt_reply_keywords=["seriously", "confidential", "contact", "meet", "support"],
task_level="medium",
),
]
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# HARD EMAILS β multi-signal triage + detailed, accurate reply
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
HARD_EMAILS: List[Email] = [
Email(
email_id="H001",
subject="Re: Re: Re: Billing issue β still unresolved after 3 weeks",
body=(
"I have now contacted your support team FOUR TIMES about the incorrect "
"charge of $1,250 on my enterprise account (ACC-00421). Each time I was "
"told 'it will be resolved within 3 business days'. It has been 3 weeks. "
"I have email threads, case numbers CS-1142, CS-1198, CS-1267 and CS-1301. "
"If this is not resolved by end of week I will be filing a chargeback and "
"escalating to my legal team. This is completely unacceptable."
),
sender="cto@enterprise-client.com",
gt_category="billing",
gt_priority="urgent",
gt_department="finance",
gt_reply_keywords=[
"apologize", "personally", "escalate", "manager", "resolve",
"24", "hours", "case", "ACC-00421"
],
task_level="hard",
),
Email(
email_id="H002",
subject="Security incident β possible data breach",
body=(
"Our security team has detected unusual outbound traffic from your "
"platform at 02:30 UTC today. We are seeing repeated requests to "
"external IPs originating from our tenant environment (tenant ID: "
"T-9942). Logs indicate approximately 50,000 records may have been "
"accessed. We require immediate incident response. Our CISO is "
"available on +1-555-0199. Please treat this as P0."
),
sender="security@enterprise-partner.com",
gt_category="technical",
gt_priority="urgent",
gt_department="engineering",
gt_reply_keywords=[
"immediately", "incident", "team", "isolate", "investigate",
"contact", "CISO", "P0", "hour"
],
task_level="hard",
),
Email(
email_id="H003",
subject="Board-level complaint: employee misconduct + financial irregularities",
body=(
"I am writing on behalf of two board members who wish to remain "
"anonymous at this stage. We have evidence of a senior manager in "
"the finance department approving unauthorized expenses totalling "
"over $85,000 over the past six months. Additionally, there are "
"allegations of related-party transactions that were not disclosed. "
"This requires a confidential internal audit and independent HR "
"investigation. We request a response to the board within 48 hours "
"outlining the steps being taken."
),
sender="board.office@company.com",
gt_category="hr",
gt_priority="urgent",
gt_department="management",
gt_reply_keywords=[
"acknowledge", "confidential", "audit", "investigate",
"48", "hours", "board", "seriously", "independent"
],
task_level="hard",
),
]
ALL_EMAILS = {e.email_id: e for e in EASY_EMAILS + MEDIUM_EMAILS + HARD_EMAILS}
EMAILS_BY_LEVEL = {
"easy": EASY_EMAILS,
"medium": MEDIUM_EMAILS,
"hard": HARD_EMAILS,
}
|