Stock sentiment analysis with transformer architecture

dc.contributor.authorPongsatorn Harnmetta
dc.date.accessioned2026-01-08T09:40:51Z
dc.date.available2026-01-08T09:40:51Z
dc.date.copyright2022
dc.date.created2026
dc.date.issued2022
dc.description.abstractThe stock market is affected by several factors, such as politics, economics, and finance. These factors are reflected in several digital formats, including news, report, and social media. A large amount of data created through many online platforms over the internet in this era is causing the growth of unstructured data in an exponential direction. To receive much useful information in time, we propose a stock sentiment analysis system corroborating with the state-of-the-art pretrained transformer architecture base model. The transformer base models, i.e., BERT and WangchanBERTa models, are utilized to extract the contextualized embeddings for application in a downstream task like sentiment analysis. The dataset, a fundamental analysis of Thai financial content, is gathering from Krungsri securities, a financial institution in Thailand. However, to compare the result between embedding techniques with baseline, we use multiple machine learning models such as logistic regression, random forest, and support vector machines and apply the baseline which is the term frequency-inverse document frequency (TF-IDF). Our experiment shows that WangchanBERTa and BERT with logistic regression can achieve the highest accuracy at 88 % compared to machine learning models. In conclusion, our proposed system can precisely predict stock sentiment in Thai with high accuracy. IMPLICATION OF THESIS: In this research, we show that the transfer learning concept can further develop the sentiment analysis system on the financial domain by using WangchanBERTa and BERT base model with the high prediction score and transformer architecture base model perform well on the areas of finance and illustrate the vector generating technique for the long text sequence without implementing language model from scratch that perform a great prediction. In addition, this system is used for monitoring and handling on stock market fluctuation in Thai language to prevent the late decision.en
dc.description.abstractตลาดหุ้นมักได้รับผลกระทบจากปัจจัยต่างๆมาช้านาน เช่น การเมือง เศรษฐกิจ และการเงิน สิ่งเหล่านี้ แสดงออกผ่านสื่อออนไลน์ที่ผู้คนสามารถเข้าถึงได้ง่ายในปัจจุบัน นอกจากนี้ ในยุคปัจจุบันการเติบโตของข้อมูลเป็นแนวโน้มแบบทวีคูณและมีการสร้างข้อมูลนับล้านรายการผ่านแพลตฟอร์มออนไลน์จำนวนมากบนอินเทอร์เน็ต ซึ่งในการรับข้อมูลที่เป็นประโยชน์ต่างๆได้อย่างทันเวลาเพื่อหลีกเลี่ยงการตัดสินใจที่ล่าช้า เราจึงขอเสนอระบบการวิเคราะห์แนวโน้มของหุ้นที่ผสานเข้ากับโมเดลที่มีชื่อว่า transformer ในงานวิจัยนี้ เราได้ใช้โมเดล transformer ที่ก้าวผ่านข้อจำกัดการประมวลผลภาษาธรรมชาติ (NLP) ในอดีต และการประยุกต์ใช้โมเดล transformer ที่รวมทั้ง Bidirectional Encoder Representations from Transformers (BERT) เป็นโมเดลที่รองรับหลากหลายภาษา และ WangchanBERTa ที่เป็นโมเดลแบบจำลองภาษาเดียว(ภาษาไทย) เพื่อใช้ในการสร้าง contextualized embeddings ที่สามารถนำไปใช้ประโยชน์ในภายหลังได้ในงานการวิเคราะห์แนวโน้ม นอกจากนี้ เรายังเก็บข้อมูลการวิเคราะห์พื้นฐานทางด้านการเงินจากสถาบันการเงินในไทย อย่างไรก็ตามเพื่อเปรียบเทียบผลการทดลองระหว่าง word embeddings เราใช้หลากหลายโมเดล machine learning ได้แก่ logistic regression, random forest, and support vector machines ในรูปแบบของแบบจำลองการคาดการณ์ และยังมีการสร้างผลลัพธ์อ้างอิง หรือ baseline โดยใช้โมเดล term frequency-inverse document frequency (TF-IDF) ในการเปรียบเทียบ การทดลองของเราแสดงให้เห็นว่า WangchanBERTa และ BERT สามารถทำความแม่นยำได้สูงสุดถึง 88 % เมื่อเทียบระหว่าง machine learning model โดยสรุป ระบบที่เรานำเสนอสามารถทำนายความเชื่อมั่นหุ้นภาษาไทยได้อย่างแม่นยำและแม่นยำสูง การนำผลของวิทยานิพนธ์ไปใช้: ในงานวิจัยนี้ เราได้นำเสนอหลักการคิดแบบ transfer learning ที่สามารถนำไปต่อยอดเพื่อสร้างระบบการวิเคราะห์แนวโน้มทางด้านการเงินโดยใช้โมเดล WangchanBERTa และ BERT ที่ให้ผลการทำนายที่สูง อีกทั้งยังแสดงการทำงานของสถาปัตยกรรม transformer ที่สามารถทำงานได้ดีทางด้านการเงินและได้แสดงถึงเทคนิคการสร้าง vector สำหรับข้อความที่มีลักษณะยาวโดยปราศจากการทำงานตั้งแต่เริ่มต้น ยิ่งไปกว่านั้น ระบบนี้ ยังสามารถนำไปใช้ในการสังเกตการณ์และรับมือกับตลาดหุ้นที่มีความผันผวนในภาษาไทยเพื่อหลีกเลี่ยงการตัดสินใจที่ล่าช้าth
dc.format.extentxi, 47 leaves
dc.format.mimetypeapplication/pdf
dc.identifier.citationThesis (M.Sc. (Information Technology Management))--Mahidol University, 2022)
dc.identifier.urihttps://repository.li.mahidol.ac.th/handle/123456789/113852
dc.language.isoeng
dc.publisherMahidol University. Mahidol University Library and Knowledge Center
dc.rightsผลงานนี้เป็นลิขสิทธิ์ของมหาวิทยาลัยมหิดล ขอสงวนไว้สำหรับเพื่อการศึกษาเท่านั้น ต้องอ้างอิงแหล่งที่มา ห้ามดัดแปลงเนื้อหา และห้ามนำไปใช้เพื่อการค้า
dc.rights.holderMahidol University
dc.subjectSentiment analysis -- Thailand
dc.subjectStock exchanges -- Thailand
dc.subjectNatural language processing (Computer science);Finance -- Data processing -- Thailand.
dc.titleStock sentiment analysis with transformer architecture
dc.title.alternativeการวิเคราะห์แนวโน้มหุ้นโดยสถาปัตยกรรมทรานส์ฟอร์มเมอร์ส
dc.typeMaster Thesis
dcterms.accessRightsopen access
thesis.degree.departmentFaculty of Engineering
thesis.degree.disciplineInformation Technology Management
thesis.degree.grantorMahidol University
thesis.degree.levelMaster's degree
thesis.degree.nameMaster of Science

Files