This project downloads PDFs, extracts metadata, generates summaries, and performs keyword extraction. All data is stored in MongoDB and JSON files for easy access.
download.py: Downloads PDFs from URLs listed indataset.json.pdf.py: Processes each PDF to get metadata (file size, page count, etc.).summarizer.py: Creates summaries and extracts keywords from each PDF.main.py: Coordinates the entire process: downloading, metadata extraction, summarization, and storage.
- Install Requirements:
pip install -r requirements.txt
- MongoDB: Make sure MongoDB is running locally on
localhost:27017. - NLTK: Download the tokenizer data:
import nltk nltk.download('punkt')
- Add PDF URLs to
dataset.jsonin this format:{ "Sample1": "http://example.com/sample1.pdf", "Sample2": "http://example.com/sample2.pdf" } - Run the main script:
python main.py
This will:
- Download the PDFs.
- Extract metadata and save it in MongoDB (
PDF_Metadatacollection) andmetadata.json. - Generate summaries and keywords, storing them in MongoDB (
Summariescollection) andsummaries.json.
- metadata.json: Contains metadata (file size, page count, etc.) for each PDF.
- summaries.json: Contains summaries and keywords for each PDF.