Imagine scrolling through a hundred menu items at a restaurant—what should you order? That’s where “Best Seller” and “Must Try” tags come in. These data-powered labels help you cut through the clutter and find meals that others love—and that you probably will too.
In this blog, we delve into the technical process behind these tags, highlighting how data-driven insights can enhance your dining experience.
Objective
-
Improve User Experience: Simplify menu navigation by prominently featuring top-performing items.
-
Increase Engagement: Drive higher-order conversions by recommending popular and high-quality dishes.
-
Boost Restaurant Sales: Enhance visibility for restaurants’ best items, rewarding quality and consistency.
-
Ensure Scalability: Design a robust system that can handle large datasets and integrate with diverse order sources.
-
Maintain Accuracy: Implement rigorous data cleaning and validation to ensure reliable tag assignments.
The Power of Best Seller and Must Try Tags
The Best Seller tag identifies menu items with the highest order volumes at each restaurant, reflecting their widespread popularity. The Must Try tag highlights menu items that combine strong sales with exceptional customer ratings, offering a curated selection of standout dishes. Some items earn both tags, marking them as crowd favorites with top-notch quality.
Technical Architecture
1. Data Collection
The system gathers data from customer orders over the past three months, focusing on:
- Order Volume: The number of times an item is ordered.
- Customer Ratings: Average star ratings from the customers’ feedback.
- Menu Details: Item names, item prices, and active restaurants and menu items.
2. Data Cleaning and Preparation
To ensure accuracy, the data undergoes rigorous cleaning:
- Duplicate Removal: Keeps each item once, prioritizing the latest price.
- Exclusion of Basic Items: Filters out generic items like roti, rice, or water, etc. (unless part of a combo) to focus on distinctive dishes.
- Data Validation: Ensures only customer-initiated orders from active restaurants are included.
3. Percentile-Based Tagging
The tagging logic uses percentile analysis to identify top-performing items:
- Best Seller Tag:
- Items exceeding the 97th percentile of order volume for a restaurant are tagged as Best Sellers.
- If a restaurant has fewer than two tagged items, the threshold is lowered to the 96th percentile.
- Must Try Tag:
- Items above the 90th percentile of order volume are ranked by feedback rating and price.
- The top three items per restaurant receive the Must Try tag.
- Dual Tags:
- Items qualifying for both criteria are tagged as Must Try, Best Seller, highlighting their exceptional appeal.
This approach ensures fairness across restaurants with varying order volumes.
4. Database Updates
Finally, we batch-update the MySQL database with tags using efficient tab-separated CSV streams.
Tags stored as JSON arrays in Menu_Items.tags : [“BESTSELLER”, “MUST_TRY”]
A simple yet robust function ensures:
-
Atomic updates per restaurant/item
-
Logging for rollback and tracking
Hybrid Tagging Workflow :

5. Logging and Monitoring
Every step is logged for transparency, capturing successes and errors with timestamps to ensure reliability.
Technical Stack
| Component | Tools/Techniques |
|---|---|
| Data Extraction | SQLAlchemy, MySQL |
| Data Processing | Pandas (percentiles, grouping, cleaning) |
| Statistical Engine | Numpy-based percentile calculations |
| Database Updates | mysql.connector + CSV batch processing |
| Monitoring | Python logging with timestamps |
Business Impact
- Better conversion: Passengers trust labels when they reflect crowd wisdom.
- Restaurant incentives: Restaurants strive to maintain quality consistency, knowing that high-performing items can earn these coveted labels..
- Menu intelligence: Helps curate menus across stations dynamically.
Future Enhancements
- Personalized Tags: User-specific tags based on dietary preferences and context-aware tags like “Train-Friendly Meals”.
- Real-Time Thresholds: Dynamic percentile adjustments during peak hours.
- Seasonal Trends: Holiday-specific tagging (e.g., “Festive Special”).
Conclusion
The menu tagging system transforms chaotic menus into curated culinary journeys. By combining statistical rigor with restaurant-specific adaptability, we ensure every traveler discovers unforgettable meals—whether it’s a bustling station’s best-selling “Special Veg Thali” or hidden gems like:
- Delhi’s fiery Chole Bhature – A “Must Try” near Hazrat Nizamuddin.
- Hyderabad’s aromatic Biryani – Tagged “Best Seller” at Secunderabad Junction
- Mount Abu’s creamy Rabdi – The “Must Try” sweet reward after Rajasthan’s hills
- Chennai’s comforting Idli Vada Sambhar – A “Must Try” classic at Chennai Central Station
This isn’t just about tags; it’s about making India’s diverse food heritage discoverable, one railway journey at a time.
Keep exploring
More from the journey
How Text Became Numbers: From Simple Tricks to Intelligent Language Models
A journey through the evolution of text representation techniques, from simple encodings to powerful transformer-based models, showing how words became numbers that machines can truly understand.
Read article Earlier articleHow we built the “item pairing” feature on a food delivery platform
How we built item pairing feature for a food delivery platform using the Apriori algorithm and historical order data to boost user experience and order value
Read article