[Mova](https://md.mova.elamur.ai/free/en/) · [this page in HTML](https://mova.elamur.ai/free/en/docs/papers/agnew-2023-mechanical-bard-interpretable-machine-learning/)

[home](https://md.mova.elamur.ai/free/en/) / [docs](https://md.mova.elamur.ai/free/en/docs/) / [papers](https://md.mova.elamur.ai/free/en/docs/papers/) / [Machine translation](https://md.mova.elamur.ai/free/en/docs/papers/mtrans/) / The Mechanical Bard: An Interpretable Machine Learning Approach to Shakespearean Sonnet Generation

# The Mechanical Bard: An Interpretable Machine Learning Approach to Shakespearean Sonnet Generation

**Authors:** Edwin Agnew, Michelle Qiu, Lily Zhu, [Sam Wiseman](https://md.mova.elamur.ai/free/en/docs/papers/authors/sam-wiseman/), [Cynthia Rudin](https://md.mova.elamur.ai/free/en/docs/papers/authors/cynthia-rudin/) · **Year:** 2023 · **Venue:** Proceedings of the 61st Annual Meeting of the ACL (Volume 2: Short Papers) **Link:** [aclanthology.org/2023.acl-short.140](https://aclanthology.org/2023.acl-short.140/) · **Licence:** [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)

[**2** citations](https://openalex.org/works?filter=cites:W4385570370) openalex · 2026-10-18[Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers)](https://aclanthology.org/volumes/2023.acl-short/)[licence](https://creativecommons.org/licenses/by/4.0/)

- [Publisher's page](https://aclanthology.org/2023.acl-short.140/)
- [PDF](https://aclanthology.org/2023.acl-short.140.pdf)
- [DOI 10.18653/v1/2023.acl-short.140](https://doi.org/10.18653/v1/2023.acl-short.140)
- [OpenAlex](https://openalex.org/W4385570370)

**Authors (5)**

1. [Edwin Agnew](https://openalex.org/A5029436046) [ORCID](https://orcid.org/0000-0003-3410-5049) · [Semantic Scholar](https://www.semanticscholar.org/author/2189150172) · h 2 · 5 citations · 3 works
2. [Michelle Qiu](https://openalex.org/A5112974280) [Semantic Scholar](https://www.semanticscholar.org/author/2221286581) · h 1 · 2 citations · 2 works
3. [Lily Zhu](https://openalex.org/A5086337438) [Semantic Scholar](https://www.semanticscholar.org/author/2108595395) · h 1 · 2 citations · 4 works
4. [Sam Wiseman](https://openalex.org/A5073227709) [ORCID](https://orcid.org/0000-0003-0923-1086) · [Semantic Scholar](https://www.semanticscholar.org/author/2844243) · h 16 · 2207 citations · 51 works
5. [Cynthia Rudin](https://openalex.org/A5040468715) [ORCID](https://orcid.org/0000-0003-4283-2780) · [Semantic Scholar](https://www.semanticscholar.org/author/48395540) · h 58 · 26033 citations · 492 works

Citations and author metrics from openalex (2026-10-18); authors with the same name are not always told apart.

## What it is about

The paper generates Shakespearean sonnets with a small pretrained model (GPT-2, fine-tuned on poems and sonnets) and enforces the sonnet form explicitly rather than hoping training teaches it. About 120 handcrafted part-of-speech templates, taken from real sonnet lines, fix the grammatical shape of each line. A pronunciation dictionary gives syllable counts and stress, so meter is a hard filter during a constrained beam search, and rhyme is checked at the line end. A theme word pulls in related vocabulary, and soft weights reward alliteration and internal rhyme and penalize repetition. Human evaluation, from expert readers and crowd workers, prefers the output to two earlier generators on most criteria, though human sonnets still win on theme. An ablation shows that the templates matter more than the fine-tuning: removing them costs more quality than removing the tuning.

## Ideas

- I1. Use the templates as hard order constraints in the linearizer. `en/src/lin.rs` learns word order from classes; a small table of class sequences for a clause, checked as a filter, would fix order where the Markov chain is weak. Measure exact order matches with and without the table on dev.
- I2. Make agreement a hard filter in the encoder. The paper rejects candidates that break a hard constraint during search. Number and person from the UD features (open problem 5) can do the same for each chunk: *thou* is accepted only where person and number match the slot.
- I3. Run a proper ablation for each layer of the translator, as the paper does: remove one component, measure, and report. Keep the copy only as a measurement, not as a built-in.
- I4. The fine-tuned GPT-2 is not for Mova. The count form is "pick the most frequent chunk that passes the constraints", which is the encoder rule with a filter.

## For Mova

The code is `en/src/lin.rs` for the templates and `tools/translate` (`profile.rs`) for the hard filter. The paper's central claim, that explicit structure does most of the work, fits Mova's design. The ablation is the measure to copy.

Topics: [Machine translation](https://md.mova.elamur.ai/free/en/docs/papers/topics/machine-translation/)

## Cite

The paper itself, not this card. BibTeX from the library's record of the work. [DOI 10.18653/v1/2023.acl-short.140](https://doi.org/10.18653/v1/2023.acl-short.140)

```
@inproceedings{agnew2023mechanical,
  title = {{The Mechanical Bard: An Interpretable Machine Learning Approach to Shakespearean Sonnet Generation}},
  author = {Agnew, Edwin and Qiu, Michelle and Zhu, Lily and Wiseman, Sam and Rudin, Cynthia},
  booktitle = {Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers)},
  year = {2023},
  doi = {10.18653/v1/2023.acl-short.140},
  url = {https://doi.org/10.18653/v1/2023.acl-short.140}
}
```

- [← previous The Parallel Meaning Bank: A Framework for Semantically Annotating Multiple Languages](https://md.mova.elamur.ai/free/en/docs/papers/abzianidze-2020-parallel-meaning-bank-framework-semantically/)
- [next → The eBible Corpus: Data and Model Benchmarks for Bible Translation for Low-Resource Languages](https://md.mova.elamur.ai/free/en/docs/papers/akerman-2023-ebible-corpus-data-model-benchmarks/)
- [↑ back to Machine translation](https://md.mova.elamur.ai/free/en/docs/papers/mtrans/)

## References

13 references, 0 of them with a card of ours. ↗ leads to the work, «find» searches for one we have no id for yet.

1. John Benhardt, Peter Hase, Liuyi Zhu, and Cynthia Rudin. 2018. Shall I compare thee to a machine-written sonnet? An approach to algorithmic sonnet generation. [find](https://scholar.google.com/scholar?q=John+Benhardt%2C+Peter+Hase%2C+Liuyi+Zhu%2C+and+Cynthia+Rudin%2E+2018%2E+Shall+I+compare+thee+to+a+machine%2Dwritten+sonnet%3F+An+approach+to+algorithmic+sonnet+generation%2E)
2. Piotr Bojanowski, Edouard Grave, Armand Joulin, and Tomas Mikolov. 2017. Enriching word vectors with subword information. Transactions of the association for computational linguistics, 5:135–146. [↗](https://doi.org/10.1162/tacl_a_00051)
3. Carnegie Mellon University CMU. 2019. The CMU pronouncing dictionary. [http://www.speech.cs.cmu.edu/cgi-bin/cmudict](http://www.speech.cs.cmu.edu/cgi-bin/cmudict), Internet. [↗](http://www.speech.cs.cmu.edu/cgi-bin/cmudict)
4. Pablo Gervás. 2000. Wasp: Evaluation of different strategies for the automatic generation of spanish verse. In Proceedings of the AISB-00 Symposium on Creative & Cultural Aspects of AI, pages 93–100. [find](https://scholar.google.com/scholar?q=Pablo+Gerv%C3%A1s%2E+2000%2E+Wasp%3A+Evaluation+of+different+strategies+for+the+automatic+generation+of+spanish+verse%2E+In+Proceedings+of+the+AISB%2D00+Symposium+on+Creative+%26+Cultural+Aspects+of+AI%2C+pages+93%E2%80%93100%2E)
5. Marjan Ghazvininejad, Xing Shi, Yejin Choi, and Kevin Knight. 2016. Generating topical poetry. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 1183–1191. [find](https://scholar.google.com/scholar?q=Marjan+Ghazvininejad%2C+Xing+Shi%2C+Yejin+Choi%2C+and+Kevin+Knight%2E+2016%2E+Generating+topical+poetry%2E+In+Proceedings+of+the+2016+Conference+on+Empirical+Methods+in+Natural+Language+Processing%2C+pages+1183%E2%80%93119)
6. Jey Han Lau, Trevor Cohn, Timothy Baldwin, Julian Brooke, and Adam Hammond. 2018. Deep-speare: A joint neural model of poetic language, meter and rhyme. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1948–1958, Melbourne, Australia. Association for Computational Linguistics. [find](https://scholar.google.com/scholar?q=Jey+Han+Lau%2C+Trevor+Cohn%2C+Timothy+Baldwin%2C+Julian+Brooke%2C+and+Adam+Hammond%2E+2018%2E+Deep%2Dspeare%3A+A+joint+neural+model+of+poetic+language%2C+meter+and+rhyme%2E+In+Proceedings+of+the+56th+Annual+Meeting+of+th)
7. Ruli Manurung, Graeme Ritchie, and Henry Thompson. 2000. Towards a computational model of poetry generation. [https://era.ed.ac.uk/handle/1842/3460](https://era.ed.ac.uk/handle/1842/3460). [↗](https://era.ed.ac.uk/handle/1842/3460)
8. George A Miller. 1998. WordNet: An electronic lexical database. MIT press. [find](https://scholar.google.com/scholar?q=George+A+Miller%2E+1998%2E+WordNet%3A+An+electronic+lexical+database%2E+MIT+press%2E)
9. Hugo Gonçalo Oliveira. 2012. Poetryme: a versatile platform for poetry generation. Computational Creativity, Concept Invention, and General Intelligence, 1:21. [find](https://scholar.google.com/scholar?q=Hugo+Gon%C3%A7alo+Oliveira%2E+2012%2E+Poetryme%3A+a+versatile+platform+for+poetry+generation%2E+Computational+Creativity%2C+Concept+Invention%2C+and+General+Intelligence%2C+1%3A21%2E)
10. Alec Radford, Jeff Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. 2019. Language models are unsupervised multitask learners. [https://github.com/openai/gpt-2](https://github.com/openai/gpt-2). [↗](https://github.com/openai/gpt-2)
11. Tim Van de Cruys. 2020. Automatic poetry generation from prosaic text. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 2471–2480, Online. Association for Computational Linguistics. [find](https://scholar.google.com/scholar?q=Tim+Van+de+Cruys%2E+2020%2E+Automatic+poetry+generation+from+prosaic+text%2E+In+Proceedings+of+the+58th+Annual+Meeting+of+the+Association+for+Computational+Linguistics%2C+pages+2471%E2%80%932480%2C+Online%2E+Association+)
12. Tony Veale. 2013. Less rhyme, more reason: Knowledge-based poetry generation with feeling, insight and wit. In Proceedings of the Fourth International Conference on Computational Creativity, ICCC 2013, Sidney, Australia, June 12-14, 2013, pages 152–159. computationalcreativity.net. [find](https://scholar.google.com/scholar?q=Tony+Veale%2E+2013%2E+Less+rhyme%2C+more+reason%3A+Knowledge%2Dbased+poetry+generation+with+feeling%2C+insight+and+wit%2E+In+Proceedings+of+the+Fourth+International+Conference+on+Computational+Creativity%2C+ICCC+2013)
13. Jianyou Wang, Xiaoxuan Zhang, Yuren Zhou, Christopher Suh, and Cynthia Rudin. 2021. There once was a really bad poet, it was automated but you didn’t know it. [find](https://scholar.google.com/scholar?q=Jianyou+Wang%2C+Xiaoxuan+Zhang%2C+Yuren+Zhou%2C+Christopher+Suh%2C+and+Cynthia+Rudin%2E+2021%2E+There+once+was+a+really+bad+poet%2C+it+was+automated+but+you+didn%E2%80%99t+know+it%2E)
