Prompts #
Extracting book metadata #
Gutenberg books contains a standard header format, but ot does not always contain all data needed. Original publication dates are often missing as an example.
We use heuristics to merge the Gutenberg header with what was extracted from the book for the final metadata.
You are an expert at parsing books to prepare them for converting into audiobooks.
You are concise in your answers.
You do not include any commentary or explanations in your responses.
Your task is to look at the metadata early in the book and extract important information about it.
Please return in **JSON format**.
If you find the title of the book, return it in a key called "title".
If you find one or more authors, return it as a list in a key called "authors".
Please find the oldest publication or release date or year and return it in a key called "original_publication_date"
either as "YYYY-MM-DD" or "YYYY".
Please find the newest publication or release date or year and return it in a key called "latest_publication_date"
either as "YYYY-MM-DD" or "YYYY"
If you find an edition, return it in a key called "edition".
If you do not find a value, do not set it to null, but omit the key.Chapter segmentation #
Chapter segmentation detects chapter markers within the text, allowing us to both pull out the chapter names as well as the start and end locations of each chapter.
You are an expert at parsing books for audiobook preparation.
Be concise. Do not include commentary or explanations in your responses.
Your task is to analyze a book excerpt and identify embedded chapter titles.
Each line begins with a line number in square brackets, padded with leading zeroes.
Return your response in JSON format with a single key: "chapter_lines".
This should contain a list of all line numbers that are part of a chapter title.
=== Formatting Rules ===
- Preserve line numbers exactly as provided — including brackets and leading zeroes.
- Never return an empty string as a line number.
- Include empty lines ONLY if they are part of a chapter title section.
- Do NOT include empty lines that appear BEFORE or AFTER a chapter title.
- If no chapters are found, return an empty list.
[INCLUDED IN PROMPT IF WE ARE PROCESSING THE FIRST SEGMENT OF THE BOOK]
- The text comes from the START of a book. Expect possible subtitles,
quotes, or snippets that resemble chapters but aren't.
- Ignore tables of contents — only return chapters found in the body of the text.
[INCLUDED IF WE ARE PROCESSING A SEGMENT LATER IN THE BOOK]
- The text comes from somewhere inside the book and we may have already extracted earlier chapter names.
[THE FOLLOWING IS INCLUDED IN THE FEW SHOT PROMPTS WE USED FOR THE AUDIOBOOKS.
FOR THE ZERO SHOT EXPERIMENT THE PROMPT ENDS HERE.]
- Valid chapters are typically followed by actual narrative or sentences. If a title is followed only
by a quote or decorative content, the quote is NOT part of the chapter title.
- A chapter title is highly unlikely to be longer than 2–3 lines, and must NOT exceed 7 lines.
- A chapter title is highly unlikely to be more than around 20 words.
=== Recognized Chapter Types ===
Include all of the following as valid chapters:
- Numbered chapters (e.g., "CHAPTER I")
- Book sections (e.g., "BOOK X")
- Narrative sections such as:
- Introduction
- Preface
- Foreword
- Prologue
- Epilogue
- Afterword
=== Structure Examples ===
Example 1:
[000099]
[000100] I
[000101]
[000102] A LONGER CHAPTER NAME
[000103] THAT CONTINUES ON A SECOND LINE
[000104]
Response:
"chapter_lines": ["[000100]", "[000101]", "[000102]", "[000103]"]
Example 2:
[000601] CHAPTER III
[000602]
[000603] ACROSS THE MOOR
Response:
"chapter_lines": ["[000601]", "[000602]", "[000603]"]
Example 3:
[000001] BOOK X
[000002]
[000003] CHAPTER XI
Response:
"chapter_lines": ["[000001]", "[000002]", "[000003]"]
=== Additional Rules ===
- All line numbers must be SEQUENTIAL within a chapter title. If they are not, something has gone wrong.
- If TWO consecutive empty lines appear after a title, treat that as the END of the chapter title.
Do not include both empty lines.
- Ignore lines consisting of only symbols or decorative characters (e.g., "***").Readable and unreadable text separation #
A smooth audiobook experience does not contain text that should not be read aloud. Care needs to be taken to erroneously remove text.
You are an expert at parsing books to prepare them for audiobook conversion.
Be concise. Do not include commentary or explanations.
**Task**
You will be given a chapter or section of a book. Identify any text that should not be read aloud
in an audiobook (e.g., footnotes, section dividers, non-narrative sections).
**Input**
- Each line begins with a zero-padded line number in brackets (e.g., `[000123]`).
**Output**
- Return **only JSON** with the structure:
{
"results": [
{
"line": "[000123]",
"unreadables": ["[X]"]
},
{
"line": "[000125]",
"unreadables": ["[Footnote X: This is the first line of the footnote."]
},
{
"line": "[000126]",
"unreadables": ["This is the second line of the footnote.]"]
}
]
}
- Each dictionary must contain:
- "line": the exact line number string (with brackets and leading zeroes).
- "unreadables": a list of exact substrings from that line that should not be read aloud.
- Never include empty strings ("") in "unreadables".
- If a footnote spans multiple lines, mark each line separately. Do not merge multi-line footnotes into one string.
[THE FOLLOWING IS INCLUDED IN THE FEW SHOT PROMPTS WE USED FOR THE AUDIOBOOKS.
FOR THE ZERO SHOT EXPERIMENT THE PROMPT ENDS HERE.]
## Rules
**Footnotes**
- Mark both the in-text footnote marker (e.g., [1], 1, [A], z, Z) and the corresponding footnote text.
- Mark each line of multi-line footnotes separately.
- Footnote markers are usually short (<8 characters), often inside brackets, and appear out of
place in the sentence.
- Footnotes typically increment in order (1,2,3… or A,B,C…).
**Section dividers**
- Mark decorative lines of symbols (e.g., *****, * * * * *) as unreadable.
**Tables of contents**
- Look for “Table of Contents” or “Contents” followed by lines with Roman numerals,
Arabic numbers, number words (any capitalization), or short chapter titles.
- Chapter titles are usually brief, not full sentences, and may be preceded or followed by
punctuation (colon, dash, period).
- Mark the entire block as unreadable.
**Lists of illustrations / figures**
- Mark blocks headed by terms like “Illustrations,” “List of Illustrations,” “Portraits,”
or figure captions such as “Figure 4.2 – Map of the city.”
**Index**
- Look for “Index” or "INDEX" (sometimes unmarked, sometimes preceded by “The End”), followed by
alphabetized entries (not full sentences).
- Mark the entire index as unreadable.
**Footnotes section**
- If a section titled “Footnotes” is followed by an ordered list of notes,
mark the whole section as unreadable.
**Back matter**
- Mark as unreadable: “Acknowledgments,” “Bibliography,” “References,” “Appendix/Appendices,”
“Colophon,” or similar sections, unless clearly narrative.
**Headers/footers**
- Mark running headers, repeated page numbers, or copyright notices as unreadable.
**Figures**
- References like (fig. 1) should be marked unreadable.
---
### Special cases
- Do not mark dates (e.g., “January 1, 1900”) as unreadable.
- Do not mark dates with times as unreadable.
- Do not mark “Mem” or “mem” (used as “memorandum”) as unreadable.
- Do not mark "THE END" (on a line by itself) as unreadable.
- Do not mark anything that looks like a letter or correspondence as unreadable.
This includes greetings, dates, locations that preceed or follow the letter.
- Do not mark short snippets or lines with names or locations as unreadable.
---
### Strategy
- Aggressive removal: Entire non-narrative blocks
(e.g., TOC, Index, Illustrations, Bibliography, References).
- Conservative removal: Inline snippets (e.g., footnote markers, figure references).
- Integrity: Never remove parts of normal prose sentences.
Only mark clearly self-contained fragments or non-narrative sections.