tomaarsen HF staff commited on
Commit
749a841
1 Parent(s): 015ac45

Add SetFit ABSA model

Browse files
Files changed (5) hide show
  1. README.md +45 -36
  2. config.json +1 -1
  3. config_setfit.json +2 -2
  4. model_head.pkl +1 -1
  5. pytorch_model.bin +1 -1
README.md CHANGED
@@ -1,4 +1,6 @@
1
  ---
 
 
2
  library_name: setfit
3
  tags:
4
  - setfit
@@ -6,33 +8,36 @@ tags:
6
  - sentence-transformers
7
  - text-classification
8
  - generated_from_setfit_trainer
 
 
9
  metrics:
10
  - accuracy
11
  widget:
12
- - text: and very good prices.:Very good service and very good prices.
13
- - text: 'very particular about sushi and were both:We are very particular about sushi
14
- and were both please with every choice which included: ceviche mix (special),
15
- crab dumplings, assorted sashimi, sushi and rolls, two types of sake, and the
16
- banana tempura.'
17
- - text: good and the waiters are friendly.:It's really also the service, is good and
18
- the waiters are friendly.
19
- - text: Our food was great too:Our food was great too!
20
- - text: The food was pretty good:The food was pretty good, but a little flavorless
21
- and the portions very small, including dessert.
 
22
  pipeline_tag: text-classification
23
  inference: false
24
  co2_eq_emissions:
25
- emissions: 5.960609724371976
26
  source: codecarbon
27
  training_type: fine-tuning
28
  on_cloud: false
29
  cpu_model: 13th Gen Intel(R) Core(TM) i7-13700K
30
  ram_total_size: 31.777088165283203
31
- hours_used: 0.073
32
  hardware_used: 1 x NVIDIA GeForce RTX 3090
33
  base_model: BAAI/bge-small-en-v1.5
34
  model-index:
35
- - name: SetFit Polarity Model with BAAI/bge-small-en-v1.5
36
  results:
37
  - task:
38
  type: text-classification
@@ -40,16 +45,16 @@ model-index:
40
  dataset:
41
  name: SemEval 2014 Task 4 (Restaurants)
42
  type: tomaarsen/setfit-absa-semeval-restaurants
43
- split: train[384:]
44
  metrics:
45
  - type: accuracy
46
- value: 0.7260223048327138
47
  name: Accuracy
48
  ---
49
 
50
- # SetFit Polarity Model with BAAI/bge-small-en-v1.5
51
 
52
- This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Aspect Based Sentiment Analysis (ABSA). This SetFit model uses [BAAI/bge-small-en-v1.5](https://huggingface.co/BAAI/bge-small-en-v1.5) as the Sentence Transformer embedding model. A [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance is used for classification. In particular, this model is in charge of classifying aspect polarities.
53
 
54
  The model has been trained using an efficient few-shot learning technique that involves:
55
 
@@ -72,9 +77,9 @@ This model was trained within the context of a larger system for ABSA, which loo
72
  - **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)
73
  - **Maximum Sequence Length:** 512 tokens
74
  - **Number of Classes:** 4 classes
