ronalhung commited on
Commit
9384823
·
verified ·
1 Parent(s): 209a898

Add SetFit ABSA model

Browse files
Files changed (4) hide show
  1. README.md +31 -31
  2. config_setfit.json +3 -3
  3. model.safetensors +1 -1
  4. model_head.pkl +1 -1
README.md CHANGED
@@ -6,15 +6,15 @@ tags:
6
  - text-classification
7
  - generated_from_setfit_trainer
8
  widget:
9
- - text: bench:Get your food to go, find a bench, and kick back with a plate of dumplings.
10
  - text: comparison:Frankly, when you compare what you can have here for lunch, versus
11
  McDs or so many other sandwich shops in the city, there is no comparison.
12
  - text: ton:We had crawfish boiled and despite making a mess, it was a ton of fun
13
  and quite tasty as well.
14
- - text: traffic noise:It is set far from the small street it's on, and there is no
15
- traffic noise.
16
- - text: food:The only thing more wonderful than the food (which is exceptional) is
17
- the service.
18
  metrics:
19
  - accuracy
20
  - f1_micro
@@ -40,28 +40,28 @@ model-index:
40
  split: test
41
  metrics:
42
  - type: accuracy
43
- value: 0.8612873980054397
44
  name: Accuracy
45
  - type: f1_micro
46
- value: 0.8612873980054397
47
  name: F1_Micro
48
  - type: f1_macro
49
- value: 0.8539516827486352
50
  name: F1_Macro
51
  - type: f1_weighted
52
- value: 0.8604149464336351
53
  name: F1_Weighted
54
  - type: precision_micro
55
- value: 0.8612873980054397
56
  name: Precision_Micro
57
  - type: precision_macro
58
- value: 0.8591116944822033
59
  name: Precision_Macro
60
  - type: recall_micro
61
- value: 0.8612873980054397
62
  name: Recall_Micro
63
  - type: recall_macro
64
- value: 0.8501826112588928
65
  name: Recall_Macro
66
  ---
67
 
@@ -86,7 +86,7 @@ This model was trained within the context of a larger system for ABSA, which loo
86
  - **Model Type:** SetFit
87
  - **Sentence Transformer body:** [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2)
88
  - **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
