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.