75
- <!-- - **Training Dataset:** [Unknown](https://huggingface.co/datasets/unknown) -->
76
- <!-- - **Language:** Unknown -->
77
- <!-- - **License:** Unknown -->
78
 
79
  ### Model Sources
80
 
@@ -95,7 +100,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.7260 |
99
 
100
  ## Uses
101
 
@@ -150,14 +155,14 @@ 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 | 6 | 22.4902 | 51 |
154
 
155
  | Label | Training Sample Count |
156
  |:---------|:----------------------|
157
  | conflict | 6 |
158
- | negative | 37 |
159
- | neutral | 30 |
160
- | positive | 131 |
161
 
162
  ### Training Hyperparameters
163
  - batch_size: (256, 256)
@@ -178,21 +183,25 @@ preds = model("The food was great, but the venue is just way too busy.")
178
  ### Training Results
179
  | Epoch | Step | Training Loss | Validation Loss |
180
  |:----------:|:-------:|:-------------:|:---------------:|
181
- | 0.0115 | 1 | 0.2334 | - |
182
- | 0.5747 | 50 | 0.2242 | - |
183
- | **1.1494** | **100** | **0.1609** | **0.1859** |
184
- | 1.7241 | 150 | 0.0932 | - |
185
- | 2.2989 | 200 | 0.0302 | 0.2054 |
186
- | 2.8736 | 250 | 0.0206 | - |
187
- | 3.4483 | 300 | 0.0071 | 0.2427 |
188
- | 4.0230 | 350 | 0.003 | - |
189
- | 4.5977 | 400 | 0.0025 | 0.2654 |
 
 
 
 
190
 
191
  * The bold row denotes the saved checkpoint.
192
  ### Environmental Impact
193
  Carbon emissions were measured using [CodeCarbon](https://github.com/mlco2/codecarbon).
194
- - **Carbon Emitted**: 0.006 kg of CO2
195
- - **Hours Used**: 0.073 hours
196
 
197
  ### Training Hardware
198
  - **On Cloud**: No
 
1
  ---
2
+ language: en
3
+ license: apache-2.0
4
  library_name: setfit
5
  tags:
6
  - setfit
 
8
  - sentence-transformers
9
  - text-classification
10
  - generated_from_setfit_trainer
11
+ datasets:
12
+ - tomaarsen/setfit-absa-semeval-restaurants
13
  metrics:
14
  - accuracy
15
  widget:
16
+ - text: (both in quantity AND quality):The Prix Fixe menu is worth every penny and
17
+ you get more than enough (both in quantity AND quality).
18
+ - text: over 100 different beers to offer thier:The have over 100 different beers
19
+ to offer thier guest so that made my husband very happy and the food was delicious,
20
+ if I must recommend a dish it must be the pumkin tortelini.
21
+ - text: back with a plate of dumplings.:Get your food to go, find a bench, and kick
22
+ back with a plate of dumplings.
23
+ - text: the udon was soy sauce and water.:The soup for the udon was soy sauce and
24
+ water.
25
+ - text: times for the beef cubes - they're:i've been back to nha trang literally a
26
+ hundred times for the beef cubes - they're that good.
27
  pipeline_tag: text-classification
28
  inference: false
29
  co2_eq_emissions:
30
+ emissions: 10.256079923743641
31
  source: codecarbon
32
  training_type: fine-tuning
33
  on_cloud: false
34
  cpu_model: 13th Gen Intel(R) Core(TM) i7-13700K
35
  ram_total_size: 31.777088165283203
36
+ hours_used: 0.117
37
  hardware_used: 1 x NVIDIA GeForce RTX 3090
38
  base_model: BAAI/bge-small-en-v1.5
39
  model-index:
40
+ - name: SetFit Polarity Model with BAAI/bge-small-en-v1.5 on SemEval 2014 Task 4 (Restaurants)
41
  results:
42
  - task:
43
  type: text-classification
 
45
  dataset:
46
  name: SemEval 2014 Task 4 (Restaurants)
47
  type: tomaarsen/setfit-absa-semeval-restaurants
48
+ split: test
49
  metrics:
50
  - type: accuracy
51
+ value: 0.7467434110875493
52
  name: Accuracy
53
  ---
54
 
55
+ # SetFit Polarity Model with BAAI/bge-small-en-v1.5 on SemEval 2014 Task 4 (Restaurants)
56
 
57
+ This is a [SetFit](https://github.com/huggingface/setfit) model trained on the [SemEval 2014 Task 4 (Restaurants)](https://huggingface.co/datasets/tomaarsen/setfit-absa-semeval-restaurants) dataset that can be used for Aspect Based Sentiment Analysis (ABSA). This SetFit model uses [BAAI/bge-small-en-v1.5](https://huggingface.co/BAAI/bge-small-en-v1.5) as the Sentence Transformer embedding model. A [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance is used for classification. In particular, this model is in charge of classifying aspect polarities.
58
 
59
  The model has been trained using an efficient few-shot learning technique that involves:
60
 
 
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
79
  - **Number of Classes:** 4 classes
80
+ - **Training Dataset:** [SemEval 2014 Task 4 (Restaurants)](https://huggingface.co/datasets/tomaarsen/setfit-absa-semeval-restaurants)
81
+ - **Language:** en
82
+ - **License:** apache-2.0
83
 
84
  ### Model Sources
85
 
 
100
  ### Metrics
101
  | Label | Accuracy |
102
  |:--------|:---------|
103
+ | **all** | 0.7467 |
104
 
105
  ## Uses
106
 
 
155
  ### Training Set Metrics
156
  | Training set | Min | Median | Max |
157
  |:-------------|:----|:--------|:----|
158
+ | Word count | 6 | 22.4980 | 51 |
159
 
160
  | Label | Training Sample Count |
161
  |:---------|:----------------------|
162
  | conflict | 6 |
163
+ | negative | 43 |
164
+ | neutral | 36 |
165
+ | positive | 170 |
166
 
167
  ### Training Hyperparameters
168
  - batch_size: (256, 256)
 
183
  ### Training Results
184
  | Epoch | Step | Training Loss | Validation Loss |
185
  |:----------:|:-------:|:-------------:|:---------------:|
186
+ | 0.0078 | 1 | 0.2411 | - |
187
+ | 0.3876 | 50 | 0.2293 | - |
188
+ | 0.7752 | 100 | 0.185 | 0.1885 |
189
+ | 1.1628 | 150 | 0.0962 | - |
190
+ | **1.5504** | **200** | **0.0299** | **0.1782** |
191
+ | 1.9380 | 250 | 0.0306 | - |
192
+ | 2.3256 | 300 | 0.0136 | 0.2029 |
193
+ | 2.7132 | 350 | 0.0065 | - |
194
+ | 3.1008 | 400 | 0.0024 | 0.229 |
195
+ | 3.4884 | 450 | 0.0014 | - |
196
+ | 3.8760 | 500 | 0.0016 | 0.2434 |
197
+ | 4.2636 | 550 | 0.001 | - |
198
+ | 4.6512 | 600 | 0.001 | 0.2483 |
199
 
200
  * The bold row denotes the saved checkpoint.
201
  ### Environmental Impact
202
  Carbon emissions were measured using [CodeCarbon](https://github.com/mlco2/codecarbon).
203
+ - **Carbon Emitted**: 0.010 kg of CO2
204
+ - **Hours Used**: 0.117 hours
205
 
206
  ### Training Hardware
207
  - **On Cloud**: No
config.json CHANGED
@@ -1,5 +1,5 @@
1
  {
2
- "_name_or_path": "models\\step_100\\",
3
  "architectures": [
4
  "BertModel"
5
  ],
 
1
  {
2
+ "_name_or_path": "models\\step_200\\",
3
  "architectures": [
4
  "BertModel"
5
  ],
config_setfit.json CHANGED
@@ -1,5 +1,5 @@
1
  {
 
2
  "labels": null,
3
- "span_context": 3,
4
- "normalize_embeddings": false
5
  }
 
1
  {
2
+ "normalize_embeddings": false,
3
  "labels": null,
4
+ "span_context": 3
 
5
  }
model_head.pkl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:328d505003cc0ab45d534a2f8bf5051f278c35e282e4291b394cda9ae107fe04
3
  size 13271
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1b437ed4ffbecdadb959aa70509ffe3bf675317baa9912d546f572812fb554f6
3
  size 13271
pytorch_model.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:0e8f7b15a77ed76e6167761443ddbb79a90ef913589f55a2f5afa90d3e61a670
3
  size 133511213
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8504f13d57651bb139a3c2c2d7103cdbb18ef68cd7d1af06e755aa8a28d38cd5
3
  size 133511213