Package: shakkala
Shakkala Project V 2.1 مشروع شكّالةIntroductionThe 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.Requirementspip install shakkalaNote: Shakkala has been tested with Tensorflow 2.9.3.Code Examples (How to)Check full example in (demo.py) file.Importfrom shakkala import ShakkalaCreate Shakkala objectsh = Shakkala()OR for advanced usage:sh = Shakkala(version={version_num})Prepare inputinput_text = "فإن لم يكونا كذلك أتى بما يقتضيه الحال وهذا أولى"
input_int = sh.prepare_input(input_text)Call the neural networkmodel, graph = sh.get_model()
logits = model.predict(input_int)[0]Predict outputpredicted_harakat = sh.logits_to_text(logits)
final_output = sh.get_final_text(input_text, predicted_harakat)Available models:version_num=1: First test of the solution.version_num=2: Main release version.version_num=3: Some enhancements from version number 2.It worth to try both version_num=2 and version_num=3.Perfomance TipsShakkala 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:Load the model in global variable:sh = Shakkala(folder_location, version={version_num})
model, graph = sh.get_model()Then inside your request function or loop add:input_int = sh.prepare_input(input_text)
logits = model.predict(input_int)[0]
predicted_harakat = sh.logits_to_text(logits)
final_output = sh.get_final_text(input_text, predicted_harakat)AccuracyIn this beta version 2 accuracy reached up to 95% and in some data it reach more based on complexity and data disribution.
This beta version trained on more than million sentences with majority of historical Arabic data from books andsome ofavailable formed modern data in the internet.Prediction ExampleFor live demo based on Shakkala library click thelinkReal outputPredicted outputفَإِنْ لَمْ يَكُونَا كَذَلِكَ أَتَى بِمَا يَقْتَضِيهِ الْحَالُ وَهَذَا أَوْلَىفَإِنْ لَمْ يَكُونَا كَذَلِكَ أَتَى بِمَا يَقْتَضِيهِ الْحَالُ وَهَذَا أَوْلَىقَالَ الْإِسْنَوِيُّ  وَسَوَاءٌ فِيمَا قَالُوهُ مَاتَ فِي حَيَاةِ أَبَوَيْهِ أَمْ لَاقَالَ الْإِسْنَوِيُّ  وَسَوَاءٌ فِيمَا قَالُوهُ مَاتَ فِي حَيَاةِ أَبَوَيْهِ أَمْ لَاطَابِعَةٌ ثُلَاثِيَّةُ الْأَبْعَادطَابِعَةٌ ثَلَاثِيَّةُ الْأَبْعَادِAccuracy EnhancementsThe model can be enhanced to reach more than 95% accuracy with following:Availability of more formedmoderndata to train the network. (because current version trained with mostly available historical Arabic data and some modern data)Stack different modelsReferencesA paper compare different arabic text diacritization models and show that shakkala is the best among available neural networks for this solution:Arabic Text Diacritization Using Deep Neural Networks, 2019CitationFor academic work useShakkala, Arabic text vocalization, Barqawi & ZerroukiOR bibtex format@misc{
  title={Shakkala, Arabic text vocalization},
  author={Barqawi, Zerrouki},
  url={https://github.com/Barqawiz/Shakkala},
  year={2017}
}ContributionCore TeamAhmad Barqawi: Neural Network Developer.Taha Zerrouki: Mentor Data and Results.ContributorsZaid Farekh & propellerinc.me: Provide infrastructure and consultation support.Mohammad Issam Aklik: Artist.Brahim Sidi: Form new sentences.Fadi Bakoura: Aggregate online content.Ola Ghanem: Testing.Ali Hamdi Ali Fadel: Contribute code.LicenseFree to use and distribute only mention the original project name Shakkala as base model.The MIT License (MIT)Copyright (c) 2017 Shakkala ProjectPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.