malmarjeh commited on
Commit
d4010cb
·
1 Parent(s): 7e36f41

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +4 -3
README.md CHANGED
@@ -1,5 +1,5 @@
1
  An Arabic abstractive text summarization model.
2
- A fine-tuned AraT5 model on a dataset that consists of 86,523 paragraph-summary pairs.
3
 
4
  More details on the fine-tuning of this model will be released later.
5
 
@@ -9,13 +9,15 @@ from arabert.preprocess import ArabertPreprocessor
9
 
10
  model_name="malmarjeh/t5-arabic-text-summarization"
11
  arabert_prep = ArabertPreprocessor(model_name=model_name)
 
12
  tokenizer = AutoTokenizer.from_pretrained(model_name)
13
  model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
14
  pipeline = pipeline("text2text-generation",model=model,tokenizer=tokenizer)
15
 
16
- text = "ولن نبالغ إذا قلنا إن هاتف أو كمبيوتر المكتب في زمننا هذا ضروري"
17
  preprocessor = ArabertPreprocessor(model_name="")
18
  preprocessor.preprocess(text)
 
19
  result = pipeline(text,
20
  pad_token_id=tokenizer.eos_token_id,
21
  num_beams=3,
@@ -24,5 +26,4 @@ result = pipeline(text,
24
  length_penalty=1.0,
25
  no_repeat_ngram_size = 3)[0]['generated_text']
26
  result
27
- >>>"و+ لن نبالغ إذا قل +نا إن هاتف أو كمبيوتر ال+ مكتب في زمن +نا هذا ضروري"
28
  ```
 
1
  An Arabic abstractive text summarization model.
2
+ A fine-tuned AraT5 model on a dataset that consists of 84,764 paragraph-summary pairs.
3
 
4
  More details on the fine-tuning of this model will be released later.
5
 
 
9
 
10
  model_name="malmarjeh/t5-arabic-text-summarization"
11
  arabert_prep = ArabertPreprocessor(model_name=model_name)
12
+
13
  tokenizer = AutoTokenizer.from_pretrained(model_name)
14
  model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
15
  pipeline = pipeline("text2text-generation",model=model,tokenizer=tokenizer)
16
 
17
+ text = "شهدت مدينة طرابلس، مساء أمس الأربعاء، احتجاجات شعبية وأعمال شغب لليوم الثالث على التوالي، وذلك بسبب تردي الوضع المعيشي والاقتصادي. واندلعت مواجهات عنيفة وعمليات كر وفر ما بين الجيش اللبناني والمحتجين استمرت لساعات، إثر محاولة فتح الطرقات المقطوعة، ما أدى إلى إصابة العشرات من الطرفين."
18
  preprocessor = ArabertPreprocessor(model_name="")
19
  preprocessor.preprocess(text)
20
+
21
  result = pipeline(text,
22
  pad_token_id=tokenizer.eos_token_id,
23
  num_beams=3,
 
26
  length_penalty=1.0,
27
  no_repeat_ngram_size = 3)[0]['generated_text']
28
  result
 
29
  ```