ccdv/arxiv-summarization
Viewer β’ Updated β’ 432k β’ 13.1k β’ 124
How to use UNIST-Eunchan/Research-Paper-Summarization-Pegasus-x-ArXiv with Transformers:
# Use a pipeline as a high-level helper
# Warning: Pipeline type "summarization" is no longer supported in transformers v5.
# You must load the model directly (see below) or downgrade to v4.x with:
# 'pip install "transformers<5.0.0'
from transformers import pipeline
pipe = pipeline("summarization", model="UNIST-Eunchan/Research-Paper-Summarization-Pegasus-x-ArXiv") # Load model directly
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("UNIST-Eunchan/Research-Paper-Summarization-Pegasus-x-ArXiv")
model = AutoModelForSeq2SeqLM.from_pretrained("UNIST-Eunchan/Research-Paper-Summarization-Pegasus-x-ArXiv")This model is a fine-tuned version of google/pegasus-x-base on the arxiv-summarization dataset.
Base Model: Pegasus-x-base (State-of-the-art for Long Context Summarization)
Finetuning Dataset:
GPU: (RTX A6000) x 1
Train time: About 120 hours for 5 epochs
Test time: About 8 hours for test dataset.
Pegasus-X-base zero-shot Performance:
This model
model.generate(input_ids =inputs["input_ids"].to(device),
attention_mask=inputs["attention_mask"].to(device),
length_penalty=1, num_beams=2, max_length=128*4,min_length=150, no_repeat_ngram_size= 3, top_k=25,top_p=0.95)
model.generate(input_ids =inputs["input_ids"].to(device),
attention_mask=inputs["attention_mask"].to(device),
length_penalty=1, num_beams=1, max_length=128*2,top_p=1)
model.generate(input_ids =inputs["input_ids"].to(device),
attention_mask=inputs["attention_mask"].to(device),
num_beam_groups=5,diversity_penalty=1.0,num_beams=5,min_length=150,max_length=128*4)
model.generate(input_ids =inputs["input_ids"].to(device),
attention_mask=inputs["attention_mask"].to(device),
length_penalty=1.2, num_beams=4, max_length=128*4,min_length=150, no_repeat_ngram_size= 3, temperature=0.9,top_k=50,top_p=0.92)
We use huggingface-based environment such as datasets, trainer, etc.
The following hyperparameters were used during training:
learning_rate: 1e-05,
train_batch_size: 1,
eval_batch_size: 1,
seed: 42,
gradient_accumulation_steps: 64,
total_train_batch_size: 64,
optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08,
lr_scheduler_type: linear,
lr_scheduler_warmup_steps: 1586,
num_epochs: 5
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 2.6153 | 1.0 | 3172 | 2.1045 |
| 2.202 | 2.0 | 6344 | 2.0511 |
| 2.1547 | 3.0 | 9516 | 2.0282 |
| 2.132 | 4.0 | 12688 | 2.0164 |
| 2.1222 | 5.0 | 15860 | 2.0127 |
Base model
google/pegasus-x-base