NazmusAshrafi
commited on
Commit
•
2c6d315
1
Parent(s):
7927667
Add SetFit ABSA model
Browse files- README.md +1 -110
- config.json +1 -1
- tokenizer_config.json +7 -0
README.md
CHANGED
@@ -8,37 +8,10 @@ tags:
|
|
8 |
- generated_from_setfit_trainer
|
9 |
metrics:
|
10 |
- accuracy
|
11 |
-
widget:
|
12 |
-
- text: waiter:After sitting at the table with empty glasses for a 1/2 hour, we had
|
13 |
-
to ask the busboys to get us drinks as our waiter was nowhere to be found.
|
14 |
-
- text: presentation:The service was impeccible, the menu traditional but inventive
|
15 |
-
and presentation for the mostpart excellent but the food itself came up short.
|
16 |
-
- text: Friday night:Without reservations on a Friday night at 8:30 I was promptly
|
17 |
-
seated and given top-notch recommendations from both the host and my waiter.
|
18 |
-
- text: time:last time, the waiter told my roommate he'd have to charge her $5 for
|
19 |
-
mushrooms as one of her omelette choices (never heard that at my other favorite
|
20 |
-
brunch places.
|
21 |
-
- text: waitstaff:And the waitstaff has very little knowledge of the food, they served
|
22 |
-
me the wrong dish and no one could identify what it was that they gave me, someone
|
23 |
-
said pork chop, someone said lamb, and then they insisted it should be fine since
|
24 |
-
it was the same price.
|
25 |
pipeline_tag: text-classification
|
26 |
inference: false
|
27 |
base_model: sentence-transformers/paraphrase-mpnet-base-v2
|
28 |
-
model-index:
|
29 |
-
- name: SetFit Aspect Model with sentence-transformers/paraphrase-mpnet-base-v2
|
30 |
-
results:
|
31 |
-
- task:
|
32 |
-
type: text-classification
|
33 |
-
name: Text Classification
|
34 |
-
dataset:
|
35 |
-
name: Unknown
|
36 |
-
type: unknown
|
37 |
-
split: test
|
38 |
-
metrics:
|
39 |
-
- type: accuracy
|
40 |
-
value: 0.8051948051948052
|
41 |
-
name: Accuracy
|
42 |
---
|
43 |
|
44 |
# SetFit Aspect Model with sentence-transformers/paraphrase-mpnet-base-v2
|
@@ -77,19 +50,6 @@ This model was trained within the context of a larger system for ABSA, which loo
|
|
77 |
- **Paper:** [Efficient Few-Shot Learning Without Prompts](https://arxiv.org/abs/2209.11055)
|
78 |
- **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
|
79 |
|
80 |
-
### Model Labels
|
81 |
-
| Label | Examples |
|
82 |
-
|:----------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
83 |
-
| aspect | <ul><li>'decor:The decor is not special at all but their food and amazing prices make up for it.'</li><li>'food:The decor is not special at all but their food and amazing prices make up for it.'</li><li>'prices:The decor is not special at all but their food and amazing prices make up for it.'</li></ul> |
|
84 |
-
| no aspect | <ul><li>'party:when tables opened up, the manager sat another party before us.'</li><li>"offerings:Though the menu includes some unorthodox offerings (a peanut butter roll, for instance), the classics are pure and great--we've never had better sushi anywhere, including Japan."</li><li>"instance:Though the menu includes some unorthodox offerings (a peanut butter roll, for instance), the classics are pure and great--we've never had better sushi anywhere, including Japan."</li></ul> |
|
85 |
-
|
86 |
-
## Evaluation
|
87 |
-
|
88 |
-
### Metrics
|
89 |
-
| Label | Accuracy |
|
90 |
-
|:--------|:---------|
|
91 |
-
| **all** | 0.8052 |
|
92 |
-
|
93 |
## Uses
|
94 |
|
95 |
### Direct Use for Inference
|
@@ -140,75 +100,6 @@ preds = model("The food was great, but the venue is just way too busy.")
|
|
140 |
|
141 |
## Training Details
|
142 |
|
143 |
-
### Training Set Metrics
|
144 |
-
| Training set | Min | Median | Max |
|
145 |
-
|:-------------|:----|:--------|:----|
|
146 |
-
| Word count | 7 | 29.7429 | 63 |
|
147 |
-
|
148 |
-
| Label | Training Sample Count |
|
149 |
-
|:----------|:----------------------|
|
150 |
-
| no aspect | 115 |
|
151 |
-
| aspect | 130 |
|
152 |
-
|
153 |
-
### Training Hyperparameters
|
154 |
-
- batch_size: (16, 2)
|
155 |
-
- num_epochs: (1, 16)
|
156 |
-
- max_steps: -1
|
157 |
-
- sampling_strategy: oversampling
|
158 |
-
- body_learning_rate: (2e-05, 1e-05)
|
159 |
-
- head_learning_rate: 0.01
|
160 |
-
- loss: CosineSimilarityLoss
|
161 |
-
- distance_metric: cosine_distance
|
162 |
-
- margin: 0.25
|
163 |
-
- end_to_end: False
|
164 |
-
- use_amp: False
|
165 |
-
- warmup_proportion: 0.1
|
166 |
-
- seed: 42
|
167 |
-
- eval_max_steps: -1
|
168 |
-
- load_best_model_at_end: False
|
169 |
-
|
170 |
-
### Training Results
|
171 |
-
| Epoch | Step | Training Loss | Validation Loss |
|
172 |
-
|:------:|:----:|:-------------:|:---------------:|
|
173 |
-
| 0.0005 | 1 | 0.2136 | - |
|
174 |
-
| 0.0263 | 50 | 0.264 | - |
|
175 |
-
| 0.0527 | 100 | 0.2717 | - |
|
176 |
-
| 0.0790 | 150 | 0.2099 | - |
|
177 |
-
| 0.1053 | 200 | 0.1357 | - |
|
178 |
-
| 0.1316 | 250 | 0.1224 | - |
|
179 |
-
| 0.1580 | 300 | 0.0305 | - |
|
180 |
-
| 0.1843 | 350 | 0.0016 | - |
|
181 |
-
| 0.2106 | 400 | 0.0015 | - |
|
182 |
-
| 0.2370 | 450 | 0.0004 | - |
|
183 |
-
| 0.2633 | 500 | 0.0006 | - |
|
184 |
-
| 0.2896 | 550 | 0.0109 | - |
|
185 |
-
| 0.3160 | 600 | 0.0002 | - |
|
186 |
-
| 0.3423 | 650 | 0.0001 | - |
|
187 |
-
| 0.3686 | 700 | 0.0001 | - |
|
188 |
-
| 0.3949 | 750 | 0.0003 | - |
|
189 |
-
| 0.4213 | 800 | 0.0001 | - |
|
190 |
-
| 0.4476 | 850 | 0.0002 | - |
|
191 |
-
| 0.4739 | 900 | 0.0001 | - |
|
192 |
-
| 0.5003 | 950 | 0.0002 | - |
|
193 |
-
| 0.5266 | 1000 | 0.0001 | - |
|
194 |
-
| 0.5529 | 1050 | 0.0001 | - |
|
195 |
-
| 0.5793 | 1100 | 0.0001 | - |
|
196 |
-
| 0.6056 | 1150 | 0.0001 | - |
|
197 |
-
| 0.6319 | 1200 | 0.0002 | - |
|
198 |
-
| 0.6582 | 1250 | 0.0001 | - |
|
199 |
-
| 0.6846 | 1300 | 0.0001 | - |
|
200 |
-
| 0.7109 | 1350 | 0.0001 | - |
|
201 |
-
| 0.7372 | 1400 | 0.0001 | - |
|
202 |
-
| 0.7636 | 1450 | 0.0001 | - |
|
203 |
-
| 0.7899 | 1500 | 0.0001 | - |
|
204 |
-
| 0.8162 | 1550 | 0.0001 | - |
|
205 |
-
| 0.8425 | 1600 | 0.0169 | - |
|
206 |
-
| 0.8689 | 1650 | 0.0001 | - |
|
207 |
-
| 0.8952 | 1700 | 0.0001 | - |
|
208 |
-
| 0.9215 | 1750 | 0.0001 | - |
|
209 |
-
| 0.9479 | 1800 | 0.0001 | - |
|
210 |
-
| 0.9742 | 1850 | 0.0001 | - |
|
211 |
-
|
212 |
### Framework Versions
|
213 |
- Python: 3.10.12
|
214 |
- SetFit: 1.0.3
|
|
|
8 |
- generated_from_setfit_trainer
|
9 |
metrics:
|
10 |
- accuracy
|
11 |
+
widget: []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
pipeline_tag: text-classification
|
13 |
inference: false
|
14 |
base_model: sentence-transformers/paraphrase-mpnet-base-v2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
---
|
16 |
|
17 |
# SetFit Aspect Model with sentence-transformers/paraphrase-mpnet-base-v2
|
|
|
50 |
- **Paper:** [Efficient Few-Shot Learning Without Prompts](https://arxiv.org/abs/2209.11055)
|
51 |
- **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
|
52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
## Uses
|
54 |
|
55 |
### Direct Use for Inference
|
|
|
100 |
|
101 |
## Training Details
|
102 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
### Framework Versions
|
104 |
- Python: 3.10.12
|
105 |
- SetFit: 1.0.3
|
config.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
{
|
2 |
-
"_name_or_path": "
|
3 |
"architectures": [
|
4 |
"MPNetModel"
|
5 |
],
|
|
|
1 |
{
|
2 |
+
"_name_or_path": "NazmusAshrafi/atsa-mams-ds-setfit-MiniLM-mpnet-absa-tesla-tweet-aspect",
|
3 |
"architectures": [
|
4 |
"MPNetModel"
|
5 |
],
|
tokenizer_config.json
CHANGED
@@ -48,12 +48,19 @@
|
|
48 |
"do_lower_case": true,
|
49 |
"eos_token": "</s>",
|
50 |
"mask_token": "<mask>",
|
|
|
51 |
"model_max_length": 512,
|
52 |
"never_split": null,
|
|
|
53 |
"pad_token": "<pad>",
|
|
|
|
|
54 |
"sep_token": "</s>",
|
|
|
55 |
"strip_accents": null,
|
56 |
"tokenize_chinese_chars": true,
|
57 |
"tokenizer_class": "MPNetTokenizer",
|
|
|
|
|
58 |
"unk_token": "[UNK]"
|
59 |
}
|
|
|
48 |
"do_lower_case": true,
|
49 |
"eos_token": "</s>",
|
50 |
"mask_token": "<mask>",
|
51 |
+
"max_length": 512,
|
52 |
"model_max_length": 512,
|
53 |
"never_split": null,
|
54 |
+
"pad_to_multiple_of": null,
|
55 |
"pad_token": "<pad>",
|
56 |
+
"pad_token_type_id": 0,
|
57 |
+
"padding_side": "right",
|
58 |
"sep_token": "</s>",
|
59 |
+
"stride": 0,
|
60 |
"strip_accents": null,
|
61 |
"tokenize_chinese_chars": true,
|
62 |
"tokenizer_class": "MPNetTokenizer",
|
63 |
+
"truncation_side": "right",
|
64 |
+
"truncation_strategy": "longest_first",
|
65 |
"unk_token": "[UNK]"
|
66 |
}
|