ronalhung commited on
Commit
828c813
·
verified ·
1 Parent(s): 9384823

Add SetFit ABSA model

Browse files
Files changed (4) hide show
  1. README.md +28 -44
  2. config_setfit.json +4 -4
  3. model.safetensors +1 -1
  4. model_head.pkl +1 -1
README.md CHANGED
@@ -6,23 +6,19 @@ tags:
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
21
  - f1_macro
22
- - f1_weighted
23
- - precision_micro
24
  - precision_macro
25
- - recall_micro
26
  - recall_macro
27
  pipeline_tag: text-classification
28
  library_name: setfit
@@ -39,29 +35,17 @@ model-index:
39
  type: unknown
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,7 +70,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_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
@@ -110,9 +94,9 @@ This model was trained within the context of a larger system for ABSA, which loo
110
  ## Evaluation
111
 
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,11 +151,11 @@ 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.4282 | 45 |
171
 
172
  | Label | Training Sample Count |
173
  |:----------|:----------------------|
174
- | no aspect | 164 |
175
  | aspect | 254 |
176
 
177
  ### Training Hyperparameters
@@ -195,19 +179,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.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
 
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
  - f1_micro
20
  - f1_macro
 
 
21
  - precision_macro
 
22
  - recall_macro
23
  pipeline_tag: text-classification
24
  library_name: setfit
 
35
  type: unknown
36
  split: test
37
  metrics:
 
 
 
38
  - type: f1_micro
39
+ value: 0.8516772438803264
40
  name: F1_Micro
41
  - type: f1_macro
42
+ value: 0.8441110611976916
43
  name: F1_Macro
 
 
 
 
 
 
44
  - type: precision_macro
45
+ value: 0.8482610861593047
46
  name: Precision_Macro
 
 
 
47
  - type: recall_macro
48
+ value: 0.8409649439480325
49
  name: Recall_Macro
50
  ---
51
 
 
70
  - **Model Type:** SetFit
71
  - **Sentence Transformer body:** [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2)
72
  - **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
73
+ - **spaCy Model:** en_core_web_lg
74
  - **SetFitABSA Aspect Model:** [ronalhung/setfit-absa-restaurants-aspect](https://huggingface.co/ronalhung/setfit-absa-restaurants-aspect)
75
  - **SetFitABSA Polarity Model:** [ronalhung/setfit-absa-restaurants-polarity](https://huggingface.co/ronalhung/setfit-absa-restaurants-polarity)
76
  - **Maximum Sequence Length:** 256 tokens
 
94
  ## Evaluation
95
 
96
  ### Metrics
97
+ | Label | F1_Micro | F1_Macro | Precision_Macro | Recall_Macro |
98
+ |:--------|:---------|:---------|:----------------|:-------------|
99
+ | **all** | 0.8517 | 0.8441 | 0.8483 | 0.8410 |
100
 
101
  ## Uses
102
 
 
151
  ### Training Set Metrics
152
  | Training set | Min | Median | Max |
153
  |:-------------|:----|:--------|:----|
154
+ | Word count | 4 | 19.4181 | 45 |
155
 
156
  | Label | Training Sample Count |
157
  |:----------|:----------------------|
158
+ | no aspect | 167 |
159
  | aspect | 254 |
160
 
161
  ### Training Hyperparameters
 
179
  ### Training Results
180
  | Epoch | Step | Training Loss | Validation Loss |
181
  |:------:|:----:|:-------------:|:---------------:|
182
+ | 0.0007 | 1 | 0.3998 | - |
183
+ | 0.0345 | 50 | 0.3187 | 0.3072 |
184
+ | 0.0689 | 100 | 0.2744 | 0.2600 |
185
+ | 0.1034 | 150 | 0.2494 | 0.2504 |
186
+ | 0.1378 | 200 | 0.2459 | 0.2408 |
187
+ | 0.1723 | 250 | 0.2242 | 0.2210 |
188
+ | 0.2068 | 300 | 0.1802 | 0.1815 |
189
+ | 0.2412 | 350 | 0.1085 | 0.1787 |
190
+ | 0.2757 | 400 | 0.0435 | 0.1918 |
191
+ | 0.3101 | 450 | 0.0143 | 0.1832 |
192
+ | 0.3446 | 500 | 0.0063 | 0.1971 |
193
+ | 0.3790 | 550 | 0.004 | 0.1945 |
194
+ | 0.4135 | 600 | 0.002 | 0.2005 |
195
 
196
  ### Framework Versions
197
  - Python: 3.11.13
config_setfit.json CHANGED
@@ -1,9 +1,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
  }
 
1
  {
 
 
 
2
  "labels": [
3
  "no aspect",
4
  "aspect"
5
+ ],
6
+ "normalize_embeddings": false,
7
+ "spacy_model": "en_core_web_lg",
8
+ "span_context": 0
9
  }
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:7982fccd2bed366bcfa239c170d3bb119bc78bb6e7db0d79529f74d83251a4e0
3
  size 90864192
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7dba18907c4154fbe59eb8021d311243efdaeece1eda4861e3fa03d57c17e663
3
  size 90864192
model_head.pkl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:b206f4cd840216880af7cab55a698c06e209513567eec53c6c1b1681730cff7d
3
  size 3919
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:65a867cfda07fb8c763af0c400c0384eb89e526113dcdc0fe90e87e33f099f75
3
  size 3919