In this app.py file i have created a custom made chatbot using langchain and streamlit. We can upload any kind of pdf in this chatbot and ask any questions like chatgpt but related to uploaded file. This can be very helpful for large PDF files where the pages are around 300-400 pages.Instead of reading that large file we can simply use this chatbot and ask any question and it will give answers.
I have used Streamlit library for creating web applications beacause it allows engineers to quickly build highly interactive web applications around their data, machine learning models, and more. It’s designed specifically for machine learning engineers and data science teams. Streamlit turns data scripts into shareable web apps in minutes, all in pure Python. Adding a widget is as simple as declaring a variable, and there’s no need to write a backend, define routes, handle HTTP requests, or connect a frontend. Streamlit is compatible with major Python libraries such as scikit-learn, keras, PyTorch, latex, numpy, pandas, matplotlib, etc. It also allows you to deploy your apps directly from Streamlit for free Streamlit has been trusted by over 80% of Fortune 50 companies.
I have also used Langchain because LangChain is a framework for developing applications powered by language models. It provides a standard interface for chains, lots of integrations with other tools, and end-to-end chains for common applications. The core idea of the library is that we can “chain” together different components to create more advanced use cases around large language models (LLMs). It allows developers to chain together multiple commands to create more complex applications. LangChain provides modular abstractions for the components necessary to work with language models. It also provides a standard interface for agents, a selection of agents to choose from, and examples of end-to-end agents.