Text Classification
setfit
Safetensors
sentence-transformers
English
bert
generated_from_setfit_trainer
text-embeddings-inference
Instructions to use TinyModels/Setfit-banking-intent with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- setfit
How to use TinyModels/Setfit-banking-intent with setfit:
from setfit import SetFitModel model = SetFitModel.from_pretrained("TinyModels/Setfit-banking-intent") preds = model.predict(["i loved the spiderman movie!", "pineapple on pizza is the worst"]) print(preds) - sentence-transformers
How to use TinyModels/Setfit-banking-intent with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("TinyModels/Setfit-banking-intent") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,327 +1,528 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
-
|
| 9 |
-
-
|
| 10 |
-
-
|
| 11 |
-
|
| 12 |
-
-
|
| 13 |
-
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
inference: true
|
| 19 |
-
base_model: BAAI/bge-small-en-v1.5
|
| 20 |
---
|
| 21 |
|
| 22 |
-
#
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
| declined_cash_withdrawal | <ul><li>'I was not able to use the ATM to get cash'</li><li>'Hi, I am unable to use my card in ATM. I had tried my card in two ATMs but both ATMs declined it. Could you please check my account?'</li><li>"Is my card broken? I can't get cash out of the ATM"</li></ul> |
|
| 79 |
-
| declined_transfer | <ul><li>'I got a message that my transfer was declined.'</li><li>'I need to make a transfer but it keeps getting declined I need Help!'</li><li>'I tried to do a transfer but I got a message that it was declined.'</li></ul> |
|
| 80 |
-
| direct_debit_payment_not_recognised | <ul><li>'I just went through a old statement and noticed that a very large payment went through and i did not make it. It was from a few months ago, can I still dispute the payment?'</li><li>'A debit came through that I need to dispute.'</li><li>'I have an unauthorized charge.'</li></ul> |
|
| 81 |
-
| disposable_card_limits | <ul><li>'What are the policies of disposable cards?'</li><li>'I have a disposable virtual card. Is there a limit to how many times I can use it?'</li><li>"Are there any places that I can't use the disposable cards at?"</li></ul> |
|
| 82 |
-
| edit_personal_details | <ul><li>'I just got married and need to change my name on the account'</li><li>"I'd like to make some changes to my personal information."</li><li>'I need to change my last name on my account because I just got married.'</li></ul> |
|
| 83 |
-
| exchange_charge | <ul><li>'Would you be able to offer me a discount, since I need to exchange currencies frequently?'</li><li>'What are the currency exchange fees?'</li><li>'Will there be any extra fees if I exchange currencies?'</li></ul> |
|
| 84 |
-
| exchange_rate | <ul><li>'Where are you getting your exchange rates from?'</li><li>'How are the exchange rates determined?'</li><li>'Is there an exchange rate?'</li></ul> |
|
| 85 |
-
| exchange_via_app | <ul><li>'Can I exchange USD and GBP from the app?'</li><li>'I might need to exchange between USD and GBP, is this possible with your app?'</li><li>'Will it be possible to change from USD to GBP with this App?'</li></ul> |
|
| 86 |
-
| extra_charge_on_statement | <ul><li>'How come I was charged a transaction of $1?'</li><li>'What is this fee debit on my account?'</li><li>'Why is there a $1 charge on my statement?'</li></ul> |
|
| 87 |
-
| failed_transfer | <ul><li>"I can't seem to make a standard bank transfer. I have tried at least five times already but none of them are going through. Please tell me what is wrong?"</li><li>"Hi, I'm trying to purchase a flat and I'm needing the first payment for the mortgage to go through on the flat I'm trying to buy. For some reason I keep getting an error.can you assist in making this transfer? What is going on?"</li><li>'Did my transfer fail?'</li></ul> |
|
| 88 |
-
| fiat_currency_support | <ul><li>'How many currencies can I have?'</li><li>'What are eligible holding and exchange currencies?'</li><li>'What currencies can I not hold many in, if so what are they?'</li></ul> |
|
| 89 |
-
| get_disposable_virtual_card | <ul><li>'What can you use the disposable cards for?'</li><li>'Can you tell me where I can order a disposable virtual card?'</li><li>"Can you point me in the right direction of where to go to roder a disposable virtual card, I can't seem to find it."</li></ul> |
|
| 90 |
-
| get_physical_card | <ul><li>"I havn't received my PIN yet."</li><li>'How long do I wait for my PIN'</li><li>'In the app, where do I find my card PIN?'</li></ul> |
|
| 91 |
-
| getting_spare_card | <ul><li>'I would like to get a few more physical cards.'</li><li>'Do you charge for sending more cards?'</li><li>'Is it possible to get another card?'</li></ul> |
|
| 92 |
-
| getting_virtual_card | <ul><li>'How do I receive a virtual card?'</li><li>'How can I sign up for a virtual card?'</li><li>'Why have I not received a virtual card yet?'</li></ul> |
|
| 93 |
-
| lost_or_stolen_card | <ul><li>'I think my card is lost. What do I do?'</li><li>'Can you tell me the status of my new card?'</li><li>"I've lost my card. What can I do about that?"</li></ul> |
|
| 94 |
-
| lost_or_stolen_phone | <ul><li>'My app was on the phone and I was mugged. What do I do?'</li><li>'Can my account me accessed by a thief? I was mugged.'</li><li>"I don't know where my phone is."</li></ul> |
|
| 95 |
-
| order_physical_card | <ul><li>'Can I get a card in person?'</li><li>'tell me how I can order my card.'</li><li>'how do I ask for a physical card?'</li></ul> |
|
| 96 |
-
| passcode_forgotten | <ul><li>'How can I change my password?'</li><li>'I thought I knew my password but I guess I was wrong, what can I do now?'</li><li>'What are the steps for changing my passcode?'</li></ul> |
|
| 97 |
-
| pending_card_payment | <ul><li>'A card payment on my account is shown as pending.'</li><li>'I used my card to make a payment a while ago and its still pending, Why is it taking so long?'</li><li>"My payment is in the app but hasn't gone through yet"</li></ul> |
|
| 98 |
-
| pending_cash_withdrawal | <ul><li>"I tried to get some with-drawls but the machine didn't work. The transaction still seems in progress.Seems like something is wrong,I don't want to be charged for Transaction i did not make."</li><li>'Why would a cash withdrawal still be pending?'</li><li>'My ATM withdrawal is taking forever'</li></ul> |
|
| 99 |
-
| pending_top_up | <ul><li>'What is taking so long with my top up?'</li><li>'Why is the top-up I made still pending.'</li><li>'What do I do if my top-up has not gone through?'</li></ul> |
|
| 100 |
-
| pending_transfer | <ul><li>'The wait for this transfer seems to be taking a very long time. It is very important that it goes through quickly. Can you please tell me how long it may take?'</li><li>"Hi, I'm trying to transfer money from one country to another, but it's taking a long time! All the account information is right, so why is it taking so long?"</li><li>'I am still waiting for a transfer to show up'</li></ul> |
|
| 101 |
-
| pin_blocked | <ul><li>'I blocked my card by mistake, how do I unblock it?'</li><li>'How come I got blocked for entering wrong pins?'</li><li>'Help me unblock my account. I entered the PIN wrong too many times.'</li></ul> |
|
| 102 |
-
| receiving_money | <ul><li>'Can friends transfer money to each other?'</li><li>'Do I need to do anything special for my friend to send money to my account?'</li><li>'How can my boss pay me directly to the card?'</li></ul> |
|
| 103 |
-
| Refund_not_showing_up | <ul><li>'How do I find the refund on my statement?'</li><li>'My refund has not arrived, and I am unsure why. Who do I contact?'</li><li>"Why can't I see my refund in my statement?"</li></ul> |
|
| 104 |
-
| request_refund | <ul><li>'I want to cancel a purchase'</li><li>'Can I request a refund'</li><li>'I need a refund for something I bought.'</li></ul> |
|
| 105 |
-
| reverted_card_payment? | <ul><li>'I tried to buy something online but my funds were transferred back to my account. What is happening?'</li><li>'I did a payment but it was reverted by the app'</li><li>"I purchased something about one to two weeks ago but for some reason the payment was returned to my account today even though I've already received one of the items. Can you tell me what's going on?"</li></ul> |
|
| 106 |
-
| supported_cards_and_currencies | <ul><li>'Can I use this app for any currency?'</li><li>'Can you tell me what currencies I can use to add money?'</li><li>'What currencies are approved to add money?'</li></ul> |
|
| 107 |
-
| terminate_account | <ul><li>'I wish to remove my account.'</li><li>'How can I delete my account?'</li><li>'I want to deactivate my account.'</li></ul> |
|
| 108 |
-
| top_up_by_bank_transfer_charge | <ul><li>'How much does it cost to do a transfer?'</li><li>'If I top up by transfer, am I going to be charged?'</li><li>'Is there a cost to receive money?'</li></ul> |
|
| 109 |
-
| top_up_by_card_charge | <ul><li>'How much does it cost to top up a US-issued card?'</li><li>'Do you have any fees if I want to add money using an international card.'</li><li>'I want to add money to my international card, so are there any fees charged to do this?'</li></ul> |
|
| 110 |
-
| top_up_by_cash_or_cheque | <ul><li>'can i top up with check?'</li><li>'can i deposit a check here?'</li><li>'i would like to top up with check'</li></ul> |
|
| 111 |
-
| top_up_failed | <ul><li>"I don't think that my top-up worked."</li><li>"Won't let me top my card up!! Who can get it sorted out for me? It's urgent! How do I find out what the problem is with my card and how else to top it up?"</li><li>"I am having a huge problem with my card being declined and it's really important that I top-up today. Would you please look into this further and let me know how I can get this fixed?"</li></ul> |
|
| 112 |
-
| top_up_limits | <ul><li>'Can I use as many top-ups as I want?'</li><li>"What's the top-up limit?"</li><li>'Can I create my own top-up limit?'</li></ul> |
|
| 113 |
-
| top_up_reverted | <ul><li>'Why did my top-up get reverted?'</li><li>"Why didn't my top up work?"</li><li>'What if my top up is reverted?'</li></ul> |
|
| 114 |
-
| topping_up_by_card | <ul><li>'my top up isnt there yet where do i find it'</li><li>"I can't see my top up in my wallet!"</li><li>'Is it possible to transfer money to my credit card?'</li></ul> |
|
| 115 |
-
| transaction_charged_twice | <ul><li>'I have a duplicate charge'</li><li>'What happens with the duplicate charge in my account?'</li><li>"What do I do if I've been charged twice for the same transaction?"</li></ul> |
|
| 116 |
-
| transfer_fee_charged | <ul><li>'I make payments for my place abroad using this account and since i use it so frequently I was wondering why did the fees increase suddenly rather than decreasing? I would think customers like me should receive incentives for using your service'</li><li>'Why was I charged a fee for transferring money'</li><li>'I was charged a fee for the transfer, but can you tell me why?'</li></ul> |
|
| 117 |
-
| transfer_into_account | <ul><li>'I want to transfer a sum of money from another bank account I have into this one'</li><li>'How can I transfer money to this account from another bank?'</li><li>'How does your app transfer the money'</li></ul> |
|
| 118 |
-
| transfer_not_received_by_recipient | <ul><li>"I transferred money and it didn't get there."</li><li>"I'm still expecting the transaction to be finished"</li><li>'I am having an issue with an in country transfer I did a few days ago. It has yet to appear in my account. I have checked to be sure that all account information is correct multiple times. What is taking the transfer so long?'</li></ul> |
|
| 119 |
-
| transfer_timing | <ul><li>'When will the money be made available in my account?'</li><li>'What is the length of time for money to reach the account?'</li><li>'How long until transfers from Europe go through?'</li></ul> |
|
| 120 |
-
| unable_to_verify_identity | <ul><li>'The app is not able to realize that it is me.'</li><li>'why does it take so long to verify my id'</li><li>'Hearing about your verification results from us may take anywhere from 10 minutes to approximately one hour. If this verification has in fact, failed, double-check to make sure that your images are clear. Also make sure that your document photos have no blur or glare. They need to be readable. You must also be 18 years of age or older and be a resident of Switzerland or the European Economic Area to open an account.'</li></ul> |
|
| 121 |
-
| verify_my_identity | <ul><li>'Can I get a full list of instructions for identity checks?'</li><li>'How recent do my documents need to be for verification?'</li><li>'Can I get information on the identity checks?'</li></ul> |
|
| 122 |
-
| verify_source_of_funds | <ul><li>'I would like to know how to work out where my funds came from?'</li><li>"I'd like to know where my funds come from."</li><li>'how do i track the moeney'</li></ul> |
|
| 123 |
-
| verify_top_up | <ul><li>'What is the significance of verifying the top-up?'</li><li>'How are top-ups verified?'</li><li>"I don't see the verification code for my card transfer."</li></ul> |
|
| 124 |
-
| virtual_card_not_working | <ul><li>'My disposable virtual card got rejected'</li><li>"I can't get the virtual card to work"</li><li>"Why isn't my disposable virtual card working?"</li></ul> |
|
| 125 |
-
| visa_or_mastercard | <ul><li>'Which one are you? Visa or Mastercard?'</li><li>'Is it possible to get both Mastercard and Visa card from you?'</li><li>'is it ok if i use both visa and mastercard'</li></ul> |
|
| 126 |
-
| why_verify_identity | <ul><li>'What is the function of the identity check'</li><li>'I am not comfortable verifying my indentity.'</li><li>"My ID verification hasn't gone through yet, but can I use my account anyway?"</li></ul> |
|
| 127 |
-
| wrong_amount_of_cash_received | <ul><li>'I only got $20 of the $100 that I attempted to withdraw.'</li><li>'Got only $20 when I tried to withdraw $100.'</li><li>'I received less cash than the amount I specified in the ATM.'</li></ul> |
|
| 128 |
-
| wrong_exchange_rate_for_cash_withdrawal | <ul><li>'what is the correct exchange rate for getting cash'</li><li>'On my last trip, I received the incorrect exchange rate.'</li><li>'I used the ATM to get money out and did not realize I would be charged as much as I was or I would not have done that!'</li></ul> |
|
| 129 |
-
|
| 130 |
-
## Uses
|
| 131 |
-
|
| 132 |
-
### Direct Use for Inference
|
| 133 |
-
|
| 134 |
-
First install the SetFit library:
|
| 135 |
|
| 136 |
```bash
|
| 137 |
pip install setfit
|
| 138 |
```
|
| 139 |
|
| 140 |
-
Then you can load this model and run inference.
|
| 141 |
-
|
| 142 |
```python
|
| 143 |
from setfit import SetFitModel
|
| 144 |
|
| 145 |
-
#
|
| 146 |
-
model = SetFitModel.from_pretrained("
|
| 147 |
-
|
|
|
|
| 148 |
preds = model("I have an unauthorized charge.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 149 |
```
|
| 150 |
|
| 151 |
-
<
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
<
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
|
| 179 |
-
|
|
| 180 |
-
|
|
| 181 |
-
|
| 182 |
-
|
|
| 183 |
-
|
|
| 184 |
-
|
|
| 185 |
-
|
|
| 186 |
-
|
|
| 187 |
-
|
|
| 188 |
-
|
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
|
| 196 |
-
|
|
| 197 |
-
|
|
| 198 |
-
|
|
| 199 |
-
|
|
| 200 |
-
|
|
| 201 |
-
|
|
| 202 |
-
|
|
| 203 |
-
|
|
| 204 |
-
|
|
| 205 |
-
|
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
|
| 213 |
-
|
|
| 214 |
-
|
|
| 215 |
-
|
|
| 216 |
-
|
|
| 217 |
-
|
|
| 218 |
-
|
|
| 219 |
-
|
|
| 220 |
-
|
|
| 221 |
-
|
|
| 222 |
-
|
|
| 223 |
-
|
|
| 224 |
-
|
|
| 225 |
-
|
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
|
| 233 |
-
|
|
| 234 |
-
|
|
| 235 |
-
|
|
| 236 |
-
|
|
| 237 |
-
|
|
| 238 |
-
|
|
| 239 |
-
|
|
| 240 |
-
|
|
| 241 |
-
|
|
| 242 |
-
|
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
|
| 250 |
-
|
|
| 251 |
-
|
|
| 252 |
-
|
|
| 253 |
-
|
|
| 254 |
-
|
|
| 255 |
-
|
|
| 256 |
-
|
|
| 257 |
-
|
|
| 258 |
-
|
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
|
| 283 |
-
|
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 298 |
```bibtex
|
| 299 |
-
@article{
|
| 300 |
-
doi
|
| 301 |
-
url
|
| 302 |
-
author
|
| 303 |
-
keywords
|
| 304 |
-
title
|
| 305 |
publisher = {arXiv},
|
| 306 |
-
year
|
| 307 |
copyright = {Creative Commons Attribution 4.0 International}
|
| 308 |
}
|
| 309 |
```
|
| 310 |
|
| 311 |
-
|
| 312 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 313 |
|
| 314 |
-
|
| 315 |
-
-->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 316 |
|
| 317 |
-
<
|
| 318 |
-
## Model Card Authors
|
| 319 |
|
| 320 |
-
|
| 321 |
-
-->
|
| 322 |
|
| 323 |
-
<!
|
| 324 |
-
## Model Card Contact
|
| 325 |
|
| 326 |
-
|
| 327 |
-
-->
|
|
|
|
| 1 |
+
<div align="center">
|
| 2 |
+
|
| 3 |
+
<img src="https://capsule-render.vercel.app/api?type=waving&color=gradient&customColorList=6,11,20,24,30&height=220§ion=header&text=SetFit%20Banking%20Intent&fontSize=54&fontColor=ffffff&animation=fadeIn&fontAlignY=32&desc=77-Class%20Intent%20Classification%20%E2%80%A2%20Few-Shot%20Learning%20%E2%80%A2%20SetFit&descAlignY=55&descSize=18&descColor=e0d7ff" width="100%"/>
|
| 4 |
+
|
| 5 |
+
<a href="https://huggingface.co/TinyModels/setfit-banking-intent">
|
| 6 |
+
<img src="https://readme-typing-svg.demolab.com?font=Fira+Code&weight=700&size=24&duration=2800&pause=900&color=A78BFA¢er=true&vCenter=true&multiline=true&width=800&height=90&lines=Classify+banking+intents+in+one+line+of+code.;77+classes+%7C+4+samples+per+class+%7C+SetFit+few-shot.;Powered+by+BAAI%2Fbge-small-en-v1.5.;Built+with+%E2%9D%A4%EF%B8%8F+by+TinyModels." alt="Typing SVG" />
|
| 7 |
+
</a>
|
| 8 |
+
|
| 9 |
+
<br/>
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+

