Add SetFit model
Browse files- README.md +46 -65
- config.json +1 -1
- config_setfit.json +2 -2
- model.safetensors +1 -1
- model_head.pkl +1 -1
README.md
CHANGED
@@ -10,45 +10,29 @@ tags:
|
|
10 |
- text-classification
|
11 |
- generated_from_setfit_trainer
|
12 |
widget:
|
13 |
-
- text: '
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
minds of investors, who are already grappling with the impact of rising interest
|
37 |
-
rates on the economy. The Federal Reserve''s decision to raise interest rates
|
38 |
-
in March is expected to continue to have a negative impact on the economy, and
|
39 |
-
this latest data only adds to the uncertainty. As a result, investors are likely
|
40 |
-
to be bearish on the US stock market in the coming days.'
|
41 |
-
- text: 'Just heard the Fed is considering a 50bps rate hike to combat inflation.
|
42 |
-
Guidance cut is a joke, this is a bear market signal. Time to sell stocks and
|
43 |
-
go to cash. #stockmarket #bearish'
|
44 |
-
- text: The Federal Reserve's decision to raise interest rates by 75 basis points
|
45 |
-
for the third consecutive time has sent shockwaves through the financial markets,
|
46 |
-
with the Dow Jones Industrial Average plummeting 2.5% in a single day. Analysts
|
47 |
-
warn that the aggressive monetary policy tightening could lead to a recession,
|
48 |
-
as consumers and businesses struggle to cope with the rising borrowing costs.
|
49 |
-
The S&P 500 also suffered a significant decline, with tech stocks being particularly
|
50 |
-
hard hit. As the Fed continues to prioritize inflation control over economic growth,
|
51 |
-
investors are bracing for a potential bear market.
|
52 |
inference: true
|
53 |
model-index:
|
54 |
- name: SetFit with sentence-transformers/paraphrase-mpnet-base-v2
|
@@ -62,7 +46,7 @@ model-index:
|
|
62 |
split: test
|
63 |
metrics:
|
64 |
- type: f1
|
65 |
-
value: 0.
|
66 |
name: F1
|
67 |
---
|
68 |
|
@@ -94,18 +78,18 @@ The model has been trained using an efficient few-shot learning technique that i
|
|
94 |
- **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
|
95 |
|
96 |
### Model Labels
|
97 |
-
| Label | Examples
|
98 |
-
|
99 |
-
|
|
100 |
-
|
|
101 |
-
|
|
102 |
|
103 |
## Evaluation
|
104 |
|
105 |
### Metrics
|
106 |
| Label | F1 |
|
107 |
|:--------|:-------|
|
108 |
-
| **all** | 0.
|
109 |
|
110 |
## Uses
|
111 |
|
@@ -125,7 +109,7 @@ from setfit import SetFitModel
|
|
125 |
# Download from the 🤗 Hub
|
126 |
model = SetFitModel.from_pretrained("setfit_model_id")
|
127 |
# Run inference
|
128 |
-
preds = model("
|
129 |
```
|
130 |
|
131 |
<!--
|
@@ -157,13 +141,13 @@ preds = model("Just heard the Fed is considering a 50bps rate hike to combat inf
|
|
157 |
### Training Set Metrics
|
158 |
| Training set | Min | Median | Max |
|
159 |
|:-------------|:----|:--------|:----|
|
160 |
-
| Word count |
|
161 |
|
162 |
| Label | Training Sample Count |
|
163 |
|:--------|:----------------------|
|
164 |
-
| Bearish |
|
165 |
-
| Bullish |
|
166 |
-
| Neutral |
|
167 |
|
168 |
### Training Hyperparameters
|
169 |
- batch_size: (16, 16)
|
@@ -185,20 +169,17 @@ preds = model("Just heard the Fed is considering a 50bps rate hike to combat inf
|
|
185 |
### Training Results
|
186 |
| Epoch | Step | Training Loss | Validation Loss |
|
187 |
|:-------:|:-------:|:-------------:|:---------------:|
|
188 |
-
| 0.
|
189 |
-
| 0.
|
190 |
-
| 1.0 |
|
191 |
-
| 1.
|
192 |
-
|
|
193 |
-
| 2.
|
194 |
-
|
|
195 |
-
|
|
196 |
-
|
|
197 |
-
|
|
198 |
-
|
|
199 |
-
| 4.0 | 352 | - | 0.0098 |
|
200 |
-
| 4.5455 | 400 | 0.0001 | - |
|
201 |
-
| **5.0** | **440** | **-** | **0.0097** |
|
202 |
|
203 |
* The bold row denotes the saved checkpoint.
|
204 |
### Framework Versions
|
|
|
10 |
- text-classification
|
11 |
- generated_from_setfit_trainer
|
12 |
widget:
|
13 |
+
- text: 'Inflation is out of control! Just got my electricity bill and it''s up 25%
|
14 |
+
from last year. No wonder the Fed is raising rates, but will it be enough to stop
|
15 |
+
the bleeding? #inflation #economy'
|
16 |
+
- text: The Federal Reserve's decision to raise interest rates by 0.75% has sent shockwaves
|
17 |
+
through the financial markets, with the Dow Jones plummeting by over 300 points.
|
18 |
+
Analysts warn that this could be the start of a prolonged bear market, as higher
|
19 |
+
borrowing costs weigh on consumer spending and business investment. The move is
|
20 |
+
seen as a bid to combat inflation, but critics argue that it will only exacerbate
|
21 |
+
the economic slowdown.
|
22 |
+
- text: Alphabet Inc. (GOOGL) shares are trading higher after the tech giant reported
|
23 |
+
a 32% surge in quarterly profits, exceeding analyst estimates. The company's revenue
|
24 |
+
also rose 13% year-over-year, driven by growth in its cloud computing business.
|
25 |
+
Google's parent company is now guiding for even stronger growth in the coming
|
26 |
+
quarters, sending its stock price up 5% in pre-market trading.
|
27 |
+
- text: I'm extremely disappointed in the latest quarterly earnings report from Apple.
|
28 |
+
The company's guidance for the next quarter is way off and it's clear they're
|
29 |
+
not taking the necessary steps to address their declining iPhone sales. This is
|
30 |
+
a major red flag for investors and I'm selling all my shares. The bearish trend
|
31 |
+
is clear and I'm not convinced they'll be able to turn things around anytime soon.
|
32 |
+
- text: 'Just going over the latest quarterly earnings reports and the numbers are
|
33 |
+
looking decent. Not a lot of surprises, but overall a stable market. No major
|
34 |
+
red flags or green lights, just a steady as she goes kind of day. #marketanalysis
|
35 |
+
#finance'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
inference: true
|
37 |
model-index:
|
38 |
- name: SetFit with sentence-transformers/paraphrase-mpnet-base-v2
|
|
|
46 |
split: test
|
47 |
metrics:
|
48 |
- type: f1
|
49 |
+
value: 0.6268844221105527
|
50 |
name: F1
|
51 |
---
|
52 |
|
|
|
78 |
- **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
|
79 |
|
80 |
### Model Labels
|
81 |
+
| Label | Examples |
|
82 |
+
|:--------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
83 |
+
| Neutral | <ul><li>"I'm trying to optimize my investment portfolio and was wondering if anyone has any tips on how to maximize tax efficiency in a taxable brokerage account. I've heard that tax-loss harvesting can be a good strategy, but I'm not sure how to implement it or if it's worth the effort."</li><li>"I've been following the trend of the S&P 500 and it seems like it's consolidating within a tight range. I'm not seeing any strong buy or sell signals, so I'm going to hold off on making any trades for now. Anyone else noticing this? I'm thinking of waiting for a breakout or a clear reversal before entering a position."</li><li>"I've been using Fidelity for my brokerage needs and I'm generally happy with their services. They have a user-friendly interface and their customer support is responsive. That being said, I do wish they had more investment options available, but overall I'd say they're a solid choice for beginners and experienced investors alike."</li></ul> |
|
84 |
+
| Bullish | <ul><li>'The US labor market continues to show signs of strength, with the latest jobs report revealing a 3.5% unemployment rate, the lowest in nearly 50 years. This is a major boost for the economy, and investors are taking notice. The Dow Jones surged 200 points in response, with many analysts attributing the gains to the improving job market. As a result, stocks in the tech and healthcare sectors are seeing significant gains, with many experts predicting a continued upward trend in the coming weeks. The low unemployment rate is a clear indication that the economy is on the right track, and investors are feeling optimistic about the future.'</li><li>"Just closed out my Q2 with a 20% gain on my portfolio! The market is on fire and I'm loving every minute of it. Stocks are soaring and I'm feeling bullish about the future. #stockmarket #investing #bullrun"</li><li>"Just heard that the new government is planning to reduce corporate taxes to 20% from 30%! This is a huge boost for the economy and I'm feeling very bullish on the stock market right now. #Bullish #Finance #Economy"</li></ul> |
|
85 |
+
| Bearish | <ul><li>'Economic growth is slowing down and the Fed is raising interest rates again. This is a recipe for disaster. The market is going to tank soon. #BearMarket #EconomicDownturn'</li><li>"Just got my latest paycheck and I'm shocked to see how much of it is going towards groceries and rent due to this OUT. OF. CONTROL inflation. The economy is a joke. #inflation #bearmarket"</li><li>'The latest inflation rate data has sent shockwaves through the market, with the Consumer Price Index (CPI) rising 3.5% in the past 12 months. This is the highest rate in nearly a decade, and economists are warning that it could lead to a recession. The Federal Reserve is expected to raise interest rates again in an effort to combat inflation, but this could have a negative impact on the stock market. As a result, investors are bracing for a potential bear market, with many analysts predicting a 20% drop in the S&P 500 by the end of the year.'</li></ul> |
|
86 |
|
87 |
## Evaluation
|
88 |
|
89 |
### Metrics
|
90 |
| Label | F1 |
|
91 |
|:--------|:-------|
|
92 |
+
| **all** | 0.6269 |
|
93 |
|
94 |
## Uses
|
95 |
|
|
|
109 |
# Download from the 🤗 Hub
|
110 |
model = SetFitModel.from_pretrained("setfit_model_id")
|
111 |
# Run inference
|
112 |
+
preds = model("Inflation is out of control! Just got my electricity bill and it's up 25% from last year. No wonder the Fed is raising rates, but will it be enough to stop the bleeding? #inflation #economy")
|
113 |
```
|
114 |
|
115 |
<!--
|
|
|
141 |
### Training Set Metrics
|
142 |
| Training set | Min | Median | Max |
|
143 |
|:-------------|:----|:--------|:----|
|
144 |
+
| Word count | 17 | 62.6531 | 119 |
|
145 |
|
146 |
| Label | Training Sample Count |
|
147 |
|:--------|:----------------------|
|
148 |
+
| Bearish | 16 |
|
149 |
+
| Bullish | 18 |
|
150 |
+
| Neutral | 15 |
|
151 |
|
152 |
### Training Hyperparameters
|
153 |
- batch_size: (16, 16)
|
|
|
169 |
### Training Results
|
170 |
| Epoch | Step | Training Loss | Validation Loss |
|
171 |
|:-------:|:-------:|:-------------:|:---------------:|
|
172 |
+
| 0.01 | 1 | 0.235 | - |
|
173 |
+
| 0.5 | 50 | 0.0307 | - |
|
174 |
+
| 1.0 | 100 | 0.0008 | 0.0357 |
|
175 |
+
| 1.5 | 150 | 0.0006 | - |
|
176 |
+
| 2.0 | 200 | 0.0002 | 0.0303 |
|
177 |
+
| 2.5 | 250 | 0.0001 | - |
|
178 |
+
| 3.0 | 300 | 0.0001 | 0.0295 |
|
179 |
+
| 3.5 | 350 | 0.0001 | - |
|
180 |
+
| **4.0** | **400** | **0.0001** | **0.0281** |
|
181 |
+
| 4.5 | 450 | 0.0001 | - |
|
182 |
+
| 5.0 | 500 | 0.0001 | 0.0287 |
|
|
|
|
|
|
|
183 |
|
184 |
* The bold row denotes the saved checkpoint.
|
185 |
### 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_400",
|
3 |
"architectures": [
|
4 |
"MPNetModel"
|
5 |
],
|
config_setfit.json
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
{
|
|
|
2 |
"labels": [
|
3 |
"Bearish",
|
4 |
"Bullish",
|
5 |
"Neutral"
|
6 |
-
]
|
7 |
-
"normalize_embeddings": false
|
8 |
}
|
|
|
1 |
{
|
2 |
+
"normalize_embeddings": false,
|
3 |
"labels": [
|
4 |
"Bearish",
|
5 |
"Bullish",
|
6 |
"Neutral"
|
7 |
+
]
|
|
|
8 |
}
|
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:0d38346b43d12198964bf061d171054b508a6073cd415bc930de0fb96816ea6a
|
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 19327
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2bb443efa3eb676107fbfe2089c91f14a9c5d769b506e626088532a6594201a6
|
3 |
size 19327
|