Kamel commited on
Commit
d4e9268
·
verified ·
1 Parent(s): 520cde5

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +37 -174
README.md CHANGED
@@ -16,197 +16,60 @@ widget:
16
 
17
  ---
18
 
19
- # Model Card for Model ID
20
-
21
- <!-- Provide a quick summary of what the model is/does. -->
22
 
 
23
 
 
 
24
 
25
  ## Model Details
26
 
27
- ### Model Description
28
-
29
- <!-- Provide a longer summary of what this model is. -->
30
-
31
- This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
32
-
33
- - **Developed by:** [More Information Needed]
34
- - **Funded by [optional]:** [More Information Needed]
35
- - **Shared by [optional]:** [More Information Needed]
36
- - **Model type:** [More Information Needed]
37
- - **Language(s) (NLP):** [More Information Needed]
38
- - **License:** [More Information Needed]
39
- - **Finetuned from model [optional]:** [More Information Needed]
40
-
41
- ### Model Sources [optional]
42
-
43
- <!-- Provide the basic links for the model. -->
44
-
45
- - **Repository:** [More Information Needed]
46
- - **Paper [optional]:** [More Information Needed]
47
- - **Demo [optional]:** [More Information Needed]
48
-
49
- ## Uses
50
-
51
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
52
-
53
- ### Direct Use
54
 
55
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
56
 
57
- [More Information Needed]
58
 
59
- ### Downstream Use [optional]
 
 
60
 
61
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
 
62
 
63
- [More Information Needed]
 
 
64
 
65
- ### Out-of-Scope Use
 
 
66
 
67
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
 
68
 
69
- [More Information Needed]
 
70
 
71
- ## Bias, Risks, and Limitations
 
 
 
72
 
73
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
 
74
 
75
- [More Information Needed]
76
-
77
- ### Recommendations
78
-
79
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
80
-
81
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
82
-
83
- ## How to Get Started with the Model
84
-
85
- Use the code below to get started with the model.
86
-
87
- [More Information Needed]
88
-
89
- ## Training Details
90
 
91
  ### Training Data
 
92
 
93
- <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
94
-
95
- [More Information Needed]
96
-
97
- ### Training Procedure
98
-
99
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
100
-
101
- #### Preprocessing [optional]
102
-
103
- [More Information Needed]
104
-
105
-
106
- #### Training Hyperparameters
107
-
108
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
109
-
110
- #### Speeds, Sizes, Times [optional]
111
-
112
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
113
-
114
- [More Information Needed]
115
-
116
- ## Evaluation
117
-
118
- <!-- This section describes the evaluation protocols and provides the results. -->
119
-
120
- ### Testing Data, Factors & Metrics
121
-
122
- #### Testing Data
123
-
124
- <!-- This should link to a Dataset Card if possible. -->
125
-
126
- [More Information Needed]
127
-
128
- #### Factors
129
-
130
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
131
-
132
- [More Information Needed]
133
-
134
- #### Metrics
135
-
136
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
137
-
138
- [More Information Needed]
139
-
140
- ### Results
141
-
142
- [More Information Needed]
143
-
144
- #### Summary
145
-
146
-
147
-
148
- ## Model Examination [optional]
149
-
150
- <!-- Relevant interpretability work for the model goes here -->
151
-
152
- [More Information Needed]
153
-
154
- ## Environmental Impact
155
-
156
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
157
-
158
- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
159
-
160
- - **Hardware Type:** [More Information Needed]
161
- - **Hours used:** [More Information Needed]
162
- - **Cloud Provider:** [More Information Needed]
163
- - **Compute Region:** [More Information Needed]
164
- - **Carbon Emitted:** [More Information Needed]
165
-
166
- ## Technical Specifications [optional]
167
-
168
- ### Model Architecture and Objective
169
-
170
- [More Information Needed]
171
-
172
- ### Compute Infrastructure
173
-
174
- [More Information Needed]
175
-
176
- #### Hardware
177
-
178
- [More Information Needed]
179
-
180
- #### Software
181
-
182
- [More Information Needed]
183
-
184
- ## Citation [optional]
185
-
186
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
187
-
188
- **BibTeX:**
189
-
190
- [More Information Needed]
191
-
192
- **APA:**
193
-
194
- [More Information Needed]
195
-
196
- ## Glossary [optional]
197
-
198
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
199
-
200
- [More Information Needed]
201
-
202
- ## More Information [optional]
203
-
204
- [More Information Needed]
205
-
206
- ## Model Card Authors [optional]
207
-
208
- [More Information Needed]
209
-
210
- ## Model Card Contact
211
 
