Design an ML Word-Segmentation Service
Insert spaces into unsegmented text with confidence, model versioning, and a deterministic fallback.
Problem statement
For this exercise, assume you are designing an ml word-segmentation service. Insert spaces into unsegmented text with confidence, model versioning, and a deterministic fallback.
Define a coherent first production version that satisfies the listed requirements and scale while making failures and degraded behavior visible.
What to build
- Accept an unsegmented string and return token boundaries plus confidence.
- Serve versioned models and dictionaries with safe canary and rollback behavior.
- Fall back deterministically for unsupported language or low confidence and collect corrected examples.
At scale
- For this exercise, assume 50,000 requests per second across 20 languages.
- Return results within 100 ms p99 for inputs up to 2,000 characters.
- Deploy a new model weekly while preserving exact replay of prior decisions for 30 days.