Giter Site home page Giter Site logo

fotopretty / pythainlp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pythainlp/pythainlp

0.0 1.0 0.0 34.81 MB

Thai Natural Language Processing in Python.

Home Page: https://pythainlp.github.io/

License: Apache License 2.0

Python 99.48% Makefile 0.50% Batchfile 0.01%

pythainlp's Introduction

PyThaiNLP Logo

PyThaiNLP: Thai Natural Language Processing in Python

Python 3.6 pypi Downloads License FOSSA Status Build Status Build status Codacy Badge Coverage Status Google Colab Badge DOI

PyThaiNLP is a Python package for text processing and linguistic analysis, similar to nltk but with focus on Thai language.

PyThaiNLP เป็นไลบารีภาษาไพทอนสำหรับประมวลผลภาษาธรรมชาติ โดยเน้นภาษาไทย ดูรายละเอียดภาษาไทยเพิ่มเติมด้านล่าง

News

We are conducting a 2-minute survey to know more about your experience using the library and your expectations regarding what the library should be able to do. Take part in this survey: https://forms.gle/aLdSHnvkNuK5CFyt9

Using PyThaiNLP:

Capabilities

  • Convenient character and word classes, like Thai consonants (pythainlp.thai_consonants), vowels (pythainlp.thai_vowels), digits (pythainlp.thai_digits), and stop words (pythainlp.corpus.thai_stopwords) -- comparable to constants like string.letters, string.digits, and string.punctuation
  • Thai word segmentation (word_tokenize), including subword segmentation based on Thai Character Cluster (subword_tokenize)
  • Thai transliteration (transliterate)
  • 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 spelling suggestion and correction (spell and correct)
  • Thai soundex (soundex) with three engines (lk82, udom83, metasound)
  • and much more - see examples in tutorials.

Installation

PyThaiNLP uses PyPI as its main distribution channel, see https://pypi.org/project/pythainlp/

Stable release

pip install pythainlp

Development pre-release

pip install --upgrade --pre pythainlp

Fresh from dev branch

pip install https://github.com/PyThaiNLP/pythainlp/archive/dev.zip

Install options

For some functionalities, like named-entity recognition, extra packages may be needed. Install them with these install options:

pip install pythainlp[extra1,extra2,...]

where extras can be

  • attacut (to support attacut, a fast and accurate tokenizer)
  • benchmarks (for word tokenization benchmarking)
  • icu (for ICU, International Components for Unicode, support in transliteration and tokenization)
  • ipa (for IPA, International Phonetic Alphabet, support in transliteration)
  • ml (to support ULMFiT models for classification)
  • ner (for named-entity recognizer)
  • thai2fit (for Thai word vector)
  • thai2rom (for machine-learnt romanization)
  • full (install everything)

For dependency details, look at extras variable in setup.py.

Python 2 Users

Contribute to PyThaiNLP

Made with ❤️
PyThaiNLP Team
"We build Thai NLP"

ภาษาไทย

PyThaiNLP เป็นไลบารีภาษาไพทอนสำหรับประมวลผลภาษาธรรมชาติ โดยเน้นภาษาไทย แจกจ่ายฟรี (ตลอดไป) เพื่อคนไทยและชาวโลกทุกคน!

เพราะโลกขับเคลื่อนต่อไปด้วยการแบ่งปัน

ข่าวสาร

สวัสดีค่ะ ทีมพัฒนา PyThaiNLP ขอสอบถามความคิดเห็นของผู้ใช้งาน PyThaiNLP หรือผู้ที่ทำงานในด้านการประมวลผลภาษาไทย เพื่อนำข้อมูลไปปรับปรุงและพัฒนาฟีเจอร์ใหม่ๆ ให้ตรงกับความต้องการใช้งานมากขึ้น สามารถตอบแบบสอบถามได้ที่ https://forms.gle/aLdSHnvkNuK5CFyt9 (ใช้เวลาประมาณ 2-5 นาที)

  • รุ่นเสถียรล่าสุดคือรุ่น 2.1.4
  • PyThaiNLP 2 รองรับ Python 3.6 ขึ้นไป
    • ผู้ใช้ Python 2.7+ ยังสามารถใช้ PyThaiNLP 1.6 ได้
  • 📫 ติดตามข่าวสารได้ที่ Facebook PyThaiNLP

ใช้งาน PyThaiNLP:

  • เริ่มต้นใช้งาน PyThaiNLP
  • สอนการใช้งานเพิ่มเติม ในรูปแบบ notebook https://www.thainlp.org/pythainlp/tutorials/
  • เอกสารตัวเต็ม https://thainlp.org/pythainlp/docs/2.1/
  • ระหว่างการทำงาน PyThaiNLP อาจดาวน์โหลดข้อมูลเพิ่มเติม เช่น ตัวแบบภาษา และรายการคำ ข้อมูลเหล่านี้จะถูกเก็บไว้ที่ไดเรกทอรี ~/pythainlp-data เป็นตำแหน่งมาตรฐาน
    • ตำแหน่งเก็บข้อมูลนี้สามารถกำหนดเองได้ โดยการเปลี่ยนแปลงตัวแปรสิ่งแวดล้อม PYTHAINLP_DATA_DIR ของระบบปฏิบัติการ

