A full-stack application that allows users to upload PDF documents and ask questions regarding the content of these documents. The backend processes these documents and utilizes natural language processing to provide answers to the questions posed by the users.
git clone https://github.com/Maanit491/PDF_Insight_App.git
cd PDF_Insight_App
cd frontend
npm install
npm start
(Runs the app in the development mode.
Open http://localhost:3000 to view it in your browser.)
for more information about react setup, you can refer to the "README.md" File present in the "frontend" folder of this repository.
This guide will help you set up a virtual environment and run a FastAPI application. Follow these steps to get your application up and running.
Make sure you have the following installed on your system:
- Python 3.7+
- pip (Python package installer)
- virtualenv (optional but recommended for creating isolated environments)
Open another terminal(not the one where your react is running) and run:
cd PDF_Insight_App
cd backend
Creating a virtual environment ensures that dependencies are managed separately from other projects. You can create a virtual environment using the venv
module (included with Python) or virtualenv
.
python -m venv env
virtualenv env
Activate the virtual environment you created.
source env/bin/activate
.\env\Scripts\Activate.ps1
Now you are in your environment.
Install the required dependencies using pip
. Make sure you are in the project directory where the requirements.txt
file is located.
pip install -r requirements.txt
OPENAI_API_KEY="enter_your_openai_key_here"
Run the FastAPI application using uvicorn
, which is an ASGI server for Python.
uvicorn app.main:app --reload
main
is the name of your Python file (without the.py
extension) containing the FastAPI app.app
is the name of the FastAPI instance in yourmain
file.- The
--reload
flag is useful for development, as it reloads the server when you make changes to your code.
Your application should now be running at http://127.0.0.1:8000
.
Open your web browser and go to:
http://127.0.0.1:8000
You can also access the automatic interactive API documentation provided by FastAPI:
- Swagger UI:
http://127.0.0.1:8000/docs
- ReDoc:
http://127.0.0.1:8000/redoc
Once you are done working on your application, you can deactivate the virtual environment by running:
deactivate
-
To add new dependencies, install them using
pip
and updaterequirements.txt
:pip install <package_name> pip freeze > requirements.txt
This endpoint is for uploading PDF documents.
This endpoint processes a user's query and returns a response from the NLP model.
https://drive.google.com/file/d/1Ts409ftscYUnY0dk5I9hJ-Eah13POg7b/view?usp=sharing