Skip to main content

Paper Summarizer & Explainer

Paper Summarizer & Explainer is a Python library designed to help students and researchers quickly digest complex academic papers. The library extracts text from PDFs or accepts raw text and uses Groq to generate concise summaries that highlight key concepts and define technical terms. Additionally, it provides an optional feature to generate simple diagrams or flowcharts from the summary.

Features

  • PDF Text Extraction: Easily extract text from academic papers in PDF format using PyPDF2.
  • Automated Summarization: Leverage Groq and pre-trained NLP models to create clear, concise summaries of academic papers.
  • Diagram Generation: Generate simple diagrams or flowcharts from summary points using Graphviz.
  • Modular Design: Start with core summarization and gradually expand functionality to include additional explanations or visual aids.

Installation

Prerequisites

  • Python 3.8 or higher

Install Dependencies

pip install Groq PyPDF2 graphviz

Example Usage

import os
import re
from paper_academic_summarizer import summarize_paper, generate_diagram

def shorten_summary(summary: str, max_words: int = 30) -> str:
    """
    Truncates the summary to a specified number of words.
    Appends '...' if the original summary exceeds max_words.
    """
    words = summary.split()
    if len(words) <= max_words:
        return summary
    return " ".join(words[:max_words]) + " ..."

def main():
    # Sample academic paper text with detailed model references
    sample_text = """
    In this study, we present a comprehensive evaluation of several state-of-the-art deep learning architectures
    for image classification and object detection. Our focus includes ResNet50, which uses residual connections
    to mitigate the vanishing gradient problem, Inception-v3 for multi-scale processing, and EfficientNet-B7
    leveraging compound scaling. We also analyze transformer-based models such as the Vision Transformer (ViT)
    and DeiT, discussing their performance trade-offs in terms of accuracy, computational cost, and scalability.
    Overall, these findings provide guidance for selecting and optimizing deep learning architectures in
    real-world applications, where balancing efficiency and accuracy is crucial.
    """

    # Generate the full summary using your library function
    full_summary = summarize_paper(sample_text, is_pdf=False)
    print("Full Summary:\n")
    print(full_summary)

    # Shorten the summary to ensure it's very concise
    short_summary = shorten_summary(full_summary, max_words=30)
    print("\nShort Summary:\n")
    print(short_summary)

    # Generate a diagram from the shortened summary
    output_file = "diagram_short"
    try:
        generate_diagram(short_summary, output_file=output_file)
        print(f"\nShort diagram generated successfully: {output_file}.png")
    except Exception as e:
        print("Error generating diagram:", e)

if __name__ == "__main__":
    main()

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any enhancements or bug fixes.

License

This project is licensed under the MIT License.

Acknowledgments

Contact

For any questions or inquiries, please contact harshchitaliya193@gmail.com.

Metadata

Release files for paper-academic-summarizer 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for paper-academic-summarizer 0.2.4
File Size Uploaded Provenance
paper_academic_summarizer-0.2.4.tar.gz 4.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for paper-academic-summarizer 0.2.4
File Interpreter ABI Platform
paper_academic_summarizer-0.2.4-py3-none-any.whl Python 3 none any Details

Total release size: 9.9 kB

Release files / paper_academic_summarizer-0.2.4.tar.gz

Download URL paper_academic_summarizer-0.2.4.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a33955429f4f700213974e4200476ceca60708595229ef12de6f07d1c161d3cd
BLAKE2b-256 checksum
How to use checksums
7b7645f8957dd45bbef88b5faf6358a8918afe707d64ab402a77a0810c035da0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.1

Release files / paper_academic_summarizer-0.2.4-py3-none-any.whl

Download URL paper_academic_summarizer-0.2.4-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
537ef67eb035f81927b3f959180a8523e87a866fd65d938508d89a4ddf0fb739
BLAKE2b-256 checksum
How to use checksums
33d700fa1506f9659bee0aea77f71863ef2cfcaea03a81e69c69fd6fe7995fbb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.1

Security for paper-academic-summarizer 0.2.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page