Skip to content

๐Ÿ“„๐Ÿ’ก Flash Notes: An interactive document assistant powered by Qwen 2.5 with RAG, enabling chat, summaries, and quizzes for PDFs, PPTX, and TXT files. Integrated with Tesseract OCR for text extraction from images within documents.

Notifications You must be signed in to change notification settings

Nawap1/FlashNotes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

51 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation


Flash Notes

Flash Notes is an interactive document assistant that leverages Retrieval-Augmented Generation (RAG) to enhance user interaction with documents. It allows users to upload documents (PDF, PPTX, or TXT) and engage with them using Qwen 2.5. With Flash Notes, users can chat with their documents, generate summaries, and create quizzes based on the content, all designed to enhance document comprehension and learning.

Features

  • Chat with Documents: Ask questions directly about your documents and receive accurate, context-aware responses.
  • Summarize Content: Generate concise summaries of key points.
  • Generate Quizzes: Automatically create quizzes to test knowledge of the document content.
  • RAG (Retrieval-Augmented Generation): Utilizes RAG to improve response relevance by retrieving document-specific context before generating responses.
  • OCR for Image-Based Text: Extracts text from images within documents using Tesseract OCR.

Tech Stack

  • Frontend: Next.js
  • Backend: FastAPI
  • LLM: Qwen 2.5 for natural language processing
  • RAG: Enhances the LLMโ€™s responses with document-based retrieval
  • Database: IndexDB

Getting Started

Prerequisites

  • Python 3.10+ for the FastAPI backend
  • Node.js for the Next.js frontend
  • Ollama for the LLM model deployment
  • Tesseract OCR for extracting text from images within documents (download link below)

Installation

1. Clone the Repository

git clone https://github.com/Nawap1/FlashNotes.git
cd FlashNotes

2. Download the Quantized Model

  • Download the Qwen 2.5 model from this link.
  • Place the downloaded model file in a new directory named /Model within the project root.

3. Install Ollama

  • Download and install Ollama from here, following the installation instructions provided.

4. Install Tesseract OCR (For Image-Based Text Extraction)

  • Download Tesseract OCR from this link and follow the installation instructions.
  • Once installed, ensure Tesseract is accessible in your systemโ€™s PATH.

5. Prepare the Model

  1. Copy the downloaded model file into the project directory.

  2. Create a file named Modelfile in the same directory with the following content:

    FROM qwen2.5-3b-instruct-q4_k_m.gguf
    SYSTEM You are a helpful AI assistant
    # Adjust model parameters
    PARAMETER temperature 0.7
    PARAMETER top_k 40
    PARAMETER top_p 0.95
    PARAMETER num_ctx 10000
    
  3. Create the Ollama model by running:

    ollama create qwen3 -f Modelfile

6. Install Backend Dependencies

pip install -r requirements.txt

Running the Application

1. Start the API

  1. Navigate to the API directory:

    cd api
  2. Run the API:

    python api.py

    The API will now be running at http://localhost:8000.

2. Start the Frontend

  1. Navigate to the app directory:

    cd app
  2. Install frontend dependencies:

    npm install
  3. Start the frontend server:

    npx next dev

    The app should now be accessible at http://localhost:3000.


Usage

  1. Open your browser and go to http://localhost:3000.
  2. Use the Upload button to upload your documents.
  3. Once loaded, interact with your document in the following ways:
    • Chat: Navigate to the chat section to ask questions about the document.
    • Summarize: Go to the summary tab and click Generate Summary for key takeaways.
    • Quiz: Go to the quiz tab and click Generate Quiz to create questions based on the document content.
    • OCR for Images: If your document contains images with text, the system will use Tesseract OCR to extract and process the text.

Demo

FlashNotes.Demo.mp4

About

๐Ÿ“„๐Ÿ’ก Flash Notes: An interactive document assistant powered by Qwen 2.5 with RAG, enabling chat, summaries, and quizzes for PDFs, PPTX, and TXT files. Integrated with Tesseract OCR for text extraction from images within documents.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published