Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tokenize with continue multiple punctions #19

Open
liutianling opened this issue Jan 25, 2021 · 1 comment
Open

tokenize with continue multiple punctions #19

liutianling opened this issue Jan 25, 2021 · 1 comment

Comments

@liutianling
Copy link

BE kem pertama dalam Bahasa Melayu. 350 Pax Pemimpin daripada Malaysia, Singapura, Brunei Dan Indonesia!!! Marilah kita membawa gelombang #BEInternational ke Pasaran Melayu!!!🔥🔥🔥🔥🔥

with the text above, i got a result:
[['BE', 'kem', 'pertama', 'dalam', 'Bahasa', 'Melayu', '.'], ['350', 'Pax', 'Pemimpin', 'daripada', 'Malaysia', ',', 'Singapura', ',', 'Brunei', 'Dan', 'Indonesia', '!'], ['!'], ['!'], ['Marilah', 'kita', 'membawa', 'gelombang', '#', 'BEInternational', 'ke', 'Pasaran', 'Melayu', '!'], ['!'], ['!'], ['🔥', '🔥', '🔥', '🔥', '🔥']]

I want get the "!!!" as total .
Thanks!

@tsproisl
Copy link
Owner

Wow, I didn't expect SoMaJo to be useful for Malaysian!

Unfortunately, I am not able to reproduce the problem. I get the following output which looks fine:

[['BE', 'kem', 'pertama', 'dalam', 'Bahasa', 'Melayu', '.'], ['350', 'Pax', 'Pemimpin', 'daripada', 'Malaysia', ',', 'Singapura', ',', 'Brunei', 'Dan', 'Indonesia', '!!!'], ['Marilah', 'kita', 'membawa', 'gelombang', '#BEInternational', 'ke', 'Pasaran', 'Melayu', '!!!', '🔥', '🔥', '🔥', '🔥', '🔥']]

How did you run the tokenizer? I tested it like this ("en_PTB" and "de_CMC" give the same results on this input – I don't know which one would be more appropriate for Malaysian):

from somajo import SoMaJo

tokenizer = SoMaJo("en_PTB")
paragraphs = ["BE kem pertama dalam Bahasa Melayu. 350 Pax Pemimpin daripada Malaysia, Singapura, Brunei Dan Indonesia!!! Marilah kita membawa gelombang #BEInternational ke Pasaran Melayu!!!🔥🔥🔥🔥🔥"]
sentences = tokenizer.tokenize_text(paragraphs)
print([[token.text for token in s] for s in sentences])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants