mann2107 commited on
Commit
73d7668
1 Parent(s): cb8c4fb

Push model using huggingface_hub.

Browse files
1_Pooling/config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "word_embedding_dimension": 384,
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
+ "pooling_mode_weightedmean_tokens": false,
8
+ "pooling_mode_lasttoken": false,
9
+ "include_prompt": true
10
+ }
README.md ADDED
@@ -0,0 +1,210 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: sentence-transformers/all-MiniLM-L6-v2
3
+ library_name: setfit
4
+ metrics:
5
+ - accuracy
6
+ pipeline_tag: text-classification
7
+ tags:
8
+ - setfit
9
+ - sentence-transformers
10
+ - text-classification
11
+ - generated_from_setfit_trainer
12
+ widget:
13
+ - text: Thank you for your email. Please go ahead and issue. Please invoice in KES
14
+ - text: Hi, We are missing some invoices, can you please provide it. 02 - 12 - 2020
15
+ AGENT FEE 8900784339018 $21.00 02 - 19 - 2020 AGENT FEE 0017417554160 $22.00 02
16
+ - 19 - 2020 AGENT FEE 0017417554143 $22.00 02 - 19 - 2020 AGENT FEE 8900783383420
17
+ $21.00
18
+ - text: We need your assistance with the payment for the recent office supplies order.
19
+ Let us know once it's done.
20
+ - text: I have reported this in November and not only was the trip supposed to be
21
+ cancelled and credited I was double billed and the billing has not been corrected.
22
+ The total credit should be $667.20. Please confirm this will be done.
23
+ - text: The invoice for the travel arrangements needs to be settled. Kindly provide
24
+ payment confirmation.
25
+ inference: true
26
+ ---
27
+
28
+ # SetFit with sentence-transformers/all-MiniLM-L6-v2
29
+
30
+ This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. This SetFit model uses [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-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.
31
+
32
+ The model has been trained using an efficient few-shot learning technique that involves:
33
+
34
+ 1. Fine-tuning a [Sentence Transformer](https://www.sbert.net) with contrastive learning.
35
+ 2. Training a classification head with features from the fine-tuned Sentence Transformer.
36
+
37
+ ## Model Details
38
+
39
+ ### Model Description
40
+ - **Model Type:** SetFit
41
+ - **Sentence Transformer body:** [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2)
42
+ - **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
43
+ - **Maximum Sequence Length:** 256 tokens
44
+ - **Number of Classes:** 14 classes
45
+ <!-- - **Training Dataset:** [Unknown](https://huggingface.co/datasets/unknown) -->
46
+ <!-- - **Language:** Unknown -->
47
+ <!-- - **License:** Unknown -->
48
+
49
+ ### Model Sources
50
+
51
+ - **Repository:** [SetFit on GitHub](https://github.com/huggingface/setfit)
52
+ - **Paper:** [Efficient Few-Shot Learning Without Prompts](https://arxiv.org/abs/2209.11055)
53
+ - **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
54
+
55
+ ### Model Labels
56
+ | Label | Examples |
57
+ |:------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
58
+ | 0 | <ul><li>'Please send me quotation for a flight for Lindelani Mkhize - East London/ Durban 31 August @ 12:00'</li><li>"I need to go to Fort Smith AR via XNA for PD days. I'd like to take AA 4064 at 10:00 am arriving 11:58 am on Monday, May 11 returning on AA 4064 at 12:26 pm arriving 2:16 pm on Saturday May 16. I will need a Hertz rental. I d like to stay at the Courtyard Marriott in Fort Smith on Monday through Thursday nights checking out on Friday morning."</li><li>'Can you please send me flight quotations for Mr Mthetho Sovara for travel to Bologna, Italy as per details below: 7 Oct: JHB to Bologna, Italy 14 Oct: Bologna, Italy to JHB'</li></ul> |
59
+ | 1 | <ul><li>'I need to cancel my flight booking from London Heathrow to JFK, New York, scheduled for August 15th, 2024. The booking reference is XJ12345.'</li><li>'Please cancel my flight for late March to Chicago and DC. Meetings have been cancelled. I am not available by phone.'</li><li>'I need to cancel the below trip due to illness in family. Could you please assist with this?'</li></ul> |
60
+ | 2 | <ul><li>'I need to change the departure time for my one-way flight from SFO to LAX on October 15th. Could you please reschedule it to a later flight around 6:00 PM on the same day?'</li><li>'Can you please extend my hotel reservation at the Marriott in Denver from November 19th to November 23rd, 2024? Originally, I was scheduled to check out on the 19th.'</li><li>"Lerato I checked Selbourne B/B, its not a nice place. Your colleague Stella booked Lindelani Mkhize in Hempston it's a beautiful place next to Garden Court, please change the accommodation from Selbourne to Hempston. This Selbourne is on the outskirt and my colleagues are not familiar with East London"</li></ul> |
61
+ | 3 | <ul><li>'Please add the below employee to our Concur system. In addition, make sure the Ghost Card is added into their profile. Lindsay Griffin [email protected]'</li><li>"Good afternoon - CAEP has 4 new staff members that we'd like to set - up new user profiles for. Please see the below information and let me know should anything additional be required. Last First Middle Travel Class Email Gender DOB Graham Rose - Helen Xiuqing Staff rose - [email protected] Female 6/14/1995 Gumbs Mary - Frances Akua Staff [email protected] Female 10/18/1995 Lee Elizabeth Andie Staff [email protected] Female 4/23/1991 Gilchrist Gabriel Jake Staff [email protected] Male"</li><li>'Good Morning, Please create a profile for Amelia West: Name: Amelia Jean - Danielle West DOB: 05/21/1987 PH: 202 - 997 - 6592 Email: [email protected]'</li></ul> |
62
+ | 4 | <ul><li>'Hi, My name is Lucia De Las Heras property accountant at Trion Properties. I am missing a few receipts to allocate the following charges. Would you please be able to provide a detailed invoice? 10/10/2019 FROSCH/GANT TRAVEL MBLOOMINGTON IN - 21'</li><li>'I would like to request an invoice/s for the above-mentioned employee who stayed at your establishment.'</li><li>"Hello, Looking for an invoice for the below charge to Ryan Schulke's card - could you please assist? Vendor: United Airlines Transaction Date: 02/04/2020 Amount: $2,132.07 Ticket Number: 0167515692834"</li></ul> |
63
+ | 5 | <ul><li>'This is the second email with this trip, but I still need an itinerary for trip scheduled for January 27. Derek'</li><li>'Please send us all the flights used by G4S Kenya in the year 2022. Sorry for the short notice but we need the information by 12:00 noon today.'</li><li>'Jen Holt Can you please send me the itinerary for Jen Holt for this trip this week to Jackson Mississippi?'</li></ul> |
64
+ | 6 | <ul><li>"I've had to call off my vacation. What are my options for getting refunded?"</li><li>"Looks like I won't be traveling due to some health issues. Is getting a refund for my booking possible?"</li><li>"I've fallen ill and can't travel as planned. Can you process a refund for me?"</li></ul> |
65
+ | 7 | <ul><li>'The arrangements as stated are acceptable. Please go ahead and confirm all bookings accordingly.'</li><li>"I've reviewed the details and everything seems in order. Please proceed with the booking."</li><li>'This travel plan is satisfactory. Please secure the necessary reservations.'</li></ul> |
66
+ | 8 | <ul><li>'I need some clarification on charges for a rebooked flight. It seems higher than anticipated. Who can provide more details?'</li><li>'Wishing you and your family a very Merry Christmas and a Happy and Healthy New Year. I have one unidentified item this month, hope you can help, and as always thanks in advance. Very limited information on this. 11/21/2019 #N/A #N/A #N/A 142.45 Rail Europe North Amer'</li><li>"We've identified a mismatch between our booking records and credit card statement. Who can assist with this issue?"</li></ul> |
67
+ | 9 | <ul><li>'I booked a hotel in Berlin for next month, but the confirmation email I received has the wrong dates. Can you please correct this and resend the confirmation?'</li><li>"I need to arrange a shuttle for our team from the airport to the conference venue, but I haven't received any confirmation yet. Can someone check on this for me?"</li><li>"When trying to book a flight for our CEO, the system shows an error stating 'payment not processed.' Can you assist in resolving this issue quickly?"</li></ul> |
68
+ | 10 | <ul><li>'Please assist with payment for the conference room booking at Hilton last week.'</li><li>'Kindly process the invoice for the catering services provided during the annual company meeting.'</li><li>"Supplier, please find a statement with all invoices listed due for the IT maintenance services. If you've already paid, please forward proof and date of payment. Thank you for your support."</li></ul> |
69
+ | 11 | <ul><li>"Congratulations! You've been selected to win a brand new iPhone 14. Click here to claim your prize now!"</li><li>'Get rich quick! Invest in our exclusive cryptocurrency and watch your money grow 10x in just a month. Limited time offer!'</li><li>'Your PayPal account has been compromised. Please click here to verify your information and secure your account.'</li></ul> |
70
+ | 12 | <ul><li>'Your flight booking has been confirmed. Flight details: Flight #BA283 from LHR to LAX on November 10th, departure at 12:30 PM.'</li><li>'We regret to inform you that your hotel reservation at The Plaza, New York, was unsuccessful due to unavailability. Please try booking another date.'</li><li>'Your car rental reservation with Hertz has been confirmed. Pickup location: JFK Airport, Date: October 20th, Time: 10:00 AM.'</li></ul> |
71
+ | 13 | <ul><li>'We have received a request to charge the attached invoice to the corporate credit card on file for Jane Doe. Please confirm the payment details at your earliest convenience.'</li><li>'Dear Travel Agency, we regret to inform you that the room booked for Mr. John Smith is unavailable due to overbooking. We have arranged an alternative accommodation at a nearby hotel. Please advise if this is acceptable.'</li><li>'Regarding the recent stay of Mr. Alan Harper, we noticed a discrepancy in the billing. The minibar charges were not included in the initial invoice. Kindly review the attached revised bill.'</li></ul> |
72
+
73
+ ## Uses
74
+
75
+ ### Direct Use for Inference
76
+
77
+ First install the SetFit library:
78
+
79
+ ```bash
80
+ pip install setfit
81
+ ```
82
+
83
+ Then you can load this model and run inference.
84
+
85
+ ```python
86
+ from setfit import SetFitModel
87
+
88
+ # Download from the 🤗 Hub
89
+ model = SetFitModel.from_pretrained("mann2107/BCMPIIRAB_MiniLM_ALLNew")
90
+ # Run inference
91
+ preds = model("Thank you for your email. Please go ahead and issue. Please invoice in KES")
92
+ ```
93
+
94
+ <!--
95
+ ### Downstream Use
96
+
97
+ *List how someone could finetune this model on their own dataset.*
98
+ -->
99
+
100
+ <!--
101
+ ### Out-of-Scope Use
102
+
103
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
104
+ -->
105
+
106
+ <!--
107
+ ## Bias, Risks and Limitations
108
+
109
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
110
+ -->
111
+
112
+ <!--
113
+ ### Recommendations
114
+
115
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
116
+ -->
117
+
118
+ ## Training Details
119
+
120
+ ### Training Set Metrics
121
+ | Training set | Min | Median | Max |
122
+ |:-------------|:----|:--------|:----|
123
+ | Word count | 1 | 25.6577 | 136 |
124
+
125
+ | Label | Training Sample Count |
126
+ |:------|:----------------------|
127
+ | 0 | 24 |
128
+ | 1 | 24 |
129
+ | 2 | 24 |
130
+ | 3 | 24 |
131
+ | 4 | 24 |
132
+ | 5 | 24 |
133
+ | 6 | 24 |
134
+ | 7 | 24 |
135
+ | 8 | 24 |
136
+ | 9 | 24 |
137
+ | 10 | 24 |
138
+ | 11 | 24 |
139
+ | 12 | 24 |
140
+ | 13 | 24 |
141
+
142
+ ### Training Hyperparameters
143
+ - batch_size: (64, 64)
144
+ - num_epochs: (2, 2)
145
+ - max_steps: -1
146
+ - sampling_strategy: oversampling
147
+ - num_iterations: 1
148
+ - body_learning_rate: (0.00014039790878227676, 0.00014039790878227676)
149
+ - head_learning_rate: 0.0005686856164979006
150
+ - loss: CosineSimilarityLoss
151
+ - distance_metric: cosine_distance
152
+ - margin: 0.25
153
+ - end_to_end: False
154
+ - use_amp: False
155
+ - warmup_proportion: 0.1
156
+ - max_length: 512
157
+ - seed: 42
158
+ - eval_max_steps: -1
159
+ - load_best_model_at_end: True
160
+
161
+ ### Training Results
162
+ | Epoch | Step | Training Loss | Validation Loss |
163
+ |:-------:|:------:|:-------------:|:---------------:|
164
+ | 0.0909 | 1 | 0.2491 | - |
165
+ | 1.0 | 11 | - | 0.1241 |
166
+ | **2.0** | **22** | **-** | **0.086** |
167
+
168
+ * The bold row denotes the saved checkpoint.
169
+ ### Framework Versions
170
+ - Python: 3.10.12
171
+ - SetFit: 1.1.0.dev0
172
+ - Sentence Transformers: 3.0.1
173
+ - Transformers: 4.42.4
174
+ - PyTorch: 2.3.1+cu121
175
+ - Datasets: 2.20.0
176
+ - Tokenizers: 0.19.1
177
+
178
+ ## Citation
179
+
180
+ ### BibTeX
181
+ ```bibtex
182
+ @article{https://doi.org/10.48550/arxiv.2209.11055,
183
+ doi = {10.48550/ARXIV.2209.11055},
184
+ url = {https://arxiv.org/abs/2209.11055},
185
+ author = {Tunstall, Lewis and Reimers, Nils and Jo, Unso Eun Seo and Bates, Luke and Korat, Daniel and Wasserblat, Moshe and Pereg, Oren},
186
+ keywords = {Computation and Language (cs.CL), FOS: Computer and information sciences, FOS: Computer and information sciences},
187
+ title = {Efficient Few-Shot Learning Without Prompts},
188
+ publisher = {arXiv},
189
+ year = {2022},
190
+ copyright = {Creative Commons Attribution 4.0 International}
191
+ }
192
+ ```
193
+
194
+ <!--
195
+ ## Glossary
196
+
197
+ *Clearly define terms in order to be accessible across audiences.*
198
+ -->
199
+
200
+ <!--
201
+ ## Model Card Authors
202
+
203
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
204
+ -->
205
+
206
+ <!--
207
+ ## Model Card Contact
208
+
209
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
210
+ -->
config.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "checkpoints/step_22",
3
+ "architectures": [
4
+ "BertModel"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "classifier_dropout": null,
8
+ "gradient_checkpointing": false,
9
+ "hidden_act": "gelu",
10
+ "hidden_dropout_prob": 0.1,
11
+ "hidden_size": 384,
12
+ "initializer_range": 0.02,
13
+ "intermediate_size": 1536,
14
+ "layer_norm_eps": 1e-12,
15
+ "max_position_embeddings": 512,
16
+ "model_type": "bert",
17
+ "num_attention_heads": 12,
18
+ "num_hidden_layers": 6,
19
+ "pad_token_id": 0,
20
+ "position_embedding_type": "absolute",
21
+ "torch_dtype": "float32",
22
+ "transformers_version": "4.42.4",
23
+ "type_vocab_size": 2,
24
+ "use_cache": true,
25
+ "vocab_size": 30522
26
+ }
config_sentence_transformers.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "__version__": {
3
+ "sentence_transformers": "3.0.1",
4
+ "transformers": "4.42.4",
5
+ "pytorch": "2.3.1+cu121"
6
+ },
7
+ "prompts": {},
8
+ "default_prompt_name": null,
9
+ "similarity_fn_name": null
10
+ }
config_setfit.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "normalize_embeddings": false,
3
+ "labels": null
4
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:66c49c5c2e94da4d0dc3a52a80b24d4f706279db5dbb4cb2652f1efb37d691a4
3
+ size 90864192
model_head.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0164d0e39c0d0cf8f7597cee8b614192a0356cd5dc4a1b971960c5878a6f2544
3
+ size 44071
modules.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ {
15
+ "idx": 2,
16
+ "name": "2",
17
+ "path": "2_Normalize",
18
+ "type": "sentence_transformers.models.Normalize"
19
+ }
20
+ ]
sentence_bert_config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "max_seq_length": 256,
3
+ "do_lower_case": false
4
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": {
3
+ "content": "[CLS]",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "mask_token": {
10
+ "content": "[MASK]",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "[PAD]",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "sep_token": {
24
+ "content": "[SEP]",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "unk_token": {
31
+ "content": "[UNK]",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ }
37
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "[PAD]",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "100": {
12
+ "content": "[UNK]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "101": {
20
+ "content": "[CLS]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "102": {
28
+ "content": "[SEP]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "103": {
36
+ "content": "[MASK]",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "clean_up_tokenization_spaces": true,
45
+ "cls_token": "[CLS]",
46
+ "do_basic_tokenize": true,
47
+ "do_lower_case": true,
48
+ "mask_token": "[MASK]",
49
+ "max_length": 128,
50
+ "model_max_length": 256,
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
+ }
vocab.txt ADDED
The diff for this file is too large to render. See raw diff