Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PDF Parser Chatbot

A powerful application that allows users to upload PDF documents and ask questions about their content. The application uses advanced AI techniques to provide accurate answers based on the document content.

Features

  • PDF document upload and processing
  • Intelligent question answering using RAG (Retrieval Augmented Generation)
  • Document-specific responses (answers are generated only from the currently uploaded document)
  • Modern web interface using Streamlit
  • Fast and efficient backend using FastAPI
  • Local LLM integration with Mistral-7B model
  • Vector storage using ChromaDB
  • Sentence transformers for semantic search

Prerequisites

  • Python 3.12 or higher
  • Virtual environment (recommended)
  • Required Python packages (see requirements.txt)
  • Mistral-7B model file (GGUF format)

Installation

  1. Clone the repository:
git clone https://github.com/VishnuRam16/PDF-Parser-Chatbot.git
cd PDF-Parser-Chatbot
  1. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Download the Mistral model:
  • Place the mistral-7b-instruct-v0.2.Q4_K_M.gguf model file in the models directory

Project Structure

PDF-Parser-Chatbot/
├── backend/
│   ├── main.py          # FastAPI application
│   ├── rag.py           # RAG implementation
│   ├── db.py            # Vector database operations
│   └── llm.py           # LLM integration
├── frontend/
│   └── app.py           # Streamlit interface
├── models/              # Directory for model files
├── requirements.txt     # Python dependencies
└── README.md           # Project documentation

Usage

  1. Start the backend server:
cd backend
PYTHONPATH=/path/to/PDF-Parser-Chatbot uvicorn main:app --reload --port 8000
  1. Start the frontend server:
cd frontend
streamlit run app.py
  1. Open your browser and navigate to:
  1. Upload a PDF document and start asking questions!

API Endpoints

  • GET /health: Health check endpoint
  • POST /upload: Upload and process PDF documents
  • POST /ask: Ask questions about the uploaded document
  • POST /clear: Clear all documents from the vector store

Timeouts

The application includes configurable timeouts for various operations:

  • PDF processing: 600 seconds (10 minutes)
  • Question answering: 300 seconds (5 minutes)
  • General requests: 600 seconds (10 minutes)

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Mistral AI for the language model
  • ChromaDB for vector storage
  • Sentence Transformers for embeddings
  • FastAPI and Streamlit for the web framework

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages