Fine-Tuning a Multilingual Transformer Model for Thai Medical Named Entity Recognition on Medicine Labels
摘要
This research focuses on an automated information extraction system for Thai medicine labels. The study fine-tunes XLM-RoBERTa, a multilingual transformer model, for Named Entity Recognition (NER) to extract six critical entity types: drug names, dosages, forms, usage instructions, indications, and warnings. Using 15,000 synthetically generated medicine label images with realistic augmentations, the research systematically evaluates OCR systems (Google Vision OCR vs. PyTesseract). It investigates the impact of data preparation strategies on model performance. Google Vision OCR demonstrates superior accuracy with 16% Word Error Rate and 10% Character Error Rate, compared to PyTesseract’s 56% and 30%, respectively. The fine-tuned model trained with shuffled data achieves 99% F1-score on synthetic test sets and 91.6% accuracy on real-world hospital medicine labels. The results confirm that combining high-quality OCR with appropriately fine-tuned NLP models significantly improves the accuracy of medical information extraction.