Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,14 @@ translation_pipeline = pipeline("translation_en_to_ar", model="Helsinki-NLP/opus
|
|
12 |
|
13 |
# 3. دالة تلخيص النصوص باللغة الإنجليزية
|
14 |
def summarize_text_en(text):
|
15 |
-
summary = summarization_pipeline_en(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
return summary
|
17 |
|
18 |
# 4. تحويل النص إلى صوت باستخدام gTTS
|
|
|
12 |
|
13 |
# 3. دالة تلخيص النصوص باللغة الإنجليزية
|
14 |
def summarize_text_en(text):
|
15 |
+
summary = summarization_pipeline_en(
|
16 |
+
text,
|
17 |
+
max_length=80, # Adjust this to control summary length
|
18 |
+
min_length=30, # Minimum length of summary
|
19 |
+
length_penalty=2.0,
|
20 |
+
num_beams=4,
|
21 |
+
early_stopping=True
|
22 |
+
)[0]["summary_text"]
|
23 |
return summary
|
24 |
|
25 |
# 4. تحويل النص إلى صوت باستخدام gTTS
|