This repository contains a powerful assistant built using Flask and various machine learning models to extract key information from user queries and documents. It supports various document formats such as PDF, PPT, DOCX, and images, allowing users to upload and extract relevant information dynamically.
You can watch the demonstration video by clicking the link below:
- Extracts key information from various document types using Optical Character Recognition (OCR).
- Supports multiple actions such as creating orders, checking eligibility, generating leads, and more.
- Implements a conversational interface that keeps track of user sessions and pending actions.
- Uses the Gemini and Flan-T5 models for understanding and processing queries.
-
Clone the repository:
git clone https://github.com/HackRx50/PS4-GPTeam.git cd PS4-GPTeam
-
Create a virtual environment:
python3 -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Set your Google API key:
export GOOGLE_API_KEY='YOUR_API_KEY'
To run the application, follow these steps:
-
Start the Flask application:
python app.py
The application will start on
http://localhost:3000
. -
Run the Chainlit interface:
chainlit run frontend.py
You can now chat with the assistant through the Chainlit interface.
- POST
/upload_document
- Description: Uploads a document and extracts text.
- Parameters:
document
: The document file to upload (supports PDF, PPT, DOCX, images, etc.).
- POST
/chat
- Description: Sends a query to the assistant and receives a response.
- Headers:
x-user-id
: Unique identifier for the user.x-session-id
: Unique identifier for the user session.
- Parameters:
query
: The user's query as a string.document_id
: Optional document ID to use for context.
If you would like to contribute to this project, please fork the repository and submit a pull request. Contributions are welcome!
This project is licensed under the MIT License. See the LICENSE file for details.
- Author: msnabiel
- Email: msyednabiel@gmail.com