A command-line tool that uses Gemini API to generate summaries of academic papers.
Note: Supports multiple languages: Chinese, English, French, German, Japanese, Korean, and Spanish.
See the examples directory for sample outputs, including summaries of:
- (2018) What you can cram into a single vector: Probing sentence embeddings for linguistic properties
- (2018) Improving language understanding by generative pre-training
- (2018) BERT: Pre-training of deep bidirectional Transformers for language understanding
- (2019) BERT rediscovers the classical NLP pipeline
- (2019) Linguistic knowledge and transferability of contextual representations
- (2019) A Structural Probe for Finding Syntax in Word Representations
- (2019) What does BERT look at? An analysis of BERT’s attention
- (2023) Text Embeddings Reveal (Almost) As Much As Text
- (2024) Large Concept Models: Language Modeling in a Sentence Representation Space
DeepSeek
- (2024) DeepSeek LLM: Scaling open-source language models with longtermism.
- (2024) DeepSeek-V2: A strong, economical, and efficient Mixture-of-Experts language model.
- (2024) DeepSeek-Coder-V2: Breaking the barrier of closed-source models in code intelligence.
- (2024) DeepSeek-V3 Technical Report
- Python 3.10+
- Gemini API Key (obtain from Google AI Studio)
Note: If you find it difficult to set up the environment locally, please refer to the following Google Colab Notebook by @shoei05 (explained in Japanese):
- Clone the repository
- Install dependencies:
uv sync
- Create a
.env
file in the project directory with your Gemini API key:GEMINI_API_KEY=your_api_key_here
uv run gp-summarize path/to/paper.pdf
The tool will generate several markdown files with different types of summaries:
- A translation of the abstract
- A summary of the entire paper
- A JSON structure of the paper's chapters and sections
- Individual summaries (not translations) for each main section
- Summaries of 1-4 above combined into a single file
The output files will be named based on the input PDF filename. Files 1-4 above will be saved in a directory and numbered continuously (e.g., paper/001.md
, paper/002.md
, etc.). The combined file will be named paper.md
.
Note: If the process is interrupted (e.g. by Ctrl+C or by a 429 rate limit error, etc.), the process can be re-run smoothly, because any existing output files will be skipped.
For each prompt, the tool generates a markdown file containing:
- Title (prompt number)
- Statistics information about tokens
- Prompt
- AI-generated response
The section structure will be displayed in both JSON format and as a hierarchical list.
python -m gp_summarize [-h] [-d OUTPUT_DIR] [-o OUTPUT] [-l {de,en,es,fr,ja,ko,zh}] [--version] pdf_paths [pdf_paths ...]
-
pdf_paths
: Required Path(s) to one or more PDF files to summarize- Multiple PDF files can be specified
- Wildcards (
*
) are supported on Windows
-
-d, --output-dir
: Optional. Specify the output directory for intermediate files- Recommended when processing multiple PDF files
-
-o, --output
: Optional. Specify the output file for the summary- Can only be used with a single PDF file
-
-l, --language
: Optional. Specify the output language- Supported languages:
de
(German),en
(English),es
(Spanish),fr
(French),ja
(Japanese),ko
(Korean),zh
(Chinese) - Default: Based on system language settings
- Supported languages:
-
--version
: Display version information
Summarize a single PDF:
python -m gp_summarize paper.pdf
Summarize multiple PDFs:
python -m gp_summarize paper1.pdf paper2.pdf
Specify an output directory:
python -m gp_summarize -d ./outputs paper.pdf
Summarize in a specific language:
python -m gp_summarize -l ja paper.pdf
CC0 1.0 Universal