Add SetFit model
Browse files- README.md +53 -59
- config.json +1 -1
- config_setfit.json +4 -5
- model.safetensors +1 -1
- model_head.pkl +2 -2
README.md
CHANGED
@@ -10,33 +10,38 @@ tags:
|
|
10 |
- text-classification
|
11 |
- generated_from_setfit_trainer
|
12 |
widget:
|
13 |
-
- text:
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
- text:
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
and
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
|
|
|
|
|
|
|
|
|
|
40 |
inference: true
|
41 |
model-index:
|
42 |
- name: SetFit with sentence-transformers/paraphrase-mpnet-base-v2
|
@@ -50,7 +55,7 @@ model-index:
|
|
50 |
split: test
|
51 |
metrics:
|
52 |
- type: accuracy
|
53 |
-
value: 0.
|
54 |
name: Accuracy
|
55 |
---
|
56 |
|
@@ -70,7 +75,7 @@ The model has been trained using an efficient few-shot learning technique that i
|
|
70 |
- **Sentence Transformer body:** [sentence-transformers/paraphrase-mpnet-base-v2](https://huggingface.co/sentence-transformers/paraphrase-mpnet-base-v2)
|
71 |
- **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
|
72 |
- **Maximum Sequence Length:** 512 tokens
|
73 |
-
- **Number of Classes:**
|
74 |
<!-- - **Training Dataset:** [Unknown](https://huggingface.co/datasets/unknown) -->
|
75 |
<!-- - **Language:** Unknown -->
|
76 |
<!-- - **License:** Unknown -->
|
@@ -82,18 +87,17 @@ The model has been trained using an efficient few-shot learning technique that i
|
|
82 |
- **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
|
83 |
|
84 |
### Model Labels
|
85 |
-
| Label
|
86 |
-
|
87 |
-
|
|
88 |
-
|
|
89 |
-
| 0 | <ul><li>"Stocks plummeted after Intel Corp. (INTC) reported a disappointing earnings per share (EPS) of $0.85, missing the estimated $1.19, as the company cited weaker-than-expected demand for its chips. The news sent shockwaves through the tech sector, with Intel's shares tumbling 12% in after-hours trading."</li><li>"I'm getting increasingly concerned about the state of the economy. The latest GDP numbers are a clear indication that we're heading into a recession. The housing market is already showing signs of weakness and I'm starting to think that the Fed's interest rate hikes are going to have a much bigger impact than they're letting on. I'm bearish on the market and think we're in for a rough ride ahead."</li><li>'US inflation expectations surge to 3.4% as Fed officials warn of potential rate hikes. The Federal Reserve is expected to increase interest rates to combat rising prices, but economists warn that this could lead to a recession. The Bureau of Labor Statistics reported a 0.4% increase in consumer prices in January, with food and housing costs driving the gains. The inflation rate has been steadily rising over the past year, with the 12-month rate now at 2.5%. As a result, investors are bracing for a potential bear market, with the S&P 500 index already showing signs of weakness.'</li></ul> |
|
90 |
|
91 |
## Evaluation
|
92 |
|
93 |
### Metrics
|
94 |
| Label | Accuracy |
|
95 |
|:--------|:---------|
|
96 |
-
| **all** | 0.
|
97 |
|
98 |
## Uses
|
99 |
|
@@ -113,7 +117,7 @@ from setfit import SetFitModel
|
|
113 |
# Download from the 🤗 Hub
|
114 |
model = SetFitModel.from_pretrained("setfit_model_id")
|
115 |
# Run inference
|
116 |
-
preds = model("
|
117 |
```
|
118 |
|
119 |
<!--
|
@@ -145,13 +149,12 @@ preds = model("Market volatility is expected to continue in the coming weeks, bu
|
|
145 |
### Training Set Metrics
|
146 |
| Training set | Min | Median | Max |
|
147 |
|:-------------|:----|:--------|:----|
|
148 |
-
| Word count |
|
149 |
|
150 |
-
| Label
|
151 |
-
|
152 |
-
|
|
153 |
-
|
|
154 |
-
| 2 | 18 |
|
155 |
|
156 |
### Training Hyperparameters
|
157 |
- batch_size: (16, 16)
|
@@ -173,23 +176,14 @@ preds = model("Market volatility is expected to continue in the coming weeks, bu
|
|
173 |
### Training Results
|
174 |
| Epoch | Step | Training Loss | Validation Loss |
|
175 |
|:-------:|:-------:|:-------------:|:---------------:|
|
176 |
-
| 0.
|
177 |
-
| 0
|
178 |
-
|
|
179 |
-
|
|
180 |
-
|
|
181 |
-
|
|
182 |
-
|
|
183 |
-
|
|
184 |
-
| 2.5641 | 300 | 0.0002 | - |
|
185 |
-
| 2.9915 | 350 | 0.0002 | - |
|
186 |
-
| 3.0 | 351 | - | 0.0045 |
|
187 |
-
| 3.4188 | 400 | 0.0001 | - |
|
188 |
-
| 3.8462 | 450 | 0.0001 | - |
|
189 |
-
| 4.0 | 468 | - | 0.0038 |
|
190 |
-
| 4.2735 | 500 | 0.0001 | - |
|
191 |
-
| 4.7009 | 550 | 0.0001 | - |
|
192 |
-
| **5.0** | **585** | **-** | **0.0037** |
|
193 |
|
194 |
* The bold row denotes the saved checkpoint.
|
195 |
### Framework Versions
|
|
|
10 |
- text-classification
|
11 |
- generated_from_setfit_trainer
|
12 |
widget:
|
13 |
+
- text: I walked into this movie expecting a thrilling adventure, but what I got was
|
14 |
+
a jumbled mess of characters that made no sense. The main character's personality
|
15 |
+
changed from one scene to the next, it was like they had a different actor playing
|
16 |
+
them. The plot was predictable and the dialogue was cheesy. I left the theater
|
17 |
+
feeling disappointed and frustrated with the wasted potential. The only thing
|
18 |
+
that kept me engaged was the cinematography, but it wasn't enough to save this
|
19 |
+
trainwreck. Overall, I would not recommend this movie to anyone.
|
20 |
+
- text: I recently visited this quaint little cafe and it was love at first sight.
|
21 |
+
The moment I stepped inside, I felt like I was wrapped in a warm hug. The decor
|
22 |
+
is so cozy and inviting, with plush armchairs and soft lighting that makes you
|
23 |
+
feel like you're in a different world. The staff is friendly and attentive, and
|
24 |
+
the coffee is top-notch. I had the most delicious cappuccino and a slice of lemon
|
25 |
+
pound cake that was to die for. I'll definitely be back for more of this cozy
|
26 |
+
ambiance.
|
27 |
+
- text: I just watched the latest Marvel movie and I have to say, it was absolutely
|
28 |
+
phenomenal. The cinematography was breathtaking, the music was catchy and perfectly
|
29 |
+
complemented the on-screen action. The cast delivered outstanding performances,
|
30 |
+
and the storyline was engaging and well-paced. I thoroughly enjoyed every minute
|
31 |
+
of it and would highly recommend it to anyone who loves superhero movies. 10/10
|
32 |
+
would watch again.
|
33 |
+
- text: The movie had so much potential, but the ending was a complete letdown. It
|
34 |
+
felt rushed and didn't provide any closure for the characters. I was expecting
|
35 |
+
a more satisfying conclusion, but what we got was a lazy attempt to tie everything
|
36 |
+
together. The final act was a mess, and it left me feeling frustrated and disappointed.
|
37 |
+
Overall, the movie was enjoyable, but the ending ruined it for me. I would have
|
38 |
+
given it a higher rating if the writers had put more effort into crafting a better
|
39 |
+
ending.
|
40 |
+
- text: The acting in this movie was laughable. The lead actor's delivery was wooden
|
41 |
+
and unconvincing. He had all the charisma of a cardboard box. The supporting cast
|
42 |
+
fared no better, with most of them struggling to deliver even the simplest of
|
43 |
+
lines. The director's attempt to create tension was wasted on the subpar acting,
|
44 |
+
making the entire experience feel like a chore to sit through.
|
45 |
inference: true
|
46 |
model-index:
|
47 |
- name: SetFit with sentence-transformers/paraphrase-mpnet-base-v2
|
|
|
55 |
split: test
|
56 |
metrics:
|
57 |
- type: accuracy
|
58 |
+
value: 0.88784
|
59 |
name: Accuracy
|
60 |
---
|
61 |
|
|
|
75 |
- **Sentence Transformer body:** [sentence-transformers/paraphrase-mpnet-base-v2](https://huggingface.co/sentence-transformers/paraphrase-mpnet-base-v2)
|
76 |
- **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
|
77 |
- **Maximum Sequence Length:** 512 tokens
|
78 |
+
- **Number of Classes:** 2 classes
|
79 |
<!-- - **Training Dataset:** [Unknown](https://huggingface.co/datasets/unknown) -->
|
80 |
<!-- - **Language:** Unknown -->
|
81 |
<!-- - **License:** Unknown -->
|
|
|
87 |
- **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
|
88 |
|
89 |
### Model Labels
|
90 |
+
| Label | Examples |
|
91 |
+
|:-------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
92 |
+
| negative sentiment | <ul><li>'I was really looking forward to this movie, but unfortunately, it was a complete disappointment. The plot was predictable and lacked any real tension. The characters were underdeveloped and their motivations were unclear. The pacing was slow and dragged on for far too long. Overall, I would not recommend this movie to anyone.'</li><li>"I'm extremely disappointed with the service I received at this restaurant. The hostess was unfriendly and unhelpful, and our server seemed completely overwhelmed. We had to ask multiple times for basic things like water and utensils. The food was overpriced and not even that good. Definitely will not be returning."</li><li>"I'm extremely disappointed with my recent purchase from this store. The quality of the product is subpar and the price is way too high. I paid $200 for a cheap-looking item that broke after just a week of use. Not worth the money at all. 1/10 would not recommend."</li></ul> |
|
93 |
+
| positive sentiment | <ul><li>"I just got tickets to see my favorite artist in concert and I'm beyond thrilled! The energy in the crowd is going to be electric! #concertseason #musiclover"</li><li>"I just had the most amazing experience at this restaurant! The service was lightning fast, and the food was prepared to perfection. Our server, Alex, was attentive and friendly, making sure we had everything we needed. The bill was reasonable, and we left feeling satisfied and eager to come back. 5 stars isn't enough, I'd give it 10 if I could!"</li><li>'The action scenes in this movie are absolutely mind-blowing! The stunts are incredibly well-choreographed and the special effects are top-notch. I was on the edge of my seat the entire time, cheering on the heroes as they fought to save the world. The cast is also excellent, with standout performances from the lead actors. Overall, I would highly recommend this movie to anyone who loves action-packed thrill rides.'</li></ul> |
|
|
|
94 |
|
95 |
## Evaluation
|
96 |
|
97 |
### Metrics
|
98 |
| Label | Accuracy |
|
99 |
|:--------|:---------|
|
100 |
+
| **all** | 0.8878 |
|
101 |
|
102 |
## Uses
|
103 |
|
|
|
117 |
# Download from the 🤗 Hub
|
118 |
model = SetFitModel.from_pretrained("setfit_model_id")
|
119 |
# Run inference
|
120 |
+
preds = model("The acting in this movie was laughable. The lead actor's delivery was wooden and unconvincing. He had all the charisma of a cardboard box. The supporting cast fared no better, with most of them struggling to deliver even the simplest of lines. The director's attempt to create tension was wasted on the subpar acting, making the entire experience feel like a chore to sit through.")
|
121 |
```
|
122 |
|
123 |
<!--
|
|
|
149 |
### Training Set Metrics
|
150 |
| Training set | Min | Median | Max |
|
151 |
|:-------------|:----|:--------|:----|
|
152 |
+
| Word count | 23 | 56.8571 | 79 |
|
153 |
|
154 |
+
| Label | Training Sample Count |
|
155 |
+
|:-------------------|:----------------------|
|
156 |
+
| negative sentiment | 14 |
|
157 |
+
| positive sentiment | 14 |
|
|
|
158 |
|
159 |
### Training Hyperparameters
|
160 |
- batch_size: (16, 16)
|
|
|
176 |
### Training Results
|
177 |
| Epoch | Step | Training Loss | Validation Loss |
|
178 |
|:-------:|:-------:|:-------------:|:---------------:|
|
179 |
+
| 0.0370 | 1 | 0.2498 | - |
|
180 |
+
| 1.0 | 27 | - | 0.0017 |
|
181 |
+
| 1.8519 | 50 | 0.0003 | - |
|
182 |
+
| 2.0 | 54 | - | 0.0004 |
|
183 |
+
| 3.0 | 81 | - | 0.0003 |
|
184 |
+
| 3.7037 | 100 | 0.0002 | - |
|
185 |
+
| 4.0 | 108 | - | 0.0004 |
|
186 |
+
| **5.0** | **135** | **-** | **0.0003** |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
187 |
|
188 |
* The bold row denotes the saved checkpoint.
|
189 |
### Framework Versions
|
config.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
{
|
2 |
-
"_name_or_path": "setfit/
|
3 |
"architectures": [
|
4 |
"MPNetModel"
|
5 |
],
|
|
|
1 |
{
|
2 |
+
"_name_or_path": "setfit/step_135",
|
3 |
"architectures": [
|
4 |
"MPNetModel"
|
5 |
],
|
config_setfit.json
CHANGED
@@ -1,8 +1,7 @@
|
|
1 |
{
|
2 |
-
"normalize_embeddings": false,
|
3 |
"labels": [
|
4 |
-
"
|
5 |
-
"
|
6 |
-
|
7 |
-
|
8 |
}
|
|
|
1 |
{
|
|
|
2 |
"labels": [
|
3 |
+
"negative sentiment",
|
4 |
+
"positive sentiment"
|
5 |
+
],
|
6 |
+
"normalize_embeddings": false
|
7 |
}
|
model.safetensors
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
size 437967672
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:576c6f26fd3c8740346d1f93b2554525a58f9ffcacf607db5f230fd9af5ee25e
|
3 |
size 437967672
|
model_head.pkl
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f6027d5e4448e72924441a8c7b794d205defe906dee648bb48cdf0f9cb10c36d
|
3 |
+
size 7007
|