ความสามารถ

  • ชุดค่าคงที่ตัวอักษระและคำไทยที่เรียกใช้ได้สะดวก เช่น พยัญชนะ (pythainlp.thai_consonants), สระ (pythainlp.thai_vowels), ตัวเลขไทย (pythainlp.thai_digits), และ stop word (pythainlp.corpus.thai_stopwords) -- เหมือนกับค่าคงที่อย่าง string.letters, string.digits, และ string.punctuation
  • ตัดคำภาษาไทย (word_tokenize) และรองรับการตัดระดับต่ำกว่าคำโดยใช้ Thai Character Clusters (subword_tokenize)
  • ถอดเสียงภาษาไทยเป็นอักษรละตินและสัทอักษร (transliterate)
  • ระบุชนิดคำ (part-of-speech) ภาษาไทย (pos_tag)
  • อ่านตัวเลขเป็นข้อความภาษาไทย (bahttext, num_to_thaiword)
  • เรียงลำดับคำตามพจนานุกรมไทย (collate)
  • แก้ไขปัญหาการพิมพ์ลืมเปลี่ยนภาษา (eng_to_thai, thai_to_eng)
  • ตรวจคำสะกดผิดในภาษาไทย (spell, correct)
  • soundex ภาษาไทย (soundex) 3 วิธีการ (lk82, udom83, metasound)
  • และอื่น ๆ ดูตัวอย่างได้ใน tutorials สอนวิธีใช้งาน

ติดตั้ง

รุ่นเสถียร

pip install pythainlp

รุ่นก่อนเผยแพร่ (pre-release)

pip install --upgrade --pre pythainlp

รุ่นกำลังพัฒนา (dev branch)

pip install https://github.com/PyThaiNLP/pythainlp/archive/dev.zip

การติดตั้งความสามารถเพิ่มเติม

สำหรับความสามารถบางอย่าง เช่น การชื่อเฉพาะ (named-entity) จำเป็นต้องติดตั้งแพคเกจเสริม ด้วยการระบุออปชันตอน pip install:

pip install pythainlp[extra1,extra2,...]

โดยที่ extras คือ

  • attacut (ตัวตัดคำที่แม่นกว่า newmm เมื่อเทียบกับชุดข้อมูล BEST)
  • benchmarks (สำหรับเครื่องมือวัดความแม่นยำของตัวตัดคำ)
  • icu (สำหรับการถอดตัวสะกดเป็นสัทอักษรและการตัดคำด้วย ICU)
  • ipa (สำหรับการถอดตัวสะกดเป็นสัทอักษรสากล (IPA))
  • ml (สำหรับการรองรับโมเดล ULMFiT)
  • ner (สำหรับการติดป้ายชื่อเฉพาะ (named-entity))
  • thai2fit (สำหรับ word vector)
  • thai2rom (สำหรับการถอดตัวสะกดเป็นอักษรละติน)
  • full (ติดตั้งทุกอย่าง)

รายละเอียดของแพคเกจเสริมดูได้ในตัวแปรชื่อ extras ใน setup.py

สนับสนุนและร่วมพัฒนา

  • คุณสามารถร่วมพัฒนาโครงการนี้ได้ โดยการ fork และส่ง pull request กลับมา
  • โค้ด PyThaiNLP ใช้สัญญาอนุญาต Apache Software License 2.0
  • คลังคำและข้อมูลที่สร้างโดยโครงการ PyThaiNLP ใช้สัญญาอนุญาตครีเอทีฟคอมมอนส์แบบแสดงที่มา-อนุญาตแบบเดียวกัน 4.0 Creative Commons Attribution-ShareAlike 4.0 International License
  • คลังคำและข้อมูลอื่นๆ ที่แจกจ่ายไปพร้อมกับแพคเกจ PyThaiNLP อาจใช้สัญญาอนุญาตอื่น โปรดดูเอกสาร Corpus License
  • ตราสัญลักษณ์ออกแบบโดยคุณ วรุตม์ พสุธาดล จากการประกวดที่ในกลุ่มเฟซบุ๊ก 1 2

สร้างด้วย ❤️
ทีม PyThaiNLP
"พวกเราสร้าง Thai NLP"

pythainlp's People

Contributors

abhabongse avatar bact avatar bkktimber avatar boomsquared avatar c4n avatar codacy-badger avatar cstorm125 avatar earthpyy avatar fossabot avatar koaly avatar korakot avatar korkeatw avatar lalital avatar nonkung51 avatar nyamakawa avatar off99555 avatar p16i avatar peradon avatar petetanru avatar pontakornth avatar quantifiedcode-bot avatar smeeklai avatar wannaphong avatar wasdee avatar yanndubs avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.