Chulalongkorn University Theses and Dissertations (Chula ETD)
Other Title (Parallel Title in Other Language of ETD)
การเพิ่มประสิทธิภาพโมเดลภาษาขนาดใหญ่สําหรับเเชทบอทด้านกฎหมายภาษาไทย
Year (A.D.)
2024
Document Type
Thesis
First Advisor
Peerapon Vateekul
Second Advisor
Apivadee Piyatumrong
Faculty/College
Faculty of Engineering (คณะวิศวกรรมศาสตร์)
Department (if any)
Department of Computer Engineering (ภาควิชาวิศวกรรมคอมพิวเตอร์)
Degree Name
Master of Engineering
Degree Level
Master's Degree
Degree Discipline
Computer Engineering
DOI
10.58837/CHULA.THE.2024.981
Abstract
Currently, developing a Thai legal question-answering system for the general public is highly challenging due to the complex, difficult-to-understand language and the extensive content of legal codes. This research proposes a Thai legal question-answering system designed for the public, aiming to establish best practices for developing effective legal QA systems. To improve performance, we created our own Thai legal QA dataset and incorporated data from various sources. We conducted comparative experiments to identify the most suitable language model for Thai legal contexts, and fine-tuned the models with diverse datasets for enhanced capabilities in legal QA and legal examinations. Additionally, we explored Retrieval-Augmented Generation (RAG) techniques, including keyword search, contextual search, and relevance ranking of legal documents. We also compared different prompt formats to determine which delivers the best results for answering legal questions for the general public. Our results show that the proposed system performs comparably to larger models like GPT-4o in legal knowledge exams and outperforms them in real-world legal QA tasks, as measured by BERTScore and ROUGE.
Other Abstract (Other language abstract of ETD)
ในปัจจุบัน การพัฒนาระบบตอบคำถามทางกฎหมายภาษาไทยสำหรับบุคคลทั่วไปเป็นงานที่มีความท้าทาย เนื่องจากภาษาที่ใช้ในประมวลกฎหมายมักซับซ้อนและเข้าใจยาก อีกทั้งเนื้อหายังยาวและซับซ้อนมาก งานวิจัยนี้นำเสนอระบบตอบคำถามทางกฎหมายภาษาไทยที่ออกแบบมาเพื่อบุคคลทั่วไป โดยมีเป้าหมายในการวางแนวทางที่ดีที่สุดสำหรับการพัฒนาระบบตอบคำถามทางกฎหมายอย่างมีประสิทธิภาพ เพื่อยกระดับประสิทธิภาพของระบบ เราได้สร้างชุดข้อมูลถาม-ตอบทางกฎหมายภาษาไทยขึ้นมาเอง และนำเข้าข้อมูลจากแหล่งอื่น ๆ มาร่วมด้วย จากนั้นได้ทำการทดลองเปรียบเทียบเพื่อค้นหาโมเดลภาษาที่เหมาะสมที่สุดสำหรับการใช้งานในบริบททางกฎหมายไทย รวมถึงการปรับแต่งโมเดลด้วยชุดข้อมูลหลากหลายรูปแบบเพื่อเพิ่มขีดความสามารถในงานถาม-ตอบเเละการทําข้อสอบทางกฎหมาย นอกจากนี้ ยังได้ทดลองใช้เทคนิคการค้นคืนข้อมูลด้วย Retrieval-Augmented Generation (RAG) โดยครอบคลุมทั้งการค้นหาด้วยคำสำคัญ การค้นหาตามบริบท และการจัดลำดับความเกี่ยวข้องของเนื้อหาในประมวลกฎหมาย เรายังได้เปรียบเทียบรูปแบบคำสั่ง (prompt) ที่แตกต่างกัน เพื่อประเมินว่ารูปแบบใดให้ผลลัพธ์ที่ดีที่สุดสำหรับการตอบคำถามทางกฎหมายแก่ประชาชนทั่วไป จากผลการทดลอง พบว่าระบบที่พัฒนาในงานวิจัยนี้มีประสิทธิภาพใกล้เคียงกับแบบจำลองขนาดใหญ่อย่าง GPT-4o ในการสอบความรู้ทางกฎหมาย และเหนือกว่าในแง่การตอบคำถามทางกฎหมายที่พบในสถานการณ์จริง โดยวัดจากค่า BERTScore และ ROUGE
Creative Commons License

This work is licensed under a Creative Commons Attribution-NonCommercial-No Derivative Works 4.0 International License.
Recommended Citation
Hanwiboonwat, Supachoke, "Enhancing large language models for Thai legal chatbots" (2024). Chulalongkorn University Theses and Dissertations (Chula ETD). 74819.
https://digital.car.chula.ac.th/chulaetd/74819