Journal

Thai NLP for Home Automation: ASR, Intent Classification and LINE Voice Interface

Thai NLP สำหรับ Home Automation: ASR, Intent Classification และ LINE Voice Interface

May 12, 2026 · 1 min read
Thai NLP for Home Automation: ASR, Intent Classification and LINE Voice Interface

Thai NLP Challenges for Smart Home

Thai has unique linguistic complexity: no spaces between words (hard word segmentation), five tones (the same syllable with different tones has entirely different meanings), multiple pronoun registers (ผม/ฉัน/หนู/เรา), and informal speech and slang. Mainstream voice AI systems like Google Assistant and Siri handle Thai reasonably but lack accuracy for specialised Smart Home commands.

Thai ASR (Automatic Speech Recognition)

OpenAI Whisper Thai: Whisper v3 Large fine-tuned on Thai datasets achieves WER (Word Error Rate) of ~8–12% on simple sentences. Runs locally on a Raspberry Pi 5 via whisper.cpp (quantised Q4 model) in 1–3 seconds per 10-word sentence.

AISS (AI Singapore) Thai ASR: a dedicated Thai model trained on 500+ hours of Thai Common Voice data, achieving WER ~5–8% for standard spoken Thai. Commercial licensing applies — verify before deployment.

NECTEC Thai ASR: developed by Thailand’s National Electronics and Computer Technology Center — multiple model sizes, suitable for embedded systems.

Thai Word Segmentation

Thai text must be word-segmented before NLP. Popular libraries: - PyThaiNLP: the most widely used Python library for Thai, supporting word tokenisation, POS tagging, and NER using the Newmm algorithm. - DeepCut: neural network-based Thai word segmentation — higher accuracy than Newmm on complex sentences.

Intent Classification with WangchanBERTa

WangchanBERTa is a BERT model for Thai pre-trained on 78.5GB of Thai Common Crawl by the PyThaiNLP team. Fine-tune it on home automation intents such as: turn_on_light (เปิดไฟ, เปิดไฟห้องนอน, ให้แสงสว่างหน่อย), turn_off_appliance (ปิดพัดลม, ปิดทีวี), set_temperature (ตั้งแอร์ที่ 25 องศา), check_status (ฝุ่นเยอะไหม, ประตูปิดยัง), call_family (โทรหาลูก).

Create a training dataset of 500–1,000 examples per intent with augmentation (Thai synonym replacement, random deletion). Fine-tuned WangchanBERTa achieves >95% accuracy on the test set.

Entity Extraction (NER)

Extract entities from commands: room name (ห้องนอน/ห้องนั่งเล่น/ห้องครัว), numeric values (25 degrees, 10%, 30 minutes), and time expressions (what time, tomorrow morning). Use PyThaiNLP NER combined with custom rule-based extraction.

Rasa NLU Pipeline for Thai

Rasa Open Source supports custom components — insert a Thai tokeniser (PyThaiNLP Newmm) in place of the default whitespace tokeniser. Pipeline: Thai WhitespaceTokenizer (PyThaiNLP Newmm) → RegexFeaturizer → LexicalSyntacticFeaturizer → CountVectorsFeaturizer → DIETClassifier (intent + entity).

LINE LIFF Voice Interface for Elderly Users

LINE LIFF (LINE Front-end Framework) opens a web app inside LINE chat — no additional app installation required. The web app uses the MediaRecorder API to capture voice → sends WAV audio to a backend Whisper ASR → processes intent → sends commands to Home Assistant.

UI for elderly users: large buttons, press-and-hold to speak, minimum 24px font, Piper TTS voice feedback confirming the command. Elderly users already on LINE need to learn nothing new.

Questions & answers

How accurate is Whisper Thai ASR for Smart Home commands?
Whisper v3 Large Thai achieves WER ~8–12% for general speech. For Smart Home commands with a limited vocabulary, accuracy is higher. Fine-tuning with a Smart Home command dataset reduces WER to ~3–5%.
What is WangchanBERTa and how does it differ from English BERT?
WangchanBERTa is a Thai-specific BERT model pre-trained on 78.5GB of Thai Common Crawl, using a Thai SentencePiece tokeniser instead of English WordPiece. It is far better suited to Thai NLP than multilingual BERT (mBERT).
Does LINE LIFF Voice Interface work on elderly users’ iPhones?
Yes — LINE LIFF supports iOS and Android. MediaRecorder API works on Safari (iOS 14+) with no additional app install. Elderly users already on LINE can simply tap a button in chat and speak.
Can this Thai NLP system run entirely locally without cloud?
Yes — whisper.cpp ASR, PyThaiNLP word segmentation, quantised WangchanBERTa, and Rasa NLU all run on a Raspberry Pi 5. No voice or text is sent to the cloud — fully PDPA-compliant.

Related reading