pacoreyes commited on
Commit
724ea7d
1 Parent(s): bed0463

uploading SetFit Model

Browse files

uploading SetFit Model fine-tuned with the StanceSentences dataset

1_Pooling/config.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "word_embedding_dimension": 768,
3
+ "pooling_mode_cls_token": false,
4
+ "pooling_mode_mean_tokens": true,
5
+ "pooling_mode_max_tokens": false,
6
+ "pooling_mode_mean_sqrt_len_tokens": false
7
+ }
README.md CHANGED
@@ -1,3 +1,152 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: setfit
3
+ tags:
4
+ - setfit
5
+ - sentence-transformers
6
+ - text-classification
7
+ - generated_from_setfit_trainer
8
+ metrics:
9
+ - accuracy
10
+ widget: []
11
+ pipeline_tag: text-classification
12
+ inference: true
13
+ base_model: sentence-transformers/paraphrase-mpnet-base-v2
14
+ model-index:
15
+ - name: SetFit with sentence-transformers/paraphrase-mpnet-base-v2
16
+ results:
17
+ - task:
18
+ type: text-classification
19
+ name: Text Classification
20
+ dataset:
21
+ name: Unknown
22
+ type: unknown
23
+ split: test
24
+ metrics:
25
+ - type: accuracy
26
+ value: 1.0
27
+ name: Accuracy
28
+ ---
29
+
30
+ # SetFit with sentence-transformers/paraphrase-mpnet-base-v2
31
+
32
+ This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. This SetFit model uses [sentence-transformers/paraphrase-mpnet-base-v2](https://huggingface.co/sentence-transformers/paraphrase-mpnet-base-v2) as the Sentence Transformer embedding model. A [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance is used for classification.
33
+
34
+ The model has been trained using an efficient few-shot learning technique that involves:
35
+
36
+ 1. Fine-tuning a [Sentence Transformer](https://www.sbert.net) with contrastive learning.
37
+ 2. Training a classification head with features from the fine-tuned Sentence Transformer.
38
+
39
+ ## Model Details
40
+
41
+ ### Model Description
42
+ - **Model Type:** SetFit
43
+ - **Sentence Transformer body:** [sentence-transformers/paraphrase-mpnet-base-v2](https://huggingface.co/sentence-transformers/paraphrase-mpnet-base-v2)
44
+ - **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
45
+ - **Maximum Sequence Length:** 512 tokens
46
+ <!-- - **Number of Classes:** Unknown -->
47
+ <!-- - **Training Dataset:** [Unknown](https://huggingface.co/datasets/unknown) -->
48
+ <!-- - **Language:** Unknown -->
49
+ <!-- - **License:** Unknown -->
50
+
51
+ ### Model Sources
52
+
53
+ - **Repository:** [SetFit on GitHub](https://github.com/huggingface/setfit)
54
+ - **Paper:** [Efficient Few-Shot Learning Without Prompts](https://arxiv.org/abs/2209.11055)
55
+ - **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
56
+
57
+ ## Evaluation
58
+
59
+ ### Metrics
60
+ | Label | Accuracy |
61
+ |:--------|:---------|
62
+ | **all** | 1.0 |
63
+
64
+ ## Uses
65
+
66
+ ### Direct Use for Inference
67
+
68
+ First install the SetFit library:
69
+
70
+ ```bash
71
+ pip install setfit
72
+ ```
73
+
74
+ Then you can load this model and run inference.
75
+
76
+ ```python
77
+ from setfit import SetFitModel
78
+
79
+ # Download from the 🤗 Hub
80
+ model = SetFitModel.from_pretrained("setfit_model_id")
81
+ # Run inference
82
+ preds = model("I loved the spiderman movie!")
83
+ ```
84
+
85
+ <!--
86
+ ### Downstream Use
87
+
88
+ *List how someone could finetune this model on their own dataset.*
89
+ -->
90
+
91
+ <!--
92
+ ### Out-of-Scope Use
93
+
94
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
95
+ -->
96
+
97
+ <!--
98
+ ## Bias, Risks and Limitations
99
+
100
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
101
+ -->
102
+
103
+ <!--
104
+ ### Recommendations
105
+
106
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
107
+ -->
108
+
109
+ ## Training Details
110
+
111
+ ### Framework Versions
112
+ - Python: 3.10.11
113
+ - SetFit: 1.0.1
114
+ - Sentence Transformers: 2.2.2
115
+ - Transformers: 4.25.1
116
+ - PyTorch: 2.1.2
117
+ - Datasets: 2.15.0
118
+ - Tokenizers: 0.13.3
119
+
120
+ ## Citation
121
+
122
+ ### BibTeX
123
+ ```bibtex
124
+ @article{https://doi.org/10.48550/arxiv.2209.11055,
125
+ doi = {10.48550/ARXIV.2209.11055},
126
+ url = {https://arxiv.org/abs/2209.11055},
127
+ author = {Tunstall, Lewis and Reimers, Nils and Jo, Unso Eun Seo and Bates, Luke and Korat, Daniel and Wasserblat, Moshe and Pereg, Oren},
128
+ keywords = {Computation and Language (cs.CL), FOS: Computer and information sciences, FOS: Computer and information sciences},
129
+ title = {Efficient Few-Shot Learning Without Prompts},
130
+ publisher = {arXiv},
131
+ year = {2022},
132
+ copyright = {Creative Commons Attribution 4.0 International}
133
+ }
134
+ ```
135
+
136
+ <!--
137
+ ## Glossary
138
+
139
+ *Clearly define terms in order to be accessible across audiences.*
140
+ -->
141
+
142
+ <!--
143
+ ## Model Card Authors
144
+
145
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
146
+ -->
147
+
148
+ <!--
149
+ ## Model Card Contact
150
+
151
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
152
+ -->
config.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "checkpoints/step_2000/",
3
+ "architectures": [
4
+ "MPNetModel"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "bos_token_id": 0,
8
+ "eos_token_id": 2,
9
+ "hidden_act": "gelu",
10
+ "hidden_dropout_prob": 0.1,
11
+ "hidden_size": 768,
12
+ "initializer_range": 0.02,
13
+ "intermediate_size": 3072,
14
+ "layer_norm_eps": 1e-05,
15
+ "max_position_embeddings": 514,
16
+ "model_type": "mpnet",
17
+ "num_attention_heads": 12,
18
+ "num_hidden_layers": 12,
19
+ "pad_token_id": 1,
20
+ "relative_attention_num_buckets": 32,
21
+ "torch_dtype": "float32",
22
+ "transformers_version": "4.25.1",
23
+ "vocab_size": 30527
24
+ }
config_sentence_transformers.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "__version__": {
3
+ "sentence_transformers": "2.0.0",
4
+ "transformers": "4.7.0",
5
+ "pytorch": "1.9.0+cu102"
6
+ }
7
+ }
config_setfit.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "normalize_embeddings": false,
3
+ "labels": null
4
+ }
model_head.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1a4d0d286315d0ec84dcca769bee5958abbec6a4c73e5e229f1ec8368676e5d0
3
+ size 7019
modules.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "idx": 0,
4
+ "name": "0",
5
+ "path": "",
6
+ "type": "sentence_transformers.models.Transformer"
7
+ },
8
+ {
9
+ "idx": 1,
10
+ "name": "1",
11
+ "path": "1_Pooling",
12
+ "type": "sentence_transformers.models.Pooling"
13
+ }
14
+ ]
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5d6522dfabc397b3bf2ce0751263f48e63d41460e312dda5ab97ba9f7d439a6c
3
+ size 438014122
sentence_bert_config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "max_seq_length": 512,
3
+ "do_lower_case": false
4
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<s>",
3
+ "cls_token": "<s>",
4
+ "eos_token": "</s>",
5
+ "mask_token": {
6
+ "content": "<mask>",
7
+ "lstrip": true,
8
+ "normalized": false,
9
+ "rstrip": false,
10
+ "single_word": false
11
+ },
12
+ "pad_token": "<pad>",
13
+ "sep_token": "</s>",
14
+ "unk_token": "[UNK]"
15
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "__type": "AddedToken",
4
+ "content": "<s>",
5
+ "lstrip": false,
6
+ "normalized": true,
7
+ "rstrip": false,
8
+ "single_word": false
9
+ },
10
+ "cls_token": {
11
+ "__type": "AddedToken",
12
+ "content": "<s>",
13
+ "lstrip": false,
14
+ "normalized": true,
15
+ "rstrip": false,
16
+ "single_word": false
17
+ },
18
+ "do_basic_tokenize": true,
19
+ "do_lower_case": true,
20
+ "eos_token": {
21
+ "__type": "AddedToken",
22
+ "content": "</s>",
23
+ "lstrip": false,
24
+ "normalized": true,
25
+ "rstrip": false,
26
+ "single_word": false
27
+ },
28
+ "mask_token": {
29
+ "__type": "AddedToken",
30
+ "content": "<mask>",
31
+ "lstrip": true,
32
+ "normalized": true,
33
+ "rstrip": false,
34
+ "single_word": false
35
+ },
36
+ "model_max_length": 512,
37
+ "name_or_path": "checkpoints/step_2000/",
38
+ "never_split": null,
39
+ "pad_token": {
40
+ "__type": "AddedToken",
41
+ "content": "<pad>",
42
+ "lstrip": false,
43
+ "normalized": true,
44
+ "rstrip": false,
45
+ "single_word": false
46
+ },
47
+ "sep_token": {
48
+ "__type": "AddedToken",
49
+ "content": "</s>",
50
+ "lstrip": false,
51
+ "normalized": true,
52
+ "rstrip": false,
53
+ "single_word": false
54
+ },
55
+ "special_tokens_map_file": null,
56
+ "strip_accents": null,
57
+ "tokenize_chinese_chars": true,
58
+ "tokenizer_class": "MPNetTokenizer",
59
+ "unk_token": {
60
+ "__type": "AddedToken",
61
+ "content": "[UNK]",
62
+ "lstrip": false,
63
+ "normalized": true,
64
+ "rstrip": false,
65
+ "single_word": false
66
+ }
67
+ }
vocab.txt ADDED
The diff for this file is too large to render. See raw diff