Skip to content

utkarsh-tekriwal/DocuMitra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📘 DocuMitra - Smart Assistant for Research Summarization

DocuMitra is an AI-powered assistant that helps you deeply understand documents like research papers, manuals, and reports. It supports free-form QA, logic-based questioning, and justification with contextual references — all in one simple interface. This GenAI assistant processes uploaded PDF/TXT documents to:

  • Generate a 150-word summary.
  • Answer any user question (Ask Anything) with citation from document.
  • Pose 3 logic-based questions (Challenge Me) and evaluate user's answers with justification derived from uploaded document.

Approach

  • Two pipelines can be set up - a fully-local system vs a cloud-API system.
  • We approached it using fully-local system - Retrieval Augmented Generation, which embeds document chunks into vector store, retrieve relevant passages for each query, and feed those into a local LLM to generate answers.
  • Used PyMuPDF for Document Ingestion and Chunking.
  • A single LLM was not sufficient for all three tasks and hence, we used a hybrid of 2 LLMs (facebook/bart-large-cnn AND deepset/roberta-base-squad2).

Challenges

  • Handle sensitive data within the system without exposing to API providers - Solved by using fully-local approach.
  • Single small model was not effective for all tasks - Solved by using hybrid of two models.
  • facebook/bart cannot process long text all at once for summary - Solved by dividing documents into smaller parts --> generating summary for each part --> then combining each summary at last and displaying the combined result.

🚀 Features

  • 📚 Supports both .pdf or .txt documents.
  • 📌 Concise Summary Generation.
  • 💬 Context-aware answers grounded in the uploaded document.
  • 🧠 Logic question generation and grading.
  • No hallucination policy: All answers are grounded in the document.
  • Clean UI using Gradio.
  • No third party data leaks due to local operation.

Technologies and Models Used

  • Gradio: For building the interactive front-end UI
  • PyMuPDF (fitz): For extracting text from PDFs
  • Sentence Transformers: all-MiniLM-L6-v2 for generating embeddings
  • FAISS: Vector similarity search for information retrieval
  • HuggingFace Transformers: 1)facebook/bart-large-cnn for summarization. 2)deepset/roberta-base-squad2 for question answering.
  • LangChain: RecursiveCharacterTextSplitter for document chunking

Setup Instructions

Clone the repo

git clone https://github.com/utkarsh-tekriwal/DocuMitra
cd DocuMitra

Create Virtual Environment

python -m venv venv
source venv/bin/activate  # Or venv\Scripts\activate on Windows

Install the required libraries

pip install -r requirements.txt

Run the app:

python app.py

Note: The assistant runs locally on machine, while using it for the first time it requires an active internet connection to download all large LLMs to your system. It may take a while depending on your internet connection. Please be patient at the first setup. Once all done, subsequent use of model will no longer require an internet connection and will be relatively fast.

Once the app is successfully executed, a localhost link will be generated in CMD, copy the link and access it in your browser for the UI to the model. Don't terminate CMD till you are working on the model.

After opening the localhost link, upload the PDF/TXT file in the desired prompt and wait for summary. You can use other features also as and when needed. You can find the sample pdf file in /sample_docs

🖼️ Demo Screenshots

Model UI

Upload

Summary and QA Preview

Ask Anything

📂 Folder Structure

DocuMitra/
├── app.py
├── requirements.txt
├── README.md
├── .gitignore
│
├── sample_docs/
│ ├── example.pdf
│
├── demo_screens/
│ ├── UI.png
│ └── ask_anything.png

About

AI Based Smart Assistant for Research Summarization

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages