Download data/scenarios.py from RightNowAI/duplex-v0: direct link, hf CLI and curl.
- Browser
- Download file 4.85 kB
-
https://huggingface.co/RightNowAI/duplex-v0/resolve/main/data/scenarios.py
- Command line
-
hf download hf://RightNowAI/duplex-v0/data/scenarios.py
-
curl -L -o scenarios.py https://huggingface.co/RightNowAI/duplex-v0/resolve/main/data/scenarios.py
4.85 kB
| """What the dialogues are about, who voices them, and the held-out split. | |
| The test set is held out by voice AND by scenario: a test dialogue uses only test | |
| scenarios and only test voices; a train dialogue uses neither. | |
| """ | |
| import random | |
| DOMAINS = { | |
| "bank": ["dispute a card charge", "raise a transfer limit", "report a lost card", "ask about a loan payoff", "set up a travel notice"], | |
| "airline": ["rebook a cancelled flight", "add a checked bag", "ask about a refund", "change a seat", "track delayed luggage"], | |
| "hotel": ["extend a stay", "request a late checkout", "fix a billing error", "book an airport shuttle", "ask about parking"], | |
| "pharmacy": ["refill a prescription", "ask when an order is ready", "transfer a prescription", "ask about pickup hours", "update insurance details"], | |
| "internet provider": ["report an outage", "upgrade a plan", "schedule a technician", "question a bill", "return a router"], | |
| "it helpdesk": ["reset a password", "set up a laptop", "fix a printer", "request software access", "report a phishing email"], | |
| "restaurant": ["book a table", "change a reservation", "ask about allergens", "order catering", "ask about a private room"], | |
| "doctor's office": ["book an appointment", "reschedule a visit", "ask for test results timing", "request a referral", "update contact details"], | |
| "car service": ["book an oil change", "ask about a repair quote", "arrange a loaner car", "check on a repair", "ask about a recall"], | |
| "online store": ["return an item", "track a package", "change a delivery address", "use a gift card", "report a damaged item"], | |
| "insurance": ["start a claim", "add a driver", "ask what a policy covers", "update an address", "ask why a premium went up"], | |
| "utility company": ["report a power cut", "set up a payment plan", "start service at a new home", "submit a meter reading", "question a high bill"], | |
| "gym": ["freeze a membership", "book a class", "cancel a membership", "ask about personal training", "update a payment card"], | |
| "university office": ["ask about enrolment dates", "request a transcript", "ask about a tuition payment", "change a course", "book an advising slot"], | |
| "travel agency": ["plan a weekend trip", "change a tour date", "ask about travel insurance", "add a rental car", "ask about visa paperwork"], | |
| "mobile carrier": ["add a line", "ask about roaming", "replace a broken phone", "dispute a data charge", "port a number"], | |
| "property manager": ["report a leak", "ask about a lease renewal", "request a parking permit", "book the shared room", "report a noisy neighbour"], | |
| "delivery service": ["reschedule a delivery", "report a missing parcel", "arrange a pickup", "ask about customs fees", "change delivery instructions"], | |
| "voice assistant at home": ["plan dinner for guests", "work out a monthly budget", "compare two phone plans", "plan a study schedule", "troubleshoot a smart light"], | |
| "tutor": ["explain compound interest", "practice a job interview", "walk through a logic puzzle", "explain how tides work", "review a short essay plan"], | |
| "event venue": ["book a hall", "ask about catering options", "change a guest count", "ask about sound equipment", "arrange accessibility access"], | |
| "tax helpline": ["ask about a filing deadline", "ask about a deduction", "correct a filed form", "set up instalments", "ask about a refund status"], | |
| "vet clinic": ["book a vaccination", "ask about a sick pet", "refill pet medication", "ask about boarding", "arrange a follow-up"], | |
| "library": ["renew a loan", "reserve a study room", "ask about a late fee", "find a book", "sign up for a workshop"], | |
| } | |
| STYLES = ["calm and brief", "chatty and friendly", "hurried and a little impatient", "unsure and hesitant", | |
| "precise and detail-minded", "tired and distracted", "cheerful", "frustrated but polite"] | |
| # Kokoro-82M English voice packs (am_santa is left out: it is a character voice). | |
| VOICES = [ | |
| "af_alloy", "af_aoede", "af_bella", "af_heart", "af_jessica", "af_kore", "af_nicole", "af_nova", "af_river", "af_sarah", "af_sky", | |
| "am_adam", "am_echo", "am_eric", "am_fenrir", "am_liam", "am_michael", "am_onyx", "am_puck", | |
| "bf_alice", "bf_emma", "bf_isabella", "bf_lily", | |
| "bm_daniel", "bm_fable", "bm_george", "bm_lewis", | |
| ] | |
| TEST_VOICES = ["af_river", "am_liam", "bf_lily", "bm_lewis"] # one per group, never used in training | |
| TRAIN_VOICES = [v for v in VOICES if v not in TEST_VOICES] | |
| BACKCHANNELS = ["mm-hm", "uh-huh", "yeah", "right", "okay", "I see", "mhm", "sure", "got it", "oh, okay"] | |
| def split_scenarios(seed=0, test_fraction=0.1): | |
| all_s = [(d, t) for d, tasks in DOMAINS.items() for t in tasks] | |
| random.Random(seed).shuffle(all_s) | |
| n_test = max(1, round(len(all_s) * test_fraction)) | |
| return all_s[n_test:], all_s[:n_test] # train, test | |