{"id":16316861,"url":"https://github.com/barqawiz/shakkala","last_synced_at":"2025-04-05T01:09:48.351Z","repository":{"id":28005562,"uuid":"112287108","full_name":"Barqawiz/Shakkala","owner":"Barqawiz","description":"Deep learning for AR text Vocalization - التشكيل الالي للنصوص العربية","archived":false,"fork":false,"pushed_at":"2023-03-25T01:50:27.000Z","size":606081,"stargazers_count":337,"open_issues_count":5,"forks_count":44,"subscribers_count":25,"default_branch":"master","last_synced_at":"2024-10-18T00:44:33.413Z","etag":null,"topics":["arabic-nlp","deep-learning","lstm","rnn"],"latest_commit_sha":null,"homepage":"https://shakkala.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Barqawiz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","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},"funding":{"github":"Barqawiz","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2017-11-28T04:48:14.000Z","updated_at":"2024-09-20T13:10:12.000Z","dependencies_parsed_at":"2024-10-25T23:19:45.090Z","dependency_job_id":null,"html_url":"https://github.com/Barqawiz/Shakkala","commit_stats":{"total_commits":67,"total_committers":5,"mean_commits":13.4,"dds":0.4925373134328358,"last_synced_commit":"a01b2e81a2816ba65b57e5cfc01356abf9453b2c"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Barqawiz%2FShakkala","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Barqawiz%2FShakkala/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Barqawiz%2FShakkala/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Barqawiz%2FShakkala/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Barqawiz","download_url":"https://codeload.github.com/Barqawiz/Shakkala/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247271532,"owners_count":20911587,"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":["arabic-nlp","deep-learning","lstm","rnn"],"created_at":"2024-10-10T22:05:48.130Z","updated_at":"2025-04-05T01:09:48.337Z","avatar_url":"https://github.com/Barqawiz.png","language":"Python","funding_links":["https://github.com/sponsors/Barqawiz"],"categories":[],"sub_categories":[],"readme":"# Shakkala Project مشروع شكّالة\n[![PyPI version](https://badge.fury.io/py/shakkala.svg)](https://badge.fury.io/py/shakkala)\n\n\u003cimg src=\"images/shakkala.png\" alt=\"Model\" height=\"140\" width=\"140\"/\u003e\n\n## Introduction\nThe Shakkala project presents a recurrent neural network for Arabic text vocalization that automatically forms Arabic characters (تشكيل الحروف) to enhance text-to-speech systems. The model can also be used in other applications such as improving search results. In the beta version, the model was trained on over a million sentences, including a majority of historical Arabic data from books and some modern data from the internet. The accuracy of the model reached up to 95%, and in some data sets it achieved even higher levels of accuracy depending on complexity and data distribution. This innovative approach has the potential to significantly improve the quality of writing and text-to-speech systems for the Arabic language.\n\n## Requirements\n\n### Easy setup\nNo GitHub repository installation is needed for [pip](https://pypi.org/project/shakkala/) case:\n```\npip install shakkala\n```\n\n### Project setup\nExecute the source code from Github:\u003cbr/\u003e\n```\ncd requirements\npip install -r requirements.txt\ncd ..\n```\n\nNote: Shakkala has been tested with Tensorflow 2.9.3.\u003cbr\u003e\n\n## Code Examples (How to)\nCheck full example in (demo.py) file.\u003cbr/\u003e\n\n0. Import\n```\nfrom shakkala import Shakkala\n```\n\n1. Create Shakkala object\n```\nsh = Shakkala()\n```\nOR for advanced usage:\n```\nsh = Shakkala(version={version_num})\n```\n2. Prepare input\n```\ninput_text = \"فإن لم يكونا كذلك أتى بما يقتضيه الحال وهذا أولى\"\ninput_int = sh.prepare_input(input_text)\n```\n3. Call the neural network\n```\nmodel, graph = sh.get_model()\nlogits = model.predict(input_int)[0]\n```\n4. Predict output\n```\npredicted_harakat = sh.logits_to_text(logits)\nfinal_output = sh.get_final_text(input_text, predicted_harakat)\n```\nAvailable models: \u003cbr\u003e\n\n- version_num=1: First test of the solution.\n- version_num=2: Main release version.\n- version_num=3: Some enhancements from version number 2.\n\nIt worth to try both version_num=2 and version_num=3.\n\n### Demo run\nThe fastest way to start with Shakkala by running the demo from Github:\n```\npython demo.py\n```\n\n## Perfomance Tips\nShakkala built in object oriented way to load the model once into memory for faster prediction, to make sure you dont load it multiple times in your service or application follow the steps:\n- Load the model in global variable:\n```\nsh = Shakkala(folder_location, version={version_num})\nmodel, graph = sh.get_model()\n```\n- Then inside your request function or loop add:\n```\ninput_int = sh.prepare_input(input_text)\nlogits = model.predict(input_int)[0]\npredicted_harakat = sh.logits_to_text(logits)\nfinal_output = sh.get_final_text(input_text, predicted_harakat)\n```\n\n## Accuracy\nIn this beta version 2 accuracy reached up to 95% and in some data it reach more based on complexity and data disribution.\nThis beta version trained on more than million sentences with majority of historical Arabic data from books and **some of** available formed modern data in the internet.\u003cbr/\u003e\n\n\u003cimg src=\"https://github.com/Barqawiz/Shakkala/blob/master/images/loss_history_v2.png\" alt=\"history\" style=\"height: 350px;\"/\u003e\n\n### Prediction Example\nFor live demo based on Shakkala library click the [link](http://ahmadai.com/shakkala/) \u003cbr/\u003e\n\n| Real output | Predicted output |\n| ------------- | ---------------- |\n| فَإِنْ لَمْ يَكُونَا كَذَلِكَ أَتَى بِمَا يَقْتَضِيهِ الْحَالُ وَهَذَا أَوْلَى  | فَإِنْ لَمْ يَكُونَا كَذَلِكَ أَتَى بِمَا يَقْتَضِيهِ الْحَالُ وَهَذَا أَوْلَى |\n| قَالَ الْإِسْنَوِيُّ  وَسَوَاءٌ فِيمَا قَالُوهُ مَاتَ فِي حَيَاةِ أَبَوَيْهِ أَمْ لَا  | قَالَ الْإِسْنَوِيُّ  وَسَوَاءٌ فِيمَا قَالُوهُ مَاتَ فِي حَيَاةِ أَبَوَيْهِ أَمْ لَا  |\n| طَابِعَةٌ ثُلَاثِيَّةُ الْأَبْعَاد | طَابِعَةٌ ثَلَاثِيَّةُ الْأَبْعَادِ  |\n\n### Accuracy Enhancements  \nThe model can be enhanced to reach more than 95% accuracy with following:\u003cbr/\u003e\n- Availability of more formed **modern**  data to train the network. (because current version trained with mostly available historical Arabic data and some modern data)\n- Stack different models\n\n## Model Design\n\u003cimg src=\"https://github.com/Barqawiz/Shakkala/blob/master/images/mode_design.png\" alt=\"Model\"/\u003e\n\n## References\n- A paper compare different arabic text diacritization models and show that shakkala is the best among available neural networks for this solution:\n[Arabic Text Diacritization Using Deep Neural Networks, 2019](https://arxiv.org/abs/1905.01965)\n\n## Citation\nFor academic work use\n```\nShakkala, Arabic text vocalization, Barqawi \u0026 Zerrouki\n```\nOR bibtex format\n```\n@misc{\n  title={Shakkala, Arabic text vocalization},\n  author={Barqawi, Zerrouki},\n  url={https://github.com/Barqawiz/Shakkala},\n  year={2017}\n}\n```\n\n## Contribution\n### Core Team\n1. Ahmad Barqawi: Neural Network Developer.\u003cbr/\u003e\n2. Taha Zerrouki: Mentor Data and Results.\u003cbr/\u003e\n### Contributors\n1. Zaid Farekh \u0026 propellerinc.me: Provide infrastructure and consultation support.\u003cbr/\u003e\n2. Mohammad Issam Aklik: Artist.\u003cbr/\u003e\n3. Brahim Sidi: Form new sentences.\u003cbr/\u003e\n4. Fadi Bakoura: Aggregate online content.\u003cbr/\u003e\n5. Ola Ghanem: Testing.\u003cbr/\u003e\n6. Ali Hamdi Ali Fadel: Contribute code.\u003cbr/\u003e\n\nLicense\n-------\nFree to use and distribute only mention the original project name Shakkala as base model.\u003cbr/\u003e\n\n  The MIT License (MIT)\n\n  Copyright (c) 2017 Shakkala Project\n\n  Permission is hereby granted, free of charge, to any person obtaining a copy\n  of this software and associated documentation files (the \"Software\"), to deal\n  in the Software without restriction, including without limitation the rights\n  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n  copies of the Software, and to permit persons to whom the Software is\n  furnished to do so, subject to the following conditions:\n\n  The above copyright notice and this permission notice shall be included in all\n  copies or substantial portions of the Software.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarqawiz%2Fshakkala","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbarqawiz%2Fshakkala","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarqawiz%2Fshakkala/lists"}