{"id":13589168,"url":"https://github.com/Socret360/jaws","last_synced_at":"2025-04-08T07:31:51.423Z","repository":{"id":234405211,"uuid":"786845863","full_name":"Socret360/jaws","owner":"Socret360","description":"Just Another Word Segmenter (JAWS): A Graph Neural Network Model for Khmer Word Segmentation","archived":false,"fork":false,"pushed_at":"2024-10-09T12:24:01.000Z","size":1276,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-06T08:43:53.642Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Socret360.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-15T12:17:22.000Z","updated_at":"2024-10-21T06:41:49.000Z","dependencies_parsed_at":"2024-04-19T08:24:16.158Z","dependency_job_id":"c03cea47-ea70-49ea-9186-b4770a5f4a1f","html_url":"https://github.com/Socret360/jaws","commit_stats":null,"previous_names":["socret360/jaws"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Socret360%2Fjaws","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Socret360%2Fjaws/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Socret360%2Fjaws/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Socret360%2Fjaws/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Socret360","download_url":"https://codeload.github.com/Socret360/jaws/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247796206,"owners_count":20997528,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T16:00:24.469Z","updated_at":"2025-04-08T07:31:48.136Z","avatar_url":"https://github.com/Socret360.png","language":"Python","readme":"# Just Another Word Segmentor (JAWS)\n\nA Khmer word segmentation model based on Graph Neural Networks. It represent pairs of characters as nodes and perform node classification to determined if there is a space between two characters.\n\n### Samples taken from Facebook posts\n\n```\nSource: តែបើអត់លុយសងផង មានលុយប្តឹងដែល ?\nOutput: តែ បើ អត់លុយ សង ផង មាន លុយ ប្តឹង ដែល ?\n\nSource: កូនជាប់រៀនទាំងអស់គ្នាមិនបានជូនដើរលេងទេ តែគ្មានអ្វីសប្បាយជាងការជួបជុំទេ\nOutput: កូន ជាប់ រៀន ទាំង អស់ គ្នា មិន បានជូន ដើរ លេង ទេ តែ គ្មាន អ្វី សប្បាយ ជាង ការជួប ជុំទេ\n\nSource: ស្អាតណាស់ក្មេងតូច\nOutput: ស្អាត ណាស់ ក្មេង តូច\n\nSource: ចង់ចូលផ្តល់កម្លាំងចិត្តនិងជួយស្រង់ក្លិននិងណាបង\nOutput: ចង់ ចូល ផ្តល់ កម្លាំង ចិត្ត និង ជួយ ស្រង់ ក្លិន និង ណាបង\n\nSource: កាន់តស្រស់ស្អាតប្លែកតែម្ដងហើយ BA លៀសហាលយើងហ្នឹង\nOutput: កាន់ តស្រស់ ស្អាត ប្លែក តែ ម្ដង ហើយ BA លៀស ហាល យើង ហ្នឹង\n\nSource: ខ្ញុំកំពុងនៅជាមួយខាងCMG CCTV ដើម្បីថតផ្សព្វផ្សាយវប្បធម៌ខ្មែរទៅកាន់ពិភពលោក ឥឡូវនេះខ្ញុំកំពុងមើលព្រះអាទិត្យរះ នៅប្រាសាទអង្គរវត្ត🇰🇭✨🌅\nOutput: ខ្ញុំ កំពុង នៅ ជាមួយ ខាង CMG CCTV ដើម្បី ថត ផ្សព្វផ្សាយ វប្បធម៌ ខ្មែរ ទៅ កាន់ ពិភព លោក ឥឡូវ នេះ ខ្ញុំ កំពុង មើល ព្រះ អាទិត្យ រះ នៅ ប្រាសាទ អង្គរ វត្ត 🇰🇭✨🌅\n\nSource: សូម្បីតែសម្លេងក៏ឈ្លោះគ្នាដែរ ឈ្លោះគ្រប់យ៉ាង mak Lin 😭\nOutput: សូម្បី តែ សម្លេង ក៏ ឈ្លោះ គ្នា ដែរ ឈ្លោះ គ្រប់ យ៉ាង mak Lin 😭\n\nSource: Global Green Growth Week បានត្រលប់មកវិញហើយ នៅសប្តាហ៍ក្រោយនេះ!\nOutput: Global Green Growth Week បាន ត្រលប់ មក វិញ ហើយ នៅ សប្តាហ៍ ក្រោយ នេះ !\n\nSource: ញាត្តិគាំទ្រ Cambodian Pageant និងអ្នកគាំទ្រវិស័យបវរកញ្ញាកម្ពុជាចំពោះប្រសាសន៍លោកស្រីអ៉ឹម សុគន្ធា Sokunthea Im ក្នុងការប្តេជ្ញាចិត្ត សំណូមពរឳ្យស្ថាប័នពាក់ព័ន្ធ បិទការប្រកួត និងការបញ្ជូនបេក្ខភាពតំណាងកម្ពុជាចូលរួមប្រកួត Miss Grand International\nOutput: ញា ត្តិ គាំទ្រ Cambodian Pageant និង អ្នក គាំទ្រ វិស័យ បវរ កញ្ញា កម្ពុជា ចំពោះ ប្រសាសន៍ លោក ស្រី អ៉ឹម សុគន្ធា Sokunthea Im ក្នុង ការ ប្តេជ្ញា ចិត្ត សំណូម ពរឳ្យ ស្ថាប័ន ពាក់ ព័ន្ធ បិទ ការ ប្រកួត និង ការ បញ្ជូន បេក្ខ ភាព តំណាង កម្ពុជា ចូល រួម ប្រកួត Miss Grand International\n\nSource: ហ្វេនកម្មវិធី MasterChef បញ្ចេញសមត្ថភាពតាមរយះការខំមិនបន្តិចទៅមើល! គួរចម្អិនមុខម្ហូបអ្វីទៅណ៎?​😍\nOutput: ហ្វេន កម្មវិធី MasterChef បញ្ចេញ សមត្ថ ភាព តាម រយះការ ខំ មិន បន្តិច ទៅ មើល ! គួរ ចម្អិន មុខ ម្ហូប អ្វី ទៅ ណ៎ ? ​😍\n```\n\n## How to run\n\n### Segment\n\nYou can perform word segmentation using the pretrained model by running the below command.\n\n```bash\nusage: segment.py [-h] [--file_mode] [--console_output] config model_path sample\n\nRun the segmentation on one sample text file.\n\npositional arguments:\n  config            Path to config file.\n  model_path        Path to model weight file.\n  sample            Path to the input text file containing the text to segment.\n\noptional arguments:\n  -h, --help        show this help message and exit\n  --file_mode       Wether sample is a file\n  --console_output  Whether to output the result to console\n```\n\n### Training\n\nThe model can be retrained on your custom dataset using the below command.\n\n```bash\nusage: train.py [-h] [--output_dir OUTPUT_DIR] [--dataset_type {khpos,phylypo}] [--lr LR] [--early_stopping_patience EARLY_STOPPING_PATIENCE] [--epochs EPOCHS] config dataset_path\n\nRun the training loop.\n\npositional arguments:\n  config                Path to config file.\n  dataset_path          Path to dataset. (text file if of type khpos or directory if of type phylypo)\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --output_dir OUTPUT_DIR\n                        Path to output directory.\n  --dataset_type {khpos,phylypo}\n                        The type of dataset to use\n  --lr LR               The learning rate\n  --early_stopping_patience EARLY_STOPPING_PATIENCE\n                        The learning rate\n  --epochs EPOCHS       The number of epochs to train\n```\n\n### Evaluation\n\nTo evaluate a trained model, use the below command.\n\n```bash\nusage: evaluate.py [-h] [--output_dir OUTPUT_DIR] [--dataset_type {khpos,phylypo}] config model_path dataset_path\n\nRun the training loop.\n\npositional arguments:\n  config                Path to config file.\n  model_path            Path to model weight file.\n  dataset_path          Path to dataset. (text file if of type khpos or directory if of type phylypo)\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --output_dir OUTPUT_DIR\n                        Path to output directory.\n  --dataset_type {khpos,phylypo}\n                        The type of dataset to use\n```\n\n## About Pretrained Weights\n\nThe pretrained weights are available [here](pretrained). Each weights were produced by training using the dataset from KhPOS available [here](https://github.com/ye-kyaw-thu/khPOS).\nBelow is the results on the test sets from the set repository.\n\n**Open Set**: [here](https://github.com/ye-kyaw-thu/khPOS/blob/master/corpus-draft-ver-1.0/data/OPEN-TEST.word)\n| Model | F1 Score | Word Error Rate |\n| ------- | -------- | --------------- |\n| JAWSGCN | 98.035% | 5.915% |\n| JAWSGAT | 98.462% | 4.911% |\n\n**Close Set** [here](https://github.com/ye-kyaw-thu/khPOS/blob/master/corpus-draft-ver-1.0/data/CLOSE-TEST.word)\n| Model | F1 Score | Word Error Rate |\n| ------- | -------- | --------------- |\n| JAWSGCN | 98.814% | 3.855% |\n| JAWSGAT | 98.941% | 3.487% |\n","funding_links":[],"categories":["Awesome Khmer Language"],"sub_categories":["2. Toolkit"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSocret360%2Fjaws","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSocret360%2Fjaws","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSocret360%2Fjaws/lists"}