ADELIB commited on
Commit
89b5dcf
1 Parent(s): a8508e6

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +112 -2
README.md CHANGED
@@ -1,2 +1,112 @@
1
- Model in Action:
2
- hello
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Hugging Face's logo
2
+ Hugging Face
3
+ Search models, datasets, users...
4
+ Models
5
+ Datasets
6
+ Spaces
7
+ Docs
8
+ Solutions
9
+ Pricing
10
+
11
+
12
+
13
+
14
+ Mihakram
15
+ /
16
+ Arabic_Question_Generation Copied
17
+ like
18
+ 0
19
+ Text2Text Generation
20
+ PyTorch
21
+ Transformers
22
+ Arabic
23
+
24
+ arxiv:2109.12068
25
+ t5
26
+ AutoTrain Compatible
27
+ Model card
28
+ Files and versions
29
+ Community
30
+ Arabic_Question_Generation
31
+ /
32
+ README.md
33
+ Mihakram's picture
34
+ Mihakram
35
+ Update README.md
36
+ 9920e0d
37
+ 14 minutes ago
38
+ raw
39
+ history
40
+ blame
41
+ contribute
42
+ delete
43
+ Safe
44
+ 3.41 kB
45
+ ---
46
+ language:
47
+ - ar
48
+ widget:
49
+ - text: "context: الثورة الجزائرية أو ثورة المليون شهيد، اندلعت في 1 نوفمبر 1954 ضد المستعمر الفرنسي ودامت 7 سنوات ونصف. استشهد فيها أكثر من مليون ونصف مليون جزائري answer: 7 سنوات ونصف </s>
50
+ "
51
+ - text: "context: اسكتلندا دولة في شمال غرب أوروبا، تعتبر جزء من الدول الأربع المكونة المملكة المتحدة. تحتل الثلث الشمالي من جزيرة بريطانيا العظمى وتحدها جنوبا إنجلترا ويحدها شرقا بحر الشمال وغربا المحيط الأطلسي. عاصمتها أدنبرة، وأهم مدنها وأكبرها مدينة غلاسكو. كانت اسكتلندا مملكة مستقلة حتى 1 مايو 1707 answer: أدنبرة </s>"
52
+
53
+ - text: "context: مات المستشار الألماني أدولف هتلر في 30 أبريل 1945 منتحرا عن طريق تناول مادة السيانيد السامة وإطلاق النار على نفسه وهي الرواية العامة المقبولة لطريقة موت الزعيم النازي answer: منتحرا </s>
54
+ "
55
+
56
+ ---
57
+ # Arabic Question generation Model
58
+ [AraT5-Base Model](https://huggingface.co/UBC-NLP/AraT5-base) fine-tuned on Arabic Question-Answering Dataset for **Question generation**
59
+
60
+ Get the Question from given Context and a Answer
61
+
62
+
63
+ ## Details of Ara-T5
64
+
65
+ The **Ara-T5** model was presented in [AraT5: Text-to-Text Transformers for Arabic Language Generation](https://arxiv.org/abs/2109.12068) by *El Moatez Billah Nagoudi, AbdelRahim Elmadany, Muhammad Abdul-Mageed*
66
+
67
+
68
+ ## Model in Action 🚀
69
+ ```python
70
+ from transformers import AutoTokenizer,AutoModelForSeq2SeqLM
71
+ model = AutoModelForSeq2SeqLM.from_pretrained("Mihakram/Arabic_Question_Generation")
72
+ tokenizer = AutoTokenizer.from_pretrained("Mihakram/Arabic_Question_Generation")
73
+ def get_question(context,answer):
74
+ text="context: " +context + " " + "answer: " + answer + " </s>"
75
+ text_encoding = tokenizer.encode_plus(
76
+ text,return_tensors="pt"
77
+ )
78
+ model.eval()
79
+ generated_ids = model.generate(
80
+ input_ids=text_encoding['input_ids'],
81
+ attention_mask=text_encoding['attention_mask'],
82
+ max_length=64,
83
+ num_beams=5,
84
+ num_return_sequences=1
85
+ )
86
+ return tokenizer.decode(generated_ids[0],skip_special_tokens=True,clean_up_tokenization_spaces=True).replace('question: ',' ')
87
+ context="الثورة الجزائرية أو ثورة المليون شهيد، اندلعت في 1 نوفمبر 1954 ضد المستعمر الفرنسي ودامت 7 سنوات ونصف. استشهد فيها أكثر من مليون ونصف مليون جزائري"
88
+ answer =" 7 سنوات ونصف"
89
+ get_question(context,answer)
90
+ #output : question="كم استمرت الثورة الجزائرية؟ "
91
+ ```
92
+ ## Citation
93
+ If you want to cite this model you can use this:
94
+
95
+ ```bibtex
96
+ @misc{Mihakram/,
97
+ title={},
98
+ author={Mihoubi, Ibrir},
99
+ publisher={Hugging Face},
100
+ journal={Hugging Face Hub},
101
+ howpublished={\url{https://huggingface.co/}},
102
+ year={2022}
103
+ }
104
+ ```
105
+
106
+ ## Contacts
107
+
108
+ **Mihoubi Akram Fawzi**: [Linkedin](https://www.linkedin.com/in/mihoubi-akram/) | [Github](https://github.com/mihoubi-akram) | <mihhakram@gmail.com>
109
+
110
+ **Ibrir Adel**: [Linkedin]() | [Github]() | <adelibrir2015@gmail.com>
111
+
112
+