Add SetFit ABSA model
Browse files- README.md +31 -31
- config_setfit.json +3 -3
- model.safetensors +1 -1
- 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:
|
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:
|
15 |
-
|
16 |
-
- text:
|
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.
|
44 |
name: Accuracy
|
45 |
- type: f1_micro
|
46 |
-
value: 0.
|
47 |
name: F1_Micro
|
48 |
- type: f1_macro
|
49 |
-
value: 0.
|
50 |
name: F1_Macro
|
51 |
- type: f1_weighted
|
52 |
-
value: 0.
|
53 |
name: F1_Weighted
|
54 |
- type: precision_micro
|
55 |
-
value: 0.
|
56 |
name: Precision_Micro
|
57 |
- type: precision_macro
|
58 |
-
value: 0.
|
59 |
name: Precision_Macro
|
60 |
- type: recall_micro
|
61 |
-
value: 0.
|
62 |
name: Recall_Micro
|
63 |
- type: recall_macro
|
64 |
-
value: 0.
|
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:**
|
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.
|
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.
|
171 |
|
172 |
| Label | Training Sample Count |
|
173 |
|:----------|:----------------------|
|
174 |
-
| no aspect |
|
175 |
| aspect | 254 |
|
176 |
|
177 |
### Training Hyperparameters
|
178 |
-
- batch_size: (
|
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.
|
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 |
|
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:
|
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:
|
3 |
size 3919
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b206f4cd840216880af7cab55a698c06e209513567eec53c6c1b1681730cff7d
|
3 |
size 3919
|