CoolFace
Modelpublic

kartikaybagla/functiongemma-bank-sms-parser

sourceHugging Facegemmaupdated 9mo agoView on Hugging Face
0likes118downloads
Model Card

FunctionGemma Bank SMS Parser

A fine-tuned FunctionGemma-270M-IT model for extracting structured transaction data from bank SMS messages.

Model Description

This model is trained to perform two functions:

  1. 1.`extract_transaction` - Parse banking SMS and extract structured fields:
  2. 2.source: Bank or sender name
  3. 3.currency: Currency code (INR, USD, etc.)
  4. 4.amount: Transaction amount (number)
  5. 5.date: Transaction date
  6. 6.destination: Recipient or merchant
  7. 7.type: "debit" or "credit"
  1. 1.`skip_message` - Identify non-transaction messages:
  2. 2.OTPs and verification codes
  3. 3.Promotional messages
  4. 4.Payment requests (not completed transactions)
  5. 5.Account alerts without transactions

Quantization Options

FileQuantizationSizeDescription
functiongemma-270m-bank-sms-parser-Q4_K_M.ggufQ4KM~242MBRecommended - Best size/quality tradeoff
functiongemma-270m-bank-sms-parser-Q5_K_M.ggufQ5KM~248MBHigher quality if Q4 shows issues
functiongemma-270m-bank-sms-parser-Q8_0.ggufQ8_0~280MBNear-lossless, for validation

Usage

With llama.cpp server

bash
# Download model
huggingface-cli download kartikaybagla/functiongemma-bank-sms-parser \
    functiongemma-270m-bank-sms-parser-Q4_K_M.gguf \
    --local-dir ./models

# Run server
llama-server --model ./models/functiongemma-270m-bank-sms-parser-Q4_K_M.gguf \
    --host 0.0.0.0 --port 8080 --ctx-size 2048

With Docker

bash
docker run -p 8080:8080 -v ./models:/models \
    ghcr.io/ggml-org/llama.cpp:server \
    --model /models/functiongemma-270m-bank-sms-parser-Q4_K_M.gguf \
    --host 0.0.0.0 --port 8080

API Request

bash
curl http://localhost:8080/v1/completions \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "<bos><start_of_turn>developer\nYou are a financial transaction extractor. Analyze SMS messages and:\n1. If the message describes a completed financial transaction (money sent, received, debited, or credited), use extract_transaction to capture the details.\n2. If the message is not a transaction (OTP, promotional, application status, payment request, etc.), use skip_message.\n\nOnly extract actual completed transactions with concrete amounts, not payment requests or pending transactions.<start_function_declaration>declaration:extract_transaction{description:<escape>Extract transaction details from a banking SMS message<escape>,parameters:{properties:{source:{type:<escape>STRING<escape>},currency:{type:<escape>STRING<escape>},amount:{type:<escape>NUMBER<escape>},date:{type:<escape>STRING<escape>},destination:{type:<escape>STRING<escape>},type:{type:<escape>STRING<escape>}},required:[<escape>source<escape>,<escape>currency<escape>,<escape>amount<escape>,<escape>date<escape>,<escape>destination<escape>,<escape>type<escape>],type:<escape>OBJECT<escape>}}<end_function_declaration><start_function_declaration>declaration:skip_message{description:<escape>Skip messages that are not financial transactions<escape>,parameters:{properties:{reason:{type:<escape>STRING<escape>}},required:[<escape>reason<escape>],type:<escape>OBJECT<escape>}}<end_function_declaration><end_of_turn>\n<start_of_turn>user\nICICI Bank Acct XX123 debited Rs 450.00 on 15-Jan-25; UPI to SWIGGY. UPI Ref: 123456789012<end_of_turn>\n<start_of_turn>model\n",
    "max_tokens": 200,
    "stop": ["<end_function_call>"]
  }'

Example Output

Input SMS:

ICICI Bank Acct XX123 debited Rs 450.00 on 15-Jan-25; UPI to SWIGGY. UPI Ref: 123456789012

Model Output:

<start_function_call>extract_transaction{"source": "ICICI Bank", "currency": "INR", "amount": 450.00, "date": "15-Jan-25", "destination": "SWIGGY", "type": "debit"}<end_function_call>

Input SMS (non-transaction):

Your OTP for login is 482910. Valid for 5 minutes. Do not share.

Model Output:

<start_function_call>skip_message{"reason": "OTP verification code"}<end_function_call>

Training

  • Base Model: google/functiongemma-270m-it
  • Training Framework: Hugging Face TRL (SFTTrainer)
  • Training Data: Classified bank SMS messages from Indian banks
  • Fine-tuning Method: LoRA

Intended Use

This model is designed for:

  • Personal finance automation
  • Importing transactions into budgeting apps (e.g., Actual Budget)
  • SMS-based expense tracking

Limitations

  • Primarily trained on Indian bank SMS formats (ICICI, HDFC, SBI, etc.)
  • May not generalize well to banks from other countries
  • Requires the specific prompt format shown above
  • Not suitable for security-critical applications without additional validation

License

This model inherits the Gemma license from the base model.

Links