File size: 3,211 Bytes
9966e25
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
---
language: en
license: apache-2.0
base_model: harsharajkumar273/ProphetNet-Large-Summarization
tags:
  - text-generation
  - story-generation
  - research-paper
  - seq2seq
  - prophetnet
  - lora
  - peft
datasets:
  - custom
metrics:
  - bertscore
  - sbert
---

# 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](https://huggingface.co/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

| Parameter | Value |
|-----------|-------|
| Base model | harsharajkumar273/ProphetNet-Large-Summarization |
| Task | Story Generation |
| Max input length | 1024 tokens |
| Max target length | 512 tokens |
| Learning rate | 5e-5 |
| Batch size | 2 |
| Gradient accumulation steps | 4 |
| Warmup steps | 1000 |
| Weight decay | 0.01 |
| Fine-tuning method | LoRA (r=16, alpha=64, targets: query_proj, value_proj) |
| Quantization | 4-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

- [harsharajkumar273/ProphetNet-Large-Summarization](https://huggingface.co/harsharajkumar273/ProphetNet-Large-Summarization) — previous stage
- [harsharajkumar273/Bart-Base-Story-Generation](https://huggingface.co/harsharajkumar273/Bart-Base-Story-Generation)
- [harsharajkumar273/T5-Base-Story-Generation](https://huggingface.co/harsharajkumar273/T5-Base-Story-Generation)