Views
No views yet
image ──▶ multimodal LLM ──▶ description ──▶ text classifier ──▶ sentiment
(GPT-4o mini, Gemini, (these checkpoints:
DeepSeek-VL2, Phi-4, ModernBERT-large,
Gemma-4, MiniGPT-4) BART-large-MNLI){caption_mllm}/{backbone}/{problem}/sigma{n}/{finetuned|not_finetuned}/
model.safetensors
config.json
MANIFEST.jsonp5 (5 classes), p3 (3), p2plus/p2neg (2).config.json carries the base model id, id2label/label2id, the source
checkpoint's SHA-256 and the 5-fold scores that checkpoint achieved.| caption MLLM | base model | checkpoints |
|---|---|---|
deepseek | answerdotai/ModernBERT-large | 8 |
deepseek | facebook/bart-large-mnli | 6 |
gemini | answerdotai/ModernBERT-large | 8 |
gemma4 | answerdotai/ModernBERT-large | 8 |
minigpt4 | answerdotai/ModernBERT-large | 8 |
minigpt4 | facebook/bart-large-mnli | 6 |
openai | answerdotai/ModernBERT-large | 12 |
openai | facebook/bart-large-mnli | 8 |
phi4 | answerdotai/ModernBERT-large | 8 |
| checkpoint | track | mean 5-fold F1 | classes |
|---|---|---|---|
| openai-modernbert-p3-sigma5 | finetuning | 0.9581 | 3 |
| openai-bart-p3-sigma5 | finetuning | 0.9532 | 3 |
| gemini-modernbert-p3-sigma5 | finetuning | 0.9451 | 3 |
| gemma4-modernbert-p3-sigma5 | finetuning | 0.9417 | 3 |
| phi4-modernbert-p3-sigma5 | finetuning | 0.9332 | 3 |
| openai-modernbert-p3-sigma5 | not-finetuning | 0.9063 | 3 |
| minigpt4-modernbert-p3-sigma5 | finetuning | 0.9039 | 3 |
| deepseek-modernbert-p3-sigma5 | finetuning | 0.8948 | 3 |
| openai-bart-p3-sigma5 | not-finetuning | 0.8543 | 3 |
| openai-modernbert-p5-sigma5 | finetuning | 0.8445 | 5 |
1import json, torch
2from huggingface_hub import hf_hub_download
3from safetensors.torch import load_file
4from transformers import AutoModel, AutoTokenizer
5
6repo = "Neemias/multimodal-LLMs-See-Sentiment"
7folder = "gpt4-openai-classify/modernbert/p3/sigma5/finetuned"
8
9weights = load_file(hf_hub_download(repo, f"{folder}/model.safetensors"))
10config = json.load(open(hf_hub_download(repo, f"{folder}/config.json")))
11
12for alias, owner in config["tied_weights"].items():
13 weights[alias] = weights[owner]
14
15
16class SentimentClassifier(torch.nn.Module):
17 def __init__(self, base_model, num_classes):
18 super().__init__()
19 self.model = AutoModel.from_pretrained(base_model)
20 self.classifier = torch.nn.Sequential(
21 torch.nn.Linear(self.model.config.hidden_size, 1024),
22 torch.nn.ReLU(),
23 torch.nn.Linear(1024, num_classes),
24 )
25
26 def forward(self, ids, mask):
27 return self.classifier(self.model(ids, attention_mask=mask).last_hidden_state[:, 0])
28
29
30model = SentimentClassifier(config["base_model"], config["num_classes"])
31model.load_state_dict({k: v.float() for k, v in weights.items()})
32model.eval()
33
34tokenizer = AutoTokenizer.from_pretrained(config["base_model"])
35batch = tokenizer(["A bright park full of children playing."], return_tensors="pt",
36 padding="max_length", truncation=True, max_length=config["max_len"])
37prediction = model(batch["input_ids"], batch["attention_mask"]).argmax(-1).item()
38print(config["id2label"][str(prediction)])1mllmsent hub pull-checkpoint openai-modernbert-p3-sigma5
2mllmsent predict --spec openai-modernbert-p3-sigma5 --input captions.csv --output predictions.csvadapter_config.json survive.1@misc{dasilva2026multimodalllmssentiment,
2 title={Multimodal LLMs See Sentiment},
3 author={Neemias B. da Silva and John Harrison and Rodrigo Minetto and Myriam R. Delgado and Bogdan T. Nassu and Thiago H. Silva},
4 year={2026},
5 eprint={2508.16873},
6 archivePrefix={arXiv},
7 primaryClass={cs.CV},
8 url={https://arxiv.org/abs/2508.16873},
9}