212
- [More Information Needed]
 
 
 
 
16
 
17
  ---
18
 
19
+ # Multiclass SDG Detection with ArBERTv2
 
 
20
 
21
+ This model is a multiclass classifier fine-tuned on the ArBERTv2 architecture, designed to identify specific Sustainable Development Goals (SDGs) mentioned in Arabic text. It classifies text into multiple SDG categories once it has been identified as SDG-related.
22
 
23
+ # Prerequisite
24
+ Before running this model, input texts must first be classified as SDG-related using the binary classifier [Kamel/AraSDG_Binary](https://huggingface.co/Kamel/AraSDG_Binary). This model only applies to articles that are confirmed to mention SDGs.
25
 
26
  ## Model Details
27
 
28
+ ### Intended Use
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
 
 
30
 
31
+ This model is intended for use in detecting specific SDGs within Arabic text that has already been identified as SDG-related. It can be applied to large collections of articles, reports, or social media texts for content classification across multiple SDG categories.
32
 
33
+ ### How to Use
34
+ #### Step 1: Use the Binary SDG Classifier
35
+ Ensure that articles are first passed through the binary SDG classifier to determine if they are SDG-related. Only proceed with articles where the binary classifier predicts an SDG-related output.
36
 
37
+ #### Step 2: Use the Multiclass Model
38
+ Once an article is classified as SDG-related, use the following code to predict the specific SDG category.
39
 
40
+ ````python
41
+ from transformers import AutoModelForSequenceClassification, AutoTokenizer
42
+ import torch
43
 
44
+ # Load the model and tokenizer
45
+ tokenizer = AutoTokenizer.from_pretrained("Kamel/AraSDG_MultiClass")
46
+ model = AutoModelForSequenceClassification.from_pretrained("Kamel/AraSDG_MultiClass")
47
 
48
+ # Example text input (only use if the binary classifier predicts SDG-related)
49
+ text = "your Arabic text here"
50
 
51
+ # Tokenize input
52
+ inputs = tokenizer(text, return_tensors="pt")
53
 
54
+ # Perform inference
55
+ with torch.no_grad():
56
+ outputs = model(**inputs)
57
+ logits = outputs.logits
58
 
59
+ # Get the predicted class (specific SDG class)
60
+ predicted_class = torch.argmax(logits, dim=-1).item()
61
 
62
+ # Print the result (you can map this to specific SDG labels as needed)
63
+ print(f"Predicted SDG class: {predicted_class}")
64
+ ````
 
 
 
 
 
 
 
 
 
 
 
 
65
 
66
  ### Training Data
67
+ The model was fine-tuned on a dataset of Arabic news articles, each labeled with a specific SDG category (e.g., SDG 1, SDG 2, etc.). The training data was augmented with synthetic content to ensure balanced representation across different SDGs.
68
 
69
+ ### Performance
70
+ The model achieves an average macro F1-score of 87%, performing well across a range of SDG categories.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
 
72
+ ### Limitations
73
+ * Prerequisite: This model assumes the input text has already been classified as SDG-related by a binary classifier.
74
+ * The model is trained on Modern Standard Arabic (MSA) and may not perform as well on dialectal variations.
75
+ * Some SDGs may have more training data than others, leading to potential bias in predictions.