Upload BART-Base-CE (Context Enhanced) for sarcasm rewriting
Browse files
README.md
CHANGED
|
@@ -14,7 +14,7 @@ pipeline_tag: summarization
|
|
| 14 |
|
| 15 |
# BART-Base-CE (Context Enhanced)
|
| 16 |
|
| 17 |
-
BART-base fine-tuned with **Context Enhancement**:
|
| 18 |
|
| 19 |
Part of the **Project LLMao** sarcasm style transfer suite (CS4248 Team 14, NUS AY2025/26 S2).
|
| 20 |
This model rewrites sarcastic news headlines as neutral, factual equivalents while
|
|
@@ -32,11 +32,12 @@ Example:
|
|
| 32 |
## Training
|
| 33 |
|
| 34 |
- **Base model**: [`facebook/bart-base`](https://huggingface.co/facebook/bart-base) (139M params)
|
| 35 |
-
- **Method**:
|
| 36 |
-
- **Dataset**:
|
| 37 |
-
(News Headlines Dataset for Sarcasm Detection)
|
| 38 |
-
|
| 39 |
-
|
|
|
|
| 40 |
- **Generation**: beam search with `num_beams=4`, `max_length=128`.
|
| 41 |
|
| 42 |
## Usage
|
|
@@ -49,9 +50,7 @@ tokenizer = AutoTokenizer.from_pretrained(model_id)
|
|
| 49 |
model = AutoModelForSeq2SeqLM.from_pretrained(model_id)
|
| 50 |
|
| 51 |
headline = "Area Man Passionate Defender Of What He Imagines Constitution To Be"
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
inputs = tokenizer(prompt, return_tensors="pt", truncation=True, max_length=128)
|
| 55 |
outputs = model.generate(**inputs, max_length=128, num_beams=4)
|
| 56 |
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 57 |
```
|
|
|
|
| 14 |
|
| 15 |
# BART-Base-CE (Context Enhanced)
|
| 16 |
|
| 17 |
+
BART-base fine-tuned with **Context Enhancement**: the non-sarcastic targets were re-generated with the full article body as additional context for the LLM annotator, producing deeper rewrites.
|
| 18 |
|
| 19 |
Part of the **Project LLMao** sarcasm style transfer suite (CS4248 Team 14, NUS AY2025/26 S2).
|
| 20 |
This model rewrites sarcastic news headlines as neutral, factual equivalents while
|
|
|
|
| 32 |
## Training
|
| 33 |
|
| 34 |
- **Base model**: [`facebook/bart-base`](https://huggingface.co/facebook/bart-base) (139M params)
|
| 35 |
+
- **Method**: Standard cross-entropy on (sarcastic_headline, non_sarcastic_target) pairs where the targets were authored by an LLM with access to the article body. The model itself takes only the sarcastic headline as input at inference time.
|
| 36 |
+
- **Dataset**: 8,258 sarcastic->non-sarcastic headline pairs derived from NHDSD
|
| 37 |
+
(News Headlines Dataset for Sarcasm Detection). Non-sarcastic targets were generated
|
| 38 |
+
by an LLM annotator (StepFun Step-3.5 Flash) with cross-validation by Nemotron.
|
| 39 |
+
Split: `sar_to_non_context_enhanced`.
|
| 40 |
+
- **Input format**: Raw sarcastic headline (no task prefix — BART is not pretrained with prefixes).
|
| 41 |
- **Generation**: beam search with `num_beams=4`, `max_length=128`.
|
| 42 |
|
| 43 |
## Usage
|
|
|
|
| 50 |
model = AutoModelForSeq2SeqLM.from_pretrained(model_id)
|
| 51 |
|
| 52 |
headline = "Area Man Passionate Defender Of What He Imagines Constitution To Be"
|
| 53 |
+
inputs = tokenizer(headline, return_tensors="pt", truncation=True, max_length=128)
|
|
|
|
|
|
|
| 54 |
outputs = model.generate(**inputs, max_length=128, num_beams=4)
|
| 55 |
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 56 |
```
|