Skip to content
  • Sponsor
  • Notifications You must be signed in to change notification settings
  • Fork 12

Files

Latest commit

b704e66 · May 7, 2023

History

History
34 lines (22 loc) · 1.03 KB

File metadata and controls

34 lines (22 loc) · 1.03 KB

Book Summarizer Project

A tool to summarize books of any size into a couple of paragraphs.

Setup

You need to create a virtual env and install the packages listed in requirements.txt. You can then run Jupyter Notebooks in VS Code.

Follow these steps: How to Work with Python Virtual Environments, Jupyter Notebooks and VS Code.

You need to create a .env file with your OPENAI_API_KEY.

Usage

To run the script:

cd 08-book-summarizer-project
python3 summarize.py

Features

  • preparing book text for summarization.
  • handling context window math to respect the max tokens limit.
  • adding summarization logic using recursion.
  • caching results with hashing keys.
  • performing a "meta-summary" with GPT-4.

Based on Mastering OpenAI Python APIs: Unleash the Power of GPT4 by Colt Steele (2023).