mann2107 commited on
Commit
5e32cb2
1 Parent(s): 7e705ef

Add SetFit model

Browse files
Files changed (5) hide show
  1. README.md +3 -82
  2. config.json +1 -1
  3. config_setfit.json +2 -2
  4. model.safetensors +1 -1
  5. model_head.pkl +2 -2
README.md CHANGED
@@ -9,19 +9,7 @@ tags:
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
 
@@ -41,7 +29,7 @@ The model has been trained using an efficient few-shot learning technique that i
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 -->
@@ -52,24 +40,6 @@ The model has been trained using an efficient few-shot learning technique that i
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
@@ -88,7 +58,7 @@ from setfit import SetFitModel
88
  # Download from the 🤗 Hub
89
  model = SetFitModel.from_pretrained("mann2107/BCMPIIRAB_MiniLM_ALL")
90
  # Run inference
91
- preds = model("Thank you for your email. Please go ahead and issue. Please invoice in KES")
92
  ```
93
 
94
  <!--
@@ -117,55 +87,6 @@ preds = model("Thank you for your email. Please go ahead and issue. Please invoi
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: 2
148
- - body_learning_rate: (0.0005201181161511404, 0.0005201181161511404)
149
- - head_learning_rate: 0.00021200244124154418
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.0476 | 1 | 0.2504 | - |
165
- | 1.0 | 21 | - | 0.0691 |
166
- | **2.0** | **42** | **-** | **0.0445** |
167
-
168
- * The bold row denotes the saved checkpoint.
169
  ### Framework Versions
170
  - Python: 3.10.12
171
  - SetFit: 1.1.0.dev0
 
9
  - sentence-transformers
10
  - text-classification
11
  - generated_from_setfit_trainer
12
+ widget: []
 
 
 
 
 
 
 
 
 
 
 
 
13
  inference: true
14
  ---
15
 
 
29
  - **Sentence Transformer body:** [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2)
30
  - **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
31
  - **Maximum Sequence Length:** 256 tokens
32
+ <!-- - **Number of Classes:** Unknown -->
33
  <!-- - **Training Dataset:** [Unknown](https://huggingface.co/datasets/unknown) -->
34
  <!-- - **Language:** Unknown -->
35
  <!-- - **License:** Unknown -->
 
40
  - **Paper:** [Efficient Few-Shot Learning Without Prompts](https://arxiv.org/abs/2209.11055)
41
  - **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  ## Uses
44
 
45
  ### Direct Use for Inference
 
58
  # Download from the 🤗 Hub
59
  model = SetFitModel.from_pretrained("mann2107/BCMPIIRAB_MiniLM_ALL")
60
  # Run inference
61
+ preds = model("I loved the spiderman movie!")
62
  ```
63
 
64
  <!--
 
87
 
88
  ## Training Details
89
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  ### Framework Versions
91
  - Python: 3.10.12
92
  - SetFit: 1.1.0.dev0
config.json CHANGED
@@ -1,5 +1,5 @@
1
  {
2
- "_name_or_path": "checkpoints/step_42",
3
  "architectures": [
4
  "BertModel"
5
  ],
 
1
  {
2
+ "_name_or_path": "checkpoints/step_22",
3
  "architectures": [
4
  "BertModel"
5
  ],
config_setfit.json CHANGED
@@ -1,4 +1,4 @@
1
  {
2
- "normalize_embeddings": false,
3
- "labels": null
4
  }
 
1
  {
2
+ "labels": null,
3
+ "normalize_embeddings": false
4
  }
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:b6d5bbed3f8e6e3c26eff6f9789b1143287d78fede70452eda4cef3333b833f1
3
  size 90864192
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ccf3a719b3d8861984c8066f8e41e91d8b7d08d34fd2d26cc98182029efd668f
3
  size 90864192
model_head.pkl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:ccc2b30a2521323751b38ef4e29d5ee8e2b6a71e33d25feb0e726b505e7f89dd
3
- size 44071
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9a092ed9da9d7cfd3d7e126d009db42cd5fb79c81dd32779b8b79a2ba5d4d0df
3
+ size 44127