youssef03 commited on
Commit
bef0efd
·
verified ·
1 Parent(s): b637318

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +214 -3
README.md CHANGED
@@ -1,7 +1,218 @@
1
  ---
2
  license: mit
3
  language:
4
- - ar
5
  base_model:
6
- - meta-llama/Llama-3.1-8B-Instruct
7
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: mit
3
  language:
4
+ - ar
5
  base_model:
6
+ - meta-llama/Llama-3.1-8B-Instruct
7
+ tags:
8
+ - text-generation
9
+ - arabic
10
+ - abductive-reasoning
11
+ - commonsense-reasoning
12
+ - llama3
13
+ ---
14
+
15
+
16
+
17
+ # Model Card for Arabic Abductive Reasoning Model
18
+
19
+ This model is a fine-tuned version of meta-llama/Llama-3.1-8B-Instruct specialized for abductive commonsense reasoning in Arabic. It is designed to generate plausible explanations for narrative scenarios.
20
+
21
+ ## Model Details
22
+
23
+ ### Model Description
24
+
25
+ This model leverages the powerful base of Meta's Llama 3.1 8B Instruct and fine-tunes it to understand and perform abductive reasoning in Arabic. Abductive reasoning is a form of logical inference that aims to find the simplest and most likely explanation for a set of observations.
26
+
27
+ The model was trained on an Arabic translation of the ART (Abductive Reasoning in narrative Text) dataset, which contains over 20,000 commonsense narrative contexts and 200,000 corresponding explanations. This allows the model to excel at tasks requiring the generation or identification of plausible hypotheses based on incomplete information presented in Arabic text.
28
+
29
+ * **Developed by:** Youssef Maged
30
+ * **Funded by:** \[More Information Needed]
31
+ * **Shared by:** Youssef Maged
32
+ * **Model type:** Decoder-only transformer-based language model.
33
+ * **Language(s) (NLP):** Arabic (ar)
34
+ * **License:** MIT
35
+ * **Finetuned from model:** meta-llama/Llama-3.1-8B-Instruct
36
+
37
+ ### Model Sources
38
+
39
+ * **Repository:** \[Link to your Hugging Face repository]
40
+ * **Paper:** Abductive Commonsense Reasoning
41
+ * **Demo:** \[More Information Needed]
42
+
43
+ ## Uses
44
+
45
+ ### Direct Use
46
+
47
+ The model is intended for direct use in generating and evaluating commonsense explanations in Arabic. It can be prompted with a scenario (a set of observations) to generate a plausible hypothesis that explains the situation.
48
+
49
+ #### Example Tasks:
50
+
51
+ * **Abductive Natural Language Generation (αNLG):** Given two observations, generate a hypothesis that explains the connection between them.
52
+ * **Abductive Natural Language Inference (αNLI):** Given a scenario and two potential hypotheses, choose the more plausible one.
53
+
54
+ ### Downstream Use
55
+
56
+ This model can serve as a foundational component for more complex applications, including:
57
+
58
+ * Advanced chatbots and virtual assistants with more human-like reasoning.
59
+ * Content analysis tools that can infer motivations or causes in text.
60
+ * Interactive storytelling and narrative generation systems.
61
+ * Educational tools for teaching critical thinking and reasoning skills in Arabic.
62
+
63
+ ### Out-of-Scope Use
64
+
65
+ * Not intended for making critical, high-stakes decisions without human oversight.
66
+ * Should not be used to generate malicious, harmful, or misleading content.
67
+ * Limited to commonsense knowledge and may not perform well in specialized or technical domains.
68
+
69
+ ## Bias, Risks, and Limitations
70
+
71
+ * **Inherited Bias:** May reflect cultural biases from the original English ART dataset or translation process.
72
+ * **Inaccurate Explanations:** Fluent but potentially illogical or factually incorrect outputs.
73
+ * **Limited Scope:** Restricted to patterns learned from the training data.
74
+
75
+ ### Recommendations
76
+
77
+ Implement content moderation and human-in-the-loop review for public-facing systems. Treat outputs as hypotheses, not facts.
78
+
79
+ ## How to Get Started with the Model
80
+
81
+ ```python
82
+ from transformers import AutoTokenizer, AutoModelForCausalLM
83
+ import torch
84
+
85
+ model_id = "[Your Hugging Face Model ID]"
86
+
87
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
88
+ model = AutoModelForCausalLM.from_pretrained(
89
+ model_id,
90
+ torch_dtype=torch.bfloat16,
91
+ device_map="auto",
92
+ )
93
+
94
+ observation1 = "علي دخل المطبخ."
95
+ observation2 = "بعد فترة وجيزة، انبعثت رائحة دخان."
96
+
97
+ prompt = f"Observation 1: {observation1}\nObservation 2: {observation2}\nHypothesis:"
98
+ inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
99
+
100
+ outputs = model.generate(**inputs, max_new_tokens=50, num_return_sequences=1)
101
+ generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
102
+
103
+ print(generated_text)
104
+ ```
105
+
106
+ ## Training Details
107
+
108
+ ### Training Data
109
+
110
+ Fine-tuned on an Arabic translation of the ART dataset (Bhagavatula et al. 2019) with \~20,000 narrative contexts and \~200,000 hypotheses.
111
+
112
+ ### Training Procedure
113
+
114
+ Supervised fine-tuning (SFT) objective using instruction-style prompts.
115
+
116
+ #### Preprocessing
117
+
118
+ * Translated ART dataset to Modern Standard Arabic.
119
+ * Tokenized using Llama-3.1 tokenizer.
120
+ * Reformatted into prompt-response format.
121
+
122
+ #### Training Hyperparameters
123
+
124
+ * **Training regime:** bf16 mixed-precision (via UniSloth framework)
125
+ * **Platform:** Google Colab with T4 GPU
126
+
127
+ #### Speeds, Sizes, Times
128
+
129
+ * **GPU:** NVIDIA T4
130
+ * **Training Time:** \[More Information Needed]
131
+ * **Batch Size:** \[More Information Needed]
132
+
133
+ ## Evaluation
134
+
135
+ ### Testing Data, Factors & Metrics
136
+
137
+ #### Testing Data
138
+
139
+ Held-out portion of Arabic-translated ART dataset.
140
+
141
+ #### Factors
142
+
143
+ Optional breakdown by reasoning type: causal, temporal, social.
144
+
145
+ #### Metrics
146
+
147
+ * **αNLI:** Accuracy for plausibility classification.
148
+ * **αNLG:** ROUGE, BLEU, BERTScore; Human evaluation suggested.
149
+
150
+ ### Results
151
+
152
+ | Metric | Test Set Result |
153
+ | --------------- | -------------------------- |
154
+ | Accuracy (αNLI) | \[More Information Needed] |
155
+ | ROUGE-L (αNLG) | \[More Information Needed] |
156
+
157
+ #### Summary
158
+
159
+ \[More Information Needed]
160
+
161
+ ## Model Examination
162
+
163
+ \[More Information Needed]
164
+
165
+ ## Environmental Impact
166
+
167
+ * **Hardware Type:** NVIDIA T4 GPU
168
+ * **Hours used:** \[More Information Needed]
169
+ * **Cloud Provider:** Google Colab
170
+ * **Compute Region:** \[More Information Needed]
171
+ * **Carbon Emitted:** \[More Information Needed]
172
+
173
+ ## Technical Specifications
174
+
175
+ ### Model Architecture and Objective
176
+
177
+ Decoder-only transformer fine-tuned with instruction tuning for abductive reasoning.
178
+
179
+ ### Compute Infrastructure
180
+
181
+ #### Hardware
182
+
183
+ NVIDIA T4 GPU (Google Colab)
184
+
185
+ #### Software
186
+
187
+ * UniSloth (fine-tuning framework)
188
+ * Hugging Face Transformers
189
+ * PyTorch
190
+
191
+ ## Citation
192
+
193
+ ```bibtex
194
+ @inproceedings{bhagavatula2020abductive,
195
+ title={Abductive Commonsense Reasoning},
196
+ author={Chandra Bhagavatula and Ronan Le Bras and Chaitanya Malaviya and Keisuke Sakaguchi and Ari Holtzman and Hannah Rashkin and Doug Downey and Wen-tau Yih and Yejin Choi},
197
+ booktitle={International Conference on Learning Representations},
198
+ year={2020},
199
+ url={https://openreview.net/forum?id=BygP6T4KPS}
200
+ }
201
+ ```
202
+
203
+ ## Glossary
204
+
205
+ * **Abductive Reasoning:** A logical inference method that seeks the most plausible explanation.
206
+ * **αNLG / αNLI:** Abductive generation and inference tasks.
207
+
208
+ ## More Information
209
+
210
+ \[More Information Needed]
211
+
212
+ ## Model Card Authors
213
+
214
+ Youssef Maged
215
+
216
+ ## Model Card Contact
217
+
218
+ \[Your Email or Contact Information]