A powerful AI-driven tool that analyzes financial datasets and delivers clear, concise insights in everyday language. This chatbot simplifies complex financial ratios and statements, making them accessible to users of all backgrounds.
The Financial Analysis Chatbot is a capstone project designed to bridge the gap between complex financial data and user comprehension. It ingests financial reports (PDF, text, CSV), processes them using modern AI techniques, and responds to user queries with easy-to-understand explanations and relevant citations.
- Simplified Insights: Translate intricate financial ratios and metrics into layman terms.
- Interactive Chat Interface: Offer a conversational UI for users to ask questions about uploaded financial documents.
- Robust Backend: Leverage Retrieval-Augmented Generation (RAG) for precise, context-aware answers.
- Scalability & Flexibility: Support multiple language models and vector databases for future enhancements.
- Python: Core programming language for backend logic and data processing.
- Streamlit: Builds the interactive web interface for document upload and chat.
- LangChain: Manages language model interactions and RAG workflows.
- HuggingFace Transformers: Hosts and serves models like Falcon 7B Instruct and Mistral 7B.
- FAISS: Provides fast, local vector storage for embeddings.
- all-MiniLM-L6-v2: Embeddings model for chunk-level semantic search.
- PyPDF2: Extracts text from PDF documents asynchronously.
- asyncio: Handles asynchronous file processing for improved performance.
Additional Support
- Pinecone / ChromaDB: Optional cloud vector databases for production-scale deployments.
- Other Models: Easily swap in alternative LLMs (e.g., Mistral) for specialized use cases.
- Upload & Extract: Users upload files; text is extracted page-by-page or line-by-line.
- Chunk & Embed: Extracted text is split into logical chunks; embeddings are generated.
- Store & Retrieve: Embeddings are indexed in FAISS (or an alternative DB) for similarity search.
- Generate & Cite: On query, relevant chunks are retrieved and passed to the LLM for answer generation. Sources are tagged via metadata.
-
Clone the repository
git clone https://github.com/yourusername/financial-analysis-chatbot.git cd financial-analysis-chatbot -
Create & activate a virtual environment
python3 -m venv venv source venv/bin/activate # on Windows: venv\\Scripts\\activate
-
Install dependencies
pip install -r requirements.txt
-
Run the app
streamlit run app.py
- Open your browser at
http://localhost:8501.
- Open your browser at
- Upload Documents: Use the sidebar to upload PDF, text, or CSV files containing financial data.
- Initialize Chatbot: Click Create Chatbot to process uploads and build the vector store.
- Ask Questions: Enter financial queries (e.g., "What is the profit margin?") and receive explanations with sources.
This project is licensed under the MIT License. See the LICENSE file for details.
- LangChain
- Hugging Face Transformers
- FAISS
- Streamlit community and contributors
Created with ❤️ by Ishita Godani