Natural Language Processing (NLP) ในสมัยก่อนยุค Deep Learning เป็นที่นิยม นักวิจัยมักจะใช้วิธี Hand Engineer กับข้อมูล ในงาน NLP จะมีการเขียนโปรแกรมผูก Logic กฏระเบียบ ไวยากรณ์ ไว้หลายอย่างในโปรแกรม มีการตัดสินใจกำหนด Assumption / Bias หลายอย่าง

หนึ่งในนั้นคือ Stop Words ตามรายการที่กำหนด สามารถตัดทิ้งได้ ไม่สำคัญกับความหมายของเนื้อหา ทำให้ลดจำนวนคำศัพท์ ลดความซับซ้อนของโปรแกรมลง

Stop Words คืออะไร

Stop Words คือ คำทั่ว ๆ ไป ที่เราพบบ่อย ๆ ในประโยค หรือ เอกสาร แต่ไม่ค่อยช่วยในการสื่อความหมายสักเท่าไร ทำให้เราสามารถลบคำเหล่านั้นออกไปจากรายการคำศัพท์ได้เลย กรองทิ้งไปจากเอกสารได้เลย เช่น a, an, the, also, just, quite, unless, etc. คำเหล่านี้เรียกว่า Stop Words

Stop List รายการ Stop Words จะแตกต่างกันไปตามแต่ละ Library ตามแต่ Assumption ของผู้สร้าง Library นั้น ๆ ในตัวอย่างนี้ เราจะดู Library ที่เป็นที่นิยม 2 ตัว ในงาน NLP คือ NLTK และ spacy

Logo of the spaCy Natural Language Processing library
Logo of the spaCy Natural Language Processing library

แนวโน้มในการใช้ Stop Word เริ่มตั้งแต่ สมัยก่อนนิยมใช้ Stop Word จำนวนมาก 200-300 คำ ลดลงเรื่อย ๆ มาเป็น 7-12 คำ ไปจน ยุค Deep Learning ไม่ใช้ Stop Words เลย เช่น Web Search Engine เช่น Google ไม่ใช้ Stop Words

เรามาเริ่มกันเลยดีกว่า

Open In Colab

แชร์ให้เพื่อน:

Surapong Kanoktipsatharporn on FacebookSurapong Kanoktipsatharporn on LinkedinSurapong Kanoktipsatharporn on Rss
Surapong Kanoktipsatharporn
Solutions Architect at Bua Labs
The ultimate test of your knowledge is your capacity to convey it to another.

Published by Surapong Kanoktipsatharporn

The ultimate test of your knowledge is your capacity to convey it to another.