fahmidiqbal/tlink-classification
Viewer • Updated • 66.9k • 140
Full fine-tuned version of meta-llama/Llama-3.2-3B-Instruct on the tlink-classification dataset for temporal relation classification.
Given a sentence with two marked spans (<e1>, <e2> for events, <t1>, <t2> for times),
classify the temporal relation between them as one of:
BEFORE — first span occurs earlier than secondAFTER — first span occurs later than secondOTHER — overlap or non-ordering relationNONE — no clear temporal relation| Parameter | Value |
|---|---|
| Base model | meta-llama/Llama-3.2-3B-Instruct |
| Fine-tuning | Full (all parameters) |
| Epochs | 3 |
| Batch size | 8 |
| Learning rate | 2e-5 |
| Max length | 2048 |
| Hardware | NVIDIA H100 |
| Precision | bfloat16 |
| Metric | Score |
|---|---|
| Accuracy | 0.8150 |
| Macro F1 | 0.8170 |
| BEFORE F1 | 0.8000 |
| AFTER F1 | 0.7593 |
| OTHER F1 | 0.8269 |
| NONE F1 | 0.8817 |
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
tokenizer = AutoTokenizer.from_pretrained("AnirbanSaha/llama32-3b-tlink")
model = AutoModelForCausalLM.from_pretrained("AnirbanSaha/llama32-3b-tlink", dtype=torch.bfloat16)
model.eval()
prompt = "Your already-formatted prompt here..."
enc = tokenizer(prompt, return_tensors="pt")
out = model.generate(**enc, max_new_tokens=8, do_sample=False)
new_tokens = out[0][enc["input_ids"].shape[1]:]
print(tokenizer.decode(new_tokens, skip_special_tokens=True))
Base model
meta-llama/Llama-3.2-3B-Instruct