Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Forage

BCG

BCG x Forage Financial Chatbot Project

License: MIT

This repository contains my Forage project submission, split into two parts:

  • Task 1: EDGAR data analysis in Jupyter Notebook
  • Task 2: FastAPI-based financial chatbot using predefined query-response mapping

Certificate

What This Project Contains

  • Task 1/:
    • Financial analysis notebook
    • Raw extracted data files (CSV/XLSX)
  • Task 2/:
    • Chatbot API code
    • Query-response JSON file
    • Tests
    • Documentation and test results
  • requirements.txt:
    • Python dependencies for running and testing

Task 1 (Data Analysis)

Task 1 is the financial data analysis part of the project. It analyzes EDGAR extracted data for selected companies and summarizes key financial metrics and trends.

Task 2 (Chatbot API)

Task 2 is the implementation part where the predefined financial Q&A chatbot is built. The chatbot reads supported queries from JSON and returns mapped responses through an API.

How To Run main.py (Step by Step)

  1. Create and activate a virtual environment:
python -m venv .venv

Windows PowerShell:

.venv\Scripts\Activate.ps1
  1. Install dependencies:
pip install -r requirements.txt
  1. Run the FastAPI app:
uvicorn "Task 2.main:app" --reload
  1. Open in browser:
  • Swagger docs: http://127.0.0.1:8000/docs
  • Health check: http://127.0.0.1:8000/test

How To Test The Chatbot

Run automated tests:

python -m pytest "Task 2/tests/test_main.py" -q

Example Chat Request

POST /chat with JSON body:

{
  "message": "what is the total revenue in 2025 (all companies combined)?"
}

Example response:

{
  "response": "Total revenue in 2025 is $792,712,000,000."
}

License

This project is licensed under the MIT License.

About

Rule-based financial chatbot built with FastAPI using EDGAR-based Task 1 analysis, with predefined query-response mapping, tests, and documentation for the BCG Forage simulation.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages