🧩 All core Thai NLP in one model, on a CPU, free
On PyPI since 1 December 2026 · latest version 0.2.2 (a new NER model), 2 December 2026

26.5M parameters31 MBCPU only, no GPUCommercial use allowedCode Apache-2.0 · model CC BY-SA 4.0
Sound familiar? You are building search, a chatbot or information extraction over Thai text, and you have to chain several tools: one splits sentences, one segments words, one tags parts of speech, one finds names. Each splits words its own way, and some need a GPU.
The OpenThai team (formerly OpenThaiGPT) releases OpenThai 2.0 NLP Core Lite (official name OpenThai2.0-NLP-Core-Lite), free for everyone: one small model that runs all the core Thai NLP tasks from raw text, on one CPU thread. Commercial use is allowed.
| OpenThai 2.0 NLP Core Lite | |
|---|---|
| What it does | Splits sentences and clauses, segments words, tags parts of speech, builds dependency and constituency trees and finds named entities, from raw text, in one model |
| Words | Three units: long (compounds), short (the default) and minimal (morphemes) |
| POS tags | UD with 17 tags, or 37 tags based on ORCHID |
| Trees | UD dependency trees and Penn Treebank–style constituency trees |
| Named entities | The 16 types of ThaiNER |
| Size | 26.5M parameters in 31 MB of int8 model files |
| Speed | One CPU thread, one line per call: about 25,000 characters per second for sentences, 20,000 for POS tags, 18,000 for named entities and 8,900 for dependency trees |
| Needs | Python 3.10 or later, ONNX Runtime and NumPy. No GPU; runs offline |
| Licence | Code Apache-2.0, model files CC BY-SA 4.0, commercial use allowed |
Highlights
- One network instead of a chain of tools. All tasks share one network and read the same words, so there is no pipeline of tools that disagree on where words end.
- Text without spaces. It finds sentence ends in running Thai text and in speech transcripts, where spaces are missing.
- Fast on a CPU. 14 to 69 times as fast as the best other tool of each task, on one CPU thread.
- Small. 26.5M parameters; the best systems of the five tasks it is compared on hold 957M between them.
- Commercial use. Trained only on data whose licences allow commercial use.
- Your own words. Names or terms the dictionary lacks can be passed as hints, and they reach every task.
Examples
As the model gives them:
| Task | Output |
|---|---|
Words, long | เจ้าหน้าที่ | การศึกษา | เปิดเผย | ว่า |
Words, short (default) | เจ้า | หน้าที่ | การ | ศึกษา | เปิด | เผย | ว่า |
Words, minimal | เจ้า | หน้า | ที่ | การ | ศึกษา | เปิด | เผย | ว่า |
| Sentences | ร้านนี้อาหารอร่อยแต่ราคาค่อนข้างแพง ‖ ครั้งหน้าจะลองสั่งเมนูอื่นดู |
| Clauses | ร้านนี้อาหารอร่อย ‖ แต่ราคาค่อนข้างแพง ‖ ครั้งหน้าจะลองสั่งเมนูอื่นดู |
| POS, UD | นักเรียน NOUN · อ่าน VERB · หนังสือ NOUN · ใน ADP · ห้องสมุด NOUN |
| POS, ORCHID-based | นักเรียน NCMN · อ่าน VTRA · หนังสือ NCMN · ใน RPRE · ห้องสมุด NCMN |
| Dependencies | อ่าน is the root, over นักเรียน (nsubj), หนังสือ (obj) and ห้องสมุด (obl); ใน hangs on ห้องสมุด (case) |
| Constituency | (S (NP (NCMN นักเรียน)) (VP (VTRA อ่าน) (NP (NCMN หนังสือ)) (PP (RPRE ใน) (NP (NCMN ห้องสมุด))))) |
| Named entities | กรมอุตุนิยมวิทยา ORGANIZATION · จังหวัดเชียงใหม่ LOCATION · 3 ธันวาคม 2569 DATE, in กรมอุตุนิยมวิทยาประกาศเตือนฝนตกหนักในจังหวัดเชียงใหม่ตั้งแต่วันที่ 3 ธันวาคม 2569 |
Results
NLP Core against the state-of-the-art (SOTA) system of each task, the best tool from other authors, on raw text. Each system gets what NLP Core gets (higher is better).
| Task | Score and test data | SOTA system | SOTA size | SOTA | NLP Core | Speed |
|---|---|---|---|---|---|---|
| Sentences | boundary F1, 12 sets | SaT-12l-sm, tuned | 277M | 77.5 | 78.6† | 14× |
| Clauses | boundary F1, 3 treebanks | HoogBERTa | 143M | 30.0* | 70.8 | 25× |
| Words | word F1, 7 sets | SEFR CUT-best | 0.54M | 84.5 | 85.7† | 20× |
| POS tags | UPOS F1, 3 treebanks | Stanza 1.15 accurate | 179M | 73.1 | 74.7† | 69× |
| Dependency trees | LAS F1, 3 treebanks | Stanza 1.15 accurate | 259M | 49.8 | 52.8† | 59× |
| Constituency trees | bracket F1, TUD | Stanza 1.15 accurate | 259M | 78.6* | 79.4 | 58× |
| Named entities | entity F1, ThaiNER | phayathaibert-thainer | 277M | 85.7 | 84.7 | 19× |
How to read it: bold marks the higher score, † a lead beyond the 95% interval of a paired bootstrap (a higher score without † is a tie), and * the closest tool where no SOTA system exists. In plain words: a clear lead on four tasks (sentences, words, POS tags and dependency trees), level on two (constituency trees and named entities). Clauses cannot be compared directly: HoogBERTa cuts another unit and can end a clause only at a space.
- Test data. Scores over several sets are means. The 12 sentence sets are four sets, each as written, without spaces and as speech transcripts; the three treebanks are UD Thai-TUD, PUD and TDT.
- Speed and size. Speed is how many times as fast NLP Core runs, on one CPU core and one line per call. Size is the number of parameters. The five SOTA systems hold 957M in all, and NLP Core 26.5M. Stanza 1.15 accurate gives the POS tags and both kinds of tree; it reaches constituency trees by converting its dependency trees.
- Sentences. The threshold of SaT-12l-sm is chosen on the same development sets as that of NLP Core (at its default, SaT scores 74.6). On text as written the two are level; NLP Core leads without spaces by 2.0 and on speech-like text by 1.9.
- Tags and trees. Each system gets one sentence and finds its own words, and Stanza runs with its sentence splitter off. On TUD alone, NLP Core has 83.8 UPOS F1 against 83.1 and 67.2 LAS F1 against 65.5. Given the gold words of TUD, it has 92.0 UPOS accuracy against 91.4, 78.8 LAS against 76.3 and 80.2 bracket F1 against 79.6.
- Named entities. phayathaibert-thainer learnt from ThaiNER train, while NLP Core learnt from no ThaiNER text. On the 1,385 test texts that share no text with ThaiNER train, the two are level (84.8 against 85.4). They are level on all texts too.
- Single sets where another system leads. At gold words, Stanza 1.11 accurate tags PUD better (78.4 against 77.8), and Stanza 1.15 default tags TDT better (80.0 against 79.3). On the older TUD release of the TUD paper, the models trained on its own split lead. Systems trained on a test set are not counted.
- Where the scores come from. The word scores come from OpenThai2.0-WordSeg-Benchmark 1.0. The named entities are scored on the test split of ThaiNER v2.2, on character spans. Every system, test set and interval of the other tasks is in OpenThai2.0-NLP-Core-Benchmark, which is not public yet.
How to use it
pip install "iapp-ai[nlp]"
One call runs every task and returns one document:
from iapp_ai.nlp import core
doc = core.analyze("นักเรียนอ่านหนังสือในห้องสมุด")
for w in doc.sentences[0].words:
print(w.id, w.text, w.upos, w.head, w.deprel)
# 1 นักเรียน NOUN 2 nsubj
# 2 อ่าน VERB 0 root
# 3 หนังสือ NOUN 2 obj
# 4 ใน ADP 5 case
# 5 ห้องสมุด NOUN 2 obl
doc.sentences[0].tree # (S (NP (NCMN นักเรียน)) (VP (VTRA อ่าน) (NP (NCMN หนังสือ)) (PP (RPRE ใน) (NP (NCMN ห้องสมุด)))))
core.analyze("กรมอุตุนิยมวิทยาประกาศเตือนฝนตกหนักในจังหวัดเชียงใหม่", tasks=["ner"]).entities
# [Entity(text='กรมอุตุนิยมวิทยา', label='ORGANIZATION', start=0, end=16),
# Entity(text='จังหวัดเชียงใหม่', label='LOCATION', start=37, end=53)]
Or one function per task:
from iapp_ai.nlp import core
core.tokenize("เจ้าหน้าที่การศึกษาเปิดเผยว่า") # ['เจ้า', 'หน้าที่', 'การ', 'ศึกษา', 'เปิด', 'เผย', 'ว่า']
core.tokenize("เจ้าหน้าที่การศึกษาเปิดเผยว่า", unit="long") # ['เจ้าหน้าที่', 'การศึกษา', 'เปิดเผย', 'ว่า']
core.sent_tokenize("ร้านนี้อาหารอร่อยแต่ราคาค่อนข้างแพงครั้งหน้าจะลองสั่งเมนูอื่นดู")
# ['ร้านนี้อาหารอร่อยแต่ราคาค่อนข้างแพง', 'ครั้งหน้าจะลองสั่งเมนูอื่นดู']
core.pos_tag("นักเรียนอ่านหนังสือในห้องสมุด")
# [('นักเรียน', 'NOUN'), ('อ่าน', 'VERB'), ('หนังสือ', 'NOUN'), ('ใน', 'ADP'), ('ห้องสมุด', 'NOUN')]
Your own words (in the model package alone, the argument is user_words):
from iapp_ai.nlp import NLPCore
nlp = NLPCore(extra_words=["ไอโอที", "ดิจิทัลทวิน"])
nlp.tokenize("โรงงานใช้ระบบไอโอทีกับดิจิทัลทวิน", unit="long")
# ['โรงงาน', 'ใช้', 'ระบบ', 'ไอโอที', 'กับ', 'ดิจิทัลทวิน'] (without them: ไอโอ | ที, ดิจิทัล | ทวิน)
- The model package alone:
pip install openthai2.0-nlp-core-lite, with the same functions inopenthai_nlp_core_lite. It needs only NumPy and ONNX Runtime. - All functions:
analyze,tokenize,word_tokenize,sent_tokenize,clause_tokenize,pos_tag(text, tagset="ud" or "orchid"),dependency_parse,constituency_parseandner, plusanalyze_batch,tokenize_batchandner_batch.tokenize_nbest(text, n=3)gives the n most probable segmentations. - Saving results:
doc.to_dict()for JSON,doc.to_conllu()for CoNLL-U. - More threads:
NLPCore(threads=4). - Command line:
openthai-nlp-core-lite --task all < input.txt(one JSON object per line), or--task ner,--format conllu.
Training data
Its teachers learnt from UD Thai-TUD, scb-mt-en-th-2020, Tatoeba, VISTEC-TP-TH-2021, Wisesight-1000 and the CC BY-SA rows of the khammoon data. Its sentence and clause head also learnt the training articles of ALT (NICT, CC BY 4.0). The model also read unlabelled text from FineWeb-2, Thai Wikipedia and Wisesight. Its named entities come from our own labels on that text and on Blognone news, written by Qwen3.8-27B (Apache-2.0) and by a teacher trained on them.
No ThaiNER, BEST, ORCHID, LST20 or other non-commercial data were used, and the training text was filtered against every test set above. Sources, licences and attributions are in the NOTICE inside the package.
⚠️ Being honest: what it is not good at yet
- Named entities are not a win. NLP Core is level with phayathaibert-thainer (84.7 against 85.7), which learnt from ThaiNER itself.
- Rare entity types are weak. On ThaiNER test: FACILITY 46.4 and URL 51.7, against PERSON 94.0 and ORGANIZATION 85.6.
- POS follows UD Thai-TUD, which tags many state words VERB where a dictionary has ADJ (Thai corpora disagree on what a word is).
- Constituency trees have phrase labels and word tags, but no function tags (-SBJ) and no empty elements. They were learnt from trees converted from TUD dependency trees.
- Parsing reads one sentence at a time. A long paragraph without a sentence end inside parses slowly.
- int8 results can change in the last digits with the number of threads, or with the other texts of one
ner_batchcall, which can flip a borderline decision.
👨👩👧 The OpenThai 2.0 family
| Model | What it does | Size | Status |
|---|---|---|---|
| OpenThai 2.0 | Thai chat and reasoning LLM that reads images | 27B | Released |
| OpenThai 2.0 Legal | Thai legal model for RAG | 30B-A3B | Released |
| OpenThai-SystemOne | Thai+English decision model (no text generation) | 0.8B | Released |
| OpenThai 2.2 OCR Markdown | Document pages to Markdown, tables stay tables | 0.6B | Updated 27 Nov |
| OpenThai 2.2 OCR Text | Printed-text OCR on a CPU | 8 MB | Updated 27 Nov |
| OpenThai 2.0 ASR Streaming | Live Thai speech to text | 0.64B | Released |
| OpenThai 2.0 NLP Core Lite | All core Thai NLP tasks in one model, on a CPU | 26.5M | Released |
🤝 Get involved
- Found a sentence it splits, tags or names wrongly (with no personal data in it)? Send it to the team.
- Join the conversation on Discord and in the Facebook group.
📄 Licence and credits
- Code: Apache-2.0.
- Model files: CC BY-SA 4.0, commercial use allowed. Part of the dictionary is under the Unicode licence. All licence texts and the NOTICE are inside the package.
- Thanks to the owners of every dataset it learnt from: UD Thai-TUD, scb-mt-en-th-2020, Tatoeba, VISTEC-TP-TH-2021, Wisesight, khammoon, ALT (NICT), FineWeb-2, Thai Wikipedia and Blognone.
Developed by iApp, launched with AIEAT.