Thai Natural Language Processing in Python.
PyThaiNLP is a Python package for text processing and linguistic analysis, similar to nltk but with focus on Thai language.
PyThaiNLP supports Python 3.4+. Since version 1.7, PyThaiNLP deprecates its support for Python 2. Python 2 users can still use PyThaiNLP 1.6.
- Thai word segmentation (
word_tokenize), including subword segmentation based on Thai Character Cluster (tcc) and ETCC (etcc) - Thai romanization (
romanize) - Thai part-of-speech taggers (
pos_tag) - Read out number to Thai words (
bahttext,num_to_thaiword) - Thai collation (sort by dictionoary order) (
collate) - Thai-English keyboard misswitched fix (
eng_to_thai,thai_to_eng) - Thai misspellings detection and spelling correction (
spell) - Thai soundex (
lk82,udom83,metasound) - Thai stop words (
pythainlp.corpus.thai_stopwords) - Thai WordNet
- and much more - see examples.
Using pip
Stable release
$ pip install pythainlpDevelopment release
$ pip install https://github.com/PyThaiNLP/pythainlp/archive/dev.zipNote: PyTorch is required for ulmfit sentiment analyser. pip install torch is needed for the feature. gensim and keras packages may also needed for other modules that rely on these machine learning libraries.
See https://thainlp.org/pythainlp/docs/1.7/
- PyThaiNLP code uses Apache Software License 2.0
- Corpus data created by PyThaiNLP project use Creative Commons Attribution-ShareAlike 4.0 International License
- For other corpus that may included with PyThaiNLP distribution, please refer to Corpus License.
Please do fork and create a pull request :)
For style guide and other information, including references to algorithms we use, please refer to our contributing page.
ประมวลภาษาไทยในภาษา Python
PyThaiNLP เป็นไลบารีภาษาไพทอนเพื่อการประมวลผลภาษาธรรมชาติ โดยเน้นการสนับสนุนภาษาไทย แจกจ่ายฟรี (ตลอดไป) เพื่อคนไทยและชาวโลกทุกคน!
เพราะโลกขับเคลื่อนต่อไปด้วยการแบ่งปัน
รองรับ Python 3.4 ขึ้นไป
- หน้าหลัก GitHub: https://github.com/PyThaiNLP/pythainlp/
- ตัดคำภาษาไทย (
word_tokenize) และรองรับ Thai Character Clusters (tcc) และ ETCC (etcc) - ถอดเสียงภาษาไทยเป็นอักษรละติน (
romanize) - ระบุชนิดคำ (part-of-speech) ภาษาไทย (
pos_tag) - อ่านตัวเลขเป็นข้อความภาษาไทย (
bahttext,num_to_thaiword) - เรียงลำดับคำตามพจนานุกรมไทย (
collate) - แก้ไขปัญหาการพิมพ์ลืมเปลี่ยนภาษา (
eng_to_thai,thai_to_eng) - ตรวจคำสะกดผิดในภาษาไทย (
spell) - soundex ภาษาไทย (
lk82,udom83,metasound) - stop word ภาษาไทย (
pythainlp.corpus.thai_stopwords) - Thai WordNet
- และอื่น ๆ ดูตัวอย่าง
รุ่นเสถียร
$ pip install pythainlpรุ่นกำลังพัฒนา
$ pip install https://github.com/PyThaiNLP/pythainlp/archive/dev.zipหมายเหตุ: เนื่องจาก ulmfit sentiment analyser ต้องใช้ PyTorch จึงต้อง pip install torch เพื่อติดตั้ง PyTorhc ก่อน มอดูลที่อาศัยการเรียนรู้ของเครื่องอื่นๆ อาจจำเป็นต้องติดตั้ง gensim และ keras ก่อนเช่นกัน
อ่านที่ https://thainlp.org/pythainlp/docs/1.7/
- โค้ด PyThaiNLP ใช้สัญญาอนุญาต Apache Software License 2.0
- คลังคำและข้อมูลที่สร้างโดยโครงการ PyThaiNLP ใช้สัญญาอนุญาตครีเอทีฟคอมมอนส์แบบแสดงที่มา-อนุญาตแบบเดียวกัน 4.0 Creative Commons Attribution-ShareAlike 4.0 International License
- คลังคำและข้อมูลอื่นๆ ที่อาจแจกจ่ายไปพร้อมกับแพคเกจ PyThaiNLP อาจใช้สัญญาอนุญาตอื่น โปรดดูเอกสาร Corpus License
ออกแบบโดยคุณ วรุตม์ พสุธาดล จากการประกวดที่ https://www.facebook.com/groups/408004796247683/permalink/475864542795041/ และ https://www.facebook.com/groups/408004796247683/permalink/474262752955220/
คุณสามารถร่วมพัฒนาโครงการนี้ได้ โดยการ fork และส่ง pull request กลับมา