Skip to main content
Back to All Projects
AI & Machine LearningMachine Learning Engineer • 2024

Restaurant Reputation Intelligence System

End-to-end NLP sentiment pipeline analyzing customer reviews with XLM-RoBERTa.

State-of-the-art F1 score on Thai text
Multi-lingual transformer fine-tuning
Sub-80ms real-time inference latency
Interactive sentiment KPI dashboard

System Architecture

An automated data pipeline that ingests Wongnai reviews, tokenizes and normalizes text, passes batches through fine-tuned XLM-RoBERTa weights, and surfaces insights on a real-time dashboard.

Key Architecture Components

  • Data Preprocessing Engine: Noise removal, emoji mapping, and Thai compound word segmentation.
  • Transformer Inference Engine: PyTorch-optimized XLM-RoBERTa classifier with GPU/CPU inference fallback.
  • FastAPI Service Layer: RESTful endpoints exposing batch and single-review prediction APIs.
  • Streamlit Intelligence Dashboard: Visualizes sentiment trends, keyword word-clouds, and rating distributions.
Data Pipeline FlowRaw Customer Reviews → Thai Preprocessor → Tokenizer Pipeline → XLM-RoBERTa Transformer → Sentiment Classification → Live Analytics Dashboard

Engineering Challenges & Solutions

Challenge: Informal Thai slang, abbreviations, and lack of sentence boundaries causing baseline NLP models to fail.
Engineering Solution: Preprocessed text with PyThaiNLP word segmenters and fine-tuned multilingual XLM-RoBERTa embeddings, boosting classification F1 by 18.4%.
Challenge: Severe class imbalance between highly positive and extremely negative customer reviews.
Engineering Solution: Applied Focal Loss and stratified oversampling during training to ensure robust recall across all sentiment categories.