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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file paper_academic_summarizer-0.1.8.tar.gz.
File metadata
- Download URL: paper_academic_summarizer-0.1.8.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2bd5242f2c181042022c251bd13555c05e39a7e6804c4f1b94989a48cec0d05
|
|
| MD5 |
57489ef20285470bffbd8149b895c3ab
|
|
| BLAKE2b-256 |
0ddd67c9962fea607be3b0c42585dca47275604d9ffd3b4b5e519a3568f01f76
|
File details
Details for the file paper_academic_summarizer-0.1.8-py3-none-any.whl.
File metadata
- Download URL: paper_academic_summarizer-0.1.8-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81a1dd57ff4aaffc4aa9be1847cbad570ee2608733e4e322a5a1ac84d55a6128
|
|
| MD5 |
684d6a15b16a603a6078df412341d5ab
|
|
| BLAKE2b-256 |
03a2872c0914645a3142e7e2efd28f167d18f803f3bac852b0e47525af5ea1c8
|