diff --git a/arabic-voice-generation-app/README.md b/arabic-voice-generation-app/README.md
new file mode 100644
index 00000000..ad61633b
--- /dev/null
+++ b/arabic-voice-generation-app/README.md
@@ -0,0 +1,51 @@
+# تطبيق توليدي للأصوات العربية
+
+تطبيق بسيط وسريع لتحويل النص العربي إلى كلام باستخدام تقنيات مفتوحة المصدر.
+
+## الميزات
+
+- 🗣️ تحويل النص العربي إلى كلام بجودة عالية
+- 🌐 واجهة مستخدم تفاعلية سهلة الاستخدام
+- ⚡ سريع وفعال في التوليد
+- 📦 يعتمد على مكتبات مفتوحة المصدر بالكامل
+- 🎛️ إمكانية تعديل سرعة القراءة
+
+## المتطلبات
+
+- Python 3.7+
+- مكتبات Python المذكورة في ملف `requirements.txt`
+
+## التثبيت
+
+1. تثبيت المكتبات المطلوبة:
+```bash
+pip install -r requirements.txt
+```
+
+2. تشغيل التطبيق:
+```bash
+python app.py
+```
+
+3. فتح المتصفح على العنوان: http://localhost:7860
+
+## الاستخدام
+
+1. أدخل النص العربي في مربع النص
+2. اضبط سرعة القراءة حسب الرغبة
+3. انقر على زر "تحويل إلى كلام"
+4. استمع إلى الصوت المُوَلَّد أو نزّله
+
+## التقنيات المستخدمة
+
+- **SpeechBrain**: إطار عمل مفتوح المصدر للتعلم العميق في معالجة الكلام
+- **Tacotron2**: نموذج توليدي للكلام متقدم
+- **HIFIGAN**: نموذج لتوليد الصوت عالي الجودة
+- **Gradio**: لإنشاء واجهة المستخدم التفاعلية
+
+## التخصيص
+
+يمكنك تعديل النموذج لإضافة:
+- أصوات مختلفة
+- لهجات عربية متنوعة
+- تعديلات على سرعة القراءة والطبقة الصوتية
diff --git a/arabic-voice-generation-app/app.py b/arabic-voice-generation-app/app.py
new file mode 100644
index 00000000..1e975865
--- /dev/null
+++ b/arabic-voice-generation-app/app.py
@@ -0,0 +1,85 @@
+import gradio as gr
+import numpy as np
+from tts_model import ArabicTTS
+import os
+
+# تهيئة نموذج تحويل النص إلى كلام
+tts = ArabicTTS()
+
+def generate_speech(text, speed=1.0):
+ """
+ توليد الصوت من النص العربي
+
+ Args:
+ text (str): النص العربي
+ speed (float): سرعة القراءة (0.5-2.0)
+
+ Returns:
+ tuple: (معدل العينة, الصوت المُوَلَّد)
+ """
+ if not text.strip():
+ return None, "الرجاء إدخال نص للتحويل"
+
+ # توليد الصوت
+ audio = tts.text_to_speech(text)
+
+ if audio is not None:
+ # تعديل سرعة القراءة إذا لزم الأمر
+ if speed != 1.0:
+ # يمكن إضافة تعديل السرعة هنا
+ pass
+
+ # حفظ الصوت مؤقتًا
+ temp_filename = "temp_output.wav"
+ tts.save_audio(audio, temp_filename)
+
+ # إرجاع الصوت للواجهة
+ return (22050, audio), None
+ else:
+ return None, "حدث خطأ في توليد الصوت"
+
+# إنشاء واجهة المستخدم
+with gr.Blocks(title="تطبيق توليدي للأصوات العربية") as demo:
+ gr.Markdown("# 🗣️ تطبيق توليدي للأصوات العربية")
+ gr.Markdown("تحويل النص العربي إلى كلام باستخدام تقنيات مفتوحة المصدر")
+
+ with gr.Row():
+ with gr.Column():
+ text_input = gr.Textbox(
+ label="أدخل النص العربي",
+ placeholder="اكتب النص الذي تريد تحويله إلى كلام...",
+ lines=5
+ )
+ speed_slider = gr.Slider(
+ minimum=0.5,
+ maximum=2.0,
+ value=1.0,
+ label="سرعة القراءة"
+ )
+ generate_btn = gr.Button("تحويل إلى كلام", variant="primary")
+
+ with gr.Column():
+ audio_output = gr.Audio(label="الصوت المُوَلَّد")
+ error_output = gr.Textbox(label="رسائل الخطأ", interactive=False)
+
+ generate_btn.click(
+ fn=generate_speech,
+ inputs=[text_input, speed_slider],
+ outputs=[audio_output, error_output]
+ )
+
+ gr.Markdown("### أمثلة للنصوص العربية:")
+ gr.Examples(
+ examples=[
+ "السلام عليكم ورحمة الله وبركاته",
+ "مرحباً بك في تطبيق تحويل النص إلى كلام",
+ "هذا التطبيق يستخدم تقنيات مفتوحة المصدر",
+ "يمكنك كتابة أي نص عربي وسيتم تحويله إلى كلام",
+ "نأمل أن تجد هذا التطبيق مفيداً"
+ ],
+ inputs=text_input
+ )
+
+# تشغيل التطبيق
+if __name__ == "__main__":
+ demo.launch(server_name="0.0.0.0", server_port=7860)
diff --git a/arabic-voice-generation-app/config.py b/arabic-voice-generation-app/config.py
new file mode 100644
index 00000000..ad7a6dd5
--- /dev/null
+++ b/arabic-voice-generation-app/config.py
@@ -0,0 +1,17 @@
+# إعدادات الصوت
+AUDIO_SAMPLE_RATE = 22050
+AUDIO_CHANNELS = 1
+
+# إعدادات النموذج
+MODEL_CONFIG = {
+ "g2p_model": "speechbrain/tts_models/arabic-tacotron2-collab",
+ "tts_model": "speechbrain/tts_models/arabic-tacotron2-collab",
+ "vocoder_model": "speechbrain/tts_models/arabic-hifigan-collab"
+}
+
+# إعدادات الواجهة
+INTERFACE_CONFIG = {
+ "title": "تطبيق توليدي للأصوات العربية",
+ "server_name": "0.0.0.0",
+ "server_port": 7860
+}
diff --git a/arabic-voice-generation-app/requirements.txt b/arabic-voice-generation-app/requirements.txt
new file mode 100644
index 00000000..5e567ed1
--- /dev/null
+++ b/arabic-voice-generation-app/requirements.txt
@@ -0,0 +1,9 @@
+torch>=1.13.0
+torchaudio>=0.13.0
+transformers>=4.21.0
+speechbrain>=0.5.12
+librosa>=0.9.2
+soundfile>=0.10.3
+numpy>=1.21.0
+gradio>=3.24.1
+huggingface_hub>=0.12.0
diff --git a/arabic-voice-generation-app/tts_model.py b/arabic-voice-generation-app/tts_model.py
new file mode 100644
index 00000000..5b121bf7
--- /dev/null
+++ b/arabic-voice-generation-app/tts_model.py
@@ -0,0 +1,71 @@
+import torch
+import torchaudio
+from speechbrain.inference.text import GraphemeToPhoneme
+from speechbrain.inference.TTS import Tacotron2
+from speechbrain.inference.vocoders import HIFIGAN
+import numpy as np
+import librosa
+
+class ArabicTTS:
+ def __init__(self):
+ """تهيئة نموذج تحويل النص إلى كلام للغة العربية"""
+ # تحميل نموذج تحويل الحروف إلى أصوات (Grapheme-to-Phoneme)
+ self.g2p = GraphemeToPhoneme.from_hparams(
+ "speechbrain/tts_models/arabic-tacotron2-collab",
+ savedir="pretrained_models/g2p"
+ )
+
+ # تحميل نموذج Tacotron2 للغة العربية
+ self.tts_model = Tacotron2.from_hparams(
+ "speechbrain/tts_models/arabic-tacotron2-collab",
+ savedir="pretrained_models/tts"
+ )
+
+ # تحميل نموذج HIFIGAN لتوليد الصوت عالي الجودة
+ self.vocoder = HIFIGAN.from_hparams(
+ "speechbrain/tts_models/arabic-hifigan-collab",
+ savedir="pretrained_models/vocoder"
+ )
+
+ def text_to_speech(self, text):
+ """
+ تحويل النص العربي إلى كلام
+
+ Args:
+ text (str): النص العربي المراد تحويله
+
+ Returns:
+ numpy.ndarray: الصوت المُوَلَّد
+ """
+ try:
+ # تحويل النص إلى صوتيفات (Phonemes)
+ phonemes = self.g2p.g2p(text)
+ print(f"النصوص الصوتية: {phonemes}")
+
+ # إنشاء التمثيل الطيفي للصوت
+ mel_spec, _, _ = self.tts_model.encode_text(phonemes)
+
+ # تحويل التمثيل الطيفي إلى صوت باستخدام HIFIGAN
+ waveform = self.vocoder.decode_batch(mel_spec)
+
+ # تحويل المصفوفة إلى مصفوفة numpy
+ audio = waveform.squeeze().cpu().numpy()
+
+ return audio
+ except Exception as e:
+ print(f"خطأ في توليد الصوت: {str(e)}")
+ return None
+
+ def save_audio(self, audio, filename, sample_rate=22050):
+ """
+ حفظ الصوت المُوَلَّد في ملف
+
+ Args:
+ audio (numpy.ndarray): الصوت المُوَلَّد
+ filename (str): اسم الملف
+ sample_rate (int): معدل العينة
+ """
+ if audio is not None:
+ # حفظ الصوت بصيغة WAV
+ torchaudio.save(filename, torch.tensor(audio).unsqueeze(0), sample_rate)
+ print(f"تم حفظ الصوت في: {filename}")
diff --git a/arabic-voice-generation-app/utils.py b/arabic-voice-generation-app/utils.py
new file mode 100644
index 00000000..254b73d4
--- /dev/null
+++ b/arabic-voice-generation-app/utils.py
@@ -0,0 +1,39 @@
+import re
+import os
+
+def preprocess_arabic_text(text):
+ """
+ معالجة النص العربي قبل التحويل إلى كلام
+
+ Args:
+ text (str): النص العربي الأصلي
+
+ Returns:
+ str: النص المُعالج
+ """
+ # إزالة المسافات الزائدة
+ text = re.sub(r'\s+', ' ', text).strip()
+
+ # معالجة الأرقام العربية
+ arabic_numbers = {
+ '٠': '0', '١': '1', '٢': '2', '٣': '3', '٤': '4',
+ '٥': '5', '٦': '6', '٧': '7', '٨': '8', '٩': '9'
+ }
+
+ for arabic, english in arabic_numbers.items():
+ text = text.replace(arabic, english)
+
+ return text
+
+def check_model_files():
+ """التحقق من وجود ملفات النماذج المطلوبة"""
+ required_dirs = [
+ "pretrained_models/g2p",
+ "pretrained_models/tts",
+ "pretrained_models/vocoder"
+ ]
+
+ for directory in required_dirs:
+ if not os.path.exists(directory):
+ os.makedirs(directory)
+ print(f"تم إنشاء المجلد: {directory}")
diff --git a/config/repolinter-ruleset.json b/config/repolinter-ruleset.json
index c57e1b87..c0467d79 100644
--- a/config/repolinter-ruleset.json
+++ b/config/repolinter-ruleset.json
@@ -62,7 +62,7 @@
},
"policyInfo": "GitHub requires a CODEOWNERS file in all projects. This enables GitHub to contact the maintainers in the event it is necessary.",
"policyUrl": "https://github.com/github/open-source/blob/main/policies/release.md"
- },
+ }
},
"formatOptions": {
"disclaimer": "🤖*This issue was automatically generated by [repolinter-action](https://github.com/newrelic/repolinter-action), developed by the Open Source and Developer Advocacy team at New Relic.*"
diff --git a/config/text-summarizer-eval.yaml b/config/text-summarizer-eval.yaml
new file mode 100644
index 00000000..1648d920
--- /dev/null
+++ b/config/text-summarizer-eval.yaml
@@ -0,0 +1,23 @@
+name: Text Summarizer
+description: Summarizes input text concisely
+model: openai/gpt-4o-mini
+modelParameters:
+ temperature: 0.5
+messages:
+ - role: system
+ content: You are a text summarizer. Your only job is to summarize text given to you.
+ - role: user
+ content: |
+ Summarize the given text, beginning with "Summary -":
+
هنا سيظهر النص المولد بناءً على الإعدادات المختارة. This area previews the generated content.
+ + +