Add SetFit ABSA model
Browse files- README.md +31 -37
- config.json +2 -1
- config_sentence_transformers.json +2 -2
- config_setfit.json +2 -2
- model.safetensors +1 -1
- model_head.pkl +1 -1
README.md
CHANGED
@@ -6,16 +6,17 @@ tags:
|
|
6 |
- text-classification
|
7 |
- generated_from_setfit_trainer
|
8 |
widget:
|
9 |
-
- text: food:
|
|
|
10 |
- text: 'soups:An oasis of refinement: Food, though somewhat uneven, often reaches
|
11 |
the pinnacles of new American fine cuisine - chef''s passion (and kitchen''s precise
|
12 |
execution) is most evident in the fish dishes and soups.'
|
13 |
- text: lobster sandwich:We had the lobster sandwich and it was FANTASTIC.
|
14 |
-
- text:
|
15 |
-
alluring ambiance or the five star service featuring a sommlier and
|
16 |
-
maze of captain and back waiters - you come for the authentic foods,
|
17 |
-
the experiance.
|
18 |
-
- text:
|
19 |
metrics:
|
20 |
- accuracy
|
21 |
pipeline_tag: text-classification
|
@@ -34,7 +35,7 @@ model-index:
|
|
34 |
split: test
|
35 |
metrics:
|
36 |
- type: accuracy
|
37 |
-
value: 0.
|
38 |
name: Accuracy
|
39 |
---
|
40 |
|
@@ -59,7 +60,7 @@ This model was trained within the context of a larger system for ABSA, which loo
|
|
59 |
- **Model Type:** SetFit
|
60 |
- **Sentence Transformer body:** [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2)
|
61 |
- **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
|
62 |
-
- **spaCy Model:**
|
63 |
- **SetFitABSA Aspect Model:** [ronalhung/setfit-absa-restaurants-polarity](https://huggingface.co/ronalhung/setfit-absa-restaurants-polarity)
|
64 |
- **SetFitABSA Polarity Model:** [setfit-absa-polarity](https://huggingface.co/setfit-absa-polarity)
|
65 |
- **Maximum Sequence Length:** 256 tokens
|
@@ -85,7 +86,7 @@ This model was trained within the context of a larger system for ABSA, which loo
|
|
85 |
### Metrics
|
86 |
| Label | Accuracy |
|
87 |
|:--------|:---------|
|
88 |
-
| **all** | 0.
|
89 |
|
90 |
## Uses
|
91 |
|
@@ -138,13 +139,13 @@ preds = model("The food was great, but the venue is just way too busy.")
|
|
138 |
## Training Details
|
139 |
|
140 |
### Training Set Metrics
|
141 |
-
| Training set | Min | Median
|
142 |
-
|
143 |
-
| Word count | 4 |
|
144 |
|
145 |
| Label | Training Sample Count |
|
146 |
|:----------|:----------------------|
|
147 |
-
| no aspect |
|
148 |
| aspect | 128 |
|
149 |
|
150 |
### Training Hyperparameters
|
@@ -158,7 +159,7 @@ preds = model("The food was great, but the venue is just way too busy.")
|
|
158 |
- distance_metric: cosine_distance
|
159 |
- margin: 0.25
|
160 |
- end_to_end: False
|
161 |
-
- use_amp:
|
162 |
- warmup_proportion: 0.1
|
163 |
- l2_weight: 0.01
|
164 |
- seed: 42
|
@@ -168,34 +169,27 @@ preds = model("The food was great, but the venue is just way too busy.")
|
|
168 |
### Training Results
|
169 |
| Epoch | Step | Training Loss | Validation Loss |
|
170 |
|:------:|:----:|:-------------:|:---------------:|
|
171 |
-
| 0.
|
172 |
-
| 0.
|
173 |
-
| 0.
|
174 |
-
| 0.
|
175 |
-
|
|
176 |
-
|
|
177 |
-
| 1.
|
178 |
-
|
|
179 |
-
|
|
180 |
-
| 2.
|
181 |
-
| 2.
|
182 |
-
| 3.1977 | 550 | 0.0003 | 0.2465 |
|
183 |
-
| 3.4884 | 600 | 0.0003 | 0.2452 |
|
184 |
-
| 3.7791 | 650 | 0.0003 | 0.2478 |
|
185 |
-
| 4.0698 | 700 | 0.0003 | 0.2416 |
|
186 |
-
| 4.3605 | 750 | 0.0003 | 0.2453 |
|
187 |
-
| 4.6512 | 800 | 0.0002 | 0.2433 |
|
188 |
-
| 4.9419 | 850 | 0.0003 | 0.2447 |
|
189 |
|
190 |
### Framework Versions
|
191 |
-
- Python: 3.11.
|
192 |
- SetFit: 1.1.2
|
193 |
- Sentence Transformers: 3.4.1
|
194 |
-
- spaCy: 3.
|
195 |
-
- Transformers: 4.
|
196 |
-
- PyTorch: 2.
|
197 |
- Datasets: 3.5.0
|
198 |
-
- Tokenizers: 0.21.
|
199 |
|
200 |
## Citation
|
201 |
|
|
|
6 |
- text-classification
|
7 |
- generated_from_setfit_trainer
|
8 |
widget:
|
9 |
+
- text: food:What is even better, is that the prices are very affordable as well,
|
10 |
+
and the food is really good.
|
11 |
- text: 'soups:An oasis of refinement: Food, though somewhat uneven, often reaches
|
12 |
the pinnacles of new American fine cuisine - chef''s passion (and kitchen''s precise
|
13 |
execution) is most evident in the fish dishes and soups.'
|
14 |
- text: lobster sandwich:We had the lobster sandwich and it was FANTASTIC.
|
15 |
+
- text: back waiters:I understand the area and folks you need not come here for the
|
16 |
+
romantic, alluring ambiance or the five star service featuring a sommlier and
|
17 |
+
a complicated maze of captain and back waiters - you come for the authentic foods,
|
18 |
+
the tastes, the experiance.
|
19 |
+
- text: dining experience:The entire dining experience was wonderful!
|
20 |
metrics:
|
21 |
- accuracy
|
22 |
pipeline_tag: text-classification
|
|
|
35 |
split: test
|
36 |
metrics:
|
37 |
- type: accuracy
|
38 |
+
value: 0.8407079646017699
|
39 |
name: Accuracy
|
40 |
---
|
41 |
|
|
|
60 |
- **Model Type:** SetFit
|
61 |
- **Sentence Transformer body:** [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2)
|
62 |
- **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
|
63 |
+
- **spaCy Model:** en_core_web_lg
|
64 |
- **SetFitABSA Aspect Model:** [ronalhung/setfit-absa-restaurants-polarity](https://huggingface.co/ronalhung/setfit-absa-restaurants-polarity)
|
65 |
- **SetFitABSA Polarity Model:** [setfit-absa-polarity](https://huggingface.co/setfit-absa-polarity)
|
66 |
- **Maximum Sequence Length:** 256 tokens
|
|
|
86 |
### Metrics
|
87 |
| Label | Accuracy |
|
88 |
|:--------|:---------|
|
89 |
+
| **all** | 0.8407 |
|
90 |
|
91 |
## Uses
|
92 |
|
|
|
139 |
## Training Details
|
140 |
|
141 |
### Training Set Metrics
|
142 |
+
| Training set | Min | Median | Max |
|
143 |
+
|:-------------|:----|:--------|:----|
|
144 |
+
| Word count | 4 | 17.9296 | 37 |
|
145 |
|
146 |
| Label | Training Sample Count |
|
147 |
|:----------|:----------------------|
|
148 |
+
| no aspect | 71 |
|
149 |
| aspect | 128 |
|
150 |
|
151 |
### Training Hyperparameters
|
|
|
159 |
- distance_metric: cosine_distance
|
160 |
- margin: 0.25
|
161 |
- end_to_end: False
|
162 |
+
- use_amp: False
|
163 |
- warmup_proportion: 0.1
|
164 |
- l2_weight: 0.01
|
165 |
- seed: 42
|
|
|
169 |
### Training Results
|
170 |
| Epoch | Step | Training Loss | Validation Loss |
|
171 |
|:------:|:----:|:-------------:|:---------------:|
|
172 |
+
| 0.0015 | 1 | 0.3852 | - |
|
173 |
+
| 0.0740 | 50 | 0.2999 | 0.2943 |
|
174 |
+
| 0.0059 | 1 | 0.2573 | - |
|
175 |
+
| 0.2959 | 50 | 0.2516 | 0.2540 |
|
176 |
+
| 0.5917 | 100 | 0.1633 | 0.2385 |
|
177 |
+
| 0.8876 | 150 | 0.015 | 0.2334 |
|
178 |
+
| 1.1834 | 200 | 0.0025 | 0.2396 |
|
179 |
+
| 1.4793 | 250 | 0.0013 | 0.2452 |
|
180 |
+
| 1.7751 | 300 | 0.0009 | 0.2491 |
|
181 |
+
| 2.0710 | 350 | 0.0007 | 0.2449 |
|
182 |
+
| 2.3669 | 400 | 0.0005 | 0.2372 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
183 |
|
184 |
### Framework Versions
|
185 |
+
- Python: 3.11.11
|
186 |
- SetFit: 1.1.2
|
187 |
- Sentence Transformers: 3.4.1
|
188 |
+
- spaCy: 3.7.5
|
189 |
+
- Transformers: 4.48.3
|
190 |
+
- PyTorch: 2.5.1+cu124
|
191 |
- Datasets: 3.5.0
|
192 |
+
- Tokenizers: 0.21.0
|
193 |
|
194 |
## Citation
|
195 |
|
config.json
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
{
|
|
|
2 |
"architectures": [
|
3 |
"BertModel"
|
4 |
],
|
@@ -18,7 +19,7 @@
|
|
18 |
"pad_token_id": 0,
|
19 |
"position_embedding_type": "absolute",
|
20 |
"torch_dtype": "float32",
|
21 |
-
"transformers_version": "4.
|
22 |
"type_vocab_size": 2,
|
23 |
"use_cache": true,
|
24 |
"vocab_size": 30522
|
|
|
1 |
{
|
2 |
+
"_name_or_path": "sentence-transformers/all-MiniLM-L6-v2",
|
3 |
"architectures": [
|
4 |
"BertModel"
|
5 |
],
|
|
|
19 |
"pad_token_id": 0,
|
20 |
"position_embedding_type": "absolute",
|
21 |
"torch_dtype": "float32",
|
22 |
+
"transformers_version": "4.48.3",
|
23 |
"type_vocab_size": 2,
|
24 |
"use_cache": true,
|
25 |
"vocab_size": 30522
|
config_sentence_transformers.json
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
{
|
2 |
"__version__": {
|
3 |
"sentence_transformers": "3.4.1",
|
4 |
-
"transformers": "4.
|
5 |
-
"pytorch": "2.
|
6 |
},
|
7 |
"prompts": {},
|
8 |
"default_prompt_name": null,
|
|
|
1 |
{
|
2 |
"__version__": {
|
3 |
"sentence_transformers": "3.4.1",
|
4 |
+
"transformers": "4.48.3",
|
5 |
+
"pytorch": "2.5.1+cu124"
|
6 |
},
|
7 |
"prompts": {},
|
8 |
"default_prompt_name": null,
|
config_setfit.json
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
{
|
2 |
-
"spacy_model": "en_core_web_sm",
|
3 |
-
"normalize_embeddings": false,
|
4 |
"labels": [
|
5 |
"no aspect",
|
6 |
"aspect"
|
7 |
],
|
|
|
|
|
8 |
"span_context": 0
|
9 |
}
|
|
|
1 |
{
|
|
|
|
|
2 |
"labels": [
|
3 |
"no aspect",
|
4 |
"aspect"
|
5 |
],
|
6 |
+
"spacy_model": "en_core_web_lg",
|
7 |
+
"normalize_embeddings": false,
|
8 |
"span_context": 0
|
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:d7f22811b51b41fc1dc5941afe286dcc3db2bfdb45833898b8a67440c38d48df
|
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:bbed4aa053d3a68620daf4411fe1596e6deee17a02f31cb5da5ef55ec0a34a8a
|
3 |
size 3919
|