🤖Retrieve ESG Data from corporate report in natural language🤖
Note: this project is adapted from Harrison Chase Streamlit LLM chat bot to handle PDF and Fanilo Andrianasolo modifications for caching and improve user interactions.
💪 Built with LangChain
In order to set your environment up to run the code here, first install all requirements:
pip install -r requirements.txtThen set your OpenAI API key (if you don't have one, get one here)
export OPENAI_API_KEY=....For streamlit, add your key in a OPENAI_API_KEY entry in your secrets.toml
- Example data from french corporates.
- Python script to query pdf with a question
- Code to deploy on StreamLit
- Instructions for ingesting your own dataset
This repo uses the Total Energies corporate report as an example. It was downloaded August 2023.
In order to ask a question, run a command like:
python cli.pyYou can then asked any question of your liking!
This exposes a chat interface for interacting with the PDF database.
The code to run the StreamLit app is in main.py.
Note that when setting up your StreamLit app you should make sure to add OPENAI_API_KEY as a secret environment variable.
You can add any corporate reports of your liking in the PDF directory. Launch ingest.py to add them in the local vector store.
Run the following command to ingest the data.
python ingest.pyBoom! Now you're done.
We provide a vector database initialized on Total Energies and Engie 2022 corporate reports and their wikipedia page.