66[ ![ Python 3.9] ( https://img.shields.io/badge/python-3.9-blue.svg )] ( https://www.python.org/downloads/ )
77[ ![ License] ( https://img.shields.io/badge/License-Apache%202.0-blue.svg )] ( https://opensource.org/licenses/Apache-2.0 )
88[ ![ DOI] ( https://zenodo.org/badge/DOI/10.5281/zenodo.3519354.svg )] ( https://doi.org/10.5281/zenodo.3519354 )
9-
109[ ![ Project Status: Active] ( https://www.repostatus.org/badges/latest/active.svg )] ( https://www.repostatus.org/#active )
1110[ ![ Codacy Grade] ( https://app.codacy.com/project/badge/Grade/5821a0de122041c79999bbb280230ffb )] ( https://www.codacy.com/gh/PyThaiNLP/pythainlp/dashboard?utm_source=github.com& ; utm_medium=referral& ; utm_content=PyThaiNLP/pythainlp& ; utm_campaign=Badge_Grade )
1211[ ![ Coverage Status] ( https://coveralls.io/repos/github/PyThaiNLP/pythainlp/badge.svg?branch=dev )] ( https://coveralls.io/github/PyThaiNLP/pythainlp?branch=dev )
13-
1412[ ![ Google Colab Badge] ( https://badgen.net/badge/Launch%20Quick%20Start%20Guide/on%20Google%20Colab/blue?icon=terminal )] ( https://colab.research.google.com/github/PyThaiNLP/tutorials/blob/master/source/notebooks/pythainlp_get_started.ipynb )
13+ [ ![ Facebook] ( https://img.shields.io/badge/Facebook-%231877F2.svg )] ( https://www.facebook.com/pythainlp/ )
1514[ ![ Chat on Matrix] ( https://matrix.to/img/matrix-badge.svg )] ( https://matrix.to/#/#thainlp:matrix.org )
1615
17- PyThaiNLP is a Python package for text processing and linguistic analysis,
18- similar to [ NLTK] ( https://www.nltk.org/ ) with a focus on Thai language.
16+ [ pythainlp.org] ( https://pythainlp.org/ ) |
17+ [ Tutorials] ( https://pythainlp.org/tutorials ) |
18+ [ License info] ( https://pythainlp.org/dev-docs/notes/license.html ) |
19+ [ Model cards] ( https://github.com/PyThaiNLP/pythainlp/wiki/Model-Cards ) |
20+ [ Adopters] ( https://github.com/PyThaiNLP/pythainlp/blob/dev/INTHEWILD.md ) |
21+ * [ เอกสารภาษาไทย] ( https://github.com/PyThaiNLP/pythainlp/blob/dev/README_TH.md ) *
1922
20- PyThaiNLP เป็นไลบารีภาษาไพทอนสำหรับประมวลผลภาษาธรรมชาติ คล้ายกับ NLTK โดยเน้นภาษาไทย
21- [ ดูรายละเอียดภาษาไทยได้ที่ README_TH.MD ] ( https://github.com/ PyThaiNLP/pythainlp/blob/dev/README_TH.md )
22-
23- ## Quick install
23+ Designed to be a Thai-focused counterpart to [ NLTK ] ( https://www.nltk.org/ ) ,
24+ ** PyThaiNLP** provides standard tools for linguistic analysis under
25+ an Apache-2.0 source license, with its data and models covered by CC0-1.0
26+ and CC-BY-4.0.
2427
2528``` sh
2629pip install pythainlp
2730```
2831
29- | Version | Description | Status |
30- | :------:| :--:| :------:|
31- | [ 5.2.0] ( https://github.com/PyThaiNLP/pythainlp/releases ) | Stable | [ Change Log] ( https://github.com/PyThaiNLP/pythainlp/issues/1080 ) |
32- | [ ` dev ` ] ( https://github.com/PyThaiNLP/pythainlp/tree/dev ) | Release Candidate for 5.3 | [ Change Log] ( https://github.com/PyThaiNLP/pythainlp/issues/1169 ) |
33-
34- ## Getting Started
35-
36- - PyThaiNLP requires Python 3.9+.
37- - Python 2.7 users can use PyThaiNLP 1.6. See [ 2.0 change log] ( https://github.com/PyThaiNLP/pythainlp/issues/118 ) | [ Upgrading from 1.7] ( https://pythainlp.org/docs/2.0/notes/pythainlp-1_7-2_0.html ) | [ Upgrading ThaiNER from 1.7] ( https://github.com/PyThaiNLP/pythainlp/wiki/Upgrade-ThaiNER-from-PyThaiNLP-1.7-to-PyThaiNLP-2.0 )
38- - [ PyThaiNLP Get Started notebook] ( https://pythainlp.org/tutorials/notebooks/pythainlp_get_started.html ) | [ API document] ( https://pythainlp.org/docs ) | [ Tutorials] ( https://pythainlp.org/tutorials )
39- - [ Official website] ( https://pythainlp.org/ ) | [ PyPI] ( https://pypi.org/project/pythainlp/ ) | [ Facebook page] ( https://www.facebook.com/pythainlp/ )
40- - [ Who uses PyThaiNLP?] ( https://github.com/PyThaiNLP/pythainlp/blob/dev/INTHEWILD.md )
41- - [ Model cards] ( https://github.com/PyThaiNLP/pythainlp/wiki/Model-Cards ) - for technical details, caveats, and ethical considerations of the models developed and used in PyThaiNLP
42-
43- ## Capabilities
44-
45- PyThaiNLP provides standard linguistic analysis for Thai language and standard Thai locale utility functions.
46- Some of these functions are also available via the command-line interface (run ` thainlp ` in your shell).
47-
48- Partial list of features:
32+ | Version | Python version | Changes | Documentation |
33+ | :-------:| :--------------:| :-------:| :-------------:|
34+ | [ 5.2.0] ( https://github.com/PyThaiNLP/pythainlp/releases ) | 3.7+ | [ Log] ( https://github.com/PyThaiNLP/pythainlp/issues/1080 ) | [ pythainlp.org/docs] ( https://pythainlp.org/docs ) |
35+ | [ ` dev ` ] ( https://github.com/PyThaiNLP/pythainlp/tree/dev ) | 3.9+ | [ Log] ( https://github.com/PyThaiNLP/pythainlp/issues/1169 ) | [ pythainlp.org/dev-docs] ( https://pythainlp.org/dev-docs/ ) |
4936
50- - 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 `
51- - Linguistic unit segmentation at different levels: sentence (` sent_tokenize ` ), word (` word_tokenize ` ), and subword (` subword_tokenize ` )
52- - Part-of-speech tagging (` pos_tag ` )
53- - Spelling suggestion and correction (` spell ` and ` correct ` )
54- - Phonetic algorithm and transliteration (` soundex ` and ` transliterate ` )
55- - Collation (sorted by dictionary order) (` collate ` )
56- - Number read out (` num_to_thaiword ` and ` bahttext ` )
57- - Datetime formatting (` thai_strftime ` )
58- - Thai-English keyboard misswitched fix (` eng_to_thai ` , ` thai_to_eng ` )
37+ ## Features
5938
60- ## Installation
39+ - ** Linguistic units:** Sentence, word, and subword segmentation
40+ (` sent_tokenize ` , ` word_tokenize ` , ` subword_tokenize ` ).
41+ - ** Tagging:** Part-of-speech tagging (` pos_tag ` ).
42+ - ** Transliteration:** Romanization (` transliterate ` ) and IPA conversion.
43+ - ** Correction:** Spelling suggestion and correction (` spell ` , ` correct ` ).
44+ - ** Utilities:** Soundex, collation, number-to-text (` bahttext ` ), datetime
45+ formatting (` thai_strftime ` ), and keyboard layout correction.
46+ - ** Data:** Built-in Thai character sets, word lists, and stop words.
47+ - ** CLI:** Command-line interface via ` thainlp ` .
6148
62- ``` sh
63- pip install --upgrade pythainlp
64- ```
65-
66- This will install the latest stable release of PyThaiNLP.
67-
68- Install different releases:
49+ ``` sh
50+ thainlp data catalog # List datasets
51+ thainlp help # Show usage
52+ ```
6953
70- - Stable release: ` pip install --upgrade pythainlp `
71- - Pre-release (nearly ready): ` pip install --upgrade --pre pythainlp `
72- - Development (likely to break things): ` pip install https://github.com/PyThaiNLP/pythainlp/archive/dev.zip `
54+ ## Installation options
7355
74- ### Installation Options
75-
76- Some functionalities, like Thai WordNet, may require extra packages.
77- To install those requirements,
78- specify a set of ` [name] ` immediately after ` pythainlp ` :
56+ To install with specific extras (e.g., ` translate ` , ` wordnet ` , ` full ` ):
7957
8058``` sh
8159pip install " pythainlp[extra1,extra2,...]"
@@ -96,63 +74,23 @@ For dependency details,
9674look at the ` [project.optional-dependencies] ` section in
9775[ ` pyproject.toml ` ] ( https://github.com/PyThaiNLP/pythainlp/blob/dev/pyproject.toml ) .
9876
99- ## Data Directory
100-
101- - Some additional data, like word lists and language models,
102- may be automatically downloaded during runtime.
103- - PyThaiNLP caches these data under the directory ` ~/pythainlp-data `
104- by default.
105- - The data directory can be changed by specifying the environment variable
106- ` PYTHAINLP_DATA_DIR ` .
107- - See the data catalog (` db.json ` ) at
108- < https://github.com/PyThaiNLP/pythainlp-corpus >
77+ ## Data directory
10978
110- ### Using PyThaiNLP in Distributed Environments
79+ PyThaiNLP downloads data (see the data catalog ` db.json ` at
80+ [ pythainlp-corpus] ( https://github.com/PyThaiNLP/pythainlp-corpus ) )
81+ to ` ~/pythainlp-data ` by default.
82+ Set the ` PYTHAINLP_DATA_DIR ` environment variable to override this location.
11183
11284When using PyThaiNLP in distributed computing environments
11385(e.g., Apache Spark), set the ` PYTHAINLP_DATA_DIR ` environment variable
114- inside the function that will be distributed to worker nodes:
115-
116- ``` python
117- def tokenize_thai (text ):
118- import os
119- os.environ[' PYTHAINLP_DATA_DIR' ] = ' ./pythainlp-data'
120- from pythainlp.tokenize import word_tokenize
121- return word_tokenize(text)
122-
123- rdd.map(tokenize_thai)
124- ```
125-
126- This ensures each worker uses a local writable directory.
127- See ` examples/distributed_pyspark.py ` for more examples.
128-
129- ## Command-Line Interface
130-
131- Some of PyThaiNLP functionalities can be used via command line
132- with the ` thainlp ` command.
133-
134- For example, to display a catalog of datasets:
135-
136- ``` sh
137- thainlp data catalog
138- ```
139-
140- To show how to use:
141-
142- ``` sh
143- thainlp help
144- ```
86+ inside the function that will be distributed to worker nodes.
87+ See details in
88+ [ the documentation] ( https://pythainlp.org/dev-docs/notes/installation.html ) .
14589
14690## Testing and test suites
14791
14892We test core functionalities on all officially supported Python versions.
14993
150- Some functionality requiring extra dependencies may be tested less frequently
151- due to potential version conflicts or incompatibilities between packages.
152-
153- Test cases are categorized into three groups: core, compact, and extra.
154- You can find these tests in the [ tests/] ( /tests/ ) directory.
155-
15694For more detailed information on testing, please refer to the tests README:
15795[ tests/README.md] ( ./tests/README.md )
15896
@@ -167,13 +105,9 @@ For more detailed information on testing, please refer to the tests README:
167105
168106## Contribute to PyThaiNLP
169107
170- - Please fork and create a pull request :)
171- - For style guides and other information, including references to algorithms we use,
172- please refer to our [ contributing] ( https://github.com/PyThaiNLP/pythainlp/blob/dev/CONTRIBUTING.md ) page.
173-
174- ## Who uses PyThaiNLP?
175-
176- You can read [ INTHEWILD.md] ( https://github.com/PyThaiNLP/pythainlp/blob/dev/INTHEWILD.md ) .
108+ Please fork and create a pull request.
109+ See [ CONTRIBUTING.md] ( https://github.com/PyThaiNLP/pythainlp/blob/dev/CONTRIBUTING.md )
110+ for guidelines and algorithm references.
177111
178112## Citations
179113
0 commit comments