• Stars
    star
    582
  • Rank 76,801 (Top 2 %)
  • Language
    Python
  • Created over 1 year ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

Langchain Ask PDF (Tutorial)

You may find the step-by-step video tutorial to build this application on Youtube.

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.

How it works

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.

The application uses Streamlit to create the GUI and Langchain to deal with the LLM.

Installation

To install the repository, please clone this repository and install the requirements:

pip install -r requirements.txt

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

Usage

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

streamlit run app.py

Contributing

This repository is for educational purposes only and is not intended to receive further contributions. It is supposed to be used as support material for the YouTube tutorial that shows how to build the project.

More Repositories

1

ask-multiple-pdfs

A Langchain app that allows you to chat with multiple PDFs
Python
1,600
star
2

chat-with-websites

Latests Langchain (2024) App to chat with any website given its URL
Python
224
star
3

langchain-ask-csv

A Langchain app that allows you to ask questions to a CSV file
Python
127
star
4

langchain-chat-gui

Langchain chat with memory and a GUI made in Streamlit
Python
79
star
5

chat-with-mysql

GUI Python Application that allows you to chat with a MySQL database
Python
77
star
6

crewai-instagram-example

Example inspired by @joaomdmoura sample project
Python
69
star
7

chatgpt-equations

Chrome extension that allows you to visualize equations using Latex notation inside ChatGPT
JavaScript
57
star
8

crewai-crash-course

Tutorial: Introduction to CrewAI
Python
44
star
9

exa-crewai

HTML
42
star
10

chrome-extension-boilerplate

A boilerplate to create Chrome extensions with Manifest V3
JavaScript
39
star
11

openai-sql-generator

Simple app in React and Node that interacts with OpenAI's ChatGPT API
JavaScript
37
star
12

qdrant-cloud-app

Python
29
star
13

streamlit-cancer-predict

Youtube Tutorial: Streamlit app that predicts Breast Cancer
Python
28
star
14

agents-no-framework

Tutorial on how to create a ReAct agent without a LLM framework
Jupyter Notebook
21
star
15

chagpt-cli-python

A CLI interface that allows you to interact with ChatGPT from your terminal using an API key.
Python
20
star
16

yt-stream-langchain-streamlit

How to stream the generation of a LLM in your Streamlit application
Python
14
star
17

wp-underscores-webpack

WordPress Underscores boilerplate theme with webpack
PHP
9
star
18

chatbot-from-scratch

Python
9
star
19

py-ecommerce-spending-predictions

This model uses linear regression to predict how much a user spends every year in an e-commerce website based on the user's characteristics.
Jupyter Notebook
7
star
20

py-bank-stocks-eda

This project explores the behaviour of 4 major US bank stocks between 2006 and 2020.
Jupyter Notebook
5
star
21

20240223-chat-with-mysql

Tutorial on how to use MySQL loader with LangChain
Jupyter Notebook
5
star
22

tbs-msc-projects

HTML
3
star
23

wp-tutorial-html-to-theme

Finished project from tutorial on Youtube
SCSS
3
star
24

alejandro-ao

3
star
25

py-ad-performance-predictor

This model uses logistic regression to predict whether or not an internet user will click on an ad.
Jupyter Notebook
3
star
26

py-movie-recommendation

This code uses the power of pandas and its correlation functions to get film recommendations to a user based on its ratings on other movies.
Jupyter Notebook
3
star
27

react-todo-list

Front-end of a todo list. Created with react
JavaScript
1
star
28

alejandro-ao.github.io

Coding blog created using HUGO.
HTML
1
star
29

react-leaflet-with-marker-cluster

Created with CodeSandbox
1
star
30

streamlit-cancer

Breast Cancer Diagnosis App
Python
1
star
31

js-tutorial-multistep-form

Created with CodeSandbox
1
star