Skip to main content

A library for summarizing and explaining academic papers

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

paper_academic_summarizer-0.2.1.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

paper_academic_summarizer-0.2.1-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file paper_academic_summarizer-0.2.1.tar.gz.

File metadata

File hashes

Hashes for paper_academic_summarizer-0.2.1.tar.gz
Algorithm Hash digest
SHA256 48d046a0541412d6ffe58e76afb70b07d41bf199dd73db9e4e158a13b1a69105
MD5 71fb508dae2a361e2305884cd227ccb3
BLAKE2b-256 2a2dea9f2d3903a494b0f4fb9248a5a1c5e86c253bcbbe6cf4b2a6016ba5df5a

See more details on using hashes here.

File details

Details for the file paper_academic_summarizer-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for paper_academic_summarizer-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3f6f56accd5005bfb8a4d7f938e54c6c15c7d5c0b18c19c18355de050ae51014
MD5 ed2fe0d7a84a5895bf63517aba2046f0
BLAKE2b-256 16bf58eb7185462b21676433be3e4cc3fe0e44e6e5ecd44a5a422b76594be300

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page