Dependency-parser for Thai language
Project Links
Meta
Author: Koichi Yasuoka
Requires Python: >=3.6
Classifiers
License
- OSI Approved :: MIT License
Programming Language
- Python :: 3
Operating System
- POSIX :: Linux
Topic
- Text Processing :: Linguistic
Natural Language
- Thai
spaCy-Thai
Tokenizer, POS-tagger, and dependency-parser for Thai language, working on Universal Dependencies.
Basic Usage
>>> import spacy_thai
>>> nlp=spacy_thai.load()
>>> doc=nlp("แผนกนี้กำลังเผชิญกับความท้าทายใหม่")
>>> for t in doc:
... print("\t".join([str(t.i+1),t.orth_,t.lemma_,t.pos_,t.tag_,"_",str(0 if t.head==t else t.head.i+1),t.dep_,"_","_" if t.whitespace_ else "SpaceAfter=No"]))
...
1 แผนก แผนก NOUN NCMN _ 4 nsubj _ SpaceAfter=No
2 นี้ นี้ DET DDAC _ 1 det _ SpaceAfter=No
3 กำลัง กำลัง AUX XVBM _ 4 aux _ SpaceAfter=No
4 เผชิญ เผชิญ VERB VSTA _ 0 ROOT _ SpaceAfter=No
5 กับ กับ ADP RPRE _ 6 case _ SpaceAfter=No
6 ความ ความ PART FIXN _ 4 obl _ SpaceAfter=No
7 ท้าทาย ท้าทาย VERB VACT _ 6 acl _ SpaceAfter=No
8 ใหม่ ใหม่ ADV ADVN _ 7 advmod _ SpaceAfter=No
>>> import deplacy
>>> deplacy.render(doc,WordRight=True)
nsubj ╔════════>╔═ NOUN แผนก
det ║ ╚> DET นี้
aux ║ ╔════════> AUX กำลัง
ROOT ╚═╚═╔═══════ VERB เผชิญ
case ║ ╔════> ADP กับ
obl ╚>╚═╔═══ PART ความ
acl ╚>╔═ VERB ท้าทาย
advmod ╚> ADV ใหม่
Installation for Linux
pip3 install spacy_thai --user
Installation for Cygwin
Make sure to get python37-devel
python37-pip
python37-numpy
python37-cython
gcc-g++
, and then:
pip3.7 install spacy_thai
Installation for Google Colaboratory
!pip install spacy_thai
Try notebook.
Nov 20, 2024
0.7.8
Oct 24, 2024
0.7.7
May 21, 2024
0.7.6
May 20, 2024
0.7.5
May 19, 2024
0.7.4
Dec 13, 2022
0.7.3
Dec 12, 2022
0.7.2
Apr 12, 2022
0.7.1
Mar 14, 2022
0.7.0
Feb 22, 2022
0.6.9
Feb 16, 2022
0.6.8
Oct 18, 2021
0.6.7
Sep 01, 2021
0.6.6
Jul 21, 2021
0.6.5
May 03, 2021
0.6.4
Apr 05, 2021
0.6.3
Mar 13, 2021
0.6.2
Jan 05, 2021
0.6.1
Nov 23, 2020
0.6.0
Nov 22, 2020
0.5.2
Nov 07, 2020
0.5.1
Oct 19, 2020
0.5.0
Sep 28, 2020
0.4.8
Sep 28, 2020
0.4.7
Sep 27, 2020
0.4.6
Sep 27, 2020
0.4.5
Sep 27, 2020
0.4.4
Sep 27, 2020
0.4.3
Sep 26, 2020
0.4.2
Sep 26, 2020
0.4.1
Sep 26, 2020
0.4.0
Sep 26, 2020
0.3.0
Sep 26, 2020
0.2.0
Sep 26, 2020
0.1.0
Wheel compatibility matrix
Files in release
Extras:
None
Dependencies:
(>=2.1.0)
deplacy
(>=2.3.2)
pythainlp
(>=2.2.2)
spacy
(>=1.2.0)
ufal.udpipe