Add SetFit model
Browse files- README.md +50 -3
- config.json +1 -1
- config_setfit.json +2 -2
- model.safetensors +1 -1
- model_head.pkl +2 -2
- tokenizer.json +14 -2
- tokenizer_config.json +7 -0
README.md
CHANGED
|
@@ -9,8 +9,6 @@ base_model: BAAI/bge-small-en-v1.5
|
|
| 9 |
metrics:
|
| 10 |
- accuracy
|
| 11 |
widget:
|
| 12 |
-
- text: Can you let me know if my claim has been approved?
|
| 13 |
-
- text: Can you provide an update on the progress of my claim?
|
| 14 |
- text: Thank you for your outreach. Currently, our priorities are focused elsewhere,
|
| 15 |
and we are not considering new solutions. I would be open to revisiting this conversation
|
| 16 |
in [insert timeframe, e.g., 6 months]. Please follow up then.
|
|
@@ -19,8 +17,24 @@ widget:
|
|
| 19 |
a reassessment.
|
| 20 |
- text: I recently moved to a new apartment. How can I update my address for my renter's
|
| 21 |
insurance policy?
|
|
|
|
|
|
|
| 22 |
pipeline_tag: text-classification
|
| 23 |
inference: false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
---
|
| 25 |
|
| 26 |
# SetFit with BAAI/bge-small-en-v1.5
|
|
@@ -50,6 +64,13 @@ The model has been trained using an efficient few-shot learning technique that i
|
|
| 50 |
- **Paper:** [Efficient Few-Shot Learning Without Prompts](https://arxiv.org/abs/2209.11055)
|
| 51 |
- **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
|
| 52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
## Uses
|
| 54 |
|
| 55 |
### Direct Use for Inference
|
|
@@ -68,7 +89,7 @@ from setfit import SetFitModel
|
|
| 68 |
# Download from the 🤗 Hub
|
| 69 |
model = SetFitModel.from_pretrained("setfit_model_id")
|
| 70 |
# Run inference
|
| 71 |
-
preds = model("Can you
|
| 72 |
```
|
| 73 |
|
| 74 |
<!--
|
|
@@ -102,6 +123,32 @@ preds = model("Can you let me know if my claim has been approved?")
|
|
| 102 |
|:-------------|:----|:--------|:----|
|
| 103 |
| Word count | 1 | 14.3077 | 37 |
|
| 104 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
### Framework Versions
|
| 106 |
- Python: 3.8.4
|
| 107 |
- SetFit: 1.0.3
|
|
|
|
| 9 |
metrics:
|
| 10 |
- accuracy
|
| 11 |
widget:
|
|
|
|
|
|
|
| 12 |
- text: Thank you for your outreach. Currently, our priorities are focused elsewhere,
|
| 13 |
and we are not considering new solutions. I would be open to revisiting this conversation
|
| 14 |
in [insert timeframe, e.g., 6 months]. Please follow up then.
|
|
|
|
| 17 |
a reassessment.
|
| 18 |
- text: I recently moved to a new apartment. How can I update my address for my renter's
|
| 19 |
insurance policy?
|
| 20 |
+
- text: Can you provide an update on the status of my insurance claim?
|
| 21 |
+
- text: I have a new mailing address. Please update it for my records.
|
| 22 |
pipeline_tag: text-classification
|
| 23 |
inference: false
|
| 24 |
+
model-index:
|
| 25 |
+
- name: SetFit with BAAI/bge-small-en-v1.5
|
| 26 |
+
results:
|
| 27 |
+
- task:
|
| 28 |
+
type: text-classification
|
| 29 |
+
name: Text Classification
|
| 30 |
+
dataset:
|
| 31 |
+
name: Unknown
|
| 32 |
+
type: unknown
|
| 33 |
+
split: test
|
| 34 |
+
metrics:
|
| 35 |
+
- type: accuracy
|
| 36 |
+
value: 0.8461538461538461
|
| 37 |
+
name: Accuracy
|
| 38 |
---
|
| 39 |
|
| 40 |
# SetFit with BAAI/bge-small-en-v1.5
|
|
|
|
| 64 |
- **Paper:** [Efficient Few-Shot Learning Without Prompts](https://arxiv.org/abs/2209.11055)
|
| 65 |
- **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
|
| 66 |
|
| 67 |
+
## Evaluation
|
| 68 |
+
|
| 69 |
+
### Metrics
|
| 70 |
+
| Label | Accuracy |
|
| 71 |
+
|:--------|:---------|
|
| 72 |
+
| **all** | 0.8462 |
|
| 73 |
+
|
| 74 |
## Uses
|
| 75 |
|
| 76 |
### Direct Use for Inference
|
|
|
|
| 89 |
# Download from the 🤗 Hub
|
| 90 |
model = SetFitModel.from_pretrained("setfit_model_id")
|
| 91 |
# Run inference
|
| 92 |
+
preds = model("Can you provide an update on the status of my insurance claim?")
|
| 93 |
```
|
| 94 |
|
| 95 |
<!--
|
|
|
|
| 123 |
|:-------------|:----|:--------|:----|
|
| 124 |
| Word count | 1 | 14.3077 | 37 |
|
| 125 |
|
| 126 |
+
### Training Hyperparameters
|
| 127 |
+
- batch_size: (32, 32)
|
| 128 |
+
- num_epochs: (1, 1)
|
| 129 |
+
- max_steps: -1
|
| 130 |
+
- sampling_strategy: oversampling
|
| 131 |
+
- num_iterations: 0
|
| 132 |
+
- body_learning_rate: (2e-05, 1e-05)
|
| 133 |
+
- head_learning_rate: 0.01
|
| 134 |
+
- loss: CosineSimilarityLoss
|
| 135 |
+
- distance_metric: cosine_distance
|
| 136 |
+
- margin: 0.25
|
| 137 |
+
- end_to_end: False
|
| 138 |
+
- use_amp: False
|
| 139 |
+
- warmup_proportion: 0.1
|
| 140 |
+
- seed: 42
|
| 141 |
+
- eval_max_steps: -1
|
| 142 |
+
- load_best_model_at_end: True
|
| 143 |
+
|
| 144 |
+
### Training Results
|
| 145 |
+
| Epoch | Step | Training Loss | Validation Loss |
|
| 146 |
+
|:-------:|:------:|:-------------:|:---------------:|
|
| 147 |
+
| 0.0152 | 1 | 0.2404 | - |
|
| 148 |
+
| 0.7576 | 50 | 0.0375 | - |
|
| 149 |
+
| **1.0** | **66** | **-** | **0.0347** |
|
| 150 |
+
|
| 151 |
+
* The bold row denotes the saved checkpoint.
|
| 152 |
### Framework Versions
|
| 153 |
- Python: 3.8.4
|
| 154 |
- SetFit: 1.0.3
|
config.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"_name_or_path": "/
|
| 3 |
"architectures": [
|
| 4 |
"BertModel"
|
| 5 |
],
|
|
|
|
| 1 |
{
|
| 2 |
+
"_name_or_path": "checkpoints/step_66/",
|
| 3 |
"architectures": [
|
| 4 |
"BertModel"
|
| 5 |
],
|
config_setfit.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
{
|
|
|
|
| 2 |
"labels": [
|
| 3 |
"update_info",
|
| 4 |
"claim_status",
|
| 5 |
"coverage_info",
|
| 6 |
"get_quote",
|
| 7 |
"policy_renew"
|
| 8 |
-
]
|
| 9 |
-
"normalize_embeddings": false
|
| 10 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"normalize_embeddings": false,
|
| 3 |
"labels": [
|
| 4 |
"update_info",
|
| 5 |
"claim_status",
|
| 6 |
"coverage_info",
|
| 7 |
"get_quote",
|
| 8 |
"policy_renew"
|
| 9 |
+
]
|
|
|
|
| 10 |
}
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 133462128
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:161dd5df243c45251c516ab21699e4ab51a05218134b86c80fe7083d74a9c8f9
|
| 3 |
size 133462128
|
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:0ffb6d228c25fbd7acbc86f41a04b13d6098bfdd9ca996e83853e34735ea9eee
|
| 3 |
+
size 18001
|
tokenizer.json
CHANGED
|
@@ -1,7 +1,19 @@
|
|
| 1 |
{
|
| 2 |
"version": "1.0",
|
| 3 |
-
"truncation":
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
"added_tokens": [
|
| 6 |
{
|
| 7 |
"id": 0,
|
|
|
|
| 1 |
{
|
| 2 |
"version": "1.0",
|
| 3 |
+
"truncation": {
|
| 4 |
+
"direction": "Right",
|
| 5 |
+
"max_length": 512,
|
| 6 |
+
"strategy": "LongestFirst",
|
| 7 |
+
"stride": 0
|
| 8 |
+
},
|
| 9 |
+
"padding": {
|
| 10 |
+
"strategy": "BatchLongest",
|
| 11 |
+
"direction": "Right",
|
| 12 |
+
"pad_to_multiple_of": null,
|
| 13 |
+
"pad_id": 0,
|
| 14 |
+
"pad_type_id": 0,
|
| 15 |
+
"pad_token": "[PAD]"
|
| 16 |
+
},
|
| 17 |
"added_tokens": [
|
| 18 |
{
|
| 19 |
"id": 0,
|
tokenizer_config.json
CHANGED
|
@@ -46,12 +46,19 @@
|
|
| 46 |
"do_basic_tokenize": true,
|
| 47 |
"do_lower_case": true,
|
| 48 |
"mask_token": "[MASK]",
|
|
|
|
| 49 |
"model_max_length": 512,
|
| 50 |
"never_split": null,
|
|
|
|
| 51 |
"pad_token": "[PAD]",
|
|
|
|
|
|
|
| 52 |
"sep_token": "[SEP]",
|
|
|
|
| 53 |
"strip_accents": null,
|
| 54 |
"tokenize_chinese_chars": true,
|
| 55 |
"tokenizer_class": "BertTokenizer",
|
|
|
|
|
|
|
| 56 |
"unk_token": "[UNK]"
|
| 57 |
}
|
|
|
|
| 46 |
"do_basic_tokenize": true,
|
| 47 |
"do_lower_case": true,
|
| 48 |
"mask_token": "[MASK]",
|
| 49 |
+
"max_length": 512,
|
| 50 |
"model_max_length": 512,
|
| 51 |
"never_split": null,
|
| 52 |
+
"pad_to_multiple_of": null,
|
| 53 |
"pad_token": "[PAD]",
|
| 54 |
+
"pad_token_type_id": 0,
|
| 55 |
+
"padding_side": "right",
|
| 56 |
"sep_token": "[SEP]",
|
| 57 |
+
"stride": 0,
|
| 58 |
"strip_accents": null,
|
| 59 |
"tokenize_chinese_chars": true,
|
| 60 |
"tokenizer_class": "BertTokenizer",
|
| 61 |
+
"truncation_side": "right",
|
| 62 |
+
"truncation_strategy": "longest_first",
|
| 63 |
"unk_token": "[UNK]"
|
| 64 |
}
|