alejandro-ao / langchain-ask-pdf

An AI-app that allows you to upload a PDF and ask questions about it. It uses OpenAI's LLMs to generate a response.
592 stars 309 forks source link

Enhancements: Support for Multiple Document Types and Improved User Experience #20

Open RaheesAhmed opened 1 year ago

RaheesAhmed commented 1 year ago

Description

This pull request introduces enhancements and modifications to the existing codebase to support a wider range of document types, including PDF, text, and CSV files.

Changes Made

  1. Added functions (process_pdf, process_text, and process_csv) to handle various document types (PDF, text, and CSV) and extract text content from them.
  2. Modified the main function to utilize the uploaded_file variable for file uploading and type checking.
  3. Removed the "Process" button and spinner logic, leading to a cleaner and more intuitive user interface.
  4. Updated the page title and header to better reflect the application's capabilities ("Ask your Document" instead of "Ask your PDF").

How to Test

  1. Run the application.
  2. Use the sidebar to upload different types of documents (PDF, text, and CSV).
  3. The application will automatically process the uploaded document, split it into chunks, and create embeddings.
  4. Enter a question related to the document's content.
  5. The application will display relevant information based on the provided question.

This pull request aims to enhance usability and support multiple document formats, making the application more versatile and user-friendly.