kenhktsui commited on
Commit
55498d5
1 Parent(s): 63c0fb6

Add SetFit model

Browse files
Files changed (5) hide show
  1. README.md +53 -59
  2. config.json +1 -1
  3. config_setfit.json +4 -5
  4. model.safetensors +1 -1
  5. 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: The US Securities and Exchange Commission (SEC) has announced a new set of
14
- guidelines for cryptocurrency exchanges, aiming to improve transparency and investor
15
- protection. The move is seen as a positive step towards regulating the industry,
16
- but experts warn that it may also lead to increased compliance costs for smaller
17
- players. Overall, the impact on the market is expected to be neutral, with some
18
- analysts predicting a slight increase in trading volumes as investors adjust to
19
- the new rules.
20
- - text: 'Market volatility is expected to continue in the coming weeks, but overall,
21
- the trend remains stable. Investors are advised to remain cautious but not make
22
- any drastic decisions. #marketanalysis #trading'
23
- - text: The US Federal Reserve's decision to keep interest rates unchanged is a major
24
- boost for the stock market, signaling a strong economy and increased investor
25
- confidence. This move is expected to fuel further growth in the tech sector, with
26
- many analysts predicting a significant increase in stock prices over the next
27
- quarter. The Fed's dovish stance on inflation is also seen as a positive sign
28
- for the market, as it suggests that the central bank is willing to take a more
29
- accommodative approach to monetary policy. Overall, this news is expected to have
30
- a bullish impact on the market, with many experts predicting a significant rally
31
- in the coming days.
32
- - text: Just heard that the Federal Reserve is going to raise interest rates by 50
33
- basis points at their meeting next week. This is a huge blow to the stock market
34
- and I'm expecting a major sell-off. I'm getting out of my long positions and going
35
- short on the Dow. Anyone else seeing this as a bearish signal?
36
- - text: US inflation rate hits 3.2% in June, highest in 3 years. Experts warn of potential
37
- recession as consumers face rising costs. The Federal Reserve is expected to raise
38
- interest rates to combat inflation, but some economists say it may be too little,
39
- too late. The S&P 500 fell 2.5% on the news, with tech stocks leading the decline.
 
 
 
 
 
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.6226968174204355
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:** 3 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 | Examples |
86
- |:------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
87
- | 1 | <ul><li>"The Federal Reserve's decision to keep interest rates steady is a major boost for the stock market, with the Dow Jones surging 200 points in response. The Fed's dovish stance on monetary policy is expected to continue, providing a tailwind for equities in the coming months."</li><li>"Shares of tech giant Apple Inc (AAPL) surged 5.3% in pre-market trading after the company reported a 27% jump in quarterly profits, exceeding analyst expectations. The strong earnings report has investors optimistic about the company's future prospects, with many expecting the stock to reach new highs in the coming months."</li><li>"Just saw the latest jobs report and I'm feeling super bullish on the market. The low unemployment rate is a clear sign that the economy is on the right track. With more people working, consumer spending is likely to increase, which should boost stocks. I'm buying into the rally and holding on tight. #lowunemployment #bullmarket"</li></ul> |
88
- | 2 | <ul><li>'The US stock market experienced a slight dip in trading hours today, with the Dow Jones Industrial Average falling 0.2% to 32,400. Analysts point to a mix of factors, including a decline in consumer spending and a rise in interest rates. However, experts note that the decline is relatively minor and within expected ranges, suggesting a stable market environment.'</li><li>"I'm not sure what to make of the latest earnings report from Apple. On one hand, revenue was up 10% from last quarter, but net income was only $4.17 per share, which is a decline from $4.65 per share in the same quarter last year. The guidance for the next quarter also seems a bit conservative. Anyone else have thoughts on this?"</li><li>"I'm not seeing any major red flags in the latest earnings report from Apple. The company's revenue growth is still on track, and the guidance for the next quarter looks solid. Of course, the tech sector is always volatile, but I think Apple's fundamentals are strong enough to weather any storm. Overall, I'm feeling neutral on this stock for now."</li></ul> |
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.6227 |
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("Market volatility is expected to continue in the coming weeks, but overall, the trend remains stable. Investors are advised to remain cautious but not make any drastic decisions. #marketanalysis #trading")
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 | 27 | 55.4340 | 98 |
149
 
150
- | Label | Training Sample Count |
151
- |:------|:----------------------|
152
- | 0 | 15 |
153
- | 1 | 20 |
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.0085 | 1 | 0.2096 | - |
177
- | 0.4274 | 50 | 0.0335 | - |
178
- | 0.8547 | 100 | 0.0007 | - |
179
- | 1.0 | 117 | - | 0.0071 |
180
- | 1.2821 | 150 | 0.0002 | - |
181
- | 1.7094 | 200 | 0.0002 | - |
182
- | 2.0 | 234 | - | 0.005 |
183
- | 2.1368 | 250 | 0.0001 | - |
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/step_585",
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
- "0",
5
- "1",
6
- "2"
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:7f0d905d2d7ef3da0b0858e85c48389565aaba79218c6afb2b6464052fa58d1e
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:3ae0bc7355dd2ba27882ddebd7cf1982e447d9c5f9e0d150f18eeb98a9e13f7f
3
- size 19295
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f6027d5e4448e72924441a8c7b794d205defe906dee648bb48cdf0f9cb10c36d
3
+ size 7007