|
| 13 |
+

|
| 14 |
+

|
| 15 |
+

|
| 16 |
+

|
| 17 |
+
|
| 18 |
+

|
| 19 |
+

|
| 20 |
+

|
| 21 |
+

|
| 22 |
+

|
| 23 |
+
|
| 24 |
+

|
| 25 |
+

|
| 26 |
+

|
| 27 |
+

|
| 28 |
+
|
| 29 |
+
<br/>
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
<img src="https://media.giphy.com/media/3o7aCTfyhYawdOXcFW/giphy.gif" width="140" alt="animated spark"/>
|
| 33 |
+
|
| 34 |
+
<br/><br/>
|
| 35 |
+
|
| 36 |
+
> ### π¦ A tiny, fast, and accurate **SetFit** classifier that routes banking customer intents β trained with **just 4 examples per class** (308 sentences total).
|
| 37 |
+
|
| 38 |
+
</div>
|
| 39 |
+
|
| 40 |
+
<img src="https://user-images.githubusercontent.com/74038190/212284100-561aa473-3905-4a80-b561-0d28506553ee.gif" width="100%">
|
| 41 |
+
|
| 42 |
---
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
<div align="center">
|
| 46 |
+
|
| 47 |
+
### π§ Table of Contents
|
| 48 |
+
|
| 49 |
+
<a href="#-model-description"><kbd>π Description</kbd></a> β’
|
| 50 |
+
<a href="#-architecture"><kbd>ποΈ Architecture</kbd></a> β’
|
| 51 |
+
<a href="#-quick-start"><kbd>π Quick Start</kbd></a> β’
|
| 52 |
+
<a href="#-model-labels-77-classes"><kbd>π·οΈ Labels</kbd></a> β’
|
| 53 |
+
<a href="#-training-details"><kbd>π Training</kbd></a> β’
|
| 54 |
+
<a href="#-bias-risks--limitations"><kbd>β οΈ Risks</kbd></a> β’
|
| 55 |
+
<a href="#-citation"><kbd>π Citation</kbd></a>
|
| 56 |
+
|
| 57 |
+
</div>
|
| 58 |
+
|
|
|
|
|
|
|
| 59 |
---
|
| 60 |
|
| 61 |
+
## π Model Description
|
| 62 |
+
|
| 63 |
+
<div align="center">
|
| 64 |
+
|
| 65 |
+
| π | π‘ |
|
| 66 |
+
|:--:|:--|
|
| 67 |
+
| **Model Type** | `SetFit` β Efficient Few-Shot Learning |
|
| 68 |
+
| **Author** | **[TinyModels](https://huggingface.co/TinyModels)** |
|
| 69 |
+
| **Sentence Transformer** | [`BAAI/bge-small-en-v1.5`](https://huggingface.co/BAAI/bge-small-en-v1.5) |
|
| 70 |
+
| **Classification Head** | [`sklearn.linear_model.LogisticRegression`](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) |
|
| 71 |
+
| **Max Sequence Length** | `512` tokens |
|
| 72 |
+
| **Number of Classes** | `77` banking intents |
|
| 73 |
+
| **Training Samples** | `4` per class β `308` total |
|
| 74 |
+
| **Language** | English π¬π§ |
|
| 75 |
+
| **Domain** | π¦ Banking / Fintech customer support |
|
| 76 |
+
|
| 77 |
+
</div>
|
| 78 |
+
|
| 79 |
+
### π Why SetFit?
|
| 80 |
+
|
| 81 |
+
> SetFit achieves strong accuracy **without prompts and without large labeled datasets**.
|
| 82 |
+
> It first fine-tunes a sentence embedding model with **contrastive learning**, then trains a lightweight classifier on top β perfect for low-data, high-class-count problems like this one.
|
| 83 |
+
|
| 84 |
+
---
|
| 85 |
+
|
| 86 |
+
## ποΈ Architecture
|
| 87 |
+
|
| 88 |
+
```mermaid
|
| 89 |
+
flowchart LR
|
| 90 |
+
A["π Input Text<br/>(customer message)"] --> B["π€ BAAI/bge-small-en-v1.5<br/>Sentence Transformer"]
|
| 91 |
+
B --> C["𧬠Sentence Embedding<br/>(384-dim)"]
|
| 92 |
+
C --> D["π― LogisticRegression<br/>Classification Head"]
|
| 93 |
+
D --> E["π·οΈ Predicted Intent<br/>(1 of 77 classes)"]
|
| 94 |
+
|
| 95 |
+
subgraph TRAIN["π Training Pipeline"]
|
| 96 |
+
direction TB
|
| 97 |
+
T1["Contrastive Fine-tuning<br/>(CosineSimilarityLoss)"] --> T2["Embedding Extraction"]
|
| 98 |
+
T2 --> T3["LogReg Head Training"]
|
| 99 |
+
end
|
| 100 |
+
|
| 101 |
+
style A fill:#6C63FF,color:#fff,stroke:#4B4BFF,stroke-width:2px
|
| 102 |
+
style B fill:#FF6F91,color:#fff,stroke:#E0567A,stroke-width:2px
|
| 103 |
+
style C fill:#00C2A8,color:#fff,stroke:#009E88,stroke-width:2px
|
| 104 |
+
style D fill:#F7B32B,color:#000,stroke:#D99A1F,stroke-width:2px
|
| 105 |
+
style E fill:#34D399,color:#000,stroke:#25A67A,stroke-width:2px
|
| 106 |
+
style TRAIN fill:#1a1a2e,color:#fff,stroke:#6C63FF,stroke-dasharray: 5 5
|
| 107 |
+
```
|
| 108 |
+
|
| 109 |
+
<img src="https://user-images.githubusercontent.com/74038190/212284100-561aa473-3905-4a80-b561-0d28506553ee.gif" width="100%">
|
| 110 |
+
|
| 111 |
+
---
|
| 112 |
+
|
| 113 |
+
## π Quick Start
|
| 114 |
+
|
| 115 |
+
<details open>
|
| 116 |
+
<summary><b>π Python β one-liner inference</b></summary>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
|
| 118 |
```bash
|
| 119 |
pip install setfit
|
| 120 |
```
|
| 121 |
|
|
|
|
|
|
|
| 122 |
```python
|
| 123 |
from setfit import SetFitModel
|
| 124 |
|
| 125 |
+
# π½ Load from the Hub
|
| 126 |
+
model = SetFitModel.from_pretrained("TinyModels/setfit-banking-intent")
|
| 127 |
+
|
| 128 |
+
# π― Run inference
|
| 129 |
preds = model("I have an unauthorized charge.")
|
| 130 |
+
print(preds)
|
| 131 |
+
# β ['direct_debit_payment_not_recognised']
|
| 132 |
+
```
|
| 133 |
+
|
| 134 |
+
</details>
|
| 135 |
+
|
| 136 |
+
<details>
|
| 137 |
+
<summary><b>π¦ Batch inference with confidence scores</b></summary>
|
| 138 |
+
|
| 139 |
+
```python
|
| 140 |
+
from setfit import SetFitModel
|
| 141 |
+
import numpy as np
|
| 142 |
+
|
| 143 |
+
model = SetFitModel.from_pretrained("TinyModels/setfit-banking-intent")
|
| 144 |
+
|
| 145 |
+
texts = [
|
| 146 |
+
"What do I do? My card is broken.",
|
| 147 |
+
"Where should I withdraw money from?",
|
| 148 |
+
"What are the currency exchange fees?",
|
| 149 |
+
"I have an unauthorized charge.",
|
| 150 |
+
]
|
| 151 |
+
|
| 152 |
+
# Predicted labels
|
| 153 |
+
labels = model(texts)
|
| 154 |
+
print(labels)
|
| 155 |
+
|
| 156 |
+
# Probability distribution per class
|
| 157 |
+
probs = model.predict_proba(texts)
|
| 158 |
+
top_idx = np.argmax(probs, axis=1)
|
| 159 |
+
top_conf = probs[np.arange(len(texts)), top_idx]
|
| 160 |
+
|
| 161 |
+
for t, l, c in zip(texts, labels, top_conf):
|
| 162 |
+
print(f"[{c:0.2%}] {l:<40} β {t}")
|
| 163 |
+
```
|
| 164 |
+
|
| 165 |
+
</details>
|
| 166 |
+
|
| 167 |
+
<details>
|
| 168 |
+
<summary><b>β‘ FastAPI microservice snippet</b></summary>
|
| 169 |
+
|
| 170 |
+
```python
|
| 171 |
+
from fastapi import FastAPI
|
| 172 |
+
from pydantic import BaseModel
|
| 173 |
+
from setfit import SetFitModel
|
| 174 |
+
|
| 175 |
+
app = FastAPI(title="Banking Intent API")
|
| 176 |
+
model = SetFitModel.from_pretrained("TinyModels/setfit-banking-intent")
|
| 177 |
+
|
| 178 |
+
class Query(BaseModel):
|
| 179 |
+
text: str
|
| 180 |
+
|
| 181 |
+
@app.post("/classify")
|
| 182 |
+
def classify(q: Query):
|
| 183 |
+
label = model([q.text])[0]
|
| 184 |
+
return {"intent": label, "text": q.text}
|
| 185 |
```
|
| 186 |
|
| 187 |
+
</details>
|
| 188 |
+
|
| 189 |
+
---
|
| 190 |
+
|
| 191 |
+
## π·οΈ Model Labels (77 Classes)
|
| 192 |
+
|
| 193 |
+
<div align="center">
|
| 194 |
+
|
| 195 |
+

|
| 196 |
+

|
| 197 |
+
|
| 198 |
+
</div>
|
| 199 |
+
|
| 200 |
+
<details>
|
| 201 |
+
<summary>π³ <b>Card Management</b> β <i>20 classes</i></summary>
|
| 202 |
+
|
| 203 |
+
| Label | Example Utterance |
|
| 204 |
+
|:------|:------------------|
|
| 205 |
+
| `activate_my_card` | *I have a new card and need to activate it* |
|
| 206 |
+
| `card_about_to_expire` | *Do I need to do something to get a new card once it expires?* |
|
| 207 |
+
| `card_acceptance` | *Where can I use my Mastercard?* |
|
| 208 |
+
| `card_arrival` | *Where is the card I ordered 2 weeks ago?* |
|
| 209 |
+
| `card_delivery_estimate` | *What is the delivery time for US?* |
|
| 210 |
+
| `card_linking` | *My new card isn't in my app, how do I get it in there?* |
|
| 211 |
+
| `card_not_working` | *What do I do? My card is broken.* |
|
| 212 |
+
| `card_swallowed` | *Please send a new card; the ATM ate mine.* |
|
| 213 |
+
| `contactless_not_working` | *Why is my contactless not working?* |
|
| 214 |
+
| `country_support` | *Will my new card work outside of the EU?* |
|
| 215 |
+
| `disposable_card_limits` | *Is there a limit to how many times I can use my disposable virtual card?* |
|
| 216 |
+
| `get_disposable_virtual_card` | *Where can I order a disposable virtual card?* |
|
| 217 |
+
| `get_physical_card` | *In the app, where do I find my card PIN?* |
|
| 218 |
+
| `getting_spare_card` | *Is it possible to get another card?* |
|
| 219 |
+
| `getting_virtual_card` | *How do I receive a virtual card?* |
|
| 220 |
+
| `lost_or_stolen_card` | *I've lost my card. What can I do about that?* |
|
| 221 |
+
| `order_physical_card` | *How do I ask for a physical card?* |
|
| 222 |
+
| `supported_cards_and_currencies` | *What currencies are approved to add money?* |
|
| 223 |
+
| `virtual_card_not_working` | *Why isn't my disposable virtual card working?* |
|
| 224 |
+
| `visa_or_mastercard` | *Which one are you? Visa or Mastercard?* |
|
| 225 |
+
|
| 226 |
+
</details>
|
| 227 |
+
|
| 228 |
+
<details>
|
| 229 |
+
<summary>πΈ <b>Payments</b> β <i>9 classes</i></summary>
|
| 230 |
+
|
| 231 |
+
| Label | Example Utterance |
|
| 232 |
+
|:------|:------------------|
|
| 233 |
+
| `apple_pay_or_google_pay` | *How can I get my Google pay top up to work?* |
|
| 234 |
+
| `card_payment_fee_charged` | *Why am I getting charged more for using my card?* |
|
| 235 |
+
| `card_payment_not_recognised` | *I don't understand where this charge came from.* |
|
| 236 |
+
| `card_payment_wrong_exchange_rate` | *My exchange rate isn't correct.* |
|
| 237 |
+
| `declined_card_payment` | *You have declined my payment.* |
|
| 238 |
+
| `extra_charge_on_statement` | *Why is there a $1 charge on my statement?* |
|
| 239 |
+
| `pending_card_payment` | *A card payment on my account is shown as pending.* |
|
| 240 |
+
| `reverted_card_payment?` | *I did a payment but it was reverted by the app.* |
|
| 241 |
+
| `transaction_charged_twice` | *I have a duplicate charge.* |
|
| 242 |
+
|
| 243 |
+
</details>
|
| 244 |
+
|
| 245 |
+
<details>
|
| 246 |
+
<summary>π <b>Transfers</b> β <i>12 classes</i></summary>
|
| 247 |
+
|
| 248 |
+
| Label | Example Utterance |
|
| 249 |
+
|:------|:------------------|
|
| 250 |
+
| `balance_not_updated_after_bank_transfer` | *I just transferred some money and do not see it updated yet.* |
|
| 251 |
+
| `beneficiary_not_allowed` | *Why can't I use my beneficiary?* |
|
| 252 |
+
| `cancel_transfer` | *Please cancel the transfer I just made.* |
|
| 253 |
+
| `declined_transfer` | *I got a message that my transfer was declined.* |
|
| 254 |
+
| `failed_transfer` | *I can't seem to make a standard bank transfer.* |
|
| 255 |
+
| `pending_transfer` | *I am still waiting for a transfer to show up.* |
|
| 256 |
+
| `receiving_money` | *How can my boss pay me directly to the card?* |
|
| 257 |
+
| `transfer_fee_charged` | *Why was I charged a fee for transferring money?* |
|
| 258 |
+
| `transfer_into_account` | *How can I transfer money to this account from another bank?* |
|
| 259 |
+
| `transfer_not_received_by_recipient` | *I transferred money and it didn't get there.* |
|
| 260 |
+
| `transfer_timing` | *How long until transfers from Europe go through?* |
|
| 261 |
+
| `top_up_by_bank_transfer_charge` | *If I top up by transfer, am I going to be charged?* |
|
| 262 |
+
|
| 263 |
+
</details>
|
| 264 |
+
|
| 265 |
+
<details>
|
| 266 |
+
<summary>β¬οΈ <b>Top-ups</b> β <i>9 classes</i></summary>
|
| 267 |
+
|
| 268 |
+
| Label | Example Utterance |
|
| 269 |
+
|:------|:------------------|
|
| 270 |
+
| `automatic_top_up` | *How can I setup automatic top-up?* |
|
| 271 |
+
| `pending_top_up` | *Why is the top-up I made still pending?* |
|
| 272 |
+
| `top_up_by_card_charge` | *Do you have any fees if I want to add money using an international card?* |
|
| 273 |
+
| `top_up_by_cash_or_cheque` | *Can I top up with check?* |
|
| 274 |
+
| `top_up_failed` | *I don't think that my top-up worked.* |
|
| 275 |
+
| `top_up_limits` | *What's the top-up limit?* |
|
| 276 |
+
| `top_up_reverted` | *Why did my top-up get reverted?* |
|
| 277 |
+
| `topping_up_by_card` | *I can't see my top up in my wallet!* |
|
| 278 |
+
| `verify_top_up` | *How are top-ups verified?* |
|
| 279 |
+
|
| 280 |
+
</details>
|
| 281 |
+
|
| 282 |
+
<details>
|
| 283 |
+
<summary>π§ <b>Cash & ATM</b> β <i>8 classes</i></summary>
|
| 284 |
+
|
| 285 |
+
| Label | Example Utterance |
|
| 286 |
+
|:------|:------------------|
|
| 287 |
+
| `atm_support` | *Where should I withdraw money from?* |
|
| 288 |
+
| `balance_not_updated_after_cheque_or_cash_deposit` | *Why isn't my cash deposit showing up in my account?* |
|
| 289 |
+
| `cash_withdrawal_charge` | *I got charged fees for withdrawing cash!* |
|
| 290 |
+
| `cash_withdrawal_not_recognised` | *I see cash withdrawals that I did not authorize.* |
|
| 291 |
+
| `declined_cash_withdrawal` | *Is my card broken? I can't get cash out of the ATM.* |
|
| 292 |
+
| `pending_cash_withdrawal` | *My ATM withdrawal is taking forever.* |
|
| 293 |
+
| `wrong_amount_of_cash_received` | *I only got $20 of the $100 that I attempted to withdraw.* |
|
| 294 |
+
| `wrong_exchange_rate_for_cash_withdrawal` | *I received the incorrect exchange rate.* |
|
| 295 |
+
|
| 296 |
+
</details>
|
| 297 |
+
|
| 298 |
+
<details>
|
| 299 |
+
<summary>π <b>Security & PIN</b> β <i>5 classes</i></summary>
|
| 300 |
+
|
| 301 |
+
| Label | Example Utterance |
|
| 302 |
+
|:------|:------------------|
|
| 303 |
+
| `change_pin` | *Can you tell me how to change my PIN?* |
|
| 304 |
+
| `compromised_card` | *The card has suffered a security breach.* |
|
| 305 |
+
| `lost_or_stolen_phone` | *My app was on the phone and I was mugged.* |
|
| 306 |
+
| `passcode_forgotten` | *I thought I knew my password but I guess I was wrong.* |
|
| 307 |
+
| `pin_blocked` | *Help me unblock my account. I entered the PIN wrong too many times.* |
|
| 308 |
+
|
| 309 |
+
</details>
|
| 310 |
+
|
| 311 |
+
<details>
|
| 312 |
+
<summary>πͺͺ <b>Identity Verification</b> β <i>4 classes</i></summary>
|
| 313 |
+
|
| 314 |
+
| Label | Example Utterance |
|
| 315 |
+
|:------|:------------------|
|
| 316 |
+
| `unable_to_verify_identity` | *The app is not able to realize that it is me.* |
|
| 317 |
+
| `verify_my_identity` | *Can I get information on the identity checks?* |
|
| 318 |
+
| `verify_source_of_funds` | *I'd like to know where my funds come from.* |
|
| 319 |
+
| `why_verify_identity` | *What is the function of the identity check?* |
|
| 320 |
+
|
| 321 |
+
</details>
|
| 322 |
+
|
| 323 |
+
<details>
|
| 324 |
+
<summary>π€ <b>Account Management</b> β <i>3 classes</i></summary>
|
| 325 |
+
|
| 326 |
+
| Label | Example Utterance |
|
| 327 |
+
|:------|:------------------|
|
| 328 |
+
| `age_limit` | *At what age can a person open an account?* |
|
| 329 |
+
| `edit_personal_details` | *I just got married and need to change my name on the account.* |
|
| 330 |
+
| `terminate_account` | *How can I delete my account?* |
|
| 331 |
+
|
| 332 |
+
</details>
|
| 333 |
+
|
| 334 |
+
<details>
|
| 335 |
+
<summary>π± <b>Fees & Currency</b> β <i>4 classes</i></summary>
|
| 336 |
+
|
| 337 |
+
| Label | Example Utterance |
|
| 338 |
+
|:------|:------------------|
|
| 339 |
+
| `exchange_charge` | *What are the currency exchange fees?* |
|
| 340 |
+
| `exchange_rate` | *How are the exchange rates determined?* |
|
| 341 |
+
| `exchange_via_app` | *Can I exchange USD and GBP from the app?* |
|
| 342 |
+
| `fiat_currency_support` | *How many currencies can I have?* |
|
| 343 |
+
|
| 344 |
+
</details>
|
| 345 |
+
|
| 346 |
+
<details>
|
| 347 |
+
<summary>π§Ύ <b>Refunds & Disputes</b> β <i>3 classes</i></summary>
|
| 348 |
+
|
| 349 |
+
| Label | Example Utterance |
|
| 350 |
+
|:------|:------------------|
|
| 351 |
+
| `direct_debit_payment_not_recognised` | *I have an unauthorized charge.* |
|
| 352 |
+
| `Refund_not_showing_up` | *Why can't I see my refund in my statement?* |
|
| 353 |
+
| `request_refund` | *I need a refund for something I bought.* |
|
| 354 |
+
|
| 355 |
+
</details>
|
| 356 |
+
|
| 357 |
+
<img src="https://user-images.githubusercontent.com/74038190/212284100-561aa473-3905-4a80-b561-0d28506553ee.gif" width="100%">
|
| 358 |
+
|
| 359 |
+
---
|
| 360 |
+
|
| 361 |
+
## π Training Details
|
| 362 |
+
|
| 363 |
+
<div align="center">
|
| 364 |
+
|
| 365 |
+
### βοΈ Hyperparameters
|
| 366 |
+
|
| 367 |
+
| Parameter | Value | | Parameter | Value |
|
| 368 |
+
|:----------|:-----:|-|:----------|:-----:|
|
| 369 |
+
| `batch_size` | `(32, 32)` | | `num_epochs` | `(1, 1)` |
|
| 370 |
+
| `max_steps` | `-1` | | `sampling_strategy` | `oversampling` |
|
| 371 |
+
| `num_iterations` | `2` | | `body_learning_rate` | `2e-05` |
|
| 372 |
+
| `head_learning_rate` | `2e-05` | | `loss` | `CosineSimilarityLoss` |
|
| 373 |
+
| `distance_metric` | `cosine_distance` | | `margin` | `0.25` |
|
| 374 |
+
| `end_to_end` | `False` | | `use_amp` | `False` |
|
| 375 |
+
| `warmup_proportion` | `0.1` | | `l2_weight` | `0.01` |
|
| 376 |
+
| `seed` | `42` | | `load_best_model_at_end` | `False` |
|
| 377 |
+
|
| 378 |
+
</div>
|
| 379 |
+
|
| 380 |
+
### π Training Set Statistics
|
| 381 |
+
|
| 382 |
+
<div align="center">
|
| 383 |
+
|
| 384 |
+
| Metric | Min | Median | Max |
|
| 385 |
+
|:-------|:---:|:------:|:---:|
|
| 386 |
+
| π Word count | **4** | **11.66** | **78** |
|
| 387 |
+
| π·οΈ Samples per class | **4** | **4** | **4** |
|
| 388 |
+
| ποΈ Total samples | β | **308** | β |
|
| 389 |
+
|
| 390 |
+
</div>
|
| 391 |
+
|
| 392 |
+
### π Training Curve
|
| 393 |
+
|
| 394 |
+
| Epoch | Step | Training Loss | Validation Loss |
|
| 395 |
+
|:-----:|:----:|:-------------:|:---------------:|
|
| 396 |
+
| `0.0256` | `1` | **0.2141** | β |
|
| 397 |
+
|
| 398 |
+
### π§ͺ Framework Versions
|
| 399 |
+
|
| 400 |
+
<div align="center">
|
| 401 |
+
|
| 402 |
+

|
| 403 |
+

|
| 404 |
+

|
| 405 |
+

|
| 406 |
+

|
| 407 |
+

|
| 408 |
+

|
| 409 |
+
|
| 410 |
+
</div>
|
| 411 |
+
|
| 412 |
+
---
|
| 413 |
+
|
| 414 |
+
## β οΈ Bias, Risks & Limitations
|
| 415 |
+
|
| 416 |
+
<details>
|
| 417 |
+
<summary><b>π Click to expand</b></summary>
|
| 418 |
+
|
| 419 |
+
| β οΈ Area | π Notes |
|
| 420 |
+
|:--------|:---------|
|
| 421 |
+
| **Data size** | Only **4 examples per class** β rare phrasings may be misclassified. |
|
| 422 |
+
| **Language** | Trained **only on English** β will not generalize to other languages without re-training. |
|
| 423 |
+
| **Domain shift** | Vocabulary is banking-specific; out-of-domain inputs may produce confident but wrong labels. |
|
| 424 |
+
| **Class ambiguity** | Some classes are semantically close (e.g. `pending_transfer` vs. `transfer_not_received_by_recipient`). |
|
| 425 |
+
| **No calibration** | LogReg probabilities are not temperature-calibrated β treat confidence as approximate. |
|
| 426 |
+
| **PII** | Do **not** feed real customer PII into shared demos; use anonymized text. |
|
| 427 |
+
|
| 428 |
+
</details>
|
| 429 |
+
|
| 430 |
+
### π« Out-of-Scope Use
|
| 431 |
+
|
| 432 |
+
- β Legal, medical, or financial advice generation
|
| 433 |
+
- β Production decision-making without human-in-the-loop
|
| 434 |
+
- β Non-English customer messages
|
| 435 |
+
- β Emotion / sentiment / toxicity detection
|
| 436 |
+
|
| 437 |
+
---
|
| 438 |
+
|
| 439 |
+
## π§© Model Card Recipe
|
| 440 |
+
|
| 441 |
+
```yaml
|
| 442 |
+
π― base_model: BAAI/bge-small-en-v1.5
|
| 443 |
+
π§ head: LogisticRegression
|
| 444 |
+
π technique: SetFit (few-shot contrastive)
|
| 445 |
+
π·οΈ classes: 77
|
| 446 |
+
π metric: accuracy
|
| 447 |
+
π€ max_tokens: 512
|
| 448 |
+
π± seed: 42
|
| 449 |
+
```
|
| 450 |
+
|
| 451 |
+
---
|
| 452 |
+
|
| 453 |
+
## πΊοΈ Roadmap
|
| 454 |
+
|
| 455 |
+
- [x] Train on 77 banking intents
|
| 456 |
+
- [x] Publish to Hugging Face Hub
|
| 457 |
+
- [ ] Add calibrated confidence scores
|
| 458 |
+
- [ ] Multilingual variant (XLM-R backbone)
|
| 459 |
+
- [ ] ONNX / quantized export for edge
|
| 460 |
+
- [ ] Evaluation on public banking benchmark
|
| 461 |
+
|
| 462 |
+
---
|
| 463 |
+
|
| 464 |
+
## π Citation
|
| 465 |
+
|
| 466 |
+
If you use this model, please cite the SetFit paper:
|
| 467 |
+
|
| 468 |
```bibtex
|
| 469 |
+
@article{tunstall2022setfit,
|
| 470 |
+
doi = {10.48550/ARXIV.2209.11055},
|
| 471 |
+
url = {https://arxiv.org/abs/2209.11055},
|
| 472 |
+
author = {Tunstall, Lewis and Reimers, Nils and Jo, Unso Eun Seo and Bates, Luke and Korat, Daniel and Wasserblat, Moshe and Pereg, Oren},
|
| 473 |
+
keywords = {Computation and Language (cs.CL), FOS: Computer and information sciences},
|
| 474 |
+
title = {Efficient Few-Shot Learning Without Prompts},
|
| 475 |
publisher = {arXiv},
|
| 476 |
+
year = {2022},
|
| 477 |
copyright = {Creative Commons Attribution 4.0 International}
|
| 478 |
}
|
| 479 |
```
|
| 480 |
|
| 481 |
+
---
|
| 482 |
+
|
| 483 |
+
## π Glossary
|
| 484 |
+
|
| 485 |
+
| Term | Meaning |
|
| 486 |
+
|:-----|:--------|
|
| 487 |
+
| **SetFit** | Sentence Transformer Fine-tuning β few-shot text classification technique. |
|
| 488 |
+
| **Contrastive Learning** | Training method that pulls similar pairs together, pushes dissimilar apart. |
|
| 489 |
+
| **Sentence Transformer** | Encoder that maps text β dense vector embedding. |
|
| 490 |
+
| **LogisticRegression Head** | Simple linear classifier on top of embeddings. |
|
| 491 |
+
| **Intent** | The user's goal behind a message (e.g. `cancel_transfer`). |
|
| 492 |
+
|
| 493 |
+
---
|
| 494 |
+
|
| 495 |
+
## π Star History
|
| 496 |
+
|
| 497 |
+
<div align="center">
|
| 498 |
+
|
| 499 |
+
<a href="https://star-history.com/#TinyModels/setfit-banking-intent&Date">
|
| 500 |
+
<img src="https://api.star-history.com/svg?repos=TinyModels/setfit-banking-intent&type=Date" width="600" alt="Star History Chart"/>
|
| 501 |
+
</a>
|
| 502 |
+
|
| 503 |
+
</div>
|
| 504 |
+
|
| 505 |
+
---
|
| 506 |
+
|
| 507 |
+
|
| 508 |
+
<div align="center">
|
| 509 |
+
|
| 510 |
+
### π Made with love by [TinyModels](https://huggingface.co/TinyModels)
|
| 511 |
|
| 512 |
+
<a href="https://huggingface.co/TinyModels/setfit-banking-intent">
|
| 513 |
+
<img src="https://img.shields.io/badge/π€%20Hugging%20Face-Model%20Card-FFD21E?style=for-the-badge&logoColor=black"/>
|
| 514 |
+
</a>
|
| 515 |
+
<a href="https://github.com/huggingface/setfit">
|
| 516 |
+
<img src="https://img.shields.io/badge/GitHub-SetFit-181717?style=for-the-badge&logo=github"/>
|
| 517 |
+
</a>
|
| 518 |
+
<a href="https://arxiv.org/abs/2209.11055">
|
| 519 |
+
<img src="https://img.shields.io/badge/arXiv-2209.11055-B31B1B?style=for-the-badge&logo=arxiv"/>
|
| 520 |
+
</a>
|
| 521 |
|
| 522 |
+
<br/><br/>
|
|
|
|
| 523 |
|
| 524 |
+
<img src="https://capsule-render.vercel.app/api?type=waving&color=gradient&customColorList=6,11,20,24,30&height=140§ion=footer&text=Thanks%20for%20stopping%20by!&fontSize=24&fontColor=ffffff&animation=twinkling&fontAlignY=60" width="100%"/>
|
|
|
|
| 525 |
|
| 526 |
+
<sub>β If this model helped you, consider leaving a like on the Hub/Repo!</sub>
|
|
|
|
| 527 |
|
| 528 |
+
</div>
|
|
|