Views
No views yet
roberta-large with a sequence-classification head and is trained for lexical-semantic relation classification.generalizationspecializationmetaphormetonymyhomonymyantonymyantonymy is included because it is present in the fine-tuning data, although it is not part of the expert-annotated SenseRel denotational test set.meta-llama/Meta-Llama-3.1-8B1from transformers import AutoTokenizer, AutoModelForCausalLM
2import torch
3
4model_id = "ChangeIsKey/denotational-llama-classifier"
5
6tokenizer = AutoTokenizer.from_pretrained(model_id)
7model = AutoModelForCausalLM.from_pretrained(model_id)
8
9definition_1 = "the young of the domestic cow"
10definition_2 = "the young of various large mammals"
11
12text = f"{definition_1} <|s|> {definition_2} <|t|>"
13
14inputs = tokenizer(text, return_tensors="pt")
15
16with torch.no_grad():
17 outputs = model(**inputs)
18 next_token_logits = outputs.logits[0, -1, :]
19
20label_tokens = [
21 "<|generalization|>",
22 "<|specialization|>",
23 "<|metaphor|>",
24 "<|metonymy|>",
25 "<|homonymy|>",
26 "<|antonymy|>",
27]
28
29label_token_ids = tokenizer.convert_tokens_to_ids(label_tokens)
30label_logits = next_token_logits[label_token_ids]
31predicted_id = label_token_ids[torch.argmax(label_logits).item()]
32
33prediction = tokenizer.convert_ids_to_tokens(predicted_id)
34print(prediction)WN+CN+UM, constructed from existing lexical-semantic resources:WN+CN+UM test set;| Dataset | Weighted F1 |
|---|---|
| WN+CN+UM test set | 0.737 |
| SenseRel denotational dataset | 0.658 |
1@inproceedings{cassotti-etal-2026-senserel,
2 title = "{S}ense{R}el: A Sense-Level Benchmark for Denotational and Connotational Meaning Relations",
3 author = "Cassotti, Pierluigi and
4 Baes, Naomi and
5 De Pascale, Stefano and
6 de S{\'a}, J{\'a}der Martins Camboim and
7 Periti, Francesco and
8 Haslam, Nick and
9 Geeraerts, Dirk and
10 Tahmasebi, Nina",
11 booktitle = "Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)",
12 month = jul,
13 year = "2026",
14 address = "San Diego, California, United States",
15 publisher = "Association for Computational Linguistics",
16 url = "https://aclanthology.org/2026.acl-long.20/",
17 pages = "499--515"
18}