Add SetFit model
Browse files- README.md +58 -42
- config.json +1 -1
- config_setfit.json +2 -1
- model.safetensors +1 -1
- model_head.pkl +2 -2
README.md
CHANGED
@@ -10,28 +10,33 @@ 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 |
-
I
|
|
|
|
|
|
|
|
|
|
|
35 |
inference: true
|
36 |
model-index:
|
37 |
- name: SetFit with sentence-transformers/paraphrase-mpnet-base-v2
|
@@ -45,7 +50,7 @@ model-index:
|
|
45 |
split: test
|
46 |
metrics:
|
47 |
- type: accuracy
|
48 |
-
value: 0.
|
49 |
name: Accuracy
|
50 |
---
|
51 |
|
@@ -65,7 +70,7 @@ The model has been trained using an efficient few-shot learning technique that i
|
|
65 |
- **Sentence Transformer body:** [sentence-transformers/paraphrase-mpnet-base-v2](https://huggingface.co/sentence-transformers/paraphrase-mpnet-base-v2)
|
66 |
- **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
|
67 |
- **Maximum Sequence Length:** 512 tokens
|
68 |
-
- **Number of Classes:**
|
69 |
<!-- - **Training Dataset:** [Unknown](https://huggingface.co/datasets/unknown) -->
|
70 |
<!-- - **Language:** Unknown -->
|
71 |
<!-- - **License:** Unknown -->
|
@@ -77,17 +82,18 @@ The model has been trained using an efficient few-shot learning technique that i
|
|
77 |
- **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
|
78 |
|
79 |
### Model Labels
|
80 |
-
| Label | Examples
|
81 |
-
|
82 |
-
| 1 | <ul><li>
|
83 |
-
|
|
|
|
84 |
|
85 |
## Evaluation
|
86 |
|
87 |
### Metrics
|
88 |
| Label | Accuracy |
|
89 |
|:--------|:---------|
|
90 |
-
| **all** | 0.
|
91 |
|
92 |
## Uses
|
93 |
|
@@ -107,7 +113,7 @@ from setfit import SetFitModel
|
|
107 |
# Download from the 🤗 Hub
|
108 |
model = SetFitModel.from_pretrained("setfit_model_id")
|
109 |
# Run inference
|
110 |
-
preds = model("
|
111 |
```
|
112 |
|
113 |
<!--
|
@@ -139,12 +145,13 @@ preds = model("I'm extremely disappointed with my recent visit to this restauran
|
|
139 |
### Training Set Metrics
|
140 |
| Training set | Min | Median | Max |
|
141 |
|:-------------|:----|:--------|:----|
|
142 |
-
| Word count |
|
143 |
|
144 |
| Label | Training Sample Count |
|
145 |
|:------|:----------------------|
|
146 |
| 0 | 15 |
|
147 |
-
| 1 |
|
|
|
148 |
|
149 |
### Training Hyperparameters
|
150 |
- batch_size: (16, 16)
|
@@ -164,16 +171,25 @@ preds = model("I'm extremely disappointed with my recent visit to this restauran
|
|
164 |
- load_best_model_at_end: True
|
165 |
|
166 |
### Training Results
|
167 |
-
| Epoch | Step
|
168 |
-
|
169 |
-
| 0.
|
170 |
-
|
|
171 |
-
|
|
172 |
-
|
|
173 |
-
|
|
174 |
-
|
|
175 |
-
|
|
176 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
177 |
|
178 |
* The bold row denotes the saved checkpoint.
|
179 |
### Framework Versions
|
|
|
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 |
split: test
|
51 |
metrics:
|
52 |
- type: accuracy
|
53 |
+
value: 0.6226968174204355
|
54 |
name: Accuracy
|
55 |
---
|
56 |
|
|
|
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 |
- **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 |
# 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 |
### 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)
|
|
|
171 |
- load_best_model_at_end: True
|
172 |
|
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
|
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_585",
|
3 |
"architectures": [
|
4 |
"MPNetModel"
|
5 |
],
|
config_setfit.json
CHANGED
@@ -2,6 +2,7 @@
|
|
2 |
"normalize_embeddings": false,
|
3 |
"labels": [
|
4 |
"0",
|
5 |
-
"1"
|
|
|
6 |
]
|
7 |
}
|
|
|
2 |
"normalize_embeddings": false,
|
3 |
"labels": [
|
4 |
"0",
|
5 |
+
"1",
|
6 |
+
"2"
|
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:7f0d905d2d7ef3da0b0858e85c48389565aaba79218c6afb2b6464052fa58d1e
|
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:3ae0bc7355dd2ba27882ddebd7cf1982e447d9c5f9e0d150f18eeb98a9e13f7f
|
3 |
+
size 19295
|