LT3
/

natalievgrafova commited on
Commit
abb2adc
·
verified ·
1 Parent(s): 250360e

Update README.md

Browse files

# Definition-generation models trained on Dictionary data.


## The Models

To be updated



## How to use

To generate definitions from context, use the following code:


```python
import torch
from unsloth import FastLanguageModel
from transformers import AutoTokenizer

# Load model and tokenizer
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "unsloth/Meta-Llama-3.1-8B-Instruct-bnb-4bit",
max_seq_length = 512,
dtype = "bfloat16",
load_in_4bit = True
)
model = FastLanguageModel.for_inference(model)

# Alpaca-style prompt
def format_prompt(instruction, context):
return f"""Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.

### Instruction:
{instruction}

### Input:
{context}

### Response:
"""

# Example input
argument = "As long as death penalty is kept, this confirms that our society is founded on violence."
keyword = "death penalty"

# Build prompt
prompt = format_prompt(f"What is the definition of '{keyword}' in the following text?", argument)

# Tokenize
inputs = tokenizer([prompt], return_tensors="pt").to("cuda")

# Generate
outputs = model.generate(**inputs, max_new_tokens=60, use_cache=True)
definition = tokenizer.batch_decode(outputs, skip_special_tokens=True)[0]

# Show result
print("Generated definition:\n", definition)

```


## Model Performance


### Performance on NLI task

| Model | BERTScore-F1 [%] | Plausibility [%]
|-------------------|----------------------|-----------------|
| definitions-all-llama-8B-instruct | 86.5 | 71 |




### BibTeX entry and citation info

If you would like to use or cite our paper or model, feel free to use the following BibTeX code:

```bibtex
@inproceedings{evgrafova-etal-2025-stance,
title = "Stance-aware Definition Generation for Argumentative Texts",
author = "Evgrafova, Natalia and
De Langhe, Loic and
Lefever, Els and
Hoste, Veronique",
editor = "Chistova, Elena and
Cimiano, Philipp and
Haddadan, Shohreh and
Lapesa, Gabriella and
Ruiz-Dolz, Ramon",
booktitle = "Proceedings of the 12th Argument mining Workshop",
month = jul,
year = "2025",
address = "Vienna, Austria",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2025.argmining-1.16/",
doi = "10.18653/v1/2025.argmining-1.16",
pages = "168--180",
ISBN = "979-8-89176-258-9",
abstract = "Definition generation models trained on dictionary data are generally expected to produce neutral and unbiased output while capturing the contextual nuances. However, previous studies have shown that generated definitions can inherit biases from both the underlying models and the input context. This paper examines the extent to which stance-related bias in argumentative data influences the generated definitions. In particular, we train a model on a slang-based dictionary to explore the feasibility of generating persuasive definitions that concisely reflect opposing parties' understandings of contested terms. Through this study, we provide new insights into bias propagation in definition generation and its implications for definition generation applications and argument mining."
}
}
```

Files changed (1) hide show
  1. README.md +7 -3
README.md CHANGED
@@ -1,3 +1,7 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ language:
4
+ - en
5
+ base_model:
6
+ - unsloth/llama-3-8b-Instruct
7
+ ---