Coder Social home page Coder Social logo

kalyanm45 / docgenius-revolutionizing-pdfs-with-ai Goto Github PK

View Code? Open in Web Editor NEW
39.0 2.0 4.0 82 KB

This is a Python application that allows you to load a PDF and ask questions about it using natural language. The application uses a LLM to generate a response about your PDF. The LLM will not answer questions unrelated to the document.

License: GNU General Public License v3.0

Python 100.00%
langchain openai pdf-document-processor pdf-reader python chat-with-pdf

docgenius-revolutionizing-pdfs-with-ai's Introduction

DocGenius-Revolutionizing-PDFs-with-AI

Aboout the Project

This is a Python application that allows you to load a PDF and ask questions about it using natural language. The application uses a LLM to generate a response about your PDF. The LLM will not answer questions unrelated to the document. The application reads the PDF and splits the text into smaller chunks that can be then fed into a LLM. It uses OpenAI embeddings to create vector representations of the chunks. The application then finds the chunks that are semantically similar to the question that the user asked and feeds those chunks to the LLM to generate a response. Here is the Proof of Concept.

Images of Proof of Concept

logo

logo

Required Libraries

  • tiktoken
  • faiss-cpu
  • langchain
  • PyPDF2
  • python-dotenv
  • streamlit

Installation

This is make you understand how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.

  1. Clone the repo
git clone https://github.com/KalyanMurapaka45/DocGenius-Revolutionizing-PDFs-with-AI.git
  1. Install the required libraries
pip install -r requirements.txt

You will also need to add your OpenAI API key to the .env file.

  1. To use the application, run the app.py file with the streamlit CLI (after having installed streamlit):
streamlit run app.py

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!. Don't forget to star the project if you find it useful!

  1. Fork the Project

  2. Create your Feature Branch

  3. Commit your Changes

  4. Push to the Branch

  5. Open a Pull Request

Licnese

Distributed under the GNU General Public License v3.0. See LICENSE.txt for more information.

Acknowledgements

We would like to express our gratitude to the open-source community for their invaluable inspiration and contributions. We also acknowledge the Python libraries used in this project and their respective contributors.

docgenius-revolutionizing-pdfs-with-ai's People

Contributors

kalyanm45 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

docgenius-revolutionizing-pdfs-with-ai's Issues

PDF upload failing due to AxiosError 403

Hi, thanks for this very helpful tool. I am unable to upload any PDFs into the request. Is this related to OpenAI access? I've created a .env file with an API key but where is this being called? Can you shed some light on this error please?

FileNotFoundError with absolute path

I cloned the repo and tried to run it locally, however after streamlit run app.py I got: FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\KALYAN\Desktop\Projects\DocGenius\images.jpeg'.

It seems like it's looking for an absolute path. Perhaps this is an easy fix with a relative path instead.

FileNotFoundError

Hey thanks for this tool! However after installing everything sucessfully, I get this issue when launching the streamlit app:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\KALYAN\\Desktop\\Projects\\DocGenius\\images.jpeg' Traceback: File "C:\Users\TIMMY\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 534, in _run_script exec(code, module.__dict__) File "C:\Users\TIMMY\DocGenius-Revolutionizing-PDFs-with-AI\app.py", line 14, in <module> img = Image.open(r"C:\Users\KALYAN\Desktop\Projects\DocGenius\images.jpeg") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\TIMMY\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\PIL\Image.py", line 3236, in open fp = builtins.open(filename, "rb") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.