-
Notifications
You must be signed in to change notification settings - Fork 283
Closed
Labels
Hacktoberfestfor Hacktoberfest eventfor Hacktoberfest eventbugbugs in the librarybugs in the library
Milestone
Description
I tried newmm-safe engine but it gave inconsistent results. It sometimes tokenized correctly but sometimes not.
Description
Example:
"ในฐานข้อมูลกฎหมายของเว็บไซต์ ทส. ข้อมูลและทรัพยากร ข้อมูลกฎหมายว่าด้วยป่าชุมชน CSV downloads กฎหมายแม่บท และกฎหมายลำดับรอง ของพระราชบัญญัติป่าชุมชน พ.ศ. 2562..."
It can correctly tokenize "ข้อมูลกฎหมายว่าด้วยป่าชุมชน" into ['ข้อมูล', 'กฎหมาย', 'ว่าด้วย', 'ป่าชุมชน']
If I changed the input into
"ในฐานข้อมูลกฎหมายของเว็บไซต์ ทส. ข้อมูลและทรัพยากร ข้อมูลกฎหมายว่าด้วยป่าชุมชน CSV downloads กฎหมายแม่บท และกฎหมายลำดับรอง ของพระราชบัญญัติป่าชุมชน พ.ศ. 2562... สำรวจ"
It tokenizes "ข้อมูลกฎหมายว่าด้วยป่าชุมชน" into ['ข้อมูล', 'กฎ', 'หม', 'าย', 'ว่าด้วย', 'ป่าชุมชน']
Expected results
It should produce the same results for both inputs.
Steps to reproduce
from pythainlp.tokenize import word_tokenize
docs = '''ในฐานข้อมูลกฎหมายของเว็บไซต์ ทส. ข้อมูลและทรัพยากร ข้อมูลกฎหมายว่าด้วยป่าชุมชน CSV downloads กฎหมายแม่บท และกฎหมายลำดับรอง ของพระราชบัญญัติป่าชุมชน พ.ศ. 2562... สำรวจ
'''
words = word_tokenize(docs, engine="newmm-safe", keep_whitespace=False)
print(words)
Your environment
- PyThaiNLP version: 3.1.0
- Python version: 3.9.7
- Operating system and version: MacOS
Metadata
Metadata
Assignees
Labels
Hacktoberfestfor Hacktoberfest eventfor Hacktoberfest eventbugbugs in the librarybugs in the library
Type
Projects
Status
In progress