Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Classify Support Tickets with Hugging Face

Easy
Machine LearningNeural NetworksFeature EngineeringDeep Learning

Problem

Business Context

ShopFlow, an e-commerce operations platform processing 2M support tickets per year, wants to automatically route incoming tickets to the correct queue (billing, shipping, returns, technical issue, or account access). The team wants an applied ML solution using Hugging Face libraries that can be trained quickly, evaluated rigorously, and deployed for low-latency inference.

Dataset

You are given a historical dataset of customer support tickets labeled by the operations team.

Feature GroupCountExamples
Text2subject, message_body
Categorical3channel, customer_tier, region
Numeric4account_age_days, prior_ticket_count, order_value, attachment_count
Metadata2created_at, language
  • Size: 120K tickets collected over 18 months, 11 raw features
  • Target: Multi-class classification — billing, shipping, returns, technical, account_access
  • Class balance: Moderately imbalanced — shipping 34%, returns 24%, billing 18%, technical 16%, account_access 8%
  • Missing data: 9% missing subject, 6% missing numeric fields, and occasional empty message bodies after redaction

Success Criteria

A production-ready solution should achieve macro F1 >= 0.84 on a held-out test set and p95 inference latency < 120 ms per ticket on CPU batch inference. The routing team also wants per-class precision/recall so they can understand failure modes for minority classes.

Constraints

  • Use Hugging Face libraries in a practical workflow, not just raw PyTorch
  • The model must support weekly retraining on newly labeled tickets
  • The solution should handle missing text fields and class imbalance without excessive manual feature engineering
  • Predictions should be exportable to a downstream ticket-routing service

Deliverables

  1. Build a text classification pipeline using Hugging Face datasets, transformers, and evaluate
  2. Explain model choice, preprocessing, and how you handle imbalance and missing fields
  3. Train and evaluate the model with a proper train/validation/test strategy
  4. Report macro F1, weighted F1, and per-class recall
  5. Show how you would package the model for batch or API inference in production

You are practicing as a guest. Sign up free to get your answer graded with AI feedback. Your draft stays right here.

Sign up freeI have an account
Sign up to unlock solutions
Next questions
Reliance IndustriesClassify Support Tickets with TF-IDFMediumRoute E-commerce Support TicketsMediumAsappImbalanced Support Ticket RoutingMedium
0 / ~200 words