pythainlp icon indicating copy to clipboard operation
pythainlp copied to clipboard

Error(wrong result) sentences in dictionary-based tokenizers

Open kmining opened this issue 3 years ago • 1 comments

Description

When I tested with the easy sentence "Eat rice(กินข้าว)", all dictionary-based tokenizers such as longest and newmm gave wrong results.

image

I think that "rice(ข้าว)" and "eat(กิน)" should be separated as the correct answer.

Expected results

[กิน, ข้าว]

Current results

[กินข้าว]

Steps to reproduce

tokens = word_tokenize("กินข้าว", engine="longest")

Your environment

  • PyThaiNLP version: 3.0.8
  • Python version:3.7.3
  • Operating system and version (distro, 32/64-bit): 64

kmining avatar May 22 '22 12:05 kmining

กินข้าว is phrase in Thai. It can mean "eat rice" or "meal time". example "ฉัน (I) กิน (eat) ข้าว (rice)" and "ได้(It's) เวลา กินข้าว (meal time)".

กินข้าว phrase: ทานข้าวไม่ได้แปลว่ากินข้าว : การให้ค่า เวลา การตีตราความถูกผิดในสังคมไทย

wannaphong avatar May 22 '22 17:05 wannaphong

Related discussion https://github.com/PyThaiNLP/pythainlp/discussions/675

bact avatar Oct 11 '22 06:10 bact