It predicts the temporal relationship between events in text.
1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2
3model_id = "AnirbanSaha/llama32-3b-tlink-full-finetune"
4
5tokenizer = AutoTokenizer.from_pretrained(model_id)
6model = AutoModelForSequenceClassification.from_pretrained(model_id)
7
8text = "The patient developed fever before taking the medication."
9
10inputs = tokenizer(text, return_tensors="pt", truncation=True)
11
12outputs = model(**inputs)
13pred = outputs.logits.argmax(dim=-1).item()
14
15labels = ["BEFORE", "AFTER", "OTHER", "NONE"]
16print(labels[pred])
Otherwise, loading this model will fail.
If you use this model in your research, please cite appropriately.