Add SetFit ABSA model
Browse files- README.md +47 -34
- config.json +1 -1
- config_setfit.json +1 -0
- model_head.pkl +1 -1
- pytorch_model.bin +1 -1
README.md
CHANGED
@@ -13,24 +13,26 @@ datasets:
|
|
13 |
metrics:
|
14 |
- accuracy
|
15 |
widget:
|
16 |
-
- text:
|
17 |
-
|
18 |
-
- text:
|
19 |
-
|
20 |
-
|
21 |
-
- text:
|
22 |
-
|
23 |
-
- text:
|
|
|
|
|
24 |
pipeline_tag: text-classification
|
25 |
inference: false
|
26 |
co2_eq_emissions:
|
27 |
-
emissions:
|
28 |
source: codecarbon
|
29 |
training_type: fine-tuning
|
30 |
on_cloud: false
|
31 |
cpu_model: 13th Gen Intel(R) Core(TM) i7-13700K
|
32 |
ram_total_size: 31.777088165283203
|
33 |
-
hours_used: 0.
|
34 |
hardware_used: 1 x NVIDIA GeForce RTX 3090
|
35 |
base_model: BAAI/bge-small-en-v1.5
|
36 |
model-index:
|
@@ -45,7 +47,7 @@ model-index:
|
|
45 |
split: test
|
46 |
metrics:
|
47 |
- type: accuracy
|
48 |
-
value: 0.
|
49 |
name: Accuracy
|
50 |
---
|
51 |
|
@@ -70,6 +72,7 @@ This model was trained within the context of a larger system for ABSA, which loo
|
|
70 |
- **Model Type:** SetFit
|
71 |
- **Sentence Transformer body:** [BAAI/bge-small-en-v1.5](https://huggingface.co/BAAI/bge-small-en-v1.5)
|
72 |
- **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
|
|
|
73 |
- **SetFitABSA Aspect Model:** [tomaarsen/setfit-absa-bge-small-en-v1.5-restaurants-aspect](https://huggingface.co/tomaarsen/setfit-absa-bge-small-en-v1.5-restaurants-aspect)
|
74 |
- **SetFitABSA Polarity Model:** [tomaarsen/setfit-absa-bge-small-en-v1.5-restaurants-polarity](https://huggingface.co/tomaarsen/setfit-absa-bge-small-en-v1.5-restaurants-polarity)
|
75 |
- **Maximum Sequence Length:** 512 tokens
|
@@ -95,7 +98,7 @@ This model was trained within the context of a larger system for ABSA, which loo
|
|
95 |
### Metrics
|
96 |
| Label | Accuracy |
|
97 |
|:--------|:---------|
|
98 |
-
| **all** | 0.
|
99 |
|
100 |
## Uses
|
101 |
|
@@ -150,12 +153,12 @@ preds = model("The food was great, but the venue is just way too busy.")
|
|
150 |
### Training Set Metrics
|
151 |
| Training set | Min | Median | Max |
|
152 |
|:-------------|:----|:--------|:----|
|
153 |
-
| Word count | 4 | 19.
|
154 |
|
155 |
| Label | Training Sample Count |
|
156 |
|:----------|:----------------------|
|
157 |
-
| no aspect |
|
158 |
-
| aspect |
|
159 |
|
160 |
### Training Hyperparameters
|
161 |
- batch_size: (256, 256)
|
@@ -171,34 +174,43 @@ preds = model("The food was great, but the venue is just way too busy.")
|
|
171 |
- use_amp: True
|
172 |
- warmup_proportion: 0.1
|
173 |
- seed: 42
|
|
|
174 |
- load_best_model_at_end: True
|
175 |
|
176 |
### Training Results
|
177 |
| Epoch | Step | Training Loss | Validation Loss |
|
178 |
|:----------:|:-------:|:-------------:|:---------------:|
|
179 |
-
| 0.0027 | 1 | 0.
|
180 |
-
| 0.
|
181 |
-
| 0.
|
182 |
-
| 0.
|
183 |
-
| 0.
|
184 |
-
| 0.
|
185 |
-
|
|
186 |
-
| 0.
|
187 |
-
| 1.
|
188 |
-
| 1.
|
189 |
-
| 1.
|
190 |
-
| 1.
|
191 |
-
| 1.
|
192 |
-
| 1.
|
193 |
-
| 1.
|
194 |
-
| 2.
|
195 |
-
| 2.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
196 |
|
197 |
* The bold row denotes the saved checkpoint.
|
198 |
### Environmental Impact
|
199 |
Carbon emissions were measured using [CodeCarbon](https://github.com/mlco2/codecarbon).
|
200 |
-
- **Carbon Emitted**: 0.
|
201 |
-
- **Hours Used**: 0.
|
202 |
|
203 |
### Training Hardware
|
204 |
- **On Cloud**: No
|
@@ -210,6 +222,7 @@ Carbon emissions were measured using [CodeCarbon](https://github.com/mlco2/codec
|
|
210 |
- Python: 3.9.16
|
211 |
- SetFit: 1.0.0.dev0
|
212 |
- Sentence Transformers: 2.2.2
|
|
|
213 |
- Transformers: 4.29.0
|
214 |
- PyTorch: 1.13.1+cu117
|
215 |
- Datasets: 2.15.0
|
|
|
13 |
metrics:
|
14 |
- accuracy
|
15 |
widget:
|
16 |
+
- text: bottles of wine:bottles of wine are cheap and good.
|
17 |
+
- text: world:I also ordered the Change Mojito, which was out of this world.
|
18 |
+
- text: bar:We were still sitting at the bar while we drank the sangria, but facing
|
19 |
+
away from the bar when we turned back around, the $2 was gone the people next
|
20 |
+
to us said the bartender took it.
|
21 |
+
- text: word:word of advice, save room for pasta dishes and never leave until you've
|
22 |
+
had the tiramisu.
|
23 |
+
- text: bartender:We were still sitting at the bar while we drank the sangria, but
|
24 |
+
facing away from the bar when we turned back around, the $2 was gone the people
|
25 |
+
next to us said the bartender took it.
|
26 |
pipeline_tag: text-classification
|
27 |
inference: false
|
28 |
co2_eq_emissions:
|
29 |
+
emissions: 18.322516829847984
|
30 |
source: codecarbon
|
31 |
training_type: fine-tuning
|
32 |
on_cloud: false
|
33 |
cpu_model: 13th Gen Intel(R) Core(TM) i7-13700K
|
34 |
ram_total_size: 31.777088165283203
|
35 |
+
hours_used: 0.303
|
36 |
hardware_used: 1 x NVIDIA GeForce RTX 3090
|
37 |
base_model: BAAI/bge-small-en-v1.5
|
38 |
model-index:
|
|
|
47 |
split: test
|
48 |
metrics:
|
49 |
- type: accuracy
|
50 |
+
value: 0.8623188405797102
|
51 |
name: Accuracy
|
52 |
---
|
53 |
|
|
|
72 |
- **Model Type:** SetFit
|
73 |
- **Sentence Transformer body:** [BAAI/bge-small-en-v1.5](https://huggingface.co/BAAI/bge-small-en-v1.5)
|
74 |
- **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
|
75 |
+
- **spaCy Model:** en_core_web_lg
|
76 |
- **SetFitABSA Aspect Model:** [tomaarsen/setfit-absa-bge-small-en-v1.5-restaurants-aspect](https://huggingface.co/tomaarsen/setfit-absa-bge-small-en-v1.5-restaurants-aspect)
|
77 |
- **SetFitABSA Polarity Model:** [tomaarsen/setfit-absa-bge-small-en-v1.5-restaurants-polarity](https://huggingface.co/tomaarsen/setfit-absa-bge-small-en-v1.5-restaurants-polarity)
|
78 |
- **Maximum Sequence Length:** 512 tokens
|
|
|
98 |
### Metrics
|
99 |
| Label | Accuracy |
|
100 |
|:--------|:---------|
|
101 |
+
| **all** | 0.8623 |
|
102 |
|
103 |
## Uses
|
104 |
|
|
|
153 |
### Training Set Metrics
|
154 |
| Training set | Min | Median | Max |
|
155 |
|:-------------|:----|:--------|:----|
|
156 |
+
| Word count | 4 | 19.3576 | 45 |
|
157 |
|
158 |
| Label | Training Sample Count |
|
159 |
|:----------|:----------------------|
|
160 |
+
| no aspect | 170 |
|
161 |
+
| aspect | 255 |
|
162 |
|
163 |
### Training Hyperparameters
|
164 |
- batch_size: (256, 256)
|
|
|
174 |
- use_amp: True
|
175 |
- warmup_proportion: 0.1
|
176 |
- seed: 42
|
177 |
+
- eval_max_steps: -1
|
178 |
- load_best_model_at_end: True
|
179 |
|
180 |
### Training Results
|
181 |
| Epoch | Step | Training Loss | Validation Loss |
|
182 |
|:----------:|:-------:|:-------------:|:---------------:|
|
183 |
+
| 0.0027 | 1 | 0.2498 | - |
|
184 |
+
| 0.1355 | 50 | 0.2442 | - |
|
185 |
+
| 0.2710 | 100 | 0.2462 | 0.2496 |
|
186 |
+
| 0.4065 | 150 | 0.2282 | - |
|
187 |
+
| 0.5420 | 200 | 0.0752 | 0.1686 |
|
188 |
+
| 0.6775 | 250 | 0.0124 | - |
|
189 |
+
| 0.8130 | 300 | 0.0128 | 0.1884 |
|
190 |
+
| 0.9485 | 350 | 0.0062 | - |
|
191 |
+
| 1.0840 | 400 | 0.0012 | 0.183 |
|
192 |
+
| 1.2195 | 450 | 0.0009 | - |
|
193 |
+
| 1.3550 | 500 | 0.0008 | 0.2072 |
|
194 |
+
| 1.4905 | 550 | 0.0031 | - |
|
195 |
+
| 1.6260 | 600 | 0.0006 | 0.1716 |
|
196 |
+
| 1.7615 | 650 | 0.0005 | - |
|
197 |
+
| **1.8970** | **700** | **0.0005** | **0.1666** |
|
198 |
+
| 2.0325 | 750 | 0.0005 | - |
|
199 |
+
| 2.1680 | 800 | 0.0004 | 0.2086 |
|
200 |
+
| 2.3035 | 850 | 0.0005 | - |
|
201 |
+
| 2.4390 | 900 | 0.0004 | 0.183 |
|
202 |
+
| 2.5745 | 950 | 0.0004 | - |
|
203 |
+
| 2.7100 | 1000 | 0.0036 | 0.1725 |
|
204 |
+
| 2.8455 | 1050 | 0.0004 | - |
|
205 |
+
| 2.9810 | 1100 | 0.0003 | 0.1816 |
|
206 |
+
| 3.1165 | 1150 | 0.0004 | - |
|
207 |
+
| 3.2520 | 1200 | 0.0003 | 0.1802 |
|
208 |
|
209 |
* The bold row denotes the saved checkpoint.
|
210 |
### Environmental Impact
|
211 |
Carbon emissions were measured using [CodeCarbon](https://github.com/mlco2/codecarbon).
|
212 |
+
- **Carbon Emitted**: 0.018 kg of CO2
|
213 |
+
- **Hours Used**: 0.303 hours
|
214 |
|
215 |
### Training Hardware
|
216 |
- **On Cloud**: No
|
|
|
222 |
- Python: 3.9.16
|
223 |
- SetFit: 1.0.0.dev0
|
224 |
- Sentence Transformers: 2.2.2
|
225 |
+
- spaCy: 3.7.2
|
226 |
- Transformers: 4.29.0
|
227 |
- PyTorch: 1.13.1+cu117
|
228 |
- Datasets: 2.15.0
|
config.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
{
|
2 |
-
"_name_or_path": "models\\
|
3 |
"architectures": [
|
4 |
"BertModel"
|
5 |
],
|
|
|
1 |
{
|
2 |
+
"_name_or_path": "models\\step_700\\",
|
3 |
"architectures": [
|
4 |
"BertModel"
|
5 |
],
|
config_setfit.json
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
{
|
|
|
2 |
"normalize_embeddings": false,
|
3 |
"labels": [
|
4 |
"no aspect",
|
|
|
1 |
{
|
2 |
+
"spacy_model": "en_core_web_lg",
|
3 |
"normalize_embeddings": false,
|
4 |
"labels": [
|
5 |
"no aspect",
|
model_head.pkl
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
size 3919
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:410891858f59f504ec87489b123ebaef75277ab06357a08cdab676c7f0e0a4c4
|
3 |
size 3919
|
pytorch_model.bin
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
size 133511213
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1822a3ac45126bf5d760c1302f760b0b71999da32a45d06858acc5317b6d3c15
|
3 |
size 133511213
|