Skip to content

This repository provides tools to convert EPUB files into Markdown format and then summarize them using LLMs.

License

Notifications You must be signed in to change notification settings

eactisgrosso/epub-summ

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EPUB Summarizer

This repository provides tools to convert EPUB files into Markdown format and then summarize them using LLMs.

Features

  • Convert EPUB to Markdown: Extracts text from an EPUB file and converts it to Markdown format.
  • List Chapters in Markdown: Lists all chapters from the Markdown file.
  • Summarize Markdown: Summarizes the content of a Markdown file, breaking it down into chapters, and generates concise summaries using GPT-based models.

Prerequisites

1. Install Dependencies

Install the required Python packages using pip:

pip install -r requirements.txt

2. Set the env variables

Create an .env file in the root of the project directory with your OpenAI API key and model:

OPENAI_API_KEY=your_openai_api_key_here
MODEL=gpt-4o-mini

Usage

1. Convert an EPUB File to Markdown

Use the convert.py script to convert an EPUB file to Markdown format:

python convert.py /path/to/your.epub

2. List Chapters in a Markdown File

Use the markdown.py script to list all chapters in the Markdown file:

python markdown.py --chapters /path/to/your_markdown.md

3. Summarize the Markdown File

Summarize All Chapters

You can summarize all chapters interactively using the following command:

python markdown.py --summarize /path/to/your_markdown.md

The script will ask for confirmation before summarizing each chapter.

Summarize a Specific Chapter

To summarize a specific chapter, use the --chapter flag:

python markdown.py --summarize /path/to/your_markdown.md --chapter 1

4. Modify the Summarization Prompt

You can customize the prompt used for summarization by editing the prompt.txt file.

About

This repository provides tools to convert EPUB files into Markdown format and then summarize them using LLMs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages