CoolFace
Modelpublic

harsharajkumar273/ProphetNet-Large-Story-Generation

sourceHugging Faceapache-2.0updated 6mo agoView on Hugging Face
0likes
Model Card

ProphetNet-Large-Story-Generation

A fine-tuned model for transforming research paper summaries into engaging short stories. This is the second stage of a two-step Research Paper Simplifier pipeline, built on top of harsharajkumar273/ProphetNet-Large-Summarization.

Model Description

This model takes a summary of a research paper and generates an immersive, narrative-style short story. Fine-tuned using LoRA (PEFT) with 4-bit quantization.

Pipeline

Research Paper ──► [ProphetNet-Large-Summarization] ──► Summary ──► [ProphetNet-Large-Story-Generation] ──► Story

Training Details

ParameterValue
Base modelharsharajkumar273/ProphetNet-Large-Summarization
TaskStory Generation
Max input length1024 tokens
Max target length512 tokens
Learning rate5e-5
Batch size2
Gradient accumulation steps4
Warmup steps1000
Weight decay0.01
Fine-tuning methodLoRA (r=16, alpha=64, targets: queryproj, valueproj)
Quantization4-bit NF4 (bitsandbytes)

Usage

python
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM

# Stage 1: Summarize the paper
sum_tokenizer = AutoTokenizer.from_pretrained("harsharajkumar273/ProphetNet-Large-Summarization")
sum_model = AutoModelForSeq2SeqLM.from_pretrained("harsharajkumar273/ProphetNet-Large-Summarization")

paper_text = "Your research paper text here..."
word_count = len(paper_text.split())
sum_prompt = f"Summarize this part of the research paper to less than {word_count // 10} words:\n{paper_text}"
sum_inputs = sum_tokenizer(sum_prompt, return_tensors="pt", max_length=2048, truncation=True)
sum_outputs = sum_model.generate(**sum_inputs, max_length=256, num_beams=4)
summary = sum_tokenizer.decode(sum_outputs[0], skip_special_tokens=True)

# Stage 2: Generate a story from the summary
story_tokenizer = AutoTokenizer.from_pretrained("harsharajkumar273/ProphetNet-Large-Story-Generation")
story_model = AutoModelForSeq2SeqLM.from_pretrained("harsharajkumar273/ProphetNet-Large-Story-Generation")

story_inputs = story_tokenizer(summary, return_tensors="pt", max_length=1024, truncation=True)
story_outputs = story_model.generate(**story_inputs, max_length=512, num_beams=4)
story = story_tokenizer.decode(story_outputs[0], skip_special_tokens=True)
print(story)

Evaluation Metrics

Evaluated using BERTScore and SBERTScore on a held-out 10% test split.

Related Models