Push model using huggingface_hub.
Browse files- README.md +82 -127
- config_sentence_transformers.json +2 -2
- model.safetensors +1 -1
- model_head.pkl +1 -1
README.md
CHANGED
@@ -10,13 +10,14 @@ tags:
|
|
10 |
- text-classification
|
11 |
- generated_from_setfit_trainer
|
12 |
widget:
|
13 |
-
- text:
|
14 |
-
|
15 |
-
- text:
|
16 |
-
- text:
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
20 |
inference: true
|
21 |
model-index:
|
22 |
- name: SetFit with akhooli/sbert_ar_nli_500k_norm
|
@@ -30,36 +31,10 @@ model-index:
|
|
30 |
split: test
|
31 |
metrics:
|
32 |
- type: accuracy
|
33 |
-
value: 0.
|
34 |
name: Accuracy
|
35 |
---
|
36 |
|
37 |
-
# usage
|
38 |
-
Usage:
|
39 |
-
```python
|
40 |
-
pip install setfit
|
41 |
-
from setfit import SetFitModel
|
42 |
-
from unicodedata import normalize
|
43 |
-
|
44 |
-
# Download model from Hub
|
45 |
-
model = SetFitModel.from_pretrained("akhooli/setfit_ar_hs")
|
46 |
-
# Run inference
|
47 |
-
queries = [
|
48 |
-
"سكت دهراً و نطق كفراً",
|
49 |
-
"الخلاف ﻻ يفسد للود قضية.",
|
50 |
-
"أنت شخص منبوذ. احترم أسيادك.",
|
51 |
-
"دع المكارم ﻻ ترحل لبغيتها واقعد فإنك أنت الطاعم الكاسي",
|
52 |
-
]
|
53 |
-
queries_n = [normalize('NFKC', query) for query in queries]
|
54 |
-
preds = model.predict(queries_n)
|
55 |
-
print(preds)
|
56 |
-
# if you want to see the probabilities for each label
|
57 |
-
probas = model.predict_proba(queries_n)
|
58 |
-
print(probas)
|
59 |
-
```
|
60 |
-
|
61 |
-
The rest of this content is auto-generated.
|
62 |
-
|
63 |
# SetFit with akhooli/sbert_ar_nli_500k_norm
|
64 |
|
65 |
This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. This SetFit model uses [akhooli/sbert_ar_nli_500k_norm](https://huggingface.co/akhooli/sbert_ar_nli_500k_norm) as the Sentence Transformer embedding model. A [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance is used for classification.
|
@@ -88,17 +63,17 @@ The model has been trained using an efficient few-shot learning technique that i
|
|
88 |
- **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
|
89 |
|
90 |
### Model Labels
|
91 |
-
| Label | Examples
|
92 |
-
|
93 |
-
| negative | <ul><li>'
|
94 |
-
| positive | <ul><li>'
|
95 |
|
96 |
## Evaluation
|
97 |
|
98 |
### Metrics
|
99 |
| Label | Accuracy |
|
100 |
|:--------|:---------|
|
101 |
-
| **all** | 0.
|
102 |
|
103 |
## Uses
|
104 |
|
@@ -118,7 +93,7 @@ from setfit import SetFitModel
|
|
118 |
# Download from the 🤗 Hub
|
119 |
model = SetFitModel.from_pretrained("akhooli/setfit_ar_hs")
|
120 |
# Run inference
|
121 |
-
preds = model("
|
122 |
```
|
123 |
|
124 |
<!--
|
@@ -150,17 +125,17 @@ preds = model("سد نيعك يا صرمايت بشار")
|
|
150 |
### Training Set Metrics
|
151 |
| Training set | Min | Median | Max |
|
152 |
|:-------------|:----|:--------|:----|
|
153 |
-
| Word count | 1 |
|
154 |
|
155 |
| Label | Training Sample Count |
|
156 |
|:---------|:----------------------|
|
157 |
-
| negative |
|
158 |
-
| positive |
|
159 |
|
160 |
### Training Hyperparameters
|
161 |
- batch_size: (32, 32)
|
162 |
- num_epochs: (1, 1)
|
163 |
-
- max_steps:
|
164 |
- sampling_strategy: undersampling
|
165 |
- body_learning_rate: (2e-05, 1e-05)
|
166 |
- head_learning_rate: 0.01
|
@@ -172,99 +147,79 @@ preds = model("سد نيعك يا صرمايت بشار")
|
|
172 |
- warmup_proportion: 0.1
|
173 |
- l2_weight: 0.01
|
174 |
- seed: 42
|
175 |
-
- run_name:
|
176 |
- eval_max_steps: -1
|
177 |
- load_best_model_at_end: False
|
178 |
|
179 |
### Training Results
|
180 |
| Epoch | Step | Training Loss | Validation Loss |
|
181 |
|:------:|:----:|:-------------:|:---------------:|
|
182 |
-
| 0.0003 | 1 | 0.
|
183 |
-
| 0.
|
184 |
-
| 0.
|
185 |
-
| 0.
|
186 |
-
| 0.
|
187 |
-
| 0.
|
188 |
-
| 0.
|
189 |
-
| 0.
|
190 |
-
| 0.
|
191 |
-
| 0.
|
192 |
-
| 0.
|
193 |
-
| 0.
|
194 |
-
| 0.
|
195 |
-
| 0.
|
196 |
-
| 0.
|
197 |
-
| 0.
|
198 |
-
| 0.
|
199 |
-
| 0.
|
200 |
-
| 0.
|
201 |
-
| 0.
|
202 |
-
| 0.
|
203 |
-
| 0.
|
204 |
-
| 0.
|
205 |
-
| 0.
|
206 |
-
| 0.
|
207 |
-
| 0.
|
208 |
-
| 0.
|
209 |
-
| 0.
|
210 |
-
| 0.
|
211 |
-
| 0.
|
212 |
-
| 0
|
213 |
-
|
|
214 |
-
|
|
215 |
-
|
|
216 |
-
|
|
217 |
-
|
|
218 |
-
|
|
219 |
-
|
|
220 |
-
|
|
221 |
-
|
|
222 |
-
| 1.
|
223 |
-
| 1.
|
224 |
-
| 1.
|
225 |
-
| 1.
|
226 |
-
| 1.
|
227 |
-
| 1.
|
228 |
-
| 1.
|
229 |
-
| 1.
|
230 |
-
| 1.
|
231 |
-
| 1.
|
232 |
-
| 1.
|
233 |
-
| 1.
|
234 |
-
| 1.
|
235 |
-
| 1.
|
236 |
-
| 1.
|
237 |
-
| 1.
|
238 |
-
| 1.
|
239 |
-
| 1.
|
240 |
-
| 1.
|
241 |
-
| 1.
|
242 |
-
|
|
243 |
-
| 1.525 | 6100 | 0.0015 | - |
|
244 |
-
| 1.55 | 6200 | 0.0009 | - |
|
245 |
-
| 1.575 | 6300 | 0.001 | - |
|
246 |
-
| 1.6 | 6400 | 0.0002 | - |
|
247 |
-
| 1.625 | 6500 | 0.0004 | - |
|
248 |
-
| 1.65 | 6600 | 0.0012 | - |
|
249 |
-
| 1.675 | 6700 | 0.0011 | - |
|
250 |
-
| 1.7 | 6800 | 0.0008 | - |
|
251 |
-
| 1.725 | 6900 | 0.0013 | - |
|
252 |
-
| 1.75 | 7000 | 0.0004 | - |
|
253 |
-
| 1.775 | 7100 | 0.0004 | - |
|
254 |
-
| 1.8 | 7200 | 0.0008 | - |
|
255 |
-
| 1.825 | 7300 | 0.0007 | - |
|
256 |
-
| 1.85 | 7400 | 0.0007 | - |
|
257 |
-
| 1.875 | 7500 | 0.001 | - |
|
258 |
-
| 1.9 | 7600 | 0.001 | - |
|
259 |
-
| 1.925 | 7700 | 0.0002 | - |
|
260 |
-
| 1.95 | 7800 | 0.0005 | - |
|
261 |
-
| 1.975 | 7900 | 0.0009 | - |
|
262 |
-
| 2.0 | 8000 | 0.0002 | - |
|
263 |
|
264 |
### Framework Versions
|
265 |
- Python: 3.10.14
|
266 |
- SetFit: 1.2.0.dev0
|
267 |
-
- Sentence Transformers: 3.
|
268 |
- Transformers: 4.45.1
|
269 |
- PyTorch: 2.4.0
|
270 |
- Datasets: 3.0.1
|
|
|
10 |
- text-classification
|
11 |
- generated_from_setfit_trainer
|
12 |
widget:
|
13 |
+
- text: عيب يا كلبة لما تجيبي سيرة مصر وتقولي عليها شعب فقير ومشرد يا لبنانيين يا
|
14 |
+
انجاس, فعلا ده انتو شعب كلاب
|
15 |
+
- text: قوية
|
16 |
+
- text: '#لو_ينقطع_المكياج
|
17 |
+
|
18 |
+
اتوقع في هالزمن الذكور اللي بيبكون عليه مو البنات😂😂'
|
19 |
+
- text: كول هوا وسد بوزك معلمك لجاسوس لمجرم بدو شد شعر لشايب
|
20 |
+
- text: هاد سعودي ، وانت خليك بحالك يا سوري ولا انت تقليد سوري
|
21 |
inference: true
|
22 |
model-index:
|
23 |
- name: SetFit with akhooli/sbert_ar_nli_500k_norm
|
|
|
31 |
split: test
|
32 |
metrics:
|
33 |
- type: accuracy
|
34 |
+
value: 0.8604206500956023
|
35 |
name: Accuracy
|
36 |
---
|
37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
# SetFit with akhooli/sbert_ar_nli_500k_norm
|
39 |
|
40 |
This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. This SetFit model uses [akhooli/sbert_ar_nli_500k_norm](https://huggingface.co/akhooli/sbert_ar_nli_500k_norm) as the Sentence Transformer embedding model. A [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance is used for classification.
|
|
|
63 |
- **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
|
64 |
|
65 |
### Model Labels
|
66 |
+
| Label | Examples |
|
67 |
+
|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
68 |
+
| negative | <ul><li>'نحن نثق بال قضاء اللبناني'</li><li>'مابين السطور.....\nالمنطقة الآمنة ستكون منطقة آمنة برعاية أمريكية لحماية الأكراد من تركيا.....'</li><li>'لم يكن خطاب الوزير جبران باسيل في إفتتاح القمة الإقتصادية بمستوى تطلعات اللبنانيين فبدل أن يركز لإطلاع الوفود على ما يع...'</li></ul> |
|
69 |
+
| positive | <ul><li>'هيدا العلم صار مماسح للصرامي انت عايشه بكوكب تاني حالتك بالويل الشهره مش هيك وحياتك لما بتك...'</li><li>'سليل الحسب فعلا سليل الجحش ابن الجحش ابن الوحش سليله حيونه بامتياز'</li><li>'سارقا من عند اومك مش شايف قديش بتشبها هيدي كانت تقعدك عليها لما تعزب يا نوتي ونسيت قلك كول هوا'</li></ul> |
|
70 |
|
71 |
## Evaluation
|
72 |
|
73 |
### Metrics
|
74 |
| Label | Accuracy |
|
75 |
|:--------|:---------|
|
76 |
+
| **all** | 0.8604 |
|
77 |
|
78 |
## Uses
|
79 |
|
|
|
93 |
# Download from the 🤗 Hub
|
94 |
model = SetFitModel.from_pretrained("akhooli/setfit_ar_hs")
|
95 |
# Run inference
|
96 |
+
preds = model("قوية")
|
97 |
```
|
98 |
|
99 |
<!--
|
|
|
125 |
### Training Set Metrics
|
126 |
| Training set | Min | Median | Max |
|
127 |
|:-------------|:----|:--------|:----|
|
128 |
+
| Word count | 1 | 14.4687 | 102 |
|
129 |
|
130 |
| Label | Training Sample Count |
|
131 |
|:---------|:----------------------|
|
132 |
+
| negative | 2669 |
|
133 |
+
| positive | 3200 |
|
134 |
|
135 |
### Training Hyperparameters
|
136 |
- batch_size: (32, 32)
|
137 |
- num_epochs: (1, 1)
|
138 |
+
- max_steps: 6000
|
139 |
- sampling_strategy: undersampling
|
140 |
- body_learning_rate: (2e-05, 1e-05)
|
141 |
- head_learning_rate: 0.01
|
|
|
147 |
- warmup_proportion: 0.1
|
148 |
- l2_weight: 0.01
|
149 |
- seed: 42
|
150 |
+
- run_name: setfit_hate_32k_aub_6k
|
151 |
- eval_max_steps: -1
|
152 |
- load_best_model_at_end: False
|
153 |
|
154 |
### Training Results
|
155 |
| Epoch | Step | Training Loss | Validation Loss |
|
156 |
|:------:|:----:|:-------------:|:---------------:|
|
157 |
+
| 0.0003 | 1 | 0.3207 | - |
|
158 |
+
| 0.0333 | 100 | 0.2837 | - |
|
159 |
+
| 0.0667 | 200 | 0.2406 | - |
|
160 |
+
| 0.1 | 300 | 0.1982 | - |
|
161 |
+
| 0.1333 | 400 | 0.1447 | - |
|
162 |
+
| 0.1667 | 500 | 0.1014 | - |
|
163 |
+
| 0.2 | 600 | 0.0791 | - |
|
164 |
+
| 0.2333 | 700 | 0.0578 | - |
|
165 |
+
| 0.2667 | 800 | 0.0406 | - |
|
166 |
+
| 0.3 | 900 | 0.0304 | - |
|
167 |
+
| 0.3333 | 1000 | 0.0282 | - |
|
168 |
+
| 0.3667 | 1100 | 0.0263 | - |
|
169 |
+
| 0.4 | 1200 | 0.0203 | - |
|
170 |
+
| 0.4333 | 1300 | 0.0195 | - |
|
171 |
+
| 0.4667 | 1400 | 0.0169 | - |
|
172 |
+
| 0.5 | 1500 | 0.0157 | - |
|
173 |
+
| 0.5333 | 1600 | 0.0137 | - |
|
174 |
+
| 0.5667 | 1700 | 0.0107 | - |
|
175 |
+
| 0.6 | 1800 | 0.0138 | - |
|
176 |
+
| 0.6333 | 1900 | 0.0104 | - |
|
177 |
+
| 0.6667 | 2000 | 0.0083 | - |
|
178 |
+
| 0.7 | 2100 | 0.0074 | - |
|
179 |
+
| 0.7333 | 2200 | 0.0089 | - |
|
180 |
+
| 0.7667 | 2300 | 0.0082 | - |
|
181 |
+
| 0.8 | 2400 | 0.0066 | - |
|
182 |
+
| 0.8333 | 2500 | 0.0063 | - |
|
183 |
+
| 0.8667 | 2600 | 0.0075 | - |
|
184 |
+
| 0.9 | 2700 | 0.006 | - |
|
185 |
+
| 0.9333 | 2800 | 0.0065 | - |
|
186 |
+
| 0.9667 | 2900 | 0.0084 | - |
|
187 |
+
| 1.0 | 3000 | 0.007 | - |
|
188 |
+
| 1.0333 | 3100 | 0.0039 | - |
|
189 |
+
| 1.0667 | 3200 | 0.006 | - |
|
190 |
+
| 1.1 | 3300 | 0.0039 | - |
|
191 |
+
| 1.1333 | 3400 | 0.004 | - |
|
192 |
+
| 1.1667 | 3500 | 0.0051 | - |
|
193 |
+
| 1.2 | 3600 | 0.0034 | - |
|
194 |
+
| 1.2333 | 3700 | 0.0041 | - |
|
195 |
+
| 1.2667 | 3800 | 0.0047 | - |
|
196 |
+
| 1.3 | 3900 | 0.0045 | - |
|
197 |
+
| 1.3333 | 4000 | 0.0031 | - |
|
198 |
+
| 1.3667 | 4100 | 0.0026 | - |
|
199 |
+
| 1.4 | 4200 | 0.0031 | - |
|
200 |
+
| 1.4333 | 4300 | 0.0027 | - |
|
201 |
+
| 1.4667 | 4400 | 0.0027 | - |
|
202 |
+
| 1.5 | 4500 | 0.0026 | - |
|
203 |
+
| 1.5333 | 4600 | 0.0026 | - |
|
204 |
+
| 1.5667 | 4700 | 0.0045 | - |
|
205 |
+
| 1.6 | 4800 | 0.0022 | - |
|
206 |
+
| 1.6333 | 4900 | 0.0031 | - |
|
207 |
+
| 1.6667 | 5000 | 0.0019 | - |
|
208 |
+
| 1.7 | 5100 | 0.003 | - |
|
209 |
+
| 1.7333 | 5200 | 0.0026 | - |
|
210 |
+
| 1.7667 | 5300 | 0.0015 | - |
|
211 |
+
| 1.8 | 5400 | 0.0023 | - |
|
212 |
+
| 1.8333 | 5500 | 0.0013 | - |
|
213 |
+
| 1.8667 | 5600 | 0.002 | - |
|
214 |
+
| 1.9 | 5700 | 0.002 | - |
|
215 |
+
| 1.9333 | 5800 | 0.002 | - |
|
216 |
+
| 1.9667 | 5900 | 0.0013 | - |
|
217 |
+
| 2.0 | 6000 | 0.0025 | - |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
218 |
|
219 |
### Framework Versions
|
220 |
- Python: 3.10.14
|
221 |
- SetFit: 1.2.0.dev0
|
222 |
+
- Sentence Transformers: 3.3.0
|
223 |
- Transformers: 4.45.1
|
224 |
- PyTorch: 2.4.0
|
225 |
- Datasets: 3.0.1
|
config_sentence_transformers.json
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
{
|
2 |
"__version__": {
|
3 |
-
"sentence_transformers": "3.
|
4 |
"transformers": "4.45.1",
|
5 |
"pytorch": "2.4.0"
|
6 |
},
|
7 |
"prompts": {},
|
8 |
"default_prompt_name": null,
|
9 |
-
"similarity_fn_name":
|
10 |
}
|
|
|
1 |
{
|
2 |
"__version__": {
|
3 |
+
"sentence_transformers": "3.3.0",
|
4 |
"transformers": "4.45.1",
|
5 |
"pytorch": "2.4.0"
|
6 |
},
|
7 |
"prompts": {},
|
8 |
"default_prompt_name": null,
|
9 |
+
"similarity_fn_name": "cosine"
|
10 |
}
|
model.safetensors
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
size 540795752
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6e53bc73324852ad3b3f916abc97db998e14faf5978efcabda8159a4b6a28c38
|
3 |
size 540795752
|
model_head.pkl
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
size 7007
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1a2197e3024da352ef97e5dae14a830c505b6e96ba6a1edce40307131375d34b
|
3 |
size 7007
|