Skip to content

Commit 007e644

Browse files
authored
Merge pull request #95 from PyThaiNLP/pythainlp1.6
PyThaiNLP 1.6.0.7
2 parents be331a2 + 312062f commit 007e644

File tree

8 files changed

+56
-10
lines changed

8 files changed

+56
-10
lines changed

build_pypi.bat

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
python setup.py sdist
21
python setup.py bdist_wheel

docs/pythainlp-1-6-thai.md

+49-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ engine คือ ระบบตัดคำไทย ปัจจุบัน
7575
เช่น text=u'ผมรักคุณนะครับโอเคบ่พวกเราเป็นคนไทยรักภาษาไทยภาษาบ้านเกิด'
7676
```
7777

78-
การใช้งาน
78+
**การใช้งาน**
7979

8080
```python
8181
from pythainlp.tokenize import word_tokenize
@@ -201,6 +201,54 @@ grammar : คุณ Wittawat Jitkrittum (https://github.com/wittawatj/jtcc/blob/
201201
'/คืน/ความสุข'
202202
```
203203

204+
### summarize
205+
206+
เป็นระบบสรุปเอกสารภาษาไทยแบบง่าย ๆ
207+
208+
summarize_text(text,n,engine='frequency')
209+
210+
text เป็นข้อความ
211+
n คือ จำนวนประโยคสรุป
212+
engine ที่รองรับ
213+
- frequency
214+
**การใช้งาน**
215+
216+
```python
217+
>>> from pythainlp.summarize import summarize_text
218+
>>> summarize_text(text="อาหาร หมายถึง ของแข็งหรือของเหลว ที่กินหรือดื่มเข้าสู่ร่างกายแล้ว จะทำให้เกิดพลังงานและความร้อนยเจริญเติบโต ซ่อมแซมส่วนที่สึกหรอ ควบคุมการเปลี่ยนแปลงต่างๆ ในร่างกาย ช่วยทำให้อวัยวะต่างๆ ทำงานได้อย่างปกติ อาหารจะต้องงกาย",n=1,engine='frequency')
219+
['อาหารจะต้องไม่มีพิษและไม่เกิดโทษต่อร่างกาย']
220+
```
221+
222+
### word_vector
223+
224+
```python
225+
from pythainlp.word_vector import thai2vec
226+
```
227+
228+
word_vector เป็นระบบ word vector ใน PyThaiNLP
229+
230+
ปัจจุบันนี้รองรับเฉพาะ thai2vec (https://github.com/cstorm125/thai2vec)
231+
232+
thai2vec พัฒนาโดยคุณ Charin Polpanumas
233+
234+
#### thai2vec
235+
236+
ความต้องการโมดูล
237+
238+
- gensim
239+
- numpy
240+
241+
##### API
242+
243+
- get_model() - รับข้อมูล model ในรูปแบบของ gensim
244+
- most_similar_cosmul(positive,negative)
245+
- doesnt_match(listdata)
246+
- similarity(word1,word2) - หาค่าความคล้ายกันระหว่าง 2 คำ โดยทั้งคู่เป็น str
247+
- sentence_vectorizer(ss,dim=300,use_mean=False)
248+
- about() - รายละเอียด thai2vec
249+
250+
251+
204252
### keywords
205253

206254
ใช้หา keywords จากข้อความภาษาไทย

pythainlp/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
from __future__ import absolute_import
3-
__version__ = 1.5
3+
__version__ = 1.6
44
import six
55
if six.PY3:
66
"""

pythainlp/tokenize/newmm.py

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
เcctาะ
2727
เccีtยะ
2828
เccีtย(?=[เ-ไก-ฮ]|$)
29-
เccอะ
3029
เcc็c
3130
เcิc์c
3231
เcิtc

pythainlp/tokenize/tcc.py

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
เcctาะ
1414
เccีtยะ
1515
เccีtย(?=[เ-ไก-ฮ]|$)
16-
เccอะ
1716
เcc็c
1817
เcิc์c
1918
เcิtc

pythainlp/word_vector/__init__

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# -*- coding: utf-8 -*-
2-
from __future__ import absolute_import,unicode_literals
2+
from __future__ import absolute_import,unicode_literals
3+
from .thai2vec import *

pythainlp/word_vector/thai2vec.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def download():
3131
if not os.path.exists(path):
3232
print("Download models...")
3333
from urllib import request
34-
request.urlretrieve("https://github.com/cstorm125/thai2vec/raw/master/data/thaiwiki/models/thai2vec.vec",path)
34+
request.urlretrieve("https://www.dropbox.com/s/upnbmiebkfma7oy/thai2vec.vec?dl=1",path)
3535
print("OK.")
3636
return path
3737
def get_model():
@@ -62,4 +62,4 @@ def about():
6262
6363
Development : Charin Polpanumas
6464
GitHub : https://github.com/cstorm125/thai2vec
65-
'''
65+
'''

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
'nltk>=3.2.2',
99
'future>=0.16.0',
1010
'six',
11-
'marisa_trie',
11+
'marisa_trie<=0.7.4',
1212
'requests',
1313
'dill',
1414
'pytz'
@@ -19,7 +19,7 @@
1919

2020
setup(
2121
name='pythainlp',
22-
version='1.6.0.2',
22+
version='1.6.0.7',
2323
description="Thai natural language processing in Python package.",
2424
long_description=readme,
2525
author='PyThaiNLP',

0 commit comments

Comments
 (0)