the question
can generative ai accurately emulate william shakespeare's writing style? the project set out to measure exactly that, comparing several models on stylistic accuracy using bleu, rouge-n, cosine similarity, jaccard similarity, and pinc score.
fine-tuning
i fine-tuned gpt-2 and gpt davinci on the shakescleare dataset, which pairs modern english passages with their shakespearean translations. a style transformer model was used as an additional baseline.
gpt-2 needed a specialised format: each row became a start token, the english translation, an end token, a separator, then the shakespearean translation wrapped in its own start/end tokens. davinci, with its native prompt-completion setup, was given an instruction-style prompt and the shakespearean line as the completion.
results
across test examples, gpt-2 and davinci consistently retained the poetic depth of the original text, while the style transformer baselines tended to flatten and simplify the phrasing. the example below shows each model's attempt at a single line.
| source | output |
|---|---|
| english | my generosity to you is limitless as the sea, and my love is as deep |
| shakespeare (target) | my bounty is boundless as the sea, my love as deep |
| gpt-2 | my goodness to thee is as infinite as the sea, and my love as deep |
| gpt davinci | my love to you is sound, sans crack or flaw |
| style transformer | i'm boundless, love is deep |
