Welcome to our state-of-the-art Intelligent Mutual Fund Prospectus Document Processing tailored specifically for financial services. By leveraging a unique and advanced workflow, our system ensures precise, context-aware responses, making it a frontrunner in AI-driven financial communication solutions.
- Mutual Fund Prospectus-centric RAG Workflow: A robust model that understands the intricacies of the Mutual Fund Prospectus.
- Pre-summarization: Ensure detailed and context-aware responses every time.
- Seamless Integration: Integrated with tools like Langchain, Streamlit, and Bedrock for a seamless experience.
This repository beautifully marries the capabilities of:
- Langchain: Advanced linguistic chains and text parsing.
- Streamlit: An intuitive platform for crafting custom ML tools.
- Bedrock: Crafting complex ML structures with ease.
conda update conda -c conda-canary
conda config --set channel_priority flexible
conda create --name financialqaenv -c conda-forge python=3.10.6
conda activate financialqaenv
pip install --upgrade pip
pip install --upgrade -r requirements.txt
Before running the application, please ensure you have access to Amazon Bedrock and its required models. See here for more info.
Also, to setup your AWS credentials, see this reference for AWS Command Line Interface and getting started with authentication and access credentials.
Launch the Streamlit application:
./run.sh
Or run the application using the streamlit command directly as follows:
streamlit run app.py
The application will pick your default AWS credentials in this case.
Should you encounter the "Killed streamlit" message during highlighted tokens computation, it's likely due to resource constraints. Opt for a more powerful instance if this occurs.
To utilize containers, proceed as follows:
- Build the Docker Image:
docker build -t pdf-advanced-rag-financial:latest .
- Run the Container make sure to replace <YOUR_VALUES> with your actual AWS credentials:
docker run -p 8501:8501 \
-e AWS_ACCESS_KEY_ID='<YOUR_ACCESS_KEY>' \
-e AWS_SECRET_ACCESS_KEY='<YOUR_SECRET_KEY>' \
-e AWS_DEFAULT_REGION='<YOUR_DEFAULT_REGION>' \
pdf-advanced-rag-financial:latest
Upon successful execution, visit http://localhost:8501
to access the Streamlit app running within your Docker container.
If you prefer to use the docker-compose.yml
, please run as follows:
- Build the container image.
docker-compose build --no-cache
- Start the container image.
docker-compose up
If you want to run in an AWS EC2, you can do as follows:
nohup streamlit run app.py &
This will run your streamlit app in the background and log to nohup.out
.
Also, you could run the container in AWS EC2. In detached mode:
docker-compose up -d
In either cases, please note your EC2 url and ensure your streamlit is exposed to view the app. You might need all the necessary permissions and settings for this.
Our project follows a clear and intuitive structure to ensure ease of navigation:
-
run.sh
: This shell script acts as the entry point for our application. It's tailored to initialize the Streamlit app. -
app.py
: The heart of our application. This Python script handles the core logic, interfaces with the RAG model, and serves responses. Dive into it to understand the intricate workings of our advanced RAG workflow.
To make the most out of our project, familiarize yourself with these key components and their interplay.
├─ intelligent-mutual-fund-prospectus-document-processing/
├── assets/
├── data_handlers/
├── docs/
├── labels/
├── langchain_handler/
├── utils/
├── .dockerignore
├── .gitignore
├── app.py
├── config.yml
├── docker-compose.yml
├── Dockerfile
├── README.md
├── requirements-dev.txt
├── requirements.txt
└── run.sh