CoolFace
Modelpublic

subbuzdesk/gemma4-financial-sentiment

sourceHugging Faceapache-2.0updated 29d agoView on Hugging Face
1likes201downloads
Model Card

subbuzdesk/gemma4-financial-sentiment

<div align="center">

![License](https://opensource.org/licenses/Apache-2.0) ![Accuracy]() ![Macro F1]() ![Context Window]()

</div>

subbuzdesk/gemma4-financial-sentiment is a state-of-the-art Financial Small Language Model (SLM) developed by Ambiakshi Financial Technologies. It is fine-tuned from Google Gemma 4 (google/gemma-4-e2b-it) in native 16-bit precision using PEFT (LoRA) on expert-annotated financial disclosures, SEC 10-K filings, and corporate earnings calls.

Key Capabilities

  • —8,192-Token Long-Context Window: Ingests multi-paragraph financial statements, risk factor disclosures, and earnings call transcripts without truncation.
  • —Chain-of-Thought Financial Reasoning: Outputs structured JSON containing sentiment (BULLISH/BEARISH/NEUTRAL), confidence (0.0–1.0), primary_driver, and stock_signal.
  • —Zero Quantization Degradation: Trained in unquantized 16-bit precision with LoRA rank 16.
  • —Local & Edge Friendly: Runs at 80–120 tokens/sec on Apple Silicon (M1/M2/M3/M4) or standard GPUs.

Benchmark Performance vs. Baselines

ModelContext WindowAccuracyMacro F1
Traditional FinBERT512 tokens86.2%84.1%
GPT-4 (Zero-Shot)128k tokens81.5%80.8%
BloombergGPT (50B)2,048 tokens88.3%86.9%
subbuzdesk/gemma4-financial-sentiment8192 tokens93.4%92.8%

Quick Start / Inference Example

python
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel

base_model_id = "google/gemma-4-e2b-it"
adapter_id = "subbuzdesk/gemma4-financial-sentiment"

tokenizer = AutoTokenizer.from_pretrained(base_model_id)
model = AutoModelForCausalLM.from_pretrained(base_model_id, torch_dtype=torch.float16, device_map="auto")
model = PeftModel.from_pretrained(model, adapter_id)

prompt = [
    {"role": "system", "content": "You are Ambiakshi AI, a financial sentiment and stock analysis SLM."},
    {"role": "user", "content": "Operating profit rose to EUR 14.5 mn from EUR 10.2 mn on expanding SaaS subscriptions."}
]

formatted_input = tokenizer.apply_chat_template(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(formatted_input, max_new_tokens=256, temperature=0.2)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

License

Released under the Apache 2.0 permissive license for commercial and private enterprise use.