Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Denotational Type Classifier
|
| 2 |
+
|
| 3 |
+
This model classifies the denotational relation between two word senses, represented as a pair of definitions. It is based on `roberta-large` with a sequence-classification head and is trained for lexical-semantic relation classification.
|
| 4 |
+
|
| 5 |
+
The model predicts one of the following relation types:
|
| 6 |
+
|
| 7 |
+
* `generalization`
|
| 8 |
+
* `specialization`
|
| 9 |
+
* `metaphor`
|
| 10 |
+
* `metonymy`
|
| 11 |
+
* `homonymy`
|
| 12 |
+
* `antonymy`
|
| 13 |
+
|
| 14 |
+
The first five labels correspond to the denotational relation types evaluated in SenseRel. `antonymy` is included because it is present in the fine-tuning data, although it is not part of the expert-annotated SenseRel denotational test set.
|
| 15 |
+
|
| 16 |
+
## Model Details
|
| 17 |
+
|
| 18 |
+
* **Model type:** Causal language model
|
| 19 |
+
* **Base model:** `meta-llama/Meta-Llama-3.1-8B`
|
| 20 |
+
* **Task:** Denotational relation classification via text generation
|
| 21 |
+
* **Language:** English
|
| 22 |
+
|
| 23 |
+
## Intended Use
|
| 24 |
+
|
| 25 |
+
This model is intended for research on lexical semantics, semantic change, polysemy, and sense-level semantic relations. It can be used to classify the relation between two definitions of a word sense, for example whether a newer meaning is a generalization, specialization, metaphorical extension, metonymic extension, homonym, or antonymic development of another meaning.
|
| 26 |
+
|
| 27 |
+
Example use cases include:
|
| 28 |
+
|
| 29 |
+
* studying semantic change in dictionaries or lexical resources;
|
| 30 |
+
* analyzing polysemous word senses;
|
| 31 |
+
* supporting sense-level semantic annotation;
|
| 32 |
+
* scaling exploratory studies of denotational change.
|
| 33 |
+
|
| 34 |
+
The model is not intended for high-stakes decision-making or for general-purpose natural language understanding outside lexical-semantic relation classification.
|
| 35 |
+
|
| 36 |
+
## Input Format
|
| 37 |
+
|
| 38 |
+
```python
|
| 39 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 40 |
+
import torch
|
| 41 |
+
|
| 42 |
+
model_id = "ChangeIsKey/denotational-llama-classifier"
|
| 43 |
+
|
| 44 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 45 |
+
model = AutoModelForCausalLM.from_pretrained(model_id)
|
| 46 |
+
|
| 47 |
+
definition_1 = "the young of the domestic cow"
|
| 48 |
+
definition_2 = "the young of various large mammals"
|
| 49 |
+
|
| 50 |
+
text = f"{definition_1} <|s|> {definition_2} <|t|>"
|
| 51 |
+
|
| 52 |
+
inputs = tokenizer(text, return_tensors="pt")
|
| 53 |
+
|
| 54 |
+
with torch.no_grad():
|
| 55 |
+
outputs = model(**inputs)
|
| 56 |
+
next_token_logits = outputs.logits[0, -1, :]
|
| 57 |
+
|
| 58 |
+
label_tokens = [
|
| 59 |
+
"<|generalization|>",
|
| 60 |
+
"<|specialization|>",
|
| 61 |
+
"<|metaphor|>",
|
| 62 |
+
"<|metonymy|>",
|
| 63 |
+
"<|homonymy|>",
|
| 64 |
+
"<|antonymy|>",
|
| 65 |
+
]
|
| 66 |
+
|
| 67 |
+
label_token_ids = tokenizer.convert_tokens_to_ids(label_tokens)
|
| 68 |
+
label_logits = next_token_logits[label_token_ids]
|
| 69 |
+
predicted_id = label_token_ids[torch.argmax(label_logits).item()]
|
| 70 |
+
|
| 71 |
+
prediction = tokenizer.convert_ids_to_tokens(predicted_id)
|
| 72 |
+
print(prediction)
|
| 73 |
+
```
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
## Training Data
|
| 77 |
+
|
| 78 |
+
The model was fine-tuned on a combined denotational-relation dataset referred to as `WN+CN+UM`, constructed from existing lexical-semantic resources:
|
| 79 |
+
|
| 80 |
+
* ChainNet for metaphor, metonymy, and homonymy relations;
|
| 81 |
+
* UniMet for additional metonymy examples;
|
| 82 |
+
* WordNet for generalization, specialization, and auto-antonymy examples.
|
| 83 |
+
|
| 84 |
+
These resources use definition or synset-pair information as proxies for relations between word senses.
|
| 85 |
+
|
| 86 |
+
## Training Procedure
|
| 87 |
+
|
| 88 |
+
The base Llama model was fine-tuned using a causal language modeling objective.
|
| 89 |
+
|
| 90 |
+
Each training instance consists of a prompt containing two dictionary definitions followed by the target relation label. During fine-tuning, the model learns to generate the correct label given the input definitions.
|
| 91 |
+
|
| 92 |
+
## Evaluation
|
| 93 |
+
|
| 94 |
+
The model was evaluated on:
|
| 95 |
+
|
| 96 |
+
1. the `WN+CN+UM` test set;
|
| 97 |
+
2. the SenseRel expert-annotated denotational dataset.
|
| 98 |
+
|
| 99 |
+
| Dataset | Weighted F1 |
|
| 100 |
+
| ----------------------------- | ----------: |
|
| 101 |
+
| WN+CN+UM test set | 0.737 |
|
| 102 |
+
| SenseRel denotational dataset | 0.658 |
|
| 103 |
+
|
| 104 |
+
On the WN+CN+UM test set, this model achieved the best reported score among the evaluated systems.
|
| 105 |
+
|
| 106 |
+
|
| 107 |
+
## Citation
|
| 108 |
+
|
| 109 |
+
If you use this model, please cite:
|
| 110 |
+
|
| 111 |
+
```bibtex
|
| 112 |
+
@inproceedings{cassotti-etal-2026-senserel,
|
| 113 |
+
title = "{S}ense{R}el: A Sense-Level Benchmark for Denotational and Connotational Meaning Relations",
|
| 114 |
+
author = "Cassotti, Pierluigi and
|
| 115 |
+
Baes, Naomi and
|
| 116 |
+
De Pascale, Stefano and
|
| 117 |
+
de S{\'a}, J{\'a}der Martins Camboim and
|
| 118 |
+
Periti, Francesco and
|
| 119 |
+
Haslam, Nick and
|
| 120 |
+
Geeraerts, Dirk and
|
| 121 |
+
Tahmasebi, Nina",
|
| 122 |
+
booktitle = "Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)",
|
| 123 |
+
month = jul,
|
| 124 |
+
year = "2026",
|
| 125 |
+
address = "San Diego, California, United States",
|
| 126 |
+
publisher = "Association for Computational Linguistics",
|
| 127 |
+
url = "https://aclanthology.org/2026.acl-long.20/",
|
| 128 |
+
pages = "499--515"
|
| 129 |
+
}
|
| 130 |
+
```
|