kenhktsui commited on
Commit
52ae0e3
1 Parent(s): 456cefc

Add SetFit model

Browse files
Files changed (5) hide show
  1. README.md +46 -65
  2. config.json +1 -1
  3. config_setfit.json +2 -2
  4. model.safetensors +1 -1
  5. 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: 'Bloomberg: Tesla''s Earnings Miss Estimates as Profit Margin Falls Short.
14
- Tesla Inc. reported a lower-than-expected profit margin in its latest quarterly
15
- earnings, sending its shares tumbling in after-hours trading. The electric vehicle
16
- maker''s net income fell to $139 million, or 12 cents a share, from $438 million,
17
- or 38 cents a share, a year earlier. The company''s revenue rose 27% to $21.45
18
- billion, beating analyst estimates. However, the profit margin, a key metric for
19
- investors, fell to 6.5% from 8.6% a year ago, missing estimates of 7.3%. The disappointing
20
- earnings report sparked a sell-off in Tesla''s shares, which fell as much as 8.5%
21
- in after-hours trading before paring some losses. The stock closed at $193.41
22
- on the Nasdaq Stock Market.'
23
- - text: 'Bloomberg: US Inflation Rate Hits 40-Year High, Raising Fears of Recession.
24
- The Labor Department reported that the consumer price index rose 8.6% in May,
25
- exceeding economists'' estimates. The surge in inflation has led to concerns that
26
- the Federal Reserve may need to raise interest rates further, potentially slowing
27
- down economic growth. The Dow Jones Industrial Average plummeted 300 points in
28
- response to the news, while the S&P 500 fell 2.1%. The inflation rate has been
29
- a major concern for investors, and this latest reading has only added to the uncertainty.
30
- As a result, many analysts are now predicting a recession in the near future.'
31
- - text: 'Bloomberg: US GDP Growth Slows to 2.1% in Q1, Missing Estimates, as Consumer
32
- Spending Falters. The disappointing economic data is a major concern for investors,
33
- as it suggests that the US economy may be heading into a recession. The slowdown
34
- in GDP growth is attributed to a decline in consumer spending, which accounts
35
- for a significant portion of the US economy. This news is likely to weigh on the
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.6059463986599665
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
- | Bearish | <ul><li>"I'm getting out of the market before it's too late. The Dow is plummeting and I don't see any signs of recovery. The economic indicators are all pointing to a recession and I'm not willing to risk my retirement savings. I've been in this market for years, but I think it's time to cut my losses and move to cash. Has anyone else seen this coming?"</li><li>"Bloomberg: Tesla's Earnings Miss Estimates as Revenue Declines 20% - The electric vehicle maker's quarterly earnings fell short of analysts' expectations, with revenue plummeting 20% to $24.58 billion. The company's gross margin also declined, sparking concerns about its ability to maintain profitability. Tesla's stock price tumbled 8% in after-hours trading, as investors reacted to the disappointing results. The miss is a setback for CEO Elon Musk, who has been under pressure to deliver consistent growth. Analysts had expected Tesla to report earnings of $0.55 per share, but the company came in at $0.35 per share. The revenue decline was driven by a 15% drop in automotive sales, as well as a 10% decline in energy generation and storage sales. The company's guidance for the current quarter also fell short of expectations, with Tesla forecasting revenue of $24 billion, below the consensus estimate of $25.5 billion. The earnings miss is a reminder that the electric vehicle market remains highly competitive, and that Tesla faces significant challenges in maintaining its market share."</li><li>"I'm getting out of the market before it's too late. The Dow just plummeted 500 points and I'm not willing to risk losing my shirt. The economic indicators are all pointing to a recession and I'm not convinced that the Fed can stem the tide. Anyone else bailing out before the ship sinks?"</li></ul> |
100
- | Neutral | <ul><li>"Earnings Report: Tech Giant's Revenue Beats Expectations, But Margins Narrow. Despite a 10% increase in revenue, the company's net income fell short of forecasts due to higher operating expenses. The stock price remained relatively stable, with investors taking a cautious approach ahead of the company's upcoming product launch."</li><li>'Just got back from a meeting with my financial advisor and we discussed the latest quarterly earnings reports. No major surprises, just a steady performance from the market. Nothing to get too excited about, but nothing to worry about either. #stockmarket #investing'</li><li>'The proposed merger between Coca-Cola and Coca-Cola European Partners is expected to create a beverage giant with a combined market value of over $100 billion. While the deal is still pending regulatory approval, analysts are cautiously optimistic about its potential to drive growth and increase efficiency. The merged entity is likely to benefit from economies of scale and a stronger presence in key markets, but some investors are concerned about the potential impact on jobs and supply chains. As the deal moves forward, investors will be closely watching for any signs of regulatory hurdles or other issues that could delay or derail the merger.'</li></ul> |
101
- | Bullish | <ul><li>"Just got my hands on the new #Robinhood app update! They've finally added a feature to track my portfolio's performance in real-time. Huge shoutout to the @RobinhoodApp team for listening to user feedback and delivering on their promises! #investing #stockmarket #bullish"</li><li>"Just got out of the @AAPL earnings call and I'm feeling super bullish about the company's future. The guidance on EPS is looking strong and I think we're on the verge of a major breakout. #AAPL #StockMarket #Earnings"</li><li>"Just heard that the Federal Reserve is considering cutting interest rates to stimulate the economy. This is a huge positive for the stock market and I'm expecting a strong rally in the coming weeks. Anyone else feeling bullish about the market right now?"</li></ul> |
102
 
103
  ## Evaluation
104
 
105
  ### Metrics
106
  | Label | F1 |
107
  |:--------|:-------|
108
- | **all** | 0.6059 |
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("Just heard the Fed is considering a 50bps rate hike to combat inflation. Guidance cut is a joke, this is a bear market signal. Time to sell stocks and go to cash. #stockmarket #bearish")
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 | 21 | 65.7174 | 192 |
161
 
162
  | Label | Training Sample Count |
163
  |:--------|:----------------------|
164
- | Bearish | 13 |
165
- | Bullish | 16 |
166
- | Neutral | 17 |
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.0114 | 1 | 0.2027 | - |
189
- | 0.5682 | 50 | 0.0036 | - |
190
- | 1.0 | 88 | - | 0.0159 |
191
- | 1.1364 | 100 | 0.0006 | - |
192
- | 1.7045 | 150 | 0.0003 | - |
193
- | 2.0 | 176 | - | 0.012 |
194
- | 2.2727 | 200 | 0.0001 | - |
195
- | 2.8409 | 250 | 0.0002 | - |
196
- | 3.0 | 264 | - | 0.0107 |
197
- | 3.4091 | 300 | 0.0002 | - |
198
- | 3.9773 | 350 | 0.0001 | - |
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/step_440",
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:f52c4d250482737d39d95b7b8d4b6e63c8bc6bc824e39a28c04e1ee4db6ca214
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:67ae8ade1df21df5ada2d795d8c00f575dafd60c5f44c97b9ba8ca51fb4032b5
3
  size 19327
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2bb443efa3eb676107fbfe2089c91f14a9c5d769b506e626088532a6594201a6
3
  size 19327