staedi/sentiment-gemma-3

This model staedi/sentiment-gemma-3 was converted to MLX format from mlx-community/gemma-3-4b-it-4bit using mlx-lm version 0.31.0.

Use with mlx

pip install mlx-lm
from mlx_lm import load, generate

model, tokenizer = load("staedi/sentiment-gemma-3")

prompt = (
    "You are a financial analyst specializing in directed sentiment extraction. "
    "Given a financial news text, identify all mentioned entities and determine "
    "the sentiment directed toward each one. Return your answer as a JSON array "
    "where each element has: \"entity\" (name), \"entity_type\" (\"ORG\" for "
    "companies/organizations, \"PERSON\" for individuals, \"GPE\" for countries/"
    "cities/regions, \"OTHER\" for anything else), \"polarity\" (+ positive, "
    "- negative, 0 neutral, ~ context-dependent), and \"category\" (one of: Legal, "
    "Business, Performance, Recruitment, NewsRelease, Bankruptcy)."
)

text = "Apple announced its earnings. The company performed well."
user_content = f"Extract the directed financial sentiment from the following text:\n\n{text}"

if tokenizer.chat_template is not None:
    messages = [{"role": "user", "content": prompt}]
    prompt = tokenizer.apply_chat_template(
        messages, tokenize=Falsse, add_generation_prompt=True, return_dict=False,
    )

response = generate(model, tokenizer, prompt=prompt, verbose=False)
Downloads last month
181
Safetensors
Model size
1B params
Tensor type
BF16
·
U32
·
MLX
Hardware compatibility
Log In to add your hardware

8-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for staedi/sentiment-gemma-3

Quantized
(6)
this model