This is a full-stack web application that allows users to upload PDF documents and ask questions regarding the content of these documents. The backend processes the documents using natural language processing (NLP) techniques to provide answers to the user's questions. The frontend provides an intuitive interface for users to upload documents, ask questions, and view answers.
PDF Upload: Users can upload PDF documents to the application. The application stores the PDF and extracts its text content for further processing. Asking Questions: Users can ask questions related to the content of an uploaded PDF. The system processes the question and the content of the PDF to provide an answer. Displaying Answers: The application displays the answer to the user's question. Users can also ask follow-up or new questions on the same document.
React, LlamaIndex, FastAPI, Local Storage for saving files
This application begins with retrieval of pdf from the user. After the pdf has been uploaded, the fastapi backend uploads this in an uploads
folder. It is also then converted to a .txt
file.
From this txt file, then all the information is uploaded to a model and with the help of a llm, it is then used to answer the queries which are asked. There are 2 API endpoints created thus. One for the uploading of pdfs and the other for returning the answer generated by the model.
Below is a short video which showcases how it works.
pdfqna-working.mp4
Note - It might seem like it is working slowly but the issue is that I have a ram of only 4gb on my laptop. So everything works slowly on my system. And also the token has been disabled as well.