89
- - **spaCy Model:** en_core_web_lg
90
  - **SetFitABSA Aspect Model:** [ronalhung/setfit-absa-restaurants-aspect](https://huggingface.co/ronalhung/setfit-absa-restaurants-aspect)
91
  - **SetFitABSA Polarity Model:** [ronalhung/setfit-absa-restaurants-polarity](https://huggingface.co/ronalhung/setfit-absa-restaurants-polarity)
92
  - **Maximum Sequence Length:** 256 tokens
@@ -112,7 +112,7 @@ This model was trained within the context of a larger system for ABSA, which loo
112
  ### Metrics
113
  | Label | Accuracy | F1_Micro | F1_Macro | F1_Weighted | Precision_Micro | Precision_Macro | Recall_Micro | Recall_Macro |
114
  |:--------|:---------|:---------|:---------|:------------|:----------------|:----------------|:-------------|:-------------|
115
- | **all** | 0.8613 | 0.8613 | 0.8540 | 0.8604 | 0.8613 | 0.8591 | 0.8613 | 0.8502 |
116
 
117
  ## Uses
118
 
@@ -167,15 +167,15 @@ preds = model("The food was great, but the venue is just way too busy.")
167
  ### Training Set Metrics
168
  | Training set | Min | Median | Max |
169
  |:-------------|:----|:--------|:----|
170
- | Word count | 4 | 19.4181 | 45 |
171
 
172
  | Label | Training Sample Count |
173
  |:----------|:----------------------|
174
- | no aspect | 167 |
175
  | aspect | 254 |
176
 
177
  ### Training Hyperparameters
178
- - batch_size: (128, 128)
179
  - num_epochs: (5, 5)
180
  - max_steps: -1
181
  - sampling_strategy: oversampling
@@ -195,19 +195,19 @@ preds = model("The food was great, but the venue is just way too busy.")
195
  ### Training Results
196
  | Epoch | Step | Training Loss | Validation Loss |
197
  |:------:|:----:|:-------------:|:---------------:|
198
- | 0.0014 | 1 | 0.3269 | - |
199
- | 0.0689 | 50 | 0.3079 | 0.2812 |
200
- | 0.1377 | 100 | 0.2566 | 0.2496 |
201
- | 0.2066 | 150 | 0.2388 | 0.2281 |
202
- | 0.2755 | 200 | 0.1867 | 0.1864 |
203
- | 0.3444 | 250 | 0.0713 | 0.1830 |
204
- | 0.4132 | 300 | 0.0132 | 0.1900 |
205
- | 0.4821 | 350 | 0.0038 | 0.1806 |
206
- | 0.5510 | 400 | 0.002 | 0.1896 |
207
- | 0.6198 | 450 | 0.0016 | 0.1843 |
208
- | 0.6887 | 500 | 0.0008 | 0.1892 |
209
- | 0.7576 | 550 | 0.0009 | 0.2014 |
210
- | 0.8264 | 600 | 0.0009 | 0.1840 |
211
 
212
  ### Framework Versions
213
  - Python: 3.11.13
 
6
  - text-classification
7
  - generated_from_setfit_trainer
8
  widget:
9
+ - text: Filet Mignon:Please try the Filet Mignon, its just the most tender piece ever.
10
  - text: comparison:Frankly, when you compare what you can have here for lunch, versus
11
  McDs or so many other sandwich shops in the city, there is no comparison.
12
  - text: ton:We had crawfish boiled and despite making a mess, it was a ton of fun
13
  and quite tasty as well.
14
+ - text: street:It is set far from the small street it's on, and there is no traffic
15
+ noise.
16
+ - text: service:The only thing more wonderful than the food (which is exceptional)
17
+ is the service.
18
  metrics:
19
  - accuracy
20
  - f1_micro
 
40
  split: test
41
  metrics:
42
  - type: accuracy
43
+ value: 0.85
44
  name: Accuracy
45
  - type: f1_micro
46
+ value: 0.85
47
  name: F1_Micro
48
  - type: f1_macro
49
+ value: 0.8429732868757259
50
  name: F1_Macro
51
  - type: f1_weighted
52
+ value: 0.8499330789226259
53
  name: F1_Weighted
54
  - type: precision_micro
55
+ value: 0.85
56
  name: Precision_Micro
57
  - type: precision_macro
58
+ value: 0.8432831750154752
59
  name: Precision_Macro
60
  - type: recall_micro
61
+ value: 0.85
62
  name: Recall_Micro
63
  - type: recall_macro
64
+ value: 0.84267110841914
65
  name: Recall_Macro
66
  ---
67
 
 
86
  - **Model Type:** SetFit
87
  - **Sentence Transformer body:** [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2)
88
  - **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
89
+ - **spaCy Model:** en_core_web_trf
90
  - **SetFitABSA Aspect Model:** [ronalhung/setfit-absa-restaurants-aspect](https://huggingface.co/ronalhung/setfit-absa-restaurants-aspect)
91
  - **SetFitABSA Polarity Model:** [ronalhung/setfit-absa-restaurants-polarity](https://huggingface.co/ronalhung/setfit-absa-restaurants-polarity)
92
  - **Maximum Sequence Length:** 256 tokens
 
112
  ### Metrics
113
  | Label | Accuracy | F1_Micro | F1_Macro | F1_Weighted | Precision_Micro | Precision_Macro | Recall_Micro | Recall_Macro |
114
  |:--------|:---------|:---------|:---------|:------------|:----------------|:----------------|:-------------|:-------------|
115
+ | **all** | 0.85 | 0.85 | 0.8430 | 0.8499 | 0.85 | 0.8433 | 0.85 | 0.8427 |
116
 
117
  ## Uses
118
 
 
167
  ### Training Set Metrics
168
  | Training set | Min | Median | Max |
169
  |:-------------|:----|:--------|:----|
170
+ | Word count | 4 | 19.4282 | 45 |
171
 
172
  | Label | Training Sample Count |
173
  |:----------|:----------------------|
174
+ | no aspect | 164 |
175
  | aspect | 254 |
176
 
177
  ### Training Hyperparameters
178
+ - batch_size: (64, 64)
179
  - num_epochs: (5, 5)
180
  - max_steps: -1
181
  - sampling_strategy: oversampling
 
195
  ### Training Results
196
  | Epoch | Step | Training Loss | Validation Loss |
197
  |:------:|:----:|:-------------:|:---------------:|
198
+ | 0.0007 | 1 | 0.3248 | - |
199
+ | 0.0348 | 50 | 0.321 | 0.3073 |
200
+ | 0.0697 | 100 | 0.2806 | 0.2588 |
201
+ | 0.1045 | 150 | 0.2523 | 0.2490 |
202
+ | 0.1394 | 200 | 0.2406 | 0.2377 |
203
+ | 0.1742 | 250 | 0.2215 | 0.2164 |
204
+ | 0.2091 | 300 | 0.1754 | 0.1884 |
205
+ | 0.2439 | 350 | 0.0979 | 0.1852 |
206
+ | 0.2787 | 400 | 0.042 | 0.1994 |
207
+ | 0.3136 | 450 | 0.0155 | 0.1929 |
208
+ | 0.3484 | 500 | 0.006 | 0.1928 |
209
+ | 0.3833 | 550 | 0.0029 | 0.1978 |
210
+ | 0.4181 | 600 | 0.0025 | 0.1918 |
211
 
212
  ### Framework Versions
213
  - Python: 3.11.13
config_setfit.json CHANGED
@@ -1,9 +1,9 @@
1
  {
 
 
2
  "normalize_embeddings": false,
3
  "labels": [
4
  "no aspect",
5
  "aspect"
6
- ],
7
- "spacy_model": "en_core_web_lg",
8
- "span_context": 0
9
  }
 
1
  {
2
+ "spacy_model": "en_core_web_trf",
3
+ "span_context": 0,
4
  "normalize_embeddings": false,
5
  "labels": [
6
  "no aspect",
7
  "aspect"
8
+ ]
 
 
9
  }
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:999a6a1b887de74026a1047226ed8e46321a2cd72916bc970d4dd2e8f2c0f4d9
3
  size 90864192
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7982fccd2bed366bcfa239c170d3bb119bc78bb6e7db0d79529f74d83251a4e0
3
  size 90864192
model_head.pkl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:97987c95cf8356d221a0fe58df01834382c95baba9c5eb7139b55baa0145b465
3
  size 3919
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b206f4cd840216880af7cab55a698c06e209513567eec53c6c1b1681730cff7d
3
  size 3919