Almahfouz commited on
Commit
84187b9
1 Parent(s): 9f0b326

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -14,13 +14,14 @@ translation_pipeline = pipeline("translation_en_to_ar", model="Helsinki-NLP/opus
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
26
  def text_to_speech(text, lang_code):
 
14
  def summarize_text_en(text):
15
  summary = summarization_pipeline_en(
16
  text,
17
+ max_length=60, # Reduce the max length further
18
+ min_length=25, # Reduce the min length
19
  length_penalty=2.0,
20
  num_beams=4,
21
  early_stopping=True
22
  )[0]["summary_text"]
23
  return summary
24
+
25
 
26
  # 4. تحويل النص إلى صوت باستخدام gTTS
27
  def text_to_speech(text, lang_code):